diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index ad125cf46..fbb8579c6 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1,4 +1,4 @@ -(self.webpackChunksilverstripe_admin=self.webpackChunksilverstripe_admin||[]).push([[296],{13978:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=b(n(19755)),r=b(n(67294)),i=n(86706),s=n(20745),o=n(79655),l=b(n(94974)),d=b(n(15586)),u=b(n(80507)),c=b(n(55766)),f=n(83065),p=b(n(4754)),h=n(11962),m=b(n(87393)),g=n(89250),v=n(80195),_=b(n(3730));function b(e){return e&&e.__esModule?e:{default:e}}t.default=class{constructor(e,t){this.store=e,this.client=t;const n=l.default.get("absoluteBaseUrl");d.default.setAbsoluteBase(n),this.shouldConfirmBeforeUnload=this.shouldConfirmBeforeUnload.bind(this)}setStore(e){this.store=e}setClient(e){this.client=e}start(e){this.matchesReactRoute(e)?this.initReactRouter():this.initLegacyRouter();const t=window.onbeforeunload;window.onbeforeunload=()=>this.shouldConfirmBeforeUnload()?p.default._t("Admin.CONFIRMUNSAVEDSHORT","WARNING: Your changes have not been saved."):"function"==typeof t?t():void 0}matchesReactRoute(e){const t=l.default.get("sections"),n=d.default.resolveURLToBase(e).replace(/\/$/,"");return!!t.find((e=>{const t=d.default.resolveURLToBase(e.url).replace(/\/$/,"");return!!e.reactRouter&&n.match(t)}))}initReactRouter(){u.default.updateRootRoute({component:c.default});const e=u.default.getRootRoute(),t=(0,o.createBrowserRouter)((0,o.createRoutesFromElements)(r.default.createElement(g.Route,{path:e.path,element:r.default.createElement(e.component,null,r.default.createElement(_.default,{shouldBlockFn:this.shouldConfirmBeforeUnload,blockMessage:this.getUnsavedChangesMessage()}))},u.default.getChildRoutes().map((e=>r.default.createElement(g.Route,{key:e.path,path:e.path,element:r.default.createElement(e.component,null)}))))),{basename:(0,v.joinUrlPaths)(l.default.get("baseUrl"),l.default.get("adminUrl"))});(0,s.createRoot)(document.getElementsByClassName("cms-content")[0]).render(r.default.createElement(f.ApolloProvider,{client:this.client},r.default.createElement(i.Provider,{store:this.store},r.default.createElement(o.RouterProvider,{router:t}))))}initLegacyRouter(){const e=l.default.get("sections"),t=this.store;(0,d.default)("*",((e,n)=>{const a=this.getUnsavedChangesMessage();this.shouldConfirmBeforeUnload()&&!window.confirm(a)||(e.store=t,n())}));let n=null;e.forEach((e=>{let t=d.default.resolveURLToBase(e.url);t=t.replace(/\/$/,""),t=`${t}(/*?)?`,(0,d.default)(t,((e,t)=>{if("complete"!==document.readyState||e.init)return void t();n||(n=window.location.pathname);const r=e.state&&e.state.__forceReload;(e.path!==n||r)&&(n=e.path.replace(/#.*$/,""),(0,a.default)(".cms-container").entwine("ss").handleStateChange(null,e.state))}))}));(0,s.createRoot)(document.createElement("div")).render(r.default.createElement("a",{role:"none",onClick:()=>{}})),d.default.start()}shouldConfirmBeforeUnload(){const e=this.store.getState(),t=e.unsavedForms||[],n=e.form.formSchemas;return t.filter((t=>{const a=Object.values(n).find((e=>e.name===t.name));return!!(a&&a.state&&a.state.notifyUnsavedChanges)&&(0,h.isDirty)(t.name,m.default)(e)})).length>0}getUnsavedChangesMessage(){return p.default._t("Admin.CONFIRMUNSAVED","Are you sure you want to navigate away\n from this page?\n\nWARNING: Your changes have not been saved.\n\n\n Press OK to continue, or Cancel to stay on the current page.")}}},56029:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=n(71745),i=(a=n(2395))&&a.__esModule?a:{default:a};t.default=e=>{const t={};return e&&e.__schema.types.forEach((e=>{e.possibleTypes&&(t[e.name]=e.possibleTypes.map((e=>e.name)))})),new r.InMemoryCache({possibleTypes:t,dataIdFromObject:i.default,addTypename:!0})}},56062:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(83065),r=l(n(94974)),i=l(n(85478)),s=l(n(66783)),o=l(n(56029));function l(e){return e&&e.__esModule?e:{default:e}}t.default=async e=>{const t=r.default.getSection("SilverStripe\\Admin\\LeftAndMain").graphql,n=t&&t.cachedTypenames;let l;try{l=await(0,i.default)(e,n)}catch(e){l=null}const d=(0,o.default)(l),u=(0,s.default)(e),c=(0,a.from)(u);return new a.ApolloClient({cache:d,link:c})}},66783:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=n(83065),i=n(63200),s=(a=n(94974))&&a.__esModule?a:{default:a},o=n(80195);t.default=e=>{const t=new r.HttpLink({uri:(0,o.joinUrlPaths)(e,"admin/graphql"),fetchOptions:{credentials:"same-origin",headers:{accept:"application/json"}}}),n=(0,i.onError)((e=>{let{networkError:t}=e;t&&console.log(`[Network error]: ${t}`)}));return[new r.ApolloLink(((e,t)=>(e.setContext({headers:{"X-CSRF-TOKEN":s.default.get("SecurityID")}}),t(e)))),n,t]}},2395:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=e=>{const t=e.id||e.ID;return t&&t>=0&&e.__typename?`${e.__typename}:${t}`:null}},85478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(94301))&&a.__esModule?a:{default:a},i=n(80195);const s=e=>{const t=e.data;return t.__schema.types=t.__schema.types.filter((e=>null!==e.possibleTypes)),t},o=e=>{if(!e.ok)throw new Error("The types.graphql file could not be loaded. You probably need to run a ?flush to generate it.\n Alternatively, you can use the IntrospectionProvider extension to generate the file dynamically.\n More information: https://github.com/silverstripe/silverstripe-graphql/#schema-introspection");return e};t.default=async function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=!!document.body.getAttribute("data-graphql-legacy"),a=[(0,i.joinUrlPaths)(e,"_graphql/admin.types.graphql"),(0,i.joinUrlPaths)(e,"admin.types.graphql")],l=[(0,i.joinUrlPaths)(e,"admin/graphql/types"),(0,i.joinUrlPaths)(e,"assets/admin.types.graphql")];let d,u;n?(t&&l.reverse(),[d,u]=l):[d,u]=a;const c={method:"GET",headers:{"Content-Type":"application/json"},uri:e,credentials:"same-origin"},f=async e=>(0,r.default)(e,c).then(o).then((e=>e.json())).then(s);let p;try{p=await f(d)}catch(e){if(!u)return Promise.reject(e);try{p=await f(u)}catch(e){return Promise.reject(e)}}return Promise.resolve(p)}},59467:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,n=window.__REDUX_DEVTOOLS_EXTENSION__||window.devToolsExtension;if("function"==typeof t)return t(e);if("function"==typeof n)return(0,a.compose)(e,n());return e};var a=n(14890)},10374:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l(n(54582)),r=l(n(39062)),i=l(n(93967)),s=n(48834),o=l(n(98028));function l(e){return e&&e.__esModule?e:{default:e}}const d=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.extraClass?e.extraClass.split(" ").reduce(((e,t)=>({...e,[t]:!0})),{}):{};"string"==typeof e.data.pristineClass&&(n[e.data.pristineClass]=t),"string"==typeof e.data.dirtyClass&&(n[e.data.dirtyClass]=!t);const a=t?e.data.pristineTitle:e.data.dirtyTitle,r=t?e.data.pristineIcon:e.data.dirtyIcon;return{...e,title:a||e.title,icon:r||e.icon,extraClass:(0,i.default)(n)}};t.default=()=>{a.default.transform("field-holders",(e=>{["FieldGroup"].forEach((t=>e.component("FieldGroup",o.default,`${t}Holder`)))})),a.default.transform("form-action-changed",(e=>{e.form.alterSchema("*",(e=>(e.mutateField("action_save",(t=>{const n=e.isPristine();return d(t,n)})),e.mutateField("action_publish",(t=>{const n=t.data.isPublished&&!t.data.isModified&&e.isPristine();return d(t,n)})),e.getState())))})),a.default.transform("schema-validation",(e=>{e.form.addValidation("*",((e,t,n)=>{const a=new r.default(e),i=Object.keys(e).reduce(((e,t)=>{const r=(0,s.findField)(n.fields,t);if(!r)return e;const{valid:i,errors:o}=a.validateFieldSchema(r);return i?e:{...e,[t]:o}}),{});return t.addErrors(i),t.getState()}))}))}},27274:function(e,t,n){"use strict";var a=h(n(54582)),r=n(14890),i=h(n(53894)),s=h(n(94974)),o=h(n(56062)),l=n(32212),d=h(n(89521)),u=h(n(24180)),c=h(n(59467)),f=h(n(10374)),p=h(n(13978));function h(e){return e&&e.__esModule?e:{default:e}}window.ss=window.ss||{},window.onload=async function(){const e=s.default.get("absoluteBaseUrl"),t=await(0,o.default)(e);(0,d.default)(),(0,u.default)();const n=[i.default],h=s.default.get("debugging");let m=(0,r.applyMiddleware)(...n);h&&(m=(0,c.default)(m));const g=m(r.createStore);window.ss.apolloClient=t;const v=new p.default(null,t);(0,f.default)(),a.default.init((()=>{const e=(0,r.combineReducers)(a.default.reducer.getAll()),t=g(e,{});t.dispatch((0,l.setConfig)(s.default.getAll())),a.default.reducer.setStore(t),window.ss.store=t,v.setStore(t),v.start(window.location.pathname),window.jQuery&&window.jQuery("body").addClass("js-react-boot").addClass("js-injector-boot")})),window.setTimeout((()=>a.default.load()),0)}},89521:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(11962),r=ne(n(54582)),i=ne(n(95393)),s=ne(n(37294)),o=ne(n(22602)),l=ne(n(45332)),d=ne(n(74898)),u=ne(n(19423)),c=ne(n(81463)),f=ne(n(63182)),p=ne(n(79629)),h=ne(n(49954)),m=ne(n(41370)),g=ne(n(5110)),v=ne(n(88940)),_=ne(n(71375)),b=ne(n(63980)),y=ne(n(20693)),w=ne(n(65732)),O=ne(n(7162)),C=ne(n(26055)),E=ne(n(21677)),T=ne(n(82432)),S=ne(n(75917)),P=ne(n(61404)),M=ne(n(40505)),j=ne(n(59644)),D=ne(n(52935)),R=ne(n(59888)),k=ne(n(48297)),I=ne(n(55742)),A=ne(n(65963)),x=ne(n(23296)),N=ne(n(3080)),F=ne(n(36800)),L=ne(n(80384)),$=ne(n(34411)),U=ne(n(18871)),B=ne(n(57129)),V=ne(n(98031)),W=ne(n(72543)),H=ne(n(85362)),q=ne(n(97023)),z=ne(n(97228)),G=ne(n(20164)),K=ne(n(62266)),Y=ne(n(65693)),X=ne(n(1922)),Q=ne(n(92227)),J=ne(n(71255)),Z=ne(n(49331)),ee=ne(n(6734)),te=ne(n(84331));function ne(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.registerMany({ActionMenu:i.default,Badge:s.default,Button:o.default,BackButton:l.default,TextField:d.default,HiddenField:u.default,DateField:c.default,TimeField:f.default,DatetimeField:p.default,CheckboxField:h.default,CheckboxSetField:m.default,OptionsetField:g.default,GridField:v.default,GridFieldActions:_.default,FieldGroup:D.default,SingleSelectField:b.default,PopoverField:y.default,HeaderField:w.default,LiteralField:O.default,HtmlReadonlyField:C.default,LookupField:E.default,CompositeField:T.default,Tabs:P.default,TabItem:M.default,FormAction:j.default,LabelField:S.default,TreeDropdownField:R.default,Preview:N.default,ReduxForm:F.default,ReduxFormField:a.Field,Form:A.default,FormAlert:x.default,FormBuilderModal:k.default,NotFoundComponent:I.default,UsedOnTable:L.default,Loading:$.default,CircularLoading:U.default,VersionedBadge:B.default,ViewModeToggle:V.default,ResizeAware:W.default,Tag:H.default,TagList:q.default,CompactTagList:z.default,Tip:G.default,Search:K.default,SearchToggle:Y.default,HtmlEditorField:X.default,NumberField:Q.default,PopoverOptionSet:J.default,ToastsContainer:Z.default,ListboxField:ee.default,SearchableDropdownField:te.default})}},24180:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=_(n(54582)),r=n(14890),i=n(11962),s=_(n(18373)),o=_(n(54191)),l=_(n(81951)),d=_(n(20430)),u=_(n(5452)),c=_(n(54558)),f=_(n(80573)),p=_(n(13346)),h=_(n(11146)),m=_(n(32659)),g=_(n(22793)),v=_(n(84231));function _(e){return e&&e.__esModule?e:{default:e}}t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.combineReducers)({formState:i.reducer,formSchemas:o.default});a.default.reducer.registerMany({config:s.default,form:t,records:l.default,breadcrumbs:d.default,treeDropdownField:u.default,tabs:c.default,mobileMenu:f.default,unsavedForms:p.default,usedOn:h.default,viewMode:g.default,toasts:v.default,...e}),a.default.transform("admin",(e=>{e.reducer("form",m.default)}))}},61534:function(e,t,n){"use strict";n(28432),n(77300),n(12523),n(46844),n(58794),n(91044),n(94033),n(39432),n(10452),n(99324),n(66273),n(62746),n(86673),n(92173),n(65986),n(64482),n(4567),n(77511),n(45970),n(64300),n(16741),n(31968),n(31643),n(63063),n(16089),n(14755),n(50194),n(37386),n(87577),n(43109),n(4193),n(40127),n(44368),n(40256),n(29094),n(60462),n(49841),n(99511),n(14536),n(96582),n(1488),n(69860),n(33281),n(79035),n(8592),n(46508),n(28170),n(53438),n(83361),n(94813),n(72472),n(55488),n(40829),n(47157),n(53877),n(71080),n(37904),n(97976),n(8145),n(87746),n(86317),n(87603),n(59628),n(70184),n(91673),n(60128),n(87872),n(60140),n(57006),n(19602),n(27729),n(54218),n(98441),n(96007),n(43893),n(51865),n(1913),n(88854),n(47640),n(50628),n(62596),n(73843),n(49266),n(95075),n(49958),n(60395),n(41221),n(88615),n(82165),n(56970),n(73366),n(81047),n(87594),n(15878),n(75350),n(8162),n(76406),n(8298),n(40303),n(44686),n(49785),n(13305),n(57893),n(49414),n(42886),n(17106),n(46993),n(27274)},34625:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(67294))&&a.__esModule?a:{default:a};t.default=e=>r.default.createElement("div",{className:"accordion",role:"tablist","aria-multiselectable":"true"},e.children)},56448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(67294))&&a.__esModule?a:{default:a};t.default=e=>{const t=`${e.groupid}_Header`,n=`${e.groupid}_Items`,a=n.replace(/\\/g,"_"),i=t.replace(/\\/g,"_"),s={id:a,"aria-expanded":!0,className:"list-group list-group-flush collapse show",role:"tabpanel","aria-labelledby":t};return r.default.createElement("div",{className:"accordion__block"},r.default.createElement("a",{className:"accordion__title","data-toggle":"collapse",href:`#${a}`,"aria-expanded":"true","aria-controls":n,id:i,role:"tab"},e.title),r.default.createElement("div",s,e.children))}},95393:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=l(n(45697)),i=n(53556),s=l(n(4754)),o=l(n(93967));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.setState({isOpen:!this.state.isOpen})),0)}render(){const{dropdownToggleProps:e,dropdownMenuProps:t,dropdownToggleClassNames:n,className:r,toggleCallback:l,...d}=this.props,c=(0,o.default)(n,e.className),f=(0,o.default)("action-menu__dropdown",t.className);return a.default.createElement(i.Dropdown,u({className:(0,o.default)("action-menu",r),isOpen:this.state.isOpen,toggle:this.toggle},d),a.default.createElement(i.DropdownToggle,u({className:c,"aria-label":s.default._t("Admin.ACTIONS","View actions")},e)),a.default.createElement(i.DropdownMenu,u({className:f},t),this.props.children))}}c.propTypes={toggleCallback:r.default.func,dropdownToggleClassNames:r.default.arrayOf(r.default.string)},c.defaultProps={className:"",dropdownToggleClassNames:["action-menu__toggle","btn","btn--no-text","btn--icon-xl","font-icon-dot-3"],dropdownToggleProps:{},dropdownMenuProps:{}};t.default=c},37294:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.statuses=t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=s(n(93967)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}const l=t.statuses=["default","info","success","warning","danger","primary","secondary"];class d extends a.PureComponent{render(){const{status:e,inverted:t,className:n,message:i}=this.props;if(!e)return null;const s=t?`badge-${e}--inverted`:"",o=(0,r.default)(n,"badge",`badge-${e}`,s);return a.default.createElement("span",{className:o},i)}}d.propTypes={message:i.default.node,status:i.default.oneOf(l),className:i.default.string,inverted:i.default.bool},d.defaultProps={status:"default",className:"badge-pill",inverted:!1};t.default=d},71691:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=n(86706),i=d(n(93967)),s=d(n(45697)),o=d(n(67388)),l=d(n(5257));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class c extends a.Component{getLastCrumb(){return this.props.crumbs&&this.props.crumbs[this.props.crumbs.length-1]}renderBreadcrumbs(){return this.props.crumbs?this.props.crumbs.slice(0,-1).map((e=>a.default.createElement("li",{key:e.text,className:"breadcrumb__item"},a.default.createElement(l.default,{className:"breadcrumb__item-title",href:e.href,onClick:e.onClick},e.text)))):null}renderLastCrumb(){const e=this.getLastCrumb();return e?a.default.createElement("div",{className:"breadcrumb__item breadcrumb__item--last"},a.default.createElement("h2",{className:"breadcrumb__item-title"},e.text,e.icon&&this.renderIcons([e.icon]),e.icons&&this.renderIcons(e.icons))):null}renderIcons(e){return e.map(((e,t)=>{const{nodeName:n,className:r,hasRestrictedAccess:s,...l}=e;let d={...l};const u=(0,i.default)(["breadcrumb__icon",r]);return d={tabIndex:"0",...d},d.hasOwnProperty("onClick")&&(d={role:"button",...d}),d.key=`breadcrumb-icon-${t}`,"FileStatusIcon"===n?(d.fileID=0,d.hasRestrictedAccess=s,d.extraClassName=u,a.default.createElement(o.default,d)):(d.className=u,a.default.createElement("span",d))}))}render(){return a.default.createElement("div",{className:"breadcrumb__container fill-height flexbox-area-grow"},this.props.crumbs&&this.props.crumbs.length>1&&a.default.createElement("div",{className:"breadcrumb__list-container"},a.default.createElement("ol",{className:"breadcrumb"},this.renderBreadcrumbs())),this.renderLastCrumb())}}t.Component=c,c.propTypes={crumbs:s.default.arrayOf(s.default.shape({onClick:s.default.func,text:s.default.string,icon:s.default.shape({nodeName:s.default.string,className:s.default.string,onClick:s.default.func,action:e=>{if(e.action)throw new Error("action: no longer used")}}),icons:s.default.arrayOf(s.default.shape({nodeName:s.default.string,className:s.default.string,onClick:s.default.func}))}))};t.default=(0,r.connect)((function(e){return{crumbs:e.breadcrumbs}}))(c)},45332:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n(67294)),r=o(n(22602)),i=o(n(93967)),s=o(n(4754));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{className:t,...n}=e;return a.default.createElement(r.default,l({className:(0,i.default)(t,"back-button")},n))};d.propTypes=r.default.propTypes,d.defaultProps={...r.default.defaultProps,noText:!0,icon:"left-open-big",children:s.default._t("Admin.BACK","Back")};t.default=d},22602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l(n(67294)),r=n(53556),i=l(n(45697)),s=l(n(93967)),o=l(n(29258));function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{className:t,noText:n,children:i,...o}=e;return a.default.createElement(r.Button,d({className:(0,s.default)(t,{"btn--no-text":n}),"aria-label":n?i:void 0},o),n?void 0:i)};u.propTypes={...r.Button.propTypes,noText:i.default.bool},u.defaultProps={...r.Button.defaultProps,noText:!1};t.default=(0,o.default)(u)},29258:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=s(n(67294)),r=s(n(45697)),i=s(n(93967));function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=t=>{let{icon:n,className:r,...s}=t;return a.default.createElement(e,o({className:(0,i.default)(r,n&&`font-icon-${n}`)},s))};return t.propTypes={...e.propTypes,icon:r.default.string},t.defaultProps=e.defaultProps,t.displayName=e.name,t}},49954:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=s(n(67294)),r=s(n(98028)),i=s(n(31885));function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.default.createElement(i.default,o({},e,{type:"checkbox"}));t.Component=l;t.default=e=>{const t=(0,r.default)(l);return a.default.createElement(t,o({},e,{hideLabels:!0}))}},41370:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=o(n(31885)),i=o(n(98028)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t`${e}`)):[]}getOptionProps(e,t){const n=this.getValues(),a=this.getItemKey(e,t);return{key:a,id:a,name:this.props.name,className:this.props.itemClass,disabled:e.disabled||this.props.disabled,readOnly:this.props.readOnly,onChange:this.handleChange,value:n.indexOf(`${e.value}`)>-1,title:e.title,type:"checkbox"}}handleChange(e,t){if("function"==typeof this.props.onChange){const n=this.getValues(),a=this.props.source.filter(((e,a)=>this.getItemKey(e,a)===t.id?1===t.value:n.indexOf(`${e.value}`)>-1)).map((e=>`${e.value}`));this.props.onChange(e,{id:this.props.id,value:a})}}render(){return this.props.source?a.default.createElement("div",null,this.props.source.map(((e,t)=>a.default.createElement(r.default,d({},this.getOptionProps(e,t),{hideLabels:!0}))))):null}}t.Component=u,u.propTypes={className:s.default.string,extraClass:s.default.string,itemClass:s.default.string,id:s.default.string,name:s.default.string.isRequired,source:s.default.arrayOf(s.default.shape({value:s.default.oneOfType([s.default.string,s.default.number]),title:s.default.any,disabled:s.default.bool})),onChange:s.default.func,value:s.default.any,readOnly:s.default.bool,disabled:s.default.bool},u.defaultProps={extraClass:"",className:"",value:[]};t.default=e=>{const t=(0,i.default)(u);return a.default.createElement(t,e)}},82432:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=s(n(10259)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class l extends a.Component{getLegend(){return"fieldset"===this.props.data.tag&&this.props.data.legend?(0,r.default)("legend",this.props.data.legend):null}getClassName(){return`${this.props.className} ${this.props.extraClass}`}render(){const e=this.getLegend(),t=this.props.data.tag||"div",n=this.getClassName();return a.default.createElement(t,{className:n},e,this.props.children)}}t.Component=l,l.propTypes={data:i.default.oneOfType([i.default.array,i.default.shape({tag:i.default.string,legend:i.default.string})]),extraClass:i.default.string},l.defaultProps={className:"",extraClass:""};t.default=l},81463:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=d(n(98028)),r=d(n(30381)),i=d(n(68300)),s=d(n(4754)),o=d(n(45697)),l=n(74898);function d(e){return e&&e.__esModule?e:{default:e}}class u extends l.Component{render(){return super.render()}moment(){return r.default.locale(this.getLang()),(0,r.default)(...arguments)}getLang(){return(this.asHTML5()?this.props.isoLang:this.props.lang)||(0,r.default)().locale()}asHTML5(){return this.props.data.html5&&this.hasNativeSupport()}hasNativeSupport(){return this.props.modernizr.inputtypes.date}getInputProps(){const e=s.default.inject(s.default._t("Admin.FormatExample","Example: {format}"),{format:this.moment().endOf("month").format("L")}),t=this.asHTML5()?this.props.value:this.getLocalisedValue(),n=this.asHTML5()?"date":"text";return{...super.getInputProps(),type:n,value:t,placeholder:e}}getLocalisedValue(){return this.convertToLocalised(this.props.value)}isMultiline(){return!1}handleChange(e){const t=e.target.value;let n="";n=this.asHTML5()?t:this.convertToIso(t),"function"==typeof this.props.onChange&&this.triggerChange(e,n)}triggerChange(e,t){this.props.onChange(e,{id:this.props.id,value:t})}convertToIso(e){let t="";if(e){const n=this.moment(e,["L","YYYY-MM-DD"]);n.isValid()&&(t=n.format("YYYY-MM-DD"))}return t}convertToLocalised(e){let t="";if(e){const n=this.moment(e);n.isValid()&&(t=n.format("L"))}return t}}t.Component=u,u.propTypes={lang:o.default.string,isoLang:o.default.string,modernizr:o.default.object,data:o.default.shape({html5:o.default.bool})},u.defaultProps={modernizr:i.default,data:{}};t.default=(0,a.default)(u)},79629:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=o(n(98028)),r=o(n(30381)),i=o(n(4754)),s=n(81463);function o(e){return e&&e.__esModule?e:{default:e}}const l="L LT";class d extends s.Component{getInputProps(){const e=i.default.inject(i.default._t("Admin.FormatExample","Example: {format}"),{format:this.moment().endOf("month").format(l)}),t=this.asHTML5()?"datetime-local":"text";return{...super.getInputProps(),type:t,placeholder:e}}isMultiline(){return!1}hasNativeSupport(){return this.props.modernizr.inputtypes["datetime-local"]}triggerChange(e,t){/^\d{4}-\d\d-\d\dT\d\d:\d\d$/.test(t)?this.props.onChange(e,{id:this.props.id,value:`${t}:00`}):this.props.onChange(e,{id:this.props.id,value:t})}convertToLocalised(e){r.default.locale(this.props.lang);let t="";if(e){const n=this.moment(e);n.isValid()&&(t=n.format(l))}return t}convertToIso(e){r.default.locale(this.props.lang);let t="";if(e){const n=[l,"L",r.default.ISO_8601],a=this.moment(e,n);a.isValid()&&(t=a.format("YYYY-MM-DDTHH:mm:ss"))}return t}}t.Component=d,d.propTypes=s.Component.propTypes,d.defaultProps=s.Component.defaultProps;t.default=(0,a.default)(d)},52935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=s(n(82432)),r=s(n(45697)),i=s(n(93967));function s(e){return e&&e.__esModule?e:{default:e}}class o extends a.default{getClassName(){return(0,i.default)("field-group-component",{"field-group-component__small-holder":this.props.smallholder},super.getClassName())}}o.propTypes={...a.default.propTypes,smallholder:r.default.bool},o.defaultProps={...a.default.defaultProps,smallholder:!0};t.default=o},98028:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=c(n(67294)),r=n(53556),i=d(n(10259)),s=d(n(93967)),o=d(n(45697)),l=c(n(20164));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}t.default=function(e){class t extends a.Component{getMessage(){let e=null;this.props.message&&this.props.message.value&&(e=this.props.message);const t=this.props.meta;return t&&t.error&&t.touched&&(!e||t.dirty)&&(e=t.error),e}getHolderProps(){return{className:(0,s.default)({field:!0,[this.props.extraClass]:!0,readonly:this.props.readOnly}),id:this.props.holderId}}renderMessage(){const e=this.getMessage();if(!e)return null;const t=(0,s.default)(["form__field-message",`form__field-message--${e.type}`]),n=(0,i.default)("div",e.value);return a.default.createElement("div",{className:t},n)}renderLeftTitle(){const e=this.props.leftTitle?this.props.leftTitle:this.props.title;return!e||this.props.hideLabels?null:(0,i.default)(r.Label,e,{className:"form__field-label",for:this.props.id})}renderRightTitle(){return!this.props.rightTitle||this.props.hideLabels?null:(0,i.default)(r.Label,this.props.rightTitle,{className:"form__field-label",for:this.props.id})}renderField(){const t=Boolean(this.getMessage()),n={...this.props,extraClass:(0,s.default)(this.props.extraClass,{"is-invalid":t})},i=a.default.createElement(e,n),o=this.props.data&&this.props.data.prefix?this.props.data.prefix:"",l=this.props.data&&this.props.data.suffix?this.props.data.suffix:"";return o||l?a.default.createElement(r.InputGroup,null,o&&a.default.createElement(r.InputGroupAddon,{addonType:"prepend"},o),i,l&&a.default.createElement(r.InputGroupAddon,{addonType:"append"},l)):i}renderTitleTip(){return this.props.id&&this.props.titleTip&&this.props.titleTip.content?a.default.createElement(l.default,{id:`FieldHolder-${this.props.id}-titleTip`,content:this.props.titleTip.content,fieldTitle:this.props.title,type:l.TIP_TYPES.TITLE,icon:"menu-help"}):null}renderDescription(){return null===this.props.description?null:(0,i.default)("div",this.props.description,{className:"form__field-description"})}render(){return this.props.noHolder?this.renderField():a.default.createElement(r.FormGroup,this.getHolderProps(),this.renderLeftTitle(),this.renderTitleTip(),a.default.createElement("div",{className:"form__field-holder"},this.renderField(),this.renderMessage(),this.renderDescription()),this.renderRightTitle())}}return t.propTypes={leftTitle:o.default.any,rightTitle:o.default.any,title:o.default.any,extraClass:o.default.string,holderId:o.default.string,id:o.default.string,name:o.default.string,description:o.default.any,hideLabels:o.default.bool,message:o.default.shape({extraClass:o.default.string,value:o.default.any,type:o.default.string}),data:o.default.oneOfType([o.default.array,o.default.shape({prefix:o.default.string,suffix:o.default.string})]),titleTip:o.default.shape(l.tipShape)},t.defaultProps={className:"",extraClass:"",leftTitle:null,rightTitle:null,title:"",description:null,hideLabels:!1,noHolder:!1,message:null,data:{}},t}},67388:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=l(n(45697)),i=l(n(4754)),s=l(n(93967)),o=n(53556);function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.container=e}},this.props.children)}}o.propTypes={children:i.default.any,className:i.default.string,onClickOut:i.default.func.isRequired},o.defaultProps={className:""};t.default=o},65963:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=s(n(23296)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.default.createElement(e,l({key:n,className:n?"":"message-box--panel-top"},t)))):null}handleSubmit(e){e.stopPropagation();for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a{this.form=e,this.props.setDOM(e)},role:"form"}),t&&a.default.createElement("fieldset",this.props.fieldHolder,r,this.props.afterMessages,t),n&&n.length?a.default.createElement("div",this.props.actionHolder,n):null)}}t.Component=d,d.propTypes={autoFocus:i.default.bool,setDOM:i.default.func,valid:i.default.bool,actions:i.default.array,fieldHolder:i.default.shape({className:i.default.string}),actionHolder:i.default.shape({className:i.default.string}),extraClass:i.default.string,afterMessages:i.default.node,attributes:i.default.shape({action:i.default.string.isRequired,className:i.default.string,encType:i.default.string,id:i.default.string,method:i.default.string.isRequired}),fields:i.default.array.isRequired,handleSubmit:i.default.func,mapActionsToComponents:i.default.func.isRequired,mapFieldsToComponents:i.default.func.isRequired,messages:i.default.arrayOf(i.default.shape({extraClass:i.default.string,value:i.default.any,type:i.default.string})),formTag:i.default.oneOfType([i.default.func,i.default.string]),FormAlertComponent:i.default.oneOfType([i.default.object,i.default.func])},d.defaultProps={setDOM:()=>null,formTag:"form",actionHolder:{className:"btn-toolbar"},FormAlertComponent:r.default};t.default=d},430:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={CSRF_HEADER:"X-SecurityID"}},59644:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=o(n(10259)),i=o(n(93967)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends a.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}getButtonProps(){const{attributes:e,id:t,name:n}=this.props;return{...void 0===e?{}:e,id:t,name:n,className:this.getButtonClasses(),disabled:this.isDisabled(),onClick:this.handleClick}}getButtonClasses(){const{title:e,loading:t,extraClass:n}=this.props,a={btn:!0,"btn--no-text":"string"!=typeof e,"btn--loading":t,disabled:this.isDisabled()},r=this.getButtonStyle();r&&(a[`btn-${r}`]=!0);const s=this.getIcon();return s&&(a[`font-icon-${s}`]=!0),"string"==typeof n&&(a[n]=!0),(0,i.default)(a)}getButtonStyle(){if(void 0!==this.props.data.buttonStyle)return this.props.data.buttonStyle;if(void 0!==this.props.buttonStyle)return this.props.buttonStyle;return this.props.extraClass.split(" ").find((e=>e.indexOf("btn-")>-1))?null:this.isPrimary()?"primary":"secondary"}getIcon(){return this.props.icon||this.props.data.icon||null}getLoadingIcon(){return this.props.loading?a.default.createElement("div",{className:"btn__loading-icon"},a.default.createElement("span",{className:"btn__circle btn__circle--1"}),a.default.createElement("span",{className:"btn__circle btn__circle--2"}),a.default.createElement("span",{className:"btn__circle btn__circle--3"})):null}isDisabled(){const{disabled:e,readOnly:t}=this.props;return e||t}isPrimary(){const{extraClass:e,name:t}=this.props,n=e?e.split(" "):[];return"action_save"===t||!!n.find((e=>"ss-ui-action-constructive"===e))}handleClick(e){"function"==typeof this.props.onClick&&this.props.onClick(e,this.props.name||this.props.id)}render(){const{title:e}=this.props;return a.default.createElement("button",this.getButtonProps(),this.getLoadingIcon(),(0,r.default)("span",e,{className:"btn__title"}))}}d.propTypes={id:s.default.string,name:s.default.string,onClick:s.default.func,title:s.default.string,type:s.default.string,loading:s.default.bool,icon:s.default.string,disabled:s.default.bool,readOnly:s.default.bool,data:s.default.oneOfType([s.default.array,s.default.shape({buttonStyle:s.default.string})]),extraClass:s.default.string,attributes:s.default.object},d.defaultProps={title:"",icon:"",extraClass:"",attributes:{},data:{},disabled:!1,readOnly:!1};t.default=d},23296:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=n(53556),i=l(n(10259)),s=l(n(93967)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}class u extends a.Component{constructor(e){super(e),this.handleClosed=this.handleClosed.bind(this),this.state={visible:!0}}getMessageStyle(){switch(this.props.type){case"good":case"success":return"success";case"info":return"info";case"warn":case"warning":return"warning";default:return"danger"}}getMessageProps(){const e=this.props.type||"no-type";return{className:(0,s.default)(["message-box",`message-box--${e}`,this.props.className,this.props.extraClass]),color:this.getMessageStyle(),toggle:this.props.closeLabel?this.handleClosed:null,isOpen:!this.props.closeLabel||this.state.visible}}handleClosed(){"function"==typeof this.props.onClosed?this.props.onClosed():this.setState({visible:!1})}render(){if("boolean"!=typeof this.props.visible&&this.state.visible||this.props.visible){const e=(0,i.default)("div",this.props.value);if(e)return a.default.createElement(r.Alert,this.getMessageProps(),e)}return null}}u.propTypes={extraClass:o.default.string,value:o.default.any,type:o.default.string,onClosed:o.default.func,closeLabel:o.default.string,visible:o.default.bool},u.defaultProps={extraClass:"",className:""};t.default=u},56334:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schemaPropType=t.default=t.basePropTypes=t.Component=void 0;var a=f(n(67294)),r=u(n(45697)),i=u(n(21965)),s=f(n(48834)),o=n(48942),l=u(n(1591)),d=n(54582);function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.context.injector.get(e,`${n}.${t}`);switch(e){case"Integer":case"Decimal":return a("NumberField");case"String":case"Text":return a("TextField");case"Date":return a("DateField");case"Time":return a("TimeField");case"Datetime":return a("DatetimeField");case"Hidden":return a("HiddenField");case"SingleSelect":return a("SingleSelectField");case"Custom":return a("GridField");case"Structural":return a("CompositeField");case"Boolean":return a("CheckboxField");case"MultiSelect":return a("CheckboxSetField");default:return null}}validateForm(e){if("function"==typeof this.props.validate)return this.props.validate(e);if(!(this.props.schema&&this.props.schema.schema))return{};const t=this.context.injector.validate(this.props.identifier);let n={};return t&&(n=t(e,this.props.schema.schema)||{}),(0,o.createErrorBlock)(n)}buildComponent(e){const t=e.input||{},n={...e,...e.input,onChange:t.onChange?(e,n)=>{t.onChange(n?n.value:e)}:null};delete n.input;const r=this.getComponent(n);if(null===r)return null;if(null!==n.schemaComponent&&void 0===r)throw Error(`Component not found in injector: ${n.schemaComponent}`);const i=this.props.createFn;return"function"==typeof i?i(r,n):a.default.createElement(r,p({key:n.id},n))}mapFieldsToComponents(e){const t=this.props.baseFieldComponent;return e.map((e=>{let n=e;return e.children&&(n=Object.assign({},e,{children:this.mapFieldsToComponents(e.children)})),n=Object.assign({onAutofill:this.props.onAutofill,formid:this.props.form},n),"Structural"===e.schemaType||!0===e.readOnly?this.buildComponent(n):a.default.createElement(t,p({key:n.id},n,{component:this.buildComponent}))}))}handleAction(e){"function"==typeof this.props.onAction&&this.props.onAction(e,this.props.values),e.isPropagationStopped()||this.setState({submittingAction:e.currentTarget.name})}handleSubmit(e){let t="";this.state.submittingAction?t=this.state.submittingAction:this.props.schema.schema.actions[0]&&(t=this.props.schema.schema.actions[0].name);const n=Object.assign({},e,t?{[t]:1}:{}),a={"X-Formschema-Request":this.props.responseRequestedSchema.join(),"X-Requested-With":"XMLHttpRequest"},r=e=>this.submitApi(e||n,a).then((e=>(this.setState({submittingAction:null}),e))).catch((e=>{throw this.setState({submittingAction:null}),e}));return"function"==typeof this.props.onSubmit?this.props.onSubmit(n,t,r):r()}mapActionsToComponents(e){return e.map((e=>{const t=Object.assign({},e);return e.children?t.children=this.mapActionsToComponents(e.children):(t.onClick=this.handleAction,this.props.submitting&&this.state.submittingAction===e.name&&(t.loading=!0)),this.buildComponent(t)}))}normalizeFields(e,t){return e.map((e=>{const n=t&&t.fields?t.fields.find((t=>t.id===e.id)):{},a=i.default.recursive(!0,(0,s.schemaMerge)(e,n),{schemaComponent:n&&n.component?n.component:e.component});return e.children&&(a.children=this.normalizeFields(e.children,t)),a}))}render(){const e=this.props.schema.schema,t=this.props.schema.state,n=this.props.baseFormComponent,r={...e.attributes,className:e.attributes.class,encType:e.attributes.enctype,noValidate:!0};delete r.class,delete r.enctype;const{asyncValidate:i,fieldHolder:o,actionHolder:l,onSubmitFail:d,onSubmitSuccess:u,shouldAsyncValidate:c,touchOnBlur:f,touchOnChange:p,persistentSubmitErrors:h,form:m,afterMessages:g,autoFocus:v,formTag:_}=this.props,b={form:m,afterMessages:g,fields:this.normalizeFields(e.fields,t),fieldHolder:o,actions:this.normalizeFields(e.actions,t),actionHolder:l,attributes:r,data:e.data,initialValues:(0,s.default)(e,t),onSubmit:this.handleSubmit,valid:t&&t.valid,messages:t&&Array.isArray(t.messages)?t.messages:[],mapActionsToComponents:this.mapActionsToComponents,mapFieldsToComponents:this.mapFieldsToComponents,asyncValidate:i,onSubmitFail:d,onSubmitSuccess:u,shouldAsyncValidate:c,touchOnBlur:f,touchOnChange:p,persistentSubmitErrors:h,validate:this.validateForm,autoFocus:v,setDOM:e=>{this.formDOM=e},formTag:_};return a.default.createElement(n,b)}}t.Component=h;const m=t.schemaPropType=r.default.shape({id:r.default.string,schema:r.default.shape({attributes:r.default.shape({class:r.default.string,enctype:r.default.string}),fields:r.default.array.isRequired}),state:r.default.shape({fields:r.default.array}),loading:r.default.bool,stateOverride:r.default.shape({fields:r.default.array})}),g=t.basePropTypes={createFn:r.default.func,onSubmit:r.default.func,onAction:r.default.func,asyncValidate:r.default.func,onSubmitFail:r.default.func,onSubmitSuccess:r.default.func,shouldAsyncValidate:r.default.func,touchOnBlur:r.default.bool,touchOnChange:r.default.bool,persistentSubmitErrors:r.default.bool,validate:r.default.func,values:r.default.object,submitting:r.default.bool,baseFormComponent:r.default.elementType.isRequired,baseFieldComponent:r.default.elementType.isRequired,getCustomFields:r.default.func,responseRequestedSchema:r.default.arrayOf(r.default.oneOf(["schema","state","errors","auto"])),identifier(e,t,n){return/^[A-Za-z0-9_.]+$/.test(e[t])?null:new Error(`\n Invalid identifier supplied to ${n}. Must be a set of\n dot-separated alphanumeric strings.\n `)}};h.propTypes=Object.assign({},g,{form:r.default.string.isRequired,schema:m.isRequired,autoFocus:r.default.bool}),h.defaultProps={responseRequestedSchema:["auto"],autoFocus:!1};t.default=(0,d.withInjector)(h)},48297:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=d(n(16304)),i=d(n(10259)),s=d(n(93967)),o=d(n(45697)),l=d(n(97399));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const c=()=>null,f=e=>{let{children:t,FormBuilderLoaderComponent:n,onLoadingError:r,onSubmit:o,responseClassBad:d,responseClassGood:u,showErrorMessage:f,autoFocus:p,bodyClassName:h,identifier:m,onAction:g,schemaUrl:v,className:_,isOpen:b,modalClassName:y,ModalComponent:w,ModalHeaderComponent:O,onClosed:C,showCloseButton:E,size:T,title:S}=e;const[P,M]=(0,a.useState)(null),[j,D]=(0,a.useState)(null),R={className:_,isOpen:b,modalClassName:y,ModalComponent:w,ModalHeaderComponent:O,onClosed:()=>{M(null),D(!1),"function"==typeof C&&C()},showCloseButton:E,size:T,title:S},k={actionHolder:{className:"modal-footer"},autoFocus:p,bodyClassName:h,fieldHolder:{className:(0,s.default)("modal-body",h)},identifier:m,onAction:g,onLoadingError:e=>{const t=r!==c;if(f||!t){const t=e.errors&&e.errors[0];M(t.value),D(!0)}t&&r(e)},onSubmit:(e,t,n)=>{M(null),D(!1);let a=null;if(a="function"==typeof o?o(e,t,n):n(),!a)throw new Error("Promise was not returned for submitting");return a.then((e=>(e&&(M(e.message),D(!1)),e))).catch((e=>{e.then((e=>{M(e),D(!0)}))})),a},schemaUrl:v};return a.default.createElement(l.default,R,P&&a.default.createElement("div",{className:j?d:u},(0,i.default)("span",{html:P})),v&&a.default.createElement(n,k),t)};f.propTypes={autoFocus:o.default.bool,bodyClassName:o.default.string,schemaUrl:o.default.string,onSubmit:o.default.func,onAction:o.default.func,responseClassGood:o.default.string,responseClassBad:o.default.string,identifier:o.default.string,showErrorMessage:o.default.bool,onLoadingError:o.default.func,FormBuilderLoaderComponent:o.default.oneOfType([o.default.object,o.default.func]),...l.default.propTypes},f.defaultProps={showErrorMessage:!1,onLoadingError:c,modalClassName:"form-builder-modal",responseClassGood:"alert alert-success",responseClassBad:"alert alert-danger",FormBuilderLoaderComponent:r.default};t.default=f},88940:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=b(n(67294)),r=v(n(4754)),i=n(14890),s=n(86706),o=v(n(430)),l=b(n(30772)),d=v(n(10259)),u=v(n(45697)),c=v(n(59746)),f=v(n(73542)),p=v(n(84002)),h=v(n(58227)),m=v(n(18052)),g=v(n(13527));function v(e){return e&&e.__esModule?e:{default:e}}function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}const y=[];class w extends a.Component{constructor(e){super(e),this.deleteRecord=this.deleteRecord.bind(this),this.editRecord=this.editRecord.bind(this)}componentDidMount(){const e=this.props.data;this.props.actions.fetchRecords(e.recordType,e.collectionReadEndpoint.method,e.collectionReadEndpoint.url)}createRowActions(e){return a.default.createElement(m.default,{className:"grid-field__cell--actions",key:"Actions"},a.default.createElement(g.default,{icon:"cog",onClick:this.editRecord,record:e}),a.default.createElement(g.default,{icon:"cancel",onClick:this.deleteRecord,record:e}))}createCell(e,t){const n=this.props.data.onDrillDown,a={className:n?"grid-field__cell--drillable":"",onDrillDown:n?t=>n(t,e):null,key:`${t.name}`,width:t.width},r=t.field.split(".").reduce(((e,t)=>e[t]),e);return(0,d.default)(m.default,r,a)}createRow(e){const t={className:this.props.data.onDrillDown?"grid-field__row--drillable":"",key:`${e.ID}`},n=this.props.data.columns.map((t=>this.createCell(e,t))),r=this.createRowActions(e);return a.default.createElement(h.default,t,n,r)}deleteRecord(e,t){e.preventDefault();const n={};n[o.default.CSRF_HEADER]=this.props.config.SecurityID,confirm(r.default._t("CampaignAdmin.DELETECAMPAIGN","Are you sure you want to delete this record?"))&&this.props.actions.deleteRecord(this.props.data.recordType,t,this.props.data.itemDeleteEndpoint.method,this.props.data.itemDeleteEndpoint.url,n)}editRecord(e,t){e.preventDefault(),this.props.data&&"function"==typeof this.props.data.onEditRecord&&this.props.data.onEditRecord(e,t)}render(){if(this.props.records===y)return a.default.createElement("div",null,r.default._t("CampaignAdmin.LOADING","Loading..."));if(!this.props.records.length)return a.default.createElement("div",null,r.default._t("CampaignAdmin.NO_RECORDS","No campaigns created yet."));const e=a.default.createElement("th",{key:"holder",className:"grid-field__action-placeholder"}),t=this.props.data.columns.map((e=>a.default.createElement(p.default,{key:e.name},e.name))),n=a.default.createElement(f.default,null,t.concat(e)),i=this.props.records.map((e=>this.createRow(e)));return a.default.createElement(c.default,{header:n,rows:i})}}w.propTypes={data:u.default.shape({recordType:u.default.string.isRequired,headerColumns:u.default.array,collectionReadEndpoint:u.default.object,onDrillDown:u.default.func,onEditRecord:u.default.func})};t.default=(0,s.connect)((function(e,t){const n=t.data&&t.data.recordType;return{config:e.config,records:n&&e.records[n]?e.records[n]:y}}),(function(e){return{actions:(0,i.bindActionCreators)(l,e)}}))(w)},13527:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(a,i,o):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),i=(a=n(45697))&&a.__esModule?a:{default:a};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class o extends r.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){this.props.onClick(e,this.props.record.ID)}render(){return r.default.createElement("button",{className:`grid-field__icon-action font-icon-${this.props.icon} btn--icon-lg`,onClick:this.handleClick})}}o.propTypes={onClick:i.default.func.isRequired};t.default=o},18052:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=s(n(93967)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.default.createElement(r.default,null,e.children)},84002:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(67294))&&a.__esModule?a:{default:a};t.default=e=>r.default.createElement("th",null,e.children)},58227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(67294))&&a.__esModule?a:{default:a};t.default=e=>{const t=`grid-field__row ${e.className}`;return r.default.createElement("tr",{tabIndex:0,className:t},e.children)}},59746:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(a,i,o):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),i=(a=n(45697))&&a.__esModule?a:{default:a};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class o extends r.Component{generateHeader(){return void 0!==this.props.header?this.props.header:null}generateRows(){return void 0!==this.props.rows?this.props.rows:null}render(){return r.default.createElement("div",{className:"grid-field"},r.default.createElement("table",{className:"table table-hover grid-field__table"},r.default.createElement("thead",null,this.generateHeader()),r.default.createElement("tbody",null,this.generateRows())))}}o.propTypes={header:i.default.object,rows:i.default.array};t.default=o},71375:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=n(53556),i=d(n(93967)),s=d(n(45697)),o=d(n(86010)),l=d(n(95393));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class c extends a.PureComponent{renderMultipleActions(e){const t=e.reduce(((e,t)=>{const n=e,a=t.group;if(!a)throw new Error(`Action: "${t.title}" has no group assigned`);return n[a]||(n[a]=[]),n[a].push(t),n}),[]);return a.default.createElement(l.default,{dropdownMenuProps:{right:!0},dropdownToggleClassNames:["action-menu__toggle","btn","btn--no-text","btn-sm","font-icon-dot-3"]},Object.keys(t).map(((e,n)=>[0!==n&&a.default.createElement(r.DropdownItem,{divider:!0,key:e}),t[e].map(((e,t)=>a.default.createElement(o.default,{data:e.data,title:e.title,type:e.type,url:e.url,key:t})))])))}renderSingleAction(e){const{type:t,title:n,data:s}=e;let o,{url:l}=e;"submit"===t&&(o="submit",l=void 0);const d=(0,i.default)("action",s.classNames);return a.default.createElement(r.Button,{className:d,type:o,href:l,"data-url":s["data-url"],"data-action-state":s["data-action-state"],name:s.name,color:"secondary"},n)}render(){const{schema:e}=this.props;return e.length>1?this.renderMultipleActions(e):1===e.length?this.renderSingleAction(e[0]):null}}const f=o.default.propTypes;f.group=s.default.string,c.propTypes=s.default.arrayOf(s.default.shape(f)).isRequired;t.default=c},86010:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=n(53556),i=o(n(93967)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends a.PureComponent{render(){const{type:e,title:t,data:n}=this.props;let{url:s}=this.props;const o=(0,i.default)("action",n.classNames);let l=null;switch(e){case"submit":case"button":l="button",s=void 0;break;case"link":l="a";break;default:l=void 0}return a.default.createElement(r.DropdownItem,{className:o,href:s,tag:l,type:"button"===l?"button":void 0,"data-url":n["data-url"],"data-action-state":n["data-action-state"],name:n.name},t)}}d.propTypes={data:s.default.object,title:s.default.string.isRequired,type:s.default.oneOf(["submit","link"]),url:s.default.string};t.default=d},65732:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=s(n(67294)),r=s(n(45697)),i=s(n(93967));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){let{className:t,extraClass:n,id:r,data:{headingLevel:s,title:o}}=e;const l=`h${s||3}`;return a.default.createElement("div",{className:"field"},a.default.createElement(l,{className:(0,i.default)(t,n),id:r},o))}o.propTypes={className:r.default.string,extraClass:r.default.string,id:r.default.string,data:r.default.oneOfType([r.default.array,r.default.shape({headingLevel:r.default.number,title:r.default.string})]).isRequired},o.defaultProps={className:"",extraClass:""};t.default=o},19423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=n(53556),i=o(n(93967)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends a.Component{getInputProps(){return{className:(0,i.default)(this.props.className,this.props.extraClass),id:this.props.id,name:this.props.name,type:"hidden",value:this.props.value||""}}render(){return a.default.createElement(r.Input,this.getInputProps())}}d.propTypes={id:s.default.string,extraClass:s.default.string,name:s.default.string.isRequired,value:s.default.any},d.defaultProps={className:"",extraClass:"",value:""};t.default=d},1922:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=o(n(67294)),r=o(n(69227)),i=n(74898),s=o(n(98028));function o(e){return e&&e.__esModule?e:{default:e}}n(51726);class l extends i.Component{constructor(e){super(e),this.state={isReady:!e.data.editorjs},this.inputRef=null,this.handleReady=this.handleReady.bind(this)}getInputProps(){return{...super.getInputProps(),...this.props.data.attributes,innerRef:e=>{this.inputRef=e}}}getEditorElement(){return document.getElementById(this.getInputProps().id)}getEditor(){return window.TinyMCE&&window.TinyMCE.get(this.getInputProps().id)}handleReady(){!window.TinyMCE&&window.tinymce&&(window.TinyMCE=window.tinymce),this.setState({isReady:!0})}registerChangeListener(){const e=this.getEditorElement();this.getEditor().on("change keyup setcontent",(()=>{super.handleChange({target:e})}))}renderDependencyScript(){return window.tinymce||window.TinyMCE?(setTimeout((()=>{this.handleReady()}),0),null):a.default.createElement(r.default,{url:this.props.data.editorjs,onLoad:this.handleReady})}render(){return this.state.isReady?super.render():this.renderDependencyScript()}componentDidUpdate(e,t){const{isReady:n}=this.state;if(!n)return;n!==t.isReady&&setTimeout((()=>{const{document:e,jQuery:t}=window,n=t?t.Event("EntwineElementsAdded"):new Event("noop"),a=this.getEditorElement();n.targets=[a],t&&t(e).triggerHandler(n),this.registerChangeListener()}),1);const{value:a}=this.props;if(a!==e.value){const e=new Event("change",{bubbles:!0});e.simulated=!0,e.value=a,this.inputRef.dispatchEvent(e)}}componentWillUnmount(){if(!this.state.isReady)return;const{document:e,jQuery:t}=window,n=t?t.Event("EntwineElementsRemoved"):new Event("noop"),a=this.getEditorElement(),r=this.getEditor();r&&r.save(),n.targets=[a],super.handleChange({target:a}),t&&t(e).triggerHandler(n)}}t.Component=l;t.default=(0,s.default)(l)},26055:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=o(n(98028)),i=n(53556),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{id:t,className:n,title:r,extraClass:i,data:s}=e;const o=s&&s.target,l=`${n} ${i}`;return a.default.createElement("label",{id:t,className:l,htmlFor:o},r)};s.propTypes={id:r.default.number,className:r.default.string,extraClass:r.default.string,title:r.default.node,data:r.default.shape({target:r.default.string})},s.defaultProps={className:"",extraClass:""};t.default=s},5257:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=s(n(67294)),r=s(n(45697)),i=n(79655);function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.default.createElement("div",{className:"list-group"},e.items.map((e=>a.default.createElement(i.default,e))));o.propTypes={items:r.default.array};t.default=o},12906:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(a,i,o):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),i=(a=n(45697))&&a.__esModule?a:{default:a};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}class o extends r.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){this.props.onClick&&this.props.onClick(e,this.props.onClickArg)}render(){const e=`list-group-item ${this.props.className}`;return r.default.createElement("a",{role:"button",tabIndex:0,className:e,onClick:this.handleClick},this.props.children)}}o.propTypes={onClickArg:i.default.any,onClick:i.default.func};t.default=o},6734:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=m(n(23157)),i=m(n(66244)),s=m(n(92332)),o=m(n(39301)),l=m(n(25114)),d=m(n(4754)),u=m(n(94301)),c=m(n(98028)),f=m(n(8575)),p=m(n(69496)),h=m(n(45697));function m(e){return e&&e.__esModule?e:{default:e}}function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;te.json())).then((e=>e.items.map((e=>({[n]:e.Title,[a]:e.Value,Selected:e.Selected})))))}isValidNewOption(e,t,n){const{valueKey:a}=this.props;if(!e)return!1;if(Array.isArray(t)){if(this.valueInOptions(e,t,a))return!1}else if(e===t[a])return!1;return!this.valueInOptions(e,n,a)}valueInOptions(e,t,n){for(const a of t)if(e===a[n])return!0;return!1}render(){const{lazyLoad:e,options:t,creatable:n,multi:r,disabled:i,labelKey:s,valueKey:o,SelectComponent:u,AsyncCreatableSelectComponent:c,AsyncSelectComponent:f,CreatableSelectComponent:p,...h}=this.props,m=e?{loadOptions:this.getOptions}:{options:t};let g=u;if(e&&n?g=c:e?g=f:n&&(g=p),this.isControlled()||(h.value=this.state.value),!r&&h.value&&Object.keys(h.value).length>0){const e=h.value[Object.keys(h.value)[0]];"object"==typeof e&&(h.value=e)}return a.default.createElement(l.default,null,a.default.createElement(g,v({},h,{isMulti:r,isDisabled:i,cacheOptions:!0,onChange:this.handleChange,onBlur:this.handleOnBlur},m,{getOptionLabel:e=>e[s],getOptionValue:e=>e[o],noOptionsMessage:e=>{let{inputValue:t}=e;return t?d.default._t("ListboxField.NO_OPTIONS","No options"):d.default._t("ListboxField.TYPE_TO_SEARCH","Type to search")},isValidNewOption:this.isValidNewOption,getNewOptionData:(e,t)=>({[s]:t,[o]:e}),classNamePrefix:"ss-listbox-field"})))}}t.Component=_,_.propTypes={name:h.default.string.isRequired,labelKey:h.default.string.isRequired,valueKey:h.default.string.isRequired,lazyLoad:h.default.bool,creatable:h.default.bool,multi:h.default.bool,disabled:h.default.bool,options:h.default.arrayOf(h.default.object),optionUrl:h.default.string,value:h.default.any,onChange:h.default.func,onBlur:h.default.func,SelectComponent:h.default.oneOfType([h.default.object,h.default.func]),AsyncCreatableSelectComponent:h.default.oneOfType([h.default.object,h.default.func]),AsyncSelectComponent:h.default.oneOfType([h.default.object,h.default.func]),CreatableSelectComponent:h.default.oneOfType([h.default.object,h.default.func])},_.defaultProps={labelKey:"Title",valueKey:"Value",disabled:!1,lazyLoad:!1,creatable:!1,multi:!1,SelectComponent:r.default,AsyncCreatableSelectComponent:s.default,AsyncSelectComponent:i.default,CreatableSelectComponent:o.default};t.default=(0,c.default)(_)},7162:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(a,i,o):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),i=(a=n(45697))&&a.__esModule?a:{default:a};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;tt.value===e));return t?t.title:""}return e&&e.length?e.map((e=>{const t=this.props.source.find((t=>t.value===e));return t&&t.title})).filter((e=>`${e}`.length)).join(", "):""}getFieldProps(){return{id:this.props.id,name:this.props.name,className:`${this.props.className} ${this.props.extraClass}`}}render(){if(!this.props.source)return null;const e=`('${s.default._t("Admin.NONE","None")}')`,t=this.getValueCSV()||e;return a.default.createElement(r.Input,u({plaintext:!0},this.getFieldProps(),{tag:"p"}),t)}}t.Component=c,c.propTypes={extraClass:o.default.string,id:o.default.string,name:o.default.string.isRequired,source:o.default.arrayOf(o.default.shape({value:o.default.oneOfType([o.default.string,o.default.number]),title:o.default.any,disabled:o.default.bool})),value:o.default.any},c.defaultProps={extraClass:"",className:"",value:[]};t.default=(0,i.default)(c)},86827:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=s(n(93967)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}class l extends a.Component{constructor(){super(),this.handleClick=this.handleClick.bind(this)}handleClick(e){e.preventDefault(),"function"==typeof this.props.onClick&&this.props.onClick(e)}render(){const e=(0,r.default)({"cms-mobile-menu-toggle":!0,"cms-mobile-menu-toggle--open":this.props.isOpen});return a.default.createElement("button",{type:"button",className:e,href:"#toggle-mobile-menu",onClick:this.handleClick,"aria-controls":this.props.controls,"aria-expanded":Boolean(this.props.isOpen)},a.default.createElement("span",null),a.default.createElement("span",null),a.default.createElement("span",null),a.default.createElement("span",null))}}l.propTypes={isOpen:i.default.bool.isRequired,onClick:i.default.func.isRequired,controls:i.default.string},l.defaultProps={controls:""};t.default=l},26195:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=n(11521),i=n(86706),s=(a=n(86827))&&a.__esModule?a:{default:a};t.default=(0,i.connect)((e=>({isOpen:e.mobileMenu.isOpen})),(e=>({onClick(){e((0,r.toggleMobileMenu)())}})))(s.default)},97399:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n(67294)),r=n(53556),i=o(n(4754)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}const l=e=>{let{children:t,className:n,isOpen:r,modalClassName:s,ModalComponent:o,ModalHeaderComponent:l,onClosed:d,showCloseButton:u,size:c,title:f}=e;return a.default.createElement(o,{isOpen:r,toggle:d,className:n,modalClassName:s,size:c},!1!==f&&a.default.createElement(l,{toggle:d,title:f},function(e){if("object"==typeof e)return(new DOMParser).parseFromString(e.html,"text/html").body.textContent||"";return e}(f)),!1===f&&!0===u&&"function"==typeof d&&a.default.createElement("button",{type:"button",className:"close modal__close-button",onClick:d,"aria-label":i.default._t("Admin.CLOSE","Close")}),t)};l.propTypes={className:s.default.string,isOpen:s.default.bool,modalClassName:s.default.string,ModalComponent:s.default.oneOfType([s.default.object,s.default.func]),ModalHeaderComponent:s.default.oneOfType([s.default.object,s.default.func]),onClosed:s.default.func,size:s.default.oneOf(["","sm","lg","xl"]),showCloseButton:s.default.bool,title:s.default.oneOfType([s.default.string,s.default.bool,s.default.shape({html:s.default.string})])},l.defaultProps={isOpen:!1,ModalComponent:r.Modal,ModalHeaderComponent:r.ModalHeader,title:null};t.default=l},3730:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a,r=n(67294),i=(a=n(45697))&&a.__esModule?a:{default:a},s=n(79655);function o(e){let{shouldBlockFn:t,blockMessage:n}=e;const a=(0,s.useBlocker)(t);return(0,r.useEffect)((()=>{if("blocked"===a.state){confirm(n)?a.proceed():a.reset()}}),[a.state]),null}o.propTypes={shouldBlockFn:i.default.func.isRequired,blockMessage:i.default.string.isRequired}},55742:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l(n(67294)),r=l(n(4754)),i=l(n(93967)),s=l(n(23296)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=e=>{let{itemName:t,name:n,value:o}=e;return a.default.createElement("div",{className:(0,i.default)(t,"not-found-component")},a.default.createElement(s.default,{value:r.default.inject(r.default._t("Admin.NOT_FOUND_COMPONENT","The component here ({component}) failed to load, there is a chance that you may lose data when saving due to this."),{component:t})}),n&&"string"==typeof o?a.default.createElement("input",{type:"hidden",name:n,value:o}):null)};d.propTypes={itemName:o.default.string.isRequired,name:o.default.string,value:o.default.any};t.default=d},92227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=i(n(98028)),r=i(n(16725));function i(e){return e&&e.__esModule?e:{default:e}}class s extends r.default{getInputProps(){const e=super.getInputProps();return Object.assign(e,{type:"number"}),e}}t.Component=s;t.default=(0,a.default)(s)},31885:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=n(53556),i=l(n(93967)),s=l(n(10259)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}class u extends a.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}getInputProps(){const e=(0,i.default)({[this.props.className]:!0,[this.props.extraClass]:!0,"form-check":!0,checked:this.props.value,disabled:this.props.readOnly,"option-field--disabled":this.props.readOnly||this.props.disabled});return{id:this.props.id,type:this.props.type,name:this.props.name,disabled:this.props.disabled||this.props.readOnly,readOnly:this.props.readOnly,className:e,onChange:this.handleChange,checked:!!this.props.value,value:1}}handleChange(e){if(this.props.readOnly||this.props.disabled)return void e.preventDefault();let t=null;"function"==typeof this.props.onChange?t=this.props.onChange:"function"==typeof this.props.onClick&&(t=this.props.onClick),t&&t(e,{id:this.props.id,value:e.target.checked?1:0})}render(){const e=null!==this.props.leftTitle?this.props.leftTitle:this.props.title,t=null!==this.props.rightTitle?`${e} ${this.props.rightTitle}`:e;return a.default.createElement(r.FormGroup,{check:!0},a.default.createElement(r.Label,{check:!0},a.default.createElement(r.Input,this.getInputProps()),(0,s.default)("span",t)))}}t.Component=u,u.propTypes={type:o.default.oneOf(["checkbox","radio"]),leftTitle:o.default.any,rightTitle:o.default.any,title:o.default.any,extraClass:o.default.string,id:o.default.string,name:o.default.string,onChange:o.default.func,value:o.default.oneOfType([o.default.string,o.default.number,o.default.bool]),readOnly:o.default.bool,disabled:o.default.bool},u.defaultProps={extraClass:"",className:"",type:"radio",leftTitle:null,rightTitle:null};t.default=u},5110:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=o(n(31885)),i=o(n(98028)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.getItemKey(e,n)===t.id));this.props.onChange(e,{id:this.props.id,value:n.value})}}render(){return this.props.source?a.default.createElement("div",null,this.props.source.map(((e,t)=>a.default.createElement(r.default,d({},this.getOptionProps(e,t),{hideLabels:!0}))))):null}}t.Component=u,u.propTypes={extraClass:s.default.string,itemClass:s.default.string,id:s.default.string,name:s.default.string.isRequired,source:s.default.arrayOf(s.default.shape({value:s.default.oneOfType([s.default.string,s.default.number]),title:s.default.oneOfType([s.default.string,s.default.number]),disabled:s.default.bool})),onChange:s.default.func,value:s.default.oneOfType([s.default.string,s.default.number]),readOnly:s.default.bool,disabled:s.default.bool},u.defaultProps={extraClass:"",className:"",itemClass:""};t.default=(0,i.default)(u)},20693:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=n(53556),i=o(n(93967)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}class d extends a.Component{constructor(e){super(e),this.toggle=this.toggle.bind(this),this.state={isOpen:!1}}getPlacement(){return this.props.data.placement||"bottom"}getContainer(){return this.props.container?this.props.container:this.wrapper}toggle(){const{toggleCallback:e}=this.props;window.setTimeout((()=>this.setState({isOpen:!this.state.isOpen},e)),0)}render(){const e=this.getPlacement(),t=(0,i.default)({btn:!0,"btn-secondary":!0,[this.props.className]:!0,[this.props.buttonClassName]:!0,"btn--no-focus":this.state.isOpen,"font-icon-dot-3 btn--no-text":!this.props.title,[`btn--icon-${this.props.buttonSize}`]:!this.props.title}),n={id:this.props.id,type:"button",className:t,onClick:this.toggle,title:this.props.data.buttonTooltip},s=(0,i.default)({[this.props.className]:!0,"popover-container":!0,"popover-field":!0});return a.default.createElement("div",{className:s,ref:e=>{this.wrapper=e}},a.default.createElement(r.Button,n,this.props.title),a.default.createElement(r.Popover,{id:`${this.props.id}_Popover`,placement:e,isOpen:this.state.isOpen,target:this.props.id,toggle:this.toggle,className:this.props.popoverClassName,container:this.getContainer()},a.default.createElement(r.PopoverHeader,null,this.props.data.popoverTitle),a.default.createElement(r.PopoverBody,null,this.props.children)))}}d.propTypes={id:s.default.string.isRequired,title:s.default.any,container:s.default.any,className:s.default.string,buttonClassName:s.default.string,popoverClassName:s.default.string,buttonSize:s.default.oneOf(["sm","md","large","xl"]),data:s.default.oneOfType([s.default.array,s.default.shape({popoverTitle:s.default.string,buttonTooltip:s.default.string,placement:s.default.oneOf(["top","bottom","left","right"])})]),toggleCallback:s.default.func},d.defaultProps={data:{},className:"",buttonClassName:"",popoverClassName:"",buttonSize:"xl",toggleCallback:()=>{}};t.default=d},71255:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=l(n(45697)),i=n(53556),s=l(n(93967)),o=l(n(4754));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.default.createElement(l,u({},e.buttonProps,{className:(0,s.default)(e.className,i),key:e.key,onClick:e.onClick}),e.content))))}render(){const{container:e,className:t,isOpen:n,placement:r,target:i,PopoverComponent:o}=this.props;return a.default.createElement(o,{className:(0,s.default)(t),container:e,hideArrow:!0,isOpen:n,onKeyDown:this.handleKeyDown,placement:r,target:i,toggle:this.handleToggle,trigger:"legacy"},this.renderSearchBox(),this.renderOptionButtons())}}c.propTypes={buttons:r.default.arrayOf(r.default.shape({key:r.default.string.isRequired,content:r.default.node.isRequired,onClick:r.default.func.isRequired,className:r.default.oneOfType([r.default.string,r.default.object,r.default.arrayOf(r.default.string)]),buttonProps:r.default.object})).isRequired,onSearch:r.default.func,container:r.default.oneOfType([r.default.string,r.default.elementType]),isOpen:r.default.bool.isRequired,placement:r.default.string,target:r.default.oneOfType([r.default.string,r.default.elementType]).isRequired,toggle:r.default.func.isRequired,searchPlaceholder:r.default.string,disableSearch:r.default.bool,ButtonComponent:r.default.oneOfType([r.default.object,r.default.func]),PopoverComponent:r.default.oneOfType([r.default.object,r.default.func]),className:r.default.oneOfType([r.default.string,r.default.array,r.default.object]),searchClassName:r.default.oneOfType([r.default.string,r.default.array,r.default.object]),searchInputClassName:r.default.oneOfType([r.default.string,r.default.array,r.default.object]),clearButtonClassName:r.default.oneOfType([r.default.string,r.default.array,r.default.object]),buttonContainerClassName:r.default.oneOfType([r.default.string,r.default.array,r.default.object]),emptyResultClassName:r.default.oneOfType([r.default.string,r.default.array,r.default.object]),buttonClassName:r.default.oneOfType([r.default.string,r.default.array,r.default.object])},c.defaultProps={searchPlaceholder:o.default._t("PopoverOptionSet.SEARCH_PLACEHOLDER","Search"),onSearch:(e,t)=>t.filter((t=>{let{content:n}=t;return n.toLowerCase().includes(e.toLowerCase())})),disableSearch:!1,ButtonComponent:i.Button,PopoverComponent:i.Popover,className:"popover-option-set",searchClassName:"popover-option-set__search",searchInputClassName:"popover-option-set__search-input",clearButtonClassName:"popover-option-set__search-clear btn btn-link",buttonContainerClassName:"popover-option-set__button-container",emptyResultClassName:"popover-option-set__no-results",buttonClassName:"popover-option-set__button"};t.default=c},3080:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=d(n(4754)),i=d(n(93967)),s=n(54582),o=d(n(45697)),l=d(n(95393));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class c extends a.Component{constructor(e){super(e),this.state={frameLoaded:!1},this.handleBackClick=this.handleBackClick.bind(this),this.setFrameLoaded=this.setFrameLoaded.bind(this)}componentDidUpdate(e){this.state.frameLoaded&&e.previewUrl!==this.props.previewUrl&&this.setFrameLoaded(!1)}setFrameLoaded(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState({frameLoaded:e})}handleBackClick(e){"function"==typeof this.props.onBack&&(e.preventDefault(),this.props.onBack(e))}buildToolbarButtons(){const e=[];if(this.props.itemLinks&&this.props.itemLinks.edit){const t=this.props.itemLinks.edit.href;e.push(a.default.createElement("a",{key:"edit",href:t,className:"btn btn-outline-secondary font-icon-edit"},a.default.createElement("span",{className:"btn__title"},r.default._t("Admin.EDIT","Edit"))))}return e}renderMoreActions(){return this.props.moreActions&&0!==this.props.moreActions.length?a.default.createElement(l.default,null,this.props.moreActions):null}renderBody(){let e=null,t="";return this.props.itemLinks&&this.props.itemLinks.preview&&(this.props.itemLinks.preview.Stage?(e=this.props.itemLinks.preview.Stage.href,t=this.props.itemLinks.preview.Stage.type):this.props.itemLinks.preview.Live&&(e=this.props.itemLinks.preview.Live.href,t=this.props.itemLinks.preview.Live.type)),this.props.itemId?e?t&&0===t.indexOf("image/")?a.default.createElement("div",{className:"preview__file-container panel--scrollable"},a.default.createElement("img",{alt:e,className:"preview__file--fits-space",src:e})):a.default.createElement("iframe",{style:{visibility:this.state.frameLoaded?"visible":"hidden"},className:"flexbox-area-grow preview__iframe",src:e,onLoad:this.setFrameLoaded}):a.default.createElement("div",{className:"preview__overlay"},a.default.createElement("h3",{className:"preview__overlay-text"},r.default._t("Admin.NO_ITEM_PREVIEW","There is no preview available for this item."))):a.default.createElement("div",{className:"preview__overlay"},a.default.createElement("h3",{className:"preview__overlay-text"},r.default._t("Admin.NO_PREVIEW","No preview available.")))}render(){const{className:e,ViewModeComponent:t}=this.props,n=(0,i.default)("preview",e);return a.default.createElement("div",{className:n},this.renderBody(),a.default.createElement("div",{className:"toolbar toolbar--south"},a.default.createElement("div",{className:"btn-toolbar"},this.buildToolbarButtons(),a.default.createElement(t,{id:"view-mode-toggle-in-preview-nb",area:"preview"}),this.renderMoreActions())))}}t.Component=c,c.propTypes={className:o.default.string,itemLinks:o.default.object,itemId:o.default.number,onBack:o.default.func,moreActions:o.default.arrayOf(o.default.element),ViewModeComponent:o.default.elementType},c.defaultProps={className:"flexbox-area-grow fill-height"};t.default=(0,s.inject)(["ViewModeToggle"],(e=>({ViewModeComponent:e})),(()=>"Admin.Preview"))(c)},72543:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(67294),r=s(n(91033)),i=s(n(45697));function s(e){return e&&e.__esModule?e:{default:e}}class o extends a.Component{constructor(e){super(e),this.render=this.render.bind(this),this.handleResize=this.handleResize.bind(this),this.state={},this.observer=new r.default((e=>e.forEach((e=>{let{contentRect:t}=e;return this.handleResize(t)}))))}componentDidMount(){this.observer.observe(this.container);const e={width:this.container.offsetWidth,height:this.container.offsetHeight};this.handleResize(e)}componentWillUnmount(){this.observer.disconnect()}handleResize(e){const{width:t,height:n}=this.state;t===e.width&&n===e.height||this.setState(e),this.props.onResize&&this.props.onResize(e)}render(){const{children:e,onlyEvent:t,component:n,onResize:r,widthPropName:i,heightPropName:s,...o}=this.props,{width:l,height:d}=this.state,u="string"!=typeof n,c={[[i||"width"]]:l,[[s||"height"]]:d};return(0,a.createElement)(n,{[u?"getRef":"ref"]:e=>{this.container=e},...u&&c,...o},"function"==typeof e?e({width:l,height:d}):a.Children.map(e,(e=>(0,a.isValidElement)(e)?(0,a.cloneElement)(e,t?null:c):e)))}}o.propTypes={component:i.default.oneOfType([i.default.string,i.default.elementType]),onResize:i.default.func},o.defaultProps={component:"div"};t.default=o},62266:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0,t.hasFilters=E;var a=y(n(4754)),r=b(n(67294)),i=n(86706),s=n(14890),o=b(n(39042)),l=n(11962),d=n(56403),u=y(n(79298)),c=y(n(87393)),f=y(n(45697)),p=y(n(90161)),h=y(n(31824)),m=y(n(97019)),g=y(n(65693)),v=y(n(18992));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function y(e){return e&&e.__esModule?e:{default:e}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t0}class T extends r.Component{constructor(e){super(e),this.expand=this.expand.bind(this),this.handleChange=this.handleChange.bind(this),this.getData=this.getData.bind(this),this.doSearch=this.doSearch.bind(this),this.focusInput=this.focusInput.bind(this),this.focusFirstFormField=this.focusFirstFormField.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.toggle=this.toggle.bind(this),this.open=this.open.bind(this),this.searchTermIsDirty=this.searchTermIsDirty.bind(this),this.clearFilters=this.clearFilters.bind(this),this.clearSearchBox=this.clearSearchBox.bind(this),this.clearFormFilter=this.clearFormFilter.bind(this),this.focusFormFilter=this.focusFormFilter.bind(this),this.formatTagData=this.formatTagData.bind(this);const t=e.term||e.filters&&e.filters[`${e.filterPrefix}${e.name}`]||"";this.state={display:e.display,searchText:t,initialSearchText:t}}componentDidMount(){this.setOverrides(this.props)}componentWillUnmount(){this.setOverrides()}setOverrides(e){if(e&&(!E(e.filters)||this.props.formSchemaUrl!==e.formSchemaUrl)){const t=e&&e.formSchemaUrl||this.props.formSchemaUrl;t&&this.props.actions.schema.setSchemaStateOverrides(t,null)}if(e&&E(e.filters)&&e.formSchemaUrl){const t=e.filters||{},n={fields:Object.keys(t).map((e=>({name:e,value:t[e]})))};this.props.actions.schema.setSchemaStateOverrides(e.formSchemaUrl,n)}}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{name:t,filterPrefix:n,formData:a}=this.props,{searchText:r}=this.state,i={};return Object.keys(a).forEach((e=>{const t=a[e];t&&(i[e]=t)})),!e&&r&&void 0===a[`${n}${t}`]&&(i[`${n}${t}`]=r.trim()),i}handleChange(e){const t=e.target.value;this.state.searchText!==t&&this.setState({searchText:t});const{schemaName:n,name:a,filterPrefix:r,actions:i,formData:s}=this.props;void 0!==s[`${r}${a}`]&&i.reduxForm.change(n,`${r}${a}`,t)}focusInput(){if(this.state.display===O.NONE)return;const e=this.nodeRef.container;if(!e)return;const t=e.querySelector(".search-box__content-field");t!==document.activeElement&&(t.focus(),t.select&&t.select())}focusFirstFormField(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"input:not([type=hidden]), textarea, select, button";if(this.state.display!==O.EXPANDED)return;const t=this.nodeRef.container;if(!t)return;const n=t.querySelector(".search-form");if(!n)return;const a=n.querySelector(e);a&&(a.focus(),a.select&&a.select())}clearFormData(e){""!==this.state.searchText&&this.setState({searchText:""});const t=e&&e.formSchemaUrl||this.props.formSchemaUrl;if(t){const n=e&&e.identifier||this.props.identifier;this.props.actions.schema.setSchemaStateOverrides(t,{fields:[]}),this.props.actions.reduxForm.reset(n)}}clearFormFilter(e){const t=this.props.tagData[e],n={[e]:void 0},{schemaName:a,filters:r}=this.props;this.props.actions.reduxForm.change(a,e,""),this.setOverrides({...this.props,filters:{...r,[e]:void 0}}),Array.isArray(t.linkedFields)&&t.linkedFields.forEach((e=>{n[e]=void 0})),this.doSearch(n)}focusFormFilter(e){const t=this.props.tagData[e].focusSelector||`[name=${e}]`;this.expand(),setTimeout((()=>this.focusFirstFormField(t)),50)}open(){this.show(),this.focusInput()}hide(){this.clearSearchBox(),this.props.onHide?this.props.onHide():this.state.display!==O.NONE&&this.setState({display:O.NONE})}show(){this.state.display!==O.VISIBLE&&this.setState({display:O.VISIBLE});const{schemaName:e,formData:t,name:n,actions:a}=this.props;void 0!==t[n]&&a.reduxForm.change(e,n,this.state.searchText)}expand(){this.state.display!==O.EXPANDED&&this.setState({display:O.EXPANDED})}toggle(){switch(this.state.display){case O.VISIBLE:this.expand(),setTimeout(this.focusFirstFormField,50);break;case O.EXPANDED:this.show()}}searchTermIsDirty(){const{searchText:e,initialSearchText:t}=this.state;return e.trim()!==t.trim()}doSearch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{name:t,filterPrefix:n}=this.props,a={},r=this.getData();Object.entries(r).forEach((i=>{let[s,o]=i,l=s,d=o;e.hasOwnProperty(s)&&(d=e[s]),n.length>0&&s.startsWith(n)&&(l=s.substring(n.length)),(!n.length>0||s!==t||void 0===r[`${n}${t}`])&&(a[l]=d)}));const i=a[t]||"";this.state.display===O.VISIBLE&&this.state.initialSearchText===i&&this.state.searchText===i||this.setState({display:O.VISIBLE,initialSearchText:i,searchText:i}),this.props.onSearch(a)}clearFilters(){this.clearFormData(),this.focusFirstFormField()}clearSearchBox(){this.clearFormData(),this.focusInput()}formatTagData(){const{tagData:e,name:t,filterPrefix:n}=this.props,a=Object.assign({},e),r=`${n}${t}`;return a&&a[r]&&delete a[r],a?Object.values(a).map((e=>{let{key:t,label:n,value:a}=e;return{key:t,label:n,value:a}})):[]}render(){const{formSchemaUrl:e,forceFilters:t,id:n,displayBehavior:a,identifier:i,formIsDirty:s,tagData:o,name:l,...d}=this.props;if(this.state.display===O.NONE)return a===C.TOGGLABLE?r.default.createElement(g.default,{onToggle:this.show}):r.default.createElement("div",null);const u=`${n}_ExtraFields`,c=this.state.searchText,f=this.state.display===O.EXPANDED,v=this.state.display===O.VISIBLE,_=[C.HIDEABLE,C.TOGGLABLE].includes(a),b=s||this.searchTermIsDirty(),y=this.getData(),E=Object.keys(y).length>0;return r.default.createElement(p.default,{onClickOut:this.show,className:"search",ref:e=>{this.nodeRef=e}},r.default.createElement(h.default,w({},d,{name:`SearchBox__${l}`,onChange:this.handleChange,onSearch:this.doSearch,onToggleFilter:this.toggle,onHideFilter:this.show,onHide:this.hide,onClear:this.clearSearchBox,searchText:c,hideable:_,expanded:f,id:`${n}_searchbox`,showFilters:Boolean(t||e),dirty:b,clearable:E,onTagDelete:this.clearFormFilter,onTagClick:this.focusFormFilter,tagData:this.formatTagData()}),r.default.createElement(m.default,{id:u,identifier:i,visible:v,expanded:f,formSchemaUrl:e,onSearch:this.doSearch,onClear:this.clearFilters,clearable:E})))}}t.Component=T,T.propTypes={onSearch:f.default.func,onHide:f.default.func,id:f.default.string.isRequired,display:f.default.oneOf(Object.values(O)),formSchemaUrl:f.default.string,filters:f.default.object,formData:f.default.object,placeholder:f.default.string,displayBehavior:f.default.oneOf(Object.values(C)),term:f.default.string,name:f.default.string,filterPrefix:f.default.string,forceFilters:f.default.bool,formIsDirty:f.default.bool,identifier:f.default.string,schemaName:f.default.string,tagHandlers:f.default.object,borders:f.default.shape({top:f.default.bool,right:f.default.bool,bottom:f.default.bool,left:f.default.bool})},T.defaultProps={placeholder:a.default._t("Admin.SEARCH","Search"),display:O.VISIBLE,displayBehavior:C.NONE,filters:{},formData:{},term:"",filterPrefix:"",forceFilters:!1,name:"searchTerm",identifier:"Admin.SearchForm"};t.default=(0,i.connect)((function(e,t){const n=e.form.formSchemas[t.formSchemaUrl];if(!n||!n.name)return{formData:{}};const a=n.name,r=(0,u.default)((0,c.default)(e),a),i=r&&r.values||{},s=(0,v.default)(n,t.filters,t.tagHandlers||{});return{formData:i,formIsDirty:(0,d.isDirty)(a,c.default)(e),schemaName:a,tagData:s}}),(function(e){return{actions:{schema:(0,s.bindActionCreators)(o,e),reduxForm:(0,s.bindActionCreators)({reset:l.reset,initialize:l.initialize,change:l.change},e)}}}))(T)},31824:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=f(n(4754)),r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),i=n(53556),s=f(n(93967)),o=f(n(97228)),l=f(n(72543)),d=f(n(45697)),u=f(n(43117));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function f(e){return e&&e.__esModule?e:{default:e}}class p extends r.Component{constructor(e){super(e),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.renderInput=this.renderInput.bind(this),this.renderFilterButton=this.renderFilterButton.bind(this),this.renderEnterHint=this.renderEnterHint.bind(this),this.renderHideButton=this.renderHideButton.bind(this),this.componentDidUpdate=this.componentDidUpdate.bind(this),this.onResize=this.onResize.bind(this),this.setWidth=this.setWidth.bind(this),this.renderTags=this.renderTags.bind(this),this.getComponentWidth=this.getComponentWidth.bind(this),this.calculateSpaceForTags=this.calculateSpaceForTags.bind(this),this.calculateInputLeftPadding=this.calculateInputLeftPadding.bind(this),this.calculateInputRightPadding=this.calculateInputRightPadding.bind(this),this.onTagListResize=this.onTagListResize.bind(this),this.focusOnLastTag=this.focusOnLastTag.bind(this),this.focusOnInput=this.focusOnInput.bind(this),this.state={hasFocus:!1,width:window.innerWidth-180-55,tagWidth:0}}componentDidUpdate(){const e=this.getComponentWidth();this.setWidth(e)}onResize(e){this.setWidth(e.width)}onTagListResize(e){const t=e.width;this.state.tagWidth!==t&&this.setState({tagWidth:t})}setWidth(e){this.state.width!==e&&this.setState({width:e})}getComponentWidth(){const e=this.nodeRef;return e?e.getBoundingClientRect().width:0}calculateInputLeftPadding(){const e=this.state.width>576?55:20;return this.state.tagWidth+e}calculateInputRightPadding(){return this.state.width<576?121:264}calculateSpaceForTags(){let e=this.state.width;e-=150,e=e-55-52;const{hideable:t,showFilters:n}=this.props;return t&&(e-=52),n&&(e-=52),e=Math.max(e,0),e}handleKeyDown(e){"Enter"===e.key?(e.preventDefault(),this.props.onSearch()):0===e.target.selectionStart&&("ArrowLeft"===e.key||"Backspace"===e.key&&e.target.selectionEnd-e.target.selectionStart==0)&&(e.preventDefault(),this.focusOnLastTag())}handleFocus(){this.state.hasFocus||this.setState({hasFocus:!0}),this.props.onHideFilter&&this.props.onHideFilter()}handleBlur(){this.state.hasFocus&&this.setState({hasFocus:!1})}focusOnLastTag(){const e=this.nodeRef;if(!e)return;const t=e.querySelector(".compact-tag-list__visible .tag:last-child");t&&t.focus()}focusOnInput(){const e=this.nodeRef;if(!e)return;const t=e.querySelector("input");t&&t.focus()}renderInput(){const{id:e,searchText:t,onChange:n,placeholder:a,name:i,borders:o}=this.props,l={paddingLeft:`${this.calculateInputLeftPadding()}px`,paddingRight:`${this.calculateInputRightPadding()}px`},d=Object.assign({},p.defaultProps.borders,o),u="search-box__content-field",c=(0,s.default)("form-control",u,{[`${u}--top-border`]:d.top,[`${u}--right-border`]:d.right,[`${u}--bottom-border`]:d.bottom,[`${u}--left-border`]:d.left});return r.default.createElement("input",{"aria-labelledby":`${e}_label`,type:"search",name:i,placeholder:a,className:c,onKeyDown:this.handleKeyDown,onChange:n,onFocus:this.handleFocus,onBlur:this.handleBlur,value:t,id:e,autoFocus:!0,style:l})}renderTags(){const{tagData:e,onTagDelete:t,onTagClick:n,onToggleFilter:a}=this.props;return r.default.createElement("div",{className:"search-box__tags"},r.default.createElement(l.default,{onResize:this.onTagListResize},r.default.createElement(o.default,{onTagDelete:t,onTagClick:n,onHolderFocus:this.focusOnInput,tags:e,onSummary:a,maxSize:this.calculateSpaceForTags(),deletable:!0})))}renderEnterHint(){return r.default.createElement("div",{role:"presentation",className:"search-box__enter",onClick:e=>{e.stopPropagation(),e.preventDefault(),this.props.onSearch()}},a.default._t("Admin.ENTER","Enter")," ↵")}renderFilterButton(){const{expanded:e,onToggleFilter:t,formId:n}=this.props,o=(0,s.default)("btn--icon","font-icon-caret-down-two","search-box__filter-trigger",this.state.width<576?"search-box--no-label":"",{collapsed:!e}),l=this.state.width<576?"sr-only":"";return r.default.createElement(i.Button,{"aria-expanded":e,"aria-controls":n,"aria-label":a.default._t("Admin.ADVANCED","Advanced"),onClick:t,className:o,title:a.default._t("Admin.ADVANCED","Advanced")},r.default.createElement("span",{className:l},a.default._t("Admin.SEARCH_OPTIONS","Search options")))}renderHideButton(){const{id:e,onHide:t}=this.props;return r.default.createElement(i.Button,{onClick:t,title:a.default._t("Admin.CLOSE","Close"),"aria-label":a.default._t("Admin.CLOSE","Close"),className:"font-icon-cancel btn--no-text btn--icon-lg search-box__cancel","aria-controls":e,"aria-expanded":"true"})}render(){const{children:e,id:t,hideable:n,expanded:o,showFilters:d,dirty:u,clearable:c}=this.props,f=(0,s.default)("search-box",{"search-box--hideable":n,"search-box--not-hideable":!n,"search-box--has-focus":this.state.hasFocus,"search-box--has-not-focus":!this.state.hasFocus,"search-box--has-filters":d,"search-box--has-not-filters":!d,"search-box--compact":this.state.width<576,"search-box--expanded":o}),p=(u||!c)&&this.state.hasFocus;return r.default.createElement("div",{className:f,ref:e=>{this.nodeRef=e}},r.default.createElement(l.default,{onResize:this.onResize},r.default.createElement("div",{className:"search-box__group"},r.default.createElement(i.Label,{for:t,id:`${t}_label`,hidden:!0},a.default._t("Admin.SEARCH","Search")),this.renderTags(),this.renderInput(),p&&this.renderEnterHint(),e,r.default.createElement("div",{className:"icon font-icon-search"}),d&&this.renderFilterButton(),n&&this.renderHideButton())))}}t.Component=p,p.propTypes={onSearch:d.default.func,onToggleFilter:d.default.func,onHideFilter:d.default.func,onChange:d.default.func,onHide:d.default.func,onTagDelete:d.default.func,onTagClick:d.default.func,placeholder:d.default.string,expanded:d.default.bool,formId:d.default.string,id:d.default.string,searchText:d.default.string,hideable:d.default.bool,showFilters:d.default.bool,name:d.default.string,dirty:d.default.bool,clearable:d.default.bool,tagData:d.default.arrayOf(u.default)},p.defaultProps={placeholder:a.default._t("Admin.SEARCH","Search"),tagData:[],filters:{},formData:{},term:"",borders:{top:!1,right:!1,bottom:!0,left:!0}};t.default=p},97019:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=c,t.default=void 0;var a=l(n(4754)),r=l(n(67294)),i=l(n(16304)),s=n(53556),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=a.default._t("Admin.SEARCH","Search"),u=a.default._t("Admin.CLEAR","Clear");function c(e){let{visible:t,expanded:n,onSearch:a,onClear:o,formSchemaUrl:l,id:c,identifier:f,clearable:p}=e;const h=(m=a,e=>{"Enter"===e.key&&(e.preventDefault(),m())});var m;const g=t||n;return r.default.createElement(s.Collapse,{id:c,isOpen:n,className:"search-form"},r.default.createElement("div",{className:"search-form__wrapper",onKeyDown:h},g&&l&&r.default.createElement(i.default,{className:"no-change-track",formTag:"div",identifier:f,schemaUrl:l,onSubmit:()=>(a(),Promise.resolve())}),r.default.createElement(s.Button,{className:"search-form__submit",onClick:()=>a(),color:"primary",type:"button"},d),p&&r.default.createElement(s.Button,{className:"search-form__clear",onClick:()=>o()},u)))}c.propTypes={onSearch:o.default.func,onClear:o.default.func,visible:o.default.bool,expanded:o.default.bool,id:o.default.string.isRequired,formSchemaUrl:o.default.string,identifier:o.default.string,clearable:o.default.bool},c.defaultProps={formData:{}};t.default=c},65693:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=l(n(4754)),r=l(n(67294)),i=n(53556),s=l(n(93967)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=a.default._t("Admin.SHOW_SEARCH","Show search"),u=e=>(0,s.default)("btn--no-text","search-toggle","font-icon-search","btn--icon-lg",{"search-toggle__active":e}),c=e=>{let{onToggle:t,toggled:n}=e;return r.default.createElement(i.Button,{title:d,onClick:t,className:u(n)},r.default.createElement("span",{className:"sr-only"},d))};t.Component=c,c.propTypes={onToggle:o.default.func,toggled:o.default.bool};t.default=c},47465:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(58592))&&a.__esModule?a:{default:a};const i=(e,t,n)=>{if(!Array.isArray(t)||0===t.length)return!1;const a=n.state.fields.find((t=>{let{name:n}=t;return n===e}));if(a&&a.source){return t.map((e=>{const t=a.source.find((t=>{let{value:n}=t;return n.toString()===e.toString()}));return t&&t.title?t.title:e})).join(", ")||!1}return!1},s={Date:(0,r.default)("ll"),Time:(0,r.default)("LT"),Datetime:(0,r.default)("lll"),Hidden:()=>!1,SingleSelect:(e,t,n)=>{if(void 0===e.value)return!1;const a=i(e.key,[e.value],n);return!!a&&Object.assign({},e,{value:a})},Boolean:e=>{if(e.value){const{value:t,...n}=e;return n}return!1},MultiSelect:(e,t,n)=>{const a=i(e.key,e.value,n);return!!a&&Object.assign({},e,{value:a})},default:e=>!!e.value&&e};t.default=s},58592:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(30381))&&a.__esModule?a:{default:a};t.default=e=>(t,n)=>{let{lang:a}=n;if(!t.value)return!1;if(t.value&&a){r.default.locale(a);const n=(0,r.default)(t.value);if(n.isValid())return Object.assign({},t,{value:n.format(e)})}return t}},18992:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(47465))&&a.__esModule?a:{default:a};const i=(e,t)=>{let{key:n,value:a,label:r}=t;return`${e}${r.toLowerCase()||n} ${a||""} `};t.default=function(e,t){let n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.metadata.loading)return{};const s=a=>{const r={key:a.name,label:a.title,value:t[a.name]};let i;return i="function"==typeof n[`#${r.key}`]?n[`#${r.key}`]:"function"==typeof n[a.schemaType]?n[a.schemaType]:n.default,i(r,a,e,t)};n=Object.assign({},r.default,{Structural:(e,t)=>{const{children:n}=t;if(!Array.isArray(n)||0===n.length)return!1;const a=n.map(s).filter((e=>!1!==e)).reduce(i,"").trim(),r=n.map((e=>e.name)),o=`[name=${n[0].name}]`;return!!a&&Object.assign({},e,{value:a,linkedFields:r,focusSelector:o})}},a);const o=e.schema.fields.map(s).filter((e=>!1!==e)),l={};return o.forEach((e=>{l[e.key]=e})),l}},84331:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=v(n(66244)),r=v(n(1591)),i=v(n(93967)),s=v(n(94974)),o=v(n(69496)),l=v(n(25114)),d=v(n(4754)),u=v(n(98028)),c=v(n(45697)),f=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),p=v(n(23157)),h=v(n(8575)),m=v(n(430));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function v(e){return e&&e.__esModule?e:{default:e}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{clearable:t,disabled:n,lazyLoad:a,multi:u,passRef:c,placeholder:p,options:g,optionUrl:v,onChange:b,searchable:y,value:w,SelectComponent:O,AsyncSelectComponent:C,...E}=e;const[T,S]=(0,f.useState)(!1),[P,M]=(0,f.useState)(!1),[j,D]=(0,f.useState)({}),R=(0,f.createRef)();(0,f.useEffect)((()=>{if(!P)return;const e=R.current.inputRef,t=new Event("change",{bubbles:!0});e.dispatchEvent(t),M(!1)}));const k=(0,i.default)({"no-change-track":!T,"ss-searchable-dropdown-field--lazy-load":a}),I=a?{loadOptions:e=>a?e?(e=>{if(j.hasOwnProperty(e))return Promise.resolve(j[e]);let t=()=>{const t=h.default.parse(v,!0);t.search&&delete t.search,t.query.term=e;const n=h.default.format(t),a={};return a[m.default.CSRF_HEADER]=s.default.get("SecurityID"),r.default.get(n,a).then((e=>e.json())).then((t=>(j[e]=t,D(j),t)))};return t=(0,o.default)(t,500),t()})(e):Promise.resolve([]):Promise.resolve(g)}:{options:g},A=c?{ref:R}:{};let x=w;if(!u&&x){const e=Object.keys(x);if(e.length>0){const t=x[e[0]];"object"==typeof t&&(x=t)}}const N=`${E.id}__input`,F=a?C:O;return f.default.createElement(l.default,null,f.default.createElement(F,_({},E,{classNamePrefix:"ss-searchable-dropdown-field",className:k,isClearable:t,isDisabled:n,isMulti:u,isSearchable:y,placeholder:p,onChange:e=>{S(!1),JSON.stringify(w)!==JSON.stringify(e)&&(S(!0),M(!0)),b(e)},onBlur:()=>{}},I,{noOptionsMessage:e=>e?d.default._t("Admin.NO_MATCHING_OPTIONS","No matching options"):d.default._t("Admin.TYPE_TO_SEARCH","Type to search")},A,{value:x,inputId:N})))};t.Component=b,b.propTypes={clearable:c.default.bool.isRequired,disabled:c.default.bool.isRequired,lazyLoad:c.default.bool.isRequired,multi:c.default.bool.isRequired,name:c.default.string.isRequired,placeholder:c.default.string.isRequired,onChange:c.default.func,options:c.default.arrayOf(c.default.object),optionUrl:c.default.string,passRef:c.default.bool.isRequired,searchable:c.default.bool.isRequired,value:c.default.any,SelectComponent:c.default.oneOfType([c.default.object,c.default.func]).isRequired,AsyncSelectComponent:c.default.oneOfType([c.default.object,c.default.func]).isRequired},b.defaultProps={disabled:!1,lazyLoad:!1,clearable:!0,searchable:!0,multi:!1,passRef:!0,placeholder:"",onChange:()=>{},value:"",SelectComponent:p.default,AsyncSelectComponent:a.default};t.default=(0,u.default)(b)},63980:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=l(n(98028)),i=l(n(4754)),s=n(53556),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;te.value===this.props.value));return e="string"==typeof e?e:this.props.value||"",a.default.createElement(s.Input,u({plaintext:!0},this.getInputProps(),{tag:"p"}),e)}getSelectField(){const e=this.props.source?this.props.source.slice():[];return this.props.data.hasEmptyDefault&&!e.find((e=>!e.value))&&e.unshift({value:"",title:this.props.data.emptyString,disabled:!1}),a.default.createElement(s.Input,u({type:"select"},this.getInputProps()),e.map(((e,t)=>{const n=`${this.props.name}-${e.value||`empty${t}`}`,r=e.description||null;return a.default.createElement("option",{key:n,value:e.value,disabled:e.disabled,title:r},e.title)})))}getInputProps(){const e={className:`${this.props.className} ${this.props.extraClass} no-chosen`,id:this.props.id,name:this.props.name,disabled:this.props.disabled};return this.props.readOnly||Object.assign(e,{onChange:this.handleChange,value:this.props.value||""}),e}handleChange(e){"function"==typeof this.props.onChange&&this.props.onChange(e,{id:this.props.id,value:e.target.value})}render(){let e=null;return e=this.props.readOnly?this.getReadonlyField():this.getSelectField(),e}}t.Component=c,c.propTypes={id:o.default.string,name:o.default.string.isRequired,onChange:o.default.func,value:o.default.oneOfType([o.default.string,o.default.number]),readOnly:o.default.bool,disabled:o.default.bool,source:o.default.arrayOf(o.default.shape({value:o.default.oneOfType([o.default.string,o.default.number]),title:o.default.oneOfType([o.default.string,o.default.number]),description:o.default.string,disabled:o.default.bool})),data:o.default.oneOfType([o.default.array,o.default.shape({hasEmptyDefault:o.default.bool,emptyString:o.default.oneOfType([o.default.string,o.default.number])})])},c.defaultProps={source:[],extraClass:"",className:"",data:{emptyString:i.default._t("Boolean.ANY","Any")}};t.default=(0,r.default)(c)},10202:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n(67294)),r=n(53556),i=o(n(93967)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(e){let{title:t,disabled:n,active:s,tabClassName:o,onToggle:l}=e;if(!t)return null;const d=(0,i.default)(o,{active:s});return a.default.createElement(r.NavItem,null,a.default.createElement(r.NavLink,{onClick:l,disabled:n,className:d},t))}l.propTypes={title:s.default.string,disabled:s.default.bool,active:s.default.bool,tabClassName:s.default.string,onToggle:s.default.func.isRequired},l.defaultProps={disabled:!1,active:!1};t.default=l},40505:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=u(n(67294)),r=n(53556),i=l(n(45697)),s=u(n(93390)),o=l(n(93967));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function c(e){let{name:t,className:n,extraClass:i,disabled:l,children:d}=e;const{activeTab:u,isOnActiveTab:c}=(0,s.default)(),f=t,p=(0,a.useMemo)((()=>({activeTab:u,currentTab:f,isOnActiveTab:!1!==c&&u===t})),[u,f,c]);return a.default.createElement(s.TabContext.Provider,{value:p},a.default.createElement(r.TabPane,{tabId:t,className:(0,o.default)(n,i),disabled:l},a.default.createElement(r.Fade,{in:c},d)))}c.propTypes={name:i.default.string.isRequired,extraClass:i.default.string,className:i.default.string,disabled:i.default.bool};t.default=c},96870:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n(67294)),r=n(53556),i=o(n(45697)),s=o(n(10202));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{props:n}=e;return a.default.createElement(s.default,l({},n,{onToggle:()=>t!==n.name&&i(n.name),active:t===n.name}))}));return o&&o.length>1?a.default.createElement(r.Nav,{tabs:!0,role:"tablist"},o):null}d.propTypes={currentTab:i.default.string,onToggle:i.default.func.isRequired};t.default=d},61404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=m,t.default=void 0;var a=h(n(67294)),r=n(53556),i=f(n(93967)),s=f(n(45697)),o=n(86706),l=h(n(53104)),d=h(n(93390)),u=f(n(96870)),c=f(n(56204));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function m(e){let{hideNav:t,children:n,activeTab:s,className:o,extraClass:l,id:f,activateTab:p,defaultActiveKey:h}=e;const m={className:(0,i.default)([o,l]),id:f},g=s||(0,c.default)(h,n),v=(0,d.default)(),_=v?v.isOnActiveTab:void 0,b=(0,a.useMemo)((()=>({activeTab:g,isOnActiveTab:_})),[s,_]);return a.default.createElement("div",m,a.default.createElement("div",{className:"wrapper"},!t&&a.default.createElement(u.default,{currentTab:g,onToggle:p},n),a.default.createElement(r.TabContent,{activeTab:g},a.default.createElement(d.TabContext.Provider,{value:b},n))))}m.propTypes={id:s.default.string.isRequired,defaultActiveKey:s.default.string,extraClass:s.default.string,hideNav:s.default.bool,activateTab:s.default.func,activeTab:s.default.string},m.defaultProps={className:"",extraClass:"",hideNav:!1};const g=e=>`${e.formid}__${e.id}`;t.default=(0,o.connect)((function(e,t){const n=g(t);return{...e.tabs.fields[n]?e.tabs.fields[n]:{activeTab:null}}}),(function(e,t){const n=g(t);return{activateTab(t){e(l.activateTab(n,t))}}}))(m)},56204:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=a.Children.toArray(t);if(!n||0===n.length)return"";let r;"string"==typeof e&&(r=n.find((t=>{let{props:{name:n}}=t;return n===e})));r||(r=n[0]);return r.props.name};var a=n(67294)},97228:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=d(n(97023)),i=d(n(72543)),s=d(n(93967)),o=d(n(45697)),l=d(n(53621));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t({showSummaryView:t})))}render(){const{maxSize:e,onSummary:t,...n}=this.props,o=this.state.showSummaryView,d=this.props.tags.length,u=(0,s.default)("compact-tag-list",{"compact-tag-list__show-summary-view":o});return a.default.createElement("div",{className:u,ref:e=>{this.nodeRef=e}},a.default.createElement(i.default,{onResize:this.onResize,className:"compact-tag-list__placeholder","aria-hidden":!0},a.default.createElement(r.default,c({},n,{focusable:!1}))),a.default.createElement("div",{className:"compact-tag-list__visible"},o?a.default.createElement(l.default,{count:d,onClick:t,onNext:n.onHolderFocus}):a.default.createElement(r.default,n)))}}f.propTypes=Object.assign({},r.default.propTypes,{maxSize:o.default.number,onSummary:o.default.func}),f.defaultProps={maxSize:0,onSummary:()=>{}};t.default=f},53621:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(n(67294)),r=o(n(85362)),i=o(n(4754)),s=o(n(45697));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{label:t,count:n,...i}=e;return a.default.createElement(r.default,l({},i,{deletable:!1,title:`${n} ${t}`}),n," ",a.default.createElement("span",{className:"font-icon-sliders","aria-label":t}))};d.propTypes=Object.assign({},r.default.propTypes,{label:s.default.string,count:s.default.number}),d.defaultProps={label:i.default._t("Admin.SUMMARY_TAG_LABEL","filters")};t.default=d},85362:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l(n(67294)),r=n(53556),i=l(n(93967)),s=l(n(4754)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{onClick:t,onDelete:n,onDeleteKey:s,onBackSpace:o,onPrevious:l,onNext:u,deletable:c,dataKey:p,label:h,value:m,children:g,focusable:v,..._}=e;const b=((e,t,n)=>(t||e)+(n?`: ${n}`:""))(p,h,m);return a.default.createElement(r.Button,d({},_,{role:"button",className:(0,i.default)("tag-component","btn-sm",{"tag-component--deletable":c}),onClick:e=>{e.preventDefault(),t(p)},tabIndex:v?0:void 0,onKeyDown:e=>{((e,t,n,a,r,i)=>{switch(e.key){case"Backspace":e.preventDefault(),a(t);break;case"Delete":e.preventDefault(),n(t);break;case"ArrowLeft":e.preventDefault(),r(t);break;case"ArrowRight":e.preventDefault(),i(t)}})(e,p,s,o,l,u)},title:b}),c&&a.default.createElement(f,{onDelete:n,dataKey:p}),g||b)},c=e=>{e.target.parentElement.focus()},f=e=>{let{dataKey:t,onDelete:n}=e;return a.default.createElement(r.Button,{onClick:e=>{e.stopPropagation(),e.preventDefault(),n(t)},"aria-label":s.default._t("Admin.REMOVE_TAG","Remove Tag"),title:s.default._t("Admin.REMOVE_TAG","Remove Tag"),onFocus:c,tabIndex:-1,className:"tag-component__delete font-icon-cancel btn--no-text btn--icon-sm"})};u.propTypes={onClick:o.default.func,onDelete:o.default.func,onDeleteKey:o.default.func,onBackSpace:o.default.func,onPrevious:o.default.func,onNext:o.default.func,deletable:o.default.bool,dataKey:o.default.string,label:o.default.string,value:o.default.string,focusable:o.default.bool},u.defaultProps={tag:"span",deletable:!1,onClick:()=>{},onDelete:()=>{},onDeleteKey:()=>{},onBackSpace:()=>{},onPrevious:()=>{},onNext:()=>{},focusable:!0};t.default=u},97023:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=o(n(67294)),r=o(n(85362)),i=o(n(45697)),s=o(n(43117));function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=document.activeElement[e?"nextElementSibling":"previousElementSibling"];return!!t&&(t.focus(),!0)},c=e=>{let{tags:t,deletable:n,focusable:i,onTagDelete:s,onTagClick:o,onHolderFocus:c}=e;const f=e=>{u(d)||c(),s(e)},p=e=>{u(false)||u(d)||c(),s(e)};return a.default.createElement("ul",{className:"tag-list"},t.map((e=>a.default.createElement(r.default,l({},e,{tag:"li",deletable:n,dataKey:e.key,focusable:i,onDelete:s,onDeleteKey:n&&s?f:void 0,onBackSpace:n&&s?p:void 0,onNext:()=>{u(d)||c()},onPrevious:()=>{u(false)},onClick:o})))))};t.Component=c,c.propTypes={onTagClick:i.default.func,onTagDelete:i.default.func,onHolderFocus:i.default.func,deletable:i.default.bool,tags:i.default.arrayOf(s.default),focusable:i.default.bool},c.defaultProps={deletable:!1,focusable:!0,onTagDelete:()=>{},onTagClick:()=>{},onHolderFocus:()=>{}};t.default=c},43117:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(45697))&&a.__esModule?a:{default:a};const i=r.default.shape({key:r.default.string.isRequired,label:r.default.string,value:r.default.string});t.default=i},74898:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=i(n(98028)),r=i(n(16725));function i(e){return e&&e.__esModule?e:{default:e}}class s extends r.default{getInputProps(){const e=super.getInputProps();return this.isMultiline()&&Object.assign(e,{type:"textarea",rows:this.props.data.rows,cols:this.props.data.columns}),e}isMultiline(){return this.props.data&&this.props.data.rows>1}}t.Component=s;t.default=(0,a.default)(s)},63182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=d(n(98028)),r=d(n(30381)),i=d(n(68300)),s=d(n(4754)),o=d(n(45697)),l=n(81463);function d(e){return e&&e.__esModule?e:{default:e}}const u="LT";class c extends l.Component{getInputProps(){const e=s.default.inject(s.default._t("Admin.FormatExample","Example: {format}"),{format:(0,r.default)().endOf("month").format(u)}),t=this.asHTML5()?"time":"text";return{...super.getInputProps(),type:t,placeholder:e}}isMultiline(){return!1}hasNativeSupport(){return this.props.modernizr.inputtypes.time}convertToLocalised(e){let t="";if(e){const n=(0,r.default)(e,"HH:mm:ss");n.isValid()&&(t=n.format(u))}return t}convertToIso(e){let t="";if(e){const n=(0,r.default)(e,u);n.isValid()&&(t=n.format("HH:mm:ss"))}return t}}t.Component=c,c.propTypes={lang:o.default.string,modernizr:o.default.object,data:o.default.shape({html5:o.default.bool})},c.defaultProps={modernizr:i.default,data:{}};t.default=(0,a.default)(c)},20164:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tipShape=t.default=t.TIP_TYPES=t.TIP_IMPORTANCE_LEVELS=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=d(n(45697)),i=n(53556),s=d(n(4754)),o=d(n(93967)),l=d(n(22602));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const c=t.TIP_TYPES={TITLE:"title",INPUT_GROUP:"input-group"},f=t.TIP_IMPORTANCE_LEVELS={NORMAL:"normal",HIGH:"high"},p={[f.NORMAL]:{iconColor:"muted",description:s.default._t("Admin.NORMAL_TIP","Tip")},[f.HIGH]:{iconColor:"danger",description:s.default._t("Admin.IMPORTANT_TIP","Important tip")}};function h(e){const{content:t,fieldTitle:n,icon:r,id:d,importance:u}=e,{iconColor:f,description:h}=p[u],m=s.default.inject(s.default._t("Admin.TIP_LABEL","{description} for {fieldTitle}"),{description:h,fieldTitle:n}),g=["tip",e.extraClass];e.type===c.TITLE?g.push("tip--title"):e.type===c.INPUT_GROUP&&g.push("tip--input-group","btn--last","btn-outline-secondary",`text-${f}`);const v=`${d}-tip`,_={id:v,onClick:()=>{},className:(0,o.default)(g),noText:!0,icon:r};return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.default,_,m),a.default.createElement(i.UncontrolledPopover,{trigger:"legacy",placement:"top-end",target:v},a.default.createElement(i.PopoverBody,null,t)))}const m=t.tipShape={content:r.default.string.isRequired,importance:r.default.oneOf(Object.values(f)),type:r.default.oneOf(Object.values(c)),icon:r.default.string};h.propTypes={...m,extraClass:r.default.string,fieldTitle:r.default.string.isRequired,id:r.default.string.isRequired},h.defaultProps={importance:f.NORMAL,icon:"lamp",type:c.INPUT_GROUP};t.default=h},87890:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toastShape=t.default=void 0;var a=u(n(67294)),r=u(n(45697)),i=u(n(4754)),s=n(53556),o=u(n(93967)),l=u(n(22602)),d=n(46735);function u(e){return e&&e.__esModule?e:{default:e}}const c=t.toastShape={text:r.default.string.isRequired,dismissed:r.default.bool.isRequired,type:r.default.string.isRequired,actions:r.default.arrayOf(r.default.shape(l.default.propTypes))},f=e=>{let{type:t,text:n,onDismiss:r,dismissed:u,actions:c}=e;const f=(0,o.default)("toast",`toast--${t}`,{"toast--dismissing":u});return a.default.createElement(s.Toast,{className:f,isOpen:!0},a.default.createElement(s.ToastBody,{className:"toast__body"},a.default.createElement(l.default,{className:"toast__close",icon:"cancel",noText:!0,onClick:e=>{e.preventDefault(),r()},color:"none"},i.default._t("Admin.DISMISS","Dismiss")),a.default.createElement("div",{className:"toast__content",role:"alert","aria-live":"assertive","aria-atomic":"true"},n)),c.length>0&&a.default.createElement(d.ToastActions,{actions:c,onDismiss:r,dismissed:u}))};f.propTypes={...c,onDismiss:r.default.func.isRequired},f.defaultProps={actions:[]};t.default=f},46735:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ToastActions=t.ToastAction=void 0;var a=s(n(67294)),r=s(n(45697)),i=s(n(22602));function s(e){return e&&e.__esModule?e:{default:e}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{label:t,href:n,onClick:r,dismissed:s,onDismiss:l}=e;const d=n?{href:n,tag:"a"}:{onClick:e=>{e.preventDefault(),s||(r&&r(),l())}};return a.default.createElement(i.default,o({color:"link",className:"toast__action"},d),t)};t.ToastAction=l;const d=e=>{let{actions:t,dismissed:n,onDismiss:r}=e;return 0===t.length?null:a.default.createElement("div",{className:"toast__actions"},t.slice(0,2).map(((e,t)=>a.default.createElement(l,o({key:t},e,{onDismiss:r,dismissed:n})))))};t.ToastActions=d,d.propTypes={dismissed:r.default.bool.isRequired,actions:r.default.arrayOf(r.default.shape({label:r.default.string.isRequired,href:r.default.string,onClick:r.default.func})),onDismiss:r.default.func.isRequired},d.defaultProps={actions:[]};t.default=d},60452:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=s(n(45697)),i=s(n(87890));function s(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{toasts:t,onDismiss:n,onPause:r,onResume:s}=e;const[o,d]=(0,a.useState)(void 0),u=e=>()=>{o&&clearTimeout(o),d(setTimeout(e,100))},c=u(r),f=u(s),p={onMouseEnter:c,onFocus:c,onMouseLeave:f,onBlur:f};return a.default.createElement("div",l({className:"toasts","aria-live":"polite","aria-atomic":"true"},p),a.default.createElement("div",{className:"toasts__wrapper"},t.map((e=>{let{id:t,...r}=e;return a.default.createElement(i.default,l({key:t},r,{onDismiss:()=>n(t)}))}))))};d.propTypes={toasts:r.default.arrayOf(r.default.shape(i.default.propTypes)).isRequired,onDismiss:r.default.func.isRequired,onPause:r.default.func.isRequired,onResume:r.default.func.isRequired},d.defaultProps={};t.default=d},53330:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=s(n(67294)),r=s(n(45697)),i=s(n(45332));function s(e){return e&&e.__esModule?e:{default:e}}const o=e=>{let{showBackButton:t,children:n,onBackButtonClick:r}=e;return a.default.createElement("div",{className:"toolbar toolbar--north"},a.default.createElement("div",{className:"toolbar__navigation fill-width"},t&&a.default.createElement(i.default,{onClick:e=>{e.preventDefault(),"function"==typeof r&&r(e)},className:"toolbar__back-button"}),n))};o.propTypes={onBackButtonClick:r.default.func,showBackButton:r.default.bool},o.defaultProps={showBackButton:!1};t.default=o},59888:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SINGLE_EMPTY_VALUE=t.MULTI_EMPTY_VALUE=t.ConnectedTreeDropdownField=t.Component=void 0,Object.defineProperty(t,"findTreeByID",{enumerable:!0,get:function(){return _.findTreeByID}}),Object.defineProperty(t,"findTreeByPath",{enumerable:!0,get:function(){return _.findTreeByPath}}),Object.defineProperty(t,"findTreePath",{enumerable:!0,get:function(){return _.findTreePath}});var a=w(n(67294)),r=b(n(45697)),i=n(86706),s=n(14890),o=b(n(10932)),l=b(n(25114)),d=b(n(4754)),u=b(n(98028)),c=b(n(94301)),f=w(n(23157)),p=w(n(25548)),h=b(n(98268)),m=b(n(8575)),g=n(53556),v=n(10259),_=n(11355);function b(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function w(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{children:t}=e;return a.default.createElement("span",{className:"treedropdownfield__option-title--highlighted"},t)};class S extends a.Component{constructor(e){super(e),this.render=this.render.bind(this),this.renderInput=this.renderInput.bind(this),this.renderMenuList=this.renderMenuList.bind(this),this.renderOption=this.renderOption.bind(this),this.formatOptionLabel=this.formatOptionLabel.bind(this),this.getBreadcrumbs=this.getBreadcrumbs.bind(this),this.getDropdownOptions=this.getDropdownOptions.bind(this),this.getVisibleTree=this.getVisibleTree.bind(this),this.handleBack=this.handleBack.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleNavigate=this.handleNavigate.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleSearchReset=this.handleSearchReset.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.callFetch=this.callFetch.bind(this),this.lazyLoad=this.lazyLoad.bind(this),this.filterOption=this.filterOption.bind(this),this.noOptionsMessage=this.noOptionsMessage.bind(this),this.state={opened:!1},this.searchTimer=null}componentDidMount(){this.props.readOnly||this.props.disabled||this.initialise();const e=this.props.id,t=(this.props.data.multiple?this.props.data.valueObjects||[]:[this.props.data.valueObject]).filter((e=>e));t.length&&this.props.actions.treeDropdownField.addSelectedValues(e,t)}componentDidUpdate(e){if(this.props.readOnly||this.props.disabled)return;let t=!1,n=[];this.props.search!==e.search&&(t=!0,n=this.props.visible),e.data.urlTree!==this.props.data.urlTree&&(t=!0),e.data.cacheKey!==this.props.data.cacheKey&&(t=!0),t&&this.loadTree(n,this.props.search,this.props)}getVisibleTree(){return this.props.findTreeByPath(this.props.tree,this.props.visible)}getBreadcrumbs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.visible;const t=[];if(!e)return t;let n=this.props.tree;for(const a of e){if(!n.children)break;if(n=n.children.find((e=>e.id===a)),!n)break;t.push(n)}return t}getDropdownOptions(){const e=this.props.value,t=this.getVisibleTree();let n=t?[...t.children]:[];const a=this.props.selectedValues.filter((t=>t.id===e||Array.isArray(e)&&e.find((e=>e===t.id))));return!this.state.opened&&this.props.data.showSelectedPath?n=a.map((e=>({...e,title:e.titlePath||e.title}))):a.length&&(n=[...a.filter((e=>!n.find((t=>t.id===e.id)))),...n]),n.unshift({id:this.props.data.multiple?"":E,title:this.props.data.hasEmptyDefault?this.props.data.emptyString:null,disabled:!n.length||!this.props.data.hasEmptyDefault}),n}getPath(e){const t=this.props.findTreePath(this.props.tree,e,this.props.data.treeBaseId);return this.getBreadcrumbs(t).reduce(((e,t)=>`${e}${t.contextString||""}${t.title}/`),"")}initialise(){return this.loadTree([],this.props.search).then((e=>{let t=[];!this.props.data.multiple&&this.props.value&&(t=this.props.findTreePath(e,this.props.value,this.props.data.treeBaseId),t?t.pop():t=[]),this.props.actions.treeDropdownField.setVisible(this.props.id,t)}))}callFetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props;const a=m.default.parse(n.data.urlTree,!0);n.data.showSearch&&t.length&&(a.query.search=t,a.query.flatList="1"),e.length?a.query.ID=e[e.length-1]:!n.data.multiple&&n.value&&(a.query.forceValue=n.value),a.query.format="json",a.search=null;const r=m.default.format(a);return this.props.fetch(r,{credentials:"same-origin"}).then((e=>e.json()))}lazyLoad(e){if(e.find((e=>this.props.loading.indexOf(e)>-1||this.props.failed.indexOf(e)>-1)))return Promise.resolve({});const t=this.props.findTreeByPath(this.props.tree,e);return t&&(0===t.count||t.children.length)?Promise.resolve({}):this.loadTree(e)}loadTree(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props;return n.actions.treeDropdownField.beginTreeUpdating(n.id,e),this.callFetch(e,t,n).then((t=>(n.actions.treeDropdownField.updateTree(n.id,e,t),t))).catch((t=>{if(n.actions.treeDropdownField.updateTreeFailed(n.id,e),"function"==typeof n.onLoadingError)return n.onLoadingError({errors:[{value:t.message,type:"error"}]});throw t}))}hasSearch(){return this.props.data.showSearch&&Boolean(this.props.search)}filterOption(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=this.getVisibleTree();if((e.value===E||""===e.value)&&(!this.props.data.hasEmptyDefault||this.props.visible.length||this.hasSearch()))return!1;const a=e.label&&e.label.toLocaleLowerCase(),r=t.toLocaleLowerCase();return r?a&&a.includes(r):!n||!e.value||n.children.find((t=>t.id===e.value))}handleOpen(){this.setState({opened:!0}),this.handleSearchReset()}handleClose(){this.setState({opened:!1})}handleSearchReset(){clearTimeout(this.searchTimer),this.props.actions.treeDropdownField.setSearch(this.props.id,"")}handleSearchChange(e){clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.props.actions.treeDropdownField.setSearch(this.props.id,e)}),500)}handleChange(e){let t=null;if(this.handleSearchReset(),this.props.data.multiple){if(t=C,e&&e.length){const n=e&&e.filter(((t,n)=>e.findIndex((e=>e.id===t.id))===n));t=n.map((e=>e.id)),this.props.actions.treeDropdownField.addSelectedValues(this.props.id,n)}}else{const n=e?e.id:null;let a=(this.getVisibleTree()||this.props.tree).children.find((e=>e.id===n));a&&(this.props.data.showSelectedPath&&(a={...a,titlePath:this.getPath(n)}),this.props.actions.treeDropdownField.addSelectedValues(this.props.id,[a])),t=n||E}"function"==typeof this.props.onChange&&this.props.onChange(t)}handleNavigate(e,t){if(this.hasSearch())return;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault();let n=this.props.findTreePath(this.props.tree,t,this.props.data.treeBaseId);n||(n=this.props.visible.slice(0),n.push(t)),this.lazyLoad(n),this.props.actions.treeDropdownField.setVisible(this.props.id,n)}handleKeyDown(e){if(this.hasSearch())return void(27===e.keyCode&&this.handleSearchReset(e));const t=this.selectField.state.focusedOption;if(t)switch(e.keyCode){case 37:this.handleBack(e);break;case 39:t.count&&this.handleNavigate(e,t.id)}}handleBack(e){if(this.hasSearch())return;e.stopPropagation(),e.preventDefault();let t=this.props.visible;t.length&&(t=t.slice(0,t.length-1)),this.lazyLoad(t),this.props.actions.treeDropdownField.setVisible(this.props.id,t)}renderInput(e){let{children:t,...n}=e;return n.id=this.props.id,a.default.createElement(f.components.Input,n,t)}renderBreadcrumbs(e,t){let{cx:n,getStyles:r,getClassNames:i,...s}=t;if(0===e.length)return null;e=e.map((e=>e.title)).join(" / ");const l=this.hasSearch()?"font-icon-search":"font-icon-left-open-big",d=n({option:!0,breadcrumbs:!0},i("option",{})),u=o.default.div(r("option",s));return a.default.createElement(u,{className:d,onClick:this.handleBack,role:"button",tabIndex:0},a.default.createElement("button",{type:"button",className:"treedropdownfield__breadcrumbs-button"},a.default.createElement("span",{className:`icon ${l}`})),a.default.createElement("span",{className:"treedropdownfield__breadcrumbs-crumbs flexbox-area-grow"},e))}renderMenuList(e){let{children:t,...n}=e;const r=this.getBreadcrumbs();return a.default.createElement(f.components.MenuList,n,this.renderBreadcrumbs(r,n),t)}renderOption(e){let{children:t,...n}=e,r=null;const i=n.data;if(i.count&&!this.hasSearch()){const e=e=>this.handleNavigate(e,i.id);r=a.default.createElement("button",{type:"button",className:"treedropdownfield__option-button fill-width",onClick:e,onKeyDown:e=>this.handleKeyDown(e),onTouchStart:e},a.default.createElement("span",{className:"treedropdownfield__option-count-icon font-icon-right-open-big"}))}let s=null;return this.hasSearch()&&(s=i.contextString,s||!this.props.data.hasEmptyDefault||this.props.visible.length||(s=this.props.data.emptyString)),a.default.createElement(f.components.Option,n,a.default.createElement("span",{className:"treedropdownfield__option-title-box flexbox-area-grow fill-height"},a.default.createElement("span",{className:"treedropdownfield__option-title"},t),s&&a.default.createElement("span",{className:"treedropdownfield__option-context"},s)),r)}renderReadOnly(){const e={id:this.props.id,readOnly:this.props.readOnly,disabled:this.props.disabled},t=this.props.extraClass?`treedropdownfield ${this.props.extraClass}`:"treedropdownfield";let n=this.props.data.hasEmptyDefault?this.props.data.emptyString:"";const r=this.props.selectedValues;if(this.props.data.multiple){n=this.props.value.map((e=>r.find((t=>t.id===e))||e)).map((e=>e.title)).join(", ")}else{const e=r.find((e=>e.id===this.props.value));n=this.props.value,e&&"string"==typeof e.title&&(n=e.title)}return a.default.createElement("div",{className:t},a.default.createElement("span",{className:"treedropdownfield__title"},n),a.default.createElement(g.Input,O({type:"hidden",name:this.props.name,value:this.props.value},e)))}formatOptionLabel(e){const{title:t}=e;return this.props.search.length?(0,v.mapHighlight)(t||"",this.props.search,T):t}noOptionsMessage(e){let{inputValue:t}=e;const n=this.getVisibleTree()||{};return this.props.failed.indexOf(n.id||0)>=0?d.default._t("Admin.TREEDROPDOWN_FAILED","Failed to load"):t||!n.id?d.default._t("Admin.TREEDROPDOWN_NO_OPTIONS","No options"):d.default._t("Admin.TREEDROPDOWN_NO_CHILDREN","No children")}render(){if(this.props.readOnly||this.props.disabled)return this.renderReadOnly();const e=this.props.extraClass?`treedropdownfield ${this.props.extraClass}`:"treedropdownfield",t=this.getDropdownOptions(),n=Array.isArray(this.props.value)?this.props.value:[this.props.value];let r=this.props.selectedValues.filter((e=>n.includes(e.id)));r.length||(r=t.filter((e=>n.includes(e.id)))),!r.length&&this.props.data.hasEmptyDefault&&(r=t[0]);const i=void 0!==this.props.data.showSearch&&this.props.data.showSearch,s={Input:this.renderInput,MenuList:this.renderMenuList,Option:this.renderOption},o=this.getVisibleTree()||{},u=this.props.loading.indexOf(o.id||0)>=0;return a.default.createElement(l.default,null,a.default.createElement(f.default,{isSearchable:i,isMulti:this.props.data.multiple,isClearable:!0,className:e,name:this.props.name,options:t,delimiter:",",components:s,formatOptionLabel:this.formatOptionLabel,filterOption:this.filterOption,onChange:this.handleChange,onMenuOpen:this.handleOpen,onMenuClose:this.handleClose,onKeyDown:this.handleKeyDown,onInputChange:this.handleSearchChange,isLoading:u,loadingMessage:()=>d.default._t("Admin.TREEDROPDOWN_LOADING","Loading..."),noOptionsMessage:this.noOptionsMessage,value:r,ref:e=>{this.selectField=e},placeholder:this.props.data.emptyString,getOptionLabel:e=>{let{title:t}=e;return t},getOptionValue:e=>{let{id:t}=e;return t},classNamePrefix:"treedropdownfield",classNames:{option:()=>"fill-width"}}))}}t.Component=S,S.propTypes={className:r.default.string,extraClass:r.default.string,id:r.default.string,name:r.default.string.isRequired,onChange:r.default.func,value:r.default.oneOfType([r.default.string,r.default.number,r.default.array]),readOnly:r.default.bool,disabled:r.default.bool,tree:r.default.shape(h.default.propTypes),findTreeByPath:r.default.func,findTreePath:r.default.func,visible:r.default.array,loading:r.default.array,failed:r.default.array,selectedValues:r.default.array,data:r.default.shape({cacheKey:r.default.string,urlTree:r.default.string.isRequired,emptyString:r.default.string,valueObject:r.default.shape(h.default.propTypes),valueObjects:r.default.arrayOf(r.default.shape(h.default.propTypes)),hasEmptyDefault:r.default.bool,showSearch:r.default.bool,multiple:r.default.bool,showSelectedPath:r.default.bool,treeBaseId:r.default.number}),onLoadingError:r.default.func,search:r.default.string,actions:r.default.shape({treeDropdownField:r.default.object}),fetch:r.default.func},S.defaultProps={value:"",extraClass:"",className:"",tree:{},visible:[],loading:[],failed:[],findTreeByPath:_.findTreeByPath,findTreePath:_.findTreePath,fetch:c.default};const P=t.ConnectedTreeDropdownField=(0,i.connect)((function(e,t){const n=t.id,a=e.treeDropdownField.fields[n]?e.treeDropdownField.fields[n]:{tree:{},visible:[],loading:[],failed:[],search:"",selectedValues:[]};let r=t.value;return t.data.multiple&&t.value===C&&(r=[]),t.data.multiple||t.value||(r=E),{...a,value:r}}),(function(e){return{actions:{treeDropdownField:(0,s.bindActionCreators)(p,e)}}}))(S);t.default=(0,u.default)(P)},98268:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(45697))&&a.__esModule?a:{default:a};const i=()=>null;i.propTypes={id:r.default.oneOfType([r.default.string,r.default.number]),title:r.default.string,titlePath:r.default.string,disabled:r.default.bool,parentid:r.default.number,count:r.default.number,depth:r.default.number,expanded:r.default.bool,limited:r.default.bool,marked:r.default.bool,opened:r.default.bool,children:r.default.array};t.default=i},11355:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findTreePath=t.findTreeByPath=t.findTreeByID=void 0;const n=(e,t)=>{if(!e||0===Object.keys(e).length)return null;if(0===t.length)return e;const a=t.slice(0),r=a.shift(),i=e.children.find((e=>e.id===r));return i?n(i,a):null};t.findTreeByPath=n;const a=(e,t)=>{if(!t||!e||!e.children||0===Object.keys(e).length)return null;if(e.id===t)return e;for(const n of e.children){const e=a(n,t);if(null!==e)return e}return null};t.findTreeByID=a;const r=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return[];if(!e||0===Object.keys(e).length)return null;if(e.id===t)return[e.id];if(!e.children)return null;for(const a of e.children){const i=r(a,t);if(null!==i)return e.id&&e.id!==n&&i.unshift(e.id),i}return null};t.findTreePath=r},80384:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=d(n(45697)),i=d(n(93967)),s=d(n(4754)),o=d(n(34411)),l=d(n(6732));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}class c extends a.PureComponent{renderHeader(){return a.default.createElement("thead",null,a.default.createElement("tr",null,a.default.createElement("th",{scope:"col",className:"used-on__col--index"},s.default._t("Admin.USED_ON_NUM","#")),a.default.createElement("th",{scope:"col",className:"used-on__col--title"},s.default._t("Admin.USED_ON","Used on"))))}renderBody(){const{usedOn:e,loading:t,error:n}=this.props;if(n||!e||!e.length){let e=null,r=null;n?(e=s.default.inject(s.default._t("Admin.LOADING_ERROR","As error occured when loading the data: {message}"),{message:n}),r="error"):t?(e=a.default.createElement(o.default,null),r="loading"):(e=s.default._t("Admin.NOT_USED","This file is currently not in use."),r="empty");const l=(0,i.default)(["used-on__message",`used-on__message--${r}`]);return a.default.createElement("tbody",{"aria-live":"polite"},a.default.createElement("tr",null,a.default.createElement("td",{className:l,colSpan:"3"},e)))}return a.default.createElement("tbody",{"aria-live":"polite"},e.map(this.renderRow))}renderRow(e,t){const{id:n,type:r}=e,s=e.ancestors?[e].concat(e.ancestors).reverse():[e].reverse();let o="#",l=!0;const d=s.map(((e,r)=>{let s=e.title;const d=e.link;s&&s.length>=25&&(s=`${s.substring(0,25).trim()}...`),d&&(o=d);const u=`${t}-${n}-${r}`,c=["used-on__title-item"];return l&&(c.push("used-on__title-item--first"),l=!1),a.default.createElement("li",{className:(0,i.default)(c),key:u},s)})),u=`${t}-${n}`;return a.default.createElement("tr",{key:u,className:"used-on__row"},a.default.createElement("td",{className:"used-on__col--index"},a.default.createElement("a",{href:o,className:"used-on__cell-link"},t+1)),a.default.createElement("td",{className:"used-on__col--title"},a.default.createElement("a",{href:o,className:"used-on__cell-link"},a.default.createElement("ul",{className:"used-on__title-items"},d),a.default.createElement("span",{className:"used-on__type"},r))))}render(){return a.default.createElement("table",{className:"table used-on__table"},this.renderHeader(),this.renderBody())}}t.Component=c,c.propTypes={loading:r.default.bool,usedOn:r.default.arrayOf(r.default.shape({id:r.default.oneOfType([r.default.string,r.default.number]),title:r.default.string,type:r.default.string,link:r.default.string,ancestors:r.default.arrayOf(r.default.shape({title:r.default.string,link:r.default.string})).isRequired})),error:r.default.string};t.default=(0,l.default)(c)},6732:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),i=(a=n(45697))&&a.__esModule?a:{default:a},s=n(86706),o=n(36992),l=n(93390);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}t.default=e=>{class t extends r.Component{componentDidMount(){this.haveFetchedData=!1,this.props.forceFetch&&this.fetchDataFromEndpoint()}componentDidUpdate(e){const t=this.props.tabContext;(e.identifier!==this.props.identifier||!t||t.isOnActiveTab)&&this.fetchDataFromEndpoint()}fetchDataFromEndpoint(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;const{method:t,url:n}=e.data.readUsageEndpoint||{};this.haveFetchedData&&!this.props.forceFetch||e.loadUsedOn(e.identifier,t,n),this.haveFetchedData=!0}render(){return r.default.createElement(e,this.props)}}t.propTypes={identifier:i.default.string,loading:i.default.bool,data:i.default.oneOfType([i.default.array,i.default.shape({recordClass:i.default.string,recordId:i.default.oneOfType([i.default.string,i.default.number]),readUsageEndpoint:i.default.shape({url:i.default.string,method:i.default.string})})]),usedOn:i.default.array,forceFetch:i.default.bool};const n=(0,l.injectTabContext)(t),a=(0,s.connect)(((e,t)=>{const{recordClass:n,recordId:a}=t.data,r=n&&a?`${n}#${a}`:"",i=e.usedOn;return{identifier:r,loading:i.loading.includes(r),usedOn:i.usedOn[r]||null,error:i.errors[r]||null}}),{loadUsedOn:o.loadUsedOn})(n);return a.Component=n,a}},57129:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.statuses=t.default=void 0;var a=l(n(67294)),r=l(n(93967)),i=l(n(45697)),s=l(n(37294)),o=l(n(4754));function l(e){return e&&e.__esModule?e:{default:e}}const d=t.statuses=["draft","modified","live","archived"],u=e=>{let{status:t,className:n}=e;const i={className:(0,r.default)(n,"versioned-badge",`versioned-badge--${t}`),message:o.default._t(`ADMIN.${t.toUpperCase()}`,(l=t,l.replace(/^\w/,(e=>e.toUpperCase())))),status:"default"};var l;return a.default.createElement(s.default,i)};u.propTypes={status:i.default.oneOf(d).isRequired,className:i.default.string};t.default=u},98031:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=f(n(45697)),i=n(53556),s=f(n(4754)),o=n(86706),l=n(14890),d=n(56486),u=n(15005),c=f(n(93967));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.setState((e=>({dropdownOpen:!e.dropdownOpen})))),0)}handleSplitSelect(){this.props.onSplitSelect()}handlePreviewSelect(){this.props.onPreviewSelect()}handleEditSelect(){this.props.onEditSelect()}renderSplitDropdownItem(){const{activeState:e,splitAvailable:t,splitIconClass:n}=this.props,r=(0,c.default)("btn","icon-view","first",n,{"viewmode-toggle__button":!0,"viewmode-toggle--selected":e===u.VIEW_MODE_STATES.SPLIT,disabled:!t});return a.default.createElement(i.DropdownItem,{type:"button",disabled:!t,className:r,value:u.VIEW_MODE_STATES.SPLIT,onClick:this.handleSplitSelect,id:"splitModeButton"},s.default._t("Admin.SPLIT_MODE","Split mode"))}renderEditDropDownItem(){const{activeState:e,editIconClass:t}=this.props,n=(0,c.default)("btn","icon-view","last","viewmode-toggle__button",t,{"viewmode-toggle--selected":e===u.VIEW_MODE_STATES.EDIT});return a.default.createElement(i.DropdownItem,{type:"button",className:n,value:"content",onClick:this.handleEditSelect},s.default._t("Admin.EDIT_MODE","Edit mode"))}renderPreviewDropDownItem(){const{activeState:e,previewIconClass:t}=this.props,n=(0,c.default)("btn","icon-view","viewmode-toggle__button",t,{"viewmode-toggle--selected":e===u.VIEW_MODE_STATES.PREVIEW});return a.default.createElement(i.DropdownItem,{type:"button",className:n,value:"preview",onClick:this.handlePreviewSelect},s.default._t("Admin.PREVIEW_MODE","Preview mode"))}render(){const{activeState:e,area:t,splitAvailable:n,dropdownToggleProps:r}=this.props;if(t===u.VIEW_MODE_STATES.EDIT&&e===u.VIEW_MODE_STATES.SPLIT)return null;const o=(0,c.default)(this.getIconClass(),"btn","viewmode-toggle__dropdown",r.classname);return a.default.createElement(i.Dropdown,{isOpen:this.state.dropdownOpen,toggle:this.toggle,className:"viewmode-toggle"},a.default.createElement(i.DropdownToggle,h({className:o,caret:!0},r),a.default.createElement("span",{className:"viewmode-toggle__chosen-view-title"},this.getTitle())),a.default.createElement(i.DropdownMenu,null,this.renderSplitDropdownItem(),this.renderEditDropDownItem(),this.renderPreviewDropDownItem(),!n&&a.default.createElement("div",{className:"disabled-tooltip"},a.default.createElement("span",{className:"disabled-tooltip-span"},s.default._t("Admin.SCREEN_TOO_SMALL","Screen size too small")))))}}t.Component=m,m.propTypes={activeState:r.default.oneOf(Object.values(u.VIEW_MODE_STATES)),area:r.default.string.isRequired,splitAvailable:r.default.bool,onPreviewSelect:r.default.func,onEditSelect:r.default.func,onSplitSelect:r.default.func,editIconClass:r.default.string,previewIconClass:r.default.string,splitIconClass:r.default.string},m.defaultProps={splitAvailable:!0,editIconClass:"font-icon-edit-write",previewIconClass:"font-icon-eye",splitIconClass:"font-icon-columns",dropdownToggleProps:{}};t.default=(0,l.compose)((0,o.connect)((function(e){return{activeState:e.viewMode.activeState,splitAvailable:e.viewMode.splitAvailable}}),(function(e){return{onSplitSelect(){e((0,d.selectSplitMode)())},onEditSelect(){e((0,d.selectEditMode)())},onPreviewSelect(){e((0,d.selectPreviewMode)())}}})))(m)},55766:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r=(a=n(67294))&&a.__esModule?a:{default:a},i=n(54582),s=n(89250);t.default=(0,i.provideInjector)((e=>{let{children:t}=e;return r.default.createElement("div",{className:"app"},t,r.default.createElement(s.Outlet,null))}))},25114:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=s(n(67294)),r=s(n(66751)),i=n(70917);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){let{children:t}=e;return window.ssReactSelectCache||(window.ssReactSelectCache=(0,r.default)({key:"react-select",insertionPoint:document.querySelector("title")})),a.default.createElement(i.CacheProvider,{value:window.ssReactSelectCache},t)}},36800:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l(n(67294)),r=n(11962),i=n(54582),s=l(n(87393)),o=l(n(45697));function l(e){return e&&e.__esModule?e:{default:e}}const d=e=>{const t=e.formComponent,n={...e};return delete n.formComponent,a.default.createElement(t,n)};d.propTypes={formComponent:o.default.elementType.isRequired};const u=(0,i.inject)(["Form"],(e=>({formComponent:e})))(d);t.default=(0,r.reduxForm)({getFormState:s.default,destroyOnUnmount:!1})(u)},16304:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0,t.createFormIdentifierFromProps=O,t.default=void 0;var a=w(n(4754)),r=y(n(67294)),i=w(n(45697)),s=n(86706),o=n(14890),l=w(n(94301)),d=w(n(16012)),u=n(11962),c=w(n(48834)),f=n(48942),p=y(n(39042)),h=w(n(21965)),m=y(n(56334)),g=w(n(79298)),v=n(54582),_=w(n(87393));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function w(e){return e&&e.__esModule?e:{default:e}}function O(e){let{identifier:t,schema:n={}}=e;return[t,n.schema&&n.schema.name].filter((e=>e)).join(".")}class C extends r.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),this.reduceSchemaErrors=this.reduceSchemaErrors.bind(this),this.handleAutofill=this.handleAutofill.bind(this)}componentDidMount(){const{schema:e,refetchSchemaOnMount:t}=this.props;!t&&e||this.fetch()}componentDidUpdate(e){this.props.schemaUrl!==e.schemaUrl&&this.fetch()}getMessages(e){const t={};return e&&e.fields&&e.fields.forEach((e=>{e.message&&(t[e.name]=e.message)})),t}getIdentifier(){return O(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props)}handleSubmit(e,t,n){let a=null;const r=()=>n().then((e=>{let t=e;if(t){const e=void 0!==t.state;if(t=this.reduceSchemaErrors(t),this.props.actions.schema.setSchema(this.props.schemaUrl,t,this.getIdentifier()),e){const e=t.schema||this.props.schema.schema,n=(0,c.default)(e,t.state);this.props.actions.reduxForm.initialize(this.getIdentifier(),n)}}return t}));if(a="function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,r):r(),!a)throw new Error("Promise was not returned for submitting");return a.then((e=>{if(!e||!e.state)return e;const t=this.getMessages(e.state);if(Object.keys(t).length)throw new u.SubmissionError(t);return e}))}reduceSchemaErrors(e){if(!e.errors)return e;let t={...e};return t.state||(t={...t,state:this.props.schema.state}),t={...t,state:{...t.state,fields:t.state.fields.map((t=>{let n=e.errors.find((e=>e.field===t.name));return n&&(n=(0,f.createErrorHtml)([n.value])),{...t,message:n}})),messages:e.errors.filter((e=>!e.field))}},delete t.errors,(0,d.default)(t)}overrideStateData(e){if(!this.props.stateOverrides||!e)return e;const t=this.props.stateOverrides.fields;let n=e.fields;return t&&n&&(n=n.map((e=>{const n=t.find((t=>t.name===e.name));return n?h.default.recursive(!0,e,n):e}))),Object.assign({},e,this.props.stateOverrides,{fields:n})}callFetch(e){return(0,l.default)(this.props.schemaUrl,{headers:{"X-FormSchema-Request":e.join(","),Accept:"application/json"},credentials:"same-origin"}).then((e=>e.status>=200&&e.status<300?e.json():new Promise(((t,n)=>e.json().then((t=>{n({status:e.status,statusText:e.statusText,json:t})})).catch((()=>{n({status:e.status,statusText:e.statusText,json:{}})}))))))}fetch(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.props.loading)return Promise.resolve({});const a=["auto",e&&"schema",t&&"state",n&&"errors"].filter((e=>e));return this.props.actions.schema.setSchemaLoading(this.props.schemaUrl,!0),"function"==typeof this.props.onFetchingSchema&&this.props.onFetchingSchema(),this.callFetch(a).then((e=>{if(this.props.actions.schema.setSchemaLoading(this.props.schemaUrl,!1),e.errors?"function"==typeof this.props.onLoadingError&&this.props.onLoadingError(e):"function"==typeof this.props.onLoadingSuccess&&this.props.onLoadingSuccess(),void 0!==e.id&&e.state){const t=Object.assign({},e,{state:this.overrideStateData(e.state)}),n=O({...this.props,schema:{...this.props.schema,...t}});this.props.actions.schema.setSchema(this.props.schemaUrl,t,n);const a=e.schema||this.props.schema.schema,r=(0,c.default)(a,t.state);return this.props.actions.reduxForm.initialize(n,r,!1,{keepSubmitSucceeded:!0}),"function"==typeof this.props.onReduxFormInit&&this.props.onReduxFormInit(),t}return e})).catch((e=>{if(this.setState({didError:!0}),this.props.actions.schema.setSchemaLoading(this.props.schemaUrl,!1),"function"==typeof this.props.onLoadingError)return this.props.onLoadingError(this.normaliseError(e));throw e}))}normaliseError(e){if(e.json&&e.json.errors)return e.json;if(e.status&&e.statusText)return{errors:[{code:e.status,value:e.statusText,type:"error"}]};return{errors:[{value:e.message||a.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred."),type:"error"}]}}handleAutofill(e,t){this.props.actions.reduxForm.autofill(this.getIdentifier(),e,t)}render(){if(this.state&&this.state.didError)return null;if(!this.props.schema||!this.props.schema.schema||this.props.loading){const e=this.props.loadingComponent;return r.default.createElement(e,{containerClass:"loading--form flexbox-area-grow"})}const e=Object.assign({},this.props,{form:this.getIdentifier(),onSubmitSuccess:this.props.onSubmitSuccess,onSubmit:this.handleSubmit,onAutofill:this.handleAutofill,autoFocus:this.props.autoFocus});return r.default.createElement(m.default,e)}}t.Component=C,C.propTypes=Object.assign({},m.basePropTypes,{actions:i.default.shape({schema:i.default.object,reduxFrom:i.default.object}),autoFocus:i.default.bool,identifier:i.default.string.isRequired,schemaUrl:i.default.string.isRequired,schema:m.schemaPropType,refetchSchemaOnMount:i.default.bool.isRequired,form:i.default.string,submitting:i.default.bool,onFetchingSchema:i.default.func,onReduxFormInit:i.default.func,loadingComponent:i.default.elementType.isRequired}),C.defaultProps={refetchSchemaOnMount:!0};t.default=(0,o.compose)((0,v.inject)(["ReduxForm","ReduxFormField","Loading"],((e,t,n)=>({loadingComponent:n,baseFormComponent:e,baseFieldComponent:t})),(e=>{let{identifier:t}=e;return t})),(0,s.connect)((function(e,t){const n=e.form.formSchemas[t.schemaUrl],a=O({...t,schema:n}),r=(0,g.default)((0,_.default)(e),a);return{schema:n,submitting:r&&r.submitting,values:r&&r.values,stateOverrides:n&&n.stateOverride,loading:n&&n.metadata&&n.metadata.loading}}),(function(e){return{actions:{schema:(0,o.bindActionCreators)(p,e),reduxForm:(0,o.bindActionCreators)({autofill:u.autofill,initialize:u.initialize},e)}}})))(C)},52583:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.createInsertLinkModal=t.InsertLinkModal=void 0;var a=f(n(67294)),r=u(n(45697)),i=n(14890),s=n(86706),o=u(n(48297)),l=u(n(63596)),d=f(n(39042));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}class p extends a.Component{constructor(e){super(e),this.handleSubmit=this.handleSubmit.bind(this),e.isOpen||e.setOverrides(null)}componentDidUpdate(e){const t=this.props;(t.isOpen&&!e.isOpen||!t.isOpen&&e.isOpen)&&t.setOverrides(t.isOpen?t:null)}getModalProps(){const e=Object.assign({},this.props,{onSubmit:this.handleSubmit,onClosed:this.props.onClosed,autoFocus:!0,showErrorMessage:!0});return delete e.onInsert,delete e.sectionConfig,e}handleSubmit(e,t){if("action_cancel"===t)this.props.onClosed();else this.props.onInsert(e,t);return Promise.resolve()}render(){const e=this.getModalProps();return a.default.createElement(o.default,e)}}function h(e){return{actions:{schema:(0,i.bindActionCreators)(d,e)}}}t.InsertLinkModal=p,p.propTypes={isOpen:r.default.bool,schemaUrl:r.default.string,onInsert:r.default.func.isRequired,onClosed:r.default.func.isRequired,setOverrides:r.default.func.isRequired,actions:r.default.object,requireLinkText:r.default.bool,currentPageID:r.default.number},p.defaultProps={};t.createInsertLinkModal=(e,t)=>(0,i.compose)((0,s.connect)((function(n,a){const r=n.config.sections.find((t=>t.name===e)),i=a.requireLinkText?"?requireLinkText":"";return{sectionConfig:r,schemaUrl:`${r.form[t].schemaUrl}${i}`.replace(/:pageid/,a.currentPageID)}}),h),l.default)(p);t.default=(0,i.compose)((0,s.connect)((()=>({})),h),l.default)(p)},63596:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FileSchemaHandler=t.ConnectedFileSchemaHandler=void 0;var a,r=u(n(67294)),i=(a=n(45697))&&a.__esModule?a:{default:a},s=n(14890),o=u(n(39042)),l=n(86706);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;if(e){if(e.schemaUrl){const t=Object.assign({},e.fileAttributes);delete t.ID;const n={fields:Object.entries(t).map((e=>{const[t,n]=e;return{name:t,value:n}}))};this.props.actions.schema.setSchemaStateOverrides(e.schemaUrl,n)}}else{const e=this.props.schemaUrl;e&&this.props.actions.schema.setSchemaStateOverrides(e,null)}}render(){const{Component:e,...t}=this.props;return r.default.createElement(e,c({setOverrides:this.setOverrides},t))}}function p(e,t){return{actions:{...t&&t.actions||{},schema:(0,s.bindActionCreators)(o,e)}}}t.FileSchemaHandler=f,f.propTypes={fileAttributes:i.default.object,Component:i.default.elementType,schemaUrl:i.default.string,actions:i.default.object};t.ConnectedFileSchemaHandler=(0,l.connect)((()=>({})),p())(f);t.default=function(e){return(0,l.connect)((function(){return{Component:e}}),p)(f)}},73276:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(67294)),r=d(n(45697)),i=n(53556),s=n(54582),o=d(n(94301)),l=d(n(94974));function d(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{class t extends a.Component{constructor(e){super(e),this.state={active:l.default.getSection(f).sudoModeActive||!1,showVerification:!1,loading:!1,errorMessage:null},this.handleConfirmNotice=this.handleConfirmNotice.bind(this),this.handleVerify=this.handleVerify.bind(this),this.handleVerifyInputKeyPress=this.handleVerifyInputKeyPress.bind(this),this.passwordInput=null,this.setPasswordInput=e=>{this.passwordInput=e}}handleConfirmNotice(){this.setState({showVerification:!0},(()=>this.passwordInput&&this.passwordInput.focus()))}handleVerify(){this.setState({loading:!0});const e=new FormData;e.append("SecurityID",l.default.get("SecurityID")),e.append("Password",this.passwordInput.value),(0,o.default)(l.default.getSection(f).endpoints.activate,{method:"POST",body:e}).then((e=>e.json().then((e=>e.result?this.setState({loading:!1,active:!0}):this.setState({loading:!1,errorMessage:e.message},(()=>this.passwordInput.focus()))))))}handleVerifyInputKeyPress(e){13===e.charCode&&(e.stopPropagation(),e.preventDefault(),this.handleVerify())}isSudoModeActive(){return!0===this.state.active}renderSudoModeNotice(){const{i18n:e}=window,{showVerification:t}=this.state,n=l.default.getSection(f).helpLink||null;return a.default.createElement("div",{className:"sudo-mode__notice sudo-mode__notice--required"},a.default.createElement("p",{className:"sudo-mode__notice-message"},e._t("Admin.VERIFY_ITS_YOU","Verify it's you first."),n&&a.default.createElement("a",{href:n,className:"sudo-mode__notice-help",target:"_blank",rel:"noopener noreferrer"},e._t("Admin.WHATS_THIS","What is this?"))),!t&&a.default.createElement(i.Button,{className:"sudo-mode__notice-button font-icon-lock",color:"info",onClick:this.handleConfirmNotice},e._t("Admin.VERIFY_TO_CONTINUE","Verify to continue")))}renderSudoModeVerification(){const{i18n:e}=window,{errorMessage:t}=this.state,n={type:"password",name:"sudoModePassword",id:"sudoModePassword",className:"no-change-track",onKeyPress:this.handleVerifyInputKeyPress,innerRef:this.setPasswordInput},r=t?{valid:!1,invalid:!0}:{};return a.default.createElement("div",{className:"sudo-mode__verify"},a.default.createElement(i.FormGroup,{className:"sudo-mode__verify-form-group"},a.default.createElement(i.Label,{for:"sudoModePassword"},e._t("Admin.ENTER_PASSWORD","Enter your password")),a.default.createElement(i.InputGroup,null,a.default.createElement(i.Input,c({},n,r)),a.default.createElement(i.InputGroupAddon,{addonType:"append"},a.default.createElement(i.Button,{className:"sudo-mode__verify-button",color:"info",onClick:this.handleVerify},e._t("Admin.VERIFY","Verify"))),a.default.createElement(i.FormFeedback,null,t))))}renderSudoMode(){const{showVerification:e,loading:t}=this.state,n=this.props.LoadingComponent||(0,s.loadComponent)("CircularLoading","SudoMode");return t?a.default.createElement("div",{className:"sudo-mode alert alert-info"},a.default.createElement(n,{block:!0})):a.default.createElement("div",{className:"sudo-mode alert alert-info"},this.renderSudoModeNotice(),e&&this.renderSudoModeVerification())}render(){return this.isSudoModeActive()?a.default.createElement(e,this.props):this.renderSudoMode()}}return t.propTypes={LoadingComponent:r.default.oneOfType([r.default.node,r.default.func])},t}},49331:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=d(n(67294)),r=d(n(60452)),i=n(86706),s=n(14890),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(36158));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.connect)((e=>{let{toasts:{toasts:t}}=e;return{toasts:t}}),(e=>({actions:(0,s.bindActionCreators)(o,e)})))((e=>{let{toasts:t,actions:{dismiss:n,pause:i,resume:s}}=e;return a.default.createElement(r.default,{toasts:t,onDismiss:n,onPause:i,onResume:s})}))},93390:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.TabContext=void 0,t.injectTabContext=function(e){return t=>{const n=o();return a.default.createElement(e,i({},t,{tabContext:n}))}},t.useTabFirstShow=function(e){const t=o(),n=!t||t.isOnActiveTab,[r,i]=(0,a.useState)(!1);(0,a.useEffect)((()=>{n&&(i(!0),e(t))}),[r||n])};var a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(a,s,o):a[s]=e[s]}return a.default=e,n&&n.set(e,a),a}(n(67294));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),a=1;a{e(".cms-content-actions .add-to-campaign-action,#add-to-campaign__action").entwine({onclick(){let t=e("#add-to-campaign__dialog-wrapper");return t.length||(t=e('
'),e("body").append(t)),t.open(),!1}}),e(".add-to-campaign-modal .add-to-campaign-modal__nav-link").entwine({onclick:t=>{t.preventDefault();const n=e(t.target);window.location=n.attr("href")}}),e("#add-to-campaign__dialog-wrapper").entwine({ReactRoot:null,onunmatch(){this._clearModal()},open(){this._renderModal(!0)},close(){this._renderModal(!1)},_renderModal(t){var n=this;const r=e("form.cms-edit-form :input[name=ID]").val(),o=`${window.ss.store.getState().config.sections.find((e=>"SilverStripe\\CMS\\Controllers\\CMSPageEditController"===e.name)).form.AddToCampaignForm.schemaUrl}/${r}`,d=a.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");let u=this.getReactRoot();u||(u=(0,s.createRoot)(this[0])),u.render(i.default.createElement(l,{title:d,isOpen:t,onSubmit:function(){return n._handleSubmitModal(...arguments)},onClosed:()=>this.close(),schemaUrl:o,bodyClassName:"modal__dialog",className:"add-to-campaign-modal",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good",identifier:"Admin.AddToCampaign"})),this.setReactRoot(u)},_clearModal(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},_handleSubmitModal(e,t,n){return n()}})}))},76406:function(e,t,n){"use strict";var a,r=(a=n(19755))&&a.__esModule?a:{default:a};(0,r.default)(document).on("click",".confirmedpassword .showOnClick a",(function(){var e=(0,r.default)(".showOnClickContainer",(0,r.default)(this).parent());return e.toggle("fast",(function(){e.toggleClass("d-none").find('input[type="hidden"]').val(e.hasClass("d-none")?0:1)})),!1}))},40303:function(e,t,n){"use strict";var a=o(n(19755)),r=o(n(4754)),i=o(n(30381)),s=o(n(68300));function o(e){return e&&e.__esModule?e:{default:e}}a.default.entwine("ss",(e=>{e("input[type=date]").entwine({onadd(){if(s.default.inputtypes.date)return;if(this.prop("disabled")||this.prop("readonly")||this.hasClass("hasDatepicker"))return;const t=e("",{type:"hidden",name:this.attr("name"),value:this.val()});this.parent().append(t),this.removeAttr("name"),i.default.locale(this.attr("lang"));const n=this.val();let a="";if(n){const e=(0,i.default)(n);e.isValid()&&(a=e.format("L"))}this.val(a);const o=r.default.inject(r.default._t("Admin.FormatExample","Example: {format}"),{format:(0,i.default)().endOf("month").format("L")});this.attr("placeholder",o),this.updateValue()},onchange(){this.updateValue()},updateValue(){const e=this.val();let t="";if(e)for(const n of["L","YYYY-MM-DD"]){const a=(0,i.default)(e,n);if(a.isValid()){t=a.format("YYYY-MM-DD");break}}this.parent().find("input[type=hidden]").val(t)}})}))},57893:function(e,t,n){"use strict";var a=o(n(19755)),r=o(n(4754)),i=o(n(30381)),s=o(n(68300));function o(e){return e&&e.__esModule?e:{default:e}}n(881),a.default.entwine("ss",(e=>{e("input[type=datetime-local]").entwine({onadd(){if(s.default.inputtypes["datetime-local"])return;if(this.prop("disabled")||this.prop("readonly")||this.hasClass("hasDatepicker"))return;const t=e("",{type:"hidden",name:this.attr("name"),value:this.val()});this.parent().append(t),this.removeAttr("name"),i.default.locale(this.attr("lang"));const n=this.val();let a="";if(n){const e=(0,i.default)(n);e.isValid()&&(a=e.format("L LT"))}this.val(a);const o=r.default.inject(r.default._t("Admin.FormatExample","Example: {format}"),{format:(0,i.default)().endOf("month").format("L LT")});this.attr("placeholder",o),this.updateValue()},onchange(){this.updateValue()},updateValue(){const e=this.val();let t="";if(e){const n=(0,i.default)(e,["L LT",i.default.ISO_8601]);n.isValid()&&(t=n.format("YYYY-MM-DDTHH:mm:ss"))}this.parent().find("input[type=hidden]").val(t)}})}))},17106:function(e,t,n){"use strict";var a=l(n(19755)),r=l(n(4754)),i=l(n(67294)),s=n(20745),o=(l(n(62266)),n(48834),n(54582));function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t").addClass("ss-gridfield-item loading").attr("colspan",d);l.append(e("").append(u));e.ajax(e.extend({},{headers:{"X-Pjax":"CurrentField"},type:"POST",url:this.data("url"),dataType:"html",success:function(r){if(a.empty().append(e(r).children()),s&&a.find(':input[name="'+s+'"]').focus(),a.find(".grid-field__filter-header, .grid-field__search-holder").length){var i="show"===t.data[0].filter;a.needsColumnFix()&&a.fixColumns(),a.injectSearchButton(i)}n&&n.apply(this,arguments),a.trigger("reload",a),!1!==t.data[0].triggerChange&&a.trigger("change")},error:function(e){alert(r.default._t("Admin.ERRORINTRANSACTION"))},complete:function(e,t){a.find(".loading").removeClass("loading")}},t))},showDetailView:function(e){window.location.href=e},getItems:function(){return this.find(".ss-gridfield-item")},setState:function(e,t){var n=this.getState();n[e]=t,this.find(':input[name="'+this.data("name")+'[GridState]"]').val(JSON.stringify(n))},getState:function(){const e=this.find(':input[name="'+this.data("name")+'[GridState]"]').val();return e?JSON.parse(e):{}},hasFilters:function(){return!!this.getState().GridFieldFilterHeader},needsColumnFix:function(){return this.find(".grid-field__filter-header, .grid-field__search-holder").length&&!this.find(".grid-field__col-compact").length&&!this.find("th.col-Actions").length},fixColumns:function(t){this.find(".sortable-header").append(''),this.find("tbody tr").each((function(){e(this).find("td:last").attr("colspan",2)}));var n=e('');e(".grid-field__filter-header th:last .action").each((function(){e(this).detach(),n.append(e(this))})),e(".grid-field__filter-header").append(n)},injectSearchButton:function(e){const t=this.find(".grid-field__filter-header").length>0;let n;e?(n='',this.addClass("show-filter").find(".grid-field__filter-header, .grid-field__search-holder").removeClass("grid-field__search-holder--hidden"),t||this.find(":button[name=showFilter]").hide()):(n='',this.removeClass("show-filter").find(".grid-field__filter-header, .grid-field__search-holder").addClass("grid-field__search-holder--hidden")),t&&this.find(".sortable-header th:last").html(n)},keepStateInHistory:function(){const t=e(this).find(".gridfield-actionmenu__container").data("schema"),n=e(this).data("name");t&&t.length>0&&t.filter((e=>{if("link"===e.type){const t=this.buildUrlQueryString(e.url,n),a=window.location.pathname+t;window.ss.router.replace(a,void 0,void 0,!1)}}))},buildUrlQueryString:function(e,t){const n={};for(const e of window.location.search.replace(/^\?/,"").split("&")){const[a,r]=e.split("=");a.match(new RegExp(`^gridState\\-${t}\\-[0-9]$`))||(n[a]=r)}const a={},r=[window.location.origin,e].join("/"),i=new URL(r).searchParams;for(const[e,t]of i.entries())a[e]=t;const s=Object.assign(n,a),o=[];for(const e in s){if(""===e)continue;const t=encodeURIComponent(s[e]);o.push([e,t].join("="))}return 0===o.length?"":"?"+o.join("&")}}),e(".grid-field *").entwine({getGridField:function(){return this.closest(".grid-field")}}),e(".gridfield-actionmenu__container").entwine({Timer:null,Component:null,Actions:null,ReactRoot:null,onmatch(){this._super();let t=[];e(".action-menu--handled",this.parent()).each((function(){const n=e(this).detach();t.push(n)})),this.setActions(t);const n=this.closest(".cms-content").attr("id"),a=n?{context:n}:{},r=(0,o.loadComponent)("GridFieldActions",a);this.setComponent(r),this.refresh()},onunmatch(){this._super();const t=this.getReactRoot();t&&(t.unmount(),this.setReactRoot(null));const n=this.getActions(),a=this.parent();n&&e(n).each((function(){e(this).appendTo(a)}))},refresh(){const e=this.data("schema"),t=this.getComponent();let n=this.getReactRoot();n||(n=(0,s.createRoot)(this[0])),n.render(i.default.createElement(t,{schema:e})),this.setReactRoot(n)}}),e(".grid-field :button[name=showFilter]").entwine({onclick:function(e){this.closest(".grid-field").find(".grid-field__filter-header, .grid-field__search-holder").removeClass("grid-field__search-holder--hidden").find(":input:first").focus(),this.closest(".grid-field").addClass("show-filter"),this.parent().html(''),e.preventDefault()}}),e(".grid-field .ss-gridfield-item").entwine({onclick:function(t){if(t.target.classList.contains("action-menu__toggle"))return this._super(t),!1;if(e(t.target).closest(".action").length)return this._super(t),!1;var n=this.find(".edit-link, .view-link");n.length&&this.getGridField().showDetailView(n.prop("href"))},onmouseover:function(){this.find(".edit-link, .view-link").length&&this.css("cursor","pointer")},onmouseout:function(){this.css("cursor","default")}}),e(".grid-field .action.action_import:button").entwine({onclick:function(e){e.preventDefault(),this.openmodal()},onmatch:function(){this._super(),"open"===this.data("state")&&this.openmodal()},onunmatch:function(){this._super()},openmodal:function(){let t=e(this.data("target")),n=e(this.data("modal"));t.length<1?(t=n,t.appendTo(document.body)):t.innerHTML=n.innerHTML;let a=e(".modal-backdrop");function r(){a.removeClass("show"),t.removeClass("show"),setTimeout((function(){a.remove()}),150)}a.length<1&&(a=e(''),a.appendTo(document.body)),t.find("[data-dismiss]").add(".modal-backdrop").on("click",(function(){r()})),e(document).on("keydown",(function(e){27===e.keyCode&&r()})),setTimeout((function(){a.addClass("show"),t.addClass("show")}),0)}}),e(".grid-field .action:button").entwine({onclick:function(t){var n="show";let a=!0;if(this.is(":disabled"))return void t.preventDefault();!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(n="hidden"),(this.hasClass("ss-gridfield-pagination-action")||this.hasClass("grid-field__sort"))&&(a=!1);var r=[{name:this.attr("name"),value:this.val(),filter:n,triggerChange:a}],i=this.data("action-state");i&&r.push({name:"ActionState",value:JSON.stringify(i)});const s=e(this).getGridField();s.reload({data:r},(function(t,n,a){s.keepStateInHistory();const r=a.getResponseHeader("X-Message-Text"),i=a.getResponseHeader("X-Message-Type");if(r&&i){var o=e("#Form_EditForm_error");o.addClass(i),o.html(r),o.show()}})),t.preventDefault()},actionurl:function(){var t=this.closest(":button"),n=this.getGridField(),a=this.closest("form"),r=a.find(":input.gridstate").serialize(),i=a.find('input[name="SecurityID"]').val();r+="&"+encodeURIComponent(t.attr("name"))+"="+encodeURIComponent(t.val()),i&&(r+="&SecurityID="+encodeURIComponent(i));var s=this.data("action-state");s&&(r+="&ActionState="+encodeURIComponent(JSON.stringify(s))),window.location.search&&(r=window.location.search.replace(/^\?/,"")+"&"+r);var o=-1==n.data("url").indexOf("?")?"?":"&";return e.path.makeUrlAbsolute(n.data("url")+o+r,e("base").attr("href"))}}),e(".grid-field .add-existing-autocompleter").entwine({onbuttoncreate:function(){var e=this;this.toggleDisabled(),this.find('input[type="text"]').on("keyup",(function(){e.toggleDisabled()}))},onunmatch:function(){this.find('input[type="text"]').off("keyup")},toggleDisabled:function(){var e=this.find(".ss-ui-button"),t=""!==this.find('input[type="text"]').val(),n=e.is(":disabled");(t&&n||!t&&!n)&&e.attr("disabled",!n)}}),e(".grid-field .grid-field__col-compact .action--delete, .grid-field .grid-field__col-compact .action--archive, .cms-edit-form .btn-toolbar .action--delete, .cms-edit-form .btn-toolbar .action--archive, .grid-field__col-compact .gridfield-button-unlink").entwine({onclick:function(t){const n=e(this).hasClass("action--archive")?r.default._t("Admin.ARCHIVECONFIRMMESSAGE","Are you sure you want to archive this record?"):r.default._t("Admin.DELETECONFIRMMESSAGE","Are you sure you want to delete this record?");if(!confirm(n))return t.preventDefault(),!1;this._super(t);const a=e(this).hasClass("action--archive")?ss.i18n._t("Admin.ARCHIVE_CONFIRM_MESSAGE","Archived"):ss.i18n._t("Admin.DELETE_CONFIRM_MESSAGE","Deleted");e(this).hasClass("dropdown-item")&&jQuery.noticeAdd({text:a,type:"success",stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}}),e(".grid-field .grid-print-button.action:button").entwine({UUID:null,onmatch:function(){this._super(),this.setUUID((new Date).getTime())},onunmatch:function(){this._super()},onclick:function(e){var t=this.actionurl();return window.open(t),e.preventDefault(),!1}}),e(".ss-gridfield-print-iframe").entwine({onmatch:function(){this._super(),this.hide().on("load",(function(){this.focus(),(this.contentWindow||this).print()}))},onunmatch:function(){this._super()}}),e(".grid-field .action.no-ajax, .grid-field .no-ajax .action:button").entwine({onclick:function(e){return window.location.href=this.actionurl(),e.preventDefault(),!1}}),e(".grid-field .action-detail").entwine({onclick:function(){return this.getGridField().showDetailView(e(this).prop("href")),!1}}),e(".grid-field[data-selectable]").entwine({getSelectedItems:function(){return this.find(".ss-gridfield-item.ui-selected")},getSelectedIDs:function(){return e.map(this.getSelectedItems(),(function(t){return e(t).data("id")}))}}),e(".grid-field[data-selectable] .ss-gridfield-items").entwine({onadd:function(){this._super(),this.selectable()},onremove:function(){this._super(),this.data("selectable")&&this.selectable("destroy")}}),e(".js-injector-boot .grid-field .grid-field__search-holder").entwine({Component:null,ReactRoot:null,onmatch(){this._super(),this.prependTo(this.parent());const e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,o.loadComponent)("Search",t);this.setComponent(n),this.refresh()},onunmatch(){this._super();const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},close(){const t=this.data("schema"),n=[{name:t.clearAction,value:"",filter:"hidden",triggerChange:!1}];t.clearActionState&&n.push({name:"ActionState",value:t.clearActionState});const a=e(this).getGridField();a.reload({data:n},(function(){a.keepStateInHistory()}))},search(t){const n=this.data("schema"),a=[{name:n.searchAction,value:"",filter:"show",triggerChange:!1}];n.searchActionState&&a.push({name:"ActionState",value:n.searchActionState});for(const[e,r]of Object.entries(t))if(r){const t=`filter[${n.gridfield}][${e}]`;a.push({name:t,value:r})}const r=e(this).getGridField();r.reload({data:a},(function(){r.keepStateInHistory()}))},refresh(){const e=this.data("schema"),t=this.getComponent();String(e.gridfield).replace(/\-/g,".");let n=this.getReactRoot();n||(n=(0,s.createRoot)(this[0])),n.render(i.default.createElement(t,d({id:`${e.gridfield}Search`,display:"VISIBLE",displayBehavior:"HIDEABLE",filterPrefix:"Search__",onHide:()=>this.close(),onSearch:e=>this.search(e)},e))),this.setReactRoot(n)}}),e(".js-injector-boot .grid-field .search-box__content-field").entwine({onkeydown:function(e){"Enter"===e.key&&e.preventDefault()}}),e(".grid-field .grid-field__filter-header :input").entwine({onmatch:function(){var e=this.closest(".extra").find(".ss-gridfield-button-filter"),t=this.closest(".extra").find(".ss-gridfield-button-reset");this.val()&&(e.addClass("filtered"),t.addClass("filtered")),this._super()},onunmatch:function(){this._super()},onkeydown:function(t){if(!this.closest(".ss-gridfield-button-reset").length){var n=this.closest(".extra").find(".ss-gridfield-button-filter"),a=this.closest(".extra").find(".ss-gridfield-button-reset");if("13"==t.keyCode){var r=this.closest(".grid-field__filter-header").find(".ss-gridfield-button-filter"),i="show";!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(i="hidden");var s=[{name:r.attr("name"),value:r.val(),filter:i,triggerChange:!1}];r.data("action-state")&&s.push({name:"ActionState",value:JSON.stringify(r.data("action-state"))});const t=e(this).getGridField(),n=function(){t.keepStateInHistory()};return t.reload({data:s},n),!1}n.addClass("hover-alike"),a.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function(t){this.autocomplete({source:function(t,n){var a=e(this.element);e(this.element).closest("form");e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(a).data("searchUrl"),data:encodeURIComponent(a.attr("name"))+"="+encodeURIComponent(a.val()),success:n,error:function(e){alert(r.default._t("Admin.ERRORINTRANSACTION","An error occured while fetching data from the server\n Please try again later."))}})},select:function(t,n){var a=e('');a.val(n.item.id),e(this).closest(".grid-field").find(".action_gridfield_relationfind").replaceWith(a),e(this).closest(".grid-field").find(".action_gridfield_relationadd").removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function(t){if(13==t.keyCode){t.preventDefault();var n=parseInt(e(this).val(),10),a=e(this).getGridField();a.setState("GridFieldPaginator",{currentPage:n});const r=function(){a.keepStateInHistory()};return a.reload({},r),!1}}})}))},49414:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){"use strict";var _jquery=_interopRequireDefault(__webpack_require__(19755));__webpack_require__(51726);var _lodash=_interopRequireDefault(__webpack_require__(91658));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ss=void 0!==window.ss?window.ss:{};ss.editorWrappers={},ss.editorWrappers.tinyMCE=function(){var editorID;return{init:function(e){editorID=e,this.create()},destroy:function(){tinymce.EditorManager.execCommand("mceRemoveEditor",!1,editorID)},getInstance:function(){return tinymce.EditorManager.get(editorID)},onopen:function(){},onclose:function(){},setHeight:function(e,t){if(void 0!==t&&e.target&&e.target.iframeElement){e.target.iframeElement.height=""!==t?"auto":t;const n=e.target.iframeElement.closest(".tox-sidebar-wrap");n&&(n.style.height=t)}},getConfig:function(){var e="#"+editorID,t=(0,_jquery.default)(e).data("config"),n=t.row_height?t.row_height:void 0,a=this;return t.selector=e,t.setup=function(e){e.on("change",(function(){a.save()})),e.on("init",(e=>{a.setHeight(e,n)})),e.on("ResizeEditor",(e=>{a.setHeight(e,"")}))},t},save:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this.getInstance();t.save(),e.silent||((0,_jquery.default)(t.getElement()).trigger("change"),t.getElement().dispatchEvent(new Event("input",{bubbles:!0})))},create:function(){let e,t,n;function a(a){const r=a.target;!e||(new Date-e)/100>500?(n=$(r).scrollTop(),$(".mce-floatpanel").css("opacity","0")):window.clearTimeout(t),e=new Date,t=window.setTimeout((()=>function(t,n){const a=$(t).scrollTop();$(".mce-floatpanel").each(((e,t)=>{const r=parseFloat(t.style.top);$(t).css("top",r-(a-n)+"px")})),$(".mce-floatpanel").css("opacity","1"),e=void 0}(r,n)),500)}var r=this.getConfig();void 0!==r.baseURL&&(tinymce.EditorManager.baseURL=r.baseURL),r.skin=r.skin||"silverstripe",tinymce.init(r).then((e=>{if(e.length>0&&e[0].container){$(e[0].container).closest(".panel--scrollable").on("scroll",(e=>a(e)))}}))},repaint:function(){},isDirty:function(){return this.getInstance().isDirty()},getContent:function(){return this.getInstance().getContent()},getSelection:function(){return this.getInstance().selection.getSel().toString()||""},getDOM:function(){return this.getInstance().getElement()},getContainer:function(){return this.getInstance().getContainer()},getSelectedNode:function(){return this.getInstance().selection.getNode()},selectNode:function(e){this.getInstance().selection.select(e)},setContent:function(e,t){this.getInstance().setContent(e,t)},insertContent:function(e,t){this.getInstance().insertContent(e,t)},replaceContent:function(e,t){this.getInstance().execCommand("mceReplaceContent",!1,e,t)},insertLink:function(e,t,n){if(n){n=n.replaceAll("<","<").replaceAll(">",">");const t=this.getInstance().dom.create("a",e,n);this.getInstance().selection.setNode(t)}else this.getInstance().execCommand("mceInsertLink",!1,e,t)},removeLink:function(){this.getInstance().execCommand("unlink",!1)},cleanLink:function(href,node){var settings=this.getConfig,cb=settings.urlconverter_callback,cu=tinyMCE.settings.convert_urls;return cb&&(href=eval(cb+"(href, node, true);")),cu&&href.match(new RegExp("^"+(0,_lodash.default)(tinyMCE.settings.document_base_url)+"(.*)$"))&&(href=RegExp.$1),href.match(/^javascript:\s*mctmp/)&&(href=""),href},createBookmark:function(){return this.getInstance().selection.getBookmark()},moveToBookmark:function(e){this.getInstance().selection.moveToBookmark(e),this.getInstance().focus()},blur:function(){this.getInstance().selection.collapse()},addUndo:function(){this.getInstance().undoManager.add()}}},ss.editorWrappers.default=ss.editorWrappers.tinyMCE,_jquery.default.entwine("ss",(function(e){e("textarea.htmleditor").entwine({Editor:null,onadd:function(){var e=this.data("editor")||"default",t=ss.editorWrappers[e]();this.setEditor(t),t.init(this.attr("id")),this._super()},onmatch:function(){this.getEditor()||this.onadd(),this._super()},onremove:function(){this.getEditor().destroy(),this._super()},onunmatch:function(){this.getEditor()&&this.onremove(),this._super()},"from .cms-edit-form":{onbeforesubmitform:function(){this.getEditor().save({silent:!0}),this._super()}},openLinkDialog:function(){this.openDialog("link")},openMediaDialog:function(){this.openDialog("media")},openEmbedDialog:function(){this.openDialog("embed")},openDialog:function(t){if("media"===t&&window.InsertMediaModal){let t=e("#insert-media-react__dialog-wrapper");return t.length||(t=e('