PageSourceSearch

https://www.investors.puuilo.fi/_next/static/chunks/pages/_admin/organization-cbb20514f1e02a8f.js

js puuilo.fi collected 2026-09-25 22:55:55 UTC 44,424 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[748],{20420:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_admin/organization",function(){return t(63108)}])},20256:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(34727),r=t(70655),a=t(85893),s=t(66083),o=t(29525),l=t(39803),c=t(41749),d=t(282),u=t(66856),h=t(31567),g=t(67294),p=t(41664),f=t.n(p),x=t(87066),v=t(52663),m=t(64436),j=t(85161),Z=t(24951),y=t(85639),b=function(){var e=(0,h.$)().i18n;return(0,a.jsxs)(m.Z,{children:[(0,a.jsx)(j.Z,{id:"admin-language-select",children:"Locale"}),(0,a.jsxs)(Z.Z,{labelId:"admin-language-select",value:e.language,label:"Ag",onChange:function(n){e.changeLanguage(n.target.value)},children:[(0,a.jsx)(y.Z,{value:"en-US",children:"English"}),(0,a.jsx)(y.Z,{value:"fi-FI",children:"Suomi"})]})]})},w=function(){var e=(0,g.useState)(""),n=e[0],t=e[1],p=(0,g.useState)(""),m=p[0],j=p[1],Z=(0,g.useState)(!1),y=Z[0],w=Z[1],_=(0,h.$)("admin",{keyPrefix:"login"}).t,k=function(){var e=(0,i.Z)((function(){return(0,r.__generator)(this,(function(e){switch(e.label){case 0:return[4,x.Z.post("/backend/credentials/validate",{email:n,password:m}).then((function(e){var n=e.data;document.cookie="Bearer=".concat(n,"; max-age=").concat(43200,"; path=/;"),window.location.href="/"})).catch((function(e){console.error(e),w(!0)}))];case 1:return e.sent(),[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(v.Z,{className:"Login",open:!0,maxWidth:"xs",fullWidth:!0,children:[(0,a.jsx)(s.Z,{children:_("title")}),(0,a.jsxs)(o.Z,{children:[(0,a.jsxs)("form",{children:[(0,a.jsx)(l.Z,{autoComplete:"username",onChange:function(e){t(e.target.value)},label:_("labelEmail"),fullWidth:!0}),(0,a.jsx)(l.Z,{autoComplete:"current-password",onChange:function(e){j(e.target.value)},label:_("labelPassword"),type:"password",fullWidth:!0})]}),(0,a.jsxs)(c.Z,{container:!0,justifyContent:"space-between",children:[(0,a.jsx)("small",{children:(0,a.jsx)(f(),{href:"/_admin/forgot-password",passHref:!0,children:(0,a.jsx)(d.Z,{component:"a",children:_("forgotPassword")})})}),(0,a.jsx)(b,{})]})]}),(0,a.jsxs)(u.Z,{children:[(0,a.jsx)(d.Z,{onClick:function(){return window.location.href="/"},children:_("home")}),(0,a.jsx)(d.Z,{id:"signin-button",onClick:k,children:_("login")})]})]}),(0,a.jsxs)(v.Z,{open:y,onClose:function(){return w(!1)},children:[(0,a.jsx)(s.Z,{children:_("error")}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(d.Z,{onClick:function(){return w(!1)},children:_("tryAgain")})})]})]})}},63108:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Fe}});var i,r=t(34727),a=t(67573),s=t(14251),o=t(52875),l=t(69779),c=t(70655),d=t(85893),u=t(64436),h=t(53537),g=t(36939),p=t(61201),f=t(50743),x=t(21783),v=t(39803),m=t(51617),j=t(87066),Z=t(55571),y=t(20256),b=t(17812),w=t(67294),_=t(96486),k=t.n(_),C=t(40705),S=t.n(C),N=function(e){var n=e.allLinks,t=e.currentLinks,i=e.menuLevel,r=e.updateLinks,a=e.pathToLinks,s=e.lang,o=(0,w.useState)(),c=o[0],u=o[1],h=(0,w.useState)(),g=h[0],p=h[1],f=(0,w.useState)(0),x=f[0],j=f[1],Z=(0,w.useState)("Upwards"),y=Z[0],_=Z[1],C=function(e,t){var i=e.target,o=i.value,l=i.name,c="".concat(a,"[").concat(t,"][").concat(l,"]");k().set(n,c,o),r(n,s)},z=function(e){u(e.currentTarget.id)},O=function(e){if(c){var i=t.findIndex((function(e,n){return S()({link:e,index:n})===c})),o=t.findIndex((function(n,t){return S()({link:n,index:t})===e.currentTarget.id})),l=""===a?n:k().get(n,a)||[],d=I(l,i,o);""===a?r(d,s):(k().set(n,a,d),r(n,s))}p(void 0)};return(0,d.jsxs)("div",{className:"NavigationEditorLinks",children:[""===a&&(0,d.jsx)(b.Z,{size:"small",onClick:function(){return r([{url:"/",title:""}].concat((0,l.Z)(n)),s)},children:(0,d.jsx)(m.ag,{fontSize:"small"})}),t.map((function(e,o){return(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"NavigationEditorLinks__Link ".concat(g===S()({link:e,index:o})?"NavigationEditorLinks__Link--dragOver".concat(y):""),id:S()({link:e,index:o}),draggable:!0,onDragOver:function(e){c&&p(e.currentTarget.id);var n=x-e.pageY;Math.abs(n)>2&&(_(n>0?"Upwards":"Downwards"),j(e.pageY)),e.preventDefault()},onDragStart:z,onDragEnd:function(){p(void 0),u(void 0)},onDrop:O,style:{marginLeft:40*i},children:(0,d.jsxs)("div",{className:"NavigationEditorLinks__Link__Inputs",children:[(0,d.jsx)(m.VV,{className:"NavigationEditorLinks__Link__Inputs__Handle"}),(0,d.jsx)(v.Z,{size:"small",value:(null===e||void 0===e?void 0:e.title)||"",name:"title",placeholder:"Nimi",onChange:function(e){return C(e,o)}}),(0,d.jsx)(v.Z,{size:"small",value:(null===e||void 0===e?void 0:e.url)||"",name:"url",placeholder:"Url",onCh
1ange:function(e){return C(e,o)}}),(0,d.jsx)(b.Z,{size:"small",onClick:function(){return function(e){var i,o="".concat(a,"[").concat(e,"].links"),c=k().get(n,o)||[],d=(0,l.Z)(c).concat([{title:"link".concat((null===c||void 0===c?void 0:c.length)||0),url:"".concat((null===t||void 0===t||null===(i=t[e])||void 0===i?void 0:i.url)||"","/")}]);k().set(n,o,d),r(n,s)}(o)},children:(0,d.jsx)(m.ag,{fontSize:"small"})}),(0,d.jsx)(b.Z,{color:"secondary",size:"small",onClick:function(){return function(e){var i=t.filter((function(n,t){return t!==e}));""===a?r(i,s):(k().set(n,a,0===i.length?void 0:i),r(n,s))}(o)},children:(0,d.jsx)(m.qC,{fontSize:"small"})})]})}),(null===e||void 0===e?void 0:e.links)&&(0,d.jsx)(N,{allLinks:n,currentLinks:e.links,menuLevel:i+1,updateLinks:r,pathToLinks:a+"[".concat(o,"].links"),lang:s})]},o)}))]})},I=function(e,n,t){var i=(0,l.Z)(e),r=i.splice(n,1)[0];return i.splice(t,0,r),i},z=function(e){var n,t,i,r,a,s=e.organization,o=e.updateLinks,l=null===(r=null===(i=null===s||void 0===s||null===(n=s.siteTemplate)||void 0===n||null===(t=n.componentsBeforeContent)||void 0===t?void 0:t.find((function(e){return"Header"===e.type||"HighlightedHeader"===e.type||"StickyHeader"===e.type})))||void 0===i?void 0:i.props)||void 0===r?void 0:r.links,c=null===(a=s.availableLangs)||void 0===a?void 0:a.map((function(e){var n,t,i,r,a,o;return{links:(null===(o=null===(a=null===s||void 0===s||null===(n=s.translations)||void 0===n||null===(t=n[e])||void 0===t||null===(i=t.siteTemplate)||void 0===i||null===(r=i.componentsBeforeContent)||void 0===r?void 0:r.find((function(e){return"Header"===e.type||"HighlightedHeader"===e.type||"StickyHeader"===e.type})))||void 0===a?void 0:a.props)||void 0===o?void 0:o.links)||[],lang:e}}));return(0,d.jsxs)("div",{className:"NavigationEditor",children:[l&&(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{children:s.defaultLang.toUpperCase()}),(0,d.jsx)(p.Z,{children:(0,d.jsx)(N,{allLinks:l,currentLinks:l,menuLevel:0,updateLinks:o,pathToLinks:"",lang:s.defaultLang})})]}),null===c||void 0===c?void 0:c.map((function(e,n){var t=e.links,i=e.lang;return(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{children:i.toUpperCase()}),(0,d.jsx)(p.Z,{children:(0,d.jsx)(N,{allLinks:t,currentLinks:t,menuLevel:0,updateLinks:o,pathToLinks:"",lang:i})})]},n)}))]})},O=t(41749),D=t(18463),E=t(79912),F=t(16204),L=t(282),T=t(30553),B=t(9570),A=t(22318),P=t(26605),W=t(25437),H=function(e){var n,t=e.organization,i=e.publications,r=e.parsePublicationsTags,a=e.addNewsFeedOptions,s=e.deleteTag,o=e.deleteNewsFeedOption,l=e.updateNewsFeedOptions,c=(0,w.useState)(!1),u=c[0],h=c[1];(0,w.useEffect)((function(){r()}),[JSON.stringify(t.newsFeedOptions),JSON.stringify(i)]);var x=null===(n=t.newsFeedOptions)||void 0===n?void 0:n.map((function(e){return{distributor:e.distributor,categorizationOptions:e.categorizationOptions}}));return(0,d.jsxs)("div",{className:"NewsFeedOptionEditor",children:[x&&x.map((function(e,n){var t;return(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{children:e.distributor}),(0,d.jsx)(p.Z,{children:(0,d.jsx)(O.Z,{container:!0,spacing:3,children:null===(t=e.categorizationOptions)||void 0===t?void 0:t.map((function(n,t){var i,r;return(0,d.jsx)(O.Z,{item:!0,xs:6,children:(0,d.jsx)(D.Z,{children:(0,d.jsxs)(E.Z,{children:[null===(i=n.langs)||void 0===i?void 0:i.map((function(e,n){return e&&(0,d.jsx)(W.Z,{className:"NewsFeedOptionEditor__Lang",small:!0,children:e},1e3*(n+1))})),n.reverse&&(0,d.jsx)(W.Z,{small:!0,children:"reversed"},1e3*(t+1)),(0,d.jsx)(v.Z,{onChange:function(n){return l(e.distributor,t,"includes",n.target.value)},label:"includes",value:n.includes}),n.isExactly&&(0,d.jsx)(v.Z,{disabled:!0,label:"isExactly",value:JSON.stringify(n.isExactly)}),(0,d.jsx)(v.Z,{onChange:function(n){return l(e.distributor,t,"field",n.target.value)},label:"field",value:n.field}),null===(r=n.tags)||void 0===r?void 0:r.map((function(n,i){return n&&(0,d.jsx)(F.Z,{label:n,variant:"outlined",onDelete:s?function(){return s(e.distributor,t,n)}:void 0},1e3*(i+1))})),(0,d.jsx)("br",{}),(0,d.jsx)(L.Z,{className:"NewsFeedOptionEditor__DeleteNewsFeedOption",startIcon:(0,d.jsx)(m.pJ,{}),onClick:o?function(){return o(e.distributor,t)}:void 0,children:"Poista"})]})})},t)}))})})]},n)})),(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{children:"Lis\xe4\xe4 uusi"}),(0,d.jsx)(p.Z,{children:(0,d.jsx)(O.Z,{container:!0,spacing:3,children:(0,d.jsx)(O.Z,{item:!0,xs:12,children:(0,d.jsxs)("form",{onSubmit:a,children:[(0,d.jsx)(v.Z,{name:"distributor",label:"distributor"}),(0,d.jsx)(v.Z,{name:"field",label:"field"}),(0,d.jsx)(v.Z,{name:"includes",label:"includes"}),(0,d.jsx)(v.Z,{name:"tags",label:"tags"}),(0,d.jsx)(v.Z,{name:"langs",label:"langs"}),(0,d.jsx)(T.Z,{control:(0,d.jsx)(B.Z,{checked:u,onChange:function(e){h(e.target.checked)},name:"reverse"}),label:"reverse",className:"NewsFeedOptionEditor__Reverse"}),(0,d.jsx)(L.Z,{variant:"outlined",color:"primary",type:"submit",children:"Lis\xe4\xe4"})]})})})})]}
1),(0,d.jsx)(A.Z,{className:"NewsFeedOptionEditor__PublicationsHeader",variant:"h5",children:"Julkaisut"}),(0,d.jsx)(O.Z,{container:!0,spacing:3,children:i.map((function(e,n){var i,r;return(0,d.jsx)(O.Z,{item:!0,xs:12,sm:6,children:(0,d.jsx)(D.Z,{children:(0,d.jsxs)(E.Z,{children:[(0,d.jsxs)(A.Z,{variant:"h6",children:[e.title,(0,d.jsx)(P.ZP,{title:(0,d.jsxs)("div",{children:["Published at"," ",new Date(e.publishedAt).toLocaleString("fi"),(0,d.jsx)("br",{}),"content (preview):"," ",e.content&&(null===(i=e.content)||void 0===i?void 0:i.substring(0,300))+"...",(0,d.jsx)("br",{}),"category: ",e._rawData.category,(0,d.jsx)("br",{}),"title: ",e._rawData.title,(0,d.jsx)("br",{}),"video_title: ",e._rawData.video_title]}),children:(0,d.jsx)(m.sz,{fontSize:"small"})},1e3*(n+1))]}),(0,d.jsxs)(A.Z,{variant:"overline",gutterBottom:!0,children:[(0,d.jsx)("b",{children:e.distributor})," | ",e.lang||t.defaultLang]}),(0,d.jsx)("div",{children:null===(r=e.tags)||void 0===r?void 0:r.map((function(e,n){return e&&(0,d.jsx)(W.Z,{small:!0,children:e},1e3*(n+1))}))})]})})},n)}))})]})},M=t(9941),U=t(69685),R=t(58108),J=t(90760),$=t(55302),G=t(85161),q=t(24951),V=t(85639),X=t(41423),K=t(15046),Y=t(78207),Q=t(62636),ee=t(64532),ne=t(43369),te=t(20640),ie=t.n(te),re=t(53999),ae=t(32512),se=t(45509);!function(e){e.ASC="asc",e.DESC="desc"}(i||(i={}));var oe,le=function(e){var n=e.files,t=e.getFiles,a=(0,w.useState)(!1),l=a[0],h=a[1],g=(0,M.Z)(w.useState(!1),2),p=g[0],f=g[1],x=(0,M.Z)(w.useState("1"),2),v=x[0],Z=x[1],y=(0,M.Z)(w.useState("updatedAt"),2),_=y[0],C=y[1],S=(0,M.Z)(w.useState(i.DESC),2),N=S[0],I=S[1];(0,w.useEffect)((function(){n.map((function(e){var n,t;e.name=null===(n=k().last(e.src.split("/")))||void 0===n?void 0:n.toUpperCase(),e.fileExtension=null===(t=k().last(e.src.split(".")))||void 0===t?void 0:t.toUpperCase()}))}),[n]);var z=function(){var e=(0,r.Z)((function(e){var n;return(0,c.__generator)(this,(function(i){switch(i.label){case 0:return[4,O(e)];case 1:return n=i.sent(),h(!0),j.Z.post("/backend/files",n).then((function(){t()})).finally((function(){h(!1)})),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),O=function(){var e=(0,r.Z)((function(e){var n,t,i,r,a,s;return(0,c.__generator)(this,(function(o){switch(o.label){case 0:n=["image/jpeg","image/png","image/webp"],t=new FormData,i=0,o.label=1;case 1:return i<e.length?(t.append(re.Tv.IMAGE,e[i]),n.includes(e[i].type)?(r="JPEG",e[i].type.includes("image/png")?r="PNG":e[i].type.includes("image/webp")&&(r="WEBP"),[4,(0,se.Zp)(e[i],2e3,2e3,r,80,0,"blob")]):[3,3]):[3,4];case 2:(a=o.sent())&&(s=e[i].name.replace(/(\.[\w\d_-]+)$/i,"-optimized$1"),t.append(re.Tv.IMAGE,a,s)),o.label=3;case 3:return i++,[3,1];case 4:return[2,t]}}))}));return function(n){return e.apply(this,arguments)}}(),D=function(e){ie()(encodeURI(e)),f(!0)},E=function(){f(!1)},L=function(e,n,i){return(0,d.jsx)(U.Z,{className:"ImageBrowser__ImageList",children:k().orderBy(e,_,N).filter((function(e){return e.type===re.Tv.IMAGE&&e.name&&(i?e.src.includes("optimized"):!e.src.includes("optimized"))})).map((function(e){return(0,d.jsxs)(R.Z,{children:[(0,d.jsx)("img",{src:"".concat(e.src,"?w=180&h=180&fit=crop&auto=format"),alt:e.alt,loading:"lazy"}),(0,d.jsx)(J.Z,{title:e.name,className:"ImageBrowser__ImageList__TitleBar",position:"top"}),(0,d.jsx)(J.Z,{subtitle:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.Z,{size:"small",label:e.updatedAt&&new Date(e.updatedAt).toLocaleString()}),(0,d.jsx)(F.Z,{size:"small",label:e.size&&(e.size.valueOf()/1e6).toFixed(2)+" MB"})]}),actionIcon:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(b.Z,{"aria-label":"copy",onClick:function(){return n(e.src)},children:(0,d.jsx)(m.t$,{className:"ImageBrowser__ImageList__CopyIcon"})}),(0,d.jsx)(b.Z,{"aria-label":"delete",onClick:function(){return function(e){h(!0),j.Z.post("/backend/move-files",{destinationFolder:"_deletedFiles",useOrganizationInFolder:!0,fileprops:[e]}).then((function(){t()})).finally((function(){h(!1)}))}(e)},children:(0,d.jsx)(m.pJ,{className:"ImageBrowser__ImageList__DeleteIcon"})})]}),position:"bottom"})]},e.src)}))})};return(0,d.jsxs)("div",{className:"ImageBrowser",children:[l&&(0,d.jsx)(ne.default,{}),(0,d.jsx)(ae.ZP,{onDrop:z,children:function(e){var n=e.getRootProps,t=e.getInputProps;return(0,d.jsxs)("div",(0,o.Z)((0,s.Z)({},n({className:"dropzone"})),{children:[(0,d.jsx)("input",(0,s.Z)({},t())),(0,d.jsx)("p",{children:"Pudota tiedosto tai klikkaa"})]}))}}),(0,d.jsx)($.Z,{open:p,autoHideDuration:3e3,onClose:E,children:(0,d.jsx)(K.Z,{onClose:E,severity:"success",children:"Kopiointi onnistui"})}
1),(0,d.jsxs)(u.Z,{children:[(0,d.jsx)(G.Z,{id:"sort-images-label",children:"Lajittele"}),(0,d.jsxs)(q.Z,{labelId:"sort-images-label",className:"ImageBrowser__Sort",value:_,label:"Lajittele",onChange:function(e){var n=e.target.value;I("updatedAt"===n?i.DESC:i.ASC),C(n)},children:[(0,d.jsx)(V.Z,{value:"updatedAt",children:"Uusimmat"}),(0,d.jsx)(V.Z,{value:"name",children:"Nimi"}),(0,d.jsx)(V.Z,{value:"fileExtension",children:"Tiedostop\xe4\xe4te"})]})]}),(0,d.jsxs)(Y.ZP,{value:v,children:[(0,d.jsxs)(Q.Z,{onChange:function(e,n){Z(n)},children:[(0,d.jsx)(X.Z,{label:"Optimoidut",value:"1"}),(0,d.jsx)(X.Z,{label:"Alkuper\xe4iset",value:"2"})]}),(0,d.jsx)(ee.Z,{value:"1",className:"ImageBrowser__TabPanel",children:L(n,D,!0)}),(0,d.jsx)(ee.Z,{value:"2",className:"ImageBrowser__TabPanel",children:L(n,D)})]})]})},ce=t(62822),de=t(50998),ue=t(95757),he=t(31567);!function(e){e.ASC="asc",e.DESC="desc"}(oe||(oe={}));var ge=function(e){var n=e.files,t=e.getFiles,i=(0,w.useState)(!1),a=i[0],l=i[1],h=(0,M.Z)(w.useState(!1),2),g=h[0],p=h[1],f=(0,M.Z)(w.useState("updatedAt"),2),x=f[0],v=f[1],Z=(0,M.Z)(w.useState(oe.DESC),2),y=Z[0],_=Z[1],C=(0,he.$)().t;(0,w.useEffect)((function(){n.map((function(e){var n,t;e.name=null===(n=k().last(e.src.split("/")))||void 0===n?void 0:n.toUpperCase(),e.fileExtension=null===(t=k().last(e.src.split(".")))||void 0===t?void 0:t.toUpperCase()}))}),[n]);var S=function(){var e=(0,r.Z)((function(e){var n;return(0,c.__generator)(this,(function(i){return n=new FormData,e.forEach((function(e){n.append(re.Tv.DOCUMENT,e)})),l(!0),j.Z.post("/backend/files",n).then((function(){t()})).finally((function(){l(!1)})),[2]}))}));return function(n){return e.apply(this,arguments)}}(),N=function(){p(!1)};return(0,d.jsxs)("div",{className:"DocumentBrowser",children:[a&&(0,d.jsx)(ne.default,{}),(0,d.jsx)(ae.ZP,{onDrop:S,children:function(e){var n=e.getRootProps,t=e.getInputProps;return(0,d.jsxs)("div",(0,o.Z)((0,s.Z)({},n({className:"dropzone"})),{children:[(0,d.jsx)("input",(0,s.Z)({},t())),(0,d.jsx)("p",{children:C("documentBrowser.text.dropZone")})]}))}}),(0,d.jsx)($.Z,{open:g,autoHideDuration:3e3,onClose:N,children:(0,d.jsx)(K.Z,{onClose:N,severity:"success",children:C("documentBrowser.alert.copySuccess")})}),(0,d.jsxs)(u.Z,{children:[(0,d.jsx)(G.Z,{id:"sort-documents-label",children:C("documentBrowser.label.sort")}),(0,d.jsxs)(q.Z,{labelId:"sort-documents-label",className:"DocumentBrowser__Sort",value:x,label:C("documentBrowser.label.sort"),onChange:function(e){var n=e.target.value;_("updatedAt"===n?oe.DESC:oe.ASC),v(n)},children:[(0,d.jsx)(V.Z,{value:"updatedAt",children:C("documentBrowser.sortMenuItem.updatedAt")}),(0,d.jsx)(V.Z,{value:"name",children:C("documentBrowser.sortMenuItem.name")}),(0,d.jsx)(V.Z,{value:"fileExtension",children:C("documentBrowser.sortMenuItem.fileExtension")})]})]}),(0,d.jsx)(ce.Z,{className:"DocumentBrowser__DocumentList",dense:!0,children:k().orderBy(n,x,y).filter((function(e){return e.type===re.Tv.DOCUMENT&&e.name})).map((function(e){return(0,d.jsx)(de.Z,{className:"DocumentBrowser__DocumentList__ListItem",children:(0,d.jsx)(ue.Z,{primary:e.name,secondary:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(F.Z,{component:"span",size:"small",label:e.updatedAt&&new Date(e.updatedAt).toLocaleString()}),(0,d.jsx)(F.Z,{component:"span",size:"small",label:e.size&&(e.size.valueOf()/1e6).toFixed(2)+" MB"}),(0,d.jsx)(b.Z,{"aria-label":"copy",onClick:function(){return n=e.src,ie()(encodeURI(n)),void p(!0);var n},children:(0,d.jsx)(m.t$,{className:"DocumentBrowser__DocumentList__CopyIcon"})}),(0,d.jsx)(b.Z,{"aria-label":"delete",onClick:function(){return function(e){l(!0),j.Z.post("/backend/move-files",{destinationFolder:"_deletedFiles",useOrganizationInFolder:!0,fileprops:[e]}).then((function(){t()})).finally((function(){l(!1)}))}(e)},children:(0,d.jsx)(m.pJ,{className:"DocumentBrowser__DocumentList__DeleteIcon"})})]})})},e.src)}))})]})},pe=t(14310),fe=t(52663),xe=t(66083),ve=t(29525),me=t(56847),je=t(79895),Ze=t(82302),ye=t(83750),be=t(57394),we=t(88222),_e=t
1(99613),ke=t(66856),Ce=function(e){var n=e.pages,t=e.organizationId,i=e.onRefreshPages,a=(0,he.$)().i18n,h=(0,w.useState)(!1),g=h[0],p=h[1],f=(0,w.useState)("updatedAt"),x=f[0],v=f[1],m=(0,w.useState)("all"),Z=m[0],y=m[1],b=(0,w.useState)(!1),_=b[0],k=b[1],C=(0,w.useState)(null),S=C[0],N=C[1],I=(0,w.useState)(null),z=I[0],D=I[1],E=(0,w.useState)(!1),T=E[0],B=E[1],W=(0,w.useState)({open:!1,message:"",severity:"success"}),H=W[0],M=W[1],U=(0,w.useState)(!1),R=U[0],J=U[1],X=(0,w.useState)(null),Y=X[0],Q=X[1],ee=function(){return p(!1)},te=function(){var e=(0,r.Z)((function(){var e,n,t,i,r,a,s;return(0,c.__generator)(this,(function(o){switch(o.label){case 0:B(!0),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,j.Z.post("/backend/pages/bulk-migrate",{dryRun:!0})];case 2:return e=o.sent(),N(e.data),k(!0),[3,5];case 3:return n=o.sent(),s="Failed to run migration preview",403===(null===(t=n.response)||void 0===t?void 0:t.status)?s="SUPER_ADMIN access required for bulk migration":409===(null===(i=n.response)||void 0===i?void 0:i.status)?s="Migration already in progress, please wait":(null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.message)&&(s=n.response.data.message),M({open:!0,message:s,severity:"error"}),[3,5];case 4:return B(!1),[7];case 5:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),ie=function(){var e=(0,r.Z)((function(){var e,n,t,r,a,s;return(0,c.__generator)(this,(function(o){switch(o.label){case 0:B(!0),o.label=1;case 1:return o.trys.push([1,5,6,7]),[4,j.Z.post("/backend/pages/bulk-migrate",{dryRun:!1,confirm:!0})];case 2:return e=o.sent(),n=e.data,k(!1),N(null),D(n),y("all"),i?[4,i()]:[3,4];case 3:o.sent(),o.label=4;case 4:return[3,7];case 5:return t=o.sent(),k(!1),N(null),s="Migration failed",(null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.message)&&(s=t.response.data.message),M({open:!0,message:s,severity:"error"}),[3,7];case 6:return B(!1),[7];case 7:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),re=function(){D(null)},ae=function(){k(!1),N(null)},se=function(){M((0,o.Z)((0,s.Z)({},H),{open:!1}))},oe=function(){J(!1),Q(null)},le=function(){var e=(0,r.Z)((function(){var e,n,t,r,a,s;return(0,c.__generator)(this,(function(o){switch(o.label){case 0:if(!Y)return[2];B(!0),o.label=1;case 1:return o.trys.push([1,5,6,7]),[4,j.Z.delete("/backend/page?pageId=".concat(encodeURIComponent(Y.id)))];case 2:return o.sent(),M({open:!0,message:'Page "'.concat(Y.path,'" deleted successfully'),severity:"success"}),J(!1),Q(null),i?[4,i()]:[3,4];case 3:o.sent(),o.label=4;case 4:return[3,7];case 5:return e=o.sent(),s="Failed to delete page",403===(null===(n=e.response)||void 0===n?void 0:n.status)?s="SUPER_ADMIN access required to delete pages":404===(null===(t=e.response)||void 0===t?void 0:t.status)?s="Page not found":(null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.message)&&(s=e.response.data.message),M({open:!0,message:s,severity:"error"}),[3,7];case 6:return B(!1),[7];case 7:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),ce=(0,l.Z)(n);"orphans"===Z?ce=ce.filter((function(e){return!e.isInNavigation})):"unmigrated"===Z&&(ce=ce.filter((function(e){return!e.id.startsWith(t)}))),ce.sort((function(e,n){if("updatedAt"===x){var t,i,r=(null===(t=e.updatedAt)||void 0===t?void 0:t.getTime())||0;return((null===(i=n.updatedAt)||void 0===i?void 0:i.getTime())||0)-r}return"path"===x?(e.path||"").localeCompare(n.path||""):"status"===x?(e.status||"").localeCompare(n.status||""):0}));return(0,d.jsxs)(pe.Z,{children:[(0,d.jsxs)(L.Z,{variant:"contained",color:"primary",onClick:function(){return p(!0)},children:["View All Pages (",n.length,")"]}),(0,d.jsxs)(fe.Z,{open:g,onClose:ee,maxWidth:"xl",fullWidth:!0,children:[(0,d.jsxs)(xe.Z,{children:["All Pages - Total: ",n.length]}),(0,d.jsxs)(ve.Z,{children:[(0,d.jsxs)(O.Z,{container:!0,spacing:2,style:{marginBottom:16},children:[(0,d.jsx)(O.Z,{item:!0,xs:6,children:(0,d.jsxs)(u.Z,{fullWidth:!0,children:[(0,d.jsx)(G.Z,{children:"Sort by"}),(0,d.jsxs)(q.Z,{value:x,onChange:function(e){return v(e.target.value)},children:[(0,d.jsx)(V.Z,{value:"updatedAt",children:"Updated Date"}),(0,d.jsx)(V.Z,{value:"path",children:"Path"}),(0,d.jsx)(V.Z,{value:"status",children:"Status"})]})]})}),(0,d.jsx)(O.Z,{item:!0,xs:6,children:(0,d.jsxs)(u.Z,{fullWidth:!0,children:[(0,d.jsx)(G.Z,{children:"Filter"}),(0,d.jsxs)(q.Z,{value:Z,onChange:function(e){return y(e.target.value)},children:[(0,d.jsx)(V.Z,{value:"all",children:"All Pages"}),(0,d.jsx)(V.Z,{value:"orphans",children:"Not in Navigation"}),(0,d.jsx)(V.Z,{value:"unmigrated",children:"Unmigrated Only"})]})]})})]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{marginBottom:8},children:["Showing ",ce.length," of ",n.length," pages"]}),(0,d.jsx)(me.Z,{component:je.Z,style:{overflowX:"auto"},children:(0,d.jsxs)(Ze.Z,{size:"small",style:{width:"100%"},children:[(0,d.jsx)(ye.Z,{children:(0,d.jsxs)(be.Z,{children:[(0,d.jsx)(we.Z,{children:"Path"}),(0,d.jsx)(we.Z,{children:"Name"}),(0,d.jsx)(we.Z,{children:"Lang"}),(0,d.jsx)(we.Z,{children:"Updated"}),(0,d.jsx)(we.Z,{align:"center",children:"In Nav"}),(0,d.jsx)(we.Z,{align:"center",children:"Warnings"}),(0,d.jsx)(we.Z,{align:"center",children:"Open"}),(0,d.jsx)(we.Z,{align:"center",children:"Delete"})]})}),(0,d.jsx)(_e.Z,{children:ce.map((function(e){return(0,d.jsxs)(be.Z,{children:[(0,d.jsx)(we.Z,{style:{maxWidth:900},title:e.path,children:(0,d.jsx)(A.Z,{variant:"body2",style:{fontFamily:"monospace"},children:e.path})}),(0,d.jsx)(we.Z,{style:{maxWidth:200},title:e.name||e.shortName||"-",children:(0,d.jsx)(A.Z,{variant:"body2",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name||e.shortName||"-"})}),(0,d.jsx)(we.Z,{children:(0,d.jsx)(F.Z,{label:e.lang||"?",size:"small",style:{fontSize:"0.75rem"}})}),(0,d.jsx)(we.Z,{children:(0,d.jsx)(A.Z,{variant:"body2",style:{fontSize:"0.85rem"},children:(n=e.updatedAt,n?new Intl.DateTimeFormat(a.language||"fi-FI",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):"-")})}),(0,d.jsx)(we.Z,{align:"center",children:(0,d.jsx)("span",{style:{fontSize:"1.5rem",color:e.isInNavigation?"green":"red"},title:e.isInNavigation?"Included in navigation":"Not in navigation",children:e.isInNavigation?"\ud83d\udfe2":"\ud83d\udd34"})}),(0,d.jsxs)(we.Z,{align:"center",children:[e.hasDuplicates&&(0,d.jsx)(P.ZP,{title:"Warning: Multiple pages with same path and language",children:(0,d.jsx)("span",{style:{color:"orange",fontSize:"1.2rem"},children:"\u26a0\ufe0f"})}),!e.id.startsWith(t)&&(0,d.jsx)(P.ZP,{title:"Warning: Not migrated (old hash ID)",children:(0,d.jsx)("span",{style:{color:"red",fontSize:"1.2rem",marginLeft:4},children:"\u26a0\ufe0f"})})]}),(0,d.jsx)(we.Z,{align:"center",children:(0,d.jsx)("a",{href:e.lang?"/".concat(e.lang).concat(e.path):e.path,target:"_blank",rel:"noopener noreferrer",style:{fontSize:"1.2rem",textDecoration:"none",cursor:"pointer"},title:"Open page in new tab",children:"\ud83d\udd17"})}),(0,d.jsx)(we.Z,{align:"center",children:(0,d.jsx)(P.ZP,{title:"Delete this page (archives before deleti
1on)",children:(0,d.jsx)(L.Z,{size:"small",color:"secondary",onClick:function(){return function(e){Q({id:e.id,path:e.path,name:e.name||e.shortName,lang:e.lang}),J(!0)}(e)},style:{minWidth:"unset",padding:"4px 8px",fontSize:"1.2rem"},children:"\ud83d\uddd1\ufe0f"})})})]},e.id);var n}))})]})})]}),(0,d.jsxs)(ke.Z,{children:["unmigrated"===Z&&ce.length>0&&(0,d.jsx)(P.ZP,{title:"Migrate all unmigrated pages to new deterministic ID format. This will remove all old hash-based IDs.",children:(0,d.jsxs)(L.Z,{variant:"contained",color:"secondary",onClick:te,style:{marginRight:"auto"},children:["Bulk Migrate Pages (",ce.length,")"]})}),(0,d.jsx)(L.Z,{onClick:ee,color:"primary",children:"Close"})]})]}),(0,d.jsxs)(fe.Z,{open:_,onClose:ae,maxWidth:"md",fullWidth:!0,children:[(0,d.jsx)(xe.Z,{children:"Bulk Migration Preview"}),(0,d.jsx)(ve.Z,{children:S&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.Z,{variant:"h6",gutterBottom:!0,children:"Migration Summary"}),(0,d.jsxs)(pe.Z,{style:{marginBottom:16},children:[(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Total pages:"})," ",S.stats.total]}),(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Already migrated:"})," ",S.stats.alreadyMigrated]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{color:"green"},children:[(0,d.jsx)("strong",{children:"Will migrate:"})," ",S.stats.toMigrate]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{color:"red"},children:[(0,d.jsx)("strong",{children:"Will delete (old hash IDs):"}
1)," ",S.stats.remainingHashIds]}),(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Skipped:"})," ",S.stats.skipped]})]}),(0,d.jsx)(A.Z,{variant:"h6",gutterBottom:!0,children:"Full Response (JSON)"}),(0,d.jsx)(je.Z,{style:{padding:16,backgroundColor:"#f5f5f5",maxHeight:400,overflow:"auto"},children:(0,d.jsx)("pre",{style:{margin:0,fontFamily:"monospace",fontSize:"0.85rem",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(S,null,2)})}),0===S.stats.remainingHashIds?(0,d.jsx)(K.Z,{severity:"success",style:{marginTop:16},children:"All pages are already migrated! No action needed."}):(0,d.jsxs)(K.Z,{severity:"warning",style:{marginTop:16},children:[(0,d.jsx)("strong",{children:"Warning:"})," This operation will permanently delete ",S.stats.remainingHashIds," old page document(s) with hash IDs. They will be archived to the pageRevisions collection before deletion."]})]})}),(0,d.jsxs)(ke.Z,{children:[(0,d.jsx)(L.Z,{onClick:ae,color:"default",children:"Cancel"}),S&&S.stats.remainingHashIds>0&&(0,d.jsx)(L.Z,{onClick:ie,color:"primary",variant:"contained",children:"Start Migration"})]})]}),(0,d.jsxs)(fe.Z,{open:!!z,onClose:re,maxWidth:"md",fullWidth:!0,children:[(0,d.jsx)(xe.Z,{children:(null===z||void 0===z?void 0:z.stats.failed)>0?"Migration Completed with Warnings":"Migration Completed Successfully"}),(0,d.jsx)(ve.Z,{children:z&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(K.Z,{severity:z.stats.failed>0?"warning":"success",style:{marginBottom:16},children:0===z.stats.remainingHashIds?(0,d.jsx)("strong",{children:"All pages successfully migrated! No hash IDs remaining."}):(0,d.jsxs)("strong",{children:["Warning: ",z.stats.remainingHashIds," hash IDs still remain. Some pages may need manual migration."]})}),(0,d.jsx)(A.Z,{variant:"h6",gutterBottom:!0,children:"Migration Statistics"}),(0,d.jsxs)(pe.Z,{style:{marginBottom:16},children:[(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Total pages:"})," ",z.stats.total]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{color:"green"},children:[(0,d.jsx)("strong",{children:"Migrated:"})," ",z.stats.migrated]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{color:"orange"},children:[(0,d.jsx)("strong",{children:"Archived:"})," ",z.stats.archived]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{color:"red"},children:[(0,d.jsx)("strong",{children:"Deleted (old hash IDs):"})," ",z.stats.deleted]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{color:"red"},children:[(0,d.jsx)("strong",{children:"Failed:"})," ",z.stats.failed]}),(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Remaining hash IDs:"})," ",z.stats.remainingHashIds]}),(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Duration:"})," ",(z.duration/1e3).toFixed(2),"s"]})]}),z.pages.failed.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(A.Z,{variant:"h6",gutterBottom:!0,color:"error",children:"Failed Pages"}),(0,d.jsx)(je.Z,{style:{padding:16,backgroundColor:"#fff3e0",marginBottom:16},children:z.pages.failed.map((function(e,n){return(0,d.jsxs)(A.Z,{variant:"body2",style:{marginBottom:8},children:[(0,d.jsx)("strong",{children:e.path})," (",e.lang||"?","):"," ",e.error]},n)}))})]}),(0,d.jsx)(A.Z,{variant:"h6",gutterBottom:!0,children:"Full Response (JSON)"}),(0,d.jsx)(je.Z,{style:{padding:16,backgroundColor:"#f5f5f5",maxHeight:400,overflow:"auto"},children:(0,d.jsx)("pre",{style:{margin:0,fontFamily:"monospace",fontSize:"0.85rem",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(z,null,2)})})]})}),(0,d.jsx)(ke.Z,{children:(0,d.jsx)(L.Z,{onClick:re,color:"primary",variant:"contained",children:"Close"})})]}),(0,d.jsxs)(fe.Z,{open:R,onClose:oe,maxWidth:"sm",fullWidth:!0,children:[(0,d.jsx)(xe.Z,{children:"Delete Page?"}),(0,d.jsx)(ve.Z,{children:Y&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(K.Z,{severity:"warning",style:{marginBottom:16},children:[(0,d.jsx)("strong",{children:"Warning:"})," This action will permanently delete the page. The page will be archived to the pageRevisions collection before deletion."]}),(0,d.jsx)(A.Z,{variant:"h6",gutterBottom:!0,children:"Page Details"}),(0,d.jsxs)(pe.Z,{style:{marginBottom:16},children:[(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Path:"})," ",Y.path]}),Y.name&&(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Name:"})," ",Y.name]}),Y.lang&&(0,d.jsxs)(A.Z,{variant:"body2",children:[(0,d.jsx)("strong",{children:"Language:"})," ",Y.lang]}),(0,d.jsxs)(A.Z,{variant:"body2",style:{marginTop:8,fontFamily:"monospace"},children:[(0,d.jsx)("strong",{children:"ID:"})," ",Y.id]})]}),(0,d.jsx)(A.Z,{variant:"body2",color:"textSecondary",children:"Are you sure you want to delete this page? This action cannot be undone."})]})}),(0,d.jsxs)(ke.Z,{children:[(0,d.jsx)(L.Z,{onClick:oe,color:"default",children:"Cancel"}),(0,d.jsx)(L.Z,{onClick:le,color:"secondary",variant:"contained",children:"Delete"})]})]}),T&&(0,d.jsx)(ne.default,{}),(0,d.jsx)($.Z,{open:H.open,autoHideDuration:8e3,onClose:se,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,d.jsx)(K.Z,{onClose:se,severity:H.severity,variant:"filled",children:H.message})})]})},Se=t(85127),Ne=t.n(Se),Ie=t(38966),ze=t.n(Ie),Oe=t(90559),De=function(e){return e&&"/"!==e?e.endsWith("/")?e.slice(0,-1):e:e||""},Ee=function(e,n){if(!n)return!1;var t=De(e),i=!0,r=!1,a=void 0;try{for(var s,o=n[Symbol.iterator]();!(i=(s=o.next()).done);i=!0){var l=s.value;if(De(l.url)===t)return!0;
1if(l.links&&Ee(e,l.links))return!0}}catch(c){r=!0,a=c}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return!1},Fe=function(){var e,n,t=(0,w.useState)(void 0),i=t[0],b=t[1],_=(0,w.useState)([]),C=_[0],S=_[1],N=(0,w.useState)(!1),I=N[0],O=N[1],D=(0,w.useState)([]),E=D[0],F=D[1],L=(0,w.useState)(!1),T=L[0],B=L[1],A=(0,w.useState)(!1),P=A[0],W=A[1],M=(0,w.useState)(""),U=M[0],R=M[1],J=(0,w.useState)(!0),$=J[0],G=J[1],q=(0,w.useState)([]),V=q[0],X=q[1],K=(0,w.useState)(!1),Y=K[0],Q=K[1],ee=(0,he.$)().t,te=function(){var e=(0,r.Z)((function(){var e,n;return(0,c.__generator)(this,(function(t){switch(t.label){case 0:return n=[{siteTemplate:{componentsBeforeContent:[],componentsAfterContent:[]}}],[4,j.Z.get("/backend/organization").then((function(e){return G(!1),e.data})).catch((function(e){return console.error(e)}))];case 1:return e=s.Z.apply(void 0,n.concat(t.sent())),b(e),R(ze()(e,null,2,80)),[2]}}))}));return function(){return e.apply(this,arguments)}}(),ie=function(e,n){i&&b((0,o.Z)((0,s.Z)({},i),(0,a.Z)({},e,n)))},re=function(){var e=(0,r.Z)((function(){return(0,c.__generator)(this,(function(e){switch(e.label){case 0:return[4,j.Z.get("/backend/publications?rawData=true").then(function(){var e=(0,r.Z)((function(e){var n;return(0,c.__generator)(this,(function(t){return(n=e.data).sort((function(e,n){return e.distributor>n.distributor?1:-1})),S(n),[2]}))}
1));return function(n){return e.apply(this,arguments)}}()).catch((function(e){return console.error(e)}))];case 1:return[2,e.sent()]}}))}));return function(){return e.apply(this,arguments)}}(),ae=function(e){if(e.preventDefault(),i){var n,t=e.target.elements.distributor.value,r=e.target.elements.includes.value,a=e.target.elements.field.value,o=e.target.elements.tags.value.split(","),l=e.target.elements.langs.value.split(","),c=e.target.elements.reverse.checked;if(!t)return;var d=null===(n=i.newsFeedOptions)||void 0===n?void 0:n.findIndex((function(e){return e.distributor===t}));if(d&&-1!==d){var u,h=0;if(k().forEach(i.newsFeedOptions,(function(e){var n,i;e.distributor===t&&e.categorizationOptions&&(h=null===(n=e.categorizationOptions)||void 0===n?void 0:n.length,u=null===(i=e.categorizationOptions)||void 0===i?void 0:i.find((function(e){return e&&e.includes===r&&e.field===a})))})),u)return;var g={includes:r,field:a,tags:o,langs:l,reverse:c};k().set(i,"newsFeedOptions[".concat(d,"].categorizationOptions[").concat(h,"]"),g)}else{var p;k().set(i,"newsFeedOptions[".concat(null===(p=i.newsFeedOptions)||void 0===p?void 0:p.length,"]"),{distributor:t}),ae(e)}b((0,s.Z)({},i))}},oe=function(){var e=(0,r.Z)((function(){return(0,c.__generator)(this,(function(e){switch(e.label){case 0:return G(!0),[4,j.Z.get("/backend/files").then(function(){var e=(0,r.Z)((function(e){return(0,c.__generator)(this,(function(n){return F(e.data),G(!1),[2]}))}));return function(n){return e.apply(this,arguments)}}()).catch((function(e){return console.error(e)}))];case 1:return e.sent(),[2]}}))}));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=(0,r.Z)((function(){var e,n,t,r,a,s;return(0,c.__generator)(this,(function(o){switch(o.label){case 0:if(!i)return[2];G(!0),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,j.Z.get("/backend/pages/all")];case 2:return e=o.sent(),n=e.data,t=function(e){var n,t,i,r,a=[],s=null===(t=e.siteTemplate)||void 0===t||null===(i=t.componentsBeforeContent)||void 0===i?void 0:i.find((function(e){return"Header"===e.type||"HighlightedHeader"===e.type||"StickyHeader"===e.type})),o=(null===(r=null===s||void 0===s?void 0:s.props)||void 0===r?void 0:r.links)||[];return(n=a).push.apply(n,(0,l.Z)(o)),e.translations&&Object.values(e.translations).forEach((function(e){var n,t,i,r,s=null===(t=e.siteTemplate)||void 0===t||null===(i=t.componentsBeforeContent)||void 0===i?void 0:i.find((function(e){return"Header"===e.type||"HighlightedHeader"===e.type||"StickyHeader"===e.type})),o=(null===(r=null===s||void 0===s?void 0:s.props)||void 0===r?void 0:r.links)||[];(n=a).push.apply(n,(0,l.Z)(o))})),a}(i),r=k().countBy(n,(function(e){return"".concat(e.path,"||").concat(e.lang||i.defaultLang)})),a=n.map((function(e){var n="".concat(e.path,"||").concat(e.lang||i.defaultLang);return{id:e.id,path:e.path,name:e.name,shortName:e.shortName,lang:e.lang,status:e.status,updatedAt:e.updatedAt?new Date(e.updatedAt):void 0,createdAt:e.createdAt?new Date(e.createdAt):void 0,isMigrated:e.isMigrated,isInNavigation:Ee(e.path,t),hasDuplicates:r[n]>1}})),X(a),[3,5];case 3:return s=o.sent(),console.error("Error fetching pages:",s),[3,5];case 4:return G(!1),[7];case 5:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();return(0,d.jsx)(Z.Z,{componentOnUnauthorized:(0,d.jsx)(y.Z,{}),componentOnUndefined:(0,d.jsx)(ne.default,{}),onAuthentication:te,children:(0,d.jsxs)(d.Fragment,{children:[$&&(0,d.jsx)(ne.default,{}),i&&(0,d.jsx)("div",{className:"Admin",children:(0,d.jsx)("div",{className:"Admin__InnerContainer",children:(0,d.jsxs)("div",{className:"Admin__InnerContainer__Element",children:[(0,d.jsx)("h1",{children:i.name}),(0,d.jsxs)(u.Z,{children:[(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.basicInfo.accordionTitle")}),(0,d.jsxs)(p.Z,{children:[(0,d.jsx)(v.Z,{fullWidth:!0,label:ee("organizationEditor.basicInfo.label.organizationId"),value:i.id,disabled:!0}),(0,d.jsx)(v.Z,{fullWidth:!0,label:ee("organizationEditor.basicInfo.label.organizationName"),value:i.name,onChange:function(e){return ie("name",e.target.value)}})]})]}),(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.navigation.accordionTitle")}),(0,d.jsx)(p.Z,{children:i&&(0,d.jsx)(z,{organization:i,updateLinks:function(e,n){if(i){var t,r=i.defaultLang===n?"siteTemplate":"translations.".concat(n,".siteTemplate"),a=k().get(i,r),o=null===a||void 0===a||null===(t=a.componentsBeforeContent)||void 0===t?void 0:t.findIndex((function(e){return"Header"===e.type||"HighlightedHeader"===e.type||"StickyHeader"===e.type}));"number"===typeof o&&-1!==o&&(k().set(i,"".concat(r,".componentsBeforeContent[").concat(o,"].props.links"),e),b((0,s.Z)({},i)))}}})})]}),(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.styles.accordionTitle")}),(0,d.jsx)(p.Z,{children:(0,d.jsx)(v.Z,{fullWidth:!0,multiline:!0,label:ee("organizationEditor.styles.label"),value:i.style&&Ne()(i.style),onChange:function(e){return ie("style",e.target.value)}})})]}),(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.siteTemplate.accordionTitle")}),(0,d.jsxs)(p.Z,{children:[(0,d.jsx)(v.Z,{fullWidth:!0,multiline:!0,label:ee("organizationEditor.siteTemplate.label.beforeContent"),value:JSON.stringify(null===(e=i.siteTemplate)||void 0===e?void 0:e.componentsBeforeContent),onChange:function(e){return ie("siteTemplate",(0,o.Z)((0,s.Z)({},i.siteTemplate),{componentsBeforeContent:JSON.parse(e.target.value)}))}}),(0,d.jsx)(v.Z,{fullWidth:!0,multiline:!0,label:ee("organizationEditor.siteTemplate.label.afterContent"),value:JSON.stringify(null===(n=i.siteTemplate)||void 0===n?void 0:n.componentsAfterContent),onChange:function(e){return ie("siteTemplate",(0,o.Z)((0,s.Z)({},i.siteTemplate),{componentsAfterContent:JSON.parse(e.target.value)}))}})]})]}),(0,d.jsxs)(g.Z,{expanded:I,onChange:function(){var e=(0,r.Z)((function(e,n){return(0,c.__generator)(this,(function(e){switch(e.label){case 0:return O(!!n),n&&0===C.length?[4,re()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
1))}));return function(n,t){return e.apply(this,arguments)}}(),children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.newsFeedSettings.accordionTitle")}),(0,d.jsx)(p.Z,{children:i&&(0,d.jsx)(H,{organization:i,publications:C,parsePublicationsTags:function(){if(i){var e=C.map((function(e){var n;return null===(n=i.newsFeedOptions)||void 0===n||n.map((function(n){if(e.distributor===n.distributor&&n.categorizationOptions)if("MFN"===e.distributor){var t=(0,se.K1)(e._rawData);e.tags=(0,se.RN)(t,n,e.lang||i.defaultLang)}else e.tags=(0,se.RN)(e._rawData,n,e.lang||i.defaultLang)})),(0,s.Z)({},e)}));S(e)}},addNewsFeedOptions:ae,deleteTag:function(e,n,t){if(i){var r,a=null===(r=i.newsFeedOptions)||void 0===r?void 0:r.findIndex((function(n){return n.distributor===e}));if(a&&-1!==a){var o,l=null===(o=i.newsFeedOptions)||void 0===o?void 0:o.find((function(n){return n.distributor===e})),c=null===l||void 0===l?void 0:l.categorizationOptions;if(c){var d=c[n].tags.findIndex((function(e){return e===t}));k().unset(i,"newsFeedOptions[".concat(a,"].categorizationOptions[").concat(n,"].tags[").concat(d,"]")),k().update(i,"newsFeedOptions[".concat(a,"].categorizationOptions[").concat(n,"].tags"),k().compact),b((0,s.Z)({},i))}}}},deleteNewsFeedOption:function(e,n){if(i){var t,r=null===(t=i.newsFeedOptions)||void 0===t?void 0:t.findIndex((function(n){return n.distributor===e}));r&&-1!==r&&(k().unset(i,"newsFeedOptions[".concat(r,"].categorizationOptions[").concat(n,"]")),k().update(i,"newsFeedOptions[".concat(r,"].categorizationOptions"),k().compact),b((0,s.Z)({},i)))}},updateNewsFeedOptions:function(e,n,t,r){if(i){var a,o=null===(a=i.newsFeedOptions)||void 0===a?void 0:a.findIndex((function(n){return n.distributor===e}));o&&-1!==o&&(k().set(i,"newsFeedOptions[".concat(o,"].categorizationOptions[").concat(n,"].").concat(t),r),b((0,s.Z)({},i)))}}})})]}),(0,d.jsxs)(g.Z,{expanded:T,onChange:function(){var e=(0,r.Z)((function(e,n){return(0,c.__generator)(this,(function(e){switch(e.label){case 0:return B(!!n),n&&0===E.length?[4,oe()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
1))}));return function(n,t){return e.apply(this,arguments)}}(),children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.images.accordionTitle")}),(0,d.jsx)(p.Z,{children:i&&(0,d.jsx)(le,{files:E,getFiles:oe})})]}),(0,d.jsxs)(g.Z,{expanded:P,onChange:function(){var e=(0,r.Z)((function(e,n){return(0,c.__generator)(this,(function(e){switch(e.label){case 0:return W(!!n),n&&0===E.length?[4,oe()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}));return function(n,t){return e.apply(this,arguments)}}(),children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.documents.accordionTitle")}),(0,d.jsx)(p.Z,{children:i&&(0,d.jsx)(ge,{files:E,getFiles:oe})})]}),(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.jsonEditor.accordionTitle")}),(0,d.jsx)(p.Z,{children:(0,d.jsx)(v.Z,{fullWidth:!0,multiline:!0,value:U,onChange:function(e){return R(e.target.value||"")}})}),(0,d.jsx)(h.Z,{children:(0,d.jsx)(x.ZP,{onClick:function(){(function(e){try{JSON.parse(e)}catch(n){return!1}return!0})(U)&&b(JSON.parse(U))},children:ee("organizationEditor.jsonEditor.button.setJson")})})]}),(0,d.jsxs)(g.Z,{expanded:Y,onChange:function(){var e=(0,r.Z)((function(e,n){return(0,c.__generator)(this,(function(e){switch(e.label){case 0:return Q(!!n),n&&0===V.length?[4,ce()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
1))}));return function(n,t){return e.apply(this,arguments)}}(),children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:"Pages"}),(0,d.jsx)(p.Z,{children:i&&(0,d.jsx)(Ce,{pages:V,organizationId:i.id,onRefreshPages:ce})})]}),(0,d.jsxs)(g.Z,{children:[(0,d.jsx)(f.Z,{expandIcon:(0,d.jsx)(m.hW,{}),children:ee("organizationEditor.alerts.accordionTitle")}),(0,d.jsx)(p.Z,{children:i&&(0,d.jsx)(Oe.Z,{organization:i})})]}),(0,d.jsx)(g.Z,{defaultExpanded:!0,children:(0,d.jsxs)(h.Z,{children:[(0,d.jsx)(x.ZP,{href:"/",children:ee("organizationEditor.button.goBack")}),(0,d.jsx)(x.ZP,{onClick:function(){G(!0),j.Z.post("/backend/organization",{organization:i}).then((function(){G(!1)}))},children:ee("organizationEditor.button.save")})]})})]})]})})})]})})}}},function(e){e.O(0,[774,190,662,698,714,86,885,762,489,657,664,990,584,888,179],(function(){return n=20420,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

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.