@luigi-project/core-modular 0.0.3-dev.202602110053 → 0.0.3-dev.202602120048
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/luigi-engine.d.ts +1 -1
- package/luigi.js +2 -2
- package/luigi.js.map +1 -1
- package/modules/ui-module.d.ts +1 -1
- package/package.json +1 -1
- package/services/navigation.service.d.ts +20 -1
- package/services/routing.service.d.ts +2 -1
package/luigi-engine.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class LuigiEngine {
|
|
|
11
11
|
luigi: import('./core-api/luigi').Luigi;
|
|
12
12
|
init: (luigi: import('./core-api/luigi').Luigi) => void;
|
|
13
13
|
update: (scopes?: string[]) => Promise<void>;
|
|
14
|
-
updateMainContent: (currentNode: any, luigi: import('./core-api/luigi').Luigi) => Promise<void>;
|
|
14
|
+
updateMainContent: (currentNode: any, luigi: import('./core-api/luigi').Luigi, withoutSync?: boolean, preventContextUpdate?: boolean) => Promise<void>;
|
|
15
15
|
openModal: (luigi: import('./core-api/luigi').Luigi, node: any, modalSettings: import('./services/navigation.service').ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
|
16
16
|
updateModalSettings: (modalSettings: import('./services/navigation.service').ModalSettings, addHistoryEntry: boolean, luigi: import('./core-api/luigi').Luigi) => void;
|
|
17
17
|
openDrawer: (luigi: import('./core-api/luigi').Luigi, node: any, modalSettings: import('./services/navigation.service').ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
package/luigi.js
CHANGED
|
@@ -3,7 +3,7 @@ Static and dynamic nodes cannot be used together on the same level. Static node
|
|
|
3
3
|
Remove the static node from the configuration to resolve this warning.
|
|
4
4
|
Affected pathSegment:`,e,"Children:",t),t=t.filter(a=>a.pathSegment&&a.pathSegment.startsWith(":"))),s>1)){console.error(`Invalid node setup detected.
|
|
5
5
|
Multiple dynamic nodes are not allowed on the same level. Stopped navigation.
|
|
6
|
-
Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegment&&a.pathSegment.startsWith(":"))return n=a,!0}),n}buildNavItems(e,t,n){const r={},s=[];return e==null||e.forEach(a=>{var o,l,c;if(M.isNodeAccessPermitted(a,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(a.category){const f=a.category.id||a.category.label||a.category,h=this.luigi.i18n().getTranslation(a.category.label||a.category.id||a.category);let u=r[f];u||(u={category:{altText:a.category.altText||"",icon:a.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(a.category,h)}},r[f]=u,s.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:a,selected:a===t,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,altText:a.altText,icon:a.icon})}else s.push({altText:a.altText,icon:a.icon,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,node:a,selected:a===t})}),s}async shouldRedirect(e,t){var r,s;const n=t??await this.getPathData(e);if(e=="")return(r=n.rootNodes[0])==null?void 0:r.pathSegment;if(n.selectedNode&&!n.selectedNode.viewUrl&&((s=n.selectedNode.children)!=null&&s.length))return e+"/"+n.selectedNode.children[0].pathSegment}async getCurrentNode(e){var r;const t=await this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}async getPathParams(e){return(await this.getPathData(e)).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(s=>{(!t||s.tabNav)&&(s.tabNav===!1&&(n=!0),s.keepSelectedForChildren===!1?t=!0:(s.keepSelectedForChildren||s.tabNav&&!n)&&(t=!0,r=[])),r.push(s)}),r.reverse()}applyNavGroups(e){const t={},n=[],s=[];return e.forEach(a=>{if(a.node)s.push(a);else if(a.category){const o=a.category.id;o&&o.indexOf("::")>0?n.push(a):(a.category.isGroup,t[o]=a,s.push(a))}}),n.forEach(a=>{var c;const o=((c=a.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(a))}),s.filter(a=>{var o,l,c,f,h,u;if((o=a.category)!=null&&o.isGroup&&((l=a.category)!=null&&l.nodes)&&((c=a.category)==null?void 0:c.nodes.length)>0){for(let d=0;d<((f=a.category)==null?void 0:f.nodes.length);d++){const S=(h=a.category)==null?void 0:h.nodes[d];if(S.node&&!S.node.hideFromNav&&S.node.label||(u=S.category)!=null&&u.nodes&&S.category.nodes.filter(_=>{var E,R;return!((E=_.node)!=null&&E.hideFromNav)&&((R=_.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}async getLeftNavData(e,t){var S,_;const n=t??await this.getPathData(e);let r=[];const s=[];let a="";(S=n.nodesInPath)==null||S.forEach(E=>{E.children&&(E.tabNav||(a+="/"+(E.pathSegment||"")),s.push(E))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop());let f,h=c;c?n.rootNodes.includes(c)?(f=c,h=void 0):c.tabNav?f=l:f=[...s].pop():(f=[...s].pop(),h=void 0);let u=await this.getChildren(f,(f==null?void 0:f.context)||{})||[];r=this.buildNavItems(u,h,n);const d=M.buildPath(s,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:a.replace(/\/\/+/g,"/"),sideNavFooterText:(_=this.luigi.getConfig().settings)==null?void 0:_.sideNavFooterText,navClick:E=>E.node&&this.navItemClick(E.node,d)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}async getTopNavData(e,t){var h,u,d,S,_,E,R,L,U,z,G,K,J,j,k,I,$,m,te,H,O,re,g,ue,b,D,pe;const n=this.luigi.getConfig(),r=t??await this.getPathData(e),s=(d=(u=(h=n.navigation)==null?void 0:h.profile)==null?void 0:u.items)!=null&&d.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],a=((S=n.navigation)==null?void 0:S.appSwitcher)&&this.getAppSwitcherData((_=n.navigation)==null?void 0:_.appSwitcher,(E=n.settings)==null?void 0:E.header),o=M.updateHeaderTitle(a,r);s!=null&&s.length&&s.map(P=>({...P,label:this.luigi.i18n().getTranslation(P.label||"")}));const l=this.luigi.i18n().getTranslation((U=(L=(R=n.navigation)==null?void 0:R.profile)==null?void 0:L.logout)==null?void 0:U.label)||rt.logout.label,c=P=>{var Ue,Qe;if(P.openNodeInModal&&!((Ue=P.externalLink)!=null&&Ue.url))this.luigi.navigation().openAsModal(P.link||"",P.openNodeInModal===!0?{}:P.openNodeInModal);else if(P.link)this.luigi.navigation().navigate(P.link);else if((Qe=P.externalLink)!=null&&Qe.url)if(P.externalLink.sameWindow)window.location.href=P.externalLink.url;else{const tt=window.open(P.externalLink.url,"_blank","noopener noreferrer");tt&&(tt.opener=null,tt.focus())}},f={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&he.isLoggedIn(),items:s,itemClick:c,logout:{altText:this.luigi.i18n().getTranslation((K=(G=(z=n.navigation)==null?void 0:z.profile)==null?void 0:G.logout)==null?void 0:K.altText)||rt.logout.label,label:l,icon:((k=(j=(J=n.navigation)==null?void 0:J.profile)==null?void 0:j.logout)==null?void 0:k.icon)||rt.logout.icon,testId:((m=($=(I=n.navigation)==null?void 0:I.profile)==null?void 0:$.logout)==null?void 0:m.testId)||M.prepareForTests(l),doLogout:()=>{Te.logout()}},onUserInfoUpdate:P=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(Ue=>{Ue?P(Ue):Te.getUserInfoStore().subscribe(Qe=>{P(Qe)})})}};return{appTitle:o||((H=(te=n.settings)==null?void 0:te.header)==null?void 0:H.title),logo:(re=(O=n.settings)==null?void 0:O.header)==null?void 0:re.logo,topNodes:this.buildNavItems(r.rootNodes,void 0,r),productSwitcher:(g=n.navigation)==null?void 0:g.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||(ue=n.navigation)!=null&&ue.profile?f:void 0,appSwitcher:((b=n.navigation)==null?void 0:b.appSwitcher)&&this.getAppSwitcherData((D=n.navigation)==null?void 0:D.appSwitcher,(pe=n.settings)==null?void 0:pe.header),navClick:P=>P.node&&this.navItemClick(P.node,"")}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var s;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const a={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((s=n.items)==null||s.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===a.link))return n;n.items.unshift(a)}return n}async getTabNavData(e,t){var f;const n=t??await this.getPathData(e),r=n==null?void 0:n.selectedNode;let s;if(!r)return{};if(!r.tabNav&&(s=this.getParentNode(r,n),s&&!s.tabNav))return{};let a="";(f=n.nodesInPath)==null||f.forEach(h=>{h.children&&(a+="/"+(h.pathSegment||""))});const o=s?this.getTruncatedChildren(s.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:a.replace(/\/\/+/g,"/"),navClick:h=>h.node&&this.navItemClick(h.node,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");v.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=await this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}async shouldPreventNavigation(e){return!!(e!=null&&e.onNodeActivation&&(v.isFunction(e.onNodeActivation)||v.isAsyncFunction(e.onNodeActivation))&&await e.onNodeActivation(e)===!1)}async shouldPreventNavigationForPath(e){const{nodeObject:t}=await this.extractDataFromPath(e);return!!await this.shouldPreventNavigation(t)}async openViewInNewTab(e){if(await this.shouldPreventNavigationForPath(e))return;this.luigi.getConfigValue("routing.useHashRouting")&&(e="#"+e),window.open(e,"_blank","noopener,noreferrer")}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=e;return n.length&&n.forEach(r=>{r.isRootNode=!0}),n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}async handleNavigationRequest(e,t,n,r,s,a){var c;const o=e.replace(/\/\/+/g,"/"),l=!1;if(n)this.luigi.navigation().openAsModal(e,n,a);else{const f={detail:{preventContextUpdate:l,withoutSync:!!s}};if(await y.get(fe).closeModals(),r){await this.openViewInNewTab(e);return}if((c=this.luigi.getConfig().routing)!=null&&c.useHashRouting)if(!s)location.hash=o;else{const h=new CustomEvent("hashchange",f);window.history.pushState({path:"/#"+o},"","/#"+o),window.dispatchEvent(h)}else{const h=new CustomEvent("popstate",f);window.history.pushState({path:o},"",o),window.dispatchEvent(h)}}}async getChildren(e,t={}){const n=y.get(le);if(!e)return[];let r=[];if(n.hasChildren(e)){let a=n.getChildren(e);a&&(r=a.children)}else try{r=await we.getConfigValueFromObjectAsync(e,"children",t||e.context),r==null&&(r=[]),r=r.map(a=>this.getExpandStructuralPathSegment(a)).map(a=>this.bindChildToParent(a,e))||[]}catch(a){console.error("Could not lazy-load children for node",a)}let s=this.getAccessibleNodes(e,r,t);return n.setChildren(e,{children:r,filteredChildren:s}),s}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},r=(s,a)=>{const o=s.shift();let l={};return s.length?(l.pathSegment=o,a.hideFromNav&&(l.hideFromNav=a.hideFromNav),l.children=[r(s,a)]):(l=n,l.pathSegment=o),l};return r(t,e)}return e}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}}function ae(){}function Dt(i){return i()}function Et(){return Object.create(null)}function ze(i){i.forEach(Dt)}function xt(i){return typeof i=="function"}function kt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let We,ke;function vt(i,e){return i===e||(We||(We=document.createElement("a")),We.href=e,i===We.href)}function yi(i,e,t){const n=(function(r){if(!r)return document;const s=r.getRootNode?r.getRootNode():r.ownerDocument;return s&&s.host?s:r.ownerDocument})(i);if(!n.getElementById(e)){const r=Ae("style");r.id=e,r.textContent=t,(function(s,a){(function(o,l){o.appendChild(l)})(s.head||s,a),a.sheet})(n,r)}}function de(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function Ae(i){return document.createElement(i)}function Mt(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Ft(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Vt(i){Ft().$$.on_mount.push(i)}const _e=[],Me=[];let ye=[];const Ct=[],bi=Promise.resolve();let ot=!1;function lt(i){ye.push(i)}const st=new Set;let me=0;function w(){if(me!==0)return;const i=ke;do{try{for(;me<_e.length;){const e=_e[me];me++,Oe(e),Ri(e.$$)}}catch(e){throw _e.length=0,me=0,e}for(Oe(null),_e.length=0,me=0;Me.length;)Me.pop()();for(let e=0;e<ye.length;e+=1){const t=ye[e];st.has(t)||(st.add(t),t())}ye.length=0}while(_e.length);for(;Ct.length;)Ct.pop()();ot=!1,st.clear(),Oe(i)}function Ri(i){if(i.fragment!==null){i.update(),ze(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(lt)}}const Ai=new Set;function Pi(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],s=[];ye.forEach((a=>n.indexOf(a)===-1?r.push(a):s.push(a))),s.forEach((a=>a())),ye=r})(t.after_update),ze(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ii(i,e){i.$$.dirty[0]===-1&&(_e.push(i),ot||(ot=!0,bi.then(w)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Ht(i,e,t,n,r,s,a=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ae,not_equal:r,bound:Et(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Et(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};a&&a(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((d,S,..._)=>{const E=_.length?_[0]:S;return c.ctx&&r(c.ctx[d],c.ctx[d]=E)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](E),f&&Ii(i,d)),S})):[],c.update(),f=!0,ze(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const d=(function(S){return Array.from(S.childNodes)})(e.target);c.fragment&&c.fragment.l(d),d.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&(Ai.delete(h),h.i(u)),(function(d,S,_){const{fragment:E,after_update:R}=d.$$;E&&E.m(S,_),lt((()=>{const L=d.$$.on_mount.map(Dt).filter(xt);d.$$.on_destroy?d.$$.on_destroy.push(...L):ze(L),d.$$.on_mount=[]})),R.forEach(lt)})(i,e.target,e.anchor),w()}var h,u;Oe(l)}let Qt;function je(i,e,t,n){var s;const r=(s=t[i])==null?void 0:s.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function Wt(i,e,t,n,r,s){let a=class extends Qt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=je(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(a.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),s&&(a=s(a)),i.element=a,a}typeof HTMLElement=="function"&&(Qt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let o;return{c:function(){o=Ae("slot"),a!=="default"&&W(o,"name",a)},m:function(l,c){de(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(a){const o={};return a.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const a of this.$$s)a in r&&(n[a]=[t(a)]);for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=je(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||this[a]===void 0||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){const o=je(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const a in this.$$l)for(const o of this.$$l[a]){const l=this.$$c.$on(a,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=je(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Gt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Pi(this,1),this.$destroy=ae}$on(e,t){if(!xt(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var T;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(T||(T={}));class $i extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const p={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ht{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var s;const r=n||"custom";if((s=e==null?void 0:e.iframe)!=null&&s.contentWindow){const a=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},a.origin):e.iframe.contentWindow.postMessage({msg:r,...t},a.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,s){this.dispatch(e,t,n,s,r)}dispatch(e,t,n,r,s){const a=new $i(e,n,s,r);t.dispatchEvent(a)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,s,a,o,l,c,f,h;const t=this.getTargetContainer(e),n=(s=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:s.contentWindow;if(n&&n===e.source)switch(e.data.msg){case T.CUSTOM_MESSAGE:{const u=e.data.data,d=u.id;delete u.id,this.dispatch(p.CUSTOM_MESSAGE,t,{id:d,_metaData:{},data:u})}break;case T.GET_CONTEXT:n.postMessage({msg:T.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case T.NAVIGATION_REQUEST:this.dispatch(p.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:T.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case T.ALERT_REQUEST:this.dispatchWithPayload(p.ALERT_REQUEST,t,e,(o=(a=e.data)==null?void 0:a.data)==null?void 0:o.settings,(u=>{var d,S,_;t.notifyAlertClosed((_=(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.settings)==null?void 0:_.id,u)}));break;case T.INITIALIZED:this.dispatch(p.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case T.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(p.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.ADD_NODE_PARAMS_REQUEST:this.dispatch(p.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(p.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case T.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(p.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case T.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(p.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case T.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(p.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case T.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(p.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case T.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(p.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case T.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(p.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case T.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(p.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case T.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(d){console.warn(d)}this.dispatch(p.GO_BACK_REQUEST,t,u),this.dispatch(p.BACK_NAVIGATION_REQUEST,t,e)}break;case T.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(p.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,route:u}},e.origin)}));break;case T.NAVIGATION_COMPLETED_REPORT:this.dispatch(p.NAVIGATION_COMPLETED_REPORT,t,e);break;case T.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(p.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case T.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(p.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case T.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(p.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,pathExists:u}},e.origin)}));break;case T.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(p.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case T.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(p.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case T.ADD_BACKDROP_REQUEST:this.dispatch(p.ADD_BACKDROP_REQUEST,t,e);break;case T.REMOVE_BACKDROP_REQUEST:this.dispatch(p.REMOVE_BACKDROP_REQUEST,t,e);break;case T.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(p.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ht,Ee=new class{constructor(){this.updateContext=(i,e,t,n,r,s)=>{if(t){const a=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:s||{},internal:a,withoutSync:!0},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},T.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const s={...r};s.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),s.id=i,se.sendCustomMessageToIframe(n,s)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,T.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,T.ALERT_CLOSED)}},wt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Pe{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Li extends Pe{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=jt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Ni extends Pe{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let s="@media only screen ";r.minWidth!=null&&(s+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(s+=`and (max-width: ${r.maxWidth}px) `),s+=`{
|
|
6
|
+
Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegment&&a.pathSegment.startsWith(":"))return n=a,!0}),n}buildNavItems(e,t,n){const r={},s=[];return e==null||e.forEach(a=>{var o,l,c;if(M.isNodeAccessPermitted(a,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(a.category){const f=a.category.id||a.category.label||a.category,h=this.luigi.i18n().getTranslation(a.category.label||a.category.id||a.category);let u=r[f];u||(u={category:{altText:a.category.altText||"",icon:a.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(a.category,h)}},r[f]=u,s.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:a,selected:a===t,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,altText:a.altText,icon:a.icon})}else s.push({altText:a.altText,icon:a.icon,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,node:a,selected:a===t})}),s}async shouldRedirect(e,t){var r,s;const n=t??await this.getPathData(e);if(e=="")return(r=n.rootNodes[0])==null?void 0:r.pathSegment;if(n.selectedNode&&!n.selectedNode.viewUrl&&((s=n.selectedNode.children)!=null&&s.length))return e+"/"+n.selectedNode.children[0].pathSegment}async getCurrentNode(e){var r;const t=await this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}async getPathParams(e){return(await this.getPathData(e)).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(s=>{(!t||s.tabNav)&&(s.tabNav===!1&&(n=!0),s.keepSelectedForChildren===!1?t=!0:(s.keepSelectedForChildren||s.tabNav&&!n)&&(t=!0,r=[])),r.push(s)}),r.reverse()}applyNavGroups(e){const t={},n=[],s=[];return e.forEach(a=>{if(a.node)s.push(a);else if(a.category){const o=a.category.id;o&&o.indexOf("::")>0?n.push(a):(a.category.isGroup,t[o]=a,s.push(a))}}),n.forEach(a=>{var c;const o=((c=a.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(a))}),s.filter(a=>{var o,l,c,f,h,u;if((o=a.category)!=null&&o.isGroup&&((l=a.category)!=null&&l.nodes)&&((c=a.category)==null?void 0:c.nodes.length)>0){for(let d=0;d<((f=a.category)==null?void 0:f.nodes.length);d++){const S=(h=a.category)==null?void 0:h.nodes[d];if(S.node&&!S.node.hideFromNav&&S.node.label||(u=S.category)!=null&&u.nodes&&S.category.nodes.filter(_=>{var E,R;return!((E=_.node)!=null&&E.hideFromNav)&&((R=_.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}async getLeftNavData(e,t){var S,_;const n=t??await this.getPathData(e);let r=[];const s=[];let a="";(S=n.nodesInPath)==null||S.forEach(E=>{E.children&&(E.tabNav||(a+="/"+(E.pathSegment||"")),s.push(E))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop());let f,h=c;c?n.rootNodes.includes(c)?(f=c,h=void 0):c.tabNav?f=l:f=[...s].pop():(f=[...s].pop(),h=void 0);let u=await this.getChildren(f,(f==null?void 0:f.context)||{})||[];r=this.buildNavItems(u,h,n);const d=M.buildPath(s,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:a.replace(/\/\/+/g,"/"),sideNavFooterText:(_=this.luigi.getConfig().settings)==null?void 0:_.sideNavFooterText,navClick:E=>E.node&&this.navItemClick(E.node,d)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}async getTopNavData(e,t){var h,u,d,S,_,E,R,L,U,z,G,K,J,j,k,I,$,m,te,H,O,re,g,ue,b,D,pe;const n=this.luigi.getConfig(),r=t??await this.getPathData(e),s=(d=(u=(h=n.navigation)==null?void 0:h.profile)==null?void 0:u.items)!=null&&d.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],a=((S=n.navigation)==null?void 0:S.appSwitcher)&&this.getAppSwitcherData((_=n.navigation)==null?void 0:_.appSwitcher,(E=n.settings)==null?void 0:E.header),o=M.updateHeaderTitle(a,r);s!=null&&s.length&&s.map(P=>({...P,label:this.luigi.i18n().getTranslation(P.label||"")}));const l=this.luigi.i18n().getTranslation((U=(L=(R=n.navigation)==null?void 0:R.profile)==null?void 0:L.logout)==null?void 0:U.label)||rt.logout.label,c=P=>{var Ue,Qe;if(P.openNodeInModal&&!((Ue=P.externalLink)!=null&&Ue.url))this.luigi.navigation().openAsModal(P.link||"",P.openNodeInModal===!0?{}:P.openNodeInModal);else if(P.link)this.luigi.navigation().navigate(P.link);else if((Qe=P.externalLink)!=null&&Qe.url)if(P.externalLink.sameWindow)window.location.href=P.externalLink.url;else{const tt=window.open(P.externalLink.url,"_blank","noopener noreferrer");tt&&(tt.opener=null,tt.focus())}},f={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&he.isLoggedIn(),items:s,itemClick:c,logout:{altText:this.luigi.i18n().getTranslation((K=(G=(z=n.navigation)==null?void 0:z.profile)==null?void 0:G.logout)==null?void 0:K.altText)||rt.logout.label,label:l,icon:((k=(j=(J=n.navigation)==null?void 0:J.profile)==null?void 0:j.logout)==null?void 0:k.icon)||rt.logout.icon,testId:((m=($=(I=n.navigation)==null?void 0:I.profile)==null?void 0:$.logout)==null?void 0:m.testId)||M.prepareForTests(l),doLogout:()=>{Te.logout()}},onUserInfoUpdate:P=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(Ue=>{Ue?P(Ue):Te.getUserInfoStore().subscribe(Qe=>{P(Qe)})})}};return{appTitle:o||((H=(te=n.settings)==null?void 0:te.header)==null?void 0:H.title),logo:(re=(O=n.settings)==null?void 0:O.header)==null?void 0:re.logo,topNodes:this.buildNavItems(r.rootNodes,void 0,r),productSwitcher:(g=n.navigation)==null?void 0:g.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||(ue=n.navigation)!=null&&ue.profile?f:void 0,appSwitcher:((b=n.navigation)==null?void 0:b.appSwitcher)&&this.getAppSwitcherData((D=n.navigation)==null?void 0:D.appSwitcher,(pe=n.settings)==null?void 0:pe.header),navClick:P=>P.node&&this.navItemClick(P.node,"")}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var s;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const a={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((s=n.items)==null||s.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===a.link))return n;n.items.unshift(a)}return n}async getTabNavData(e,t){var f;const n=t??await this.getPathData(e),r=n==null?void 0:n.selectedNode;let s;if(!r)return{};if(!r.tabNav&&(s=this.getParentNode(r,n),s&&!s.tabNav))return{};let a="";(f=n.nodesInPath)==null||f.forEach(h=>{h.children&&(a+="/"+(h.pathSegment||""))});const o=s?this.getTruncatedChildren(s.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:a.replace(/\/\/+/g,"/"),navClick:h=>h.node&&this.navItemClick(h.node,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");v.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=await this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}async shouldPreventNavigation(e){return!!(e!=null&&e.onNodeActivation&&(v.isFunction(e.onNodeActivation)||v.isAsyncFunction(e.onNodeActivation))&&await e.onNodeActivation(e)===!1)}async shouldPreventNavigationForPath(e){const{nodeObject:t}=await this.extractDataFromPath(e);return!!await this.shouldPreventNavigation(t)}async openViewInNewTab(e){if(await this.shouldPreventNavigationForPath(e))return;this.luigi.getConfigValue("routing.useHashRouting")&&(e="#"+e),window.open(e,"_blank","noopener,noreferrer")}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=e;return n.length&&n.forEach(r=>{r.isRootNode=!0}),n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}async handleNavigationRequest(e,t){var f;const{path:n,preserveView:r,modalSettings:s,newTab:a,withoutSync:o,preventContextUpdate:l}=e,c=n.replace(/\/\/+/g,"/");if(s)this.luigi.navigation().openAsModal(n,s,t);else{const h={detail:{preventContextUpdate:!!l,withoutSync:!!o}};if(await y.get(fe).closeModals(),a){await this.openViewInNewTab(n);return}if((f=this.luigi.getConfig().routing)!=null&&f.useHashRouting)if(!o)location.hash=c;else{const u=new CustomEvent("hashchange",h);window.history.pushState({path:"/#"+c},"","/#"+c),window.dispatchEvent(u)}else{const u=new CustomEvent("popstate",h);window.history.pushState({path:c},"",c),window.dispatchEvent(u)}}}async getChildren(e,t={}){const n=y.get(le);if(!e)return[];let r=[];if(n.hasChildren(e)){let a=n.getChildren(e);a&&(r=a.children)}else try{r=await we.getConfigValueFromObjectAsync(e,"children",t||e.context),r==null&&(r=[]),r=r.map(a=>this.getExpandStructuralPathSegment(a)).map(a=>this.bindChildToParent(a,e))||[]}catch(a){console.error("Could not lazy-load children for node",a)}let s=this.getAccessibleNodes(e,r,t);return n.setChildren(e,{children:r,filteredChildren:s}),s}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},r=(s,a)=>{const o=s.shift();let l={};return s.length?(l.pathSegment=o,a.hideFromNav&&(l.hideFromNav=a.hideFromNav),l.children=[r(s,a)]):(l=n,l.pathSegment=o),l};return r(t,e)}return e}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}}function ae(){}function Dt(i){return i()}function Et(){return Object.create(null)}function ze(i){i.forEach(Dt)}function xt(i){return typeof i=="function"}function kt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let We,ke;function vt(i,e){return i===e||(We||(We=document.createElement("a")),We.href=e,i===We.href)}function yi(i,e,t){const n=(function(r){if(!r)return document;const s=r.getRootNode?r.getRootNode():r.ownerDocument;return s&&s.host?s:r.ownerDocument})(i);if(!n.getElementById(e)){const r=Ae("style");r.id=e,r.textContent=t,(function(s,a){(function(o,l){o.appendChild(l)})(s.head||s,a),a.sheet})(n,r)}}function de(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function Ae(i){return document.createElement(i)}function Mt(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Ft(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Vt(i){Ft().$$.on_mount.push(i)}const _e=[],Me=[];let ye=[];const Ct=[],bi=Promise.resolve();let ot=!1;function lt(i){ye.push(i)}const st=new Set;let me=0;function w(){if(me!==0)return;const i=ke;do{try{for(;me<_e.length;){const e=_e[me];me++,Oe(e),Ri(e.$$)}}catch(e){throw _e.length=0,me=0,e}for(Oe(null),_e.length=0,me=0;Me.length;)Me.pop()();for(let e=0;e<ye.length;e+=1){const t=ye[e];st.has(t)||(st.add(t),t())}ye.length=0}while(_e.length);for(;Ct.length;)Ct.pop()();ot=!1,st.clear(),Oe(i)}function Ri(i){if(i.fragment!==null){i.update(),ze(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(lt)}}const Ai=new Set;function Pi(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],s=[];ye.forEach((a=>n.indexOf(a)===-1?r.push(a):s.push(a))),s.forEach((a=>a())),ye=r})(t.after_update),ze(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ii(i,e){i.$$.dirty[0]===-1&&(_e.push(i),ot||(ot=!0,bi.then(w)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Ht(i,e,t,n,r,s,a=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ae,not_equal:r,bound:Et(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Et(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};a&&a(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((d,S,..._)=>{const E=_.length?_[0]:S;return c.ctx&&r(c.ctx[d],c.ctx[d]=E)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](E),f&&Ii(i,d)),S})):[],c.update(),f=!0,ze(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const d=(function(S){return Array.from(S.childNodes)})(e.target);c.fragment&&c.fragment.l(d),d.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&(Ai.delete(h),h.i(u)),(function(d,S,_){const{fragment:E,after_update:R}=d.$$;E&&E.m(S,_),lt((()=>{const L=d.$$.on_mount.map(Dt).filter(xt);d.$$.on_destroy?d.$$.on_destroy.push(...L):ze(L),d.$$.on_mount=[]})),R.forEach(lt)})(i,e.target,e.anchor),w()}var h,u;Oe(l)}let Qt;function je(i,e,t,n){var s;const r=(s=t[i])==null?void 0:s.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function Wt(i,e,t,n,r,s){let a=class extends Qt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=je(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(a.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),s&&(a=s(a)),i.element=a,a}typeof HTMLElement=="function"&&(Qt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let o;return{c:function(){o=Ae("slot"),a!=="default"&&W(o,"name",a)},m:function(l,c){de(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(a){const o={};return a.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const a of this.$$s)a in r&&(n[a]=[t(a)]);for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=je(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||this[a]===void 0||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){const o=je(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const a in this.$$l)for(const o of this.$$l[a]){const l=this.$$c.$on(a,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=je(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Gt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Pi(this,1),this.$destroy=ae}$on(e,t){if(!xt(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var T;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(T||(T={}));class $i extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const p={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ht{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var s;const r=n||"custom";if((s=e==null?void 0:e.iframe)!=null&&s.contentWindow){const a=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},a.origin):e.iframe.contentWindow.postMessage({msg:r,...t},a.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,s){this.dispatch(e,t,n,s,r)}dispatch(e,t,n,r,s){const a=new $i(e,n,s,r);t.dispatchEvent(a)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,s,a,o,l,c,f,h;const t=this.getTargetContainer(e),n=(s=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:s.contentWindow;if(n&&n===e.source)switch(e.data.msg){case T.CUSTOM_MESSAGE:{const u=e.data.data,d=u.id;delete u.id,this.dispatch(p.CUSTOM_MESSAGE,t,{id:d,_metaData:{},data:u})}break;case T.GET_CONTEXT:n.postMessage({msg:T.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case T.NAVIGATION_REQUEST:this.dispatch(p.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:T.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case T.ALERT_REQUEST:this.dispatchWithPayload(p.ALERT_REQUEST,t,e,(o=(a=e.data)==null?void 0:a.data)==null?void 0:o.settings,(u=>{var d,S,_;t.notifyAlertClosed((_=(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.settings)==null?void 0:_.id,u)}));break;case T.INITIALIZED:this.dispatch(p.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case T.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(p.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.ADD_NODE_PARAMS_REQUEST:this.dispatch(p.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(p.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case T.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(p.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case T.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(p.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case T.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(p.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case T.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(p.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case T.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(p.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case T.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(p.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case T.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(p.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case T.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(d){console.warn(d)}this.dispatch(p.GO_BACK_REQUEST,t,u),this.dispatch(p.BACK_NAVIGATION_REQUEST,t,e)}break;case T.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(p.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,route:u}},e.origin)}));break;case T.NAVIGATION_COMPLETED_REPORT:this.dispatch(p.NAVIGATION_COMPLETED_REPORT,t,e);break;case T.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(p.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case T.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(p.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case T.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(p.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,pathExists:u}},e.origin)}));break;case T.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(p.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case T.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(p.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case T.ADD_BACKDROP_REQUEST:this.dispatch(p.ADD_BACKDROP_REQUEST,t,e);break;case T.REMOVE_BACKDROP_REQUEST:this.dispatch(p.REMOVE_BACKDROP_REQUEST,t,e);break;case T.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(p.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ht,Ee=new class{constructor(){this.updateContext=(i,e,t,n,r,s)=>{if(t){const a=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:s||{},internal:a,withoutSync:!0},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},T.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const s={...r};s.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),s.id=i,se.sendCustomMessageToIframe(n,s)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,T.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,T.ALERT_CLOSED)}},wt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Pe{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Li extends Pe{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=jt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Ni extends Pe{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let s="@media only screen ";r.minWidth!=null&&(s+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(s+=`and (max-width: ${r.maxWidth}px) `),s+=`{
|
|
7
7
|
.${e} {
|
|
8
8
|
grid-template-columns: ${r.columns||"auto"};
|
|
9
9
|
grid-template-rows: ${r.rows||"auto"};
|
|
@@ -30,5 +30,5 @@ Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegme
|
|
|
30
30
|
|
|
31
31
|
main.lui-isolated {
|
|
32
32
|
line-height: 0;
|
|
33
|
-
}`,t=Mt(" "),n=Ae("iframe"),vt(n.src,r=i[3])||W(n,"src",r),W(n,"title",i[1]),W(n,"allow",s=wt(i[0])),W(n,"sandbox",a=i[2]?i[2].join(" "):void 0)},m(o,l){de(o,e,l),de(o,t,l),de(o,n,l),i[28](n)},p(o,l){8&l[0]&&!vt(n.src,r=o[3])&&W(n,"src",r),2&l[0]&&W(n,"title",o[1]),1&l[0]&&s!==(s=wt(o[0]))&&W(n,"allow",s),4&l[0]&&a!==(a=o[2]?o[2].join(" "):void 0)&&W(n,"sandbox",a)},d(o){o&&(oe(e),oe(t),oe(n)),i[28](null)}}}function Ui(i){let e,t,n=i[5]&&bt(i);return{c(){e=Ae("main"),n&&n.c(),W(e,"class",t=i[4]?void 0:"lui-isolated")},m(r,s){de(r,e,s),n&&n.m(e,null),i[29](e)},p(r,s){r[5]?n?n.p(r,s):(n=bt(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null),16&s[0]&&t!==(t=r[4]?void 0:"lui-isolated")&&W(e,"class",t)},i:ae,o:ae,d(r){r&&oe(e),n&&n.d(),i[29](null)}}}function Oi(i,e,t){let{activeFeatureToggleList:n}=e,{allowRules:r}=e,{anchor:s}=e,{authData:a}=e,{clientPermissions:o}=e,{context:l}=e,{deferInit:c}=e,{dirtyStatus:f}=e,{documentTitle:h}=e,{hasBack:u}=e,{label:d}=e,{locale:S}=e,{noShadow:_}=e,{nodeParams:E}=e,{pathParams:R}=e,{sandboxRules:L}=e,{searchParams:U}=e,{skipCookieCheck:z}=e,{skipInitCheck:G}=e,{theme:K}=e,{userSettings:J}=e,{viewurl:j}=e,{webcomponent:k}=e;const I={};let $,m,te=!1;const H=new Bt,O=g=>{if(!te){g.sendCustomMessage=(b,D)=>{Ee.sendCustomMessage(b,g.getNoShadow()?g:$,!!k,I,D)},g.updateContext=(b,D)=>{if(t(8,l=b),k)(g.getNoShadow()?g:$)._luigi_mfe_webcomponent.context=b;else{const pe={...D||{},activeFeatureToggleList:g.activeFeatureToggleList||[],currentLocale:g.locale,currentTheme:g.theme,userSettings:g.userSettings||null,cssVariables:g.cssVariables||{},anchor:g.anchor||"",drawer:g.drawer||!1,modal:g.modal||!1,viewStackSize:g.viewStackSize||0,isNavigateBack:g.isNavigateBack||!1};Ee.updateContext(b,pe,I,E,R,U)}},g.closeAlert=(b,D)=>{g.notifyAlertClosed(b,D)},g.notifyAlertClosed=(b,D)=>{g.isConnected&&(k?H.resolveAlert(b,D):Ee.notifyAlertClosed(b,D,I))},g.notifyConfirmationModalClosed=b=>{g.isConnected&&(k?H.notifyConfirmationModalClosed(!!b):Ee.notifyConfirmationModalClosed(!!b,I))},se.registerContainer(g),H.thisComponent=g;const ue=De.resolveContext(l);if(g.updateViewUrl=(b,D)=>{b!=null&&b.length&&Ee.updateViewUrl(b,De.resolveContext(l),D,I)},k&&k!="false"){g.getNoShadow()?g.innerHTML="":(t(7,$.innerHTML="",$),g.attachShadow({mode:"open"}).append($));const b=De.checkWebcomponentValue(k);H.renderWebComponent(j,g.getNoShadow()?g:$,ue,typeof b=="object"?{webcomponent:b}:{})}else g.getNoShadow()||(g.innerHTML="",g.attachShadow({mode:"open"}).append($));G?(g.initialized=!0,setTimeout((()=>{H.dispatchLuigiEvent(p.INITIALIZED,{})}))):k&&(g.getNoShadow()?g:$).addEventListener("wc_ready",(()=>{var b;(b=(g.getNoShadow()?g:$)._luigi_mfe_webcomponent)!=null&&b.deferLuigiClientWCInit||(g.initialized=!0,H.dispatchLuigiEvent(p.INITIALIZED,{}))})),t(5,te=!0),g.containerInitialized=!0}};var re;return Vt((async()=>{t(27,m=$.parentNode),t(27,m.iframeHandle=I,m),t(27,m.init=()=>{O(m)},m),!c&&j&&O(m)})),re=async()=>{},Ft().$$.on_destroy.push(re),i.$$set=g=>{"activeFeatureToggleList"in g&&t(9,n=g.activeFeatureToggleList),"allowRules"in g&&t(0,r=g.allowRules),"anchor"in g&&t(10,s=g.anchor),"authData"in g&&t(11,a=g.authData),"clientPermissions"in g&&t(12,o=g.clientPermissions),"context"in g&&t(8,l=g.context),"deferInit"in g&&t(13,c=g.deferInit),"dirtyStatus"in g&&t(14,f=g.dirtyStatus),"documentTitle"in g&&t(15,h=g.documentTitle),"hasBack"in g&&t(16,u=g.hasBack),"label"in g&&t(1,d=g.label),"locale"in g&&t(17,S=g.locale),"noShadow"in g&&t(18,_=g.noShadow),"nodeParams"in g&&t(19,E=g.nodeParams),"pathParams"in g&&t(20,R=g.pathParams),"sandboxRules"in g&&t(2,L=g.sandboxRules),"searchParams"in g&&t(21,U=g.searchParams),"skipCookieCheck"in g&&t(22,z=g.skipCookieCheck),"skipInitCheck"in g&&t(23,G=g.skipInitCheck),"theme"in g&&t(24,K=g.theme),"userSettings"in g&&t(25,J=g.userSettings),"viewurl"in g&&t(3,j=g.viewurl),"webcomponent"in g&&t(4,k=g.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!te&&j&&!c&&m&&O(m)},[r,d,L,j,k,te,I,$,l,n,s,a,o,c,f,h,u,S,_,E,R,U,z,G,K,J,()=>n&&r&&s&&a&&o&&f&&h&&u&&S&&_&&E&&R&&L&&U&&z&&G&&K&&J,m,function(g){Me[g?"unshift":"push"]((()=>{I.iframe=g,t(6,I)}))},function(g){Me[g?"unshift":"push"]((()=>{$=g,t(7,$)}))}]}class qt extends Gt{constructor(e){super(),Ht(this,e,Oi,Ui,kt,{activeFeatureToggleList:9,allowRules:0,anchor:10,authData:11,clientPermissions:12,context:8,deferInit:13,dirtyStatus:14,documentTitle:15,hasBack:16,label:1,locale:17,noShadow:18,nodeParams:19,pathParams:20,sandboxRules:2,searchParams:21,skipCookieCheck:22,skipInitCheck:23,theme:24,userSettings:25,viewurl:3,webcomponent:4,unwarn:26},null,[-1,-1])}get activeFeatureToggleList(){return this.$$.ctx[9]}set activeFeatureToggleList(e){this.$$set({activeFeatureToggleList:e}),w()}get allowRules(){return this.$$.ctx[0]}set allowRules(e){this.$$set({allowRules:e}),w()}get anchor(){return this.$$.ctx[10]}set anchor(e){this.$$set({anchor:e}),w()}get authData(){return this.$$.ctx[11]}set authData(e){this.$$set({authData:e}),w()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get context(){return this.$$.ctx[8]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[13]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[16]}set hasBack(e){this.$$set({hasBack:e}),w()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),w()}get locale(){return this.$$.ctx[17]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[18]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[20]}set pathParams(e){this.$$set({pathParams:e}),w()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(e){this.$$set({sandboxRules:e}),w()}get searchParams(){return this.$$.ctx[21]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(e){this.$$set({skipCookieCheck:e}),w()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[24]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[25]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[3]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[26]}}function Di(i){yi(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function xi(i){let e;return{c(){e=Ae("main"),W(e,"class","svelte-1buc46y")},m(t,n){de(t,e,n),i[21](e)},p:ae,i:ae,o:ae,d(t){t&&oe(e),i[21](null)}}}function ki(i,e,t){let n,r,{activeFeatureToggleList:s}=e,{anchor:a}=e,{clientPermissions:o}=e,{compoundConfig:l}=e,{context:c}=e,{deferInit:f}=e,{dirtyStatus:h}=e,{documentTitle:u}=e,{hasBack:d}=e,{locale:S}=e,{noShadow:_}=e,{nodeParams:E}=e,{pathParams:R}=e,{searchParams:L}=e,{skipInitCheck:U}=e,{theme:z}=e,{userSettings:G}=e,{viewurl:K}=e,{webcomponent:J}=e,j=!1;const k=new ht,I=new Bt,$=m=>{if(!l||j)return;m.updateContext=(O,re)=>{const g=m.getNoShadow()?m:n;g._luigi_mfe_webcomponent.context=O,t(1,c=O);const ue=g._luigi_mfe_webcomponent;if(ue){const b=ue.querySelectorAll("[lui_web_component]");b==null||b.forEach((D=>{const pe=D.context||{};D.context=Object.assign(pe,O)}))}};const te=De.resolveContext(c);t(2,f=!1),m.notifyAlertClosed=(O,re)=>{m.isConnected&&I.resolveAlert(O,re)},m.notifyConfirmationModalClosed=O=>{m.isConnected&&I.notifyConfirmationModalClosed(!!O)};const H={compound:l,viewUrl:K,webcomponent:De.checkWebcomponentValue(J)||!0};m.getNoShadow()?m.innerHTML="":(t(0,n.innerHTML="",n),m.attachShadow({mode:"open"}).append(n)),I.renderWebComponentCompound(H,m.getNoShadow()?m:n,te).then((O=>{r=O,U||!H.viewUrl?(m.initialized=!0,setTimeout((()=>{I.dispatchLuigiEvent(p.INITIALIZED,{})}))):r.LuigiClient&&!r.deferLuigiClientWCInit&&(m.initialized=!0,I.dispatchLuigiEvent(p.INITIALIZED,{}))})),j=!0,m.containerInitialized=!0};return Vt((async()=>{const m=n.getRootNode()===document?n.parentNode:n.getRootNode().host;m.init=()=>{$(m)},f||$(m),k.registerContainer(m),I.thisComponent=m})),i.$$set=m=>{"activeFeatureToggleList"in m&&t(3,s=m.activeFeatureToggleList),"anchor"in m&&t(4,a=m.anchor),"clientPermissions"in m&&t(5,o=m.clientPermissions),"compoundConfig"in m&&t(6,l=m.compoundConfig),"context"in m&&t(1,c=m.context),"deferInit"in m&&t(2,f=m.deferInit),"dirtyStatus"in m&&t(7,h=m.dirtyStatus),"documentTitle"in m&&t(8,u=m.documentTitle),"hasBack"in m&&t(9,d=m.hasBack),"locale"in m&&t(10,S=m.locale),"noShadow"in m&&t(11,_=m.noShadow),"nodeParams"in m&&t(12,E=m.nodeParams),"pathParams"in m&&t(13,R=m.pathParams),"searchParams"in m&&t(14,L=m.searchParams),"skipInitCheck"in m&&t(15,U=m.skipInitCheck),"theme"in m&&t(16,z=m.theme),"userSettings"in m&&t(17,G=m.userSettings),"viewurl"in m&&t(18,K=m.viewurl),"webcomponent"in m&&t(19,J=m.webcomponent)},[n,c,f,s,a,o,l,h,u,d,S,_,E,R,L,U,z,G,K,J,()=>s&&a&&o&&h&&u&&d&&S&&_&&E&&R&&L&&U&&z&&G,function(m){Me[m?"unshift":"push"]((()=>{n=m,t(0,n)}))}]}Wt(qt,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},allowRules:{type:"Array",reflect:!1,attribute:"allow-rules"},anchor:{type:"String",reflect:!1,attribute:"anchor"},authData:{type:"Object",reflect:!1,attribute:"auth-data"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},label:{type:"String",reflect:!1,attribute:"label"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},sandboxRules:{type:"Array",reflect:!1,attribute:"sandbox-rules"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipCookieCheck:{type:"String",reflect:!1,attribute:"skip-cookie-check"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"sendCustomMessage",e("sendCustomMessage"));A(this,"updateContext",e("updateContext"));A(this,"updateViewUrl",e("updateViewUrl"));A(this,"closeAlert",e("closeAlert"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,s){try{super.attributeChangedCallback(n,r,s)}catch(a){console.error("Error in super.attributeChangedCallback",a)}this.containerInitialized&&(n==="context"&&this.updateContext(JSON.parse(s)),n==="auth-data"&&Ee.updateAuthData(this.iframeHandle,JSON.parse(s)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class At extends Gt{constructor(e){super(),Ht(this,e,ki,xi,kt,{activeFeatureToggleList:3,anchor:4,clientPermissions:5,compoundConfig:6,context:1,deferInit:2,dirtyStatus:7,documentTitle:8,hasBack:9,locale:10,noShadow:11,nodeParams:12,pathParams:13,searchParams:14,skipInitCheck:15,theme:16,userSettings:17,viewurl:18,webcomponent:19,unwarn:20},Di)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(e){this.$$set({activeFeatureToggleList:e}),w()}get anchor(){return this.$$.ctx[4]}set anchor(e){this.$$set({anchor:e}),w()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(e){this.$$set({compoundConfig:e}),w()}get context(){return this.$$.ctx[1]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[2]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[9]}set hasBack(e){this.$$set({hasBack:e}),w()}get locale(){return this.$$.ctx[10]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[11]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[13]}set pathParams(e){this.$$set({pathParams:e}),w()}get searchParams(){return this.$$.ctx[14]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[16]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[17]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[18]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[20]}}Wt(At,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},anchor:{type:"String",reflect:!1,attribute:"anchor"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow",reflect:!1},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"updateContext",e("updateContext"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,s){try{super.attributeChangedCallback(n,r,s)}catch(a){console.warn("Error in attributeChangedCallback",a)}this.containerInitialized&&n==="context"&&this.updateContext(JSON.parse(s))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",qt.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",At.element);class Ie{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(e){this.decorators=this.decorators.filter(t=>t.uid!==e.uid).concat(e)}applyDecorators(e,t){if(!e)return e;const n=new URL(v.prependOrigin(e)),r=this.decorators.filter(s=>s.type==="queryString");for(let s=0;s<r.length;s++){const a=r[s];n.searchParams.has(a.key)&&n.searchParams.delete(a.key);const o=a.valueFn();n.searchParams.append(a.key,o)}return t&&(n.search=decodeURIComponent(n.search)),n.href}}const at=async(i,e)=>{const t=await e.readUserSettings(),r=i.userSettingsGroup&&typeof t=="object"&&t!==null?t[i.userSettingsGroup]:null;if(i.webcomponent&&!C.checkWCUrl(i.viewUrl,e))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const s=document.createElement("luigi-compound-container");return s.setAttribute("lui_container","true"),s.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),s.webcomponent=i.webcomponent,s.compoundConfig=i.compound,s.context=i.context,s.clientPermissions=i.clientPermissions,s.nodeParams=i.nodeParams,s.pathParams=i.pathParams,s.userSettingsGroup=i.userSettingsGroup,s.userSettings=r,s.searchParams=i.searchParams,s.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),s.locale=e.i18n().getCurrentLocale(),s.theme=e.theming().getCurrentTheme(),s.viewGroup=i.viewGroup,e.getEngine()._comm.addListeners(s,e),s}else{const s=document.createElement("luigi-container");return s.setAttribute("lui_container","true"),s.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),s.webcomponent=i.webcomponent,s.context=i.context,s.clientPermissions=i.clientPermissions,s.cssVariables=await e.theming().getCSSVariables(),s.nodeParams=i.nodeParams,s.pathParams=i.pathParams,s.userSettingsGroup=i.userSettingsGroup,s.userSettings=r,s.searchParams=i.searchParams,s.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),s.locale=e.i18n().getCurrentLocale(),s.theme=e.theming().getCurrentTheme(),s.viewGroup=i.viewGroup,zt(s,e),Kt(s,e),e.getEngine()._comm.addListeners(s,e),s}},zt=(i,e)=>{const t=e.getConfigValue("settings.customSandboxRules");if(!(t!=null&&t.length))return;const n=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],r=t?[...new Set([...n,...t])]:n;i.sandboxRules=r},Kt=(i,e)=>{const t=e.getConfigValue("settings.allowRules");t!=null&&t.length&&(t.forEach((n,r)=>{t[r]=n+(n.indexOf(";")!=-1?"":";")}),i.allowRules=t)},x={navService:void 0,routingService:void 0,luigi:void 0,init:i=>{var e;console.log("Init UI..."),x.navService=y.get(ce),x.routingService=y.get(ge),x.luigi=i,(e=i.getEngine()._connector)==null||e.renderMainLayout()},update:async i=>{var n,r,s;const e=x.routingService.getCurrentRoute();if(!e)return;const t=!i||i.length===0;(t||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&((n=x.luigi.getEngine()._connector)==null||n.renderTopNav(await x.navService.getTopNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(y.get(le).deleteCache(),(r=x.luigi.getEngine()._connector)==null||r.renderLeftNav(await x.navService.getLeftNavData(e.path)),(s=x.luigi.getEngine()._connector)==null||s.renderTabNav(await x.navService.getTabNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(y.get(le).deleteCache(),x.updateMainContent(e.node,x.luigi))},updateMainContent:async(i,e)=>{var a,o,l;const t=await e.readUserSettings(),r=i.userSettingsGroup&&typeof t=="object"&&t!==null?t[i.userSettingsGroup]:null,s=(a=e.getEngine()._connector)==null?void 0:a.getContainerWrapper();if((o=e.getEngine()._connector)==null||o.hideLoadingIndicator(s),i&&s){let c;if([...s.childNodes].forEach(f=>{var h;((h=f.tagName)==null?void 0:h.indexOf("LUIGI-"))===0&&(f.viewGroup?i.viewGroup===f.viewGroup?c=f:f.style.display="none":f.remove())}),c)c.style.display="block",c.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),c.nodeParams=i.nodeParams,c.pathParams=i.pathParams,c.clientPermissions=i.clientPermissions,c.searchParams=C.prepareSearchParamsForClient(i,e),c.locale=e.i18n().getCurrentLocale(),c.theme=e.theming().getCurrentTheme(),c.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),c.userSettingsGroup=i.userSettingsGroup,c.userSettings=r,zt(c,e),Kt(c,e),c.updateContext(i.context||{});else{const f=await at(i,e);s==null||s.appendChild(f);const h=e.getEngine()._connector;((l=i.loadingIndicator)==null?void 0:l.enabled)!==!1&&(h==null||h.showLoadingIndicator(s))}}},openModal:async(i,e,t,n)=>{var S,_;const r=await at(e,i),s=y.get(ge),a=y.get(fe);let o=!1,l,c;const h=new Promise(E=>{l=()=>{o||(o=!0,E(),a.removeLastModalFromStack())},c=()=>{l&&l(),i.getConfigValue("routing.showModalPathInUrl")&&a.getModalStackLength()===0&&s.removeModalDataFromUrl(!0)},r.addEventListener(p.CLOSE_CURRENT_MODAL_REQUEST,c)}),u={closePromise:h,resolveFn:l,onCloseRequestHandler:c,onInternalClose:()=>{try{u.resolveFn&&u.resolveFn()}catch(E){console.warn("onInternalClose failed",E)}},modalsettings:t};a.registerModal(u),(S=i.getEngine()._connector)==null||S.renderModal(r,t,()=>{n==null||n(),a.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&a.getModalStackLength()===0&&s.removeModalDataFromUrl(!0)},()=>h);const d=i.getEngine()._connector;((_=e.loadingIndicator)==null?void 0:_.enabled)!==!1&&(d==null||d.showLoadingIndicator(r.parentElement))},updateModalSettings:(i,e,t)=>{var a;const n=y.get(fe);if(n.getModalStackLength()===0)return;n.updateFirstModalSettings(i);const r=y.get(ge),s=C.getModalPathFromPath(t);s&&r.updateModalDataInUrl(s,n.getModalSettings(),e),(a=t.getEngine()._connector)==null||a.updateModalSettings(n.getModalSettings())},openDrawer:async(i,e,t,n)=>{var a,o;const r=await at(e,i);(a=i.getEngine()._connector)==null||a.renderDrawer(r,t,n);const s=i.getEngine()._connector;((o=e.loadingIndicator)==null?void 0:o.enabled)!==!1&&(s==null||s.showLoadingIndicator(r.parentElement))}};class ge{constructor(e){this.luigi=e}getNavigationService(){return this.navigationService||(this.navigationService=y.get(ce)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const e=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||e).filter(n=>location.href.match(n)).length!==0}enableRouting(){var t;const e=this.luigi.getConfig();console.log("Init Routing...",e.routing),(t=e.routing)!=null&&t.useHashRouting?(window.addEventListener("hashchange",n=>{var s;const r=!!((s=n==null?void 0:n.detail)!=null&&s.withoutSync);this.handleRouteChange(C.getCurrentPath(!0),r)}),this.handleRouteChange(C.getCurrentPath(!0))):(window.addEventListener("popstate",n=>{var s;const r=!!((s=n==null?void 0:n.detail)!=null&&s.withoutSync);this.handleRouteChange(C.getCurrentPath(),r)}),this.handleRouteChange(C.getCurrentPath()))}async handleRouteChange(e,t=!1){var u,d,S;const n=e.path,r=e.query,s=n+(r?"?"+r:""),a=new URLSearchParams(r),o={};if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(s),await this.shouldShowModalPathInUrl(e),a.forEach((_,E)=>{o[E]=_}),this.checkInvalidateCache(this.previousPathData,n);const l=await this.getNavigationService().getPathData(n);this.previousPathData=l;const c=C.filterNodeParams(o,this.luigi),f=await this.getNavigationService().shouldRedirect(n,l);if(f){this.luigi.navigation().navigate(f);return}this.currentRoute={raw:window.location.href,path:n,nodeParams:c},(u=this.luigi.getEngine()._connector)==null||u.renderTopNav(await this.getNavigationService().getTopNavData(n,l)),(d=this.luigi.getEngine()._connector)==null||d.renderLeftNav(await this.getNavigationService().getLeftNavData(n,l)),(S=this.luigi.getEngine()._connector)==null||S.renderTabNav(await this.getNavigationService().getTabNavData(n,l));const h=(l==null?void 0:l.selectedNode)??await this.getNavigationService().getCurrentNode(n);h&&(this.currentRoute.node=h,h.nodeParams=c||{},h.pathParams=(l==null?void 0:l.pathParams)||{},h.searchParams=C.prepareSearchParamsForClient(h,this.luigi),this.getNavigationService().onNodeChange(this.previousNode,h),this.previousNode=h,t||x.updateMainContent(h,this.luigi))}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(e){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(e)}async handleBookmarkableModalPath(e){var o;const t=y.get(ce),n=y.get(fe),r=new URLSearchParams((e==null?void 0:e.query)||""),s=C.getModalViewParamName(this.luigi),a=r.get(s);if(a){const l=r.get(`${s}Params`);try{const c=JSON.parse(l||"{}"),{nodeObject:f}=await t.extractDataFromPath(a);document.querySelector(".lui-modal luigi-container")?(o=this.luigi.getEngine()._connector)==null||o.updateModalSettings(c):this.luigi.navigation().openAsModal(a,c||f.openNodeInModal)}catch(c){console.error("Error parsing modal settings from URL parameters",c)}}else{n.closeModals();return}}appendModalDataToUrl(e,t){const n=C.getHashQueryParamSeparator(),r=C.getQueryParams(this.luigi),s=C.getModalViewParamName(this.luigi),a=r[s],o=new URL(location.href),l=this.luigi.getConfigValue("routing.useHashRouting");let c=history.state,f,h;if(l){let[u,d]=o.hash.split("?");f=u,h=C.getURLWithoutModalData(d,s),h&&(f+="?"+h)}else f=o.pathname,h=C.getURLWithoutModalData(o.search,s),h&&(f+="?"+C.getURLWithoutModalData(o.search,s));if(c=C.handleHistoryState(c,f),a!==e){if(r[s]=e,t&&Object.keys(t).length&&(r[`${s}Params`]=JSON.stringify(t)),l){const u=location.hash.indexOf(n);u!==-1&&(o.hash=o.hash.slice(0,u)),o.hash=`${o.hash}${n}${C.encodeParams(r)}`}else o.search=`?${C.encodeParams(r)}`;history.pushState(c,"",o.href)}else{const u=new URL(o);if(l){let d=u.hash.split("?")[0];u.hash=d,h&&(u.hash+="?"+h)}else u.search=h;history.replaceState({},"",u.href),history.pushState(c,"",o.href)}}removeModalDataFromUrl(e){const t=C.getQueryParams(this.luigi),n=C.getModalViewParamName(this.luigi);let r=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let a={};t[n]&&(a[n]=t[n]),t[`${n}Params`]&&(a[`${n}Params`]=t[`${n}Params`]);let o=C.encodeParams(a);r.hash.includes(`?${o}`)?r.hash=r.hash.replace(`?${o}`,""):r.hash.includes(`&${o}`)&&(r.hash=r.hash.replace(`&${o}`,""))}else{let a=new URLSearchParams(r.search.slice(1));a.delete(n),a.delete(`${n}Params`);let o="";Array.from(a.keys()).forEach(l=>{o+=(o===""?"?":"&")+l+"="+a.get(l)}),r.search=o}if(history.state&&history.state.modalHistoryLength>=0&&e){history.state.modalHistoryLength;const a=history.state.pathBeforeHistory;let o=!1;if(window.addEventListener("popstate",l=>{o?(history.replaceState({},"",a),history.pushState({},"",a),history.back()):(history.pushState({},"",a),history.back())},{once:!0}),history.state.historygap===history.length-history.state.modalHistoryLength)history.go(-history.state.modalHistoryLength);else if(history.state.modalHistoryLength>history.length){const l=history.length-1;o=!0,history.go(-l),window.Luigi.preventLoadingModalData=!0}else{const l=history.state.modalHistoryLength;history.go(-l)}}else history.pushState({},"",r.href)}setFeatureToggle(e){const t=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),n=this.luigi.featureToggles();t&&typeof e=="string"&&C.setFeatureToggles(t,e,n)}updateModalDataInUrl(e,t,n){let r=C.getHashQueryParamSeparator();const s=C.getQueryParams(this.luigi),a=C.getModalViewParamName(this.luigi);s[a]=e,t&&Object.keys(t).length&&(s[`${a}Params`]=JSON.stringify(t));const o=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const c=location.hash.indexOf(r);c!==-1&&(o.hash=o.hash.slice(0,c)),o.hash=`${o.hash}${r}${C.encodeParams(s)}`}else o.search=`?${C.encodeParams(s)}`;n?history.pushState(window.state,"",o.href):history.replaceState(window.state,"",o.href)}checkInvalidateCache(e,t){if(!e)return;const n=y.get(le);let r=t.split("/");if(e.nodesInPath&&e.nodesInPath.length>0){let s=e.nodesInPath.slice(1),a=!0;for(let o=0;o<s.length;o++){let l=r.length>o?r[o]:void 0,c=s[o];if(l!==c.pathSegment||!a)if(C.isDynamicNode(c)){if(!a||l!==C.getDynamicNodeValue(c,e.pathParams)){n.deleteNodesRecursively(c);break}}else a=!1}}else n.deleteCache()}}class Mi{constructor(e){var t;this.hashRouting=!1,this.navigate=async(n,r,s,a,o)=>{this.navService.handleNavigationRequest(n,r,s,!1,!1,void 0)},this.openAsModal=async(n,r,s)=>{r.keepPrevious||await this.modalService.closeModals();const a=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(a),l=r||{};l.title||(l.title=o.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(a,l),this.luigi.getEngine()._ui.openModal(this.luigi,o,l,s)},this.openAsDrawer=async(n,r,s)=>{const a=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(a),l=r||{};l.title||(l.title=o.label),this.luigi.getEngine()._ui.openDrawer(this.luigi,o,l,s)},this.runTimeErrorHandler=async n=>{var o,l,c;const{path:r}=C.getCurrentPath((o=this.luigi.getConfig().routing)==null?void 0:o.useHashRouting),s=await this.navService.getCurrentNode(r),a=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");(l=s==null?void 0:s.runTimeErrorHandler)!=null&&l.errorFn&&v.isFunction((c=s==null?void 0:s.runTimeErrorHandler)==null?void 0:c.errorFn)?s.runTimeErrorHandler.errorFn(n,s):a!=null&&a.errorFn&&v.isFunction(a.errorFn)&&a.errorFn(n,s)},this.luigi=e,this.hashRouting=(t=e.getConfig().routing)==null?void 0:t.useHashRouting,this.navService=y.get(ce),this.routingService=y.get(ge),this.modalService=y.get(fe)}}class Fi{constructor(e){this.luigi=e}addSearchParams(e,t=!1){if(!v.isObject(e)){console.log("Params argument must be an object");return}const n=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?n.hash=C.addParamsOnHashRouting(e,n.hash):C.modifySearchParams(e,n.searchParams),this.handleBrowserHistory(t,n),this.luigi.configChanged()}getSearchParams(){const e={},t=["__proto__","constructor","prototype"],n=new URL(location.href);let r;if(this.luigi.getConfigValue("routing.useHashRouting")){const s=n.hash.split("?")[1];r=s?new URLSearchParams(s).entries():[]}else r=n.searchParams.entries();for(const[s,a]of r){if(t.some(o=>s===o)){console.warn(`Blocked because of potentially dangerous query param: ${s}`);continue}e[s]=a}return e}handleBrowserHistory(e,t){const n=this.sanitizeUrl(t.href);if(!n){console.warn("invalid url: "+n);return}e?window.history.pushState({},"",n):window.history.replaceState({},"",n)}sanitizeUrl(e){return new URL(location.href).origin===new URL(e).origin?e:void 0}addNodeParams(e,t){if(!v.isObject(e)){console.log("Params argument must be an object");return}const n=C.getContentViewParamPrefix(this.luigi),r=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?r.hash=C.addParamsOnHashRouting(e,r.hash,n):C.modifySearchParams(e,r.searchParams,n),this.handleBrowserHistory(t,r),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}var V,Re;class Vi{constructor(e){it(this,V);it(this,Re,"");nt(this,V,e)}async getAvailableThemes(){return await Q(this,V).getConfigValueAsync("settings.theming.themes")}setCurrentTheme(e){nt(this,Re,e),Q(this,V).__cssVars=void 0}async getThemeObject(e){const t=await this.getAvailableThemes();return t==null?void 0:t.find(n=>n.id===e)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(Q(this,Re))return Q(this,Re);const e=Q(this,V).getConfigValue("settings.theming");return e.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",e),e.defaultTheme}isThemingAvailable(){return!!Q(this,V).getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const e=Q(this,V).getConfigValue("settings.theming.variables.file");if(e)try{const t=await fetch(e);window.Luigi.__cssVars=(await t.json()).root,Object.keys(window.Luigi.__cssVars).forEach(n=>{const r=getComputedStyle(document.documentElement).getPropertyValue("--"+n);r&&(window.Luigi.__cssVars[n]=r)})}catch(t){v.isFunction(Q(this,V).getConfigValue("settings.theming.variables.errorHandling"))?Q(this,V).getConfigValue("settings.theming.variables.errorHandling")(t):console.error("CSS variables file error: ",t)}else Q(this,V).getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(t=>{window.Luigi.__cssVars[t]=getComputedStyle(document.documentElement).getPropertyValue("--"+t)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const e=y.get(Ie);(()=>{const n=Q(this,V).getConfigValue("settings.theming");n&&n.nodeViewURLDecorator&&n.nodeViewURLDecorator.queryStringParameter&&e.add({type:"queryString",uid:"theming",key:n.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const r=this.getCurrentTheme(),s=n.nodeViewURLDecorator.queryStringParameter.value;return s?s(r):r}}),n&&n.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}V=new WeakMap,Re=new WeakMap;class Ke{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(e,t){var n,r;if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const s=new Set;s.add(t),this.unsavedChanges={dirtySet:s}}this.unsavedChanges.persistUrl=window.location.href,e?(n=this.unsavedChanges.dirtySet)==null||n.add(t):(r=this.unsavedChanges.dirtySet)==null||r.delete(t)}clearDirtyState(e){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(e?this.unsavedChanges.dirtySet.delete(e):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let Pt;const N={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),N.luigi=i,N.documentTitle=Be(void 0),Pt=y.get(Ke)},processAlert:(i,e,t)=>{var r;if(!N.luigi)throw new Error("Luigi is not initialized.");const n={openFromClient:e,close:()=>{i.id&&t.notifyAlertClosed(i.id)},link:s=>{var a;if(i.links){const o=i.links[s];if(o&&(o.url&&((a=N.luigi)==null||a.navigation().navigate(o.url)),o.dismissKey&&i.id))return t.notifyAlertClosed(i.id,o.dismissKey),!0}return!1}};(r=N.luigi.getEngine()._connector)==null||r.renderAlert(i,n)},handleConfirmationModalRequest:(i,e)=>{var t;if(!N.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:N.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:N.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:N.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:N.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),(t=N.luigi.getEngine()._connector)==null||t.renderConfirmationModal(i,{confirm(){e.notifyConfirmationModalClosed(!0)},dismiss(){e.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,e)=>{if(!N.luigi)throw new Error("Luigi is not initialized.");Pt.updateDirtyStatus(i,e)}};class Hi{processUserSettingGroups(e,t){var o;const n=[],r=e==null?void 0:e.userSettingGroups,s=(o=t==null?void 0:t.userSettings)==null?void 0:o.userSettingGroups,a=r||s;if(v.isObject(a)){for(const l in a){const c={};c[l]=a[l],n.push(c)}return n}return n}getUserSettingsIframesInDom(){const e=document.querySelector(".iframeUserSettingsCtn");return e?[...e.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(e=>{e.style.display="none"})}findActiveCustomUserSettingsIframe(e){const t=document.querySelectorAll("[userSettingsGroup]");for(let n=0;n<t.length;n++)if(t[n].contentWindow===e)return t[n];return null}}const Qi=new Hi;class Wi{constructor(e){this.dirtyStatusService=y.get(Ke),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=t=>new Promise(n=>{var s;t.id||(t.id=v.getRandomId().toString());const r={openFromClient:!1,close:()=>{n(!0)},link:a=>{var o;if(t.links){const l=t.links[a];if(l&&(l.url&&((o=this.luigi)==null||o.navigation().navigate(l.url)),l.dismissKey))return n(l.dismissKey),!0}return!1}};(s=this.luigi.getEngine()._connector)==null||s.renderAlert(t,r)}),this.showConfirmationModal=t=>(t&&(t={...t,header:this.luigi.i18n().getTranslation(t.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(t.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(t.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(t.buttonConfirm||"luigi.button.confirm")}),new Promise((n,r)=>{var s;(s=this.luigi.getEngine()._connector)==null||s.renderConfirmationModal(t,{confirm(){n(!0)},dismiss(){r()}})})),this.processUserSettingGroups=()=>{const t=this.luigi.getConfigValue("userSettings"),n=this.luigi.getConfigValue("settings");return Qi.processUserSettingGroups(t,n)},this.openUserSettings=t=>{var n;(n=this.luigi.getEngine()._connector)==null||n.openUserSettings(t)},this.closeUserSettings=()=>{var t;(t=this.luigi.getEngine()._connector)==null||t.closeUserSettings()},this.setDocumentTitle=t=>{var n,r,s;(r=(n=this.luigi.getEngine()._ux)==null?void 0:n.documentTitle)==null||r.set(t),(s=this.luigi.getEngine()._connector)==null||s.setDocumentTitle(t)},this.getDocumentTitle=()=>{var t;return Ot((t=this.luigi.getEngine()._ux)==null?void 0:t.documentTitle)||window.document.title||""},this.hideAppLoadingIndicator=()=>{const t=document.querySelector(this.appLoadingIndicatorSelector);t&&(t.classList.add("hidden"),setTimeout(()=>{var n;(n=t.parentNode)==null||n.removeChild(t)},500))},this.showLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.showLoadingIndicator(t)},this.hideLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.hideLoadingIndicator(t)},this.addBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.addBackdrop()},this.removeBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.removeBackdrop()},this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=e}}class Gi{constructor(e){this.engine=e,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=t=>{this.config=t,this.setConfigCallback(this.getConfigReadyCallback()),Te.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,Ci.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...t)=>{this.getEngine()._ui.update(t)},this.i18n=()=>(this._i18n||(this._i18n=new vi(this)),this._i18n),this.navigation=()=>new Mi(this),this.ux=()=>new Wi(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new wi),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new Fi(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new Vi(this)),this._theming),this.auth=()=>ve,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(e){return v.getConfigValueFromObject(this.getConfig(),e)}getConfigValueAsync(e,...t){return we.getConfigValueFromObjectAsync(this.getConfig(),e,t)}clearNavigationCache(){y.get(le).deleteCache()}async readUserSettings(){const e=await this.getConfigValueAsync("userSettings"),t=e||await this.getConfigValueAsync("settings.userSettings");if(t&&v.isFunction(t.readUserSettings))return t.readUserSettings();const n=localStorage.getItem(this.USER_SETTINGS_KEY);return n&&JSON.parse(n)}async storeUserSettings(e,t){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&v.isFunction(r.storeUserSettings))return r.storeUserSettings(e,t);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(e)),this.configChanged()}createConfigStore(){const e=Be({}),t={};let n=[];return{subscribe:r=>{n.push(e.subscribe(r))},reset:r=>{e.update(r)},subscribeToScope:(r,s)=>{let a=t[s];a||(a=new Set,t[s]=a),a.add(r)},fire:(r,s)=>{const a=t[r];a&&[...a].forEach(o=>{o(s)})},clear:()=>{n.forEach(r=>{r()}),n=[]}}}getConfigReadyCallback(){return new Promise(e=>{this.i18n()._init(),e()})}setConfigCallback(e){this.configReadyCallback=e}}const ji=!1;var Bi=Array.isArray,qi=Array.from,zi=Object.defineProperty,It=Object.getOwnPropertyDescriptor;const dt=2,Jt=4,Xt=8,Ki=16,Ve=32,Ye=64,Ze=128,Je=256,ne=512,Yt=1024,gt=2048,Zt=4096,et=8192,Ji=16384,Xi=1<<18,Yi=1<<19;function Zi(i){return i===this.v}function en(){throw new Error("effect_update_depth_exceeded")}function tn(i){return{f:0,v:i,reactions:null,equals:Zi,version:0}}var $t,ei;function nn(){if($t===void 0){$t=window;var i=Element.prototype,e=Node.prototype;It(e,"firstChild").get,ei=It(e,"nextSibling").get,i.__click=void 0,i.__className="",i.__attributes=null,i.__styles=null,i.__e=void 0,Text.prototype.__t=void 0}}function rn(i=""){return document.createTextNode(i)}function sn(i){return ei.call(i)}function ti(i){var e=i.children;if(e!==null){i.children=null;for(var t=0;t<e.length;t+=1){var n=e[t];(n.f&dt)!==0?ii(n):He(n)}}}function an(i){var e,t=ie;Le(i.parent);try{ti(i),e=li(i)}finally{Le(t)}return e}function on(i){var e=an(i),t=(Ce||(i.f&Ze)!==0)&&i.deps!==null?gt:ne;Ne(i,t),i.equals(e)||(i.v=e,i.version=gn())}function ii(i){ti(i),Fe(i,0),Ne(i,et),i.v=i.children=i.deps=i.ctx=i.reactions=null}function ln(i,e){var t=e.last;t===null?e.last=e.first=i:(t.next=i,i.prev=t,e.last=i)}function ft(i,e,t,n=!0){var r=(i&Ye)!==0,s=ie,a={ctx:ee,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:i|Yt,first:null,fn:e,last:null,next:null,parent:r?null:s,prev:null,teardown:null,transitions:null,version:0};if(t){var o=be;try{Lt(!0),mt(a),a.f|=Ji}catch(f){throw He(a),f}finally{Lt(o)}}else e!==null&&vn(a);var l=t&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&Yi)===0;if(!l&&!r&&n&&(s!==null&&ln(a,s),Z!==null&&(Z.f&dt)!==0)){var c=Z;(c.children??(c.children=[])).push(a)}return a}function cn(i){const e=ft(Ye,i,!0);return()=>{He(e)}}function un(i){return ft(Jt,i,!1)}function hn(i,e=!0){return ft(Xt|Ve,i,!0,e)}function ni(i){var e=i.teardown;if(e!==null){const t=Z;$e(null);try{e.call(null)}finally{$e(t)}}}function ri(i){var e=i.deriveds;if(e!==null){i.deriveds=null;for(var t=0;t<e.length;t+=1)ii(e[t])}}function si(i,e=!1){var t=i.first;for(i.first=i.last=null;t!==null;){var n=t.next;He(t,e),t=n}}function dn(i){for(var e=i.first;e!==null;){var t=e.next;(e.f&Ve)===0&&He(e),e=t}}function He(i,e=!0){var t=!1;if((e||(i.f&Xi)!==0)&&i.nodes_start!==null){for(var n=i.nodes_start,r=i.nodes_end;n!==null;){var s=n===r?null:sn(n);n.remove(),n=s}t=!0}ri(i),si(i,e&&!t),Fe(i,0),Ne(i,et);var a=i.transitions;if(a!==null)for(const l of a)l.stop();ni(i);var o=i.parent;o!==null&&o.first!==null&&ai(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.parent=i.fn=i.nodes_start=i.nodes_end=null}function ai(i){var e=i.parent,t=i.prev,n=i.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===i&&(e.first=n),e.last===i&&(e.last=t))}let Xe=!1,be=!1;function Lt(i){be=i}let ct=[],xe=0;let Z=null;function $e(i){Z=i}let ie=null;function Le(i){ie=i}let X=null,B=0,oi=0,Ce=!1,ee=null;function gn(){return++oi}function pt(i){var a,o;var e=i.f;if((e&Yt)!==0)return!0;if((e>)!==0){var t=i.deps,n=(e&Ze)!==0;if(t!==null){var r;if((e&Je)!==0){for(r=0;r<t.length;r++)((a=t[r]).reactions??(a.reactions=[])).push(i);i.f^=Je}for(r=0;r<t.length;r++){var s=t[r];if(pt(s)&&on(s),n&&ie!==null&&!Ce&&!((o=s==null?void 0:s.reactions)!=null&&o.includes(i))&&(s.reactions??(s.reactions=[])).push(i),s.version>i.version)return!0}}n||Ne(i,ne)}return!1}function fn(i,e,t){throw i}function li(i){var f;var e=X,t=B,n=Z,r=Ce,s=ee,a=i.f;X=null,B=0,Z=(a&(Ve|Ye))===0?i:null,Ce=!be&&(a&Ze)!==0,ee=i.ctx;try{var o=(0,i.fn)(),l=i.deps;if(X!==null){var c;if(Fe(i,B),l!==null&&B>0)for(l.length=B+X.length,c=0;c<X.length;c++)l[B+c]=X[c];else i.deps=l=X;if(!Ce)for(c=B;c<l.length;c++)((f=l[c]).reactions??(f.reactions=[])).push(i)}else l!==null&&B<l.length&&(Fe(i,B),l.length=B);return o}finally{X=e,B=t,Z=n,Ce=r,ee=s}}function pn(i,e){let t=e.reactions;if(t!==null){var n=t.indexOf(i);if(n!==-1){var r=t.length-1;r===0?t=e.reactions=null:(t[n]=t[r],t.pop())}}t===null&&(e.f&dt)!==0&&(X===null||!X.includes(e))&&(Ne(e,gt),(e.f&(Ze|Je))===0&&(e.f^=Je),Fe(e,0))}function Fe(i,e){var t=i.deps;if(t!==null)for(var n=e;n<t.length;n++)pn(i,t[n])}function mt(i){var e=i.f;if((e&et)===0){Ne(i,ne);var t=ie;ie=i;try{ri(i),(e&Ki)!==0?dn(i):si(i),ni(i);var n=li(i);i.teardown=typeof n=="function"?n:null,i.version=oi}catch(r){fn(r)}finally{ie=t}}}function mn(){xe>1e3&&(xe=0,en()),xe++}function Sn(i){var e=i.length;if(e!==0){mn();var t=be;be=!0;try{for(var n=0;n<e;n++){var r=i[n];(r.f&ne)===0&&(r.f^=ne);var s=[];ci(r,s),_n(s)}}finally{be=t}}}function _n(i){var e=i.length;if(e!==0)for(var t=0;t<e;t++){var n=i[t];(n.f&(et|Zt))===0&&pt(n)&&(mt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?ai(n):n.fn=null))}}function En(){if(Xe=!1,xe>1001)return;const i=ct;ct=[],Sn(i),Xe||(xe=0)}function vn(i){Xe||(Xe=!0,queueMicrotask(En));for(var e=i;e.parent!==null;){e=e.parent;var t=e.f;if((t&(Ye|Ve))!==0){if((t&ne)===0)return;e.f^=ne}}ct.push(e)}function ci(i,e){var t=i.first,n=[];e:for(;t!==null;){var r=t.f,s=(r&Ve)!==0,a=s&&(r&ne)!==0;if(!a&&(r&Zt)===0)if((r&Xt)!==0){s?t.f^=ne:pt(t)&&mt(t);var o=t.first;if(o!==null){t=o;continue}}else(r&Jt)!==0&&n.push(t);var l=t.next;if(l===null){let h=t.parent;for(;h!==null;){if(i===h)break e;var c=h.next;if(c!==null){t=c;continue e}h=h.parent}}t=l}for(var f=0;f<n.length;f++)o=n[f],e.push(o),ci(o,e)}const Cn=-3585;function Ne(i,e){i.f=i.f&Cn|e}function wn(i,e=!1,t){ee={p:ee,c:null,e:null,m:!1,s:i,x:null,l:null},e||(ee.l={s:null,u:null,r1:[],r2:tn(!1)})}function Tn(i){const e=ee;if(e!==null){const a=e.e;if(a!==null){var t=ie,n=Z;e.e=null;try{for(var r=0;r<a.length;r++){var s=a[r];Le(s.effect),$e(s.reaction),un(s.fn)}}finally{Le(t),$e(n)}}ee=e.p,e.m=!0}return{}}const yn=new Set,Nt=new Set;function Ge(i){var L;var e=this,t=e.ownerDocument,n=i.type,r=((L=i.composedPath)==null?void 0:L.call(i))||[],s=r[0]||i.target,a=0,o=i.__root;if(o){var l=r.indexOf(o);if(l!==-1&&(e===document||e===window)){i.__root=e;return}var c=r.indexOf(e);if(c===-1)return;l<=c&&(a=l)}if(s=r[a]||i.target,s!==e){zi(i,"currentTarget",{configurable:!0,get(){return s||t}});var f=Z,h=ie;$e(null),Le(null);try{for(var u,d=[];s!==null;){var S=s.assignedSlot||s.parentNode||s.host||null;try{var _=s["__"+n];if(_!==void 0&&!s.disabled)if(Bi(_)){var[E,...R]=_;E.apply(s,[i,...R])}else _.call(s,i)}catch(U){u?d.push(U):u=U}if(i.cancelBubble||S===e||S===null)break;s=S}if(u){for(let U of d)queueMicrotask(()=>{throw U});throw u}}finally{i.__root=e,delete i.currentTarget,$e(f),Le(h)}}}const bn=["touchstart","touchmove"];function Rn(i){return bn.includes(i)}function An(i,e){return Pn(i,e)}const Se=new Map;function Pn(i,{target:e,anchor:t,props:n={},events:r,context:s,intro:a=!0}){nn();var o=new Set,l=h=>{for(var u=0;u<h.length;u++){var d=h[u];if(!o.has(d)){o.add(d);var S=Rn(d);e.addEventListener(d,Ge,{passive:S});var _=Se.get(d);_===void 0?(document.addEventListener(d,Ge,{passive:S}),Se.set(d,1)):Se.set(d,_+1)}}};l(qi(yn)),Nt.add(l);var c=void 0,f=cn(()=>{var h=t??e.appendChild(rn());return hn(()=>{if(s){wn({});var u=ee;u.c=s}r&&(n.$$events=r),c=i(h,n)||{},s&&Tn()}),()=>{var S;for(var u of o){e.removeEventListener(u,Ge);var d=Se.get(u);--d===0?(document.removeEventListener(u,Ge),Se.delete(u)):Se.set(u,d)}Nt.delete(l),Ut.delete(c),h!==t&&((S=h.parentNode)==null||S.removeChild(h))}});return Ut.set(c,f),c}let Ut=new WeakMap;const In="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(In);function $n(i){}const ut={init:i=>{y.get(ge).enableRouting()},handlePageErrorHandler:(i,e,t)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)e.viewUrl=i.viewUrl,t.getEngine()._ui.updateMainContent(e,t);else if(i.errorFn)i.errorFn(e);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const n=i.redirectPath||"/";t.navigation().navigate(n)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const t=window.open(i.url,"_blank","noopener noreferrer");t&&(t.opener=null,t.focus())}},async addSearchParamsFromClient(i,e,t){var o;const n=y.get(ce),r=C.getCurrentPath(),s=await n.getCurrentNode(r.path),a={...i};if((o=s==null?void 0:s.clientPermissions)!=null&&o.urlParameters){const l={};Object.keys(s.clientPermissions.urlParameters).forEach(c=>{c in a&&s.clientPermissions.urlParameters[c].write===!0&&(l[c]=a[c],delete a[c])});for(const c in a)console.warn(`No permission to add the search param "${c}" to the url`);Object.keys(l).length>0&&t.routing().addSearchParams(l,e)}}},Y={luigi:{},init:i=>{console.log("Init communication..."),Y.luigi=i},addListeners:(i,e)=>{i.addEventListener(p.INITIALIZED,t=>{var n;(n=N.luigi)==null||n.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(p.NAVIGATION_REQUEST,t=>{const{link:n,preserveView:r,modal:s,newTab:a,withoutSync:o}=t.detail;y.get(ce).handleNavigationRequest(n,r,s,a,o,t.callbackFn)}),i.addEventListener(p.RUNTIME_ERROR_HANDLING_REQUEST,t=>{var n,r;e.navigation().runTimeErrorHandler(((r=(n=t.payload)==null?void 0:n.data)==null?void 0:r.errorObj)||{})}),i.addEventListener(p.ALERT_REQUEST,t=>{N.processAlert(t.payload,!0,i)}),i.addEventListener(p.SHOW_CONFIRMATION_MODAL_REQUEST,t=>{N.handleConfirmationModalRequest(t.payload,i)}),i.addEventListener(p.SET_DOCUMENT_TITLE_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.setDocumentTitle(t.detail.title)}),i.addEventListener(p.SHOW_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.showLoadingIndicator(i.parentNode)}),i.addEventListener(p.HIDE_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.hideLoadingIndicator(i.parentNode)}),i.addEventListener(p.ADD_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.addBackdrop()}),i.addEventListener(p.REMOVE_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.removeBackdrop()}),i.addEventListener(p.SET_DIRTY_STATUS_REQUEST,t=>{var n,r,s;N.handleDirtyStatusRequest((r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.dirty,(s=t.detail)==null?void 0:s.source)}),i.addEventListener(p.ADD_NODE_PARAMS_REQUEST,t=>{e.routing().addNodeParams(t.payload.data,t.payload.keepBrowserHistory)}),i.addEventListener(p.OPEN_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.openUserSettings(t.detail)}),i.addEventListener(p.CLOSE_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.closeUserSettings()}),i.addEventListener(p.ADD_SEARCH_PARAMS_REQUEST,t=>{ut.addSearchParamsFromClient(t.detail.data,t.detail.keepBrowserHistory,e)}),i.addEventListener(p.UPDATE_MODAL_SETTINGS_REQUEST,t=>{x.updateModalSettings(t.payload.updatedModalSettings,t.payload.addHistoryEntry,e)}),i.addEventListener(p.SET_CURRENT_LOCALE_REQUEST,t=>{var n,r,s;e.i18n().setCurrentLocale((s=(r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.data)==null?void 0:s.currentLocale,i)})}};class Ln{constructor(){this._ui=x,this._comm=Y,this._ux=N,this._routing=ut}bootstrap(e){this._app=An($n,{target:document.body}),this._connector=e}init(){const e=window.Luigi;y.register(Ke,()=>new Ke),y.register(ce,()=>new ce(e)),y.register(le,()=>new le),y.register(ge,()=>new ge(e)),y.register(Ie,()=>new Ie),y.register(fe,()=>new fe(e)),e.theming()._init(),x.init(e),ut.init(e),Y.init(e),N.init(e)}}window.Luigi=new Gi(new Ln);
|
|
33
|
+
}`,t=Mt(" "),n=Ae("iframe"),vt(n.src,r=i[3])||W(n,"src",r),W(n,"title",i[1]),W(n,"allow",s=wt(i[0])),W(n,"sandbox",a=i[2]?i[2].join(" "):void 0)},m(o,l){de(o,e,l),de(o,t,l),de(o,n,l),i[28](n)},p(o,l){8&l[0]&&!vt(n.src,r=o[3])&&W(n,"src",r),2&l[0]&&W(n,"title",o[1]),1&l[0]&&s!==(s=wt(o[0]))&&W(n,"allow",s),4&l[0]&&a!==(a=o[2]?o[2].join(" "):void 0)&&W(n,"sandbox",a)},d(o){o&&(oe(e),oe(t),oe(n)),i[28](null)}}}function Ui(i){let e,t,n=i[5]&&bt(i);return{c(){e=Ae("main"),n&&n.c(),W(e,"class",t=i[4]?void 0:"lui-isolated")},m(r,s){de(r,e,s),n&&n.m(e,null),i[29](e)},p(r,s){r[5]?n?n.p(r,s):(n=bt(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null),16&s[0]&&t!==(t=r[4]?void 0:"lui-isolated")&&W(e,"class",t)},i:ae,o:ae,d(r){r&&oe(e),n&&n.d(),i[29](null)}}}function Oi(i,e,t){let{activeFeatureToggleList:n}=e,{allowRules:r}=e,{anchor:s}=e,{authData:a}=e,{clientPermissions:o}=e,{context:l}=e,{deferInit:c}=e,{dirtyStatus:f}=e,{documentTitle:h}=e,{hasBack:u}=e,{label:d}=e,{locale:S}=e,{noShadow:_}=e,{nodeParams:E}=e,{pathParams:R}=e,{sandboxRules:L}=e,{searchParams:U}=e,{skipCookieCheck:z}=e,{skipInitCheck:G}=e,{theme:K}=e,{userSettings:J}=e,{viewurl:j}=e,{webcomponent:k}=e;const I={};let $,m,te=!1;const H=new Bt,O=g=>{if(!te){g.sendCustomMessage=(b,D)=>{Ee.sendCustomMessage(b,g.getNoShadow()?g:$,!!k,I,D)},g.updateContext=(b,D)=>{if(t(8,l=b),k)(g.getNoShadow()?g:$)._luigi_mfe_webcomponent.context=b;else{const pe={...D||{},activeFeatureToggleList:g.activeFeatureToggleList||[],currentLocale:g.locale,currentTheme:g.theme,userSettings:g.userSettings||null,cssVariables:g.cssVariables||{},anchor:g.anchor||"",drawer:g.drawer||!1,modal:g.modal||!1,viewStackSize:g.viewStackSize||0,isNavigateBack:g.isNavigateBack||!1};Ee.updateContext(b,pe,I,E,R,U)}},g.closeAlert=(b,D)=>{g.notifyAlertClosed(b,D)},g.notifyAlertClosed=(b,D)=>{g.isConnected&&(k?H.resolveAlert(b,D):Ee.notifyAlertClosed(b,D,I))},g.notifyConfirmationModalClosed=b=>{g.isConnected&&(k?H.notifyConfirmationModalClosed(!!b):Ee.notifyConfirmationModalClosed(!!b,I))},se.registerContainer(g),H.thisComponent=g;const ue=De.resolveContext(l);if(g.updateViewUrl=(b,D)=>{b!=null&&b.length&&Ee.updateViewUrl(b,De.resolveContext(l),D,I)},k&&k!="false"){g.getNoShadow()?g.innerHTML="":(t(7,$.innerHTML="",$),g.attachShadow({mode:"open"}).append($));const b=De.checkWebcomponentValue(k);H.renderWebComponent(j,g.getNoShadow()?g:$,ue,typeof b=="object"?{webcomponent:b}:{})}else g.getNoShadow()||(g.innerHTML="",g.attachShadow({mode:"open"}).append($));G?(g.initialized=!0,setTimeout((()=>{H.dispatchLuigiEvent(p.INITIALIZED,{})}))):k&&(g.getNoShadow()?g:$).addEventListener("wc_ready",(()=>{var b;(b=(g.getNoShadow()?g:$)._luigi_mfe_webcomponent)!=null&&b.deferLuigiClientWCInit||(g.initialized=!0,H.dispatchLuigiEvent(p.INITIALIZED,{}))})),t(5,te=!0),g.containerInitialized=!0}};var re;return Vt((async()=>{t(27,m=$.parentNode),t(27,m.iframeHandle=I,m),t(27,m.init=()=>{O(m)},m),!c&&j&&O(m)})),re=async()=>{},Ft().$$.on_destroy.push(re),i.$$set=g=>{"activeFeatureToggleList"in g&&t(9,n=g.activeFeatureToggleList),"allowRules"in g&&t(0,r=g.allowRules),"anchor"in g&&t(10,s=g.anchor),"authData"in g&&t(11,a=g.authData),"clientPermissions"in g&&t(12,o=g.clientPermissions),"context"in g&&t(8,l=g.context),"deferInit"in g&&t(13,c=g.deferInit),"dirtyStatus"in g&&t(14,f=g.dirtyStatus),"documentTitle"in g&&t(15,h=g.documentTitle),"hasBack"in g&&t(16,u=g.hasBack),"label"in g&&t(1,d=g.label),"locale"in g&&t(17,S=g.locale),"noShadow"in g&&t(18,_=g.noShadow),"nodeParams"in g&&t(19,E=g.nodeParams),"pathParams"in g&&t(20,R=g.pathParams),"sandboxRules"in g&&t(2,L=g.sandboxRules),"searchParams"in g&&t(21,U=g.searchParams),"skipCookieCheck"in g&&t(22,z=g.skipCookieCheck),"skipInitCheck"in g&&t(23,G=g.skipInitCheck),"theme"in g&&t(24,K=g.theme),"userSettings"in g&&t(25,J=g.userSettings),"viewurl"in g&&t(3,j=g.viewurl),"webcomponent"in g&&t(4,k=g.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!te&&j&&!c&&m&&O(m)},[r,d,L,j,k,te,I,$,l,n,s,a,o,c,f,h,u,S,_,E,R,U,z,G,K,J,()=>n&&r&&s&&a&&o&&f&&h&&u&&S&&_&&E&&R&&L&&U&&z&&G&&K&&J,m,function(g){Me[g?"unshift":"push"]((()=>{I.iframe=g,t(6,I)}))},function(g){Me[g?"unshift":"push"]((()=>{$=g,t(7,$)}))}]}class qt extends Gt{constructor(e){super(),Ht(this,e,Oi,Ui,kt,{activeFeatureToggleList:9,allowRules:0,anchor:10,authData:11,clientPermissions:12,context:8,deferInit:13,dirtyStatus:14,documentTitle:15,hasBack:16,label:1,locale:17,noShadow:18,nodeParams:19,pathParams:20,sandboxRules:2,searchParams:21,skipCookieCheck:22,skipInitCheck:23,theme:24,userSettings:25,viewurl:3,webcomponent:4,unwarn:26},null,[-1,-1])}get activeFeatureToggleList(){return this.$$.ctx[9]}set activeFeatureToggleList(e){this.$$set({activeFeatureToggleList:e}),w()}get allowRules(){return this.$$.ctx[0]}set allowRules(e){this.$$set({allowRules:e}),w()}get anchor(){return this.$$.ctx[10]}set anchor(e){this.$$set({anchor:e}),w()}get authData(){return this.$$.ctx[11]}set authData(e){this.$$set({authData:e}),w()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get context(){return this.$$.ctx[8]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[13]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[16]}set hasBack(e){this.$$set({hasBack:e}),w()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),w()}get locale(){return this.$$.ctx[17]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[18]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[20]}set pathParams(e){this.$$set({pathParams:e}),w()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(e){this.$$set({sandboxRules:e}),w()}get searchParams(){return this.$$.ctx[21]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(e){this.$$set({skipCookieCheck:e}),w()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[24]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[25]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[3]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[26]}}function Di(i){yi(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function xi(i){let e;return{c(){e=Ae("main"),W(e,"class","svelte-1buc46y")},m(t,n){de(t,e,n),i[21](e)},p:ae,i:ae,o:ae,d(t){t&&oe(e),i[21](null)}}}function ki(i,e,t){let n,r,{activeFeatureToggleList:s}=e,{anchor:a}=e,{clientPermissions:o}=e,{compoundConfig:l}=e,{context:c}=e,{deferInit:f}=e,{dirtyStatus:h}=e,{documentTitle:u}=e,{hasBack:d}=e,{locale:S}=e,{noShadow:_}=e,{nodeParams:E}=e,{pathParams:R}=e,{searchParams:L}=e,{skipInitCheck:U}=e,{theme:z}=e,{userSettings:G}=e,{viewurl:K}=e,{webcomponent:J}=e,j=!1;const k=new ht,I=new Bt,$=m=>{if(!l||j)return;m.updateContext=(O,re)=>{const g=m.getNoShadow()?m:n;g._luigi_mfe_webcomponent.context=O,t(1,c=O);const ue=g._luigi_mfe_webcomponent;if(ue){const b=ue.querySelectorAll("[lui_web_component]");b==null||b.forEach((D=>{const pe=D.context||{};D.context=Object.assign(pe,O)}))}};const te=De.resolveContext(c);t(2,f=!1),m.notifyAlertClosed=(O,re)=>{m.isConnected&&I.resolveAlert(O,re)},m.notifyConfirmationModalClosed=O=>{m.isConnected&&I.notifyConfirmationModalClosed(!!O)};const H={compound:l,viewUrl:K,webcomponent:De.checkWebcomponentValue(J)||!0};m.getNoShadow()?m.innerHTML="":(t(0,n.innerHTML="",n),m.attachShadow({mode:"open"}).append(n)),I.renderWebComponentCompound(H,m.getNoShadow()?m:n,te).then((O=>{r=O,U||!H.viewUrl?(m.initialized=!0,setTimeout((()=>{I.dispatchLuigiEvent(p.INITIALIZED,{})}))):r.LuigiClient&&!r.deferLuigiClientWCInit&&(m.initialized=!0,I.dispatchLuigiEvent(p.INITIALIZED,{}))})),j=!0,m.containerInitialized=!0};return Vt((async()=>{const m=n.getRootNode()===document?n.parentNode:n.getRootNode().host;m.init=()=>{$(m)},f||$(m),k.registerContainer(m),I.thisComponent=m})),i.$$set=m=>{"activeFeatureToggleList"in m&&t(3,s=m.activeFeatureToggleList),"anchor"in m&&t(4,a=m.anchor),"clientPermissions"in m&&t(5,o=m.clientPermissions),"compoundConfig"in m&&t(6,l=m.compoundConfig),"context"in m&&t(1,c=m.context),"deferInit"in m&&t(2,f=m.deferInit),"dirtyStatus"in m&&t(7,h=m.dirtyStatus),"documentTitle"in m&&t(8,u=m.documentTitle),"hasBack"in m&&t(9,d=m.hasBack),"locale"in m&&t(10,S=m.locale),"noShadow"in m&&t(11,_=m.noShadow),"nodeParams"in m&&t(12,E=m.nodeParams),"pathParams"in m&&t(13,R=m.pathParams),"searchParams"in m&&t(14,L=m.searchParams),"skipInitCheck"in m&&t(15,U=m.skipInitCheck),"theme"in m&&t(16,z=m.theme),"userSettings"in m&&t(17,G=m.userSettings),"viewurl"in m&&t(18,K=m.viewurl),"webcomponent"in m&&t(19,J=m.webcomponent)},[n,c,f,s,a,o,l,h,u,d,S,_,E,R,L,U,z,G,K,J,()=>s&&a&&o&&h&&u&&d&&S&&_&&E&&R&&L&&U&&z&&G,function(m){Me[m?"unshift":"push"]((()=>{n=m,t(0,n)}))}]}Wt(qt,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},allowRules:{type:"Array",reflect:!1,attribute:"allow-rules"},anchor:{type:"String",reflect:!1,attribute:"anchor"},authData:{type:"Object",reflect:!1,attribute:"auth-data"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},label:{type:"String",reflect:!1,attribute:"label"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},sandboxRules:{type:"Array",reflect:!1,attribute:"sandbox-rules"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipCookieCheck:{type:"String",reflect:!1,attribute:"skip-cookie-check"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"sendCustomMessage",e("sendCustomMessage"));A(this,"updateContext",e("updateContext"));A(this,"updateViewUrl",e("updateViewUrl"));A(this,"closeAlert",e("closeAlert"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,s){try{super.attributeChangedCallback(n,r,s)}catch(a){console.error("Error in super.attributeChangedCallback",a)}this.containerInitialized&&(n==="context"&&this.updateContext(JSON.parse(s)),n==="auth-data"&&Ee.updateAuthData(this.iframeHandle,JSON.parse(s)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class At extends Gt{constructor(e){super(),Ht(this,e,ki,xi,kt,{activeFeatureToggleList:3,anchor:4,clientPermissions:5,compoundConfig:6,context:1,deferInit:2,dirtyStatus:7,documentTitle:8,hasBack:9,locale:10,noShadow:11,nodeParams:12,pathParams:13,searchParams:14,skipInitCheck:15,theme:16,userSettings:17,viewurl:18,webcomponent:19,unwarn:20},Di)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(e){this.$$set({activeFeatureToggleList:e}),w()}get anchor(){return this.$$.ctx[4]}set anchor(e){this.$$set({anchor:e}),w()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(e){this.$$set({compoundConfig:e}),w()}get context(){return this.$$.ctx[1]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[2]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[9]}set hasBack(e){this.$$set({hasBack:e}),w()}get locale(){return this.$$.ctx[10]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[11]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[13]}set pathParams(e){this.$$set({pathParams:e}),w()}get searchParams(){return this.$$.ctx[14]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[16]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[17]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[18]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[20]}}Wt(At,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},anchor:{type:"String",reflect:!1,attribute:"anchor"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow",reflect:!1},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"updateContext",e("updateContext"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,s){try{super.attributeChangedCallback(n,r,s)}catch(a){console.warn("Error in attributeChangedCallback",a)}this.containerInitialized&&n==="context"&&this.updateContext(JSON.parse(s))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",qt.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",At.element);class Ie{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(e){this.decorators=this.decorators.filter(t=>t.uid!==e.uid).concat(e)}applyDecorators(e,t){if(!e)return e;const n=new URL(v.prependOrigin(e)),r=this.decorators.filter(s=>s.type==="queryString");for(let s=0;s<r.length;s++){const a=r[s];n.searchParams.has(a.key)&&n.searchParams.delete(a.key);const o=a.valueFn();n.searchParams.append(a.key,o)}return t&&(n.search=decodeURIComponent(n.search)),n.href}}const at=async(i,e)=>{const t=await e.readUserSettings(),r=i.userSettingsGroup&&typeof t=="object"&&t!==null?t[i.userSettingsGroup]:null;if(i.webcomponent&&!C.checkWCUrl(i.viewUrl,e))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const s=document.createElement("luigi-compound-container");return s.setAttribute("lui_container","true"),s.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),s.webcomponent=i.webcomponent,s.compoundConfig=i.compound,s.context=i.context,s.clientPermissions=i.clientPermissions,s.nodeParams=i.nodeParams,s.pathParams=i.pathParams,s.userSettingsGroup=i.userSettingsGroup,s.userSettings=r,s.searchParams=i.searchParams,s.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),s.locale=e.i18n().getCurrentLocale(),s.theme=e.theming().getCurrentTheme(),s.viewGroup=i.viewGroup,e.getEngine()._comm.addListeners(s,e),s}else{const s=document.createElement("luigi-container");return s.setAttribute("lui_container","true"),s.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),s.webcomponent=i.webcomponent,s.context=i.context,s.clientPermissions=i.clientPermissions,s.cssVariables=await e.theming().getCSSVariables(),s.nodeParams=i.nodeParams,s.pathParams=i.pathParams,s.userSettingsGroup=i.userSettingsGroup,s.userSettings=r,s.searchParams=i.searchParams,s.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),s.locale=e.i18n().getCurrentLocale(),s.theme=e.theming().getCurrentTheme(),s.viewGroup=i.viewGroup,zt(s,e),Kt(s,e),e.getEngine()._comm.addListeners(s,e),s}},zt=(i,e)=>{const t=e.getConfigValue("settings.customSandboxRules");if(!(t!=null&&t.length))return;const n=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],r=t?[...new Set([...n,...t])]:n;i.sandboxRules=r},Kt=(i,e)=>{const t=e.getConfigValue("settings.allowRules");t!=null&&t.length&&(t.forEach((n,r)=>{t[r]=n+(n.indexOf(";")!=-1?"":";")}),i.allowRules=t)},x={navService:void 0,routingService:void 0,luigi:void 0,init:i=>{var e;console.log("Init UI..."),x.navService=y.get(ce),x.routingService=y.get(ge),x.luigi=i,(e=i.getEngine()._connector)==null||e.renderMainLayout()},update:async i=>{var n,r,s;const e=x.routingService.getCurrentRoute();if(!e)return;const t=!i||i.length===0;(t||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&((n=x.luigi.getEngine()._connector)==null||n.renderTopNav(await x.navService.getTopNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(y.get(le).deleteCache(),(r=x.luigi.getEngine()._connector)==null||r.renderLeftNav(await x.navService.getLeftNavData(e.path)),(s=x.luigi.getEngine()._connector)==null||s.renderTabNav(await x.navService.getTabNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(y.get(le).deleteCache(),x.updateMainContent(e.node,x.luigi))},updateMainContent:async(i,e,t,n)=>{var l,c,f;const r=await e.readUserSettings(),a=i.userSettingsGroup&&typeof r=="object"&&r!==null?r[i.userSettingsGroup]:null,o=(l=e.getEngine()._connector)==null?void 0:l.getContainerWrapper();if((c=e.getEngine()._connector)==null||c.hideLoadingIndicator(o),i&&o){let h;if([...o.childNodes].forEach(u=>{var d;((d=u.tagName)==null?void 0:d.indexOf("LUIGI-"))===0&&(u.viewGroup?i.viewGroup===u.viewGroup?h=u:u.style.display="none":u.remove())}),h)t||(h.style.display="block",h.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),h.nodeParams=i.nodeParams,h.pathParams=i.pathParams,h.clientPermissions=i.clientPermissions,h.searchParams=C.prepareSearchParamsForClient(i,e),h.locale=e.i18n().getCurrentLocale(),h.theme=e.theming().getCurrentTheme(),h.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),h.userSettingsGroup=i.userSettingsGroup,h.userSettings=a,zt(h,e),Kt(h,e)),n||h.updateContext(i.context||{});else{const u=await at(i,e);o==null||o.appendChild(u);const d=e.getEngine()._connector;((f=i.loadingIndicator)==null?void 0:f.enabled)!==!1&&(d==null||d.showLoadingIndicator(o))}}},openModal:async(i,e,t,n)=>{var S,_;const r=await at(e,i),s=y.get(ge),a=y.get(fe);let o=!1,l,c;const h=new Promise(E=>{l=()=>{o||(o=!0,E(),a.removeLastModalFromStack())},c=()=>{l&&l(),i.getConfigValue("routing.showModalPathInUrl")&&a.getModalStackLength()===0&&s.removeModalDataFromUrl(!0)},r.addEventListener(p.CLOSE_CURRENT_MODAL_REQUEST,c)}),u={closePromise:h,resolveFn:l,onCloseRequestHandler:c,onInternalClose:()=>{try{u.resolveFn&&u.resolveFn()}catch(E){console.warn("onInternalClose failed",E)}},modalsettings:t};a.registerModal(u),(S=i.getEngine()._connector)==null||S.renderModal(r,t,()=>{n==null||n(),a.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&a.getModalStackLength()===0&&s.removeModalDataFromUrl(!0)},()=>h);const d=i.getEngine()._connector;((_=e.loadingIndicator)==null?void 0:_.enabled)!==!1&&(d==null||d.showLoadingIndicator(r.parentElement))},updateModalSettings:(i,e,t)=>{var a;const n=y.get(fe);if(n.getModalStackLength()===0)return;n.updateFirstModalSettings(i);const r=y.get(ge),s=C.getModalPathFromPath(t);s&&r.updateModalDataInUrl(s,n.getModalSettings(),e),(a=t.getEngine()._connector)==null||a.updateModalSettings(n.getModalSettings())},openDrawer:async(i,e,t,n)=>{var a,o;const r=await at(e,i);(a=i.getEngine()._connector)==null||a.renderDrawer(r,t,n);const s=i.getEngine()._connector;((o=e.loadingIndicator)==null?void 0:o.enabled)!==!1&&(s==null||s.showLoadingIndicator(r.parentElement))}};class ge{constructor(e){this.luigi=e}getNavigationService(){return this.navigationService||(this.navigationService=y.get(ce)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const e=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||e).filter(n=>location.href.match(n)).length!==0}enableRouting(){var t;const e=this.luigi.getConfig();console.log("Init Routing...",e.routing),(t=e.routing)!=null&&t.useHashRouting?(window.addEventListener("hashchange",n=>{var a,o;const r=!!((a=n==null?void 0:n.detail)!=null&&a.preventContextUpdate),s=!!((o=n==null?void 0:n.detail)!=null&&o.withoutSync);this.handleRouteChange(C.getCurrentPath(!0),s,r)}),this.handleRouteChange(C.getCurrentPath(!0))):(window.addEventListener("popstate",n=>{var a,o;const r=!!((a=n==null?void 0:n.detail)!=null&&a.preventContextUpdate),s=!!((o=n==null?void 0:n.detail)!=null&&o.withoutSync);this.handleRouteChange(C.getCurrentPath(),s,r)}),this.handleRouteChange(C.getCurrentPath()))}async handleRouteChange(e,t=!1,n=!1){var d,S,_;const r=e.path,s=e.query,a=r+(s?"?"+s:""),o=new URLSearchParams(s),l={};if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(a),await this.shouldShowModalPathInUrl(e),o.forEach((E,R)=>{l[R]=E}),this.checkInvalidateCache(this.previousPathData,r);const c=await this.getNavigationService().getPathData(r);this.previousPathData=c;const f=C.filterNodeParams(l,this.luigi),h=await this.getNavigationService().shouldRedirect(r,c);if(h){this.luigi.navigation().navigate(h);return}this.currentRoute={raw:window.location.href,path:r,nodeParams:f},(d=this.luigi.getEngine()._connector)==null||d.renderTopNav(await this.getNavigationService().getTopNavData(r,c)),(S=this.luigi.getEngine()._connector)==null||S.renderLeftNav(await this.getNavigationService().getLeftNavData(r,c)),(_=this.luigi.getEngine()._connector)==null||_.renderTabNav(await this.getNavigationService().getTabNavData(r,c));const u=(c==null?void 0:c.selectedNode)??await this.getNavigationService().getCurrentNode(r);u&&(this.currentRoute.node=u,u.nodeParams=f||{},u.pathParams=(c==null?void 0:c.pathParams)||{},u.searchParams=C.prepareSearchParamsForClient(u,this.luigi),this.getNavigationService().onNodeChange(this.previousNode,u),this.previousNode=u,x.updateMainContent(u,this.luigi,t,n))}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(e){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(e)}async handleBookmarkableModalPath(e){var o;const t=y.get(ce),n=y.get(fe),r=new URLSearchParams((e==null?void 0:e.query)||""),s=C.getModalViewParamName(this.luigi),a=r.get(s);if(a){const l=r.get(`${s}Params`);try{const c=JSON.parse(l||"{}"),{nodeObject:f}=await t.extractDataFromPath(a);document.querySelector(".lui-modal luigi-container")?(o=this.luigi.getEngine()._connector)==null||o.updateModalSettings(c):this.luigi.navigation().openAsModal(a,c||f.openNodeInModal)}catch(c){console.error("Error parsing modal settings from URL parameters",c)}}else{n.closeModals();return}}appendModalDataToUrl(e,t){const n=C.getHashQueryParamSeparator(),r=C.getQueryParams(this.luigi),s=C.getModalViewParamName(this.luigi),a=r[s],o=new URL(location.href),l=this.luigi.getConfigValue("routing.useHashRouting");let c=history.state,f,h;if(l){let[u,d]=o.hash.split("?");f=u,h=C.getURLWithoutModalData(d,s),h&&(f+="?"+h)}else f=o.pathname,h=C.getURLWithoutModalData(o.search,s),h&&(f+="?"+C.getURLWithoutModalData(o.search,s));if(c=C.handleHistoryState(c,f),a!==e){if(r[s]=e,t&&Object.keys(t).length&&(r[`${s}Params`]=JSON.stringify(t)),l){const u=location.hash.indexOf(n);u!==-1&&(o.hash=o.hash.slice(0,u)),o.hash=`${o.hash}${n}${C.encodeParams(r)}`}else o.search=`?${C.encodeParams(r)}`;history.pushState(c,"",o.href)}else{const u=new URL(o);if(l){let d=u.hash.split("?")[0];u.hash=d,h&&(u.hash+="?"+h)}else u.search=h;history.replaceState({},"",u.href),history.pushState(c,"",o.href)}}removeModalDataFromUrl(e){const t=C.getQueryParams(this.luigi),n=C.getModalViewParamName(this.luigi);let r=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let a={};t[n]&&(a[n]=t[n]),t[`${n}Params`]&&(a[`${n}Params`]=t[`${n}Params`]);let o=C.encodeParams(a);r.hash.includes(`?${o}`)?r.hash=r.hash.replace(`?${o}`,""):r.hash.includes(`&${o}`)&&(r.hash=r.hash.replace(`&${o}`,""))}else{let a=new URLSearchParams(r.search.slice(1));a.delete(n),a.delete(`${n}Params`);let o="";Array.from(a.keys()).forEach(l=>{o+=(o===""?"?":"&")+l+"="+a.get(l)}),r.search=o}if(history.state&&history.state.modalHistoryLength>=0&&e){history.state.modalHistoryLength;const a=history.state.pathBeforeHistory;let o=!1;if(window.addEventListener("popstate",l=>{o?(history.replaceState({},"",a),history.pushState({},"",a),history.back()):(history.pushState({},"",a),history.back())},{once:!0}),history.state.historygap===history.length-history.state.modalHistoryLength)history.go(-history.state.modalHistoryLength);else if(history.state.modalHistoryLength>history.length){const l=history.length-1;o=!0,history.go(-l),window.Luigi.preventLoadingModalData=!0}else{const l=history.state.modalHistoryLength;history.go(-l)}}else history.pushState({},"",r.href)}setFeatureToggle(e){const t=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),n=this.luigi.featureToggles();t&&typeof e=="string"&&C.setFeatureToggles(t,e,n)}updateModalDataInUrl(e,t,n){let r=C.getHashQueryParamSeparator();const s=C.getQueryParams(this.luigi),a=C.getModalViewParamName(this.luigi);s[a]=e,t&&Object.keys(t).length&&(s[`${a}Params`]=JSON.stringify(t));const o=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const c=location.hash.indexOf(r);c!==-1&&(o.hash=o.hash.slice(0,c)),o.hash=`${o.hash}${r}${C.encodeParams(s)}`}else o.search=`?${C.encodeParams(s)}`;n?history.pushState(window.state,"",o.href):history.replaceState(window.state,"",o.href)}checkInvalidateCache(e,t){if(!e)return;const n=y.get(le);let r=t.split("/");if(e.nodesInPath&&e.nodesInPath.length>0){let s=e.nodesInPath.slice(1),a=!0;for(let o=0;o<s.length;o++){let l=r.length>o?r[o]:void 0,c=s[o];if(l!==c.pathSegment||!a)if(C.isDynamicNode(c)){if(!a||l!==C.getDynamicNodeValue(c,e.pathParams)){n.deleteNodesRecursively(c);break}}else a=!1}}else n.deleteCache()}}class Mi{constructor(e){var t;this.hashRouting=!1,this.navigate=async(n,r,s,a,o)=>{const l={modalSettings:s,newTab:!1,path:n,preserveView:r,preventContextUpdate:!1,withoutSync:!1};this.navService.handleNavigationRequest(l,void 0)},this.openAsModal=async(n,r,s)=>{r.keepPrevious||await this.modalService.closeModals();const a=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(a),l=r||{};l.title||(l.title=o.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(a,l),this.luigi.getEngine()._ui.openModal(this.luigi,o,l,s)},this.openAsDrawer=async(n,r,s)=>{const a=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(a),l=r||{};l.title||(l.title=o.label),this.luigi.getEngine()._ui.openDrawer(this.luigi,o,l,s)},this.runTimeErrorHandler=async n=>{var o,l,c;const{path:r}=C.getCurrentPath((o=this.luigi.getConfig().routing)==null?void 0:o.useHashRouting),s=await this.navService.getCurrentNode(r),a=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");(l=s==null?void 0:s.runTimeErrorHandler)!=null&&l.errorFn&&v.isFunction((c=s==null?void 0:s.runTimeErrorHandler)==null?void 0:c.errorFn)?s.runTimeErrorHandler.errorFn(n,s):a!=null&&a.errorFn&&v.isFunction(a.errorFn)&&a.errorFn(n,s)},this.luigi=e,this.hashRouting=(t=e.getConfig().routing)==null?void 0:t.useHashRouting,this.navService=y.get(ce),this.routingService=y.get(ge),this.modalService=y.get(fe)}}class Fi{constructor(e){this.luigi=e}addSearchParams(e,t=!1){if(!v.isObject(e)){console.log("Params argument must be an object");return}const n=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?n.hash=C.addParamsOnHashRouting(e,n.hash):C.modifySearchParams(e,n.searchParams),this.handleBrowserHistory(t,n),this.luigi.configChanged()}getSearchParams(){const e={},t=["__proto__","constructor","prototype"],n=new URL(location.href);let r;if(this.luigi.getConfigValue("routing.useHashRouting")){const s=n.hash.split("?")[1];r=s?new URLSearchParams(s).entries():[]}else r=n.searchParams.entries();for(const[s,a]of r){if(t.some(o=>s===o)){console.warn(`Blocked because of potentially dangerous query param: ${s}`);continue}e[s]=a}return e}handleBrowserHistory(e,t){const n=this.sanitizeUrl(t.href);if(!n){console.warn("invalid url: "+n);return}e?window.history.pushState({},"",n):window.history.replaceState({},"",n)}sanitizeUrl(e){return new URL(location.href).origin===new URL(e).origin?e:void 0}addNodeParams(e,t){if(!v.isObject(e)){console.log("Params argument must be an object");return}const n=C.getContentViewParamPrefix(this.luigi),r=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?r.hash=C.addParamsOnHashRouting(e,r.hash,n):C.modifySearchParams(e,r.searchParams,n),this.handleBrowserHistory(t,r),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}var V,Re;class Vi{constructor(e){it(this,V);it(this,Re,"");nt(this,V,e)}async getAvailableThemes(){return await Q(this,V).getConfigValueAsync("settings.theming.themes")}setCurrentTheme(e){nt(this,Re,e),Q(this,V).__cssVars=void 0}async getThemeObject(e){const t=await this.getAvailableThemes();return t==null?void 0:t.find(n=>n.id===e)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(Q(this,Re))return Q(this,Re);const e=Q(this,V).getConfigValue("settings.theming");return e.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",e),e.defaultTheme}isThemingAvailable(){return!!Q(this,V).getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const e=Q(this,V).getConfigValue("settings.theming.variables.file");if(e)try{const t=await fetch(e);window.Luigi.__cssVars=(await t.json()).root,Object.keys(window.Luigi.__cssVars).forEach(n=>{const r=getComputedStyle(document.documentElement).getPropertyValue("--"+n);r&&(window.Luigi.__cssVars[n]=r)})}catch(t){v.isFunction(Q(this,V).getConfigValue("settings.theming.variables.errorHandling"))?Q(this,V).getConfigValue("settings.theming.variables.errorHandling")(t):console.error("CSS variables file error: ",t)}else Q(this,V).getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(t=>{window.Luigi.__cssVars[t]=getComputedStyle(document.documentElement).getPropertyValue("--"+t)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const e=y.get(Ie);(()=>{const n=Q(this,V).getConfigValue("settings.theming");n&&n.nodeViewURLDecorator&&n.nodeViewURLDecorator.queryStringParameter&&e.add({type:"queryString",uid:"theming",key:n.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const r=this.getCurrentTheme(),s=n.nodeViewURLDecorator.queryStringParameter.value;return s?s(r):r}}),n&&n.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}V=new WeakMap,Re=new WeakMap;class Ke{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(e,t){var n,r;if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const s=new Set;s.add(t),this.unsavedChanges={dirtySet:s}}this.unsavedChanges.persistUrl=window.location.href,e?(n=this.unsavedChanges.dirtySet)==null||n.add(t):(r=this.unsavedChanges.dirtySet)==null||r.delete(t)}clearDirtyState(e){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(e?this.unsavedChanges.dirtySet.delete(e):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let Pt;const N={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),N.luigi=i,N.documentTitle=Be(void 0),Pt=y.get(Ke)},processAlert:(i,e,t)=>{var r;if(!N.luigi)throw new Error("Luigi is not initialized.");const n={openFromClient:e,close:()=>{i.id&&t.notifyAlertClosed(i.id)},link:s=>{var a;if(i.links){const o=i.links[s];if(o&&(o.url&&((a=N.luigi)==null||a.navigation().navigate(o.url)),o.dismissKey&&i.id))return t.notifyAlertClosed(i.id,o.dismissKey),!0}return!1}};(r=N.luigi.getEngine()._connector)==null||r.renderAlert(i,n)},handleConfirmationModalRequest:(i,e)=>{var t;if(!N.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:N.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:N.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:N.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:N.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),(t=N.luigi.getEngine()._connector)==null||t.renderConfirmationModal(i,{confirm(){e.notifyConfirmationModalClosed(!0)},dismiss(){e.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,e)=>{if(!N.luigi)throw new Error("Luigi is not initialized.");Pt.updateDirtyStatus(i,e)}};class Hi{processUserSettingGroups(e,t){var o;const n=[],r=e==null?void 0:e.userSettingGroups,s=(o=t==null?void 0:t.userSettings)==null?void 0:o.userSettingGroups,a=r||s;if(v.isObject(a)){for(const l in a){const c={};c[l]=a[l],n.push(c)}return n}return n}getUserSettingsIframesInDom(){const e=document.querySelector(".iframeUserSettingsCtn");return e?[...e.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(e=>{e.style.display="none"})}findActiveCustomUserSettingsIframe(e){const t=document.querySelectorAll("[userSettingsGroup]");for(let n=0;n<t.length;n++)if(t[n].contentWindow===e)return t[n];return null}}const Qi=new Hi;class Wi{constructor(e){this.dirtyStatusService=y.get(Ke),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=t=>new Promise(n=>{var s;t.id||(t.id=v.getRandomId().toString());const r={openFromClient:!1,close:()=>{n(!0)},link:a=>{var o;if(t.links){const l=t.links[a];if(l&&(l.url&&((o=this.luigi)==null||o.navigation().navigate(l.url)),l.dismissKey))return n(l.dismissKey),!0}return!1}};(s=this.luigi.getEngine()._connector)==null||s.renderAlert(t,r)}),this.showConfirmationModal=t=>(t&&(t={...t,header:this.luigi.i18n().getTranslation(t.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(t.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(t.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(t.buttonConfirm||"luigi.button.confirm")}),new Promise((n,r)=>{var s;(s=this.luigi.getEngine()._connector)==null||s.renderConfirmationModal(t,{confirm(){n(!0)},dismiss(){r()}})})),this.processUserSettingGroups=()=>{const t=this.luigi.getConfigValue("userSettings"),n=this.luigi.getConfigValue("settings");return Qi.processUserSettingGroups(t,n)},this.openUserSettings=t=>{var n;(n=this.luigi.getEngine()._connector)==null||n.openUserSettings(t)},this.closeUserSettings=()=>{var t;(t=this.luigi.getEngine()._connector)==null||t.closeUserSettings()},this.setDocumentTitle=t=>{var n,r,s;(r=(n=this.luigi.getEngine()._ux)==null?void 0:n.documentTitle)==null||r.set(t),(s=this.luigi.getEngine()._connector)==null||s.setDocumentTitle(t)},this.getDocumentTitle=()=>{var t;return Ot((t=this.luigi.getEngine()._ux)==null?void 0:t.documentTitle)||window.document.title||""},this.hideAppLoadingIndicator=()=>{const t=document.querySelector(this.appLoadingIndicatorSelector);t&&(t.classList.add("hidden"),setTimeout(()=>{var n;(n=t.parentNode)==null||n.removeChild(t)},500))},this.showLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.showLoadingIndicator(t)},this.hideLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.hideLoadingIndicator(t)},this.addBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.addBackdrop()},this.removeBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.removeBackdrop()},this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=e}}class Gi{constructor(e){this.engine=e,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=t=>{this.config=t,this.setConfigCallback(this.getConfigReadyCallback()),Te.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,Ci.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...t)=>{this.getEngine()._ui.update(t)},this.i18n=()=>(this._i18n||(this._i18n=new vi(this)),this._i18n),this.navigation=()=>new Mi(this),this.ux=()=>new Wi(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new wi),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new Fi(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new Vi(this)),this._theming),this.auth=()=>ve,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(e){return v.getConfigValueFromObject(this.getConfig(),e)}getConfigValueAsync(e,...t){return we.getConfigValueFromObjectAsync(this.getConfig(),e,t)}clearNavigationCache(){y.get(le).deleteCache()}async readUserSettings(){const e=await this.getConfigValueAsync("userSettings"),t=e||await this.getConfigValueAsync("settings.userSettings");if(t&&v.isFunction(t.readUserSettings))return t.readUserSettings();const n=localStorage.getItem(this.USER_SETTINGS_KEY);return n&&JSON.parse(n)}async storeUserSettings(e,t){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&v.isFunction(r.storeUserSettings))return r.storeUserSettings(e,t);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(e)),this.configChanged()}createConfigStore(){const e=Be({}),t={};let n=[];return{subscribe:r=>{n.push(e.subscribe(r))},reset:r=>{e.update(r)},subscribeToScope:(r,s)=>{let a=t[s];a||(a=new Set,t[s]=a),a.add(r)},fire:(r,s)=>{const a=t[r];a&&[...a].forEach(o=>{o(s)})},clear:()=>{n.forEach(r=>{r()}),n=[]}}}getConfigReadyCallback(){return new Promise(e=>{this.i18n()._init(),e()})}setConfigCallback(e){this.configReadyCallback=e}}const ji=!1;var Bi=Array.isArray,qi=Array.from,zi=Object.defineProperty,It=Object.getOwnPropertyDescriptor;const dt=2,Jt=4,Xt=8,Ki=16,Ve=32,Ye=64,Ze=128,Je=256,ne=512,Yt=1024,gt=2048,Zt=4096,et=8192,Ji=16384,Xi=1<<18,Yi=1<<19;function Zi(i){return i===this.v}function en(){throw new Error("effect_update_depth_exceeded")}function tn(i){return{f:0,v:i,reactions:null,equals:Zi,version:0}}var $t,ei;function nn(){if($t===void 0){$t=window;var i=Element.prototype,e=Node.prototype;It(e,"firstChild").get,ei=It(e,"nextSibling").get,i.__click=void 0,i.__className="",i.__attributes=null,i.__styles=null,i.__e=void 0,Text.prototype.__t=void 0}}function rn(i=""){return document.createTextNode(i)}function sn(i){return ei.call(i)}function ti(i){var e=i.children;if(e!==null){i.children=null;for(var t=0;t<e.length;t+=1){var n=e[t];(n.f&dt)!==0?ii(n):He(n)}}}function an(i){var e,t=ie;Le(i.parent);try{ti(i),e=li(i)}finally{Le(t)}return e}function on(i){var e=an(i),t=(Ce||(i.f&Ze)!==0)&&i.deps!==null?gt:ne;Ne(i,t),i.equals(e)||(i.v=e,i.version=gn())}function ii(i){ti(i),Fe(i,0),Ne(i,et),i.v=i.children=i.deps=i.ctx=i.reactions=null}function ln(i,e){var t=e.last;t===null?e.last=e.first=i:(t.next=i,i.prev=t,e.last=i)}function ft(i,e,t,n=!0){var r=(i&Ye)!==0,s=ie,a={ctx:ee,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:i|Yt,first:null,fn:e,last:null,next:null,parent:r?null:s,prev:null,teardown:null,transitions:null,version:0};if(t){var o=be;try{Lt(!0),mt(a),a.f|=Ji}catch(f){throw He(a),f}finally{Lt(o)}}else e!==null&&vn(a);var l=t&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&Yi)===0;if(!l&&!r&&n&&(s!==null&&ln(a,s),Z!==null&&(Z.f&dt)!==0)){var c=Z;(c.children??(c.children=[])).push(a)}return a}function cn(i){const e=ft(Ye,i,!0);return()=>{He(e)}}function un(i){return ft(Jt,i,!1)}function hn(i,e=!0){return ft(Xt|Ve,i,!0,e)}function ni(i){var e=i.teardown;if(e!==null){const t=Z;$e(null);try{e.call(null)}finally{$e(t)}}}function ri(i){var e=i.deriveds;if(e!==null){i.deriveds=null;for(var t=0;t<e.length;t+=1)ii(e[t])}}function si(i,e=!1){var t=i.first;for(i.first=i.last=null;t!==null;){var n=t.next;He(t,e),t=n}}function dn(i){for(var e=i.first;e!==null;){var t=e.next;(e.f&Ve)===0&&He(e),e=t}}function He(i,e=!0){var t=!1;if((e||(i.f&Xi)!==0)&&i.nodes_start!==null){for(var n=i.nodes_start,r=i.nodes_end;n!==null;){var s=n===r?null:sn(n);n.remove(),n=s}t=!0}ri(i),si(i,e&&!t),Fe(i,0),Ne(i,et);var a=i.transitions;if(a!==null)for(const l of a)l.stop();ni(i);var o=i.parent;o!==null&&o.first!==null&&ai(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.parent=i.fn=i.nodes_start=i.nodes_end=null}function ai(i){var e=i.parent,t=i.prev,n=i.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===i&&(e.first=n),e.last===i&&(e.last=t))}let Xe=!1,be=!1;function Lt(i){be=i}let ct=[],xe=0;let Z=null;function $e(i){Z=i}let ie=null;function Le(i){ie=i}let X=null,B=0,oi=0,Ce=!1,ee=null;function gn(){return++oi}function pt(i){var a,o;var e=i.f;if((e&Yt)!==0)return!0;if((e>)!==0){var t=i.deps,n=(e&Ze)!==0;if(t!==null){var r;if((e&Je)!==0){for(r=0;r<t.length;r++)((a=t[r]).reactions??(a.reactions=[])).push(i);i.f^=Je}for(r=0;r<t.length;r++){var s=t[r];if(pt(s)&&on(s),n&&ie!==null&&!Ce&&!((o=s==null?void 0:s.reactions)!=null&&o.includes(i))&&(s.reactions??(s.reactions=[])).push(i),s.version>i.version)return!0}}n||Ne(i,ne)}return!1}function fn(i,e,t){throw i}function li(i){var f;var e=X,t=B,n=Z,r=Ce,s=ee,a=i.f;X=null,B=0,Z=(a&(Ve|Ye))===0?i:null,Ce=!be&&(a&Ze)!==0,ee=i.ctx;try{var o=(0,i.fn)(),l=i.deps;if(X!==null){var c;if(Fe(i,B),l!==null&&B>0)for(l.length=B+X.length,c=0;c<X.length;c++)l[B+c]=X[c];else i.deps=l=X;if(!Ce)for(c=B;c<l.length;c++)((f=l[c]).reactions??(f.reactions=[])).push(i)}else l!==null&&B<l.length&&(Fe(i,B),l.length=B);return o}finally{X=e,B=t,Z=n,Ce=r,ee=s}}function pn(i,e){let t=e.reactions;if(t!==null){var n=t.indexOf(i);if(n!==-1){var r=t.length-1;r===0?t=e.reactions=null:(t[n]=t[r],t.pop())}}t===null&&(e.f&dt)!==0&&(X===null||!X.includes(e))&&(Ne(e,gt),(e.f&(Ze|Je))===0&&(e.f^=Je),Fe(e,0))}function Fe(i,e){var t=i.deps;if(t!==null)for(var n=e;n<t.length;n++)pn(i,t[n])}function mt(i){var e=i.f;if((e&et)===0){Ne(i,ne);var t=ie;ie=i;try{ri(i),(e&Ki)!==0?dn(i):si(i),ni(i);var n=li(i);i.teardown=typeof n=="function"?n:null,i.version=oi}catch(r){fn(r)}finally{ie=t}}}function mn(){xe>1e3&&(xe=0,en()),xe++}function Sn(i){var e=i.length;if(e!==0){mn();var t=be;be=!0;try{for(var n=0;n<e;n++){var r=i[n];(r.f&ne)===0&&(r.f^=ne);var s=[];ci(r,s),_n(s)}}finally{be=t}}}function _n(i){var e=i.length;if(e!==0)for(var t=0;t<e;t++){var n=i[t];(n.f&(et|Zt))===0&&pt(n)&&(mt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?ai(n):n.fn=null))}}function En(){if(Xe=!1,xe>1001)return;const i=ct;ct=[],Sn(i),Xe||(xe=0)}function vn(i){Xe||(Xe=!0,queueMicrotask(En));for(var e=i;e.parent!==null;){e=e.parent;var t=e.f;if((t&(Ye|Ve))!==0){if((t&ne)===0)return;e.f^=ne}}ct.push(e)}function ci(i,e){var t=i.first,n=[];e:for(;t!==null;){var r=t.f,s=(r&Ve)!==0,a=s&&(r&ne)!==0;if(!a&&(r&Zt)===0)if((r&Xt)!==0){s?t.f^=ne:pt(t)&&mt(t);var o=t.first;if(o!==null){t=o;continue}}else(r&Jt)!==0&&n.push(t);var l=t.next;if(l===null){let h=t.parent;for(;h!==null;){if(i===h)break e;var c=h.next;if(c!==null){t=c;continue e}h=h.parent}}t=l}for(var f=0;f<n.length;f++)o=n[f],e.push(o),ci(o,e)}const Cn=-3585;function Ne(i,e){i.f=i.f&Cn|e}function wn(i,e=!1,t){ee={p:ee,c:null,e:null,m:!1,s:i,x:null,l:null},e||(ee.l={s:null,u:null,r1:[],r2:tn(!1)})}function Tn(i){const e=ee;if(e!==null){const a=e.e;if(a!==null){var t=ie,n=Z;e.e=null;try{for(var r=0;r<a.length;r++){var s=a[r];Le(s.effect),$e(s.reaction),un(s.fn)}}finally{Le(t),$e(n)}}ee=e.p,e.m=!0}return{}}const yn=new Set,Nt=new Set;function Ge(i){var L;var e=this,t=e.ownerDocument,n=i.type,r=((L=i.composedPath)==null?void 0:L.call(i))||[],s=r[0]||i.target,a=0,o=i.__root;if(o){var l=r.indexOf(o);if(l!==-1&&(e===document||e===window)){i.__root=e;return}var c=r.indexOf(e);if(c===-1)return;l<=c&&(a=l)}if(s=r[a]||i.target,s!==e){zi(i,"currentTarget",{configurable:!0,get(){return s||t}});var f=Z,h=ie;$e(null),Le(null);try{for(var u,d=[];s!==null;){var S=s.assignedSlot||s.parentNode||s.host||null;try{var _=s["__"+n];if(_!==void 0&&!s.disabled)if(Bi(_)){var[E,...R]=_;E.apply(s,[i,...R])}else _.call(s,i)}catch(U){u?d.push(U):u=U}if(i.cancelBubble||S===e||S===null)break;s=S}if(u){for(let U of d)queueMicrotask(()=>{throw U});throw u}}finally{i.__root=e,delete i.currentTarget,$e(f),Le(h)}}}const bn=["touchstart","touchmove"];function Rn(i){return bn.includes(i)}function An(i,e){return Pn(i,e)}const Se=new Map;function Pn(i,{target:e,anchor:t,props:n={},events:r,context:s,intro:a=!0}){nn();var o=new Set,l=h=>{for(var u=0;u<h.length;u++){var d=h[u];if(!o.has(d)){o.add(d);var S=Rn(d);e.addEventListener(d,Ge,{passive:S});var _=Se.get(d);_===void 0?(document.addEventListener(d,Ge,{passive:S}),Se.set(d,1)):Se.set(d,_+1)}}};l(qi(yn)),Nt.add(l);var c=void 0,f=cn(()=>{var h=t??e.appendChild(rn());return hn(()=>{if(s){wn({});var u=ee;u.c=s}r&&(n.$$events=r),c=i(h,n)||{},s&&Tn()}),()=>{var S;for(var u of o){e.removeEventListener(u,Ge);var d=Se.get(u);--d===0?(document.removeEventListener(u,Ge),Se.delete(u)):Se.set(u,d)}Nt.delete(l),Ut.delete(c),h!==t&&((S=h.parentNode)==null||S.removeChild(h))}});return Ut.set(c,f),c}let Ut=new WeakMap;const In="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(In);function $n(i){}const ut={init:i=>{y.get(ge).enableRouting()},handlePageErrorHandler:(i,e,t)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)e.viewUrl=i.viewUrl,t.getEngine()._ui.updateMainContent(e,t);else if(i.errorFn)i.errorFn(e);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const n=i.redirectPath||"/";t.navigation().navigate(n)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const t=window.open(i.url,"_blank","noopener noreferrer");t&&(t.opener=null,t.focus())}},async addSearchParamsFromClient(i,e,t){var o;const n=y.get(ce),r=C.getCurrentPath(),s=await n.getCurrentNode(r.path),a={...i};if((o=s==null?void 0:s.clientPermissions)!=null&&o.urlParameters){const l={};Object.keys(s.clientPermissions.urlParameters).forEach(c=>{c in a&&s.clientPermissions.urlParameters[c].write===!0&&(l[c]=a[c],delete a[c])});for(const c in a)console.warn(`No permission to add the search param "${c}" to the url`);Object.keys(l).length>0&&t.routing().addSearchParams(l,e)}}},Y={luigi:{},init:i=>{console.log("Init communication..."),Y.luigi=i},addListeners:(i,e)=>{i.addEventListener(p.INITIALIZED,t=>{var n;(n=N.luigi)==null||n.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(p.NAVIGATION_REQUEST,t=>{const{link:n,preserveView:r,modal:s,newTab:a,withoutSync:o,preventContextUpdate:l}=t.detail,c={modalSettings:s,newTab:a,path:n,preserveView:r,preventContextUpdate:l,withoutSync:o};y.get(ce).handleNavigationRequest(c,t.callbackFn)}),i.addEventListener(p.RUNTIME_ERROR_HANDLING_REQUEST,t=>{var n,r;e.navigation().runTimeErrorHandler(((r=(n=t.payload)==null?void 0:n.data)==null?void 0:r.errorObj)||{})}),i.addEventListener(p.ALERT_REQUEST,t=>{N.processAlert(t.payload,!0,i)}),i.addEventListener(p.SHOW_CONFIRMATION_MODAL_REQUEST,t=>{N.handleConfirmationModalRequest(t.payload,i)}),i.addEventListener(p.SET_DOCUMENT_TITLE_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.setDocumentTitle(t.detail.title)}),i.addEventListener(p.SHOW_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.showLoadingIndicator(i.parentNode)}),i.addEventListener(p.HIDE_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.hideLoadingIndicator(i.parentNode)}),i.addEventListener(p.ADD_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.addBackdrop()}),i.addEventListener(p.REMOVE_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.removeBackdrop()}),i.addEventListener(p.SET_DIRTY_STATUS_REQUEST,t=>{var n,r,s;N.handleDirtyStatusRequest((r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.dirty,(s=t.detail)==null?void 0:s.source)}),i.addEventListener(p.ADD_NODE_PARAMS_REQUEST,t=>{e.routing().addNodeParams(t.payload.data,t.payload.keepBrowserHistory)}),i.addEventListener(p.OPEN_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.openUserSettings(t.detail)}),i.addEventListener(p.CLOSE_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.closeUserSettings()}),i.addEventListener(p.ADD_SEARCH_PARAMS_REQUEST,t=>{ut.addSearchParamsFromClient(t.detail.data,t.detail.keepBrowserHistory,e)}),i.addEventListener(p.UPDATE_MODAL_SETTINGS_REQUEST,t=>{x.updateModalSettings(t.payload.updatedModalSettings,t.payload.addHistoryEntry,e)}),i.addEventListener(p.SET_CURRENT_LOCALE_REQUEST,t=>{var n,r,s;e.i18n().setCurrentLocale((s=(r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.data)==null?void 0:s.currentLocale,i)})}};class Ln{constructor(){this._ui=x,this._comm=Y,this._ux=N,this._routing=ut}bootstrap(e){this._app=An($n,{target:document.body}),this._connector=e}init(){const e=window.Luigi;y.register(Ke,()=>new Ke),y.register(ce,()=>new ce(e)),y.register(le,()=>new le),y.register(ge,()=>new ge(e)),y.register(Ie,()=>new Ie),y.register(fe,()=>new fe(e)),e.theming()._init(),x.init(e),ut.init(e),Y.init(e),N.init(e)}}window.Luigi=new Gi(new Ln);
|
|
34
34
|
//# sourceMappingURL=luigi.js.map
|