@luigi-project/container 1.2.0-rc2 → 1.2.0-rc3
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/LuigiCompoundContainer.svelte.d.ts +22 -2
- package/LuigiContainer.svelte.d.ts +22 -0
- package/bundle.js +1 -1
- package/bundle.js.map +1 -1
- package/constants/event-type.d.ts +25 -0
- package/constants/events.d.ts +75 -21
- package/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -60,6 +60,26 @@ export default class LuigiCompoundContainer extends HTMLElement {
|
|
|
60
60
|
*/
|
|
61
61
|
anchor: string;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* The document title value to be passed to the compound micro frontend.
|
|
65
|
+
* @since NEXT_RELEASE
|
|
66
|
+
*/
|
|
67
|
+
documentTitle: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The hasBack value to be passed to the compound micro frontend.
|
|
71
|
+
* It indicates that there is one or more preserved views. Useful when you need to show a back button.
|
|
72
|
+
* @since NEXT_RELEASE
|
|
73
|
+
*/
|
|
74
|
+
hasBack: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The dirty status value to be passed to the compound micro frontend.
|
|
78
|
+
* It's used to indicate that there are unsaved changes when navigating away.
|
|
79
|
+
* @since NEXT_RELEASE
|
|
80
|
+
*/
|
|
81
|
+
dirtyStatus: boolean;
|
|
82
|
+
|
|
63
83
|
/**
|
|
64
84
|
* The following properties can be set for the web component object. By default, the web component is set to true.
|
|
65
85
|
* @param {Object} [WebComponentSettings]
|
|
@@ -72,7 +92,7 @@ export default class LuigiCompoundContainer extends HTMLElement {
|
|
|
72
92
|
webcomponent: boolean | WebComponentSettings | string;
|
|
73
93
|
|
|
74
94
|
/**
|
|
75
|
-
* Function that updates the context of the compound microfrontend
|
|
95
|
+
* Function that updates the context of the compound microfrontend.
|
|
76
96
|
* @param contextObj The context data
|
|
77
97
|
*
|
|
78
98
|
* @example
|
|
@@ -82,7 +102,7 @@ export default class LuigiCompoundContainer extends HTMLElement {
|
|
|
82
102
|
updateContext(contextObj: Object): void;
|
|
83
103
|
|
|
84
104
|
/**
|
|
85
|
-
* Manually triggers the micro frontend rendering process when using defer-init attribute
|
|
105
|
+
* Manually triggers the micro frontend rendering process when using the defer-init attribute.
|
|
86
106
|
* @since 1.0.0
|
|
87
107
|
*/
|
|
88
108
|
init(): void;
|
|
@@ -106,15 +106,37 @@ export default class LuigiContainer extends HTMLElement {
|
|
|
106
106
|
/**
|
|
107
107
|
* The list of rules for the content in the iframe, managed by the HTML `allow` attribute.
|
|
108
108
|
* You can use one or more rules by adding them to the array, for example allowRules: ["microphone", "camera"].
|
|
109
|
+
* @since NEXT_RELEASE
|
|
109
110
|
*/
|
|
110
111
|
allowRules: string[];
|
|
111
112
|
|
|
112
113
|
/**
|
|
113
114
|
* The list of rules for the content in the iframe, managed by the HTML `sandbox` attribute.
|
|
114
115
|
* You can use one or more rules by adding them to the array, for example sandboxRules: ["allow-scripts", "allow-same-origin"].
|
|
116
|
+
* @since NEXT_RELEASE
|
|
115
117
|
*/
|
|
116
118
|
sandboxRules: string[];
|
|
117
119
|
|
|
120
|
+
/**
|
|
121
|
+
* The document title value to be passed to the web-component-based micro frontend.
|
|
122
|
+
* @since NEXT_RELEASE
|
|
123
|
+
*/
|
|
124
|
+
documentTitle: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The hasBack value to be passed to the web-component-based micro frontend.
|
|
128
|
+
* It indicates that there is one or more preserved views. Useful when you need to show a back button.
|
|
129
|
+
* @since NEXT_RELEASE
|
|
130
|
+
*/
|
|
131
|
+
hasBack: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The dirty status value to be passed to the web-component-based micro frontend.
|
|
135
|
+
* It's used to indicate that there are unsaved changes when navigating away.
|
|
136
|
+
* @since NEXT_RELEASE
|
|
137
|
+
*/
|
|
138
|
+
dirtyStatus: boolean;
|
|
139
|
+
|
|
118
140
|
/**
|
|
119
141
|
* Function that updates the context of the microfrontend
|
|
120
142
|
* @param {Object} contextObj The context data
|
package/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(){}function t(e){return e()}function n(){return Object.create(null)}function i(e){e.forEach(t)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let o,a;function c(e,t){return e===t||(o||(o=document.createElement("a")),o.href=t,e===o.href)}function u(e,t,n){const i=function(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;if(t&&t.host)return t;return e.ownerDocument}(e);if(!i.getElementById(t)){const e=h("style");e.id=t,e.textContent=n,function(e,t){(function(e,t){e.appendChild(t)})(e.head||e,t),t.sheet}(i,e)}}function l(e,t,n){e.insertBefore(t,n||null)}function d(e){e.parentNode&&e.parentNode.removeChild(e)}function h(e){return document.createElement(e)}function m(e){return document.createTextNode(e)}function p(){return m("")}function E(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function g(e){a=e}function _(){if(!a)throw new Error("Function called outside component initialization");return a}function $(e){_().$$.on_mount.push(e)}const f=[],T=[];let C=[];const S=[],R=Promise.resolve();let b=!1;function w(e){C.push(e)}const A=new Set;let I=0;function O(){if(0!==I)return;const e=a;do{try{for(;I<f.length;){const e=f[I];I++,g(e),v(e.$$)}}catch(e){throw f.length=0,I=0,e}for(g(null),f.length=0,I=0;T.length;)T.pop()();for(let e=0;e<C.length;e+=1){const t=C[e];A.has(t)||(A.add(t),t())}C.length=0}while(f.length);for(;S.length;)S.pop()();b=!1,A.clear(),g(e)}function v(e){if(null!==e.fragment){e.update(),i(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(w)}}const U=new Set;function N(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];C.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),C=t}(n.after_update),i(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function P(e,t){-1===e.$$.dirty[0]&&(f.push(e),b||(b=!0,R.then(O)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function L(r,o,c,u,l,h,m=null,p=[-1]){const E=a;g(r);const _=r.$$={fragment:null,ctx:[],props:h,update:e,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(E?E.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:o.target||E.$$.root};m&&m(_.root);let $=!1;if(_.ctx=c?c(r,o.props||{},((e,t,...n)=>{const i=n.length?n[0]:t;return _.ctx&&l(_.ctx[e],_.ctx[e]=i)&&(!_.skip_bound&&_.bound[e]&&_.bound[e](i),$&&P(r,e)),t})):[],_.update(),$=!0,i(_.before_update),_.fragment=!!u&&u(_.ctx),o.target){if(o.hydrate){const e=function(e){return Array.from(e.childNodes)}(o.target);_.fragment&&_.fragment.l(e),e.forEach(d)}else _.fragment&&_.fragment.c();o.intro&&((f=r.$$.fragment)&&f.i&&(U.delete(f),f.i(T))),function(e,n,r){const{fragment:o,after_update:a}=e.$$;o&&o.m(n,r),w((()=>{const n=e.$$.on_mount.map(t).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...n):i(n),e.$$.on_mount=[]})),a.forEach(w)}(r,o.target,o.anchor),O()}var f,T;g(E)}let y;function x(e,t,n,i){const s=n[e]?.type;if(t="Boolean"===s&&"boolean"!=typeof t?null!=t:t,!i||!n[e])return t;if("toAttribute"===i)switch(s){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return null==t?null:t;default:return t}else switch(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}function D(e,t,n,i,s,r){let o=class extends y{constructor(){super(e,n,s),this.$$p_d=t}static get observedAttributes(){return Object.keys(t).map((e=>(t[e].attribute||e).toLowerCase()))}};return Object.keys(t).forEach((e=>{Object.defineProperty(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=x(e,n,t),this.$$d[e]=n,this.$$c?.$set({[e]:n})}})})),i.forEach((e=>{Object.defineProperty(o.prototype,e,{get(){return this.$$c?.[e]}})})),r&&(o=r(o)),e.element=o,o}"function"==typeof HTMLElement&&(y=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(e,t,n){super(),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 n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function e(e){return()=>{let t;return{c:function(){t=h("slot"),"default"!==e&&E(t,"name",e)},m:function(e,n){l(e,t,n)},d:function(e){e&&d(t)}}}}const t={},n=function(e){const t={};return e.childNodes.forEach((e=>{t[e.slot||"default"]=!0})),t}(this);for(const s of this.$$s)s in n&&(t[s]=[e(s)]);for(const r of this.attributes){const o=this.$$g_p(r.name);o in this.$$d||(this.$$d[o]=x(o,r.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||void 0===this[a]||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});const i=()=>{this.$$r=!0;for(const e in this.$$p_d)if(this.$$d[e]=this.$$c.$$.ctx[this.$$c.$$.props[e]],this.$$p_d[e].reflect){const t=x(e,this.$$d[e],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(const c in this.$$l)for(const u of this.$$l[c]){const m=this.$$c.$on(c,u);this.$$l_u.set(u,m)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=x(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(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 k{$$=void 0;$$set=void 0;$destroy(){N(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var M,Q;"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),function(e){e.CUSTOM_MESSAGE="custom-message",e.GET_CONTEXT_REQUEST="get-context-request",e.NAVIGATION_REQUEST="navigation-request",e.ALERT_REQUEST="show-alert-request",e.ALERT_CLOSED="close-alert-request",e.INITIALIZED="initialized",e.ADD_SEARCH_PARAMS_REQUEST="add-search-params-request",e.ADD_NODE_PARAMS_REQUEST="add-node-params-request",e.SHOW_CONFIRMATION_MODAL_REQUEST="show-confirmation-modal-request",e.SHOW_LOADING_INDICATOR_REQUEST="show-loading-indicator-request",e.HIDE_LOADING_INDICATOR_REQUEST="hide-loading-indicator-request",e.SET_CURRENT_LOCALE_REQUEST="set-current-locale-request",e.LOCAL_STORAGE_SET_REQUEST="set-storage-request",e.RUNTIME_ERROR_HANDLING_REQUEST="runtime-error-handling-request",e.SET_ANCHOR_LINK_REQUEST="set-anchor-request",e.SET_THIRD_PARTY_COOKIES_REQUEST="set-third-party-cookies-request",e.BACK_NAVIGATION_REQUEST="navigate-back-request",e.GET_CURRENT_ROUTE_REQUEST="get-current-route-request",e.NAVIGATION_COMPLETED_REPORT="report-navigation-completed-request",e.UPDATE_MODAL_PATH_DATA_REQUEST="update-modal-path-data-request",e.CHECK_PATH_EXISTS_REQUEST="check-path-exists-request",e.SET_DIRTY_STATUS_REQUEST="set-dirty-status-request"}(M||(M={})),function(e){e.CUSTOM_MESSAGE="custom",e.GET_CONTEXT="luigi.get-context",e.SEND_CONTEXT_HANDSHAKE="luigi.init",e.CONTEXT_RECEIVED="luigi.init.ok",e.NAVIGATION_REQUEST="luigi.navigation.open",e.ALERT_REQUEST="luigi.ux.alert.show",e.ALERT_CLOSED="luigi.ux.alert.hide",e.INITIALIZED="luigi.init.ok",e.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",e.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",e.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",e.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",e.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",e.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",e.LOCAL_STORAGE_SET_REQUEST="storage",e.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",e.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",e.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",e.BACK_NAVIGATION_REQUEST="luigi.navigation.back",e.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",e.SEND_CONTEXT_OBJECT="luigi.navigate",e.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",e.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",e.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",e.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty"}(Q||(Q={}));const H=new class{isFunction(e){return e&&"[object Function]"==={}.toString.call(e)}isObject(e){return!(!e||"object"!=typeof e||Array.isArray(e))}checkWebcomponentValue(e){return"string"==typeof e?JSON.parse(e):"boolean"==typeof e||"object"==typeof e?e:void console.warn("Webcomponent value has a wrong type.")}resolveContext(e){return e?"string"==typeof e?JSON.parse(e):e:{}}};class W{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){const i=n||"custom";if(e.iframe.contentWindow){const n=new URL(e.iframe.src);"custom"===i?e.iframe.contentWindow.postMessage({msg:i,data:t},n.origin):e.iframe.contentWindow.postMessage(Object.assign({msg:i},t),n.origin)}else console.error("Message target could not be resolved")}dispatch(e,t,n,i,s){const r=new CustomEvent(e,{detail:n});i&&H.isFunction(i)&&s&&(r[s]=e=>{i(e)}),t.dispatchEvent(r)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var i;(null===(i=n.iframeHandle)||void 0===i?void 0:i.iframe)&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var t,n;const i=this.getTargetContainer(e),s=null===(n=null===(t=null==i?void 0:i.iframeHandle)||void 0===t?void 0:t.iframe)||void 0===n?void 0:n.contentWindow;if(s&&s===e.source){const t=e.data.msg;switch(t){case Q.CUSTOM_MESSAGE:{const t=e.data.data,n=t.id;delete t.id,this.dispatch(M.CUSTOM_MESSAGE,i,{id:n,_metaData:{},data:t})}break;case Q.GET_CONTEXT:s.postMessage({msg:Q.SEND_CONTEXT_HANDSHAKE,context:i.context||{},internal:{}},"*");break;case Q.NAVIGATION_REQUEST:this.dispatch(M.NAVIGATION_REQUEST,i,e.data.params);break;case Q.ALERT_REQUEST:this.dispatch(M.ALERT_REQUEST,i,e);break;case Q.INITIALIZED:this.dispatch(M.INITIALIZED,i,e.data.params);break;case Q.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(M.ADD_SEARCH_PARAMS_REQUEST,i,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case Q.ADD_NODE_PARAMS_REQUEST:this.dispatch(M.ADD_NODE_PARAMS_REQUEST,i,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case Q.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatch(M.SHOW_CONFIRMATION_MODAL_REQUEST,i,e.data.data);break;case Q.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(M.SHOW_LOADING_INDICATOR_REQUEST,i,e);break;case Q.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(M.HIDE_LOADING_INDICATOR_REQUEST,i,e);break;case Q.SET_CURRENT_LOCALE_REQUEST:this.dispatch(M.SET_CURRENT_LOCALE_REQUEST,i,e);break;case Q.LOCAL_STORAGE_SET_REQUEST:this.dispatch(M.LOCAL_STORAGE_SET_REQUEST,i,e);break;case Q.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(M.RUNTIME_ERROR_HANDLING_REQUEST,i,e);break;case Q.SET_ANCHOR_LINK_REQUEST:this.dispatch(M.SET_ANCHOR_LINK_REQUEST,i,e);break;case Q.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(M.SET_THIRD_PARTY_COOKIES_REQUEST,i,e);break;case Q.BACK_NAVIGATION_REQUEST:this.dispatch(M.BACK_NAVIGATION_REQUEST,i,e);break;case Q.GET_CURRENT_ROUTE_REQUEST:this.dispatch(M.GET_CURRENT_ROUTE_REQUEST,i,e);break;case Q.NAVIGATION_COMPLETED_REPORT:this.dispatch(M.NAVIGATION_COMPLETED_REPORT,i,e);break;case Q.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatch(M.UPDATE_MODAL_PATH_DATA_REQUEST,i,e);break;case Q.CHECK_PATH_EXISTS_REQUEST:this.dispatch(M.CHECK_PATH_EXISTS_REQUEST,i,e);break;case Q.SET_DIRTY_STATUS_REQUEST:this.dispatch(M.SET_DIRTY_STATUS_REQUEST,i,e);break;default:console.warn("Functionality not yet implemented: ",t)}}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const G=new W;class j{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 F extends j{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=V({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 B extends j{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((t=>{if(t.minWidth||t.maxWidth){let i="@media only screen ";null!=t.minWidth&&(i+=`and (min-width: ${t.minWidth}px) `),null!=t.maxWidth&&(i+=`and (max-width: ${t.maxWidth}px) `),i+=`{\n .${e} {\n grid-template-columns: ${t.columns||"auto"};\n grid-template-rows: ${t.rows||"auto"};\n grid-gap: ${t.gap||"0"};\n }\n }\n `,n+=i}})),t.innerHTML=`\n <style scoped>\n .${e} {\n display: grid;\n grid-template-columns: ${this.config.columns||"auto"};\n grid-template-rows: ${this.config.rows||"auto"};\n grid-gap: ${this.config.gap||"0"};\n min-height: ${this.config.minHeight||"auto"};\n }\n ${n}\n </style>\n `,t}createCompoundItemContainer(e){const t=e||{},n=document.createElement("div");return n.setAttribute("style",`grid-row: ${t.row||"auto"}; grid-column: ${t.column||"auto"}`),n}}const V=e=>{const t=e.use;return t?"grid"===t?new B(e):t.createCompoundContainer||t.createCompoundItemContainer||t.attachCompoundItem?new F(e):new j(e):new j(e)},q=(e,t,n,i)=>{(null==t?void 0:t.eventListeners)&&t.eventListeners.forEach((t=>{const s=t.source+"."+t.name,r=e[s],o={wcElementId:n,wcElement:i,action:t.action,converter:t.dataConverter};r?r.push(o):e[s]=[o]}))};function K(e){return String(e).replaceAll("<","<").replaceAll(">",">").replaceAll(""",'"').replaceAll("'","'").replaceAll("/","/")}class X{constructor(){this.containerService=new W}dynamicImport(e){return Object.freeze(import(/* webpackIgnore: true */e))}processViewUrl(e,t){return e}attachWC(e,t,n,i,s,r,o){if(n&&n.contains(t)){const a=document.createElement(e);r&&a.setAttribute("nodeId",r),this.initWC(a,e,n,s,i,r,o),n.replaceChild(a,t),n._luigi_node&&(n._luigi_mfe_webcomponent=a),n.dispatchEvent(new Event("wc_ready"))}}dispatchLuigiEvent(e,t,n){this.containerService.dispatch(e,this.thisComponent,t,n)}createClientAPI(e,t,n,i,s){return{linkManager:()=>({navigate:e=>{this.dispatchLuigiEvent(M.NAVIGATION_REQUEST,{link:e})}}),uxManager:()=>({showAlert:e=>{this.dispatchLuigiEvent(M.ALERT_REQUEST,e)},showConfirmationModal:async e=>new Promise(((t,n)=>{this.dispatchLuigiEvent(M.SHOW_CONFIRMATION_MODAL_REQUEST,e,(e=>{e?t(e):n(new Error("No data"))}))})),getCurrentTheme:()=>this.thisComponent.theme}),getCurrentLocale:()=>this.thisComponent.locale,getActiveFeatureToggles:()=>this.thisComponent.activeFeatureToggleList||[],publishEvent:s=>{e&&e.eventBus&&e.eventBus.onPublishEvent(s,t,n);const r={id:s.type,_metaData:{nodeId:t,wc_id:n,src:i},data:s.detail};this.dispatchLuigiEvent(M.CUSTOM_MESSAGE,r)},luigiClientInit:()=>{this.dispatchLuigiEvent(M.INITIALIZED,{})},addNodeParams:(e,t)=>{s||this.dispatchLuigiEvent(M.ADD_NODE_PARAMS_REQUEST,{params:e,keepBrowserHistory:t})},getNodeParams:e=>{return s?{}:e?(t=this.thisComponent.nodeParams,Object.entries(t).reduce(((e,t)=>(e[K(t[0])]=K(t[1]),e)),{})):this.thisComponent.nodeParams||{};var t},setAnchor:e=>{s||this.dispatchLuigiEvent(M.SET_ANCHOR_LINK_REQUEST,e)},getAnchor:()=>this.thisComponent.anchor||"",getCoreSearchParams:()=>this.thisComponent.searchParams||{},getPathParams:()=>this.thisComponent.pathParams||{},getClientPermissions:()=>this.thisComponent.clientPermissions||{},getUserSettings:()=>this.thisComponent.userSettings||{}}}initWC(e,t,n,i,s,r,o){const a=this.createClientAPI(n,r,t,e,o);if(e.__postProcess){const t=new URL(document.baseURI).origin===new URL(i,document.baseURI).origin?new URL("./",new URL(i,document.baseURI)):new URL("./",i);e.__postProcess(s,a,t.origin+t.pathname)}else e.context=s,e.LuigiClient=a}generateWCId(e){let t="";const n=new URL(e,encodeURI(location.href)).href;for(let e=0;e<n.length;e++)t+=n.charCodeAt(e).toString(16);return"luigi-wc-"+t}registerWCFromUrl(e,t){const n=this.processViewUrl(e);return new Promise(((e,i)=>{if(this.checkWCUrl(n))this.dynamicImport(n).then((n=>{try{if(!window.customElements.get(t)){let e=n.default;if(!HTMLElement.isPrototypeOf(e)){const t=Object.keys(n);for(let i=0;i<t.length&&(e=n[t[i]],!HTMLElement.isPrototypeOf(e));i++);}window.customElements.define(t,e)}e(1)}catch(e){i(e)}})).catch((e=>{i(e)}));else{i(`Error: View URL '${n}' not allowed to be included`)}}))}includeSelfRegisteredWCFromUrl(e,t,n){if(this.checkWCUrl(t)){this.containerService.getContainerManager()._registerWebcomponent||(this.containerService.getContainerManager()._registerWebcomponent=(e,t)=>{window.customElements.define(this.generateWCId(e),t)}),window.Luigi||(window.Luigi={},window.Luigi._registerWebcomponent||(window.Luigi._registerWebcomponent=(e,t)=>{this.containerService.getContainerManager()._registerWebcomponent(e,t)}));const i=document.createElement("script");i.setAttribute("src",t),"module"===e.webcomponent.type&&i.setAttribute("type","module"),i.setAttribute("defer","true"),i.addEventListener("load",(()=>{n()})),document.body.appendChild(i)}else console.warn(`View URL '${t}' not allowed to be included`)}checkWCUrl(e){return!0}renderWebComponent(e,t,n,i,s,r){var o;const a=this.processViewUrl(e,{context:n}),c=(null===(o=null==i?void 0:i.webcomponent)||void 0===o?void 0:o.tagName)||this.generateWCId(a),u=document.createElement("div");t.appendChild(u),t._luigi_node=i,window.customElements.get(c)?this.attachWC(c,u,t,n,a,s,r):window.luigiWCFn?window.luigiWCFn(a,c,u,(()=>{this.attachWC(c,u,t,n,a,s,r)})):i.webcomponent&&i.webcomponent.selfRegistered?this.includeSelfRegisteredWCFromUrl(i,a,(()=>{this.attachWC(c,u,t,n,a,s,r)})):this.registerWCFromUrl(a,c).then((()=>{this.attachWC(c,u,t,n,a,s,r)})).catch((e=>{console.warn("ERROR =>",e),this.containerService.dispatch(M.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,e)}))}createCompoundContainerAsync(e,t,n){return new Promise(((i,s)=>{var r;if(e.viewUrl)try{const s=(null===(r=null==n?void 0:n.webcomponent)||void 0===r?void 0:r.tagName)||this.generateWCId(e.viewUrl);n.webcomponent&&n.webcomponent.selfRegistered?this.includeSelfRegisteredWCFromUrl(n,e.viewUrl,(()=>{const n=document.createElement(s);this.initWC(n,s,n,e.viewUrl,t,"_root"),i(n)})):this.registerWCFromUrl(e.viewUrl,s).then((()=>{const n=document.createElement(s);this.initWC(n,s,n,e.viewUrl,t,"_root"),i(n)})).catch((e=>{console.warn("Error: ",e),this.containerService.dispatch(M.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,e)}))}catch(e){s(e)}else i(e.createCompoundContainer())}))}renderWebComponentCompound(e,t,n){var i;let s;return e.webcomponent&&e.viewUrl?(s=new j,s.viewUrl=this.processViewUrl(e.viewUrl,{context:n}),s.createCompoundItemContainer=e=>{const t=document.createElement("div");return e&&e.slot&&t.setAttribute("slot",e.slot),t}):(null===(i=e.compound)||void 0===i?void 0:i.renderer)&&(s=V(e.compound.renderer)),s=s||new j,new Promise((i=>{this.createCompoundContainerAsync(s,n,e).then((r=>{var o;t._luigi_mfe_webcomponent=r,t._luigi_node=e;const a={};r.eventBus={listeners:a,onPublishEvent:(e,t,n)=>{const i=a[t+"."+e.type]||[];i.push(...a["*."+e.type]||[]),i.forEach((t=>{const n=t.wcElement||r.querySelector("[nodeId="+t.wcElementId+"]");n?n.dispatchEvent(new CustomEvent(t.action,{detail:t.converter?t.converter(e.detail):e.detail})):console.debug("Could not find event target",t)}))}},null===(o=e.compound)||void 0===o||o.children.forEach(((e,t)=>{const i=Object.assign(Object.assign({},n),e.context),o=s.createCompoundItemContainer(e.layoutConfig);o.eventBus=r.eventBus,s.attachCompoundItem(r,o);const c=e.id||"gen_"+t;this.renderWebComponent(e.viewUrl,o,i,e,c,!0),q(a,e,c)})),t.appendChild(r),q(a,e.compound,"_root",r),i(r)})).catch((e=>{console.warn("Error: ",e),this.containerService.dispatch(M.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,e)}))}))}}const z=new class{constructor(){this.updateContext=(e,t,n)=>{if(n){const i=t||{};G.sendCustomMessageToIframe(n,{context:e,internal:i,withoutSync:!0},Q.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.sendCustomMessage=(e,t,n,i,s)=>{if(n&&t._luigi_mfe_webcomponent)G.dispatch(e,t._luigi_mfe_webcomponent,s);else{const t=Object.assign({},s);t.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),t.id=e,G.sendCustomMessageToIframe(i,t)}}}closeAlert(e,t,n){G.sendCustomMessageToIframe(n,{id:e,dismissKey:t},Q.ALERT_CLOSED)}};function Z(e){let t,n=!e[2]&&J(e);return{c(){n&&n.c(),t=p()},m(e,i){n&&n.m(e,i),l(e,t,i)},p(e,i){e[2]?n&&(n.d(1),n=null):n?n.p(e,i):(n=J(e),n.c(),n.m(t.parentNode,t))},d(e){e&&d(t),n&&n.d(e)}}}function J(e){let t,n;return{c(){t=h("iframe"),c(t.src,n=e[0])||E(t,"src",n),E(t,"title",e[1])},m(n,i){l(n,t,i),e[20](t)},p(e,i){1&i&&!c(t.src,n=e[0])&&E(t,"src",n),2&i&&E(t,"title",e[1])},d(n){n&&d(t),e[20](null)}}}function Y(e){let t;return{c(){t=h("style"),t.textContent="main,\n iframe {\n width: 100%;\n height: 100%;\n border: none;\n }\n\n main.lui-isolated {\n line-height: 0;\n }"},m(e,n){l(e,t,n)},d(e){e&&d(t)}}}function ee(t){let n,i,s,r,o=t[6]&&Z(t),a=!t[3]&&Y();return{c(){n=h("main"),o&&o.c(),s=m(" "),a&&a.c(),r=p(),E(n,"class",i=t[2]?void 0:"lui-isolated")},m(e,i){l(e,n,i),o&&o.m(n,null),t[21](n),l(e,s,i),a&&a.m(e,i),l(e,r,i)},p(e,[t]){e[6]?o?o.p(e,t):(o=Z(e),o.c(),o.m(n,null)):o&&(o.d(1),o=null),4&t&&i!==(i=e[2]?void 0:"lui-isolated")&&E(n,"class",i),e[3]?a&&(a.d(1),a=null):a||(a=Y(),a.c(),a.m(r.parentNode,r))},i:e,o:e,d(e){e&&(d(n),d(s),d(r)),o&&o.d(),t[21](null),a&&a.d(e)}}}function te(e,t,n){let{viewurl:i}=t,{context:s}=t,{label:r}=t,{webcomponent:o}=t,{deferInit:a}=t,{noShadow:c}=t,{locale:u}=t,{theme:l}=t,{activeFeatureToggleList:d}=t,{skipInitCheck:h}=t,{nodeParams:m}=t,{searchParams:p}=t,{pathParams:E}=t,{clientPermissions:g}=t,{userSettings:f}=t,{anchor:C}=t;const S={};let R,b=!1;const w=new X,A=e=>{if(!b){e.sendCustomMessage=(t,n)=>{z.sendCustomMessage(t,c?e:R,!!o,S,n)},e.updateContext=(t,n)=>{o?(c?e:R)._luigi_mfe_webcomponent.context=t:z.updateContext(t,n,S)},e.closeAlert=(e,t)=>{z.closeAlert(e,t,S)},G.registerContainer(e),w.thisComponent=e;const t=H.resolveContext(s);if(o){const n=c?e:R;n.innerHTML="";const s=H.checkWebcomponentValue(o);w.renderWebComponent(i,n,t,"object"==typeof s?{webcomponent:s}:{})}h?(e.initialized=!0,setTimeout((()=>{w.dispatchLuigiEvent(M.INITIALIZED,{})}))):o&&(c?e:R).addEventListener("wc_ready",(()=>{var t;(null===(t=(c?e:R)._luigi_mfe_webcomponent)||void 0===t?void 0:t.deferLuigiClientWCInit)||(e.initialized=!0,w.dispatchLuigiEvent(M.INITIALIZED,{}))})),n(6,b=!0),e.containerInitialized=!0}};var I;return $((async()=>{const e=R.getRootNode()===document?R.parentNode:R.getRootNode().host;e.iframeHandle=S,e.init=()=>{A(e)},a||A(e)})),I=async()=>{},_().$$.on_destroy.push(I),e.$$set=e=>{"viewurl"in e&&n(0,i=e.viewurl),"context"in e&&n(7,s=e.context),"label"in e&&n(1,r=e.label),"webcomponent"in e&&n(2,o=e.webcomponent),"deferInit"in e&&n(8,a=e.deferInit),"noShadow"in e&&n(3,c=e.noShadow),"locale"in e&&n(9,u=e.locale),"theme"in e&&n(10,l=e.theme),"activeFeatureToggleList"in e&&n(11,d=e.activeFeatureToggleList),"skipInitCheck"in e&&n(12,h=e.skipInitCheck),"nodeParams"in e&&n(13,m=e.nodeParams),"searchParams"in e&&n(14,p=e.searchParams),"pathParams"in e&&n(15,E=e.pathParams),"clientPermissions"in e&&n(16,g=e.clientPermissions),"userSettings"in e&&n(17,f=e.userSettings),"anchor"in e&&n(18,C=e.anchor)},[i,r,o,c,S,R,b,s,a,u,l,d,h,m,p,E,g,f,C,()=>u&&l&&d&&m&&p&&E&&g&&f&&C,function(e){T[e?"unshift":"push"]((()=>{S.iframe=e,n(4,S)}))},function(e){T[e?"unshift":"push"]((()=>{R=e,n(5,R)}))}]}class ne extends k{constructor(e){super(),L(this,e,te,ee,r,{viewurl:0,context:7,label:1,webcomponent:2,deferInit:8,noShadow:3,locale:9,theme:10,activeFeatureToggleList:11,skipInitCheck:12,nodeParams:13,searchParams:14,pathParams:15,clientPermissions:16,userSettings:17,anchor:18,unwarn:19})}get viewurl(){return this.$$.ctx[0]}set viewurl(e){this.$$set({viewurl:e}),O()}get context(){return this.$$.ctx[7]}set context(e){this.$$set({context:e}),O()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),O()}get webcomponent(){return this.$$.ctx[2]}set webcomponent(e){this.$$set({webcomponent:e}),O()}get deferInit(){return this.$$.ctx[8]}set deferInit(e){this.$$set({deferInit:e}),O()}get noShadow(){return this.$$.ctx[3]}set noShadow(e){this.$$set({noShadow:e}),O()}get locale(){return this.$$.ctx[9]}set locale(e){this.$$set({locale:e}),O()}get theme(){return this.$$.ctx[10]}set theme(e){this.$$set({theme:e}),O()}get activeFeatureToggleList(){return this.$$.ctx[11]}set activeFeatureToggleList(e){this.$$set({activeFeatureToggleList:e}),O()}get skipInitCheck(){return this.$$.ctx[12]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),O()}get nodeParams(){return this.$$.ctx[13]}set nodeParams(e){this.$$set({nodeParams:e}),O()}get searchParams(){return this.$$.ctx[14]}set searchParams(e){this.$$set({searchParams:e}),O()}get pathParams(){return this.$$.ctx[15]}set pathParams(e){this.$$set({pathParams:e}),O()}get clientPermissions(){return this.$$.ctx[16]}set clientPermissions(e){this.$$set({clientPermissions:e}),O()}get userSettings(){return this.$$.ctx[17]}set userSettings(e){this.$$set({userSettings:e}),O()}get anchor(){return this.$$.ctx[18]}set anchor(e){this.$$set({anchor:e}),O()}get unwarn(){return this.$$.ctx[19]}}function ie(e){u(e,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function se(t){let n;return{c(){n=h("main"),E(n,"class","svelte-1buc46y")},m(e,i){l(e,n,i),t[13](n)},p:e,i:e,o:e,d(e){e&&d(n),t[13](null)}}}function re(e,t,n){let i,s,{viewurl:r}=t,{webcomponent:o}=t,{context:a}=t,{deferInit:c}=t,{compoundConfig:u}=t,{nodeParams:l}=t,{searchParams:d}=t,{pathParams:h}=t,{clientPermissions:m}=t,{userSettings:p}=t,{anchor:E}=t,g=!1;const _=new W,f=new X,C=e=>{if(!u||g)return;e.updateContext=(e,t)=>{n(0,i._luigi_mfe_webcomponent.context=e,i)};const t=H.resolveContext(a);n(1,c=!1);const l={compound:u,viewUrl:r,webcomponent:H.checkWebcomponentValue(o)||!0};f.renderWebComponentCompound(l,i,t).then((t=>{s=t,e.hasAttribute("skip-init-check")||!l.viewUrl?(e.initialized=!0,setTimeout((()=>{f.dispatchLuigiEvent(M.INITIALIZED,{})}))):s.LuigiClient&&!s.deferLuigiClientWCInit&&(e.initialized=!0,f.dispatchLuigiEvent(M.INITIALIZED,{}))})),g=!0,e.containerInitialized=!0};return $((async()=>{const e=i.getRootNode().host;e.init=()=>{C(e)},c||C(e),_.registerContainer(e),f.thisComponent=e})),e.$$set=e=>{"viewurl"in e&&n(2,r=e.viewurl),"webcomponent"in e&&n(3,o=e.webcomponent),"context"in e&&n(4,a=e.context),"deferInit"in e&&n(1,c=e.deferInit),"compoundConfig"in e&&n(5,u=e.compoundConfig),"nodeParams"in e&&n(6,l=e.nodeParams),"searchParams"in e&&n(7,d=e.searchParams),"pathParams"in e&&n(8,h=e.pathParams),"clientPermissions"in e&&n(9,m=e.clientPermissions),"userSettings"in e&&n(10,p=e.userSettings),"anchor"in e&&n(11,E=e.anchor)},[i,c,r,o,a,u,l,d,h,m,p,E,()=>l&&d&&h&&m&&p&&E,function(e){T[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}D(ne,{viewurl:{type:"String",reflect:!1,attribute:"viewurl"},context:{type:"String",reflect:!1,attribute:"context"},label:{type:"String",reflect:!1,attribute:"label"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"},deferInit:{type:"Boolean",attribute:"defer-init"},noShadow:{type:"Boolean",attribute:"no-shadow"},locale:{type:"String",reflect:!1,attribute:"locale"},theme:{type:"String",reflect:!1,attribute:"theme"},activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},anchor:{type:"String",reflect:!1,attribute:"anchor"}},[],["unwarn"],!0,(e=>{let t=e=>()=>console.warn(e+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends e{sendCustomMessage=t("sendCustomMessage");updateContext=t("updateContext");closeAlert=t("closeAlert");attachShadow(e){return this.hasAttribute("no-shadow")?this:super.attachShadow(e)}attributeChangedCallback(e,t,n){this.containerInitialized&&"context"===e&&this.updateContext(JSON.parse(n))}}}));class oe extends k{constructor(e){super(),L(this,e,re,se,r,{viewurl:2,webcomponent:3,context:4,deferInit:1,compoundConfig:5,nodeParams:6,searchParams:7,pathParams:8,clientPermissions:9,userSettings:10,anchor:11,unwarn:12},ie)}get viewurl(){return this.$$.ctx[2]}set viewurl(e){this.$$set({viewurl:e}),O()}get webcomponent(){return this.$$.ctx[3]}set webcomponent(e){this.$$set({webcomponent:e}),O()}get context(){return this.$$.ctx[4]}set context(e){this.$$set({context:e}),O()}get deferInit(){return this.$$.ctx[1]}set deferInit(e){this.$$set({deferInit:e}),O()}get compoundConfig(){return this.$$.ctx[5]}set compoundConfig(e){this.$$set({compoundConfig:e}),O()}get nodeParams(){return this.$$.ctx[6]}set nodeParams(e){this.$$set({nodeParams:e}),O()}get searchParams(){return this.$$.ctx[7]}set searchParams(e){this.$$set({searchParams:e}),O()}get pathParams(){return this.$$.ctx[8]}set pathParams(e){this.$$set({pathParams:e}),O()}get clientPermissions(){return this.$$.ctx[9]}set clientPermissions(e){this.$$set({clientPermissions:e}),O()}get userSettings(){return this.$$.ctx[10]}set userSettings(e){this.$$set({userSettings:e}),O()}get anchor(){return this.$$.ctx[11]}set anchor(e){this.$$set({anchor:e}),O()}get unwarn(){return this.$$.ctx[12]}}D(oe,{viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},anchor:{type:"String",reflect:!1,attribute:"anchor"}},[],["unwarn"],!0,(e=>class extends e{updateContext=(e=>()=>console.warn(e+" can't be called on luigi-container before its micro frontend is attached to the DOM."))("updateContext");attributeChangedCallback(e,t,n){this.containerInitialized&&"context"===e&&this.updateContext(JSON.parse(n))}}));var ae=M;customElements.get("luigi-container")||customElements.define("luigi-container",ne.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",oe.element);export{oe as LuigiCompoundContainer,ne as LuigiContainer,ae as default};
|
|
1
|
+
function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function s(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let o,a;function c(t,e){return t===e||(o||(o=document.createElement("a")),o.href=e,t===o.href)}function u(t,e,n){const i=function(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;if(e&&e.host)return e;return t.ownerDocument}(t);if(!i.getElementById(e)){const t=h("style");t.id=e,t.textContent=n,function(t,e){(function(t,e){t.appendChild(e)})(t.head||t,e),e.sheet}(i,t)}}function l(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function h(t){return document.createElement(t)}function m(t){return document.createTextNode(t)}function p(){return m("")}function E(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t){a=t}function g(){if(!a)throw new Error("Function called outside component initialization");return a}function $(t){g().$$.on_mount.push(t)}const T=[],f=[];let S=[];const C=[],R=Promise.resolve();let b=!1;function A(t){S.push(t)}const w=new Set;let I=0;function O(){if(0!==I)return;const t=a;do{try{for(;I<T.length;){const t=T[I];I++,_(t),v(t.$$)}}catch(t){throw T.length=0,I=0,t}for(_(null),T.length=0,I=0;f.length;)f.pop()();for(let t=0;t<S.length;t+=1){const e=S[t];w.has(e)||(w.add(e),e())}S.length=0}while(T.length);for(;C.length;)C.pop()();b=!1,w.clear(),_(t)}function v(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(A)}}const U=new Set;function N(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];S.forEach((i=>-1===t.indexOf(i)?e.push(i):n.push(i))),n.forEach((t=>t())),S=e}(n.after_update),i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function y(t,e){-1===t.$$.dirty[0]&&(T.push(t),b||(b=!0,R.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function L(r,o,c,u,l,h,m=null,p=[-1]){const E=a;_(r);const g=r.$$={fragment:null,ctx:[],props:h,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(E?E.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:o.target||E.$$.root};m&&m(g.root);let $=!1;if(g.ctx=c?c(r,o.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return g.ctx&&l(g.ctx[t],g.ctx[t]=i)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](i),$&&y(r,t)),e})):[],g.update(),$=!0,i(g.before_update),g.fragment=!!u&&u(g.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);g.fragment&&g.fragment.l(t),t.forEach(d)}else g.fragment&&g.fragment.c();o.intro&&((T=r.$$.fragment)&&T.i&&(U.delete(T),T.i(f))),function(t,n,r){const{fragment:o,after_update:a}=t.$$;o&&o.m(n,r),A((()=>{const n=t.$$.on_mount.map(e).filter(s);t.$$.on_destroy?t.$$.on_destroy.push(...n):i(n),t.$$.on_mount=[]})),a.forEach(A)}(r,o.target,o.anchor),O()}var T,f;_(E)}let P;function x(t,e,n,i){const s=n[t]?.type;if(e="Boolean"===s&&"boolean"!=typeof e?null!=e:e,!i||!n[t])return e;if("toAttribute"===i)switch(s){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(s){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}function D(t,e,n,i,s,r){let o=class extends P{constructor(){super(t,n,s),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((t=>(e[t].attribute||t).toLowerCase()))}};return Object.keys(e).forEach((t=>{Object.defineProperty(o.prototype,t,{get(){return this.$$c&&t in this.$$c?this.$$c[t]:this.$$d[t]},set(n){n=x(t,n,e),this.$$d[t]=n,this.$$c?.$set({[t]:n})}})})),i.forEach((t=>{Object.defineProperty(o.prototype,t,{get(){return this.$$c?.[t]}})})),r&&(o=r(o)),t.element=o,o}"function"==typeof HTMLElement&&(P=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(t,e,n){super(),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=h("slot"),"default"!==t&&E(e,"name",t)},m:function(t,n){l(t,e,n)},d:function(t){t&&d(e)}}}}const e={},n=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const s of this.$$s)s in n&&(e[s]=[t(s)]);for(const r of this.attributes){const o=this.$$g_p(r.name);o in this.$$d||(this.$$d[o]=x(o,r.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||void 0===this[a]||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});const i=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=x(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(this.$$p_d[t].attribute||t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(const c in this.$$l)for(const u of this.$$l[c]){const m=this.$$c.$on(c,u);this.$$l_u.set(u,m)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=x(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});class k{$$=void 0;$$set=void 0;$destroy(){N(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var Q,M;"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),function(t){t.CUSTOM_MESSAGE="custom-message",t.GET_CONTEXT_REQUEST="get-context-request",t.NAVIGATION_REQUEST="navigation-request",t.ALERT_REQUEST="show-alert-request",t.ALERT_CLOSED="close-alert-request",t.INITIALIZED="initialized",t.ADD_SEARCH_PARAMS_REQUEST="add-search-params-request",t.ADD_NODE_PARAMS_REQUEST="add-node-params-request",t.SHOW_CONFIRMATION_MODAL_REQUEST="show-confirmation-modal-request",t.SHOW_LOADING_INDICATOR_REQUEST="show-loading-indicator-request",t.HIDE_LOADING_INDICATOR_REQUEST="hide-loading-indicator-request",t.SET_CURRENT_LOCALE_REQUEST="set-current-locale-request",t.LOCAL_STORAGE_SET_REQUEST="set-storage-request",t.RUNTIME_ERROR_HANDLING_REQUEST="runtime-error-handling-request",t.SET_ANCHOR_LINK_REQUEST="set-anchor-request",t.SET_THIRD_PARTY_COOKIES_REQUEST="set-third-party-cookies-request",t.BACK_NAVIGATION_REQUEST="navigate-back-request",t.GET_CURRENT_ROUTE_REQUEST="get-current-route-request",t.NAVIGATION_COMPLETED_REPORT="report-navigation-completed-request",t.UPDATE_MODAL_PATH_DATA_REQUEST="update-modal-path-data-request",t.CHECK_PATH_EXISTS_REQUEST="check-path-exists-request",t.SET_DIRTY_STATUS_REQUEST="set-dirty-status-request",t.SET_VIEW_GROUP_DATA_REQUEST="set-viewgroup-data-request",t.SET_DOCUMENT_TITLE_REQUEST="set-document-title-request",t.OPEN_USER_SETTINGS_REQUEST="open-user-settings-request",t.CLOSE_USER_SETTINGS_REQUEST="close-user-settings-request",t.COLLAPSE_LEFT_NAV_REQUEST="collapse-leftnav-request",t.UPDATE_TOP_NAVIGATION_REQUEST="update-top-navigation-request",t.PATH_EXISTS_REQUEST="path-exists-request",t.GO_BACK_REQUEST="go-back-request",t.HAS_BACK_REQUEST="has-back-request",t.REMOVE_BACKDROP_REQUEST="remove-backdrop-request"}(Q||(Q={})),function(t){t.CUSTOM_MESSAGE="custom",t.GET_CONTEXT="luigi.get-context",t.SEND_CONTEXT_HANDSHAKE="luigi.init",t.CONTEXT_RECEIVED="luigi.init.ok",t.NAVIGATION_REQUEST="luigi.navigation.open",t.ALERT_REQUEST="luigi.ux.alert.show",t.ALERT_CLOSED="luigi.ux.alert.hide",t.INITIALIZED="luigi.init.ok",t.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",t.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",t.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",t.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",t.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",t.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",t.LOCAL_STORAGE_SET_REQUEST="storage",t.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",t.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",t.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",t.BACK_NAVIGATION_REQUEST="luigi.navigation.back",t.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",t.SEND_CONTEXT_OBJECT="luigi.navigate",t.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",t.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",t.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",t.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty"}(M||(M={}));const H=new class{isFunction(t){return t&&"[object Function]"==={}.toString.call(t)}isObject(t){return!(!t||"object"!=typeof t||Array.isArray(t))}checkWebcomponentValue(t){return"string"==typeof t?JSON.parse(t):"boolean"==typeof t||"object"==typeof t?t:void console.warn("Webcomponent value has a wrong type.")}resolveContext(t){return t?"string"==typeof t?JSON.parse(t):t:{}}};class W{isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}sendCustomMessageToIframe(t,e,n){const i=n||"custom";if(t.iframe.contentWindow){const n=new URL(t.iframe.src);"custom"===i?t.iframe.contentWindow.postMessage({msg:i,data:e},n.origin):t.iframe.contentWindow.postMessage(Object.assign({msg:i},e),n.origin)}else console.error("Message target could not be resolved")}dispatch(t,e,n,i,s){const r=new CustomEvent(t,{detail:n});i&&H.isFunction(i)&&s&&(r[s]=t=>{i(t)}),e.dispatchEvent(r)}getTargetContainer(t){let e;return globalThis.__luigi_container_manager.container.forEach((n=>{var i;(null===(i=n.iframeHandle)||void 0===i?void 0:i.iframe)&&n.iframeHandle.iframe.contentWindow===t.source&&(e=n)})),e}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:t=>{var e,n;const i=this.getTargetContainer(t),s=null===(n=null===(e=null==i?void 0:i.iframeHandle)||void 0===e?void 0:e.iframe)||void 0===n?void 0:n.contentWindow;if(s&&s===t.source){const e=t.data.msg;switch(e){case M.CUSTOM_MESSAGE:{const e=t.data.data,n=e.id;delete e.id,this.dispatch(Q.CUSTOM_MESSAGE,i,{id:n,_metaData:{},data:e})}break;case M.GET_CONTEXT:s.postMessage({msg:M.SEND_CONTEXT_HANDSHAKE,context:i.context||{},internal:{}},"*");break;case M.NAVIGATION_REQUEST:this.dispatch(Q.NAVIGATION_REQUEST,i,t.data.params);break;case M.ALERT_REQUEST:this.dispatch(Q.ALERT_REQUEST,i,t);break;case M.INITIALIZED:this.dispatch(Q.INITIALIZED,i,t.data.params);break;case M.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(Q.ADD_SEARCH_PARAMS_REQUEST,i,{data:t.data.data,keepBrowserHistory:t.data.keepBrowserHistory});break;case M.ADD_NODE_PARAMS_REQUEST:this.dispatch(Q.ADD_NODE_PARAMS_REQUEST,i,{data:t.data.data,keepBrowserHistory:t.data.keepBrowserHistory});break;case M.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatch(Q.SHOW_CONFIRMATION_MODAL_REQUEST,i,t.data.data);break;case M.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(Q.SHOW_LOADING_INDICATOR_REQUEST,i,t);break;case M.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(Q.HIDE_LOADING_INDICATOR_REQUEST,i,t);break;case M.SET_CURRENT_LOCALE_REQUEST:this.dispatch(Q.SET_CURRENT_LOCALE_REQUEST,i,t);break;case M.LOCAL_STORAGE_SET_REQUEST:this.dispatch(Q.LOCAL_STORAGE_SET_REQUEST,i,t);break;case M.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(Q.RUNTIME_ERROR_HANDLING_REQUEST,i,t);break;case M.SET_ANCHOR_LINK_REQUEST:this.dispatch(Q.SET_ANCHOR_LINK_REQUEST,i,t);break;case M.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(Q.SET_THIRD_PARTY_COOKIES_REQUEST,i,t);break;case M.BACK_NAVIGATION_REQUEST:this.dispatch(Q.BACK_NAVIGATION_REQUEST,i,t);break;case M.GET_CURRENT_ROUTE_REQUEST:this.dispatch(Q.GET_CURRENT_ROUTE_REQUEST,i,t);break;case M.NAVIGATION_COMPLETED_REPORT:this.dispatch(Q.NAVIGATION_COMPLETED_REPORT,i,t);break;case M.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatch(Q.UPDATE_MODAL_PATH_DATA_REQUEST,i,t);break;case M.CHECK_PATH_EXISTS_REQUEST:this.dispatch(Q.CHECK_PATH_EXISTS_REQUEST,i,t);break;case M.SET_DIRTY_STATUS_REQUEST:this.dispatch(Q.SET_DIRTY_STATUS_REQUEST,i,t);break;default:console.warn("Functionality not yet implemented: ",e)}}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(t){this.getContainerManager().container.push(t)}}const G=new W;class B{constructor(t){t?(this.rendererObject=t,this.config=t.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(t){return document.createElement("div")}attachCompoundItem(t,e){t.appendChild(e)}}class j extends B{constructor(t){super(t||{use:{}}),t&&t.use&&t.use.extends&&(this.superRenderer=q({use:t.use.extends,config:t.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(t){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(t,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(t):super.createCompoundItemContainer(t)}attachCompoundItem(t,e){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(t,e,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(t,e):super.attachCompoundItem(t,e)}}class V extends B{createCompoundContainer(){const t="__lui_compound_"+(new Date).getTime(),e=document.createElement("div");e.classList.add(t);let n="";return this.config.layouts&&this.config.layouts.forEach((e=>{if(e.minWidth||e.maxWidth){let i="@media only screen ";null!=e.minWidth&&(i+=`and (min-width: ${e.minWidth}px) `),null!=e.maxWidth&&(i+=`and (max-width: ${e.maxWidth}px) `),i+=`{\n .${t} {\n grid-template-columns: ${e.columns||"auto"};\n grid-template-rows: ${e.rows||"auto"};\n grid-gap: ${e.gap||"0"};\n }\n }\n `,n+=i}})),e.innerHTML=`\n <style scoped>\n .${t} {\n display: grid;\n grid-template-columns: ${this.config.columns||"auto"};\n grid-template-rows: ${this.config.rows||"auto"};\n grid-gap: ${this.config.gap||"0"};\n min-height: ${this.config.minHeight||"auto"};\n }\n ${n}\n </style>\n `,e}createCompoundItemContainer(t){const e=t||{},n=document.createElement("div");return n.setAttribute("style",`grid-row: ${e.row||"auto"}; grid-column: ${e.column||"auto"}`),n}}const q=t=>{const e=t.use;return e?"grid"===e?new V(t):e.createCompoundContainer||e.createCompoundItemContainer||e.attachCompoundItem?new j(t):new B(t):new B(t)},F=(t,e,n,i)=>{(null==e?void 0:e.eventListeners)&&e.eventListeners.forEach((e=>{const s=e.source+"."+e.name,r=t[s],o={wcElementId:n,wcElement:i,action:e.action,converter:e.dataConverter};r?r.push(o):t[s]=[o]}))};function K(t){return String(t).replaceAll("<","<").replaceAll(">",">").replaceAll(""",'"').replaceAll("'","'").replaceAll("/","/")}class X{constructor(){this.containerService=new W}dynamicImport(t){return Object.freeze(import(/* webpackIgnore: true */t))}processViewUrl(t,e){return t}attachWC(t,e,n,i,s,r,o){if(n&&n.contains(e)){const a=document.createElement(t);r&&a.setAttribute("nodeId",r),this.initWC(a,t,n,s,i,r,o),n.replaceChild(a,e),n._luigi_node&&(n._luigi_mfe_webcomponent=a),n.dispatchEvent(new Event("wc_ready"))}}dispatchLuigiEvent(t,e,n){this.containerService.dispatch(t,this.thisComponent,e,n)}createClientAPI(t,e,n,i,s){return{linkManager:()=>{let t=null,e=!1,n=!1,i={};const s={navigate:(s,r={})=>{const o=Object.assign({fromContext:t,fromClosestContext:e,fromVirtualTreeRoot:n,nodeParams:i},r);this.dispatchLuigiEvent(Q.NAVIGATION_REQUEST,Object.assign({link:s},o))},fromClosestContext:()=>(e=!0,s),fromContext:e=>(t=e,s),fromVirtualTreeRoot:()=>(n=!0,s),withParams:t=>(i=t,s),updateTopNavigation:()=>{this.dispatchLuigiEvent(Q.UPDATE_TOP_NAVIGATION_REQUEST,{})},pathExists:()=>new Promise(((t,e)=>{this.containerService.dispatch(Q.PATH_EXISTS_REQUEST,this.thisComponent,{},(n=>{n?t(!0):e(!1)}),"callback")})),openAsDrawer:(t,e={})=>{s.navigate(t,{drawer:e})},openAsModal:(t,e={})=>{s.navigate(t,{modal:e})},openAsSplitView:(t,e={})=>{s.navigate(t,{splitView:e})},goBack:t=>{this.dispatchLuigiEvent(Q.GO_BACK_REQUEST,t)},hasBack:()=>!1};return s},uxManager:()=>({showAlert:t=>{this.dispatchLuigiEvent(Q.ALERT_REQUEST,t)},showConfirmationModal:async t=>new Promise(((e,n)=>{this.dispatchLuigiEvent(Q.SHOW_CONFIRMATION_MODAL_REQUEST,t,(t=>{t?e(t):n(new Error("No data"))}))})),getCurrentTheme:()=>this.thisComponent.theme,closeUserSettings:()=>{this.dispatchLuigiEvent(Q.CLOSE_USER_SETTINGS_REQUEST,this.thisComponent.userSettings)},openUserSettings:()=>{this.dispatchLuigiEvent(Q.OPEN_USER_SETTINGS_REQUEST,this.thisComponent.userSettings)},collapseLeftSideNav:()=>{this.dispatchLuigiEvent(Q.COLLAPSE_LEFT_NAV_REQUEST,{})},getDirtyStatus:()=>this.thisComponent.dirtyStatus||!1,getDocumentTitle:()=>this.thisComponent.documentTitle,setDocumentTitle:t=>{this.dispatchLuigiEvent(Q.SET_DOCUMENT_TITLE_REQUEST,t)},removeBackdrop:()=>{this.dispatchLuigiEvent(Q.REMOVE_BACKDROP_REQUEST,{})},hideAppLoadingIndicator:()=>{this.dispatchLuigiEvent(Q.HIDE_LOADING_INDICATOR_REQUEST,{})}}),getCurrentLocale:()=>this.thisComponent.locale,getActiveFeatureToggles:()=>this.thisComponent.activeFeatureToggleList||[],publishEvent:s=>{t&&t.eventBus&&t.eventBus.onPublishEvent(s,e,n);const r={id:s.type,_metaData:{nodeId:e,wc_id:n,src:i},data:s.detail};this.dispatchLuigiEvent(Q.CUSTOM_MESSAGE,r)},luigiClientInit:()=>{this.dispatchLuigiEvent(Q.INITIALIZED,{})},addNodeParams:(t,e)=>{s||this.dispatchLuigiEvent(Q.ADD_NODE_PARAMS_REQUEST,{params:t,keepBrowserHistory:e})},getNodeParams:t=>{return s?{}:t?(e=this.thisComponent.nodeParams,Object.entries(e).reduce(((t,e)=>(t[K(e[0])]=K(e[1]),t)),{})):this.thisComponent.nodeParams||{};var e},setAnchor:t=>{s||this.dispatchLuigiEvent(Q.SET_ANCHOR_LINK_REQUEST,t)},getAnchor:()=>this.thisComponent.anchor||"",getCoreSearchParams:()=>this.thisComponent.searchParams||{},getPathParams:()=>this.thisComponent.pathParams||{},getClientPermissions:()=>this.thisComponent.clientPermissions||{},getUserSettings:()=>this.thisComponent.userSettings||{},setViewGroupData:t=>{this.dispatchLuigiEvent(Q.SET_VIEW_GROUP_DATA_REQUEST,t)}}}initWC(t,e,n,i,s,r,o){const a=this.createClientAPI(n,r,e,t,o);if(t.__postProcess){const e=new URL(document.baseURI).origin===new URL(i,document.baseURI).origin?new URL("./",new URL(i,document.baseURI)):new URL("./",i);t.__postProcess(s,a,e.origin+e.pathname)}else t.context=s,t.LuigiClient=a}generateWCId(t){let e="";const n=new URL(t,encodeURI(location.href)).href;for(let t=0;t<n.length;t++)e+=n.charCodeAt(t).toString(16);return"luigi-wc-"+e}registerWCFromUrl(t,e){const n=this.processViewUrl(t);return new Promise(((t,i)=>{if(this.checkWCUrl(n))this.dynamicImport(n).then((n=>{try{if(!window.customElements.get(e)){let t=n.default;if(!HTMLElement.isPrototypeOf(t)){const e=Object.keys(n);for(let i=0;i<e.length&&(t=n[e[i]],!HTMLElement.isPrototypeOf(t));i++);}window.customElements.define(e,t)}t(1)}catch(t){i(t)}})).catch((t=>{i(t)}));else{i(`Error: View URL '${n}' not allowed to be included`)}}))}includeSelfRegisteredWCFromUrl(t,e,n){if(this.checkWCUrl(e)){this.containerService.getContainerManager()._registerWebcomponent||(this.containerService.getContainerManager()._registerWebcomponent=(t,e)=>{window.customElements.define(this.generateWCId(t),e)}),window.Luigi||(window.Luigi={},window.Luigi._registerWebcomponent||(window.Luigi._registerWebcomponent=(t,e)=>{this.containerService.getContainerManager()._registerWebcomponent(t,e)}));const i=document.createElement("script");i.setAttribute("src",e),"module"===t.webcomponent.type&&i.setAttribute("type","module"),i.setAttribute("defer","true"),i.addEventListener("load",(()=>{n()})),document.body.appendChild(i)}else console.warn(`View URL '${e}' not allowed to be included`)}checkWCUrl(t){return!0}renderWebComponent(t,e,n,i,s,r){var o;const a=this.processViewUrl(t,{context:n}),c=(null===(o=null==i?void 0:i.webcomponent)||void 0===o?void 0:o.tagName)||this.generateWCId(a),u=document.createElement("div");e.appendChild(u),e._luigi_node=i,window.customElements.get(c)?this.attachWC(c,u,e,n,a,s,r):window.luigiWCFn?window.luigiWCFn(a,c,u,(()=>{this.attachWC(c,u,e,n,a,s,r)})):i.webcomponent&&i.webcomponent.selfRegistered?this.includeSelfRegisteredWCFromUrl(i,a,(()=>{this.attachWC(c,u,e,n,a,s,r)})):this.registerWCFromUrl(a,c).then((()=>{this.attachWC(c,u,e,n,a,s,r)})).catch((t=>{console.warn("ERROR =>",t),this.containerService.dispatch(Q.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,t)}))}createCompoundContainerAsync(t,e,n){return new Promise(((i,s)=>{var r;if(t.viewUrl)try{const s=(null===(r=null==n?void 0:n.webcomponent)||void 0===r?void 0:r.tagName)||this.generateWCId(t.viewUrl);n.webcomponent&&n.webcomponent.selfRegistered?this.includeSelfRegisteredWCFromUrl(n,t.viewUrl,(()=>{const n=document.createElement(s);this.initWC(n,s,n,t.viewUrl,e,"_root"),i(n)})):this.registerWCFromUrl(t.viewUrl,s).then((()=>{const n=document.createElement(s);this.initWC(n,s,n,t.viewUrl,e,"_root"),i(n)})).catch((t=>{console.warn("Error: ",t),this.containerService.dispatch(Q.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,t)}))}catch(t){s(t)}else i(t.createCompoundContainer())}))}renderWebComponentCompound(t,e,n){var i;let s;return t.webcomponent&&t.viewUrl?(s=new B,s.viewUrl=this.processViewUrl(t.viewUrl,{context:n}),s.createCompoundItemContainer=t=>{const e=document.createElement("div");return t&&t.slot&&e.setAttribute("slot",t.slot),e}):(null===(i=t.compound)||void 0===i?void 0:i.renderer)&&(s=q(t.compound.renderer)),s=s||new B,new Promise((i=>{this.createCompoundContainerAsync(s,n,t).then((r=>{var o;e._luigi_mfe_webcomponent=r,e._luigi_node=t;const a={};r.eventBus={listeners:a,onPublishEvent:(t,e,n)=>{const i=a[e+"."+t.type]||[];i.push(...a["*."+t.type]||[]),i.forEach((e=>{const n=e.wcElement||r.querySelector("[nodeId="+e.wcElementId+"]");n?n.dispatchEvent(new CustomEvent(e.action,{detail:e.converter?e.converter(t.detail):t.detail})):console.debug("Could not find event target",e)}))}},null===(o=t.compound)||void 0===o||o.children.forEach(((t,e)=>{const i=Object.assign(Object.assign({},n),t.context),o=s.createCompoundItemContainer(t.layoutConfig);o.eventBus=r.eventBus,s.attachCompoundItem(r,o);const c=t.id||"gen_"+e;this.renderWebComponent(t.viewUrl,o,i,t,c,!0),F(a,t,c)})),e.appendChild(r),F(a,t.compound,"_root",r),i(r)})).catch((t=>{console.warn("Error: ",t),this.containerService.dispatch(Q.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,t)}))}))}}const z=new class{constructor(){this.updateContext=(t,e,n)=>{if(n){const i=e||{};G.sendCustomMessageToIframe(n,{context:t,internal:i,withoutSync:!0},M.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.sendCustomMessage=(t,e,n,i,s)=>{if(n&&e._luigi_mfe_webcomponent)G.dispatch(t,e._luigi_mfe_webcomponent,s);else{const e=Object.assign({},s);e.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),e.id=t,G.sendCustomMessageToIframe(i,e)}}}closeAlert(t,e,n){G.sendCustomMessageToIframe(n,{id:t,dismissKey:e},M.ALERT_CLOSED)}};function Z(t){let e,n=!t[2]&&J(t);return{c(){n&&n.c(),e=p()},m(t,i){n&&n.m(t,i),l(t,e,i)},p(t,i){t[2]?n&&(n.d(1),n=null):n?n.p(t,i):(n=J(t),n.c(),n.m(e.parentNode,e))},d(t){t&&d(e),n&&n.d(t)}}}function J(t){let e,n;return{c(){e=h("iframe"),c(e.src,n=t[0])||E(e,"src",n),E(e,"title",t[1])},m(n,i){l(n,e,i),t[25](e)},p(t,i){1&i&&!c(e.src,n=t[0])&&E(e,"src",n),2&i&&E(e,"title",t[1])},d(n){n&&d(e),t[25](null)}}}function Y(t){let e;return{c(){e=h("style"),e.textContent="main,\n iframe {\n width: 100%;\n height: 100%;\n border: none;\n }\n\n main.lui-isolated {\n line-height: 0;\n }"},m(t,n){l(t,e,n)},d(t){t&&d(e)}}}function tt(e){let n,i,s,r,o=e[6]&&Z(e),a=!e[3]&&Y();return{c(){n=h("main"),o&&o.c(),s=m(" "),a&&a.c(),r=p(),E(n,"class",i=e[2]?void 0:"lui-isolated")},m(t,i){l(t,n,i),o&&o.m(n,null),e[26](n),l(t,s,i),a&&a.m(t,i),l(t,r,i)},p(t,[e]){t[6]?o?o.p(t,e):(o=Z(t),o.c(),o.m(n,null)):o&&(o.d(1),o=null),4&e&&i!==(i=t[2]?void 0:"lui-isolated")&&E(n,"class",i),t[3]?a&&(a.d(1),a=null):a||(a=Y(),a.c(),a.m(r.parentNode,r))},i:t,o:t,d(t){t&&(d(n),d(s),d(r)),o&&o.d(),e[26](null),a&&a.d(t)}}}function et(t,e,n){let{viewurl:i}=e,{context:s}=e,{label:r}=e,{webcomponent:o}=e,{deferInit:a}=e,{noShadow:c}=e,{locale:u}=e,{theme:l}=e,{activeFeatureToggleList:d}=e,{skipInitCheck:h}=e,{nodeParams:m}=e,{searchParams:p}=e,{pathParams:E}=e,{clientPermissions:_}=e,{dirtyStatus:T}=e,{hasBack:S}=e,{documentTitle:C}=e,{allowRules:R}=e,{sandboxRules:b}=e,{userSettings:A}=e,{anchor:w}=e;const I={};let O,v=!1;const U=new X,N=t=>{if(!v){t.sendCustomMessage=(e,n)=>{z.sendCustomMessage(e,c?t:O,!!o,I,n)},t.updateContext=(e,n)=>{o?(c?t:O)._luigi_mfe_webcomponent.context=e:z.updateContext(e,n,I)},t.closeAlert=(t,e)=>{z.closeAlert(t,e,I)},G.registerContainer(t),U.thisComponent=t;const e=H.resolveContext(s);if(o){const n=c?t:O;n.innerHTML="";const s=H.checkWebcomponentValue(o);U.renderWebComponent(i,n,e,"object"==typeof s?{webcomponent:s}:{})}h?(t.initialized=!0,setTimeout((()=>{U.dispatchLuigiEvent(Q.INITIALIZED,{})}))):o&&(c?t:O).addEventListener("wc_ready",(()=>{var e;(null===(e=(c?t:O)._luigi_mfe_webcomponent)||void 0===e?void 0:e.deferLuigiClientWCInit)||(t.initialized=!0,U.dispatchLuigiEvent(Q.INITIALIZED,{}))})),n(6,v=!0),t.containerInitialized=!0}};var y;return $((async()=>{const t=O.getRootNode()===document?O.parentNode:O.getRootNode().host;t.iframeHandle=I,t.init=()=>{N(t)},a||N(t)})),y=async()=>{},g().$$.on_destroy.push(y),t.$$set=t=>{"viewurl"in t&&n(0,i=t.viewurl),"context"in t&&n(7,s=t.context),"label"in t&&n(1,r=t.label),"webcomponent"in t&&n(2,o=t.webcomponent),"deferInit"in t&&n(8,a=t.deferInit),"noShadow"in t&&n(3,c=t.noShadow),"locale"in t&&n(9,u=t.locale),"theme"in t&&n(10,l=t.theme),"activeFeatureToggleList"in t&&n(11,d=t.activeFeatureToggleList),"skipInitCheck"in t&&n(12,h=t.skipInitCheck),"nodeParams"in t&&n(13,m=t.nodeParams),"searchParams"in t&&n(14,p=t.searchParams),"pathParams"in t&&n(15,E=t.pathParams),"clientPermissions"in t&&n(16,_=t.clientPermissions),"dirtyStatus"in t&&n(17,T=t.dirtyStatus),"hasBack"in t&&n(18,S=t.hasBack),"documentTitle"in t&&n(19,C=t.documentTitle),"allowRules"in t&&n(20,R=t.allowRules),"sandboxRules"in t&&n(21,b=t.sandboxRules),"userSettings"in t&&n(22,A=t.userSettings),"anchor"in t&&n(23,w=t.anchor)},[i,r,o,c,I,O,v,s,a,u,l,d,h,m,p,E,_,T,S,C,R,b,A,w,()=>u&&l&&d&&m&&p&&E&&_&&A&&w&&T&&S&&C&&R&&b,function(t){f[t?"unshift":"push"]((()=>{I.iframe=t,n(4,I)}))},function(t){f[t?"unshift":"push"]((()=>{O=t,n(5,O)}))}]}class nt extends k{constructor(t){super(),L(this,t,et,tt,r,{viewurl:0,context:7,label:1,webcomponent:2,deferInit:8,noShadow:3,locale:9,theme:10,activeFeatureToggleList:11,skipInitCheck:12,nodeParams:13,searchParams:14,pathParams:15,clientPermissions:16,dirtyStatus:17,hasBack:18,documentTitle:19,allowRules:20,sandboxRules:21,userSettings:22,anchor:23,unwarn:24})}get viewurl(){return this.$$.ctx[0]}set viewurl(t){this.$$set({viewurl:t}),O()}get context(){return this.$$.ctx[7]}set context(t){this.$$set({context:t}),O()}get label(){return this.$$.ctx[1]}set label(t){this.$$set({label:t}),O()}get webcomponent(){return this.$$.ctx[2]}set webcomponent(t){this.$$set({webcomponent:t}),O()}get deferInit(){return this.$$.ctx[8]}set deferInit(t){this.$$set({deferInit:t}),O()}get noShadow(){return this.$$.ctx[3]}set noShadow(t){this.$$set({noShadow:t}),O()}get locale(){return this.$$.ctx[9]}set locale(t){this.$$set({locale:t}),O()}get theme(){return this.$$.ctx[10]}set theme(t){this.$$set({theme:t}),O()}get activeFeatureToggleList(){return this.$$.ctx[11]}set activeFeatureToggleList(t){this.$$set({activeFeatureToggleList:t}),O()}get skipInitCheck(){return this.$$.ctx[12]}set skipInitCheck(t){this.$$set({skipInitCheck:t}),O()}get nodeParams(){return this.$$.ctx[13]}set nodeParams(t){this.$$set({nodeParams:t}),O()}get searchParams(){return this.$$.ctx[14]}set searchParams(t){this.$$set({searchParams:t}),O()}get pathParams(){return this.$$.ctx[15]}set pathParams(t){this.$$set({pathParams:t}),O()}get clientPermissions(){return this.$$.ctx[16]}set clientPermissions(t){this.$$set({clientPermissions:t}),O()}get dirtyStatus(){return this.$$.ctx[17]}set dirtyStatus(t){this.$$set({dirtyStatus:t}),O()}get hasBack(){return this.$$.ctx[18]}set hasBack(t){this.$$set({hasBack:t}),O()}get documentTitle(){return this.$$.ctx[19]}set documentTitle(t){this.$$set({documentTitle:t}),O()}get allowRules(){return this.$$.ctx[20]}set allowRules(t){this.$$set({allowRules:t}),O()}get sandboxRules(){return this.$$.ctx[21]}set sandboxRules(t){this.$$set({sandboxRules:t}),O()}get userSettings(){return this.$$.ctx[22]}set userSettings(t){this.$$set({userSettings:t}),O()}get anchor(){return this.$$.ctx[23]}set anchor(t){this.$$set({anchor:t}),O()}get unwarn(){return this.$$.ctx[24]}}function it(t){u(t,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function st(e){let n;return{c(){n=h("main"),E(n,"class","svelte-1buc46y")},m(t,i){l(t,n,i),e[16](n)},p:t,i:t,o:t,d(t){t&&d(n),e[16](null)}}}function rt(t,e,n){let i,s,{viewurl:r}=e,{webcomponent:o}=e,{context:a}=e,{deferInit:c}=e,{compoundConfig:u}=e,{nodeParams:l}=e,{searchParams:d}=e,{pathParams:h}=e,{clientPermissions:m}=e,{userSettings:p}=e,{anchor:E}=e,{dirtyStatus:_}=e,{hasBack:g}=e,{documentTitle:T}=e,S=!1;const C=new W,R=new X,b=t=>{if(!u||S)return;t.updateContext=(t,e)=>{n(0,i._luigi_mfe_webcomponent.context=t,i)};const e=H.resolveContext(a);n(1,c=!1);const l={compound:u,viewUrl:r,webcomponent:H.checkWebcomponentValue(o)||!0};R.renderWebComponentCompound(l,i,e).then((e=>{s=e,t.hasAttribute("skip-init-check")||!l.viewUrl?(t.initialized=!0,setTimeout((()=>{R.dispatchLuigiEvent(Q.INITIALIZED,{})}))):s.LuigiClient&&!s.deferLuigiClientWCInit&&(t.initialized=!0,R.dispatchLuigiEvent(Q.INITIALIZED,{}))})),S=!0,t.containerInitialized=!0};return $((async()=>{const t=i.getRootNode().host;t.init=()=>{b(t)},c||b(t),C.registerContainer(t),R.thisComponent=t})),t.$$set=t=>{"viewurl"in t&&n(2,r=t.viewurl),"webcomponent"in t&&n(3,o=t.webcomponent),"context"in t&&n(4,a=t.context),"deferInit"in t&&n(1,c=t.deferInit),"compoundConfig"in t&&n(5,u=t.compoundConfig),"nodeParams"in t&&n(6,l=t.nodeParams),"searchParams"in t&&n(7,d=t.searchParams),"pathParams"in t&&n(8,h=t.pathParams),"clientPermissions"in t&&n(9,m=t.clientPermissions),"userSettings"in t&&n(10,p=t.userSettings),"anchor"in t&&n(11,E=t.anchor),"dirtyStatus"in t&&n(12,_=t.dirtyStatus),"hasBack"in t&&n(13,g=t.hasBack),"documentTitle"in t&&n(14,T=t.documentTitle)},[i,c,r,o,a,u,l,d,h,m,p,E,_,g,T,()=>l&&d&&h&&m&&p&&E&&_&&g&&T,function(t){f[t?"unshift":"push"]((()=>{i=t,n(0,i)}))}]}D(nt,{viewurl:{type:"String",reflect:!1,attribute:"viewurl"},context:{type:"String",reflect:!1,attribute:"context"},label:{type:"String",reflect:!1,attribute:"label"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"},deferInit:{type:"Boolean",attribute:"defer-init"},noShadow:{type:"Boolean",attribute:"no-shadow"},locale:{type:"String",reflect:!1,attribute:"locale"},theme:{type:"String",reflect:!1,attribute:"theme"},activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},allowRules:{type:"Array",reflect:!1,attribute:"allow-rules"},sandboxRules:{type:"Array",reflect:!1,attribute:"sandbox-rules"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},anchor:{type:"String",reflect:!1,attribute:"anchor"}},[],["unwarn"],!0,(t=>{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 t{sendCustomMessage=e("sendCustomMessage");updateContext=e("updateContext");closeAlert=e("closeAlert");attachShadow(t){return this.hasAttribute("no-shadow")?this:super.attachShadow(t)}attributeChangedCallback(t,e,n){this.containerInitialized&&"context"===t&&this.updateContext(JSON.parse(n))}}}));class ot extends k{constructor(t){super(),L(this,t,rt,st,r,{viewurl:2,webcomponent:3,context:4,deferInit:1,compoundConfig:5,nodeParams:6,searchParams:7,pathParams:8,clientPermissions:9,userSettings:10,anchor:11,dirtyStatus:12,hasBack:13,documentTitle:14,unwarn:15},it)}get viewurl(){return this.$$.ctx[2]}set viewurl(t){this.$$set({viewurl:t}),O()}get webcomponent(){return this.$$.ctx[3]}set webcomponent(t){this.$$set({webcomponent:t}),O()}get context(){return this.$$.ctx[4]}set context(t){this.$$set({context:t}),O()}get deferInit(){return this.$$.ctx[1]}set deferInit(t){this.$$set({deferInit:t}),O()}get compoundConfig(){return this.$$.ctx[5]}set compoundConfig(t){this.$$set({compoundConfig:t}),O()}get nodeParams(){return this.$$.ctx[6]}set nodeParams(t){this.$$set({nodeParams:t}),O()}get searchParams(){return this.$$.ctx[7]}set searchParams(t){this.$$set({searchParams:t}),O()}get pathParams(){return this.$$.ctx[8]}set pathParams(t){this.$$set({pathParams:t}),O()}get clientPermissions(){return this.$$.ctx[9]}set clientPermissions(t){this.$$set({clientPermissions:t}),O()}get userSettings(){return this.$$.ctx[10]}set userSettings(t){this.$$set({userSettings:t}),O()}get anchor(){return this.$$.ctx[11]}set anchor(t){this.$$set({anchor:t}),O()}get dirtyStatus(){return this.$$.ctx[12]}set dirtyStatus(t){this.$$set({dirtyStatus:t}),O()}get hasBack(){return this.$$.ctx[13]}set hasBack(t){this.$$set({hasBack:t}),O()}get documentTitle(){return this.$$.ctx[14]}set documentTitle(t){this.$$set({documentTitle:t}),O()}get unwarn(){return this.$$.ctx[15]}}D(ot,{viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},anchor:{type:"String",reflect:!1,attribute:"anchor"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"}},[],["unwarn"],!0,(t=>class extends t{updateContext=(t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM."))("updateContext");attributeChangedCallback(t,e,n){this.containerInitialized&&"context"===t&&this.updateContext(JSON.parse(n))}}));var at=Q;customElements.get("luigi-container")||customElements.define("luigi-container",nt.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",ot.element);export{ot as LuigiCompoundContainer,nt as LuigiContainer,at as default};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|