tocco-admin 1.0.90 → 1.0.93

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 +1 @@
1
- "use strict";(self.webpackChunktocco_admin=self.webpackChunktocco_admin||[]).push([[85],{57387:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var r=n(27361),o=n.n(r),a=n(74806),i=n(50558),c=n(29785),s=n(59713),l=n.n(s),u=(n(9230),n(17563)),p=n(73183),d=n(6699),f=n(90169),m=n(85893);function h(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?h(Object(n),!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=function(e){var t=e.entityName,n=e.entityKeys,r=e.children,o=n.map((function(e){return{entityName:t,key:e}}));return(0,m.jsx)(d.Z,{to:"/docs?rootNodes=".concat(JSON.stringify(o)),target:"_blank",children:r})};const v=function(e){var t=u.parse(e.history.location.search);return(0,m.jsx)(p.default,y(y(y({},e),{},{routerType:"inherit",navigationStrategy:{ListLink:g,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 x={container:(0,i.connect)((function(e,t){return{searchFormCollapsed:o()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",null)}}),b)((0,a.ZP)(v))}},23847:(e,t,n)=>{n.r(t),n.d(t,{default:()=>$n});var r=n(15857),o=n(74806),a=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",p="path/SET_CURRENT_VIEW_TITLE",d="path/SET_RELATIONS_INFO",f="path/PROPAGATE_REFRESH",m="path/INVALIDATE_LAST_BREADCRUMB",h="path/SELECT_RELATION",y=function(e,t){return{type:i,payload:{location:e,currentViewInfo:t}}},g=function(e,t){return{type:l,payload:{path:e,breadcrumbsInfo:t}}},v=function(e){return{type:u,payload:{relations:e}}},b=function(e){return{type:d,payload:{relationsInfo:e}}},x=function(e){return{type:h,payload:{selectedRelation:e}}},w=(n(9230),n(1024)),k=n.n(w),j=n(80467),Z=n(19743),P=n(98235),O=n(27361),_=n.n(O),N=n(75354),R=n(70696),C=n(87467),E=n(90169),D=n(44448),S={"widget-code-copy":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,99294))})),"user-qr-action":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,83754))})),"input-edit":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,83712))})),resourcescheduler:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,773))})),"show-output-jobs-action":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,79191))})),delete:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,74259))})),merge:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,55393))})),copy:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,20995))})),"entity-report":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,85904))})),documents:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,62902))})),"password-update":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,58538))})),"widget-config-edit":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,24818))})),"connect-principal":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,95751))})),export:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,17715))}))};const I=D.Z.actionFactory(S);var T=n(85893),V=function(e){var t=e.history,n=e.match,r=e.setCurrentViewTitle,o=e.currentViewInfo,a=e.intl,i=t.location;if((0,w.useEffect)((function(){return o&&r(a.formatMessage({id:"client.actions.".concat(o.actionId,".title")})),function(){r(null)}}),[o,r,a]),!o)return null;var c=N.Z.fromQueryString(i.search),s=_()(i,"state.selection",c.actionProperties),l=_()(i,"state.definition.properties",c.actionProperties),u=function(){t.replace((0,C.H)(n.url,2))};return(0,T.jsx)(I,{history:t,match:n,appId:o.actionId,selection:s,actionProperties:l,navigationStrategy:(0,E.ZP)(t,n),onSuccess:u,onError:u,onCancel:u})},L=function(e,t){return 0===Object.keys(R.Z.difference(e,t)).length};const A=k().memo(V,L);var F={setCurrentViewTitle:function(e){return{type:p,payload:{currentViewTitle:e}}}};const M=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),F)((0,o.ZP)(A));var B,z=n(50600),$=n(91073),U=n(319),W=n.n(U),q=n(63038),H=n.n(q),K=n(28655),G=n.n(K),Y=n(58804),J=n(12274),X=n(88601),Q=n(7281),ee=Y.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(B||(B=G()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),X.Z.color("paper"),Q.Z.space(0));const te=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,o=e.intl,a=e.chooseDocument,i=e.dispatchEmittedAction,c=n.location,s=_()(c,"state.defaultValues",[]),l=(0,w.useState)(!1),u=H()(l,2),p=u[0],d=u[1];if(!t)return null;var f,m=t.model,h=t.reverseRelation,y=t.parentKey,g=m.name,v=_()(m,"paths.".concat(h,".multi"),!1),b=[].concat(W()(h&&y?[{id:h,value:v?[y]:y}]:[]),W()(s));return(0,T.jsxs)(ee,{children:[(0,T.jsx)(j.NL,{when:p,message:(f="client.entity-browser.detail.confirmTouchedFormLeave",o.formatMessage({id:f}))}),(0,T.jsx)(J.ZP,{entityName:g,formName:g,mode:"create",defaultValues:b,emitAction:function(e){i(e)},navigationStrategy:(0,E.ZP)(n,r),chooseDocument:a,onEntityCreated:function(e){var t=e.id;d(!1),n.push(r.url.replace(/create$/,t))},onTouchedChange:function(e){var t=e.touched;return d(t)}})]})};var ne={chooseDocument:$.Z.actions.chooseDocument,dispatchEmittedAction:z.Z.dispatchEmittedAction};const re=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),ne)((0,o.ZP)(te));var oe=n(29785),ae=n(59713),ie=n.n(ae),ce=n(17563),se=n(79217),le=n(29441),ue=n(48926),pe=n.n(ue),de=n(87757),fe=n.n(de),me=n(63094),he=n(73183);function ye(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 ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ve=function(e){var t=e.entityName,n=e.entityKey,r=e.showActions,o=e.noLeftPadding,a=e.openResource,i=e.initialLocation,c=e.sortable,s=(0,w.useState)(null),l=H()(s,2),u=l[0],p=l[1],d=(0,w.useCallback)(pe()(fe().mark((function e(){return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:me.Z.simpleRequest("entities/2.0/"+t+"/"+n+"/entitydocs/folder").then((function(e){p(e.body.key)}));case 1:case"end":return e.stop()}}),e)}))),[t,n]);return(0,w.useEffect)((function(){d()}),[d]),u&&(0,T.jsx)(he.default,ge(ge(ge({routerType:"routerless",initialLocation:i,noLeftPadding:o,sortable:c,searchFormType:"none",rootNodes:[{key:u,entityName:"Folder"}],embedded:!0,showActions:r},!1===r?{selectionStyle:"none"}:{}),{},{disableViewPersistor:!0},a?{openResource:a}:{}),{},{scrollBehaviour:"inline"}))};const be=function(e){var t=e.currentViewInfo,n=e.initialLocation;return(0,T.jsx)(ve,{noLeftPadding:!1,entityName:t.parentModel.name,entityKey:t.parentKey,showActions:!0,initialLocation:n})};function xe(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?xe(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ke=function(e){var t=e.match,n=e.history,r=e.currentViewInfo,o=e.emitAction,a=e.searchFormCollapsed,i=e.saveUserPreferences;if(!r)return null;var c=ce.parse(n.location.search),s=n.location.hash?n.location.hash.substring(1):null;return"Resource"===r.model.name?(0,T.jsx)(be,{currentViewInfo:r,initialLocation:s}):(0,T.jsx)(se.ZP,we(we({emitAction:o,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,E.ZP)(n,t),searchFormPosition:"left",searchFormType:"admin",scrollBehaviour:"inline",store:le.Z.viewInfoSelector(n.location.pathname).store,onStoreCreate:function(e){le.Z.persistViewInfo(n.location.pathname,{store:e},r.level)},actionAppComponent:I,tql:c.tql,searchFormCollapsed:a,onSearchFormCollapsedChange:function(e){var t=e.collapsed;i({"admin.list.searchFormCollapsed":t})}}))};var je={emitAction:function(e){return z.Z.dispatchEmittedAction(e)},saveUserPreferences:oe.RK};const Ze=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],searchFormCollapsed:_()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",!1)}}),je)((0,o.ZP)(ke));var Pe;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 _e(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){ie()(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}var Ne=Y.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(Pe||(Pe=G()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),X.Z.color("paper"),Q.Z.space(0));const Re=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,o=e.intl,a=e.chooseDocument,i=e.emitAction,c=e.propagateRefresh,s=e.invalidateLastBreadcrumb,l=(0,w.useState)(!1),u=H()(l,2),p=u[0],d=u[1];if(!t||t.pathname!==n.location.pathname)return null;var f=ce.parse(location.search).formName,m=t.model.name;return(0,T.jsxs)(Ne,{children:[(0,T.jsx)(j.NL,{when:p,message:function(e){return n.location.pathname!==e.pathname&&(t="client.entity-browser.detail.confirmTouchedFormLeave",o.formatMessage({id:t}));var t}}),(0,T.jsx)(J.ZP,{entityName:m,entityId:t.key,formName:f||m,mode:"update",emitAction:i,onTouchedChange:function(e){var t=e.touched;d(t)},navigationStrategy:_e(_e({},(0,E.ZP)(n,r)),{},{navigateToCreateRelative:function(e,t){if(e){var o=(0,C.H)(r.url,1);n.push({pathname:"".concat(o,"/").concat(e,"/create"),state:t})}else{var a=(0,C.H)(r.url,2);n.push({pathname:a+"/create",state:t})}}}),chooseDocument:a,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:I,onSubGridRowClick:function(e){var t=e.id,o=e.relationName,a=(0,C.H)(r.url);n.push("".concat(a,"/").concat(o,"/").concat(t))}})]})};var Ce={chooseDocument:$.Z.actions.chooseDocument,emitAction:function(e){return z.Z.dispatchEmittedAction(e)},propagateRefresh:function(e){return{type:f,payload:{location:e}}},invalidateLastBreadcrumb:function(e){return{type:m,payload:{location:e}}}};const Ee=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),Ce)((0,o.ZP)(Re));var De=n(34206),Se=n(88162),Ie={};const Te=function(e){var t=e.currentViewInfo,n=e.history,r=e.selectedRelation,o=e.sortable;return(0,T.jsx)(ve,{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:o})};var Ve=function(e){var t=e.selectedRelation,n=e.currentViewInfo,r=e.match,o=e.history,a=e.emitAction,i="".concat(t.reverseRelationName).concat(t.relationName);return(0,T.jsx)(se.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,E.ZP)(o,r),onRowClick:function(e){var n=e.id,a=r.url.replace(/detail$/,"");o.push("".concat(a).concat(t.relationName,"/").concat(n))},onNavigateToCreate:function(){var e=(0,C.H)(r.url);o.push(e+"/"+t.relationName+"/create")},searchFormType:"fulltext",selectionStyle:"none",store:le.Z.viewInfoSelector(o.location.pathname)["store-".concat(i)],onStoreCreate:function(e){le.Z.persistViewInfo(n.pathname,ie()({},"store-".concat(i),e),n.level)},showActions:!1,limit:15,emitAction:a,scrollBehaviour:"inline"},t.reverseRelationName+t.targetEntity)};const Le=k().memo(Ve);var Ae,Fe,Me,Be,ze,$e,Ue,We,qe,He,Ke,Ge,Ye,Je=n(6699),Xe=n(65035),Qe=n(11347),et=n(86491),tt=n(69829),nt=n(30759),rt=Y.ZP.div.withConfig({displayName:"StyledRelationsViewWrapper"})(Ae||(Ae=G()(["\n display: ",";\n height: 100%;\n flex-direction: column;\n"])),(function(e){return e.isCollapsed?"none":"flex"})),ot=Y.ZP.div.withConfig({displayName:"StyledPlaceHolder"})(Fe||(Fe=G()(["\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.isCollapsed?"flex":"none"}),X.Z.color("paper"),Q.Z.space(-1.5),Q.Z.space(-2.5)),at=Y.ZP.div.withConfig({displayName:"StyledToggleCollapse"})(Me||(Me=G()(["\n display: flex;\n background-color: ",";\n padding-top: ",";\n padding-bottom: ",";\n"])),X.Z.color("paper"),Q.Z.space(-1.5),Q.Z.space(-1.5)),it=(0,Y.ZP)(Xe.Z).withConfig({displayName:"StyledToggleCollapseButton"})(Be||(Be=G()(["\n font-size: ",";\n padding: 0;\n margin-left: auto;\n\n &:hover,\n ",":hover & {\n background-color: transparent;\n color: ",";\n }\n"])),Q.Z.font(0),ot,X.Z.color("secondaryLight")),ct=Y.ZP.div.withConfig({displayName:"StyledPreviewBox"})(ze||(ze=G()(["\n background-color: ",";\n padding: ",";\n margin-top: 3px;\n display: flex;\n flex-direction: column;\n flex: 1;\n"])),X.Z.color("paper"),Q.Z.space(-1)),st=Y.ZP.div.withConfig({displayName:"StyledRelationBoxes"})($e||($e=G()(["\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"),Q.Z.space(-1),Q.Z.space(-2),Qe.C),lt=(0,Y.ZP)(Je.Z).withConfig({displayName:"StyledPreviewLink"})(Ue||(Ue=G()(["\n padding-left: ",";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n"])),Q.Z.space(-.5)),ut=Y.ZP.div.withConfig({displayName:"StyledRelationLinks"})(We||(We=G()(["\n display: none;\n margin-left: auto;\n\n * {\n color: ",";\n padding-left: ",";\n }\n"])),X.Z.color("text"),Q.Z.space(-4.5)),pt=Y.ZP.div.withConfig({displayName:"StyledRelationBox"})(qe||(qe=G()(["\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"),Q.Z.space(-2.7),Q.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(ut," {\n display: flex;\n }\n ")}),(0,et.k)("\n &:hover ".concat(ut," {\n display: flex;\n }\n\n && {\n :hover {\n background-color: ").concat(X.Z.color("secondaryLight"),";\n\n * {\n color: ").concat(X.Z.color("paper"),";\n }\n cursor: pointer;\n }\n }\n\n ").concat(Je.Z,":hover * {\n color: ").concat(X.Z.color("secondary"),";\n }\n "))),dt=(0,Y.ZP)(tt.Fe).withConfig({displayName:"StyledRelationLabel"})(He||(He=G()(["\n && {\n max-width: 110px;\n }\n"]))),ft=Y.ZP.span.withConfig({displayName:"StyledCountLabel"})(Ke||(Ke=G()(["\n ","\n"])),(0,nt.Z)());const mt=function(e){var t,n,r=e.relation,o=e.history,a=e.match,i=e.relationsInfo,c=e.selectRelation,s=e.selectedRelation,l=e.intl,u=e.entityName,p=r.relationName,d=r.targetEntity,f=r.relationDisplay,m=function(e){return l.formatMessage({id:e})},h=a.url.replace(/(relations|detail)$/,p),y=a.url.replace(/(relations|detail)$/,p)+"/create";return(0,T.jsxs)(pt,{selected:(null==s?void 0:s.relationName)===p,onClick:function(){c(r),o.replace({search:"?relation=".concat(p)}),function(e,t){Ie[e]=t}(u,p)},children:[(0,T.jsx)(dt,{title:f.label,children:f.label}),(null===(n=i[p])||void 0===n?void 0:n.count)>0?(0,T.jsxs)(ft,{children:[" (",i[p].count,")"]}):null,(0,T.jsxs)(ut,{children:[(0,T.jsx)(Je.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkView"),to:h,children:Ge||(Ge=(0,T.jsx)(Se.Z,{icon:"arrow-right"}))}),(null===(t=i[p])||void 0===t?void 0:t.createPermission)&&"Resource"!==d&&(0,T.jsx)(Je.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkCreate"),to:y,children:Ye||(Ye=(0,T.jsx)(Se.Z,{icon:"plus"}))})]})]})};var ht,yt,gt;function vt(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 bt=function(e){var t=e.history,n=e.match,r=e.currentViewInfo,o=e.relations,a=e.relationsInfo,i=e.emitAction,c=e.intl,s=e.isCollapsed,l=e.toggleCollapse,u=e.selectedRelation,p=e.selectRelation,d=_()(r,"model.name"),f=(0,w.useCallback)((function(){if((null==o?void 0:o.length)>0){var e=ce.parse(t.location.search).relation;if(e)p(o.find((function(t){return t.relationName===e})));else{var n=Ie[d];p(n?o.find((function(e){return e.relationName===n})):o[0])}}}),[o,d,t.location.search,p]);if((0,w.useEffect)(f,[f]),(0,w.useEffect)((function(){return u?null:f()}),[u,f]),!o||0===o.length||!r)return null;var m,h,y=function(e){return c.formatMessage({id:e})},g=u?"Resource"===u.targetEntity?Te:Le:function(){return ht||(ht=(0,T.jsx)(k().Fragment,{}))},v=o.map((function(t){return(0,T.jsx)(mt,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({relation:t,entityName:d},e),"relation-".concat(t.relationName))}));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(rt,{isCollapsed:s,children:[(0,T.jsx)(at,{children:(0,T.jsx)(it,{icon:"chevron-right",onClick:l})}),(0,T.jsx)(st,{children:v}),u&&(0,T.jsxs)(ct,{children:[(0,T.jsxs)(De.ZP.H4,{children:[u.relationDisplay.label,(0,T.jsx)(lt,{"aria-label":y("client.admin.entities.relationsView.relationLinkView"),to:n.url.replace(/(relations|detail)$/,u.relationName),children:yt||(yt=(0,T.jsx)(Se.Z,{icon:"arrow-right"}))}),(m=u.relationName,(null===(h=a[m])||void 0===h?void 0:h.createPermission)&&"Resource"!==u.targetEntity&&(0,T.jsx)(lt,{"aria-label":y("client.admin.entities.relationsView.relationLinkCreate"),to:n.url.replace(/(relations|detail)$/,u.relationName)+"/create",children:gt||(gt=(0,T.jsx)(Se.Z,{icon:"plus"}))}))]}),(0,T.jsx)(g,{selectedRelation:u,match:n,history:t,currentViewInfo:r,emitAction:i,sortable:!0})]})]}),(0,T.jsx)(ot,{onClick:l,isCollapsed:s,children:(0,T.jsx)(it,{icon:"chevron-left",isCollapsed:s})})]})},xt=function(e,t){return 0===Object.keys(R.Z.difference(e,t)).length};const wt=k().memo(bt,xt);var kt={emitAction:function(e){return z.Z.dispatchEmittedAction(e)},selectRelation:x};const jt=(0,a.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,o.ZP)(wt));var Zt,Pt,Ot,_t=Y.ZP.div.withConfig({displayName:"StyledDetailViewContainer"})(Zt||(Zt=G()(["\n display: flex;\n flex-direction: row;\n height: 100%;\n\n .react-bs-container-body {\n height: auto !important;\n }\n"]))),Nt=Y.ZP.div.withConfig({displayName:"StyledDetailViewLeft"})(Pt||(Pt=G()(["\n flex: 1;\n margin-right: 1rem;\n ","\n"])),(function(e){return!e.isCollapsed&&" @media(max - width: 1024px) {\n flex: none;\n width: 40%;\n }"})),Rt=Y.ZP.div.withConfig({displayName:"StyledDetailViewRight"})(Ot||(Ot=G()(["\n flex: ",";\n"])),(function(e){return e.isCollapsed?"0":"1"}));const Ct=function(e){var t=e.match,n=e.history,r=(e.currentViewInfo,e.relationViewCollapsed),o=e.saveUserPreferences,a=(0,w.useState)(!1),i=H()(a,2),c=i[0],s=i[1];(0,w.useEffect)((function(){s(r)}),[r]);var l=function(e){o({"admin.detail.relationViewCollapsed":e})};return(0,T.jsxs)(_t,{children:[(0,T.jsx)(Nt,{isCollapsed:c,children:(0,T.jsx)(Z.Z.ErrorBoundary,{children:(0,T.jsx)(Ee,{match:t,history:n})})}),(0,T.jsx)(Rt,{isCollapsed:c,children:(0,T.jsx)(Z.Z.ErrorBoundary,{children:(0,T.jsx)(jt,{match:t,history:n,isCollapsed:c,toggleCollapse:function(){s(!c),l(!c)}})})})]})};var Et={saveUserPreferences:oe.RK};const Dt=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relationViewCollapsed:_()(e.preferences.userPreferences,"admin.detail.relationViewCollapsed",!1)}}),Et)((0,o.ZP)(Ct));const St=function(e){var t,n,r=e.match,o=(t=r.path,n=":relation",t.split(n).length-1);return(0,T.jsxs)(j.rs,{children:[(0,T.jsx)(j.AW,{exact:!0,path:"".concat(r.url),render:function(e){var t=e.match;return(0,T.jsx)(j.l_,{to:"".concat(t.url.replace(/\/$/,""),"/detail")})}}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/detail"),component:Dt}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/edit"),component:Ee}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/relations"),component:jt}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/action"),component:M}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/:relation_").concat(o),component:It})]})};const It=function(e){var t=e.match;return(0,T.jsxs)(j.rs,{children:[(0,T.jsx)(j.AW,{exact:!0,path:t.url,render:function(e){var t=e.match;return(0,T.jsx)(j.l_,{to:"".concat(t.url.replace(/\/$/,""),"/list")})}}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/action/:id"),component:M}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/list"),component:Ze}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/create"),component:re}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/:key"),component:St})]})};var Tt=n(2977);const Vt=(0,a.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,o.ZP)(Tt.Z));var Lt=n(44012),At=n(39233);const Ft=function(e){var t=e.currentViewInfo,n="client.admin.entity.errorView.",r="detail"===t.type?"detailTitle":"defaultTitle",o="listDescription";return"detail"===t.type?o="detailDescription":"list"===t.type&&t.error.relationName&&(o="relationDescription"),(0,T.jsx)(At.Z,{title:(0,T.jsx)(Lt.Z,{id:n+r}),message:(0,T.jsx)(Lt.Z,{id:n+o,values:t.error})})};const Mt=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}))((0,o.ZP)(Ft));var Bt,zt,$t,Ut,Wt=Y.ZP.div.withConfig({displayName:"StyledWrapper"})(Bt||(Bt=G()(["\n display: grid;\n grid-template-rows: auto 1fr;\n grid-template-areas:\n 'breadcrumbs'\n 'content';\n height: 100%;\n width: 100%;\n"]))),qt=Y.ZP.div.withConfig({displayName:"StyledContent"})(zt||(zt=G()(["\n grid-area: content;\n overflow: hidden;\n"]))),Ht=Y.ZP.div.withConfig({displayName:"StyledBreadcrumbs"})($t||($t=G()(["\n grid-area: breadcrumbs;\n"])));const Kt=function(e){var t=e.match,n=e.history,r=e.loadCurrentRoute,o=e.currentViewInfo,a=n.location;(0,w.useEffect)((function(){r(a)}),[a,r]);var i=null!=o&&o.error?(0,T.jsx)(Mt,{history:n}):(0,T.jsxs)(j.rs,{children:[(0,T.jsx)(j.AW,{path:"".concat(t.url,"/action/:actionId"),component:M}),(0,T.jsx)(j.AW,{path:"".concat(t.url,"/:entity"),component:It}),(0,T.jsx)(j.AW,{exact:!0,path:t.url,component:P.Z})]});return(0,T.jsxs)(Wt,{children:[Ut||(Ut=(0,T.jsx)(Z.Z.ErrorBoundary,{children:(0,T.jsx)(Ht,{children:(0,T.jsx)(Vt,{})})})),(0,T.jsx)(qt,{children:i})]})};var Gt={loadCurrentRoute:function(e){return{type:c,payload:{location:e}}}};const Yt=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),Gt)((0,o.ZP)(Kt));var Jt,Xt=n(34857),Qt=n(81770);function en(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 tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?en(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nn=(Jt={},ie()(Jt,i,(function(e,t){var n=t.payload,r=n.location,o=n.currentViewInfo;return tn(tn({},e),{},{currentViewInfos:tn(tn({},e.currentViewInfos),{},ie()({},r,tn(tn({},e.currentViewInfos[r]),o)))})})),ie()(Jt,s,Qt.Z.singleTransferReducer("breadcrumbsInfo")),ie()(Jt,l,(function(e,t){var n=t.payload,r=n.path,o=n.breadcrumbsInfo;return tn(tn({},e),{},{breadcrumbsInfo:e.breadcrumbsInfo.map((function(e){return e.path===r?tn(tn({},e),o):e}))})})),ie()(Jt,u,Qt.Z.singleTransferReducer("relations")),ie()(Jt,d,Qt.Z.singleTransferReducer("relationsInfo")),ie()(Jt,p,Qt.Z.singleTransferReducer("currentViewTitle")),ie()(Jt,h,Qt.Z.singleTransferReducer("selectedRelation")),Jt),rn={currentViewInfos:{},breadcrumbsInfo:[],relations:null,relationsInfo:{},selectedRelation:null};var on=n(57557),an=n.n(on),cn=n(78718),sn=n.n(cn),ln=n(35937),un=n.n(ln),pn=n(44759),dn=n(96801),fn=function(e){var t=dn.Z.extractParamsFromPath("/e/:entity/:key?/:relation*/:view(list|detail|edit|create|relations|action)/:actionId?",e),n=dn.Z.extractParamsFromPath("/e/action/:actionId",e);return t||n};function mn(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 hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yn=fe().mark(Rn),gn=fe().mark(Cn),vn=fe().mark(En),bn=fe().mark(Dn),xn=fe().mark(Sn),wn=fe().mark(Vn),kn=fe().mark(Ln),jn=fe().mark(An),Zn=fe().mark(Fn),Pn=fe().mark(Mn),On=fe().mark(Bn),_n=function(e){return e.entities.path},Nn=/[^/]+\/?[^/]+/g;function Rn(){return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Xt.$6)([(0,Xt.Fm)(c,Cn),(0,Xt.Fm)(f,Ln),(0,Xt.Fm)(m,An)]);case 2:case"end":return e.stop()}}),yn)}function Cn(e){var t,n,r,o;return fe().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=e.payload.location,n=t.pathname,a.next=4,(0,Xt.RE)(Sn,n);case 4:if(!((r=a.sent).length>0)){a.next=16;break}return a.next=8,(0,Xt.RE)(En,n,r);case 8:return o=a.sent,a.next=11,(0,Xt.RE)(Dn,r);case 11:if("detail"!==o.type||o.error){a.next=14;break}return a.next=14,(0,Xt.Cs)(Vn,o.model,o.key);case 14:return a.next=16,(0,Xt.RE)(le.Z.clearPersistedViews,o.level+1);case 16:case"end":return a.stop()}}),gn)}function En(e,t){var n;return fe().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,Xt.RE)(In,e,t);case 2:return n=r.sent,r.next=5,(0,Xt.gz)(y(e,n));case 5:return r.abrupt("return",n);case 6:case"end":return r.stop()}}),vn)}function Dn(e){var t;return fe().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Xt.RE)(Tn,e);case 2:return t=n.sent,n.next=5,(0,Xt.gz)({type:s,payload:{breadcrumbsInfo:t}});case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),bn)}function Sn(e){var t,n,r,o,a,i,c,s,l,u,p,d,f,m,h,y,g;return fe().wrap((function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,(0,Xt.RE)(fn,e);case 2:if(t=v.sent,n=[],null!==t){v.next=6;break}return v.abrupt("return",n);case 6:if(!t.entity){v.next=70;break}return v.prev=7,v.next=10,(0,Xt.RE)(me.Z.fetchModel,t.entity);case 10:r=v.sent,n.push({type:"list",model:r}),v.next=18;break;case 14:return v.prev=14,v.t0=v.catch(7),n.push({type:"list",error:{entityName:t.entity}}),v.abrupt("return",n);case 18:if(!t.key){v.next=67;break}return v.next=21,(0,Xt.RE)(me.Z.entityExists,r.name,t.key);case 21:if(!v.sent){v.next=29;break}return v.next=25,(0,Xt.RE)(me.Z.fetchDisplay,r.name,t.key);case 25:o=v.sent,n.push({type:"detail",key:t.key,model:r,display:o}),v.next=31;break;case 29:return n.push({type:"detail",error:{entityName:r.label,key:t.key}}),v.abrupt("return",n);case 31:if(!t.relation){v.next=67;break}a=t.relation.split("/"),i=0;case 34:if(!(i<a.length)){v.next=67;break}if(c=a[i],s=n[n.length-1],i%2!=0){v.next=50;break}if(l=c,u=s.model.paths[l]){v.next=43;break}return n.push({type:"list",error:{relationName:l,entityName:s.model.name}}),v.abrupt("return",n);case 43:return p=u.targetEntity,v.next=46,(0,Xt.RE)(me.Z.fetchModel,p);case 46:d=v.sent,n.push({type:"list",model:d,relationName:l,parent:s}),v.next=64;break;case 50:return f=c,m=s.model,v.next=54,(0,Xt.RE)(me.Z.entityExists,m.name,f);case 54:if(!v.sent){v.next=62;break}return v.next=58,(0,Xt.RE)(me.Z.fetchDisplay,m.name,f);case 58:h=v.sent,n.push({type:"detail",model:m,key:f,display:h,relationName:s.relationName,parent:s.parent}),v.next=64;break;case 62:return n.push({type:"detail",error:{entityName:m.name,key:f}}),v.abrupt("return",n);case 64:i++,v.next=34;break;case 67:"create"===t.view?(y=n[n.length-1],g=n[n.length-2],n.push({type:"create",model:y.model,parent:g,relationName:y.relationName})):t.actionId&&n.push({type:"action",actionId:t.actionId}),v.next=71;break;case 70:t.actionId&&n.push({type:"action",actionId:t.actionId});case 71:return v.abrupt("return",n);case 72:case"end":return v.stop()}}),xn,null,[[7,14]])}var In=function(e,t){var n=t[t.length-1],r=n.parent;return hn(hn({},an()(n,["parent"])),{},{pathname:e,level:t.length-1},r&&n.relationName&&{parentKey:r.key,reverseRelation:r.model.paths[n.relationName].reverseRelationName,parentModel:r.model})},Tn=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 Vn(e,t){var n,r;return fe().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=un()(e.paths,(function(e,t){return e.relationDisplay&&e.relationDisplay.show})),r=Object.keys(n).map((function(e){return sn()(n[e],["relationName","reverseRelationName","targetEntity","relationDisplay.label","relationDisplay.order"])})).sort((function(e,t){return e.relationDisplay.order>t.relationDisplay.order?1:-1})),o.next=4,(0,Xt.gz)(x(null));case 4:return o.next=6,(0,Xt.gz)(v(r));case 6:return o.next=8,(0,Xt.RE)(Bn,e.name,t);case 8:case"end":return o.stop()}}),wn)}function Ln(e){var t,n,r,o,a;return fe().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.payload.location,n=t.pathname,i.next=4,(0,Xt.Ys)(_n);case 4:if(r=i.sent,o=r.currentViewInfos,"detail"!==(a=o[n]).type||a.error){i.next=12;break}return i.next=10,(0,Xt.Cs)(Bn,a.model.name,a.key);case 10:return i.next=12,(0,Xt.gz)(x(null));case 12:case"end":return i.stop()}}),kn)}function An(e){var t,n,r,o,a,i,c,s;return fe().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.payload.location,n=t.pathname,l.next=4,(0,Xt.RE)(fn,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,Xt.RE)(Mn,r);case 9:if(!(o=l.sent)){l.next=24;break}return a=o.entityName,i=o.key,l.next=14,(0,Xt.RE)(me.Z.invalidateDisplay,a,i);case 14:return l.next=16,(0,Xt.RE)(me.Z.fetchDisplay,a,i);case 16:return c=l.sent,l.next=19,(0,Xt.gz)(y(n,{display:c}));case 19:return l.next=21,(0,Xt.RE)(Fn,n);case 21:return s=l.sent,l.next=24,(0,Xt.gz)(g(s,{display:c}));case 24:l.next=29;break;case 26:l.prev=26,l.t0=l.catch(6),pn.Z.logError("breadcrumbs invalidation failed",l.t0);case 29:case"end":return l.stop()}}),jn,null,[[6,26]])}function Fn(e){var t;return fe().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Xt.RE)(fn,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()}}),Zn)}function Mn(e){var t,n,r,o,a,i,c,s,l,u;return fe().wrap((function(p){for(;;)switch(p.prev=p.next){case 0:if(e&&e.entity&&e.key&&"action"!==e.view){p.next=2;break}return p.abrupt("return",null);case 2:return p.next=4,(0,Xt.RE)(me.Z.fetchModel,e.entity);case 4:if(t=p.sent,e.relation){p.next=7;break}return p.abrupt("return",{entityName:t.name,key:e.key});case 7:if(!((n=e.relation.match(Nn)).length<1)){p.next=10;break}return p.abrupt("return",null);case 10:r=t,o=null,a=0;case 13:if(!(a<n.length)){p.next=25;break}if(i=n[a].split("/"),c=H()(i,2),s=c[0],l=c[1],(u=r.paths[s])&&l){p.next=18;break}return p.abrupt("return",null);case 18:return p.next=20,(0,Xt.RE)(me.Z.fetchModel,u.targetEntity);case 20:r=p.sent,o={entityName:r.name,key:l};case 22:a++,p.next=13;break;case 25:return p.abrupt("return",o);case 26:case"end":return p.stop()}}),Pn)}function Bn(e,t){var n,r,o;return fe().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n="client/entities/".concat(e,"/").concat(t,"/relations"),a.next=3,(0,Xt.RE)(me.Z.requestSaga,n);case 3:return r=a.sent,o=r.body.relations,a.next=7,(0,Xt.gz)(b(o));case 7:case"end":return a.stop()}}),On)}const zn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rn,t=arguments.length>1?arguments[1]:void 0,n=nn[t.type];return n?n(e,t):e},$n={container:Yt,reducers:{entities:(0,r.UY)({path:zn})},sagas:[Rn]}},24295:(e,t,n)=>{n.r(t),n.d(t,{default:()=>xe});var r=n(68957),o=n(91411),a=n(86249),i=n.n(a),c=(n(58900),n(78634)),s=n(84100),l=n(60131),u=n(48230),p=n(64952),d=n(469),f=n(81896),m=n(46940),h=n(27361),y=n.n(h),g=n(14293),v=n.n(g),b=n(13218),x=n.n(b),w=n(47037),k=n.n(w),j=n(1024),Z=n(58804),P=(n(39335),n(28212),n(6488),n(32510),n(79657),n(20844),n(41030),n(98827),n(37363),n(53299),n(54159)),O=function(e){return P.Z.executeRequest("rest/".concat(e))},_=function(e){return 200===e.status?e.json():null},N=n(44822),R=n(11259),C=n(32208),E=n(99357),D=n(19241),S=(n(70646),n(1469)),I=n.n(S),T=n(30236),V=n.n(T),L=["==","!=","<=",">=","<",">","~="],A=["true","false","null"],F=["string","long","serial","bool","boolean","double","float","time","timestamp","char","varchar","date","datetime"],M=["now_date","yesterday_date","tomorrow_date","today_date","now_start","yesterday_start","tomorrow_start","today_start","now","yesterday","tomorrow","today","currentUsername","currentUser","currentBu"],B=["in","dateadd","datetimeadd","duedate","birthdayin","fulltext","likeall","distance","inboundingbox"];function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}const $=function(e){return function(t){(0,C.Z)(r,t);var n=z(r);function r(){var t;(0,R.Z)(this,r),t=n.call(this);var o=[{token:"keyword.operator.conjunction",regex:/(\s*)(and|or|not)($|\s+)/,caseInsensitive:!0},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.exists",regex:/exists\s*/,push:"exists",caseInsensitive:!0},{token:"keyword.count",regex:/count\s*/,push:"count",caseInsensitive:!0},{token:["keyword.function.nice_function","paren.lparen.function_arguments","text.function_arguments","paren.rparen","text.whitespace"],regex:"((?:".concat(B.join("|"),")\\s*)(\\()(.*?)(\\))($|\\s+)"),caseInsensitive:!0},{token:"keyword.other.chaining",regex:/\./},{token:"support.function.field",regex:/([a-z_]+)($|\s+)/,push:"comparison"}],a={start:e?[{token:"keyword.where",regex:/\s*/,next:"rootwhere",caseInsensitive:!0}]:[{token:"keyword.find",regex:/find($|\s+)/,push:"model",caseInsensitive:!0},{token:"keyword.where",regex:/where($|\s+)/,next:"rootwhere",caseInsensitive:!0}],model:[{token:"support.class.model",regex:/[A-Z][a-z_0-9]*\s*/,next:"pop"}],rootwhere:[{token:"keyword.order_by",regex:/order by($|\s+)/,next:"order",caseInsensitive:!0}].concat(o),comparison:[{token:"keyword.operator.comparison",regex:"(".concat(L.join("|"),")\\s*"),next:"value"}],value:[{token:"string",regex:/".*?"\s*/,next:"pop"},{token:"constant.numeric",regex:/\d+(.\d+)?\s*/,next:"pop"},{token:"constant.language.tocco_placeholder",regex:"\\:(".concat(M.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"constant.language",regex:"(".concat(A.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"support.type",regex:"(".concat(F.join("|"),"):\\s*"),caseInsensitive:!0}],exists:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"existswhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"pop"}],existswhere:[].concat(o,[{token:"paren.rparen",regex:/\)\s*/,next:"pop"}]),count:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"countwhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}],countwhere:[].concat(o,[{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}]),order:[{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:["support.function.field","keyword.direction","separator"],regex:/([a-z_]+\s*)(asc|desc)?($|,|\s+)/}]};return t.$rules=V()(t.$rules,a,(function(e,t){return I()(e)?e.concat(t):void 0})),t.normalizeRules(),t}return(0,N.Z)(r)}(i().require("ace/mode/text_highlight_rules").TextHighlightRules)};function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}var W=function(e){(0,C.Z)(n,e);var t=U(n);function n(){var e;(0,R.Z)(this,n);return(e=t.call(this)).$rules={start:[{token:"constant.character.entity",regex:/&[^;]+;/},{token:"support.function",regex:"\\?(\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|upper_case|word_list|xhtml|xmlc|round|floor|ceilingiso_[a-z_]+first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunkkeys|valueschildren|parent|root|ancestors|node_name|node_type|node_namespacebyte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|eval|has_content|interpret|is_[a-z_]+|namespacenew)"},{token:"support.function.deprecated",regex:"\\?(default|exists|if_exists|web_safe)"},{token:"language.variable",regex:"\\.(?:data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|now|output_encoding|template_name|url_escaping_charset|vars|version)"},{token:"constant.language",regex:"\\b(true|false)\\b"},{token:"keyword.operator",regex:"\\b(?:gt|gte|lt|lte|as|in|using)\\b"},{token:"entity.other.attribute-name",regex:"encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|attributes"},{token:"string",regex:/['"]/,next:"qstring"},{token:function(e){return e.match("^[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?$")?"constant.numeric":"variable"},regex:/[\w.+-]+/},{token:"keyword.operator",regex:"!|\\.|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^="},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qstring:[{token:"constant.character.escape",regex:'\\\\[nrtvef\\\\"$]'},{token:"string",regex:/['"]/,next:"start"},{defaultToken:"string"}]},e}return(0,N.Z)(n)}(i().require("ace/mode/text_highlight_rules").TextHighlightRules),q=function(e){(0,C.Z)(n,e);var t=U(n);function n(){var e;(0,R.Z)(this,n),e=t.call(this);var r=["query","queryCount"],o=[{token:"keyword.function",regex:"\\[@(".concat(r.join("|"),").*?]"),push:"tql-start"},{token:"comment",regex:"\\[#--",next:"ftl-dcomment"},{token:"string.interpolated",regex:"\\${",push:"ftl-start"},{token:"keyword.function",regex:"\\[/?#(assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|setting|stop|switch|t|visit)",push:"ftl-start"},{token:"keyword.other",regex:"\\[/?@[a-zA-Z\\.]+",push:"ftl-start"}];for(var a in e.$rules)e.$rules[a].unshift.apply(e.$rules[a],o);e.embedRules(W,"ftl-",[{token:"keyword",regex:"/?\\]",next:"pop"},{token:"string.interpolated",regex:"}",next:"pop"}],["start"]),e.addRules({"ftl-dcomment":[{token:"comment",regex:"--\\]",next:"pop"},{defaultToken:"comment"}]});var i=[{token:"keyword.function",regex:"\\[/@(".concat(r.join("|"),")]"),next:"pop"}];e.embedRules($(),"tql-",i,["start"]);var c={"tql-rootwhere":[{token:"keyword.function",regex:"\\[/@(".concat(r.join("|"),")]"),next:"pop"}],"tql-order":[{token:"keyword.function",regex:"\\[/@(".concat(r.join("|"),")]"),next:"pop"}]};return e.$rules=V()(e.$rules,c,(function(e,t){return I()(e)?e.concat(t):void 0})),e.normalizeRules(),e}return(0,N.Z)(n)}(i().require("ace/mode/html_highlight_rules").HtmlHighlightRules),H=n(52902),K=n(45915),G=i().require("ace/token_iterator").TokenIterator,Y=function(e){return e?e.type.substring(e.type.lastIndexOf(".")+1):null},J=function(e,t){return Y(e.getCurrentToken())===t},X=function(e){if(J(e,"model")&&e.stepBackward(),(J(e,"field")||J(e,"relation"))&&e.stepBackward(),!J(e,"chaining"))return null;if(e.stepBackward(),J(e,"model")){var t=e.getCurrentToken();return e.stepBackward(),e.stepBackward(),t?t.value.trim():null}return null},Q=function(e,t){for(;!J(e,t);)if(!e.stepBackward())return!1;return!0},ee=function(e,t){return J(e,"rparen")?1:t>0&&J(e,"lparen")?(e.stepBackward(),-1):0},te=function(e){for(var t=0;e.getCurrentToken();){if(0===t&&J(e,"where")){var n=e.stepBackward();return n?[n.value.trim()].concat((0,K.Z)(re(e))):[]}if(J(e,"order_by")){if(Q(e,"find")){var r=e.stepForward();return r?r.value.trim():[]}return[]}if(t+=ee(e,t),!e.stepBackward())return null}return null},ne=function(e,t){for(var n=[],r=t(e);r;)Array.isArray(r)?r.forEach((function(e){return n.unshift(e)})):n.unshift(r),r=t(e);return n},re=function(e){return ne(e,X)},oe=function(e){return ne(e,te)},ae=1e3,ie=function(e,t,n){var r=function(e,t){if(t){var n=oe(e());return{baseModel:t,modelScope:(0,H.Z)(n).slice(0)}}var r=oe(e()),o=(0,H.Z)(r);return{baseModel:o[0],modelScope:o.slice(1)}}(e,n),o=r.baseModel,a=r.modelScope;if(o){var i=re(e()),c=[].concat((0,K.Z)(a),(0,K.Z)(i)).map((function(e){return"rel".concat(e)}));(function(e){var t=(0,H.Z)(e),n=t[0],r=t.slice(1);return O(function(e,t){var n=t.length>0?"/resolve?path="+t.join("."):"";return"entities/".concat(e,"/model").concat(n)}(n,r)).then(_).then((function(e){if(!e)return[];var t=e.fields||[],n=e.relations||[];return[].concat((0,K.Z)(t.map((function(e){return{label:(t=e,t.label?"".concat(t.fieldName," (").concat(t.label,")"):t.fieldName),value:e.fieldName,meta:e.type};var t}))),(0,K.Z)(n.map((function(e){return{label:(t=e,t.label?"".concat(t.relationName," (").concat(t.label,")"):t.relationName),value:e.relationName,meta:e.targetEntity};var t}))))}))})([o].concat((0,K.Z)(c))).then((function(e){var n=e.map((function(e){return{caption:e.label,value:e.value,meta:e.meta,score:ae}}));t(null,n)})).catch((function(e){return t(e)}))}},ce=function(e,t){return t?"".concat(e," (").concat(t,")"):e},se=function(e){return O("entities").then(_).then((function(e){return e?e.entities:{}})).then((function(e){return e?Object.values(e):[]})).then((function(e){return e.map((function(e){return e.metaData}))})).then((function(t){var n=t.map((function(e){var t=e.modelName,n=e.label;return{caption:ce(t,n),value:t,score:ae}}));e(null,n)})).catch((function(t){return e(t)}))},le=function(){return B.map((function(e){return e.toUpperCase()})).map((function(e){return{caption:e,value:"".concat(e,"()"),meta:"function",score:970}}))};const ue=function(e){return{getCompletions:function(t,n,r,o,a){var i=function(){return new G(n,r.row,r.column)},c=i(),s=c.getCurrentToken(),l=c.stepBackward()?c.getCurrentToken():null;switch(Y(s)){case"chaining":case"relation":case"separator":case"order_by":case"count":case"exists":case"field":case"function_arguments":ie(i,a,e);break;case"where":case"conjunction":ie(i,a,e),a(null,le());break;case"nice_function":a(null,le());break;case"find":se(a);break;case"type":case"tocco_placeholder":case"comparison":a(null,F.map((function(e){return{caption:e,value:"".concat(e,":"),meta:"type",score:980}}))),a(null,M.map((function(e){return{caption:e,value:":".concat(e),meta:"placeholder",score:990}})));break;case"model":ie(i,a,e),l&&"relation"!==Y(l)&&se(a);break;case null:e&&ie(i,a,e),a(null,le())}}}};function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}var de=function(e){(0,C.Z)(n,e);var t=pe(n);function n(){var e;return(0,R.Z)(this,n),(e=t.call(this)).HighlightRules=q,e.completer=ue(),e}return(0,N.Z)(n)}(i().require("ace/mode/ftl").Mode);function fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}var me,he=function(e){(0,C.Z)(n,e);var t=fe(n);function n(e){var r,o=e.implicitModelName;return(0,R.Z)(this,n),(r=t.call(this)).HighlightRules=$(o),r.completer=ue(o),r.snippedIdField=null,r}return(0,N.Z)(n)}(i().require("ace/mode/text").Mode),ye=n(85893),ge=Z.ZP.div.withConfig({displayName:"StyledEditor"})(me||(me=(0,o.Z)(["\n width: 100%;\n z-index: 0; /* gutter lays over menu otherwise */\n"]))),ve={groovy:function(){return new s.Mode},html:function(){return new l.Mode},xml:function(){return new m.Mode},properties:function(){return new d.Mode},json:function(){return new u.Mode},htmlmixed:function(){return new de},freemarkermixed:function(){return new de},ftl:function(){return new de},tql:function(e){return new he(e)},less:function(){return new p.Mode},drools:function(){return new c.Mode},text:function(){return new f.Mode}},be=function(e,t){var n=t.mode,o=t.theme,a=t.showGutter,i=t.editorOptions,c=void 0===i?{}:i;(function(e){return k()(e)?Promise.resolve(e):x()(e)?O("entities/2.0/".concat(e.entityModel,"/").concat(e.key,"?_paths=").concat(e.field)).then(_).then((function(e){return y()(e,["paths","entity_name","value"],null)})):Promise.resolve(null)})(t.implicitModel).then((function(e){return function(e,t){return y()(ve,e,e)(t)}(n,{implicitModelName:e})})).then((function(t){return e.getSession().setMode(t)})),e.setTheme("ace/theme/".concat(o)),Object.entries(c).forEach((function(t){var n=(0,r.Z)(t,2),o=n[0],a=n[1];e.setOption(o,a)})),e.renderer.setShowGutter(a),e.resize()};const xe=function(e){var t=e.mode,n=e.theme,r=void 0===n?"textmate":n,o=e.value,a=e.onChange,c=e.showGutter,s=void 0===c||c,l=e.editorOptions,u=void 0===l?{}:l,p=e.implicitModel,d=(0,j.useRef)(null),f=(0,j.useRef)(null),m=(0,j.useMemo)((function(){return{mode:t,theme:r,showGutter:s,editorOptions:u,implicitModel:p}}),[t,r,s,u,p]);return(0,j.useEffect)((function(){var e=i().edit(d.current);return e.getSession().setValue(o||""),e.on("change",(function(){return a(e.getValue())})),be(e,m),f.current=e,function(){return e.destroy()}}),[]),(0,j.useEffect)((function(){f.current&&be(f.current,m)}),[m]),(0,j.useEffect)((function(){f.current&&!v()(o)&&o!==f.current.getValue()&&f.current.getSession().setValue(o)}),[o]),(0,ye.jsx)(ge,{ref:d})}},38421:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var r,o=n(68957),a=(n(44661),n(1024)),i=n(12520),c=n.n(i),s=n(74806),l=n(58804),u=n(91411),p=l.ZP.span.withConfig({displayName:"StyledChildrenWrapper"})(r||(r=(0,u.Z)(["\n cursor: pointer;\n user-select: none;\n"]))),d=n(85893);const f=function(e){var t=e.children,n=e.onOpen;return(0,d.jsx)(p,{onClick:n,children:t})};(0,n(77281).X)();const m=(0,l.Zz)((0,s.ZP)((function(e){var t,n=e.children,r=e.value,i=e.onChange,s=e.intl,l=s.locale,u=(0,a.useRef)(null),p=(0,a.useState)(!1),m=(0,o.Z)(p,2),h=m[0],y=m[1],g=function(e){var t,n;(y(e),null!==(t=u.current)&&void 0!==t&&t.setPreSelection)&&(null===(n=u.current)||void 0===n||n.setPreSelection(r))};return(0,d.jsx)(c(),{ref:u,selected:r,preSelection:null,onChange:i,showTimeInput:!1,dateFormat:"P",showMonthDropdown:!0,showYearDropdown:!0,scrollableYearDropdown:!0,fixedHeight:!0,showPopperArrow:!1,open:h,onFocus:function(){g(!0)},onClickOutside:function(){g(!1)},locale:l,enableTabLoop:!1,customInput:(0,d.jsx)(f,{onOpen:function(){g(!0)},children:n}),todayButton:(t="client.component.datePicker.todayLabel",s.formatMessage({id:t}))})})))},77281:(e,t,n)=>{n.d(t,{X:()=>i,k:()=>c});n(44661);var r=n(5429),o=n(12520),a=n(82022),i=function(){(0,o.registerLocale)("en",a.Z.getDateFnsLocale("en")),(0,o.registerLocale)("en-US",a.Z.getDateFnsLocale("en")),(0,o.registerLocale)("de-CH",a.Z.getDateFnsLocale("de-CH")),(0,o.registerLocale)("de",a.Z.getDateFnsLocale("de")),(0,o.registerLocale)("fr",a.Z.getDateFnsLocale("fr")),(0,o.registerLocale)("fr-CH",a.Z.getDateFnsLocale("fr")),(0,o.registerLocale)("it",a.Z.getDateFnsLocale("it")),(0,o.registerLocale)("it-CH",a.Z.getDateFnsLocale("it")),(0,o.setDefaultLocale)("de")},c=function(e){var t=(0,r.default)(e);return isNaN(t)?null:t}},64820:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R});var r,o,a,i=n(68957),c=(n(44661),n(75502)),s=n(65809),l=n(94712),u=n(1024),p=n(12520),d=n.n(p),f=n(74806),m=n(58804),h=n(82022),y=n(2091),g=n(65035),v=n(77281),b=n(91411),x=n(30759),w=n(51032),k=m.ZP.div.withConfig({displayName:"StyledDatePickerOuterWrapper"})(r||(r=(0,b.Z)(["\n outline: ",";\n"])),(function(e){return e.immutable?0:"initial"})),j=m.ZP.div.withConfig({displayName:"StyledDatePickerWrapper"})(o||(o=(0,b.Z)(["\n && {\n ","\n\n & .react-datepicker__input-container {\n & input {\n ","\n width: calc(100% - 5px);\n }\n }\n\n & .react-datepicker {\n & .react-datepicker__today-button {\n ","\n }\n }\n }\n"])),w.yP,w.k9,(function(e){return e.hasTime&&"border-bottom: 1px solid #aeaeae;"})),Z=m.ZP.input.withConfig({displayName:"StyledTimeInput"})(a||(a=(0,b.Z)(["\n ","\n border: none;\n outline: none;\n min-height: 2.6rem;\n"])),(0,x.Z)()),P=n(85893);(0,v.X)();var O="react-datepicker-time__input",_=function(e){var t=e.onChange,n=e.label;return(0,P.jsx)(g.Z,{onMouseDown:function(e){e.preventDefault(),t(null)},children:n})},N=function(e){var t=e.value,n=e.onChange,r=e.onKeyDown;return(0,P.jsx)(Z,{type:"time",className:O,required:!0,value:t,onKeyDown:r,onChange:function(e){n&&n(e.target.value)},onClick:function(e){e.target.focus()}})};const R=(0,m.Zz)((0,f.ZP)((function(e){var t=e.immutable,n=e.id,r=e.value,o=e.minDate,a=e.maxDate,p=e.onChange,f=e.intl,m=e.placeholder,g=e.hasTime,b=e.dateFormat,x=f.locale,w=function(e){return f.formatMessage({id:e})},Z=(0,u.useRef)(null),R=(0,u.useRef)(null),C=(0,u.useState)(!1),E=(0,i.Z)(C,2),D=E[0],S=E[1],I=Boolean(r),T=(0,v.k)(r),V=o?(0,v.k)(o):void 0,L=a?(0,v.k)(a):void 0,A=function(e){var t,n;(S(e),null!==(t=R.current)&&void 0!==t&&t.setPreSelection)&&(null===(n=R.current)||void 0===n||n.setPreSelection(T))},F=function(e){"Tab"!==e.key||e.shiftKey||(e.target.classList.contains("react-datepicker__day")?g?function(e){var t=e.querySelector("input.".concat(O));t&&t.focus()}(Z.current):A(!1):function(e){return e.classList.contains(O)}(e.target)&&A(!1)),function(e){return e.classList.contains("react-datepicker-ignore-onclickoutside")}(e.target)&&"Tab"===e.key&&e.shiftKey&&A(!1),"Enter"===e.key&&(A(!1),e.preventDefault(),e.stopPropagation())};return(0,P.jsx)(k,{immutable:t,id:n,tabIndex:"-1",children:(0,P.jsxs)(j,{immutable:t,ref:Z,hasTime:g,children:[(0,P.jsx)(d(),{ref:R,selected:T,onChange:function(e){if(e){var t=!r&&e,n=(0,c.default)(e),o=(0,s.default)(e)!==(0,s.default)(n)||(0,l.default)(e)!==(0,l.default)(n);t&&g&&!o&&(e=h.Z.setCurrentTime(e)),p(e.toISOString())}},disabled:t,showTimeInput:g,dateFormat:b,placeholderText:m,showMonthDropdown:!0,showYearDropdown:!0,scrollableYearDropdown:!0,fixedHeight:!0,showPopperArrow:!1,open:D,onFocus:function(){A(!0)},onClickOutside:function(){A(!1)},locale:x,onKeyDown:F,customTimeInput:(0,P.jsx)(N,{onKeyDown:F}),enableTabLoop:!1,timeInputLabel:"",minDate:V,maxDate:L,todayButton:(0,P.jsx)(_,{onChange:p,label:w("client.component.datePicker.todayLabel")})}),!t&&I&&(0,P.jsx)(y.Z,{icon:"times",tabIndex:-1,"aria-label":w("client.component.datePicker.clearDateLabel"),onMouseDown:function(e){e.preventDefault(),p(null)}})]})})})))},48078:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(52817),o=n(41609),a=n.n(o),i=n(41291),c=n(85893);const s=function(e){var t=e.value,n=e.breakWords,o=(0,r._)(t),s=a()(o)?t:o.formatInternational();return(0,c.jsx)(i.Z,{href:"tel:".concat(t),target:"_blank",onClick:function(e){return e.stopPropagation()},label:s,breakWords:n})}},81251:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(46927),o=n(70457),a=n(30963),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){(0,r.Z)(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){var t=e.size,n=e.style;return(0,i.jsx)(a.G,s(s({},n),{},{style:{fontSize:t},spin:!0,icon:o.IJ7}))}},67210:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(74806),o=n(12274),a=n(25660),i=n(80722),c=n(20247),s=n(85893);const l=(0,c.U)((0,r.ZP)((function(e){var t=e.path,n=e.context,r=e.onSuccess,c=e.intl,l=e.locale,u=e.emitAction,p=(0,i.Z)(t),d=p?[{id:"rel".concat(p.model),value:p.key}]:[],f=(0,a.Z)(n,"Domain");return(0,s.jsx)(o.ZP,{entityName:"Domain",formName:f,mode:"create",defaultValues:d,locale:l,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Domain/".concat(t)}]}}];r({title:c.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)||u(e)}})})))},36340:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(74806),o=n(12274),a=n(25660),i=n(80722),c=n(20247),s=n(85893);const l=(0,c.U)((0,r.ZP)((function(e){var t=e.context,n=e.path,r=e.onSuccess,c=e.intl,l=e.locale,u=e.emitAction,p=(0,i.Z)(n),d=p?[{id:"rel".concat(p.model),value:p.key}]:[],f=(0,a.Z)(t,"Folder");return(0,s.jsx)(o.ZP,{entityName:"Folder",formName:f,mode:"create",defaultValues:d,locale:l,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Folder/".concat(t)}]}}];r({title:c.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)||u(e)}})})))},96954:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(59713),o=n.n(r),a=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){o()(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)(a.Z,s(s({},e),{},{customDeleteEndpoint:"documents/delete"}))}},90100:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(63038),o=n.n(r),a=n(12274),i=n(25660),c=n(20247),s=n(85893);const l=(0,c.U)((function(e){var t=e.selection,n=e.onSuccess,r=e.onCancel,c=e.locale,l=e.context,u=e.emitAction,p=e.navigate,d=t.ids[0].split("/"),f=o()(d,2),m=f[0],h=f[1];"Resource"===m&&(p("/docs/doc/".concat(h,"/detail")),r());var y=(0,i.Z)(l,m);return(0,s.jsx)(a.ZP,{entityName:m,formName:y,entityId:h,mode:"update",locale:c,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)||u(e)}})}))},4505:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R});var r,o,a,i=n(74806),c=n(50558),s=n(30081),l=n(20247),u=n(63038),p=n.n(u),d=n(28655),f=n.n(d),m=n(18446),h=n.n(m),y=n(1024),g=n(44012),v=n(58804),b=n(36589),x=n(50258),w=n(65035),k=n(73183),j=n(80722),Z=n(85893),P=v.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),O=(0,v.ZP)(x.Z).withConfig({displayName:"StyledLoadMask"})(o||(o=f()(["\n height: auto;\n"]))),_=function(e){return null===e?"Move_root_docs_list_item":"Move_docs_list_item"},N={initialize:s.j2,moveElements:s.w6};const R=(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}}),N)((0,i.ZP)((function(e){var t=e.selection,n=e.onSuccess,r=e.onError,o=e.path,i=e.initialize,c=e.moveElements,s=e.isWaiting,l=e.domainTypes,u=e.rootNodes,d=e.businessUnit,f=e.locale,m=e.emitAction,v=(0,j.Z)(o),b={model:"Docs_list_item",key:"".concat(v.model,"/").concat(v.key)},x=(0,y.useState)(b),N=p()(x,2),R=N[0],C=N[1];(0,y.useEffect)((function(){i(t,n,r)}),[]);var E=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,Z.jsxs)(O,{required:[!s],children:[(0,Z.jsx)(k.default,{routerType:"routerless",initialLocation:function(){if(null===R)return null;var e=R.key.split("/"),t=p()(e,2),n=t[0],r=t[1];return E(n,r)}(),listLimit:10,selectionStyle:"none",searchFormType:"none",disableViewPersistor:!0,getListFormName:_,onListParentChange:C,getCustomLocation:E,navigationStrategy:{},embedded:!0,emitAction:m,noLeftPadding:!0,domainTypes:l,rootNodes:u,businessUnit:d,sortable:!1,scrollBehaviour:"none",locale:f}),(0,Z.jsx)(P,{children:(0,Z.jsx)(w.Z,{onClick:function(){return c(R.key,t.ids)},look:"raised",ink:"primary",disabled:null===R||h()(R,b),children:a||(a=(0,Z.jsx)(g.Z,{id:"client.actions.dms-move.button"}))})})]})}))))},77840:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r.ZP});var r=n(79217)},82445:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r.ZP});var r=n(12274)},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)}}}]);
1
+ "use strict";(self.webpackChunktocco_admin=self.webpackChunktocco_admin||[]).push([[85],{57387:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var r=n(27361),o=n.n(r),a=n(74806),i=n(50558),c=n(29785),s=n(59713),l=n.n(s),u=(n(9230),n(17563)),p=n(73183),d=n(6699),f=n(90169),m=n(85893);function h(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?h(Object(n),!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=function(e){var t=e.entityName,n=e.entityKeys,r=e.children,o=n.map((function(e){return{entityName:t,key:e}}));return(0,m.jsx)(d.Z,{to:"/docs?rootNodes=".concat(JSON.stringify(o)),target:"_blank",children:r})};const v=function(e){var t=u.parse(e.history.location.search);return(0,m.jsx)(p.default,y(y(y({},e),{},{routerType:"inherit",navigationStrategy:{ListLink:g,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 x={container:(0,i.connect)((function(e,t){return{searchFormCollapsed:o()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",null)}}),b)((0,a.ZP)(v))}},23847:(e,t,n)=>{n.r(t),n.d(t,{default:()=>$n});var r=n(15857),o=n(74806),a=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",p="path/SET_CURRENT_VIEW_TITLE",d="path/SET_RELATIONS_INFO",f="path/PROPAGATE_REFRESH",m="path/INVALIDATE_LAST_BREADCRUMB",h="path/SELECT_RELATION",y=function(e,t){return{type:i,payload:{location:e,currentViewInfo:t}}},g=function(e,t){return{type:l,payload:{path:e,breadcrumbsInfo:t}}},v=function(e){return{type:u,payload:{relations:e}}},b=function(e){return{type:d,payload:{relationsInfo:e}}},x=function(e){return{type:h,payload:{selectedRelation:e}}},w=(n(9230),n(1024)),k=n.n(w),j=n(80467),Z=n(19743),P=n(98235),O=n(27361),_=n.n(O),N=n(75354),R=n(70696),C=n(87467),E=n(90169),D=n(44448),S={"widget-code-copy":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,99294))})),"user-qr-action":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,83754))})),"input-edit":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,83712))})),resourcescheduler:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,773))})),"show-output-jobs-action":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,79191))})),delete:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,74259))})),merge:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,55393))})),copy:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,20995))})),"entity-report":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,85904))})),documents:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,62902))})),"password-update":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,58538))})),"widget-config-edit":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,24818))})),"connect-principal":(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,95751))})),export:(0,w.lazy)((function(){return Promise.all([n.e(18),n.e(802),n.e(107)]).then(n.bind(n,17715))}))};const I=D.Z.actionFactory(S);var T=n(85893),V=function(e){var t=e.history,n=e.match,r=e.setCurrentViewTitle,o=e.currentViewInfo,a=e.intl,i=t.location;if((0,w.useEffect)((function(){return o&&r(a.formatMessage({id:"client.actions.".concat(o.actionId,".title")})),function(){r(null)}}),[o,r,a]),!o)return null;var c=N.Z.fromQueryString(i.search),s=_()(i,"state.selection",c.actionProperties),l=_()(i,"state.definition.properties",c.actionProperties),u=function(){t.replace((0,C.H)(n.url,2))};return(0,T.jsx)(I,{history:t,match:n,appId:o.actionId,selection:s,actionProperties:l,navigationStrategy:(0,E.ZP)(t,n),onSuccess:u,onError:u,onCancel:u})},L=function(e,t){return 0===Object.keys(R.Z.difference(e,t)).length};const A=k().memo(V,L);var F={setCurrentViewTitle:function(e){return{type:p,payload:{currentViewTitle:e}}}};const M=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),F)((0,o.ZP)(A));var B,z=n(50600),$=n(91073),U=n(319),W=n.n(U),q=n(63038),H=n.n(q),K=n(28655),G=n.n(K),Y=n(58804),J=n(12274),X=n(88601),Q=n(7281),ee=Y.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(B||(B=G()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),X.Z.color("paper"),Q.Z.space(0));const te=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,o=e.intl,a=e.chooseDocument,i=e.dispatchEmittedAction,c=n.location,s=_()(c,"state.defaultValues",[]),l=(0,w.useState)(!1),u=H()(l,2),p=u[0],d=u[1];if(!t)return null;var f,m=t.model,h=t.reverseRelation,y=t.parentKey,g=m.name,v=_()(m,"paths.".concat(h,".multi"),!1),b=[].concat(W()(h&&y?[{id:h,value:v?[y]:y}]:[]),W()(s));return(0,T.jsxs)(ee,{children:[(0,T.jsx)(j.NL,{when:p,message:(f="client.entity-browser.detail.confirmTouchedFormLeave",o.formatMessage({id:f}))}),(0,T.jsx)(J.ZP,{entityName:g,formName:g,mode:"create",defaultValues:b,emitAction:function(e){i(e)},navigationStrategy:(0,E.ZP)(n,r),chooseDocument:a,onEntityCreated:function(e){var t=e.id;d(!1),n.push(r.url.replace(/create$/,t))},onTouchedChange:function(e){var t=e.touched;return d(t)}})]})};var ne={chooseDocument:$.Z.actions.chooseDocument,dispatchEmittedAction:z.Z.dispatchEmittedAction};const re=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),ne)((0,o.ZP)(te));var oe=n(29785),ae=n(59713),ie=n.n(ae),ce=n(17563),se=n(24720),le=n(29441),ue=n(48926),pe=n.n(ue),de=n(87757),fe=n.n(de),me=n(63094),he=n(73183);function ye(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 ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ve=function(e){var t=e.entityName,n=e.entityKey,r=e.showActions,o=e.noLeftPadding,a=e.openResource,i=e.initialLocation,c=e.sortable,s=(0,w.useState)(null),l=H()(s,2),u=l[0],p=l[1],d=(0,w.useCallback)(pe()(fe().mark((function e(){return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:me.Z.simpleRequest("entities/2.0/"+t+"/"+n+"/entitydocs/folder").then((function(e){p(e.body.key)}));case 1:case"end":return e.stop()}}),e)}))),[t,n]);return(0,w.useEffect)((function(){d()}),[d]),u&&(0,T.jsx)(he.default,ge(ge(ge({routerType:"routerless",initialLocation:i,noLeftPadding:o,sortable:c,searchFormType:"none",rootNodes:[{key:u,entityName:"Folder"}],embedded:!0,showActions:r},!1===r?{selectionStyle:"none"}:{}),{},{disableViewPersistor:!0},a?{openResource:a}:{}),{},{scrollBehaviour:"inline"}))};const be=function(e){var t=e.currentViewInfo,n=e.initialLocation;return(0,T.jsx)(ve,{noLeftPadding:!1,entityName:t.parentModel.name,entityKey:t.parentKey,showActions:!0,initialLocation:n})};function xe(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?xe(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ke=function(e){var t=e.match,n=e.history,r=e.currentViewInfo,o=e.emitAction,a=e.searchFormCollapsed,i=e.saveUserPreferences;if(!r)return null;var c=ce.parse(n.location.search),s=n.location.hash?n.location.hash.substring(1):null;return"Resource"===r.model.name?(0,T.jsx)(be,{currentViewInfo:r,initialLocation:s}):(0,T.jsx)(se.ZP,we(we({emitAction:o,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,E.ZP)(n,t),searchFormPosition:"left",searchFormType:"admin",scrollBehaviour:"inline",store:le.Z.viewInfoSelector(n.location.pathname).store,onStoreCreate:function(e){le.Z.persistViewInfo(n.location.pathname,{store:e},r.level)},actionAppComponent:I,tql:c.tql,searchFormCollapsed:a,onSearchFormCollapsedChange:function(e){var t=e.collapsed;i({"admin.list.searchFormCollapsed":t})}}))};var je={emitAction:function(e){return z.Z.dispatchEmittedAction(e)},saveUserPreferences:oe.RK};const Ze=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],searchFormCollapsed:_()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",!1)}}),je)((0,o.ZP)(ke));var Pe;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 _e(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){ie()(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}var Ne=Y.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(Pe||(Pe=G()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),X.Z.color("paper"),Q.Z.space(0));const Re=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,o=e.intl,a=e.chooseDocument,i=e.emitAction,c=e.propagateRefresh,s=e.invalidateLastBreadcrumb,l=(0,w.useState)(!1),u=H()(l,2),p=u[0],d=u[1];if(!t||t.pathname!==n.location.pathname)return null;var f=ce.parse(location.search).formName,m=t.model.name;return(0,T.jsxs)(Ne,{children:[(0,T.jsx)(j.NL,{when:p,message:function(e){return n.location.pathname!==e.pathname&&(t="client.entity-browser.detail.confirmTouchedFormLeave",o.formatMessage({id:t}));var t}}),(0,T.jsx)(J.ZP,{entityName:m,entityId:t.key,formName:f||m,mode:"update",emitAction:i,onTouchedChange:function(e){var t=e.touched;d(t)},navigationStrategy:_e(_e({},(0,E.ZP)(n,r)),{},{navigateToCreateRelative:function(e,t){if(e){var o=(0,C.H)(r.url,1);n.push({pathname:"".concat(o,"/").concat(e,"/create"),state:t})}else{var a=(0,C.H)(r.url,2);n.push({pathname:a+"/create",state:t})}}}),chooseDocument:a,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:I,onSubGridRowClick:function(e){var t=e.id,o=e.relationName,a=(0,C.H)(r.url);n.push("".concat(a,"/").concat(o,"/").concat(t))}})]})};var Ce={chooseDocument:$.Z.actions.chooseDocument,emitAction:function(e){return z.Z.dispatchEmittedAction(e)},propagateRefresh:function(e){return{type:f,payload:{location:e}}},invalidateLastBreadcrumb:function(e){return{type:m,payload:{location:e}}}};const Ee=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),Ce)((0,o.ZP)(Re));var De=n(34206),Se=n(88162),Ie={};const Te=function(e){var t=e.currentViewInfo,n=e.history,r=e.selectedRelation,o=e.sortable;return(0,T.jsx)(ve,{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:o})};var Ve=function(e){var t=e.selectedRelation,n=e.currentViewInfo,r=e.match,o=e.history,a=e.emitAction,i="".concat(t.reverseRelationName).concat(t.relationName);return(0,T.jsx)(se.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,E.ZP)(o,r),onRowClick:function(e){var n=e.id,a=r.url.replace(/detail$/,"");o.push("".concat(a).concat(t.relationName,"/").concat(n))},onNavigateToCreate:function(){var e=(0,C.H)(r.url);o.push(e+"/"+t.relationName+"/create")},searchFormType:"fulltext",selectionStyle:"none",store:le.Z.viewInfoSelector(o.location.pathname)["store-".concat(i)],onStoreCreate:function(e){le.Z.persistViewInfo(n.pathname,ie()({},"store-".concat(i),e),n.level)},showActions:!1,limit:15,emitAction:a,scrollBehaviour:"inline"},t.reverseRelationName+t.targetEntity)};const Le=k().memo(Ve);var Ae,Fe,Me,Be,ze,$e,Ue,We,qe,He,Ke,Ge,Ye,Je=n(6699),Xe=n(65035),Qe=n(11347),et=n(86491),tt=n(69829),nt=n(30759),rt=Y.ZP.div.withConfig({displayName:"StyledRelationsViewWrapper"})(Ae||(Ae=G()(["\n display: ",";\n height: 100%;\n flex-direction: column;\n"])),(function(e){return e.isCollapsed?"none":"flex"})),ot=Y.ZP.div.withConfig({displayName:"StyledPlaceHolder"})(Fe||(Fe=G()(["\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.isCollapsed?"flex":"none"}),X.Z.color("paper"),Q.Z.space(-1.5),Q.Z.space(-2.5)),at=Y.ZP.div.withConfig({displayName:"StyledToggleCollapse"})(Me||(Me=G()(["\n display: flex;\n background-color: ",";\n padding-top: ",";\n padding-bottom: ",";\n"])),X.Z.color("paper"),Q.Z.space(-1.5),Q.Z.space(-1.5)),it=(0,Y.ZP)(Xe.Z).withConfig({displayName:"StyledToggleCollapseButton"})(Be||(Be=G()(["\n font-size: ",";\n padding: 0;\n margin-left: auto;\n\n &:hover,\n ",":hover & {\n background-color: transparent;\n color: ",";\n }\n"])),Q.Z.font(0),ot,X.Z.color("secondaryLight")),ct=Y.ZP.div.withConfig({displayName:"StyledPreviewBox"})(ze||(ze=G()(["\n background-color: ",";\n padding: ",";\n margin-top: 3px;\n display: flex;\n flex-direction: column;\n flex: 1;\n"])),X.Z.color("paper"),Q.Z.space(-1)),st=Y.ZP.div.withConfig({displayName:"StyledRelationBoxes"})($e||($e=G()(["\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"),Q.Z.space(-1),Q.Z.space(-2),Qe.C),lt=(0,Y.ZP)(Je.Z).withConfig({displayName:"StyledPreviewLink"})(Ue||(Ue=G()(["\n padding-left: ",";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n"])),Q.Z.space(-.5)),ut=Y.ZP.div.withConfig({displayName:"StyledRelationLinks"})(We||(We=G()(["\n display: none;\n margin-left: auto;\n\n * {\n color: ",";\n padding-left: ",";\n }\n"])),X.Z.color("text"),Q.Z.space(-4.5)),pt=Y.ZP.div.withConfig({displayName:"StyledRelationBox"})(qe||(qe=G()(["\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"),Q.Z.space(-2.7),Q.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(ut," {\n display: flex;\n }\n ")}),(0,et.k)("\n &:hover ".concat(ut," {\n display: flex;\n }\n\n && {\n :hover {\n background-color: ").concat(X.Z.color("secondaryLight"),";\n\n * {\n color: ").concat(X.Z.color("paper"),";\n }\n cursor: pointer;\n }\n }\n\n ").concat(Je.Z,":hover * {\n color: ").concat(X.Z.color("secondary"),";\n }\n "))),dt=(0,Y.ZP)(tt.Fe).withConfig({displayName:"StyledRelationLabel"})(He||(He=G()(["\n && {\n max-width: 110px;\n }\n"]))),ft=Y.ZP.span.withConfig({displayName:"StyledCountLabel"})(Ke||(Ke=G()(["\n ","\n"])),(0,nt.Z)());const mt=function(e){var t,n,r=e.relation,o=e.history,a=e.match,i=e.relationsInfo,c=e.selectRelation,s=e.selectedRelation,l=e.intl,u=e.entityName,p=r.relationName,d=r.targetEntity,f=r.relationDisplay,m=function(e){return l.formatMessage({id:e})},h=a.url.replace(/(relations|detail)$/,p),y=a.url.replace(/(relations|detail)$/,p)+"/create";return(0,T.jsxs)(pt,{selected:(null==s?void 0:s.relationName)===p,onClick:function(){c(r),o.replace({search:"?relation=".concat(p)}),function(e,t){Ie[e]=t}(u,p)},children:[(0,T.jsx)(dt,{title:f.label,children:f.label}),(null===(n=i[p])||void 0===n?void 0:n.count)>0?(0,T.jsxs)(ft,{children:[" (",i[p].count,")"]}):null,(0,T.jsxs)(ut,{children:[(0,T.jsx)(Je.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkView"),to:h,children:Ge||(Ge=(0,T.jsx)(Se.Z,{icon:"arrow-right"}))}),(null===(t=i[p])||void 0===t?void 0:t.createPermission)&&"Resource"!==d&&(0,T.jsx)(Je.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkCreate"),to:y,children:Ye||(Ye=(0,T.jsx)(Se.Z,{icon:"plus"}))})]})]})};var ht,yt,gt;function vt(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 bt=function(e){var t=e.history,n=e.match,r=e.currentViewInfo,o=e.relations,a=e.relationsInfo,i=e.emitAction,c=e.intl,s=e.isCollapsed,l=e.toggleCollapse,u=e.selectedRelation,p=e.selectRelation,d=_()(r,"model.name"),f=(0,w.useCallback)((function(){if((null==o?void 0:o.length)>0){var e=ce.parse(t.location.search).relation;if(e)p(o.find((function(t){return t.relationName===e})));else{var n=Ie[d];p(n?o.find((function(e){return e.relationName===n})):o[0])}}}),[o,d,t.location.search,p]);if((0,w.useEffect)(f,[f]),(0,w.useEffect)((function(){return u?null:f()}),[u,f]),!o||0===o.length||!r)return null;var m,h,y=function(e){return c.formatMessage({id:e})},g=u?"Resource"===u.targetEntity?Te:Le:function(){return ht||(ht=(0,T.jsx)(k().Fragment,{}))},v=o.map((function(t){return(0,T.jsx)(mt,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({relation:t,entityName:d},e),"relation-".concat(t.relationName))}));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(rt,{isCollapsed:s,children:[(0,T.jsx)(at,{children:(0,T.jsx)(it,{icon:"chevron-right",onClick:l})}),(0,T.jsx)(st,{children:v}),u&&(0,T.jsxs)(ct,{children:[(0,T.jsxs)(De.ZP.H4,{children:[u.relationDisplay.label,(0,T.jsx)(lt,{"aria-label":y("client.admin.entities.relationsView.relationLinkView"),to:n.url.replace(/(relations|detail)$/,u.relationName),children:yt||(yt=(0,T.jsx)(Se.Z,{icon:"arrow-right"}))}),(m=u.relationName,(null===(h=a[m])||void 0===h?void 0:h.createPermission)&&"Resource"!==u.targetEntity&&(0,T.jsx)(lt,{"aria-label":y("client.admin.entities.relationsView.relationLinkCreate"),to:n.url.replace(/(relations|detail)$/,u.relationName)+"/create",children:gt||(gt=(0,T.jsx)(Se.Z,{icon:"plus"}))}))]}),(0,T.jsx)(g,{selectedRelation:u,match:n,history:t,currentViewInfo:r,emitAction:i,sortable:!0})]})]}),(0,T.jsx)(ot,{onClick:l,isCollapsed:s,children:(0,T.jsx)(it,{icon:"chevron-left",isCollapsed:s})})]})},xt=function(e,t){return 0===Object.keys(R.Z.difference(e,t)).length};const wt=k().memo(bt,xt);var kt={emitAction:function(e){return z.Z.dispatchEmittedAction(e)},selectRelation:x};const jt=(0,a.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,o.ZP)(wt));var Zt,Pt,Ot,_t=Y.ZP.div.withConfig({displayName:"StyledDetailViewContainer"})(Zt||(Zt=G()(["\n display: flex;\n flex-direction: row;\n height: 100%;\n\n .react-bs-container-body {\n height: auto !important;\n }\n"]))),Nt=Y.ZP.div.withConfig({displayName:"StyledDetailViewLeft"})(Pt||(Pt=G()(["\n flex: 1;\n margin-right: 1rem;\n ","\n"])),(function(e){return!e.isCollapsed&&" @media(max - width: 1024px) {\n flex: none;\n width: 40%;\n }"})),Rt=Y.ZP.div.withConfig({displayName:"StyledDetailViewRight"})(Ot||(Ot=G()(["\n flex: ",";\n"])),(function(e){return e.isCollapsed?"0":"1"}));const Ct=function(e){var t=e.match,n=e.history,r=(e.currentViewInfo,e.relationViewCollapsed),o=e.saveUserPreferences,a=(0,w.useState)(!1),i=H()(a,2),c=i[0],s=i[1];(0,w.useEffect)((function(){s(r)}),[r]);var l=function(e){o({"admin.detail.relationViewCollapsed":e})};return(0,T.jsxs)(_t,{children:[(0,T.jsx)(Nt,{isCollapsed:c,children:(0,T.jsx)(Z.Z.ErrorBoundary,{children:(0,T.jsx)(Ee,{match:t,history:n})})}),(0,T.jsx)(Rt,{isCollapsed:c,children:(0,T.jsx)(Z.Z.ErrorBoundary,{children:(0,T.jsx)(jt,{match:t,history:n,isCollapsed:c,toggleCollapse:function(){s(!c),l(!c)}})})})]})};var Et={saveUserPreferences:oe.RK};const Dt=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relationViewCollapsed:_()(e.preferences.userPreferences,"admin.detail.relationViewCollapsed",!1)}}),Et)((0,o.ZP)(Ct));const St=function(e){var t,n,r=e.match,o=(t=r.path,n=":relation",t.split(n).length-1);return(0,T.jsxs)(j.rs,{children:[(0,T.jsx)(j.AW,{exact:!0,path:"".concat(r.url),render:function(e){var t=e.match;return(0,T.jsx)(j.l_,{to:"".concat(t.url.replace(/\/$/,""),"/detail")})}}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/detail"),component:Dt}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/edit"),component:Ee}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/relations"),component:jt}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/action"),component:M}),(0,T.jsx)(j.AW,{path:"".concat(r.path,"/:relation_").concat(o),component:It})]})};const It=function(e){var t=e.match;return(0,T.jsxs)(j.rs,{children:[(0,T.jsx)(j.AW,{exact:!0,path:t.url,render:function(e){var t=e.match;return(0,T.jsx)(j.l_,{to:"".concat(t.url.replace(/\/$/,""),"/list")})}}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/action/:id"),component:M}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/list"),component:Ze}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/create"),component:re}),(0,T.jsx)(j.AW,{path:"".concat(t.path,"/:key"),component:St})]})};var Tt=n(2977);const Vt=(0,a.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,o.ZP)(Tt.Z));var Lt=n(44012),At=n(39233);const Ft=function(e){var t=e.currentViewInfo,n="client.admin.entity.errorView.",r="detail"===t.type?"detailTitle":"defaultTitle",o="listDescription";return"detail"===t.type?o="detailDescription":"list"===t.type&&t.error.relationName&&(o="relationDescription"),(0,T.jsx)(At.Z,{title:(0,T.jsx)(Lt.Z,{id:n+r}),message:(0,T.jsx)(Lt.Z,{id:n+o,values:t.error})})};const Mt=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}))((0,o.ZP)(Ft));var Bt,zt,$t,Ut,Wt=Y.ZP.div.withConfig({displayName:"StyledWrapper"})(Bt||(Bt=G()(["\n display: grid;\n grid-template-rows: auto 1fr;\n grid-template-areas:\n 'breadcrumbs'\n 'content';\n height: 100%;\n width: 100%;\n"]))),qt=Y.ZP.div.withConfig({displayName:"StyledContent"})(zt||(zt=G()(["\n grid-area: content;\n overflow: hidden;\n"]))),Ht=Y.ZP.div.withConfig({displayName:"StyledBreadcrumbs"})($t||($t=G()(["\n grid-area: breadcrumbs;\n"])));const Kt=function(e){var t=e.match,n=e.history,r=e.loadCurrentRoute,o=e.currentViewInfo,a=n.location;(0,w.useEffect)((function(){r(a)}),[a,r]);var i=null!=o&&o.error?(0,T.jsx)(Mt,{history:n}):(0,T.jsxs)(j.rs,{children:[(0,T.jsx)(j.AW,{path:"".concat(t.url,"/action/:actionId"),component:M}),(0,T.jsx)(j.AW,{path:"".concat(t.url,"/:entity"),component:It}),(0,T.jsx)(j.AW,{exact:!0,path:t.url,component:P.Z})]});return(0,T.jsxs)(Wt,{children:[Ut||(Ut=(0,T.jsx)(Z.Z.ErrorBoundary,{children:(0,T.jsx)(Ht,{children:(0,T.jsx)(Vt,{})})})),(0,T.jsx)(qt,{children:i})]})};var Gt={loadCurrentRoute:function(e){return{type:c,payload:{location:e}}}};const Yt=(0,a.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),Gt)((0,o.ZP)(Kt));var Jt,Xt=n(34857),Qt=n(81770);function en(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 tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?en(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nn=(Jt={},ie()(Jt,i,(function(e,t){var n=t.payload,r=n.location,o=n.currentViewInfo;return tn(tn({},e),{},{currentViewInfos:tn(tn({},e.currentViewInfos),{},ie()({},r,tn(tn({},e.currentViewInfos[r]),o)))})})),ie()(Jt,s,Qt.Z.singleTransferReducer("breadcrumbsInfo")),ie()(Jt,l,(function(e,t){var n=t.payload,r=n.path,o=n.breadcrumbsInfo;return tn(tn({},e),{},{breadcrumbsInfo:e.breadcrumbsInfo.map((function(e){return e.path===r?tn(tn({},e),o):e}))})})),ie()(Jt,u,Qt.Z.singleTransferReducer("relations")),ie()(Jt,d,Qt.Z.singleTransferReducer("relationsInfo")),ie()(Jt,p,Qt.Z.singleTransferReducer("currentViewTitle")),ie()(Jt,h,Qt.Z.singleTransferReducer("selectedRelation")),Jt),rn={currentViewInfos:{},breadcrumbsInfo:[],relations:null,relationsInfo:{},selectedRelation:null};var on=n(57557),an=n.n(on),cn=n(78718),sn=n.n(cn),ln=n(35937),un=n.n(ln),pn=n(44759),dn=n(96801),fn=function(e){var t=dn.Z.extractParamsFromPath("/e/:entity/:key?/:relation*/:view(list|detail|edit|create|relations|action)/:actionId?",e),n=dn.Z.extractParamsFromPath("/e/action/:actionId",e);return t||n};function mn(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 hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(n),!0).forEach((function(t){ie()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yn=fe().mark(Rn),gn=fe().mark(Cn),vn=fe().mark(En),bn=fe().mark(Dn),xn=fe().mark(Sn),wn=fe().mark(Vn),kn=fe().mark(Ln),jn=fe().mark(An),Zn=fe().mark(Fn),Pn=fe().mark(Mn),On=fe().mark(Bn),_n=function(e){return e.entities.path},Nn=/[^/]+\/?[^/]+/g;function Rn(){return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Xt.$6)([(0,Xt.Fm)(c,Cn),(0,Xt.Fm)(f,Ln),(0,Xt.Fm)(m,An)]);case 2:case"end":return e.stop()}}),yn)}function Cn(e){var t,n,r,o;return fe().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=e.payload.location,n=t.pathname,a.next=4,(0,Xt.RE)(Sn,n);case 4:if(!((r=a.sent).length>0)){a.next=16;break}return a.next=8,(0,Xt.RE)(En,n,r);case 8:return o=a.sent,a.next=11,(0,Xt.RE)(Dn,r);case 11:if("detail"!==o.type||o.error){a.next=14;break}return a.next=14,(0,Xt.Cs)(Vn,o.model,o.key);case 14:return a.next=16,(0,Xt.RE)(le.Z.clearPersistedViews,o.level+1);case 16:case"end":return a.stop()}}),gn)}function En(e,t){var n;return fe().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,Xt.RE)(In,e,t);case 2:return n=r.sent,r.next=5,(0,Xt.gz)(y(e,n));case 5:return r.abrupt("return",n);case 6:case"end":return r.stop()}}),vn)}function Dn(e){var t;return fe().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Xt.RE)(Tn,e);case 2:return t=n.sent,n.next=5,(0,Xt.gz)({type:s,payload:{breadcrumbsInfo:t}});case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),bn)}function Sn(e){var t,n,r,o,a,i,c,s,l,u,p,d,f,m,h,y,g;return fe().wrap((function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,(0,Xt.RE)(fn,e);case 2:if(t=v.sent,n=[],null!==t){v.next=6;break}return v.abrupt("return",n);case 6:if(!t.entity){v.next=70;break}return v.prev=7,v.next=10,(0,Xt.RE)(me.Z.fetchModel,t.entity);case 10:r=v.sent,n.push({type:"list",model:r}),v.next=18;break;case 14:return v.prev=14,v.t0=v.catch(7),n.push({type:"list",error:{entityName:t.entity}}),v.abrupt("return",n);case 18:if(!t.key){v.next=67;break}return v.next=21,(0,Xt.RE)(me.Z.entityExists,r.name,t.key);case 21:if(!v.sent){v.next=29;break}return v.next=25,(0,Xt.RE)(me.Z.fetchDisplay,r.name,t.key);case 25:o=v.sent,n.push({type:"detail",key:t.key,model:r,display:o}),v.next=31;break;case 29:return n.push({type:"detail",error:{entityName:r.label,key:t.key}}),v.abrupt("return",n);case 31:if(!t.relation){v.next=67;break}a=t.relation.split("/"),i=0;case 34:if(!(i<a.length)){v.next=67;break}if(c=a[i],s=n[n.length-1],i%2!=0){v.next=50;break}if(l=c,u=s.model.paths[l]){v.next=43;break}return n.push({type:"list",error:{relationName:l,entityName:s.model.name}}),v.abrupt("return",n);case 43:return p=u.targetEntity,v.next=46,(0,Xt.RE)(me.Z.fetchModel,p);case 46:d=v.sent,n.push({type:"list",model:d,relationName:l,parent:s}),v.next=64;break;case 50:return f=c,m=s.model,v.next=54,(0,Xt.RE)(me.Z.entityExists,m.name,f);case 54:if(!v.sent){v.next=62;break}return v.next=58,(0,Xt.RE)(me.Z.fetchDisplay,m.name,f);case 58:h=v.sent,n.push({type:"detail",model:m,key:f,display:h,relationName:s.relationName,parent:s.parent}),v.next=64;break;case 62:return n.push({type:"detail",error:{entityName:m.name,key:f}}),v.abrupt("return",n);case 64:i++,v.next=34;break;case 67:"create"===t.view?(y=n[n.length-1],g=n[n.length-2],n.push({type:"create",model:y.model,parent:g,relationName:y.relationName})):t.actionId&&n.push({type:"action",actionId:t.actionId}),v.next=71;break;case 70:t.actionId&&n.push({type:"action",actionId:t.actionId});case 71:return v.abrupt("return",n);case 72:case"end":return v.stop()}}),xn,null,[[7,14]])}var In=function(e,t){var n=t[t.length-1],r=n.parent;return hn(hn({},an()(n,["parent"])),{},{pathname:e,level:t.length-1},r&&n.relationName&&{parentKey:r.key,reverseRelation:r.model.paths[n.relationName].reverseRelationName,parentModel:r.model})},Tn=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 Vn(e,t){var n,r;return fe().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=un()(e.paths,(function(e,t){return e.relationDisplay&&e.relationDisplay.show})),r=Object.keys(n).map((function(e){return sn()(n[e],["relationName","reverseRelationName","targetEntity","relationDisplay.label","relationDisplay.order"])})).sort((function(e,t){return e.relationDisplay.order>t.relationDisplay.order?1:-1})),o.next=4,(0,Xt.gz)(x(null));case 4:return o.next=6,(0,Xt.gz)(v(r));case 6:return o.next=8,(0,Xt.RE)(Bn,e.name,t);case 8:case"end":return o.stop()}}),wn)}function Ln(e){var t,n,r,o,a;return fe().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.payload.location,n=t.pathname,i.next=4,(0,Xt.Ys)(_n);case 4:if(r=i.sent,o=r.currentViewInfos,"detail"!==(a=o[n]).type||a.error){i.next=12;break}return i.next=10,(0,Xt.Cs)(Bn,a.model.name,a.key);case 10:return i.next=12,(0,Xt.gz)(x(null));case 12:case"end":return i.stop()}}),kn)}function An(e){var t,n,r,o,a,i,c,s;return fe().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.payload.location,n=t.pathname,l.next=4,(0,Xt.RE)(fn,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,Xt.RE)(Mn,r);case 9:if(!(o=l.sent)){l.next=24;break}return a=o.entityName,i=o.key,l.next=14,(0,Xt.RE)(me.Z.invalidateDisplay,a,i);case 14:return l.next=16,(0,Xt.RE)(me.Z.fetchDisplay,a,i);case 16:return c=l.sent,l.next=19,(0,Xt.gz)(y(n,{display:c}));case 19:return l.next=21,(0,Xt.RE)(Fn,n);case 21:return s=l.sent,l.next=24,(0,Xt.gz)(g(s,{display:c}));case 24:l.next=29;break;case 26:l.prev=26,l.t0=l.catch(6),pn.Z.logError("breadcrumbs invalidation failed",l.t0);case 29:case"end":return l.stop()}}),jn,null,[[6,26]])}function Fn(e){var t;return fe().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Xt.RE)(fn,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()}}),Zn)}function Mn(e){var t,n,r,o,a,i,c,s,l,u;return fe().wrap((function(p){for(;;)switch(p.prev=p.next){case 0:if(e&&e.entity&&e.key&&"action"!==e.view){p.next=2;break}return p.abrupt("return",null);case 2:return p.next=4,(0,Xt.RE)(me.Z.fetchModel,e.entity);case 4:if(t=p.sent,e.relation){p.next=7;break}return p.abrupt("return",{entityName:t.name,key:e.key});case 7:if(!((n=e.relation.match(Nn)).length<1)){p.next=10;break}return p.abrupt("return",null);case 10:r=t,o=null,a=0;case 13:if(!(a<n.length)){p.next=25;break}if(i=n[a].split("/"),c=H()(i,2),s=c[0],l=c[1],(u=r.paths[s])&&l){p.next=18;break}return p.abrupt("return",null);case 18:return p.next=20,(0,Xt.RE)(me.Z.fetchModel,u.targetEntity);case 20:r=p.sent,o={entityName:r.name,key:l};case 22:a++,p.next=13;break;case 25:return p.abrupt("return",o);case 26:case"end":return p.stop()}}),Pn)}function Bn(e,t){var n,r,o;return fe().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n="client/entities/".concat(e,"/").concat(t,"/relations"),a.next=3,(0,Xt.RE)(me.Z.requestSaga,n);case 3:return r=a.sent,o=r.body.relations,a.next=7,(0,Xt.gz)(b(o));case 7:case"end":return a.stop()}}),On)}const zn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rn,t=arguments.length>1?arguments[1]:void 0,n=nn[t.type];return n?n(e,t):e},$n={container:Yt,reducers:{entities:(0,r.UY)({path:zn})},sagas:[Rn]}},24295:(e,t,n)=>{n.r(t),n.d(t,{default:()=>xe});var r=n(68957),o=n(91411),a=n(86249),i=n.n(a),c=(n(58900),n(78634)),s=n(84100),l=n(60131),u=n(48230),p=n(64952),d=n(469),f=n(81896),m=n(46940),h=n(27361),y=n.n(h),g=n(14293),v=n.n(g),b=n(13218),x=n.n(b),w=n(47037),k=n.n(w),j=n(1024),Z=n(58804),P=(n(39335),n(28212),n(6488),n(32510),n(79657),n(20844),n(41030),n(98827),n(37363),n(53299),n(54159)),O=function(e){return P.Z.executeRequest("rest/".concat(e))},_=function(e){return 200===e.status?e.json():null},N=n(44822),R=n(11259),C=n(32208),E=n(99357),D=n(19241),S=(n(70646),n(1469)),I=n.n(S),T=n(30236),V=n.n(T),L=["==","!=","<=",">=","<",">","~="],A=["true","false","null"],F=["string","long","serial","bool","boolean","double","float","time","timestamp","char","varchar","date","datetime"],M=["now_date","yesterday_date","tomorrow_date","today_date","now_start","yesterday_start","tomorrow_start","today_start","now","yesterday","tomorrow","today","currentUsername","currentUser","currentBu"],B=["in","dateadd","datetimeadd","duedate","birthdayin","fulltext","likeall","distance","inboundingbox"];function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}const $=function(e){return function(t){(0,C.Z)(r,t);var n=z(r);function r(){var t;(0,R.Z)(this,r),t=n.call(this);var o=[{token:"keyword.operator.conjunction",regex:/(\s*)(and|or|not)($|\s+)/,caseInsensitive:!0},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.exists",regex:/exists\s*/,push:"exists",caseInsensitive:!0},{token:"keyword.count",regex:/count\s*/,push:"count",caseInsensitive:!0},{token:["keyword.function.nice_function","paren.lparen.function_arguments","text.function_arguments","paren.rparen","text.whitespace"],regex:"((?:".concat(B.join("|"),")\\s*)(\\()(.*?)(\\))($|\\s+)"),caseInsensitive:!0},{token:"keyword.other.chaining",regex:/\./},{token:"support.function.field",regex:/([a-z_]+)($|\s+)/,push:"comparison"}],a={start:e?[{token:"keyword.where",regex:/\s*/,next:"rootwhere",caseInsensitive:!0}]:[{token:"keyword.find",regex:/find($|\s+)/,push:"model",caseInsensitive:!0},{token:"keyword.where",regex:/where($|\s+)/,next:"rootwhere",caseInsensitive:!0}],model:[{token:"support.class.model",regex:/[A-Z][a-z_0-9]*\s*/,next:"pop"}],rootwhere:[{token:"keyword.order_by",regex:/order by($|\s+)/,next:"order",caseInsensitive:!0}].concat(o),comparison:[{token:"keyword.operator.comparison",regex:"(".concat(L.join("|"),")\\s*"),next:"value"}],value:[{token:"string",regex:/".*?"\s*/,next:"pop"},{token:"constant.numeric",regex:/\d+(.\d+)?\s*/,next:"pop"},{token:"constant.language.tocco_placeholder",regex:"\\:(".concat(M.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"constant.language",regex:"(".concat(A.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"support.type",regex:"(".concat(F.join("|"),"):\\s*"),caseInsensitive:!0}],exists:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"existswhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"pop"}],existswhere:[].concat(o,[{token:"paren.rparen",regex:/\)\s*/,next:"pop"}]),count:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"countwhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}],countwhere:[].concat(o,[{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}]),order:[{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:["support.function.field","keyword.direction","separator"],regex:/([a-z_]+\s*)(asc|desc)?($|,|\s+)/}]};return t.$rules=V()(t.$rules,a,(function(e,t){return I()(e)?e.concat(t):void 0})),t.normalizeRules(),t}return(0,N.Z)(r)}(i().require("ace/mode/text_highlight_rules").TextHighlightRules)};function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}var W=function(e){(0,C.Z)(n,e);var t=U(n);function n(){var e;(0,R.Z)(this,n);return(e=t.call(this)).$rules={start:[{token:"constant.character.entity",regex:/&[^;]+;/},{token:"support.function",regex:"\\?(\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|upper_case|word_list|xhtml|xmlc|round|floor|ceilingiso_[a-z_]+first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunkkeys|valueschildren|parent|root|ancestors|node_name|node_type|node_namespacebyte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|eval|has_content|interpret|is_[a-z_]+|namespacenew)"},{token:"support.function.deprecated",regex:"\\?(default|exists|if_exists|web_safe)"},{token:"language.variable",regex:"\\.(?:data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|now|output_encoding|template_name|url_escaping_charset|vars|version)"},{token:"constant.language",regex:"\\b(true|false)\\b"},{token:"keyword.operator",regex:"\\b(?:gt|gte|lt|lte|as|in|using)\\b"},{token:"entity.other.attribute-name",regex:"encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|attributes"},{token:"string",regex:/['"]/,next:"qstring"},{token:function(e){return e.match("^[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?$")?"constant.numeric":"variable"},regex:/[\w.+-]+/},{token:"keyword.operator",regex:"!|\\.|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^="},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qstring:[{token:"constant.character.escape",regex:'\\\\[nrtvef\\\\"$]'},{token:"string",regex:/['"]/,next:"start"},{defaultToken:"string"}]},e}return(0,N.Z)(n)}(i().require("ace/mode/text_highlight_rules").TextHighlightRules),q=function(e){(0,C.Z)(n,e);var t=U(n);function n(){var e;(0,R.Z)(this,n),e=t.call(this);var r=["query","queryCount"],o=[{token:"keyword.function",regex:"\\[@(".concat(r.join("|"),").*?]"),push:"tql-start"},{token:"comment",regex:"\\[#--",next:"ftl-dcomment"},{token:"string.interpolated",regex:"\\${",push:"ftl-start"},{token:"keyword.function",regex:"\\[/?#(assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|setting|stop|switch|t|visit)",push:"ftl-start"},{token:"keyword.other",regex:"\\[/?@[a-zA-Z\\.]+",push:"ftl-start"}];for(var a in e.$rules)e.$rules[a].unshift.apply(e.$rules[a],o);e.embedRules(W,"ftl-",[{token:"keyword",regex:"/?\\]",next:"pop"},{token:"string.interpolated",regex:"}",next:"pop"}],["start"]),e.addRules({"ftl-dcomment":[{token:"comment",regex:"--\\]",next:"pop"},{defaultToken:"comment"}]});var i=[{token:"keyword.function",regex:"\\[/@(".concat(r.join("|"),")]"),next:"pop"}];e.embedRules($(),"tql-",i,["start"]);var c={"tql-rootwhere":[{token:"keyword.function",regex:"\\[/@(".concat(r.join("|"),")]"),next:"pop"}],"tql-order":[{token:"keyword.function",regex:"\\[/@(".concat(r.join("|"),")]"),next:"pop"}]};return e.$rules=V()(e.$rules,c,(function(e,t){return I()(e)?e.concat(t):void 0})),e.normalizeRules(),e}return(0,N.Z)(n)}(i().require("ace/mode/html_highlight_rules").HtmlHighlightRules),H=n(52902),K=n(45915),G=i().require("ace/token_iterator").TokenIterator,Y=function(e){return e?e.type.substring(e.type.lastIndexOf(".")+1):null},J=function(e,t){return Y(e.getCurrentToken())===t},X=function(e){if(J(e,"model")&&e.stepBackward(),(J(e,"field")||J(e,"relation"))&&e.stepBackward(),!J(e,"chaining"))return null;if(e.stepBackward(),J(e,"model")){var t=e.getCurrentToken();return e.stepBackward(),e.stepBackward(),t?t.value.trim():null}return null},Q=function(e,t){for(;!J(e,t);)if(!e.stepBackward())return!1;return!0},ee=function(e,t){return J(e,"rparen")?1:t>0&&J(e,"lparen")?(e.stepBackward(),-1):0},te=function(e){for(var t=0;e.getCurrentToken();){if(0===t&&J(e,"where")){var n=e.stepBackward();return n?[n.value.trim()].concat((0,K.Z)(re(e))):[]}if(J(e,"order_by")){if(Q(e,"find")){var r=e.stepForward();return r?r.value.trim():[]}return[]}if(t+=ee(e,t),!e.stepBackward())return null}return null},ne=function(e,t){for(var n=[],r=t(e);r;)Array.isArray(r)?r.forEach((function(e){return n.unshift(e)})):n.unshift(r),r=t(e);return n},re=function(e){return ne(e,X)},oe=function(e){return ne(e,te)},ae=1e3,ie=function(e,t,n){var r=function(e,t){if(t){var n=oe(e());return{baseModel:t,modelScope:(0,H.Z)(n).slice(0)}}var r=oe(e()),o=(0,H.Z)(r);return{baseModel:o[0],modelScope:o.slice(1)}}(e,n),o=r.baseModel,a=r.modelScope;if(o){var i=re(e()),c=[].concat((0,K.Z)(a),(0,K.Z)(i)).map((function(e){return"rel".concat(e)}));(function(e){var t=(0,H.Z)(e),n=t[0],r=t.slice(1);return O(function(e,t){var n=t.length>0?"/resolve?path="+t.join("."):"";return"entities/".concat(e,"/model").concat(n)}(n,r)).then(_).then((function(e){if(!e)return[];var t=e.fields||[],n=e.relations||[];return[].concat((0,K.Z)(t.map((function(e){return{label:(t=e,t.label?"".concat(t.fieldName," (").concat(t.label,")"):t.fieldName),value:e.fieldName,meta:e.type};var t}))),(0,K.Z)(n.map((function(e){return{label:(t=e,t.label?"".concat(t.relationName," (").concat(t.label,")"):t.relationName),value:e.relationName,meta:e.targetEntity};var t}))))}))})([o].concat((0,K.Z)(c))).then((function(e){var n=e.map((function(e){return{caption:e.label,value:e.value,meta:e.meta,score:ae}}));t(null,n)})).catch((function(e){return t(e)}))}},ce=function(e,t){return t?"".concat(e," (").concat(t,")"):e},se=function(e){return O("entities").then(_).then((function(e){return e?e.entities:{}})).then((function(e){return e?Object.values(e):[]})).then((function(e){return e.map((function(e){return e.metaData}))})).then((function(t){var n=t.map((function(e){var t=e.modelName,n=e.label;return{caption:ce(t,n),value:t,score:ae}}));e(null,n)})).catch((function(t){return e(t)}))},le=function(){return B.map((function(e){return e.toUpperCase()})).map((function(e){return{caption:e,value:"".concat(e,"()"),meta:"function",score:970}}))};const ue=function(e){return{getCompletions:function(t,n,r,o,a){var i=function(){return new G(n,r.row,r.column)},c=i(),s=c.getCurrentToken(),l=c.stepBackward()?c.getCurrentToken():null;switch(Y(s)){case"chaining":case"relation":case"separator":case"order_by":case"count":case"exists":case"field":case"function_arguments":ie(i,a,e);break;case"where":case"conjunction":ie(i,a,e),a(null,le());break;case"nice_function":a(null,le());break;case"find":se(a);break;case"type":case"tocco_placeholder":case"comparison":a(null,F.map((function(e){return{caption:e,value:"".concat(e,":"),meta:"type",score:980}}))),a(null,M.map((function(e){return{caption:e,value:":".concat(e),meta:"placeholder",score:990}})));break;case"model":ie(i,a,e),l&&"relation"!==Y(l)&&se(a);break;case null:e&&ie(i,a,e),a(null,le())}}}};function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}var de=function(e){(0,C.Z)(n,e);var t=pe(n);function n(){var e;return(0,R.Z)(this,n),(e=t.call(this)).HighlightRules=q,e.completer=ue(),e}return(0,N.Z)(n)}(i().require("ace/mode/ftl").Mode);function fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,D.Z)(e);if(t){var o=(0,D.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,E.Z)(this,n)}}var me,he=function(e){(0,C.Z)(n,e);var t=fe(n);function n(e){var r,o=e.implicitModelName;return(0,R.Z)(this,n),(r=t.call(this)).HighlightRules=$(o),r.completer=ue(o),r.snippedIdField=null,r}return(0,N.Z)(n)}(i().require("ace/mode/text").Mode),ye=n(85893),ge=Z.ZP.div.withConfig({displayName:"StyledEditor"})(me||(me=(0,o.Z)(["\n width: 100%;\n z-index: 0; /* gutter lays over menu otherwise */\n"]))),ve={groovy:function(){return new s.Mode},html:function(){return new l.Mode},xml:function(){return new m.Mode},properties:function(){return new d.Mode},json:function(){return new u.Mode},htmlmixed:function(){return new de},freemarkermixed:function(){return new de},ftl:function(){return new de},tql:function(e){return new he(e)},less:function(){return new p.Mode},drools:function(){return new c.Mode},text:function(){return new f.Mode}},be=function(e,t){var n=t.mode,o=t.theme,a=t.showGutter,i=t.editorOptions,c=void 0===i?{}:i;(function(e){return k()(e)?Promise.resolve(e):x()(e)?O("entities/2.0/".concat(e.entityModel,"/").concat(e.key,"?_paths=").concat(e.field)).then(_).then((function(e){return y()(e,["paths","entity_name","value"],null)})):Promise.resolve(null)})(t.implicitModel).then((function(e){return function(e,t){return y()(ve,e,e)(t)}(n,{implicitModelName:e})})).then((function(t){return e.getSession().setMode(t)})),e.setTheme("ace/theme/".concat(o)),Object.entries(c).forEach((function(t){var n=(0,r.Z)(t,2),o=n[0],a=n[1];e.setOption(o,a)})),e.renderer.setShowGutter(a),e.resize()};const xe=function(e){var t=e.mode,n=e.theme,r=void 0===n?"textmate":n,o=e.value,a=e.onChange,c=e.showGutter,s=void 0===c||c,l=e.editorOptions,u=void 0===l?{}:l,p=e.implicitModel,d=(0,j.useRef)(null),f=(0,j.useRef)(null),m=(0,j.useMemo)((function(){return{mode:t,theme:r,showGutter:s,editorOptions:u,implicitModel:p}}),[t,r,s,u,p]);return(0,j.useEffect)((function(){var e=i().edit(d.current);return e.getSession().setValue(o||""),e.on("change",(function(){return a(e.getValue())})),be(e,m),f.current=e,function(){return e.destroy()}}),[]),(0,j.useEffect)((function(){f.current&&be(f.current,m)}),[m]),(0,j.useEffect)((function(){f.current&&!v()(o)&&o!==f.current.getValue()&&f.current.getSession().setValue(o)}),[o]),(0,ye.jsx)(ge,{ref:d})}},38421:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var r,o=n(68957),a=(n(44661),n(1024)),i=n(12520),c=n.n(i),s=n(74806),l=n(58804),u=n(91411),p=l.ZP.span.withConfig({displayName:"StyledChildrenWrapper"})(r||(r=(0,u.Z)(["\n cursor: pointer;\n user-select: none;\n"]))),d=n(85893);const f=function(e){var t=e.children,n=e.onOpen;return(0,d.jsx)(p,{onClick:n,children:t})};(0,n(77281).X)();const m=(0,l.Zz)((0,s.ZP)((function(e){var t,n=e.children,r=e.value,i=e.onChange,s=e.intl,l=s.locale,u=(0,a.useRef)(null),p=(0,a.useState)(!1),m=(0,o.Z)(p,2),h=m[0],y=m[1],g=function(e){var t,n;(y(e),null!==(t=u.current)&&void 0!==t&&t.setPreSelection)&&(null===(n=u.current)||void 0===n||n.setPreSelection(r))};return(0,d.jsx)(c(),{ref:u,selected:r,preSelection:null,onChange:i,showTimeInput:!1,dateFormat:"P",showMonthDropdown:!0,showYearDropdown:!0,scrollableYearDropdown:!0,fixedHeight:!0,showPopperArrow:!1,open:h,onFocus:function(){g(!0)},onClickOutside:function(){g(!1)},locale:l,enableTabLoop:!1,customInput:(0,d.jsx)(f,{onOpen:function(){g(!0)},children:n}),todayButton:(t="client.component.datePicker.todayLabel",s.formatMessage({id:t}))})})))},77281:(e,t,n)=>{n.d(t,{X:()=>i,k:()=>c});n(44661);var r=n(5429),o=n(12520),a=n(82022),i=function(){(0,o.registerLocale)("en",a.Z.getDateFnsLocale("en")),(0,o.registerLocale)("en-US",a.Z.getDateFnsLocale("en")),(0,o.registerLocale)("de-CH",a.Z.getDateFnsLocale("de-CH")),(0,o.registerLocale)("de",a.Z.getDateFnsLocale("de")),(0,o.registerLocale)("fr",a.Z.getDateFnsLocale("fr")),(0,o.registerLocale)("fr-CH",a.Z.getDateFnsLocale("fr")),(0,o.registerLocale)("it",a.Z.getDateFnsLocale("it")),(0,o.registerLocale)("it-CH",a.Z.getDateFnsLocale("it")),(0,o.setDefaultLocale)("de")},c=function(e){var t=(0,r.default)(e);return isNaN(t)?null:t}},64820:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R});var r,o,a,i=n(68957),c=(n(44661),n(75502)),s=n(65809),l=n(94712),u=n(1024),p=n(12520),d=n.n(p),f=n(74806),m=n(58804),h=n(82022),y=n(2091),g=n(65035),v=n(77281),b=n(91411),x=n(30759),w=n(51032),k=m.ZP.div.withConfig({displayName:"StyledDatePickerOuterWrapper"})(r||(r=(0,b.Z)(["\n outline: ",";\n"])),(function(e){return e.immutable?0:"initial"})),j=m.ZP.div.withConfig({displayName:"StyledDatePickerWrapper"})(o||(o=(0,b.Z)(["\n && {\n ","\n\n & .react-datepicker__input-container {\n & input {\n ","\n width: calc(100% - 5px);\n }\n }\n\n & .react-datepicker {\n & .react-datepicker__today-button {\n ","\n }\n }\n }\n"])),w.yP,w.k9,(function(e){return e.hasTime&&"border-bottom: 1px solid #aeaeae;"})),Z=m.ZP.input.withConfig({displayName:"StyledTimeInput"})(a||(a=(0,b.Z)(["\n ","\n border: none;\n outline: none;\n min-height: 2.6rem;\n"])),(0,x.Z)()),P=n(85893);(0,v.X)();var O="react-datepicker-time__input",_=function(e){var t=e.onChange,n=e.label;return(0,P.jsx)(g.Z,{onMouseDown:function(e){e.preventDefault(),t(null)},children:n})},N=function(e){var t=e.value,n=e.onChange,r=e.onKeyDown;return(0,P.jsx)(Z,{type:"time",className:O,required:!0,value:t,onKeyDown:r,onChange:function(e){n&&n(e.target.value)},onClick:function(e){e.target.focus()}})};const R=(0,m.Zz)((0,f.ZP)((function(e){var t=e.immutable,n=e.id,r=e.value,o=e.minDate,a=e.maxDate,p=e.onChange,f=e.intl,m=e.placeholder,g=e.hasTime,b=e.dateFormat,x=f.locale,w=function(e){return f.formatMessage({id:e})},Z=(0,u.useRef)(null),R=(0,u.useRef)(null),C=(0,u.useState)(!1),E=(0,i.Z)(C,2),D=E[0],S=E[1],I=Boolean(r),T=(0,v.k)(r),V=o?(0,v.k)(o):void 0,L=a?(0,v.k)(a):void 0,A=function(e){var t,n;(S(e),null!==(t=R.current)&&void 0!==t&&t.setPreSelection)&&(null===(n=R.current)||void 0===n||n.setPreSelection(T))},F=function(e){"Tab"!==e.key||e.shiftKey||(e.target.classList.contains("react-datepicker__day")?g?function(e){var t=e.querySelector("input.".concat(O));t&&t.focus()}(Z.current):A(!1):function(e){return e.classList.contains(O)}(e.target)&&A(!1)),function(e){return e.classList.contains("react-datepicker-ignore-onclickoutside")}(e.target)&&"Tab"===e.key&&e.shiftKey&&A(!1),"Enter"===e.key&&(A(!1),e.preventDefault(),e.stopPropagation())};return(0,P.jsx)(k,{immutable:t,id:n,tabIndex:"-1",children:(0,P.jsxs)(j,{immutable:t,ref:Z,hasTime:g,children:[(0,P.jsx)(d(),{ref:R,selected:T,onChange:function(e){if(e){var t=!r&&e,n=(0,c.default)(e),o=(0,s.default)(e)!==(0,s.default)(n)||(0,l.default)(e)!==(0,l.default)(n);t&&g&&!o&&(e=h.Z.setCurrentTime(e)),p(e.toISOString())}},disabled:t,showTimeInput:g,dateFormat:b,placeholderText:m,showMonthDropdown:!0,showYearDropdown:!0,scrollableYearDropdown:!0,fixedHeight:!0,showPopperArrow:!1,open:D,onFocus:function(){A(!0)},onClickOutside:function(){A(!1)},locale:x,onKeyDown:F,customTimeInput:(0,P.jsx)(N,{onKeyDown:F}),enableTabLoop:!1,timeInputLabel:"",minDate:V,maxDate:L,todayButton:(0,P.jsx)(_,{onChange:p,label:w("client.component.datePicker.todayLabel")})}),!t&&I&&(0,P.jsx)(y.Z,{icon:"times",tabIndex:-1,"aria-label":w("client.component.datePicker.clearDateLabel"),onMouseDown:function(e){e.preventDefault(),p(null)}})]})})})))},48078:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(52817),o=n(41609),a=n.n(o),i=n(41291),c=n(85893);const s=function(e){var t=e.value,n=e.breakWords,o=(0,r._)(t),s=a()(o)?t:o.formatInternational();return(0,c.jsx)(i.Z,{href:"tel:".concat(t),target:"_blank",onClick:function(e){return e.stopPropagation()},label:s,breakWords:n})}},81251:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(46927),o=n(70457),a=n(30963),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){(0,r.Z)(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){var t=e.size,n=e.style;return(0,i.jsx)(a.G,s(s({},n),{},{style:{fontSize:t},spin:!0,icon:o.IJ7}))}},67210:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(74806),o=n(12274),a=n(25660),i=n(80722),c=n(20247),s=n(85893);const l=(0,c.U)((0,r.ZP)((function(e){var t=e.path,n=e.context,r=e.onSuccess,c=e.intl,l=e.locale,u=e.emitAction,p=(0,i.Z)(t),d=p?[{id:"rel".concat(p.model),value:p.key}]:[],f=(0,a.Z)(n,"Domain");return(0,s.jsx)(o.ZP,{entityName:"Domain",formName:f,mode:"create",defaultValues:d,locale:l,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Domain/".concat(t)}]}}];r({title:c.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)||u(e)}})})))},36340:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(74806),o=n(12274),a=n(25660),i=n(80722),c=n(20247),s=n(85893);const l=(0,c.U)((0,r.ZP)((function(e){var t=e.context,n=e.path,r=e.onSuccess,c=e.intl,l=e.locale,u=e.emitAction,p=(0,i.Z)(n),d=p?[{id:"rel".concat(p.model),value:p.key}]:[],f=(0,a.Z)(t,"Folder");return(0,s.jsx)(o.ZP,{entityName:"Folder",formName:f,mode:"create",defaultValues:d,locale:l,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Folder/".concat(t)}]}}];r({title:c.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)||u(e)}})})))},96954:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(59713),o=n.n(r),a=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){o()(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)(a.Z,s(s({},e),{},{customDeleteEndpoint:"documents/delete"}))}},90100:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(63038),o=n.n(r),a=n(12274),i=n(25660),c=n(20247),s=n(85893);const l=(0,c.U)((function(e){var t=e.selection,n=e.onSuccess,r=e.onCancel,c=e.locale,l=e.context,u=e.emitAction,p=e.navigate,d=t.ids[0].split("/"),f=o()(d,2),m=f[0],h=f[1];"Resource"===m&&(p("/docs/doc/".concat(h,"/detail")),r());var y=(0,i.Z)(l,m);return(0,s.jsx)(a.ZP,{entityName:m,formName:y,entityId:h,mode:"update",locale:c,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)||u(e)}})}))},4505:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R});var r,o,a,i=n(74806),c=n(50558),s=n(30081),l=n(20247),u=n(63038),p=n.n(u),d=n(28655),f=n.n(d),m=n(18446),h=n.n(m),y=n(1024),g=n(44012),v=n(58804),b=n(36589),x=n(50258),w=n(65035),k=n(73183),j=n(80722),Z=n(85893),P=v.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),O=(0,v.ZP)(x.Z).withConfig({displayName:"StyledLoadMask"})(o||(o=f()(["\n height: auto;\n"]))),_=function(e){return null===e?"Move_root_docs_list_item":"Move_docs_list_item"},N={initialize:s.j2,moveElements:s.w6};const R=(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}}),N)((0,i.ZP)((function(e){var t=e.selection,n=e.onSuccess,r=e.onError,o=e.path,i=e.initialize,c=e.moveElements,s=e.isWaiting,l=e.domainTypes,u=e.rootNodes,d=e.businessUnit,f=e.locale,m=e.emitAction,v=(0,j.Z)(o),b={model:"Docs_list_item",key:"".concat(v.model,"/").concat(v.key)},x=(0,y.useState)(b),N=p()(x,2),R=N[0],C=N[1];(0,y.useEffect)((function(){i(t,n,r)}),[]);var E=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,Z.jsxs)(O,{required:[!s],children:[(0,Z.jsx)(k.default,{routerType:"routerless",initialLocation:function(){if(null===R)return null;var e=R.key.split("/"),t=p()(e,2),n=t[0],r=t[1];return E(n,r)}(),listLimit:10,selectionStyle:"none",searchFormType:"none",disableViewPersistor:!0,getListFormName:_,onListParentChange:C,getCustomLocation:E,navigationStrategy:{},embedded:!0,emitAction:m,noLeftPadding:!0,domainTypes:l,rootNodes:u,businessUnit:d,sortable:!1,scrollBehaviour:"none",locale:f}),(0,Z.jsx)(P,{children:(0,Z.jsx)(w.Z,{onClick:function(){return c(R.key,t.ids)},look:"raised",ink:"primary",disabled:null===R||h()(R,b),children:a||(a=(0,Z.jsx)(g.Z,{id:"client.actions.dms-move.button"}))})})]})}))))},77840:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r.ZP});var r=n(24720)},82445:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r.ZP});var r=n(12274)},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)}}}]);