PageSourceSearch

https://baskadia.com/_next/static/chunks/pages/auth/upload/image/page-b9a1529afcb3662b.js

js baskadia.com collected 2026-10-01 10:34:33 UTC 15,365 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{9797:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/upload/image/page",function(){return n(36669)}])},34118:function(e,t,n){"use strict";var o=n(85893),r=n(67294),i=n(11163),a=n(60253),u=n(79912),l=n(22318),s=n(98530),c=n(13048),d=n(57308);t.Z=function(e){var t,n=e.content,v=(0,c.Z)(n.ID?s.Z.getPublicContent({id:n.ID}):null).data,p=(0,i.useRouter)(),f=p.defaultLocale,h=p.locale,g=(0,a.$G)().t,y=null===(t=n.Pages)||void 0===t?void 0:t[0],b=null===v||void 0===v?void 0:v.Pages,D=n.Published&&!(null===y||void 0===y?void 0:y.Unpublished),E=r.useMemo((function(){if(!n.ID)return"";var e="/post/".concat(n.ID.toString(36));return((null===b||void 0===b?void 0:b.length)||0)>1&&(null===y||void 0===y?void 0:y.ID)&&(e+="/page/".concat(y.ID)),e}),[n.ID,null===y||void 0===y?void 0:y.ID,null===b||void 0===b?void 0:b.length]),I=r.useMemo((function(){var e="https://baskadia.com";return h&&h!==f&&(e+="/".concat(h)),e+=E}),[f,E,h]),m=r.useMemo((function(){return n.Published?g("this-page-is-unpublished"):g("this-post-is-unpublished")}),[n.Published,g]);return(0,o.jsxs)(u.Z,{children:[(0,o.jsx)(l.Z,{variant:"body1",style:{opacity:.7},children:g("published-url")}),D&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.Z,{variant:"body1",style:{marginTop:"8px",overflowWrap:"break-word"},children:(0,o.jsx)(d.Z,{href:E,textLink:!0,children:I})}),(0,o.jsx)(l.Z,{variant:"caption",style:{opacity:.7},children:g("share-button-is-in-upper-right")})]}),!D&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.Z,{color:"error",variant:"body1",style:{marginTop:"8px",fontWeight:"bold"},children:m}),(0,o.jsx)(l.Z,{variant:"caption",style:{opacity:.7},children:g("publish-button-is-in-upper-right")})]})]})}},94270:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var o=n(85893),r=n(67294),i=n(36802),a=n(13048),u=n(26042),l=n(69396),s=n(41664),c=n.n(s),d=n(97250),v=function(e){var t,n=e.content,i=e.item,a=null===(t=e.pages[i.page-1])||void 0===t?void 0:t.ID,s=r.useMemo((function(){return n.Type&&a?"/auth/upload/".concat(n.Type,"/page?id=").concat(a):""}),[n.Type,a]);return(0,o.jsx)(c(),{href:s,passHref:!0,replace:!0,children:(0,o.jsx)(d.Z,(0,l.Z)((0,u.Z)({},i),{component:"a"}))})},p=function(e){var t=e.content,n=(0,a.Z)(t.ID?"/auth/content/".concat(t.ID):null).data,u=r.useMemo((function(){return(null===n||void 0===n?void 0:n.Pages)?n.Pages.filter((function(e){return!e.Header})):[]}),[null===n||void 0===n?void 0:n.Pages]),l=r.useMemo((function(){for(var e=0;e<u.length;e+=1){var n,o;if(u[e].ID===(null===(n=t.Pages)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.ID))return e+1}}),[t.Pages,u]),s=r.useCallback((function(e){return(0,o.jsx)(v,{content:t,item:e,pages:u})}),[t,u]);return u.length<2?null:(0,o.jsx)(i.Z,{color:"primary",count:u.length,page:l,renderItem:s})}},94118:function(e,t,n){"use strict";var o=n(82670),r=n(26042),i=n(69396),a=n(828),u=n(67294),l=n(11163),s=n(36808),c=n.n(s);t.Z=function(){var e=(0,l.useRouter)().locale,t=(0,a.Z)(u.useState(null),2),n=t[0],s=t[1];return u.useEffect((function(){s(new XMLHttpRequest)}),[]),u.useMemo((function(){return{abort:function(){var e;null===n||void 0===n||null===(e=n.abort)||void 0===e||e.call(n)},send:function(t,u){if(null===n)return new Promise((function(e){return e(null)}));var l="".concat("https://api.baskadia.com").concat(t);n.open(u.method||"GET",l);var s={Accept:"application/json","Accept-Language":e||"en"},d=c().get("auth._token.local");return d&&(s=(0,i.Z)((0,r.Z)({},s),{Authorization:d}),n.withCredentials=!0),Object.entries(s).forEach((function(e){var t=(0,a.Z)(e,2),o=t[0],r=t[1];n.setRequestHeader(o,r)})),u.onAbort&&(n.upload.onabort=u.onAbort),u.onProgress&&(n.upload.onprogress=u.onProgress),new Promise((function(e,t){null!==n?(n.onload=function(n){if((0,o.Z)(n.target,XMLHttpRequest))if(200===n.target.status)try{var r=JSON.parse(n.target.responseText);e(r)}catch(i){e(null)}else t(new Error(n.target.responseText));else t(new Error("event.target must be XMLHttpRequest"))},n.onerror=function(e){(0,o.Z)(e.target,XMLHttpRequest)?t(new Error(e.target.responseText)):t(new Error("event.target must be XMLHttpRequest"))},n.send(u.body)):e(null)}))}}}),[e,n])}},36669:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return k},default:function(){return j}});var o=n(47568),r=n(20414),i=n(85893),a=n(67294),u=n(9008),l=n.n(u),s=n(11163),c=n(33681),d=n(49384),v=n(13048),p=n(828),f=n(60253),h=n(72091),g=n(18463),y=n(79912),b=n(39803),D=n(22318),E=n(61164),I=n(92674),m=n(34118),S=n(38584),Z=n(29077),T=n(60103),_=function(e){var t,n=e.content,u=e.onContentUpdate,l=(0,s.useRouter)(),c=(0,f.$G)().t,v=(0,h.Ds)().enqueueSnackbar,_=(0,I.Z)(),x=(0,p.Z)((0,E.o)(),2),w=x[0],P=w.disabled,C=w.isEdited,k=x[1],j=(0,p.Z)(a.useState(0),2),L=j[0],N=j[1],B=(0,p.Z)(a.useState(""),2),A=B[0],O
1=B[1],U=(0,p.Z)(a.useState(""),2),M=U[0],R=U[1],H=(0,p.Z)(a.useState(""),2),J=H[0],q=H[1],X=(0,p.Z)(a.useState([]),2),F=X[0],W=X[1],G=(0,p.Z)(a.useState(""),2),V=G[0],$=G[1],z=(0,p.Z)(a.useState(!1),2),K=z[0],Q=z[1],Y=(0,p.Z)(a.useState(!1),2),ee=Y[0],te=Y[1],ne=null===n||void 0===n||null===(t=n.Pages)||void 0===t?void 0:t[0],oe=(null===ne||void 0===ne?void 0:ne.Body)||"[]",re=a.useMemo((function(){return JSON.parse(oe)}),[oe]),ie=a.useMemo((function(){if(F.length!==re.length)return!0;for(var e=0;e<F.length;e+=1){if(F[e].path!==re[e].path)return!0;if((F[e].text||"").trim()!==(re[e].text||""))return!0}return!1}),[F,re]),ae=a.useCallback((function(e){var t,n=null===e||void 0===e||null===(t=e.Pages)||void 0===t?void 0:t[0];O((null===n||void 0===n?void 0:n.Title)||""),R((null===n||void 0===n?void 0:n.Description)||""),q((null===e||void 0===e?void 0:e.Img)||""),W(JSON.parse((null===n||void 0===n?void 0:n.Body)||"[]"))}),[]);a.useEffect((function(){(null===ne||void 0===ne?void 0:ne.ID)&&ne.ID!==L&&(N(ne.ID),ae(n),_("/auth/page/".concat(ne.ID)).then((function(e){ae(e)})).catch((function(e){return(0,d.kg)(e)})))}),[n,_,L,null===ne||void 0===ne?void 0:ne.ID,ae]),a.useEffect((function(){A.trim().slice(0,100)===((null===ne||void 0===ne?void 0:ne.Title)||"")?M.trim().slice(0,1e3)===((null===ne||void 0===ne?void 0:ne.Description)||"")&&J===(n.Img||"")?k(ie?{type:"SET_IS_EDITED",payload:!0}:{type:"SET_IS_EDITED",payload:!1}):k({type:"SET_IS_EDITED",payload:!0}):k({type:"SET_IS_EDITED",payload:!0})}),[ie,n.Img,M,k,null===ne||void 0===ne?void 0:ne.Description,null===ne||void 0===ne?void 0:ne.Title,J,A]),a.useEffect((function(){if(V&&!C){var e=V;$(""),l.push(e).catch((function(e){return(0,d.kg)(e)})).finally((function(){k({type:"SET_DISABLED",payload:!1})}))}}),[k,C,V,l]),a.useEffect((function(){var e=function(e){if(C){var t=c("you-have-unsaved-changes");return e.preventDefault(),e.returnValue=t,t}(null===ne||void 0===ne?void 0:ne.ID)&&_("/auth/page/".concat(ne.ID,"/files"),{method:"DELETE"}).catch((function(e){return(0,d.kg)(e)}))};return window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}}),[_,C,null===ne||void 0===ne?void 0:ne.ID,c]),a.useEffect((function(){var e=function(){if(C&&!window.confirm(c("you-have-unsaved-changes")))throw l.events.emit("routeChangeError"),"Route change was cancelled";(null===ne||void 0===ne?void 0:ne.ID)&&_("/auth/page/".concat(ne.ID,"/files"),{method:"DELETE"}).catch((function(e){return(0,d.kg)(e)}))};return l.events.on("routeChangeStart",e),function(){l.events.off("routeChangeStart",e)}}),[_,C,null===ne||void 0===ne?void 0:ne.ID,l.events,c]);var ue=a.useCallback((function(){return Q(!1)}),[]),le=a.useCallback((function(){return te(!1)}),[]),se=a.useCallback((function(){return k({type:"SET_DISABLED",payload:!0})}),[k]),ce=a.useCallback((function(){return k({type:"SET_DISABLED",payload:!1})}),[k]),de=a.useCallback((function(e){return O(e.target.value)}),[]),ve=a.useCallback((function(e){"Enter"===e.key&&e.preventDefault()}),[]),pe=a.useCallback((function(e){return R(e.target.value)}),[]),fe=a.useCallback((function(e){return q(e)}),[]),he=a.useCallback((function(e){return W(e)}),[]),ge=a.useCallback((0,o.Z)((function(){var e,t,o,i,a,l;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!C)return[2];if(!(null===ne||void 0===ne?void 0:ne.ID))throw new Error("page.ID is undefined");return t={},(o=A.trim().slice(0,100))!==((null===ne||void 0===ne?void 0:ne.Title)||"")&&(t.title=o),(i=M.trim().slice(0,1e3))!==((null===ne||void 0===ne?void 0:ne.Description)||"")&&(t.description=i),J!==(n.Img||"")&&(t.img=J),ie&&(t.body=JSON.stringify(F)),[4,_("/auth/page/".concat(ne.ID),{method:"PUT",body:JSON.stringify(t)})];case 1:if(null===(a=r.sent()))throw new Error("newContent is null");return l=null===(e=a.Pages)||void 0===e?void 0:e[0],O((null===l||void 0===l?void 0:l.Title)||""),R((null===l||void 0===l?void 0:l.Description)||""),q(a.Img||""),W(JSON.parse((null===l||void 0===l?void 0:l.Body)||"[]")),u(a),[2]}}))})),[ie,n.Img,M,_,C,F,u,null===ne||void 0===ne?void 0:ne.Description,null===ne||void 0===ne?void 0:ne.ID,null===ne||void 0===ne?void 0:ne.Title,J,A]),ye=a.useCallback((0,o.Z)((function(){var e;return(0,r.__generator)(this,(function(t){switch(t.label){case 0:if(n.Published&&!(null===ne||void 0===ne?void 0:ne.Unpublished)&&!F.length)return v(c("content-is-empty"),{variant:"error"}),[2];k({type:"SET_DISABLED",payload:!0}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,ge()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),(0,d.kg)(e),v(c("failed-to-save-changes"),{variant:"error"}),k({type:"SET_DISABLED",payload:!1}),[2];case 4:return k({type:"SET_DISABLED",payload:!1}),[2]}}))})),[n.Published,k,v,F.length,null===ne||void 0===ne?void 0:ne.Unpublished,ge,c]);a.useEffect((function(){k({type:"SET_ON_SAVE",payload:ye})}),[k,ye]);var be=a.useCallback((0,o.Z)((function(){var e;return(0,r.__generator)(this,(function(t){switch(t.label){case 0:if(!F.length)return v(c("content-is-empty"),{variant:"error"}),[2];k({type:"SET_DISABLED",payload:!0}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,ge()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),(0,d.kg)(e),v(c("failed-to-save-changes"),{variant:"error"}),k({type:"SET_DISABLED",payload:!1}),[2];
1case 4:try{if(!n.Type)throw new Error("content.Type is undefined");return(n.PrevPageID||n.NextPageID)&&(null===ne||void 0===ne?void 0:ne.ID)?$("/auth/upload/".concat(n.Type,"/preview/page?id=").concat(ne.ID)):n.ID&&$("/auth/upload/".concat(n.Type,"/preview?id=").concat(n.ID)),[2]}catch(o){(0,d.kg)(o)}return k({type:"SET_DISABLED",payload:!1}),[2]}}))})),[n.ID,n.NextPageID,n.PrevPageID,n.Type,k,v,F.length,null===ne||void 0===ne?void 0:ne.ID,ge,c]);a.useEffect((function(){k({type:"SET_ON_PREVIEW",payload:be})}),[k,be]);var De=a.useCallback((0,o.Z)((function(){var e,t,o,i,a,l,s,p;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!F.length)return v(c("content-is-empty"),{variant:"error"}),[2];k({type:"SET_DISABLED",payload:!0}),r.label=1;case 1:if(r.trys.push([1,4,,5]),!(null===ne||void 0===ne?void 0:ne.ID))throw new Error("page.ID is undefined");return e={},t=!1,(null===ne||void 0===ne?void 0:ne.Unpublished)&&(e.unpublished=!1,t=!0),(o=A.trim().slice(0,100))!==((null===ne||void 0===ne?void 0:ne.Title)||"")&&(e.title=o,t=!0),(i=M.trim().slice(0,1e3))!==((null===ne||void 0===ne?void 0:ne.Description)||"")&&(e.description=i,t=!0),J!==(n.Img||"")&&(e.img=J,t=!0),ie&&(e.body=JSON.stringify(F),t=!0),t?[4,_("/auth/page/".concat(ne.ID),{method:"PUT",body:JSON.stringify(e)})]:[3,3];case 2:if(null===(l=r.sent()))throw new Error("newContent is null");s=null===(a=l.Pages)||void 0===a?void 0:a[0],O((null===s||void 0===s?void 0:s.Title)||""),R((null===s||void 0===s?void 0:s.Description)||""),W(JSON.parse((null===s||void 0===s?void 0:s.Body)||"[]")),u(l),r.label=3;case 3:return[3,5];case 4:return p=r.sent(),(0,d.kg)(p),v(n.Published?c("failed-to-publish-page"):c("failed-to-publish-post"),{variant:"error"}),k({type:"SET_DISABLED",payload:!1}),[2];case 5:return k({type:"SET_DISABLED",payload:!1}),n.Published?te(!0):Q(!0),[2]}}))})),[ie,n.Img,n.Published,M,k,v,_,F,u,null===ne||void 0===ne?void 0:ne.Description,null===ne||void 0===ne?void 0:ne.ID,null===ne||void 0===ne?void 0:ne.Title,null===ne||void 0===ne?void 0:ne.Unpublished,c,J,A]);return a.useEffect((function(){k({type:"SET_ON_PUBLISH",payload:De})}),[k,De]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(g.Z,{children:[(0,i.jsx)(m.Z,{content:n}),(0,i.jsxs)(y.Z,{children:[(0,i.jsx)(b.Z,{value:A,label:c("page-title"),error:A.length>100,autoComplete:"off",disabled:P,fullWidth:!0,multiline:!0,type:"text",variant:"outlined",onChange:de,onKeyPress:ve}),(0,i.jsx)(D.Z,{align:"right",color:A.length>100?"error":"inherit",display:"block",variant:"caption",children:"".concat(A.length," / 100")}),(0,i.jsx)(b.Z,{value:M,label:c("page-summary-optional"),error:M.length>1e3,autoComplete:"off",disabled:P,fullWidth:!0,multiline:!0,type:"text",variant:"outlined",style:{marginTop:"8px"},onChange:pe}),(0,i.jsx)(D.Z,{align:"right",color:M.length>1e3?"error":"inherit",display:"block",variant:"caption",children:"".concat(M.length," / 1000")})]}),(0,i.jsx)(T.Z,{items:F,disabled:P,page:ne,thumbnail:J,onDisable:se,onEnable:ce,onItemsUpdate:he,onThumbnailUpdate:fe})]}),(0,i.jsx)(Z.Z,{content:n,disabled:P,open:K,onClose:ue,onDisable:se,onEnable:ce,onContentUpdate:u}),(0,i.jsx)(S.Z,{content:n,open:ee,onClose:le})]})},x=n(62284),w=n(86263),P=n(73844),C=n(94270),k=!0,j=function(){var e=(0,s.useRouter)().query,t="string"===typeof e.id?e.id:"",n=(0,v.Z)(t?"/auth/page/".concat(t):null),u=n.data,p=n.mutate,f=a.useCallback(function(){var e=(0,o.Z)((function(e){var t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,p(e,!1)];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),(0,d.kg)(t),[3,3];case 3:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),[p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"Baskadia"})}),!u&&(0,i.jsx)(c.Z,{}),u&&(0,i.jsx)(x.Z,{component:"main",style:{margin:"16px auto"},children:(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(P.Z,{children:(0,i.jsx)(_,{content:u,onContentUpdate:f})}),(0,i.jsx)(P.Z,{children:(0,i.jsx)(C.Z,{content:u})})]})})]})}},98530:function(e,t){"use strict";t.Z={getPublicUsers:function(e){var t=e.offset,n=e.auth,o="/user?offset=".concat(t);return(null===n||void 0===n?void 0:n.ID)&&(o+="&user=".concat(n.ID)),o},getPublicUser:function(e){var t=e.id,n=e.auth,o="/user/".concat(t);return n&&(o+="?auth=true"),o},getPublicContents:function(e){var t=e.type,n=e.sortBy,o=e.offset,r=e.lang,i="/content?type=".concat(t,"&date=any&sort_by=").concat(n,"&offset=").concat(o);return r&&(i+="&lang=".concat(r)),i},getPublicContent:function(e){var t=e.id,n=e.auth,o="/content/".concat(t);return n&&(o+="?auth=true"),o},getContentsFromContent:function(e){var t=e.id,n=e.offset;return"/content/".concat(t,"/content?offset=").concat(n)},getCommentsFromContent:function(e){var t=e.contentId,n=e.lastId,o=e.auth,r="/content/".concat(t,"/comment?last_id=").concat(n);return o&&(r+="&auth=true"),r},getTags:function(e){var t=e.offset,n=e.lang,o="/tag?offset=".concat(t);return n&&(o+="&lang=".concat(n)),o}}}},function(e){e.O(0,[630,3576,868,3138,2387,4794,9803,3322,3518,5992,3934,1427,6801,8477,103,9774,2888,179],(function(){return t=9797,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.