tocco-admin 1.0.149 → 1.0.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunktocco_admin=self.webpackChunktocco_admin||[]).push([[141],{57387:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var r=n(27361),a=n.n(r),o=n(74806),i=n(50558),c=n(29785),s=n(59713),l=n.n(s),u=n(17563),d=n(73183),p=n(6699),f=n(90169),h=n(85893);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(e){var t=e.entityName,n=e.entityKeys,r=e.children,a=n.map((function(e){return{entityName:t,key:e}}));return(0,h.jsx)(p.Z,{to:"/docs?rootNodes=".concat(JSON.stringify(a)),target:"_blank",children:r})};const g=function(e){var t=u.parse(e.history.location.search);return(0,h.jsx)(d.default,y(y(y({},e),{},{routerType:"inherit",navigationStrategy:{ListLink:v,DetailLink:f.z2}},t.rootNodes&&{rootNodes:JSON.parse(t.rootNodes)}),{},{searchFormCollapsed:e.searchFormCollapsed,onSearchFormCollapsedChange:function(t){var n=t.collapsed;e.saveUserPreferences({"admin.list.searchFormCollapsed":n})},scrollBehaviour:"inline"}))};var b={saveUserPreferences:c.RK};const w={container:(0,i.connect)((function(e,t){return{searchFormCollapsed:a()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",null)}}),b)((0,o.ZP)(g))}},18632:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Kn});var r=n(15857),a=n(74806),o=n(50558),i="path/SET_CURRENT_VIEW_INFO",c="path/LOAD_CURRENT_ROUTE",s="path/SET_BREADCRUMBS_INFO",l="path/UPDATE_BREADCRUMBS_INFO",u="path/SET_RELATIONS",d="path/SET_CURRENT_VIEW_TITLE",p="path/SET_RELATIONS_INFO",f="path/PROPAGATE_REFRESH",h="path/INVALIDATE_LAST_BREADCRUMB",m="path/SELECT_RELATION",y=function(e,t){return{type:i,payload:{location:e,currentViewInfo:t}}},v=function(e,t){return{type:l,payload:{path:e,breadcrumbsInfo:t}}},g=function(e){return{type:u,payload:{relations:e}}},b=function(e){return{type:p,payload:{relationsInfo:e}}},w=function(e){return{type:m,payload:{selectedRelation:e}}},x=n(1024),P=n.n(x),O=n(56746),j=n(19743),Z=n(5303),E=n(27361),k=n.n(E),R=n(70696),N=n(75354),C=n(87467),S=n(90169),A=n(96801),I=function(e){var t=A.Z.extractParamsFromPath("/e/:entity/:key?/:relation*/:view(list|detail|edit|create|relations|action)/:actionId?",e),n=A.Z.extractParamsFromPath("/e/action/:actionId",e);return t||n},D=n(46054),L=n(85893),V=function(e){var t=e.history,n=e.match,r=e.setCurrentViewTitle,a=e.currentViewInfo,o=e.intl,i=t.location;if((0,x.useEffect)((function(){return a&&r(o.formatMessage({id:"client.actions.".concat(a.actionId,".title")})),function(){r(null)}}),[a,r,o]),!a)return null;var c=N.Z.fromQueryString(i.search),s=k()(i,"state.selection",c.selection),l=k()(i,"state.definition.properties",c.actionProperties),u=function(){var e=I(n.url).key?(0,C.H)(n.url):(0,C.H)(n.url,2);t.replace(e)};return(0,L.jsx)(D.Z,{history:t,match:n,appId:a.actionId,selection:s,actionProperties:l,navigationStrategy:(0,S.ZP)(t,n),onSuccess:u,onError:u,onCancel:u})},T=function(e,t){return 0===Object.keys(R.Z.difference(e,t)).length};const _=P().memo(V,T);var F={setCurrentViewTitle:function(e){return{type:d,payload:{currentViewTitle:e}}}};const U=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),F)((0,a.ZP)(_));var M=n(50600),W=n(91073),B=n(319),H=n.n(B),z=n(63038),K=n.n(z),$=n(28655),q=n.n($),G=n(38205),Y=n(73183),J=n(45650),Q=n(12568),X=n(88601),ee=n(7281),te=n(24688);const ne=function(e){var t=e.when,n=e.message;return(0,x.useEffect)((function(){return t&&te.Z.activatePreventFromLeaving(),function(){te.Z.deactivatePreventFromLeaving()}}),[t]),(0,L.jsx)(O.NL,{when:t,message:n})},re=ne;var ae,oe=G.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(ae||(ae=q()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),X.Z.color("paper"),ee.Z.space(0));const ie=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,a=e.intl,o=e.chooseDocument,i=e.dispatchEmittedAction,c=n.location,s=k()(c,"state.defaultValues",[]),l=(0,x.useState)(!1),u=K()(l,2),d=u[0],p=u[1];if(!t)return null;var f,h=t.model,m=t.reverseRelation,y=t.parentKey,v=h.name,g=k()(h,"paths.".concat(m,".multi"),!1),b=[].concat(H()(m&&y?[{id:m,value:g?[y]:y}]:[]),H()(s));return(0,L.jsxs)(oe,{children:[(0,L.jsx)(re,{when:d,message:(f="client.entity-browser.detail.confirmTouchedFormLeave",a.formatMessage({id:f}))}),(0,L.jsx)(J.ZP,{entityName:v,formName:v,mode:"create",defaultValues:b,emitAction:function(e){i(e)},navigationStrategy:(0,S.ZP)(n,r),chooseDocument:o,onEntityCreated:function(e){var t=e.id;p(!1),n.push(r.url.replace(/create$/,t))},onTouchedChange:function(e){var t=e.touched;return p(t)},listApp:Q.ZP,docsApp:Y.default})]})};var ce={chooseDocument:W.Z.actions.chooseDocument,dispatchEmittedAction:M.Z.dispatchEmittedAction};const se=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),ce)((0,a.ZP)(ie));var le=n(29785),ue=n(59713),de=n.n(ue),pe=n(17563),fe=n(29441),he=n(48926),me=n.n(he),ye=n(87757),ve=n.n(ye),ge=n(81719);function be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?be(Object(n),!0).forEach((function(t){de()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const xe=function(e){var t=e.entityName,n=e.entityKey,r=e.showActions,a=e.noLeftPadding,o=e.openResource,i=e.initialLocation,c=e.sortable,s=(0,x.useState)(null),l=K()(s,2),u=l[0],d=l[1],p=(0,x.useCallback)(me()(ve().mark((function e(){return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ge.Z.simpleRequest("entities/2.0/"+t+"/"+n+"/entitydocs/folder").then((function(e){d(e.body.key)}));case 1:case"end":return e.stop()}}),e)}))),[t,n]);return(0,x.useEffect)((function(){p()}),[p]),u&&(0,L.jsx)(Y.default,we(we(we({routerType:"routerless",initialLocation:i,noLeftPadding:a,sortable:c,searchFormType:"none",rootNodes:[{key:u,entityName:"Folder"}],embedded:!0,showActions:r},!1===r?{selectionStyle:"none"}:{}),{},{disableViewPersistor:!0},o?{openResource:o}:{}),{},{scrollBehaviour:"inline"}))};const Pe=function(e){var t=e.currentViewInfo,n=e.initialLocation;return(0,L.jsx)(xe,{noLeftPadding:!1,entityName:t.parentModel.name,entityKey:t.parentKey,showActions:!0,initialLocation:n})};function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){de()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ze=function(e){var t=e.match,n=e.history,r=e.currentViewInfo,a=e.emitAction,o=e.searchFormCollapsed,i=e.saveUserPreferences;if(!r)return null;var c=pe.parse(n.location.search),s=n.location.hash?n.location.hash.substring(1):null;return"Resource"===r.model.name?(0,L.jsx)(Pe,{currentViewInfo:r,initialLocation:s}):(0,L.jsx)(Q.ZP,je(je({emitAction:a,limit:25,id:"".concat(r.model.name,"_list"),entityName:r.model.name,formName:c.formName||r.model.name,onRowClick:function(e){var r=e.id;n.push(t.url.replace(/list$/,"")+r)}},r.reverseRelation&&{parent:{key:r.parentKey,reverseRelationName:r.reverseRelation,model:r.parentModel.name}}),{},{showLink:!0,navigationStrategy:(0,S.ZP)(n,t),searchFormPosition:"left",searchFormType:"admin",scrollBehaviour:"inline",store:fe.Z.viewInfoSelector(n.location.pathname).store,onStoreCreate:function(e){fe.Z.persistViewInfo(n.location.pathname,{store:e},r.level)},actionAppComponent:D.Z,tql:c.tql,searchFormCollapsed:o,onSearchFormCollapsedChange:function(e){var t=e.collapsed;i({"admin.list.searchFormCollapsed":t})}}))};var Ee={emitAction:function(e){return M.Z.dispatchEmittedAction(e)},saveUserPreferences:le.RK};const ke=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],searchFormCollapsed:k()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",!1)}}),Ee)((0,a.ZP)(Ze));var Re,Ne=n(4975);function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){de()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ae=G.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(Re||(Re=q()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),X.Z.color("paper"),ee.Z.space(0));const Ie=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,a=e.intl,o=e.chooseDocument,i=e.emitAction,c=e.propagateRefresh,s=e.invalidateLastBreadcrumb,l=(0,x.useState)(!1),u=K()(l,2),d=u[0],p=u[1];if(!t||t.pathname!==n.location.pathname)return null;var f=pe.parse(location.search).formName,h=t.model.name;return(0,L.jsxs)(Ae,{children:[(0,L.jsx)(re,{when:d,message:function(e){return n.location.pathname!==e.pathname&&(t="client.entity-browser.detail.confirmTouchedFormLeave",a.formatMessage({id:t}));var t}}),(0,L.jsx)(J.ZP,{entityName:h,entityId:t.key,formName:f||h,mode:"update",emitAction:i,onTouchedChange:function(e){var t=e.touched;return p(t)},navigationStrategy:Se(Se({},(0,S.ZP)(n,r)),{},{navigateToCreateRelative:function(e,t){if(e){var a=(0,C.H)(r.url,1);n.push({pathname:"".concat(a,"/").concat(e,"/create"),state:t})}else{var o=(0,C.H)(r.url,2);n.push({pathname:o+"/create",state:t})}}}),chooseDocument:o,onEntityDeleted:function(){var e=(0,C.H)(r.url,2);n.push(e)},onEntityUpdated:function(){var e=n.location;s(e)},onRefresh:function(){var e=n.location;c(e)},actionAppComponent:D.Z,onSubGridRowClick:function(e){var t=e.id,a=e.relationName,o=(0,C.H)(r.url);n.push("".concat(o,"/").concat(a,"/").concat(t))},listApp:Q.ZP,docsApp:Y.default})]})};var De={chooseDocument:W.Z.actions.chooseDocument,emitAction:function(e){return M.Z.dispatchEmittedAction(e)},propagateRefresh:function(e){return{type:f,payload:{location:e}}},invalidateLastBreadcrumb:function(e){return{type:h,payload:{location:e}}}};const Le=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),De)((0,a.ZP)(Ie));var Ve=n(34206),Te=n(88162),_e={};const Fe=function(e){var t=e.currentViewInfo,n=e.history,r=e.selectedRelation,a=e.sortable;return(0,L.jsx)(xe,{entityName:t.model.name,entityKey:t.key,showActions:!1,noLeftPadding:!0,history:n,openResource:function(e){n.push("".concat(r.relationName,"/list#").concat(e))},sortable:a})};var Ue=function(e){var t=e.selectedRelation,n=e.currentViewInfo,r=e.match,a=e.history,o=e.emitAction,i="".concat(t.reverseRelationName).concat(t.relationName);return(0,L.jsx)(Q.ZP,{id:"preview"+t.reverseRelationName+t.targetEntity,entityName:t.targetEntity,formName:t.targetEntity,parent:{key:n.key,reverseRelationName:t.reverseRelationName,model:n.model.name,relationName:t.relationName},showLink:!0,navigationStrategy:(0,S.ZP)(a,r),onRowClick:function(e){var n=e.id,o=r.url.replace(/detail$/,"");a.push("".concat(o).concat(t.relationName,"/").concat(n))},onNavigateToCreate:function(){var e=(0,C.H)(r.url);a.push(e+"/"+t.relationName+"/create")},searchFormType:"fulltext",selectionStyle:"none",store:fe.Z.viewInfoSelector(a.location.pathname)["store-".concat(i)],onStoreCreate:function(e){fe.Z.persistViewInfo(n.pathname,de()({},"store-".concat(i),e),n.level)},showActions:!1,limit:15,emitAction:o,scrollBehaviour:"inline"},t.reverseRelationName+t.targetEntity)};const Me=P().memo(Ue);var We,Be,He,ze,Ke,$e,qe,Ge,Ye,Je,Qe,Xe,et,tt,nt=n(6699),rt=n(65035),at=n(11347),ot=n(84647),it=n(69829),ct=n(30759),st=G.ZP.div.withConfig({displayName:"StyledRelationsViewWrapper"})(We||(We=q()(["\n display: ",";\n height: 100%;\n flex-direction: column;\n"])),(function(e){return e.isRightPaneCollapsed?"none":"flex"})),lt=G.ZP.div.withConfig({displayName:"StyledPlaceHolder"})(Be||(Be=q()(["\n display: ",";\n flex: 1;\n height: 100%;\n width: 25px;\n background: ",";\n padding-top: ",";\n padding-left: ",";\n align-items: flex-start;\n\n &:hover {\n cursor: pointer;\n }\n"])),(function(e){return e.isRightPaneCollapsed?"flex":"none"}),X.Z.color("paper"),ee.Z.space(-1.5),ee.Z.space(-2.5)),ut=G.ZP.div.withConfig({displayName:"StyledToggleCollapse"})(He||(He=q()(["\n display: flex;\n background-color: ",";\n padding-top: ",";\n padding-bottom: ",";\n"])),X.Z.color("paper"),ee.Z.space(-1.5),ee.Z.space(-1.5)),dt=(0,G.ZP)(rt.Z).withConfig({displayName:"StyledToggleCollapseButton"})(ze||(ze=q()(["\n font-size: ",";\n padding: 0;\n margin-left: auto;\n\n &:hover,\n ",":hover & {\n background-color: transparent;\n color: ",";\n }\n"])),ee.Z.font(0),lt,X.Z.color("secondaryLight")),pt=G.ZP.div.withConfig({displayName:"StyledPreviewBox"})(Ke||(Ke=q()(["\n background-color: ",";\n padding: ",";\n margin-top: 3px;\n display: flex;\n flex-direction: column;\n flex: 1;\n"])),X.Z.color("paper"),ee.Z.space(-1)),ft=G.ZP.div.withConfig({displayName:"StyledRelationBoxes"})($e||($e=q()(["\n background-color: ",";\n padding: ",";\n display: grid;\n grid-template-columns: repeat(auto-fit, 170px);\n grid-gap: ",";\n justify-content: space-between;\n overflow-y: auto;\n align-content: flex-start;\n height: fit-content;\n min-height: 150px;\n max-height: 20%;\n ","\n"])),X.Z.color("paper"),ee.Z.space(-1),ee.Z.space(-2),at.C),ht=(0,G.ZP)(nt.Z).withConfig({displayName:"StyledPreviewLink"})(qe||(qe=q()(["\n padding-left: ",";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n"])),ee.Z.space(-.5)),mt=G.ZP.div.withConfig({displayName:"StyledRelationLinks"})(Ge||(Ge=q()(["\n display: none;\n margin-left: auto;\n\n * {\n color: ",";\n padding-left: ",";\n }\n"])),X.Z.color("text"),ee.Z.space(-4.5)),yt=G.ZP.div.withConfig({displayName:"StyledRelationBox"})(Ye||(Ye=q()(["\n border-radius: ",";\n padding: "," ",";\n display: flex;\n background-color: ",";\n height: fit-content;\n\n &&& {\n * {\n color: ",";\n box-sizing: initial;\n }\n }\n ",";\n\n /* allow hover styles only on non-touch devices */\n ","\n"])),X.Z.radii("large"),ee.Z.space(-2.7),ee.Z.space(-1),(function(e){return e.selected&&X.Z.color("secondary")}),(function(e){return e.selected&&X.Z.color("paper")}),(function(e){return e.selected&&"\n ".concat(mt," {\n display: flex;\n }\n ")}),!ot.b&&(0,G.iv)(Je||(Je=q()(["\n &:hover "," {\n display: flex;\n }\n\n && {\n :hover {\n background-color: ",";\n\n * {\n color: ",";\n }\n cursor: pointer;\n }\n }\n\n ",":hover * {\n color: ",";\n }\n "])),mt,X.Z.color("secondaryLight"),X.Z.color("paper"),nt.Z,X.Z.color("secondary"))),vt=(0,G.ZP)(it.Fe).withConfig({displayName:"StyledRelationLabel"})(Qe||(Qe=q()(["\n && {\n max-width: 110px;\n }\n"]))),gt=G.ZP.span.withConfig({displayName:"StyledCountLabel"})(Xe||(Xe=q()(["\n ","\n"])),(0,ct.Z)());const bt=function(e){var t,n,r=e.relation,a=e.history,o=e.match,i=e.relationsInfo,c=e.selectRelation,s=e.selectedRelation,l=e.intl,u=e.entityName,d=r.relationName,p=r.targetEntity,f=r.relationDisplay,h=function(e){return l.formatMessage({id:e})},m=o.url.replace(/(relations|detail)$/,d),y=o.url.replace(/(relations|detail)$/,d)+"/create";return(0,L.jsxs)(yt,{selected:(null==s?void 0:s.relationName)===d,onClick:function(){c(r),a.replace({search:"?relation=".concat(d)}),function(e,t){_e[e]=t}(u,d)},children:[(0,L.jsx)(vt,{title:f.label,children:f.label}),(null===(n=i[d])||void 0===n?void 0:n.count)>0?(0,L.jsxs)(gt,{children:[" (",i[d].count,")"]}):null,(0,L.jsxs)(mt,{children:[(0,L.jsx)(nt.Z,{"aria-label":h("client.admin.entities.relationsView.relationLinkView"),to:m,children:et||(et=(0,L.jsx)(Te.Z,{icon:"arrow-right"}))}),(null===(t=i[d])||void 0===t?void 0:t.createPermission)&&"Resource"!==p&&(0,L.jsx)(nt.Z,{"aria-label":h("client.admin.entities.relationsView.relationLinkCreate"),to:y,children:tt||(tt=(0,L.jsx)(Te.Z,{icon:"plus"}))})]})]})};var wt,xt,Pt;function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var jt=function(e){var t=e.history,n=e.match,r=e.currentViewInfo,a=e.relations,o=e.relationsInfo,i=e.emitAction,c=e.intl,s=e.isRightPaneCollapsed,l=e.toggleCollapse,u=e.selectedRelation,d=e.selectRelation,p=k()(r,"model.name"),f=(0,x.useCallback)((function(){if((null==a?void 0:a.length)>0){var e=pe.parse(t.location.search).relation;if(e)d(a.find((function(t){return t.relationName===e})));else{var n=_e[p];d(n?a.find((function(e){return e.relationName===n})):a[0])}}}),[a,p,t.location.search,d]);if((0,x.useEffect)(f,[f]),(0,x.useEffect)((function(){return u?null:f()}),[u,f]),!a||0===a.length||!r)return null;var h,m,y=function(e){return c.formatMessage({id:e})},v=u?"Resource"===u.targetEntity?Fe:Me:function(){return wt||(wt=(0,L.jsx)(P().Fragment,{}))},g=a.map((function(t){return(0,L.jsx)(bt,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(n),!0).forEach((function(t){de()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({relation:t,entityName:p},e),"relation-".concat(t.relationName))}));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(st,{isRightPaneCollapsed:s,children:[(0,L.jsx)(ut,{children:(0,L.jsx)(dt,{icon:"chevron-right",onClick:l})}),(0,L.jsx)(ft,{children:g}),u&&(0,L.jsxs)(pt,{children:[(0,L.jsxs)(Ve.ZP.H4,{children:[u.relationDisplay.label,(0,L.jsx)(ht,{"aria-label":y("client.admin.entities.relationsView.relationLinkView"),to:n.url.replace(/(relations|detail)$/,u.relationName),children:xt||(xt=(0,L.jsx)(Te.Z,{icon:"arrow-right"}))}),(h=u.relationName,(null===(m=o[h])||void 0===m?void 0:m.createPermission)&&"Resource"!==u.targetEntity&&(0,L.jsx)(ht,{"aria-label":y("client.admin.entities.relationsView.relationLinkCreate"),to:n.url.replace(/(relations|detail)$/,u.relationName)+"/create",children:Pt||(Pt=(0,L.jsx)(Te.Z,{icon:"plus"}))}))]}),(0,L.jsx)(v,{selectedRelation:u,match:n,history:t,currentViewInfo:r,emitAction:i,sortable:!0})]})]}),(0,L.jsx)(lt,{onClick:l,isRightPaneCollapsed:s,children:(0,L.jsx)(dt,{icon:"chevron-left",isRightPaneCollapsed:s})})]})},Zt=function(e,t){return 0===Object.keys(R.Z.difference(e,t)).length};const Et=P().memo(jt,Zt);var kt={emitAction:function(e){return M.Z.dispatchEmittedAction(e)},selectRelation:w};const Rt=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relations:e.entities.path.relations,relationsInfo:e.entities.path.relationsInfo,selectedRelation:e.entities.path.selectedRelation}}),kt)((0,a.ZP)(Et));var Nt,Ct,St,At=G.ZP.div.withConfig({displayName:"StyledDetailViewContainer"})(Nt||(Nt=q()(["\n display: flex;\n flex-direction: row;\n height: 100%;\n\n .react-bs-container-body {\n height: auto !important;\n }\n"]))),It=G.ZP.div.withConfig({displayName:"StyledDetailViewLeft"})(Ct||(Ct=q()(["\n flex: 1;\n margin-right: 1rem;\n /* Only show one panel at a time on screens <= 500px */\n display: ",";\n"])),(function(e){var t=e.windowWidth,n=e.isRightPaneCollapsed;return t<=500&&!n&&"none"})),Dt=G.ZP.div.withConfig({displayName:"StyledDetailViewRight"})(St||(St=q()(["\n flex: ",";\n"])),(function(e){return e.isRightPaneCollapsed?"0":"1"}));const Lt=function(e){var t=e.match,n=e.history,r=(e.currentViewInfo,e.relationViewCollapsed),a=e.saveUserPreferences,o=(0,Ne.K)(r,(function(e){a({"admin.detail.relationViewCollapsed":e})})),i=o.isCollapsed,c=o.toggleCollapse;return(0,L.jsxs)(At,{children:[(0,L.jsx)(It,{isRightPaneCollapsed:i,windowWidth:window.innerWidth,children:(0,L.jsx)(j.Z.ErrorBoundary,{children:(0,L.jsx)(Le,{match:t,history:n})})}),(0,L.jsx)(Dt,{isRightPaneCollapsed:i,children:(0,L.jsx)(j.Z.ErrorBoundary,{children:(0,L.jsx)(Rt,{match:t,history:n,isRightPaneCollapsed:i,toggleCollapse:c})})})]})};var Vt={saveUserPreferences:le.RK};const Tt=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relationViewCollapsed:k()(e.preferences.userPreferences,"admin.detail.relationViewCollapsed",!1)}}),Vt)((0,a.ZP)(Lt));const _t=function(e){var t,n,r=e.match,a=(t=r.path,n=":relation",t.split(n).length-1);return(0,L.jsxs)(O.rs,{children:[(0,L.jsx)(O.AW,{exact:!0,path:"".concat(r.url),render:function(e){return(0,L.jsx)(O.l_,{to:"".concat(e.match.url.replace(/\/$/,""),"/detail")})}}),(0,L.jsx)(O.AW,{path:"".concat(r.path,"/detail"),component:Tt}),(0,L.jsx)(O.AW,{path:"".concat(r.path,"/edit"),component:Le}),(0,L.jsx)(O.AW,{path:"".concat(r.path,"/relations"),component:Rt}),(0,L.jsx)(O.AW,{path:"".concat(r.path,"/action"),component:U}),(0,L.jsx)(O.AW,{path:"".concat(r.path,"/:relation_").concat(a),component:Ft})]})};const Ft=function(e){var t=e.match;return(0,L.jsxs)(O.rs,{children:[(0,L.jsx)(O.AW,{exact:!0,path:t.url,render:function(e){return(0,L.jsx)(O.l_,{to:"".concat(e.match.url.replace(/\/$/,""),"/list")})}}),(0,L.jsx)(O.AW,{path:"".concat(t.path,"/action/:id"),component:U}),(0,L.jsx)(O.AW,{path:"".concat(t.path,"/list"),component:ke}),(0,L.jsx)(O.AW,{path:"".concat(t.path,"/create"),component:se}),(0,L.jsx)(O.AW,{path:"".concat(t.path,"/:key"),component:_t})]})};var Ut=n(54680);const Mt=(0,o.connect)((function(e,t){return{pathPrefix:"/e",breadcrumbsInfo:e.entities.path.breadcrumbsInfo,currentView:e.entities.path.currentViewTitle?{display:e.entities.path.currentViewTitle,title:e.entities.path.currentViewTitle}:null}}),{})((0,a.ZP)(Ut.Z));var Wt=n(44012),Bt=n(39233);const Ht=function(e){var t=e.currentViewInfo,n="client.admin.entity.errorView.",r="detail"===t.type?"detailTitle":"defaultTitle",a="listDescription";return"detail"===t.type?a="detailDescription":"list"===t.type&&t.error.relationName&&(a="relationDescription"),(0,L.jsx)(Bt.Z,{title:(0,L.jsx)(Wt.Z,{id:n+r}),message:(0,L.jsx)(Wt.Z,{id:n+a,values:t.error})})};const zt=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}))((0,a.ZP)(Ht));var Kt,$t,qt,Gt,Yt=G.ZP.div.withConfig({displayName:"StyledWrapper"})(Kt||(Kt=q()(["\n display: grid;\n grid-template-rows: auto 1fr;\n grid-template-areas:\n 'breadcrumbs'\n 'content';\n height: 100%;\n width: 100%;\n"]))),Jt=G.ZP.div.withConfig({displayName:"StyledContent"})($t||($t=q()(["\n grid-area: content;\n overflow: hidden;\n"]))),Qt=G.ZP.div.withConfig({displayName:"StyledBreadcrumbs"})(qt||(qt=q()(["\n grid-area: breadcrumbs;\n"])));const Xt=function(e){var t=e.match,n=e.history,r=e.loadCurrentRoute,a=e.currentViewInfo,o=n.location;(0,x.useEffect)((function(){r(o)}),[o,r]);var i=null!=a&&a.error?(0,L.jsx)(zt,{history:n}):(0,L.jsxs)(O.rs,{children:[(0,L.jsx)(O.AW,{path:"".concat(t.url,"/action/:actionId"),component:U}),(0,L.jsx)(O.AW,{path:"".concat(t.url,"/:entity"),component:Ft}),(0,L.jsx)(O.AW,{exact:!0,path:t.url,component:Z.Z})]});return(0,L.jsxs)(Yt,{children:[Gt||(Gt=(0,L.jsx)(j.Z.ErrorBoundary,{children:(0,L.jsx)(Qt,{children:(0,L.jsx)(Mt,{})})})),(0,L.jsx)(Jt,{children:i})]})};var en={loadCurrentRoute:function(e){return{type:c,payload:{location:e}}}};const tn=(0,o.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),en)((0,a.ZP)(Xt));var nn,rn=n(34857),an=n(81770);function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){de()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sn=(nn={},de()(nn,i,(function(e,t){var n=t.payload,r=n.location,a=n.currentViewInfo;return cn(cn({},e),{},{currentViewInfos:cn(cn({},e.currentViewInfos),{},de()({},r,cn(cn({},e.currentViewInfos[r]),a)))})})),de()(nn,s,an.Z.singleTransferReducer("breadcrumbsInfo")),de()(nn,l,(function(e,t){var n=t.payload,r=n.path,a=n.breadcrumbsInfo;return cn(cn({},e),{},{breadcrumbsInfo:e.breadcrumbsInfo.map((function(e){return e.path===r?cn(cn({},e),a):e}))})})),de()(nn,u,an.Z.singleTransferReducer("relations")),de()(nn,p,an.Z.singleTransferReducer("relationsInfo")),de()(nn,d,an.Z.singleTransferReducer("currentViewTitle")),de()(nn,m,an.Z.singleTransferReducer("selectedRelation")),nn),ln={currentViewInfos:{},breadcrumbsInfo:[],relations:null,relationsInfo:{},selectedRelation:null};var un=n(57557),dn=n.n(un),pn=n(78718),fn=n.n(pn),hn=n(35937),mn=n.n(hn),yn=n(44759);function vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(n),!0).forEach((function(t){de()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bn=ve().mark(An),wn=ve().mark(In),xn=ve().mark(Dn),Pn=ve().mark(Ln),On=ve().mark(Vn),jn=ve().mark(Fn),Zn=ve().mark(Un),En=ve().mark(Mn),kn=ve().mark(Wn),Rn=ve().mark(Bn),Nn=ve().mark(Hn),Cn=function(e){return e.entities.path},Sn=/[^/]+\/?[^/]+/g;function An(){return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,rn.$6)([(0,rn.Fm)(c,In),(0,rn.Fm)(f,Un),(0,rn.Fm)(h,Mn)]);case 2:case"end":return e.stop()}}),bn)}function In(e){var t,n,r,a;return ve().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return t=e.payload.location,n=t.pathname,o.next=4,(0,rn.RE)(Vn,n);case 4:if(!((r=o.sent).length>0)){o.next=16;break}return o.next=8,(0,rn.RE)(Dn,n,r);case 8:if("detail"!==(a=o.sent).type||a.error){o.next=12;break}return o.next=12,(0,rn.RE)(Fn,a.model,a.key);case 12:return o.next=14,(0,rn.RE)(Ln,r);case 14:return o.next=16,(0,rn.RE)(fe.Z.clearPersistedViews,a.level+1);case 16:case"end":return o.stop()}}),wn)}function Dn(e,t){var n;return ve().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,rn.RE)(Tn,e,t);case 2:return n=r.sent,r.next=5,(0,rn.gz)(y(e,n));case 5:return r.abrupt("return",n);case 6:case"end":return r.stop()}}),xn)}function Ln(e){var t;return ve().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,rn.RE)(_n,e);case 2:return t=n.sent,n.next=5,(0,rn.gz)({type:s,payload:{breadcrumbsInfo:t}});case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),Pn)}function Vn(e){var t,n,r,a,o,i,c,s,l,u,d,p,f,h,m,y,v;return ve().wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,(0,rn.RE)(I,e);case 2:if(t=g.sent,n=[],null!==t){g.next=6;break}return g.abrupt("return",n);case 6:if(!t.entity){g.next=70;break}return g.prev=7,g.next=10,(0,rn.RE)(ge.Z.fetchModel,t.entity);case 10:r=g.sent,n.push({type:"list",model:r}),g.next=18;break;case 14:return g.prev=14,g.t0=g.catch(7),n.push({type:"list",error:{entityName:t.entity}}),g.abrupt("return",n);case 18:if(!t.key){g.next=67;break}return g.next=21,(0,rn.RE)(ge.Z.entityExists,r.name,t.key);case 21:if(!g.sent){g.next=29;break}return g.next=25,(0,rn.RE)(ge.Z.fetchDisplay,r.name,t.key);case 25:a=g.sent,n.push({type:"detail",key:t.key,model:r,display:a}),g.next=31;break;case 29:return n.push({type:"detail",error:{entityName:r.label,key:t.key}}),g.abrupt("return",n);case 31:if(!t.relation){g.next=67;break}o=t.relation.split("/"),i=0;case 34:if(!(i<o.length)){g.next=67;break}if(c=o[i],s=n[n.length-1],i%2!=0){g.next=50;break}if(l=c,u=s.model.paths[l]){g.next=43;break}return n.push({type:"list",error:{relationName:l,entityName:s.model.name}}),g.abrupt("return",n);case 43:return d=u.targetEntity,g.next=46,(0,rn.RE)(ge.Z.fetchModel,d);case 46:p=g.sent,n.push({type:"list",model:p,relationName:l,parent:s}),g.next=64;break;case 50:return f=c,h=s.model,g.next=54,(0,rn.RE)(ge.Z.entityExists,h.name,f);case 54:if(!g.sent){g.next=62;break}return g.next=58,(0,rn.RE)(ge.Z.fetchDisplay,h.name,f);case 58:m=g.sent,n.push({type:"detail",model:h,key:f,display:m,relationName:s.relationName,parent:s.parent}),g.next=64;break;case 62:return n.push({type:"detail",error:{entityName:h.name,key:f}}),g.abrupt("return",n);case 64:i++,g.next=34;break;case 67:"create"===t.view?(y=n[n.length-1],v=n[n.length-2],n.push({type:"create",model:y.model,parent:v,relationName:y.relationName})):t.actionId&&n.push({type:"action",actionId:t.actionId}),g.next=71;break;case 70:t.actionId&&n.push({type:"action",actionId:t.actionId});case 71:return g.abrupt("return",n);case 72:case"end":return g.stop()}}),On,null,[[7,14]])}var Tn=function(e,t){var n=t[t.length-1],r=n.parent;return gn(gn({},dn()(n,["parent"])),{},{pathname:e,level:t.length-1},r&&n.relationName&&{parentKey:r.key,reverseRelation:r.model.paths[n.relationName].reverseRelationName,parentModel:r.model})},_n=function(e){var t="";return e.map((function(e){return e.error?{type:"error"}:"action"===e.type?null:(t=(t?t+"/":"")+(e.key?e.key:e.relationName||e.model.name),{type:e.type,display:e.display||e.model.label,path:t+"/"+e.type})})).filter((function(e){return e}))};function Fn(e,t){var n,r;return ve().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n=mn()(e.paths,(function(e){return e.relationDisplay&&e.relationDisplay.show})),r=Object.keys(n).map((function(e){return fn()(n[e],["relationName","reverseRelationName","targetEntity","relationDisplay.label","relationDisplay.order"])})).sort((function(e,t){return e.relationDisplay.order>t.relationDisplay.order?1:-1})),a.next=4,(0,rn.gz)(w(null));case 4:return a.next=6,(0,rn.gz)(g(r));case 6:return a.next=8,(0,rn.RE)(Hn,e.name,t);case 8:case"end":return a.stop()}}),jn)}function Un(e){var t,n,r,a,o;return ve().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.payload.location,n=t.pathname,i.next=4,(0,rn.Ys)(Cn);case 4:if(r=i.sent,a=r.currentViewInfos,"detail"!==(o=a[n]).type||o.error){i.next=12;break}return i.next=10,(0,rn.Cs)(Hn,o.model.name,o.key);case 10:return i.next=12,(0,rn.gz)(w(null));case 12:case"end":return i.stop()}}),Zn)}function Mn(e){var t,n,r,a,o,i,c,s;return ve().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.payload.location,n=t.pathname,l.next=4,(0,rn.RE)(I,n);case 4:if(null==(r=l.sent)||!r.entity||null==r||!r.key){l.next=29;break}return l.prev=6,l.next=9,(0,rn.RE)(Bn,r);case 9:if(!(a=l.sent)){l.next=24;break}return o=a.entityName,i=a.key,l.next=14,(0,rn.RE)(ge.Z.invalidateDisplay,o,i);case 14:return l.next=16,(0,rn.RE)(ge.Z.fetchDisplay,o,i);case 16:return c=l.sent,l.next=19,(0,rn.gz)(y(n,{display:c}));case 19:return l.next=21,(0,rn.RE)(Wn,n);case 21:return s=l.sent,l.next=24,(0,rn.gz)(v(s,{display:c}));case 24:l.next=29;break;case 26:l.prev=26,l.t0=l.catch(6),yn.Z.logError("breadcrumbs invalidation failed",l.t0);case 29:case"end":return l.stop()}}),En,null,[[6,26]])}function Wn(e){var t;return ve().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,rn.RE)(I,e);case 2:if(null!==(t=n.sent)&&t.entity){n.next=5;break}return n.abrupt("return","");case 5:return n.abrupt("return",[t.entity,t.key,t.relation,t.view].filter(Boolean).join("/"));case 6:case"end":return n.stop()}}),kn)}function Bn(e){var t,n,r,a,o,i,c,s,l,u;return ve().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(e&&e.entity&&e.key&&"action"!==e.view){d.next=2;break}return d.abrupt("return",null);case 2:return d.next=4,(0,rn.RE)(ge.Z.fetchModel,e.entity);case 4:if(t=d.sent,e.relation){d.next=7;break}return d.abrupt("return",{entityName:t.name,key:e.key});case 7:if(!((n=e.relation.match(Sn)).length<1)){d.next=10;break}return d.abrupt("return",null);case 10:r=t,a=null,o=0;case 13:if(!(o<n.length)){d.next=25;break}if(i=n[o].split("/"),c=K()(i,2),s=c[0],l=c[1],(u=r.paths[s])&&l){d.next=18;break}return d.abrupt("return",null);case 18:return d.next=20,(0,rn.RE)(ge.Z.fetchModel,u.targetEntity);case 20:r=d.sent,a={entityName:r.name,key:l};case 22:o++,d.next=13;break;case 25:return d.abrupt("return",a);case 26:case"end":return d.stop()}}),Rn)}function Hn(e,t){var n,r,a;return ve().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n="client/entities/".concat(e,"/").concat(t,"/relations"),o.next=3,(0,rn.RE)(ge.Z.requestSaga,n);case 3:return r=o.sent,a=r.body.relations,o.next=7,(0,rn.gz)(b(a));case 7:case"end":return o.stop()}}),Nn)}const zn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ln,t=arguments.length>1?arguments[1]:void 0,n=sn[t.type];return n?n(e,t):e},Kn={container:tn,reducers:{entities:(0,r.UY)({path:zn})},sagas:[An]}},67210:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var r=n(74806),a=n(45650),o=n(12568),i=n(73183),c=n(25660),s=n(80722),l=n(20247),u=n(85893);const d=(0,l.U)((0,r.ZP)((function(e){var t=e.path,n=e.context,r=e.onSuccess,l=e.intl,d=e.locale,p=e.emitAction,f=(0,s.Z)(t),h=f?[{id:"rel".concat(f.model),value:f.key}]:[],m=(0,c.Z)(n,"Domain");return(0,u.jsx)(a.ZP,{entityName:"Domain",formName:m,mode:"create",defaultValues:h,locale:d,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Domain/".concat(t)}]}}];r({title:l.formatMessage({id:"client.docs-browser.createDomainSuccessful"}),remoteEvents:n})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||p(e)},listApp:o.ZP,docsApp:i.default})})))},36340:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var r=n(74806),a=n(45650),o=n(12568),i=n(73183),c=n(25660),s=n(80722),l=n(20247),u=n(85893);const d=(0,l.U)((0,r.ZP)((function(e){var t=e.context,n=e.path,r=e.onSuccess,l=e.intl,d=e.locale,p=e.emitAction,f=(0,s.Z)(n),h=f?[{id:"rel".concat(f.model),value:f.key}]:[],m=(0,c.Z)(t,"Folder");return(0,u.jsx)(a.ZP,{entityName:"Folder",formName:m,mode:"create",defaultValues:h,locale:d,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Folder/".concat(t)}]}}];r({title:l.formatMessage({id:"client.docs-browser.createFolderSuccessful"}),remoteEvents:n})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||p(e)},listApp:o.ZP,docsApp:i.default})})))},96954:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(59713),a=n.n(r),o=n(8156),i=n(85893);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const l=function(e){return(0,i.jsx)(o.Z,s(s({},e),{},{customDeleteEndpoint:"documents/delete"}))}},90100:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var r=n(63038),a=n.n(r),o=n(45650),i=n(12568),c=n(73183),s=n(25660),l=n(20247),u=n(85893);const d=(0,l.U)((function(e){var t=e.selection,n=e.onSuccess,r=e.onCancel,l=e.locale,d=e.context,p=e.emitAction,f=e.navigate,h=t.ids[0].split("/"),m=a()(h,2),y=m[0],v=m[1];"Resource"===y&&(f("/docs/doc/".concat(v,"/detail")),r());var g=(0,s.Z)(d,y);return(0,u.jsx)(o.ZP,{entityName:y,formName:g,entityId:v,mode:"update",locale:l,onEntityUpdated:function(){var e=[{type:"entity-update-event",payload:{entities:[{entityName:"Docs_list_item",key:t.ids[0]}]}}];n({title:null,remoteEvents:e})},onEntityDeleted:function(){var e=[{type:"entity-delete-event",payload:{entities:[{entityName:"Docs_list_item",key:t.ids[0]}]}}];n({title:null,remoteEvents:e})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||p(e)},listApp:i.ZP,docsApp:c.default})}))},4505:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var r,a,o,i=n(74806),c=n(50558),s=n(30081),l=n(20247),u=n(63038),d=n.n(u),p=n(28655),f=n.n(p),h=n(18446),m=n.n(h),y=n(1024),v=n(44012),g=n(38205),b=n(36589),w=n(50258),x=n(65035),P=n(73183),O=n(80722),j=n(85893),Z=g.ZP.div.withConfig({displayName:"StyledButtonsWrapper"})(r||(r=f()(["\n display: flex;\n justify-content: flex-end;\n\n "," {\n margin-right: 0;\n }\n"])),b.Z),E=(0,g.ZP)(w.Z).withConfig({displayName:"StyledLoadMask"})(a||(a=f()(["\n height: auto;\n"]))),k=function(e){return null===e?"Move_root_docs_list_item":"Move_docs_list_item"},R={initialize:s.j2,moveElements:s.w6};const N=(0,l.U)((0,c.connect)((function(e){return{isWaiting:e.docs.move.isWaiting,domainTypes:e.input.domainTypes,rootNodes:e.input.rootNodes,businessUnit:e.input.businessUnit,locale:e.intl.locale}}),R)((0,i.ZP)((function(e){var t=e.selection,n=e.onSuccess,r=e.onError,a=e.path,i=e.initialize,c=e.moveElements,s=e.isWaiting,l=e.domainTypes,u=e.rootNodes,p=e.businessUnit,f=e.locale,h=e.emitAction,g=(0,O.Z)(a),b={model:"Docs_list_item",key:"".concat(g.model,"/").concat(g.key)},w=(0,y.useState)(b),R=d()(w,2),N=R[0],C=R[1];(0,y.useEffect)((function(){i(t,n,r)}),[]);var S=function(e,t){switch(e){case"Domain":return"/docs/domain/".concat(t,"/list");case"Folder":return"/docs/folder/".concat(t,"/list");case"Resource":return;default:throw new Error("Unexpected model: ".concat(e))}};return(0,j.jsxs)(E,{required:[!s],children:[(0,j.jsx)(P.default,{routerType:"routerless",initialLocation:function(){if(null===N)return null;var e=N.key.split("/"),t=d()(e,2),n=t[0],r=t[1];return S(n,r)}(),listLimit:10,selectionStyle:"none",searchFormType:"none",disableViewPersistor:!0,getListFormName:k,onListParentChange:C,getCustomLocation:S,navigationStrategy:{},embedded:!0,emitAction:h,noLeftPadding:!0,domainTypes:l,rootNodes:u,businessUnit:p,sortable:!1,scrollBehaviour:"none",locale:f}),(0,j.jsx)(Z,{children:(0,j.jsx)(x.Z,{onClick:function(){return c(N.key,t.ids)},look:"raised",ink:"primary",disabled:null===N||m()(N,b),children:o||(o=(0,j.jsx)(v.Z,{id:"client.actions.dms-move.button"}))})})]})}))))},82445:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var r=n(59713),a=n.n(r),o=n(45650),i=n(12568),c=n(73183),s=n(85893);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const d=function(e){return(0,s.jsx)(o.ZP,u(u({},e),{},{listApp:i.ZP,docsApp:c.default}))}},25660:(e,t,n)=>{n.d(t,{Z:()=>r});const r=function(e,t){return e.detailFormNames&&e.detailFormNames[t]?e.detailFormNames[t]:"Dms".concat(t)}},67092:(e,t)=>{t.__esModule=!0;t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.getConfirmation=function(e,t){return t(window.confirm(e))},t.supportsHistory=function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},t.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},t.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},t.isExtraneousPopstateEvent=function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")}},88536:(e,t,n)=>{t.__esModule=!0,t.locationsAreEqual=t.createLocation=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=c(n(14149)),o=c(n(54545)),i=n(3074);function c(e){return e&&e.__esModule?e:{default:e}}t.createLocation=function(e,t,n,o){var c=void 0;"string"==typeof e?(c=(0,i.parsePath)(e)).state=t:(void 0===(c=r({},e)).pathname&&(c.pathname=""),c.search?"?"!==c.search.charAt(0)&&(c.search="?"+c.search):c.search="",c.hash?"#"!==c.hash.charAt(0)&&(c.hash="#"+c.hash):c.hash="",void 0!==t&&void 0===c.state&&(c.state=t));try{c.pathname=decodeURI(c.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+c.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(c.key=n),o?c.pathname?"/"!==c.pathname.charAt(0)&&(c.pathname=(0,a.default)(c.pathname,o.pathname)):c.pathname=o.pathname:c.pathname||(c.pathname="/"),c},t.locationsAreEqual=function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&(0,o.default)(e.state,t.state)}},3074:(e,t)=>{t.__esModule=!0;t.addLeadingSlash=function(e){return"/"===e.charAt(0)?e:"/"+e},t.stripLeadingSlash=function(e){return"/"===e.charAt(0)?e.substr(1):e};var n=t.hasBasename=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};t.stripBasename=function(e,t){return n(e,t)?e.substr(t.length):e},t.stripTrailingSlash=function(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e},t.parsePath=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}},t.createPath=function(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}},52540:(e,t,n)=>{var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=u(n(30670)),o=u(n(41143)),i=n(88536),c=n(3074),s=u(n(3405)),l=n(67092);function u(e){return e&&e.__esModule?e:{default:e}}var d="hashchange",p={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+(0,c.stripLeadingSlash)(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:c.stripLeadingSlash,decodePath:c.addLeadingSlash},slash:{encodePath:c.addLeadingSlash,decodePath:c.addLeadingSlash}},f=function(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)},h=function(e){return window.location.hash=e},m=function(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)};t.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(l.canUseDOM,"Hash history needs a DOM");var t=window.history,n=(0,l.supportsGoWithoutReloadUsingHash)(),u=e.getUserConfirmation,y=void 0===u?l.getConfirmation:u,v=e.hashType,g=void 0===v?"slash":v,b=e.basename?(0,c.stripTrailingSlash)((0,c.addLeadingSlash)(e.basename)):"",w=p[g],x=w.encodePath,P=w.decodePath,O=function(){var e=P(f());return(0,a.default)(!b||(0,c.hasBasename)(e,b),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+e+'" to begin with "'+b+'".'),b&&(e=(0,c.stripBasename)(e,b)),(0,i.createLocation)(e)},j=(0,s.default)(),Z=function(e){r(K,e),K.length=t.length,j.notifyListeners(K.location,K.action)},E=!1,k=null,R=function(){var e=f(),t=x(e);if(e!==t)m(t);else{var n=O(),r=K.location;if(!E&&(0,i.locationsAreEqual)(r,n))return;if(k===(0,c.createPath)(n))return;k=null,N(n)}},N=function(e){if(E)E=!1,Z();else{j.confirmTransitionTo(e,"POP",y,(function(t){t?Z({action:"POP",location:e}):C(e)}))}},C=function(e){var t=K.location,n=D.lastIndexOf((0,c.createPath)(t));-1===n&&(n=0);var r=D.lastIndexOf((0,c.createPath)(e));-1===r&&(r=0);var a=n-r;a&&(E=!0,_(a))},S=f(),A=x(S);S!==A&&m(A);var I=O(),D=[(0,c.createPath)(I)],L=function(e){return"#"+x(b+(0,c.createPath)(e))},V=function(e,t){(0,a.default)(void 0===t,"Hash history cannot push state; it is ignored");var n="PUSH",r=(0,i.createLocation)(e,void 0,void 0,K.location);j.confirmTransitionTo(r,n,y,(function(e){if(e){var t=(0,c.createPath)(r),o=x(b+t);if(f()!==o){k=t,h(o);var i=D.lastIndexOf((0,c.createPath)(K.location)),s=D.slice(0,-1===i?0:i+1);s.push(t),D=s,Z({action:n,location:r})}else(0,a.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),Z()}}))},T=function(e,t){(0,a.default)(void 0===t,"Hash history cannot replace state; it is ignored");var n="REPLACE",r=(0,i.createLocation)(e,void 0,void 0,K.location);j.confirmTransitionTo(r,n,y,(function(e){if(e){var t=(0,c.createPath)(r),a=x(b+t);f()!==a&&(k=t,m(a));var o=D.indexOf((0,c.createPath)(K.location));-1!==o&&(D[o]=t),Z({action:n,location:r})}}))},_=function(e){(0,a.default)(n,"Hash history go(n) causes a full page reload in this browser"),t.go(e)},F=function(){return _(-1)},U=function(){return _(1)},M=0,W=function(e){1===(M+=e)?(0,l.addEventListener)(window,d,R):0===M&&(0,l.removeEventListener)(window,d,R)},B=!1,H=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=j.setPrompt(e);return B||(W(1),B=!0),function(){return B&&(B=!1,W(-1)),t()}},z=function(e){var t=j.appendListener(e);return W(1),function(){W(-1),t()}},K={length:t.length,action:"POP",location:I,createHref:L,push:V,replace:T,go:_,goBack:F,goForward:U,block:H,listen:z};return K}},3405:(e,t,n)=>{t.__esModule=!0;var r,a=n(30670),o=(r=a)&&r.__esModule?r:{default:r};t.default=function(){var e=null,t=[];return{setPrompt:function(t){return(0,o.default)(null==e,"A history supports only one prompt at a time"),e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,a):((0,o.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),a(!0)):a(!1!==i)}else a(!0)},appendListener:function(e){var n=!0,r=function(){n&&e.apply(void 0,arguments)};return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}},44049:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(14892);const a=(o=r.Z,i=o.getIn,function(e,t){return function(n){var r=t||function(e){return i(e,"form")};return i(r(n),e+".initial")}});var o,i}}]);