@luzmo/analytics-components-kit 1.0.9-beta.3 → 1.0.9-beta.5
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/README.md +1 -1
- package/package.json +2 -2
- package/react/package.json +2 -2
- package/standalone/chunks/base-Cgmw1Vq_.js +2 -0
- package/standalone/chunks/display-settings-binning-CxpvhW7Y.js +38 -0
- package/standalone/chunks/display-settings-datetime-Cqptoxuq.js +199 -0
- package/standalone/chunks/display-settings-grand-totals-BJp7zJPj.js +26 -0
- package/standalone/chunks/display-settings-numeric-BskLgQmz.js +172 -0
- package/standalone/chunks/{display-settings-period-over-period-Bwjoji3a.js → display-settings-period-over-period-CbUd7uc9.js} +1 -1
- package/standalone/chunks/embed-EnSdYTW8.js +228 -0
- package/standalone/chunks/{filters-C1yU7w2V.js → filters-CTsIpQ2T.js} +68 -68
- package/standalone/chunks/{formula-codemirror-BAlhe79s.js → formula-codemirror-4wlUAHrO.js} +1 -1
- package/standalone/chunks/item-option-action-button-group-DZW0HRGd.js +35 -0
- package/standalone/chunks/item-option-base-BlSnktzl.js +38 -0
- package/standalone/chunks/item-option-color-palette-picker-jnEt02PP.js +22 -0
- package/standalone/chunks/{item-option-color-picker-59il-pkm.js → item-option-color-picker-CcElYCgD.js} +1 -1
- package/standalone/chunks/item-option-color-range-DTFbs7JK.js +80 -0
- package/standalone/chunks/item-option-guidelines-DFlj41ZE.js +117 -0
- package/standalone/chunks/{item-option-multi-language-field-BNn4WFUG.js → item-option-multi-language-field-DVc8-FVc.js} +1 -1
- package/standalone/chunks/{item-option-number-field-_lCPA_qC.js → item-option-number-field-B1V-8Nq-.js} +1 -1
- package/standalone/chunks/item-option-panel-CpyguQjh.js +298 -0
- package/standalone/chunks/{item-option-picker-CeK7QDTm.js → item-option-picker-BCrQSP1O.js} +1 -1
- package/standalone/chunks/item-option-position-picker-CLiGzaZ1.js +14 -0
- package/standalone/chunks/item-option-positions-number-field-DmFdahh8.js +31 -0
- package/standalone/chunks/{item-option-radio-button-group-DR7gdaTr.js → item-option-radio-button-group-nioc7wyo.js} +1 -1
- package/standalone/chunks/item-option-slider-BfXB8U09.js +15 -0
- package/standalone/chunks/{item-option-switch-DJfnhpf_.js → item-option-switch-DPF9lIX0.js} +1 -1
- package/standalone/chunks/{item-option-text-field-DNqL7Evw.js → item-option-text-field-CRbhs_g4.js} +1 -1
- package/standalone/chunks/item-slot-picker-panel-B_7VXYPs.js +439 -0
- package/standalone/chunks/load-data-fields-for-datasets-fBp1YEFi.js +25 -0
- package/standalone/chunks/{load-formula-codemirror-Cyqo4LoE.js → load-formula-codemirror-DcjxFIW6.js} +1 -1
- package/standalone/chunks/localized-mixin-YSDMfLKU.js +2 -0
- package/standalone/chunks/{luzmo-icon-markup-GqF25og5.js → luzmo-icon-markup-JO3eup7O.js} +1 -1
- package/standalone/chunks/luzmoCog-C4v4vc5N.js +2 -0
- package/standalone/chunks/luzmoLockOutline-Dctb86HR.js +2 -0
- package/standalone/chunks/luzmoTable-BYeZ8pW6.js +2 -0
- package/standalone/chunks/task-CTUsEtxU.js +2 -0
- package/standalone/chunks/themes-BD5sKr3j.js +2 -0
- package/standalone/chunks/v4-CI0qP0ur.js +2 -0
- package/standalone/interactive-viz-item.js +20 -246
- package/standalone/item-grid.js +115 -0
- package/standalone/manifest.json +40 -33
- package/standalone/chunks/base-DOKoeL4P.js +0 -2
- package/standalone/chunks/display-settings-binning-CTWsdo0F.js +0 -38
- package/standalone/chunks/display-settings-datetime-CdxMI-9Q.js +0 -199
- package/standalone/chunks/display-settings-grand-totals-BCW8hefp.js +0 -26
- package/standalone/chunks/display-settings-numeric-D04OO7n9.js +0 -172
- package/standalone/chunks/item-option-action-button-group-B3cugMc_.js +0 -35
- package/standalone/chunks/item-option-base-R8-N5_rE.js +0 -38
- package/standalone/chunks/item-option-color-palette-picker-CMZyo1NH.js +0 -22
- package/standalone/chunks/item-option-color-range-BWaElfwS.js +0 -80
- package/standalone/chunks/item-option-guidelines-BzvrNruz.js +0 -117
- package/standalone/chunks/item-option-panel-CyE_83Hf.js +0 -298
- package/standalone/chunks/item-option-position-picker-BAWZpDBA.js +0 -14
- package/standalone/chunks/item-option-positions-number-field-DjhFmMAp.js +0 -31
- package/standalone/chunks/item-option-slider-C_jierlR.js +0 -15
- package/standalone/chunks/item-slot-picker-panel-Bqmx51Yb.js +0 -439
- package/standalone/chunks/load-data-fields-for-datasets-_VJWUFPO.js +0 -25
- package/standalone/chunks/localized-mixin-BEfBwOPN.js +0 -2
- package/standalone/chunks/task-C3c3OWyi.js +0 -2
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
|
|
2
|
+
import{LitElement as e,css as t,html as n,property as r,query as i,state as a,styleMap as o}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.0/standalone/lit.js";var s=(e,t)=>{let n=`The dashboard component encountered an error`;typeof t?.dashboardId==`string`&&(n+=` for dashboard with id ${t.dashboardId}`),typeof t?.dashboardSlug==`string`&&(n+=` for dashboard with slug ${t.dashboardSlug}`),typeof t?.container==`string`&&(n+=` in container ${t.container}`),e&&(n+=`:
|
|
3
|
+
${e}`,console.warn(n))},c=e=>{let t=!1,n=``,r=(document.body||document.documentElement).style,i={svg:!!(`createElementNS`in document&&document.createElementNS(`http://www.w3.org/2000/svg`,`svg`).createSVGRect),flexbox:r.webkitFlexWrap===``||r.flexWrap===``,postMessage:!!window.postMessage};for(let r of[`svg`,`flexbox`,`postMessage`])i[r]||(t=!0,e.browserNotSupported=e.browserNotSupported||[],e.browserNotSupported.push(r),n+=`Your browser does not support: ${r}
|
|
4
|
+
`);let a=window.navigator.userAgent,o=a.includes(`MSIE`),c=a.includes(`Trident/`);(o||c)&&(t=!0,n=`IE is not supported.`),t&&s(n)},l={appServer:`https://app.luzmo.com/`,apiHost:`https://api.luzmo.com/`,dashboardId:null,dashboardSlug:null,container:null,key:null,token:null,language:`auto`,editorLanguage:`auto`,editMode:null,screenMode:null,switchScreenModeOnResize:!0,itemId:null,theme:``,mainColor:``,itemDimensions:{width:`auto`,height:`auto`},loaderBackground:`#f9f9f9`,loaderFontColor:`#5a5a5a`,loaderSpinnerColor:`rgb(68, 52, 255)`,loaderSpinnerBackground:`rgba(169, 169, 169, 0.14)`,timezoneId:null,contextId:null},u=[{mode:`mobile`,width:[150,767]},{mode:`tablet`,width:[768,1199]},{mode:`desktop`,width:[1200,1599]},{mode:`largeScreen`,width:[1600,9999]},{mode:`fixed`,width:[]}],d={initializing:{en:`Initializing...`,nl:`Laden...`,fr:`Chargement...`,de:`Initialisiere...`,es:`Inicializando...`},errorDashboard:{en:`Oops, we could not load this dashboard!`,nl:`Oeps, we konden het dashboard niet laden.`,fr:`Le chargement a echoué.`,de:`Hoppla, wir konnten dieses Dashboard nicht laden!`,es:`¡Ups! No pudimos cargar este tablero.`},errorItem:{en:`Oops, we could not load this item!`,nl:`Oeps, we konden de grafiek niet laden.`,fr:`Le chargement a echoué.`,de:`Hoppla, wir konnten dieses Diagramm nicht laden!`,es:`¡Ups! No pudimos cargar este elemento.`}},f=e=>e?e.endsWith(`/`)?e:`${e}/`:``,p=e=>e?e.endsWith(`/`)?e.slice(0,-1):e:``,m=(e,t,n,r)=>{let i=(e,t)=>{let n=e.users.find(e=>e.id===t.id),r=n&&n.userAccessRight?{flagRead:n.userAccessRight.flagRead,flagUse:n.userAccessRight.flagUse,flagModify:n.userAccessRight.flagModify,flagOwn:n.userAccessRight.flagOwn}:{flagRead:!1,flagUse:!1,flagModify:!1,flagOwn:!1},i=e.groups.filter(e=>t.userGroups.includes(e.id)||e.public===!0).map(e=>{if(e.groupAccessRight)return e.groupAccessRight});for(let e of i)!r.flagRead&&e.flagRead&&(r.flagRead=e.flagRead),!r.flagUse&&e.flagUse&&(r.flagUse=e.flagUse),!r.flagModify&&e.flagModify&&(r.flagModify=e.flagModify),!r.flagOwn&&e.flagOwn&&(r.flagOwn=e.flagOwn);let a=e.integrations?.length>0?e.integrations.map(e=>{if(e.integrationAccessRight)return e.integrationAccessRight}):[];for(let e of a)!r.flagRead&&e.flagRead&&(r.flagRead=e.flagRead),!r.flagUse&&e.flagUse&&(r.flagUse=e.flagUse),!r.flagModify&&e.flagModify&&(r.flagModify=e.flagModify);return r},a=(e,t)=>{if(e==null)return``;if(typeof e!=`object`||Object.keys(e).length===0)return typeof e==`object`&&Object.keys(e).length===0?``:e;let n;return n=t&&e[t]?e[t]:e[Object.keys(e)[0]],n??=``,n},o=[];for(let s of e){let e={accessibleBy:[],accessRights:i(s,n),id:s.id,modifiedAt:s.modified_at,name:a(s.name,r.language),slug:null,tags:s.tags.map(e=>e.tag).sort((e,t)=>e.localeCompare(t))},c=s.integrations.find(e=>e.id===t);c?.integrationAccessRight?.slug&&(e.slug=c.integrationAccessRight.slug);let l=s.users.map(e=>({model:`User`,id:e.id,name:a(e.name,n.locale_id)})),u=s.groups.map(e=>({model:`Group`,id:e.id,name:a(e.name,n.locale_id)||{}})),d=s.integrations.map(e=>({model:`Integration`,id:e.id,name:a(e.name,n.locale_id)||{}}));e.accessibleBy=[...l,...u,...d],o.push(e)}return o},h=e=>{let t=/^(%20|\s)*(javascript|data)/im,n=/[^\u0020-\u007E]/gim,r=/^([^:]+):/gm,i=new Set([`.`,`/`]),a=e=>i.has(e[0]);if(!e)return`about:blank`;let o=e.replaceAll(n,``).trim();if(a(o))return o;let s=o.match(r);if(!s)return o;let c=s[0];return t.test(c)?`about:blank`:o},g=e=>JSON.parse(JSON.stringify(e)),_=e=>e&&typeof e==`object`,ee=(e,t)=>(Object.entries(t).forEach(([t,n])=>{t in e?e[t]===void 0?e[t]=n:e[t]=_(n)?ee(e[t],n):e[t]:e[t]=n}),e),v=()=>`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replaceAll(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)}),te=e=>{let t=[],{appServer:n,language:r,editorLanguage:i,loaderBackground:a,loaderSpinnerColor:o,loaderSpinnerBackground:s,loaderFontColor:c,screenMode:l,key:u,token:d,timezoneId:p,itemEmbedding:m,itemDimensions:g,dashboardId:_,dashboardSlug:ee,itemId:v,theme:te,mainColor:ne,editMode:y}=e.params;r&&r!==`auto`&&t.push(`language=${r}`),i&&i!==`auto`&&t.push(`editorLanguage=${i}`),a&&t.push(`ldrbg=${a}`),c&&t.push(`ldrftclr=${c}`),o&&t.push(`ldrspclr=${o}`),s&&t.push(`ldrspbg=${s}`),te&&t.push(`theme=${te}`),ne&&t.push(`mainColor=${ne}`),l&&l!==`auto`&&t.push(`screenMode=${l}`),p&&t.push(`timezoneId=`+p),m&&g&&g.width&&t.push(`width=`+g.width),m&&g&&g.height&&t.push(`height=`+g.height),y&&t.push(`editMode=`+y);let b=u&&d?`#`+u+`:`+d:``;t.push(`version=`+(e.libVersion||`0.0.0-unknown-luzmo`));let re=f(n);return h(m?`${re}i/${_||ee}/${v}?${encodeURIComponent(t.join(`&`))}${b}`:`${re}i/${_||ee}?${encodeURIComponent(t.join(`&`))}${b}`)},ne=e=>{let t;(e.params.error||e.browserNotSupported.length>0)&&(e.params.error=!0,e.browserNotSupported&&(t=`Browser is not supported.`));let n=d.initializing[e.params.language]||d.initializing.en;return e.browserNotSupported||e.params.error?{loadingMsg:n,errorMsg:t}:{loadingMsg:n,errorMsg:``}};function y(e,t,n){e.promises[t]&&(e.promises[t].resolve(n),delete e.promises[t])}function b(e,t,n){e.promises[t]&&(e.promises[t].reject(n),delete e.promises[t])}function re(e){let t={};return e.params.loaderBackground&&!e.iframeLoaded&&(t.background=e.params.loaderBackground),t}function ie(e){let t=e.params.itemDimensions?.height||l.itemDimensions.height,n=e.params.itemEmbedding&&t!==`auto`;return{display:e.iframeLoaded?`none`:``,height:`${n?t:e.minHeight}px`}}function ae(e){let t=e.params.loaderBackground||l.loaderBackground;if(e.params.itemEmbedding){e.loaderSize=24,e.borderWidth=4,e.minHeight=200;let n=e.params.itemDimensions?.width||l.itemDimensions.width,r=e.params.itemDimensions?.height||l.itemDimensions.height,i=n!==`auto`,a=r!==`auto`;return{background:t,width:i?`${n}px`:`100%`,height:`${a?r:`200`}px`,"min-height":a?``:`200px`}}return{background:t}}function oe(e){let{loaderSpinnerColor:t,loaderSpinnerBackground:n}=l,r=le(e.borderWidth,e.params.loaderSpinnerColor||t),i=le(e.borderWidth,e.params.loaderSpinnerBackground||n),a=`${e.loaderSize}px`;return{"border-top":r,"border-right":r,"border-bottom":i,"border-left":i,width:a,height:a}}function se(e){let t=e.params.itemDimensions?.height||l.itemDimensions.height,n=e.params.itemEmbedding&&t!==`auto`;return{padding:`${e.params.itemId?(t=>`${(t-e.loaderSize-32)/2}px`)(n?Number.parseInt(`${t}`,10):e.minHeight):`128px`} 16px`}}function ce(e){let t=e.params.itemDimensions?.height||l.itemDimensions.height,n=e.params.itemDimensions?.width||l.itemDimensions.width;e.params.itemEmbedding&&t!==`auto`?e.iframeHeight=`${t}px`:e.params.itemEmbedding?e.iframeHeight=`200px`:[`editFull`,`editLimited`].includes(e.params.editMode)?e.iframeHeight=`100%`:e.iframeHeight=`400px`,e.iframeWidth=e.params.itemEmbedding&&n!==`auto`?`${n}px`:`100%`;let r={height:e.iframeHeight,width:e.iframeWidth};return e.iframeLoaded?r.opacity=1:e.error?(r.opacity=1,r.width=`100%`,r.height=`400px`):r.opacity=0,r}function le(e,t){return`${e}px solid ${t}`}var ue=(e,t)=>{e?.contentWindow&&e.contentWindow.location.replace(t)},de=(e,t,n)=>{let r=v();return t?.contentWindow?(t.contentWindow.postMessage({action:`exportDashboard`,format:n||`png`,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(Error(`exportDashboard request timed out.`)),delete e.promises[r])},12e5)})):Promise.reject(Error(`Cannot retrieve contentWindow.`))},fe=async e=>{if(await e.updateComplete,(e.currentAuthKey??e.authKey)&&(e.currentAuthToken??e.authToken)){let t=new Promise((t,n)=>{(()=>{try{window.fetch(`${f(e.params.apiHost)}0.1.0/authorization`,{method:`POST`,mode:`cors`,cache:`no-cache`,headers:{"Content-Type":`application/json`},redirect:`follow`,body:JSON.stringify({action:`get`,version:`0.1.0`,key:e.currentAuthKey??e.authKey,token:e.currentAuthToken??e.authToken,find:{where:{id:e.authKey},attributes:[`id`,`integration_id`],include:[{model:`User`,attributes:[`id`,`name`,`locale_id`],include:[{model:`Group`}]}]}})}).then(e=>e.json()).then(e=>{!e||!e.rows||e.rows.length===0||!e.rows[0].user?n(`Authorization failed, please check authKey and authToken. If the problem persists, please contact support@luzmo.com.`):(e.rows[0].user.userGroups=e.rows[0].user.groups.map(e=>e.id),delete e.rows[0].user.groups,t({integrationId:e.rows[0].integration_id,user:e.rows[0].user}))})}catch(e){n(e)}})()});return new Promise((n,r)=>void(()=>{try{t.then(t=>{window.fetch(`${f(e.params.apiHost)}0.1.0/securable`,{method:`POST`,mode:`cors`,cache:`no-cache`,headers:{"Content-Type":`application/json`},redirect:`follow`,body:JSON.stringify({action:`get`,version:`0.1.0`,key:e.currentAuthKey??e.authKey,token:e.currentAuthToken??e.authToken,find:{where:{type:`dashboard`,is_variant:!1},attributes:[`id`,`name`,`modified_at`],order:[[`modified_at`,`desc`]],include:[{model:`Tag`,attributes:[`tag`]},{model:`User`,attributes:[`id`,`name`]},{model:`Group`,attributes:[`id`,`name`,`public`]},{model:`Integration`,attributes:[`id`,`name`]}]}})}).then(e=>e.json()).then(r=>{n(r.rows.length>0?m(r.rows,t.integrationId,t.user,e):[])})}).catch(e=>{r(e)})}catch(e){r(e)}})())}throw Error(`No authKey or authToken found in the luzmo-dashboard component.`)},pe=(e,t)=>{if(t?.contentWindow){let n=v();return t.contentWindow.postMessage({action:`getDashboardContext`,_version:e.libVersion,requestId:n},`*`),new Promise((t,r)=>{e.promises[n]={resolve:t,reject:r},setTimeout(()=>{e.promises[n]&&(e.promises[n].reject(Error(`getDashboardContext request timed out.`)),delete e.promises[n])},2e3)})}return Promise.reject(Error(`Cannot retrieve contentWindow.`))},me=(e,t,n)=>{if(t?.contentWindow){let r=v();return t.contentWindow.postMessage({action:`getData`,id:n,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(Error(`getData request timed out.`)),delete e.promises[r])},2e3)})}return Promise.reject(Error(`Cannot retrieve contentWindow.`))},he=(e,t)=>{if(t?.contentWindow){let n=v();return t.contentWindow.postMessage({action:`getFilters`,_version:e.libVersion,requestId:n},`*`),new Promise((t,r)=>{e.promises[n]={resolve:t,reject:r},setTimeout(()=>{e.promises[n]&&(e.promises[n].reject(Error(`getFilters request timed out.`)),delete e.promises[n])},2e3)})}return Promise.reject(Error(`Cannot retrieve contentWindow.`))},ge=(e,t,n={})=>{if(!t?.contentWindow)return Promise.reject(Error(`Cannot retrieve contentWindow.`));let r=v();return t.contentWindow.postMessage({action:`getInsights`,options:n,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(Error(`getInsights request timed out.`)),delete e.promises[r])},6e4)})},_e=(e,t,n)=>t?(t.contentWindow.postMessage({action:`refreshData`,id:n??null,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(Error(`Cannot retrieve contentWindow.`)),ve=(e,t)=>t?(t.contentWindow.postMessage({action:`reloadDashboard`,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(Error(`Cannot retrieve contentWindow.`)),ye=(e,t,n,r,i)=>t?(t.contentWindow.postMessage({action:`sendExportEmail`,type:n||`once`,subject:r,message:i,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(Error(`Cannot retrieve contentWindow.`)),be=(e,t,n,r)=>t?(t.contentWindow.postMessage({action:`setAuthorization`,key:n,token:r,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(Error(`Cannot retrieve contentWindow.`)),xe=(e,t,n)=>{if(t&&t.contentWindow){let r=v();return e.params.editMode===n?Promise.reject(Error(`editMode parameter is currently already set to `+n)):n!==`editFull`&&n!==`editLimited`&&n!==`view`?Promise.reject(Error(`The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'.`)):(t.contentWindow.postMessage({action:`setEditMode`,editMode:n,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n}}))}return Promise.reject(Error(`Cannot retrieve contentWindow.`))},Se=(e,t,n)=>{if(t){let r=v();return t.contentWindow.postMessage({action:`setPreview`,preview:n,requestId:r,_version:e.libVersion},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(Error(`setPreview request timed out.`)),delete e.promises[r])},2e3)})}return Promise.reject(Error(`Cannot retrieve contentWindow.`))},Ce=(e,t,n,r)=>{if(t){let i=v();return t.contentWindow.postMessage({action:`setSelectedData`,itemId:n,filters:r,_version:e.libVersion,requestId:i},`*`),new Promise((t,n)=>{e.promises[i]={resolve:t,reject:n},setTimeout(()=>{e.promises[i]&&(e.promises[i].reject(Error(`setSelectedData request timed out.`)),delete e.promises[i])},2e3)})}return Promise.reject()},we=e=>{if(!e.dimensions){e.params.error=!0,s(`Got no valid dimensions.`,e.params);return}let t=Object.keys(e.dimensions),n=[],r,i=0,a=0;if(!e.params.switchScreenModeOnResize&&e.currentScreenMode&&(e.params.screenMode=e.currentScreenMode),e.dimensions&&t?.[0]===`fixed`)r=`fixed`,i=e.dimensions.fixed[0],a=e.dimensions.fixed[1];else{let o=[`mobile`,`tablet`,`desktop`,`largeScreen`];if(e.params.itemEmbedding){let[n]=t,r=g(n);for(let n of o){let i=t.find(e=>e===n);i?r=g(i):e.dimensions[n]=e.dimensions[r]}}for(let r of t)if(o.includes(r)){let t=u.find(e=>e.mode===r);n.push({...t,height:e.dimensions[r][1]||50})}if(n.map(e=>e.mode).includes(e.params.screenMode)||(e.params.screenMode=`auto`),e.params.screenMode===`auto`){n.sort((e,t)=>o.indexOf(e.mode)-o.indexOf(t.mode));for(let t of n){let[n,o]=t.width;e.params.itemEmbedding&&e.params.itemDimensions&&e.params.itemDimensions.width!==`auto`&&e.params.itemDimensions.height===`auto`?n<e.params.itemDimensions.width&&(r=t.mode,i=Number.parseInt(e.params.itemDimensions.width,10),a=e.dimensions[r][1]):n<e.containerWidth&&(r=t.mode,e.params.itemEmbedding?(i=e.params.itemDimensions?.width&&e.params.itemDimensions?.width!==`auto`?Number.parseInt(e.params.itemDimensions.width,10):Math.min(e.containerWidth,o),a=e.params.itemDimensions?.height&&e.params.itemDimensions?.height!==`auto`?Number.parseInt(e.params.itemDimensions.height,10):e.dimensions[r][1],e.params.itemDimensions&&e.params.itemDimensions.width!==`auto`&&e.params.itemDimensions.height===`auto`&&(i=Number.parseInt(e.params.itemDimensions.width,10),a=e.dimensions[r][1])):(i=Math.max(Math.min(o,e.containerWidth),n),a=t.height))}}else{let{height:t,width:[o,s]}=n.find(t=>t.mode===e.params.screenMode);r=e.params.screenMode,i=Math.max(Math.min(s,e.containerWidth),o),a=t,e.params.itemEmbedding&&(e.params.itemDimensions?.width&&e.params.itemDimensions?.width!==`auto`&&(i=Number.parseInt(e.params.itemDimensions.width,10)),e.params.itemDimensions?.height&&e.params.itemDimensions?.height!==`auto`&&(a=Number.parseInt(e.params.itemDimensions.height,10)))}if(!r&&n.length>0){let[e]=n;r=e.mode,i=e.width[0],a=e.height}}e.currentScreenMode=r;let o={height:a===0?`100%`:`${String(a)}px`,width:i===0?`100%`:`${String(i)}px`,opacity:1};[`editFull`,`editLimited`].includes(e.params.editMode)?(o.height=`100%`,o.width=`100%`):e.params.itemEmbedding&&e.params.itemDimensions?(o.height=e.params.itemDimensions.height===`auto`?o.height:`${String(e.params.itemDimensions.height).replace(`px`,``)}px`,o.width=e.params.itemDimensions.width===`auto`?o.width:`${String(e.params.itemDimensions.width).replace(`px`,``)}px`):(o.height=a===0?`100%`:`${String(a)}px`,o.width=i===0?`100%`:`${String(i)}px`),e.currentScreenMode=r,e.iframeStyle=o},Te=e=>{let t=Object.keys(l),n=[],r=[`appServer`,`language`,`apiHost`],i=[`key`,`token`,`screenMode`,`timezoneId`,`itemId`,`container`,`loaderBackground`,`loaderFontColor`,`loaderSpinnerColor`,`loaderSpinnerBackground`],a=[`itemDimensions`],o=[`mobile`,`tablet`,`desktop`,`largeScreen`,`fixed`,`auto`];for(let n of t)e.params[n]===null&&delete e.params[n];e.params=ee(e.params,l),(!e.params.dashboardId||typeof e.params.dashboardId!=`string`)&&(!e.params.dashboardSlug||typeof e.params.dashboardSlug!=`string`)&&(delete e.params.dashboardId,delete e.params.dashboardSlug);for(let t of r)typeof e.params[t]!=`string`&&(delete e.params[t],n.push(`${t} needs to be of type string.`));for(let t of i)typeof e.params[t]!=`string`&&e.params[t]!==null&&e.params[t]!==void 0&&(delete e.params[t],n.push(`${t} needs to be of type string or empty.`));if(e.params.screenMode&&!o.includes(e.params.screenMode)){let t=o.map(e=>`"${e}"`).join(`, `);n.push(`"screenMode" needs should be one of these types: ${t}`),e.params.screenMode=`auto`}e.params.itemId&&(e.params.itemEmbedding=!0);for(let t of a)typeof e.params[t]!=`object`&&e.params[t]!==null&&(delete e.params[t],n.push(`${t} needs to be of type object or empty.`));if(typeof e.params.switchScreenModeOnResize!=`boolean`&&(n.push(`switchScreenModeOnResize needs to be of type boolean.`),e.params.switchScreenModeOnResize=!0),e.params.itemDimensions)for(let t of[`width`,`height`])![`string`,`number`].includes(typeof e.params.itemDimensions[t])&&e.params.itemDimensions[t]!==null&&n.push(`itemDimensions ${t} needs to be of type string, number or empty.`);e.params=ee(e.params,l),e.params.screenMode&&e.params.screenMode!==`auto`&&(e.params.switchScreenModeOnResize=!1),e.params.itemDimensions.width!==`auto`&&(e.params.itemDimensions.width=Number.parseInt(`${e.params.itemDimensions.width}`.replace(`px`,``),10)||`auto`),e.params.itemDimensions.height!==`auto`&&(e.params.itemDimensions.height=Number.parseInt(`${e.params.itemDimensions.height}`.replace(`px`,``),10)||`auto`),e.params.itemEmbedding=!!e.params.itemId,(e.params.error||n.length>0)&&s(n.join(`
|
|
5
|
+
`),e.params)},Ee={type:`type`,slots:`slots`,options:`options`,appServer:`app-server`,apiHost:`api-host`,authKey:`auth-key`,authToken:`auth-token`,contextId:`context-id`,canFilter:`can-filter`,filters:`filters`,dashboardId:`dashboard-id`,itemId:`item-id`,aiMessageAssetId:`ai-message-asset-id`,dashboardContentsVersion:`dashboard-contents-version`,libVersion:`lib-version`},De=`luzmo-embed-container`,Oe=`FEDERATION_DEBUG`,x={AT:`@`,HYPHEN:`-`,SLASH:`/`},ke={[x.AT]:`scope_`,[x.HYPHEN]:`_`,[x.SLASH]:`__`};ke[x.AT],x.AT,ke[x.HYPHEN],x.HYPHEN,ke[x.SLASH],x.SLASH;var Ae=function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({}),S=typeof ENV_TARGET<`u`?ENV_TARGET===`web`:typeof window<`u`&&window.document!==void 0;function je(){return S}function Me(){return typeof navigator<`u`&&navigator?.product===`ReactNative`}function Ne(){try{if(je()&&window.localStorage)return!!localStorage.getItem(Oe)}catch{return!1}return!1}function Pe(){return typeof process<`u`&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:Ne()}var Fe=`[ Federation Runtime ]`,Ie=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``};function Le(e,t){if(`getPublicPath`in e){let n;return n=e.getPublicPath.startsWith(`function`)?Function(`return `+e.getPublicPath)()():Function(e.getPublicPath)(),`${n}${t}`}else if(`publicPath`in e)return!je()&&!Me()&&`ssrPublicPath`in e&&typeof e.ssrPublicPath==`string`?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`;else return console.warn(`Cannot get resource URL. If in debug mode, please ignore.`,e,t),``}var Re=e=>{console.warn(`${Fe}: ${e}`)};function ze(e){try{return JSON.stringify(e,null,2)}catch{return``}}var Be=(e,t)=>{if(!e)return t;let n=(e=>{if(e===`.`)return``;if(e.startsWith(`./`))return e.replace(`./`,``);if(e.startsWith(`/`)){let t=e.slice(1);return t.endsWith(`/`)?t.slice(0,-1):t}return e})(e);return n?n.endsWith(`/`)?`${n}${t}`:`${n}/${t}`:t};function Ve(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function He(e,t={}){let{remotes:n={},overrides:r={},version:i}=t,a,o=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&i?Ve(i):e.metaData.publicPath:e.metaData.getPublicPath,s=Object.keys(r),c={};Object.keys(n).length||(c=e.remotes?.reduce((e,t)=>{let n,i=t.federationContainerName;return n=s.includes(i)?r[i]:`version`in t?t.version:t.entry,e[i]={matchedVersion:n},e},{})||{}),Object.keys(n).forEach(e=>c[e]={matchedVersion:s.includes(e)?r[e]:n[e]});let{remoteEntry:{path:l,name:u,type:d},types:f={path:``,name:``,zip:``,api:``},buildInfo:{buildVersion:p},globalName:m,ssrRemoteEntry:h}=e.metaData,{exposes:g}=e,_={version:i||``,buildVersion:p,globalName:m,remoteEntry:Be(l,u),remoteEntryType:d,remoteTypes:Be(f.path,f.name),remoteTypesZip:f.zip||``,remoteTypesAPI:f.api||``,remotesInfo:c,shared:e?.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]})),modules:g?.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(`publicPath`in e.metaData?(a={..._,publicPath:o()},typeof e.metaData.ssrPublicPath==`string`&&(a.ssrPublicPath=e.metaData.ssrPublicPath)):a={..._,getPublicPath:o()},h){let e=Be(h.path,h.name);a.ssrRemoteEntry=e,a.ssrRemoteEntryType=h.type||`commonjs-module`}return a}function Ue(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var We=`[ Module Federation ]`,Ge=console,Ke=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function qe(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(`
|
|
6
|
+
`),n=t.filter(e=>!Ke.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
|
|
7
|
+
`)}`:void 0}catch{return}}var Je=class{constructor(e,t=Ge){this.prefix=e,this.delegate=t??Ge}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??Ge}emit(e,t){let n=this.delegate,r=Pe()?qe():void 0,i=r?[...t,r]:t,a=(()=>{switch(e){case`log`:return[`log`,`info`];case`info`:return[`info`,`log`];case`warn`:return[`warn`,`info`,`log`];case`error`:return[`error`,`warn`,`log`];default:return[`debug`,`log`]}})();for(let e of a){let t=n[e];if(typeof t==`function`){t.call(n,this.prefix,...i);return}}for(let e of a){let t=Ge[e];if(typeof t==`function`){t.call(Ge,this.prefix,...i);return}}}log(...e){this.emit(`log`,e)}warn(...e){this.emit(`warn`,e)}error(...e){this.emit(`error`,e)}success(...e){this.emit(`info`,e)}info(...e){this.emit(`info`,e)}ready(...e){this.emit(`info`,e)}debug(...e){Pe()&&this.emit(`debug`,e)}};function Ye(e){return new Je(e)}function Xe(e){let t=new Je(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Ye(We),Xe(We);async function Ze(e,t){try{return await e()}catch(e){!t&&Re(e);return}}function Qe(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function $e(e){let t=null,n=!0,r=2e4,i,a=document.getElementsByTagName(`script`);for(let r=0;r<a.length;r++){let i=a[r],o=i.getAttribute(`src`);if(o&&Qe(o,e.url)){t=i,n=!1;break}}if(!t){let n=e.attrs;t=document.createElement(`script`),t.type=n?.type===`module`?`module`:`text/javascript`;let i;e.createScriptHook&&(i=e.createScriptHook(e.url,e.attrs),i instanceof HTMLScriptElement?t=i:typeof i==`object`&&(`script`in i&&i.script&&(t=i.script),`timeout`in i&&i.timeout&&(r=i.timeout))),t.src||=e.url,n&&!i&&Object.keys(n).forEach(e=>{t&&(e===`async`||e===`defer`?t[e]=n[e]:t.getAttribute(e)||t.setAttribute(e,n[e]))})}let o=null,s=typeof window<`u`?t=>{if(t.filename&&Qe(t.filename,e.url)){let n=Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);n.name=`ScriptExecutionError`,o=n}}:null;s&&window.addEventListener(`error`,s);let c=async(n,r)=>{clearTimeout(i),s&&window.removeEventListener(`error`,s);let a=()=>{if(r?.type===`error`){let t=Error(r?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);t.name=`ScriptNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else o?e?.onErrorCallback&&e?.onErrorCallback(o):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,Ze(()=>{let{needDeleteScript:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n&&typeof n==`function`)){let e=n(r);if(e instanceof Promise){let t=await e;return a(),t}return a(),e}a()};return t.onerror=c.bind(null,t.onerror),t.onload=c.bind(null,t.onload),i=setTimeout(()=>{c(null,{type:`error`,isTimeout:!0})},r),{script:t,needAttach:n}}function et(e){let t=null,n=!0,r=2e4,i,a=document.getElementsByTagName(`link`);for(let r=0;r<a.length;r++){let i=a[r],o=i.getAttribute(`href`),s=i.getAttribute(`rel`);if(o&&Qe(o,e.url)&&s===e.attrs.rel){t=i,n=!1;break}}if(!t){t=document.createElement(`link`),t.setAttribute(`href`,e.url);let n,i=!0,a=e.attrs;e.createLinkHook&&(n=e.createLinkHook(e.url,a),n instanceof HTMLLinkElement?(t=n,i=!1):typeof n==`object`&&(`link`in n&&n.link&&(t=n.link,i=!1),`timeout`in n&&n.timeout&&(r=n.timeout))),a&&i&&Object.keys(a).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,a[e])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};let o=(n,r)=>{i&&clearTimeout(i);let a=()=>{if(r?.type===`error`){let t=Error(r?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name=`LinkNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,Ze(()=>{let{needDeleteLink:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n)){let e=n(r);return a(),e}a()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),i=setTimeout(()=>{o(null,{type:`error`,isTimeout:!0})},r),{link:t,needAttach:n}}function tt(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,i)=>{let{script:a,needAttach:o}=$e({url:e,cb:t,onErrorCallback:i,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});o&&document.head.appendChild(a)})}var nt=new Map;function C(e){if(!e)throw Error(`import specifier is required`);if(nt.has(e))return nt.get(e);let t=Function(`name`,`return import(name)`)(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),nt.delete(e),t});return nt.set(e,t),t}var rt=async(e,t,n)=>{let r=await((e,t)=>n.lifecycle.fetch.emit(e,t))(e,t||{});return!r||!(r instanceof Response)?fetch(e,t||{}):r},it=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t,n,r)=>{if(r?.createScriptHook){let t=r.createScriptHook(e);t&&typeof t==`object`&&`url`in t&&(e=t.url)}let i;try{i=new URL(e)}catch(e){console.error(`Error constructing URL:`,e),t(Error(`Invalid URL: ${e}`));return}let a=async()=>r?.fetch?(e,t)=>rt(e,t,r):fetch,o=async(e,r)=>{try{let i=await(await e(r.href)).text(),[a,o]=await Promise.all([C(`path`),C(`vm`)]),s={exports:{},module:{exports:{}}},c=r.pathname.split(`/`).slice(0,-1).join(`/`),l=a.basename(r.pathname),u=new o.Script(`(function(exports, module, require, __dirname, __filename) {${i}\n})`,{filename:l,importModuleDynamically:o.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??C}),d;d=(await C(`node:module`)).createRequire(r.protocol===`file:`||r.protocol===`node:`?r.href:a.join(process.cwd(),`__mf_require_base__.js`)),u.runInThisContext()(s.exports,s.module,d,c,l);let f=s.module.exports||s.exports;if(n&&f&&n.globalName){t(void 0,f[n.globalName]||f);return}t(void 0,f)}catch(e){t(e instanceof Error?e:Error(`Script execution error: ${e}`))}};a().then(async e=>{if(n?.type===`esm`||n?.type===`module`)return gt(i.href,{fetch:e,vm:await C(`vm`)}).then(async e=>{await e.evaluate(),t(void 0,e.namespace)}).catch(e=>{t(e instanceof Error?e:Error(`Script execution error: ${e}`))});o(e,i)}).catch(e=>{t(e)})}:(e,t,n,r)=>{t(Error(`createScriptNode is disabled in non-Node.js environment`))},at=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t)=>new Promise((n,r)=>{it(e,(e,i)=>{if(e)r(e);else{let e=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[e]=i)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error(`loadScriptNode is disabled in non-Node.js environment`)},w=new Map,ot=e=>e.startsWith(`http:`)||e.startsWith(`https:`),st=e=>!e.startsWith(`./`)&&!e.startsWith(`../`)&&!e.startsWith(`/`)&&!e.includes(`:`);function ct(e){let t=new URL(e),n=encodeURIComponent(t.protocol.slice(0,-1)),r=encodeURIComponent(t.host),i=t.pathname.split(`/`).map(e=>encodeURIComponent(e)).join(`/`),a=encodeURIComponent(`${t.search}${t.hash}`);return`/${n}/${r}${i}${a?`/${a}`:``}`}function lt(e,t){let n=t.endsWith(`/`)?t:`${t}/`;return new URL(`__module_federation_remote__${ct(e)}`,n).href}async function ut(e){return e.startsWith(`node:`)?!0:st(e)?(await C(`node:module`)).builtinModules.includes(e):!1}function dt(e){let t=e&&(typeof e==`object`||typeof e==`function`)?e:{default:e},n={...t};return Object.prototype.hasOwnProperty.call(n,`default`)||(n.default=t),n}async function ft(e,t,n){if(typeof n.SyntheticModule!=`function`)throw Error(`vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.`);let r=dt(t),i=Object.keys(r),a=new n.SyntheticModule(i,function(){for(let e of i)this.setExport(e,r[e])},{identifier:e});return w.set(e,a),await a.link(async()=>{throw Error(`Node.js built-in module "${e}" should not request child modules.`)}),await a.evaluate(),a}async function pt(e,t){let n=`node-builtin:${e}`;return w.has(n)?w.get(n):ft(n,await C(e),t)}async function mt(e,t,n){if(await ut(e))return pt(e,n.vm);if(st(e))throw Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);let r=new URL(e,t).href;if(!ot(r))throw Error(`Unsupported ESM module specifier "${e}" resolved to "${r}". Only http(s) remote modules and Node.js built-in modules are supported.`);return gt(r,n)}async function ht(e){if(e.status===`linked`&&await e.evaluate(),e.status===`errored`)throw e.error;return e}async function gt(e,t){if(w.has(e))return w.get(e);let{fetch:n,vm:r}=t;if(!ot(e))throw Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);let i=await(await n(e)).text(),a=(await C(`node:url`)).pathToFileURL(process.cwd()).href,o=new r.SourceTextModule(i,{identifier:e,initializeImportMeta:t=>{t.url=lt(e,a)},importModuleDynamically:async n=>ht(await mt(n,e,t))});return w.set(e,o),await o.link(async n=>mt(n,e,t)),o}var _t=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,vt=(e,t,n,r)=>{let i=[`${[t[e]]} #${e}`];return n&&i.push(`args: ${JSON.stringify(n)}`),i.push(_t(e)),r&&i.push(`Original Error Message:\n ${r}`),i.join(`
|
|
8
|
+
`)};function yt(e,t,n,r,i,a){return r(vt(e,t,n,i))}var T=`[ Federation Runtime ]`,bt=Ye(T);function E(e,t,n,r,i){e||(n===void 0?D(t):D(t,n,r,void 0,i))}function D(e,t,n,r,i){if(t!==void 0)return yt(e,t,n??{},e=>{throw Error(`${T}: ${e}`)},r,i);let a=e;throw a instanceof Error?(a.message.startsWith(T)||(a.message=`${T}: ${a.message}`),a):Error(`${T}: ${a}`)}function xt(e){e instanceof Error&&(e.message.startsWith(T)||(e.message=`${T}: ${e.message}`)),bt.warn(e)}function St(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function Ct(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function wt(e){return e.entry!==void 0}function Tt(e){return!e.entry.includes(`.json`)}function Et(e){return e&&typeof e==`object`}var Dt=Object.prototype.toString;function Ot(e){return Dt.call(e)===`[object Object]`}function kt(e){return Array.isArray(e)?e:[e]}function At(e){let t={url:``,type:`global`,globalName:``};return S||Me()||!(`ssrRemoteEntry`in e)?`remoteEntry`in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:`ssrRemoteEntry`in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}var jt=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},Mt=2e3,O=typeof globalThis==`object`?globalThis:window,k=(()=>{try{return document.defaultView}catch{return O}})(),Nt=k;function Pt(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function Ft(e,t){return Object.hasOwnProperty.call(e,t)}Ft(O,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||Pt(O,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var A=O.__GLOBAL_LOADING_REMOTE_ENTRY__;function It(e){Ft(e,`__VMOK__`)&&!Ft(e,`__FEDERATION__`)&&Pt(e,`__FEDERATION__`,e.__VMOK__),Ft(e,`__FEDERATION__`)||(Pt(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map,__PRELOADED_ASSETS__:new Set}),Pt(e,`__VMOK__`,e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map,e.__FEDERATION__.__PRELOADED_ASSETS__??=new Set}It(O),It(k);function Lt(e){O.__FEDERATION__.__INSTANCES__.push(e)}function Rt(){return O.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function zt(e,t=Pe()){t&&(O.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,O.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.9.0`)}function j(e,t){if(typeof t==`string`){if(e[t])return{value:e[t],key:t};{let n=Object.keys(e);for(let r of n){let[n,i]=r.split(`:`),a=`${n}:${t}`,o=e[a];if(o)return{value:o,key:a}}return{value:void 0,key:t}}}else D(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Bt=()=>k.__FEDERATION__.moduleInfo,Vt=(e,t)=>{let n=j(t,Ct(e)).value;if(n&&!n.version&&`version`in e&&e.version&&(n.version=e.version),n)return n;if(`version`in e&&e.version){let{version:t,...n}=e,r=Ct(n),i=j(k.__FEDERATION__.moduleInfo,r).value;if(i?.version===t)return i}},Ht=e=>Vt(e,k.__FEDERATION__.moduleInfo),Ut=(e,t)=>{let n=Ct(e);return k.__FEDERATION__.moduleInfo[n]=t,k.__FEDERATION__.moduleInfo},Wt=e=>(k.__FEDERATION__.moduleInfo={...k.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete k.__FEDERATION__.moduleInfo[e]}),Gt=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:O[n]}},Kt=()=>k.__FEDERATION__.__GLOBAL_PLUGIN__,qt=e=>O.__FEDERATION__.__PRELOADED_MAP__.get(e),Jt=e=>O.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Yt=e=>O.__FEDERATION__.__PRELOADED_ASSETS__.has(e),Xt=e=>{let t=O.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>Mt){let e=t.values().next().value;e!==void 0&&t.delete(e)}},Zt=`[0-9A-Za-z-]+`,Qt=`(?:\\+(${Zt}(?:\\.${Zt})*))`,$t=`0|[1-9]\\d*`,en=`[0-9]+`,tn=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,nn=`(?:${en}|${tn})`,rn=`(?:-?(${nn}(?:\\.${nn})*))`,an=`(?:${$t}|${tn})`,on=`(?:-(${an}(?:\\.${an})*))`,sn=`${$t}|x|X|\\*`,M=`[v=\\s]*(${sn})(?:\\.(${sn})(?:\\.(${sn})(?:${on})?${Qt}?)?)?`,cn=`^\\s*(${M})\\s+-\\s+(${M})\\s*$`,ln=`[v=\\s]*${`(${en})\\.(${en})\\.(${en})`}${rn}?${Qt}?`,un=`((?:<|>)?=?)`,dn=`(\\s*)${un}\\s*(${ln}|${M})`,fn=`(?:~>?)`,pn=`(\\s*)${fn}\\s+`,mn=`(?:\\^)`,hn=`(\\s*)${mn}\\s+`,gn=`(<|>)?=?\\s*\\*`,_n=`^${mn}${M}$`,vn=`v?${`(${$t})\\.(${$t})\\.(${$t})`}${on}?${Qt}?`,yn=`^${fn}${M}$`,bn=`^${un}\\s*${M}$`,xn=`^${un}\\s*(${vn})$|^$`,Sn=`^\\s*>=\\s*0.0.0\\s*$`;function N(e){return new RegExp(e)}function P(e){return!e||e.toLowerCase()===`x`||e===`*`}function Cn(...e){return t=>e.reduce((e,t)=>t(e),t)}function wn(e){return e.match(N(xn))}function Tn(e,t,n,r){let i=`${e}.${t}.${n}`;return r?`${i}-${r}`:i}function En(e){return e.replace(N(cn),(e,t,n,r,i,a,o,s,c,l,u,d)=>(t=P(n)?``:P(r)?`>=${n}.0.0`:P(i)?`>=${n}.${r}.0`:`>=${t}`,s=P(c)?``:P(l)?`<${Number(c)+1}.0.0-0`:P(u)?`<${c}.${Number(l)+1}.0-0`:d?`<=${c}.${l}.${u}-${d}`:`<=${s}`,`${t} ${s}`.trim()))}function Dn(e){return e.replace(N(dn),`$1$2$3`)}function On(e){return e.replace(N(pn),`$1~`)}function kn(e){return e.replace(N(hn),`$1^`)}function An(e){return e.trim().split(/\s+/).map(e=>e.replace(N(_n),(e,t,n,r,i)=>P(t)?``:P(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:P(r)?t===`0`?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0 <${Number(t)+1}.0.0-0`:i?t===`0`?n===`0`?`>=${t}.${n}.${r}-${i} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r}-${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r}-${i} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${r} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${Number(t)+1}.0.0-0`)).join(` `)}function jn(e){return e.trim().split(/\s+/).map(e=>e.replace(N(yn),(e,t,n,r,i)=>P(t)?``:P(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:P(r)?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:i?`>=${t}.${n}.${r}-${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`)).join(` `)}function Mn(e){return e.split(/\s+/).map(e=>e.trim().replace(N(bn),(e,t,n,r,i,a)=>{let o=P(n),s=o||P(r),c=s||P(i);return t===`=`&&c&&(t=``),a=``,o?t===`>`||t===`<`?`<0.0.0-0`:`*`:t&&c?(s&&(r=0),i=0,t===`>`?(t=`>=`,s?(n=Number(n)+1,r=0,i=0):(r=Number(r)+1,i=0)):t===`<=`&&(t=`<`,s?n=Number(n)+1:r=Number(r)+1),t===`<`&&(a=`-0`),`${t+n}.${r}.${i}${a}`):s?`>=${n}.0.0${a} <${Number(n)+1}.0.0-0`:c?`>=${n}.${r}.0${a} <${n}.${Number(r)+1}.0-0`:e})).join(` `)}function Nn(e){return e.trim().replace(N(gn),``)}function Pn(e){return e.trim().replace(N(Sn),``)}function Fn(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function In(e,t){let{preRelease:n}=e,{preRelease:r}=t;if(n===void 0&&r)return 1;if(n&&r===void 0)return-1;if(n===void 0&&r===void 0)return 0;for(let e=0,t=n.length;e<=t;e++){let t=n[e],i=r[e];if(t!==i)return t===void 0&&i===void 0?0:t?i?Fn(t,i):-1:1}return 0}function Ln(e,t){return Fn(e.major,t.major)||Fn(e.minor,t.minor)||Fn(e.patch,t.patch)||In(e,t)}function Rn(e,t){return e.version===t.version}function zn(e,t){switch(e.operator){case``:case`=`:return Rn(e,t);case`>`:return Ln(e,t)<0;case`>=`:return Rn(e,t)||Ln(e,t)<0;case`<`:return Ln(e,t)>0;case`<=`:return Rn(e,t)||Ln(e,t)>0;case void 0:return!0;default:return!1}}function Bn(e){return Cn(An,jn,Mn,Nn)(e)}function Vn(e){return Cn(En,Dn,On,kn)(e.trim()).split(/\s+/).join(` `)}function Hn(e,t){if(!e)return!1;let n=wn(e);if(!n)return!1;let[,r,,i,a,o,s]=n,c={operator:r,version:Tn(i,a,o,s),major:i,minor:a,patch:o,preRelease:s?.split(`.`)},l=t.split(`||`);for(let e of l){let t=e.trim();if(!t||t===`*`||t===`x`)return!0;try{let e=Vn(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>Bn(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>Pn(e)).filter(Boolean);if(r.length===0)continue;let i=!0;for(let e of r){let t=wn(e);if(!t){i=!1;break}let[,n,,r,a,o,s]=t;if(!zn({operator:n,version:Tn(r,a,o,s),major:r,minor:a,patch:o,preRelease:s?.split(`.`)},c)){i=!1;break}}if(i)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}var Un=`default`,Wn=`global`;function Gn(e,t,n,r){let i;return i=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{D(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&D(`Invalid shared config for "${n}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:i,loaded:e?.loaded||`lib`in e?!0:void 0,version:e.version??`0`,scope:Array.isArray(e.scope)?e.scope:[e.scope??`default`],strategy:(e.strategy??r)||`version-first`,treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??`server-calc`,status:e.treeShaking.status??Ae.UNKNOWN,useIn:[]}:void 0}}function Kn(e,t){let n=t.shared||{},r=t.name,i=Object.keys(n).reduce((e,i)=>{let a=kt(n[i]);return e[i]=e[i]||[],a.forEach(n=>{e[i].push(Gn(n,r,i,t.shareStrategy))}),e},{}),a={...e.shared};return Object.keys(i).forEach(e=>{a[e]?i[e].forEach(t=>{a[e].find(e=>e.version===t.version)||a[e].push(t)}):a[e]=i[e]}),{allShareInfos:a,newShareInfos:i}}function qn(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===Ae.NO_USE?!1:n===Ae.CALCULATED?!0:r===`runtime-infer`?!t||Zn(e,t):!1}function F(e,t){let n=e=>{if(!Number.isNaN(Number(e))){let t=e.split(`.`),n=e;for(let e=0;e<3-t.length;e++)n+=`.0`;return n}return e};return!!Hn(n(e),`<=${n(t)}`)}var Jn=(e,t)=>{let n=t||function(e,t){return F(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},Yn=e=>!!e.loaded||typeof e.lib==`function`,Xn=e=>!!e.loading,Zn=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function Qn(e,t,n,r){let i=e[t][n],a=``,o=qn(r),s=function(e,t){return o?i[e].treeShaking?i[t].treeShaking?!Yn(i[e].treeShaking)&&F(e,t):!1:!0:!Yn(i[e])&&F(e,t)};if(o){if(a=Jn(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:Jn(e[t][n],s),useTreesShaking:o}}var I=e=>Yn(e)||Xn(e);function $n(e,t,n,r){let i=e[t][n],a=``,o=qn(r),s=function(e,t){if(o){if(!i[e].treeShaking)return!0;if(!i[t].treeShaking)return!1;if(I(i[t].treeShaking))return!I(i[e].treeShaking)||!!F(e,t);if(I(i[e].treeShaking))return!1}return I(i[t])?!I(i[e])||!!F(e,t):!I(i[e])&&F(e,t)};if(o){if(a=Jn(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:Jn(e[t][n],s),useTreesShaking:o}}function er(e){return e===`loaded-first`?$n:Qn}function tr(e,t,n,r,i){if(!e)return;let{shareConfig:a,scope:o=Un,strategy:s,treeShaking:c}=n,l=Array.isArray(o)?o:[o];for(let o of l)if(a&&e[o]&&e[o][t]){let{requiredVersion:l}=a,{version:u,useTreesShaking:d}=er(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:Nt.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!Hn(u,l)){let e=`Version ${u} from ${u&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${l})`;a.strictVersion?D(e):xt(e)}return{shared:r,useTreesShaking:d}}else{if(l===!1||l===`*`||Hn(u,l))return{shared:r,useTreesShaking:d};let n=qn(c);if(n){for(let[r,i]of Object.entries(e[o][t]))if(qn(i.treeShaking,c?.usedExports)&&Hn(r,l))return{shared:i,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(Hn(n,l))return{shared:r,useTreesShaking:!1}}},loadContext:i};return(r.emit(f)||f).resolver()}}function nr(){return Nt.__FEDERATION__.__SHARE__}function rr(e){let{pkgName:t,extraOptions:n,shareInfos:r}=e,i=n?.resolver??(e=>{if(!e)return;let t={};return e.forEach(e=>{t[e.version]=e}),t[Jn(t,function(e,n){return!Yn(t[e])&&F(e,n)})]}),a=e=>typeof e==`object`&&!!e&&!Array.isArray(e),o=(...e)=>{let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n)){let n=t[e];a(n)&&a(r)?t[e]=o(n,r):r!==void 0&&(t[e]=r)}return t};return o(i(r[t]),n?.customShareInfo)}var L=(e,t)=>{e.useIn||=[],St(e.useIn,t)};function ir(e,t){return t&&e.treeShaking?e.treeShaking:e}function ar(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function or(e,t){for(let n of e){let e=t.startsWith(n.name),r=t.replace(n.name,``);if(e){if(r.startsWith(`/`)){let e=n.name;return r=`.${r}`,{pkgNameOrAlias:e,expose:r,remote:n}}else if(r===``)return{pkgNameOrAlias:n.name,expose:`.`,remote:n}}let i=n.alias&&t.startsWith(n.alias),a=n.alias&&t.replace(n.alias,``);if(n.alias&&i){if(a&&a.startsWith(`/`)){let e=n.alias;return a=`.${a}`,{pkgNameOrAlias:e,expose:a,remote:n}}else if(a===``)return{pkgNameOrAlias:n.alias,expose:`.`,remote:n}}}}function sr(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var cr=`RUNTIME-001`,lr=`RUNTIME-002`,ur=`RUNTIME-003`,dr=`RUNTIME-004`,fr=`RUNTIME-005`,pr=`RUNTIME-006`,mr=`RUNTIME-007`,hr=`RUNTIME-008`,gr=`RUNTIME-009`,_r=`RUNTIME-010`,vr=`RUNTIME-011`,yr=`RUNTIME-012`,br=`RUNTIME-013`,xr=`RUNTIME-014`,Sr=`RUNTIME-015`,Cr=`TYPE-001`,wr=`BUILD-001`,Tr=`BUILD-002`,R={[cr]:`Failed to get remoteEntry exports.`,[lr]:`The remote entry interface does not contain "init"`,[ur]:`Failed to get manifest.`,[dr]:`Failed to locate remote.`,[fr]:`Invalid loadShareSync function call from bundler runtime`,[pr]:`Invalid loadShareSync function call from runtime`,[mr]:`Failed to get remote snapshot.`,[hr]:`Failed to load script resources.`,[gr]:`Please call createInstance first.`,[_r]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[vr]:`The remoteEntry URL is missing from the remote snapshot.`,[yr]:`The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.`,[br]:`The manifest is not a valid Module Federation manifest.`,[xr]:`The remote does not expose the requested module.`,[Sr]:`Remote container initialization failed.`},Er={[Cr]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},Dr={[wr]:`Failed to find expose module.`,[Tr]:`PublicPath is required in prod mode.`};({...R,...Er,...Dr});var Or=`.then(callbacks[0]).catch(callbacks[1])`,kr=new WeakMap,Ar=[`Failed to fetch dynamically imported module`,`Importing a module script failed`,`error loading dynamically imported module`];function jr(e){return e instanceof TypeError&&Ar.some(t=>e.message.includes(t))}function Mr(e){return e===`esm`||e===`module`}async function Nr({entry:e,remoteEntryExports:t,name:n,getEntryUrl:r}){return new Promise((i,a)=>{let o=e=>{if(jr(e)){let t=e instanceof Error?e.message:String(e);try{D(hr,R,{remoteName:n,resourceUrl:s},t)}catch(e){a(e);return}}a(e)},s=r?r(e):e;try{t?i(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${s}")${Or}`)([i,o]):import(s).then(i).catch(o)}catch(e){D(`Failed to load ESM entry from "${s}". ${e instanceof Error?e.message:String(e)}`)}})}async function Pr({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof __system_context__>`u`?System.import(e).then(n).catch(r):Function(`callbacks`,`System.import("${e}")${Or}`)([n,r])}catch(t){D(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function Fr(e,t,n){let{remoteEntryKey:r,entryExports:i}=Gt(e,t);return i||D(cr,R,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),i}async function Ir({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:i,getEntryUrl:a,resourceContext:o}){let{entryExports:s}=Gt(e,t);if(s)return s;let c=a?a(n):n;return tt(c,{attrs:{},createScriptHook:(e,t)=>{let n=i.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:o?{...o,url:e}:void 0});if(n&&(n instanceof HTMLScriptElement||`script`in n||`timeout`in n))return n}}).then(()=>Fr(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);D(hr,R,{remoteName:e,resourceUrl:c},n)})}async function Lr({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:r,resourceContext:i}){let{entry:a,entryGlobalName:o,name:s,type:c}=e;return Mr(c)?Nr({entry:a,remoteEntryExports:t,name:s,getEntryUrl:r}):c===`system`?Pr({entry:a,remoteEntryExports:t}):Ir({entry:a,globalName:o,name:s,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:i})}async function Rr({remoteInfo:e,loaderHook:t,resourceContext:n}){let{entry:r,entryGlobalName:i,name:a,type:o}=e,{entryExports:s}=Gt(a,i);return s||at(r,{attrs:{name:a,globalName:i,type:o},loaderHook:{createScriptHook:(r,i={})=>{let a=t.lifecycle.createScript.emit({url:r,attrs:i,remoteInfo:e,resourceContext:n?{...n,url:r}:void 0});if(a&&`url`in a)return a}}}).then(()=>Fr(a,i,r)).catch(e=>{D(`Failed to load Node.js entry for remote "${a}" from "${r}". ${e instanceof Error?e.message:String(e)}`)})}function zr(e){let{entry:t,name:n}=e;return Ie(n,t)}async function Br(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:i,resourceContext:a,_inErrorHandling:o=!1}=e,s=zr(r);if(n)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:n,resourceContext:a,cached:!0}),n;if(!A[s]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;A[s]=e.emit({origin:t,loaderHook:c,remoteInfo:r,remoteEntryExports:n,resourceContext:a}).then(e=>e||((typeof ENV_TARGET<`u`?ENV_TARGET===`web`:S)?Lr({remoteInfo:r,remoteEntryExports:n,loaderHook:c,getEntryUrl:i,resourceContext:a}):Rr({remoteInfo:r,loaderHook:c,resourceContext:a}))).then(async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,resourceContext:a}),e)).catch(async e=>{let i=e instanceof Error&&e.message.includes(`ScriptExecutionError`);if(e instanceof Error&&e.message.includes(`RUNTIME-008`)&&!i&&!o){let i=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e=>Br({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:A,uniqueKey:s});if(i)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:i,resourceContext:a,error:e,recovered:!0}),i}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,resourceContext:a,error:e}),e}),kr.set(A[s],t)}let c=A[s];if(kr.get(c)!==t)try{let e=await c;return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,resourceContext:a}),e}catch(e){throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,resourceContext:a,error:e}),e}return c}function z(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function Vr(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function Hr(e){let t=new Map;return[...e||[],...Kt()].forEach(e=>{e&&(E(Ot(e),`Plugin configuration is invalid.`),E(e.name,`A name must be provided by the plugin.`),t.has(e.name)||t.set(e.name,e))}),Array.from(t.values())}function Ur(e,t){return t===void 0?e:{...t,name:e.name,version:e.version}}function Wr(e,t){let n=new Map;t.options.plugins.forEach(e=>{e&&n.set(e.name,e)});let r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return Hr(e).forEach(e=>{if(n.set(e.name,e),t.hooks.registerPlugins[e.name])return;let i=Ur(e,e.apply?.(t));r.forEach(e=>{e.applyPlugin(i)})}),Array.from(n.values())}function Gr(e){return{name:e.name,alias:e.alias,entry:`entry`in e?e.entry:void 0,version:`version`in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function B(e){let t={};for(let[n,r]of Object.entries(e.shared)){let e=r[0];e&&(t[n]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:e.shareConfig?.requiredVersion!==!1&&e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?`host`:`unknown`},mfConfig:{name:e.name,remotes:e.remotes?.map(Gr)??[],shared:t}}}function Kr(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,recordPreloadedAssets:!0,...e}}function qr(e,t){return t.map(t=>{let n=sr(e,t.nameOrAlias);return E(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&ze({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Kr(t)}})}function Jr(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function Yr(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function V(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}function Xr(e,t,n,r){return n?Yt(t)?Promise.resolve(V(e,t,`cached`)):(Xt(t),r()):r()}async function Zr(e,t,n,r){let i=e.moduleCache.get(n.name),a=n.entry;if(i?.remoteEntryExports)return V(r,a,`cached`);try{if(!await Br({origin:e,remoteInfo:n,remoteEntryExports:i?.remoteEntryExports,resourceContext:{...r,url:a}}))throw Error(`Failed to load remoteEntry "${a}".`);return V(r,a,`success`)}catch(e){return V(r,a,Yr(e)?`timeout`:`error`,e)}}function Qr({host:e,remoteInfo:t,url:n,attrs:r,context:i,needDeleteLink:a}){return new Promise(o=>{let{link:s,needAttach:c}=et({url:n,cb:()=>{o(V(i,n,c?`success`:`cached`))},onErrorCallback:e=>{o(V(i,n,Yr(e)?`timeout`:`error`,e))},attrs:r,createLinkHook:(n,r)=>{let a=e.loaderHook.lifecycle.createLink.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...i,url:n}});return a instanceof HTMLLinkElement,a},needDeleteLink:a});c&&document.head.appendChild(s)})}function $r({host:e,remoteInfo:t,url:n,attrs:r,context:i}){return new Promise(a=>{let{script:o,needAttach:s}=$e({url:n,cb:()=>{a(V(i,n,s?`success`:`cached`))},onErrorCallback:e=>{a(V(i,n,Yr(e)?`timeout`:`error`,e))},attrs:r,createScriptHook:(n,r)=>{let a=e.loaderHook.lifecycle.createScript.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...i,url:n}});return a instanceof HTMLScriptElement,a},needDeleteScript:!0});s&&document.head.appendChild(o)})}function ei(e,t){return{...e,resourceType:t}}function ti(e,t,n,r=!0,i={initiator:`preloadRemote`,id:e.name},a=!0){let{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:c}=n,l=[];if(t.options.inBrowser){if(c.forEach(n=>{let{moduleInfo:r}=n;l.push(Zr(t,e,r,ei(i,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{let o=ei(i,`css`);l.push(Xr(o,r,a,()=>Qr({host:t,remoteInfo:e,url:r,attrs:n,context:o})))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{let o=ei(i,`css`);l.push(Xr(o,r,a,()=>Qr({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:o})))})}let n=$r,u={fetchpriority:`high`,type:`text/javascript`};r?(n=Qr,u={rel:`preload`,as:`script`}):Mr(e.type)&&(n=Qr,u={rel:`modulepreload`,fetchpriority:`high`}),s.forEach(r=>{let o=ei(i,`js`);l.push(Xr(o,r,a,()=>n({host:t,remoteInfo:e,url:r,attrs:u,context:o})))})}return Promise.all(l)}function ni(e){if(!e||!(`modules`in e)||!Array.isArray(e.modules))return;let t=e.modules.map(e=>e.moduleName).filter(Boolean);return t.length?t.join(`,`):void 0}function ri(e,t,n){let r=t,i=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];i.length||i.push(`default`),i.forEach(e=>{r[e]||(r[e]={})});let a={version:e.version||``,shareScopeKeys:Array.isArray(e.shareScope)?i:e.shareScope||`default`};return Object.defineProperty(a,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:a,shareScope:r[i[0]],initScope:n??[]}}var ii=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e,t){let n=t||{initiator:`loadRemote`,id:ar(this.remoteInfo.name,e),resourceType:`remoteEntry`,url:this.remoteInfo.entry,expose:e},r=await Br({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:n});return E(r,`remoteEntryExports is undefined \n ${ze(this.remoteInfo)}`),this.remoteEntryExports=r,this.remoteEntryExports}async init(e,t,n,r,i){let a=await this.getEntry(r,i);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host}),a;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,cached:!0,origin:this.host}),n}return a}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});let{remoteEntryInitOptions:r,shareScope:i,initScope:o}=ri(this.remoteInfo,this.host.shareScopeMap,n),s=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:i,remoteEntryInitOptions:r,initScope:o,remoteInfo:this.remoteInfo,origin:this.host});a?.init===void 0&&D(lr,R,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,B(this.host.options));try{await a.init(s.shareScope,s.initScope,s.remoteEntryInitOptions)}catch(e){D(Sr,R,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,B(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...s,id:e,remoteSnapshot:t,remoteEntryExports:a}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,origin:this.host}),n}finally{this.initing=!1,this.initPromise=void 0}return a}async get(e,t,n,r){let{loadFactory:i=!0}=n||{loadFactory:!0},a=await this.init(e,r,void 0,t);this.lib=a,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,origin:this.host});let o;try{let n=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:a,expose:t,moduleInfo:this.remoteInfo});o=typeof n==`function`?n:void 0,o||=await a.get(t),o||D(xr,R,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:ni(r)},void 0,B(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,moduleFactory:o,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,error:n,origin:this.host}),n}let s=jt(this.remoteInfo.name,t),c=this.wraperFactory(o,s);if(!i)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,origin:this.host});try{let n=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,exposeModule:n,origin:this.host}),n}catch(n){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,error:n,origin:this.host}),n}}wraperFactory(e,t){function n(e,t){e&&typeof e==`object`&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for(`mf_module_id`))&&Object.defineProperty(e,Symbol.for(`mf_module_id`),{value:t,enumerable:!1})}return()=>{let r=e();return r instanceof Promise?r.then(e=>(n(e,t),e)):(n(r,t),r)}}},H=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e){E(Ot(e),`Plugin configuration is invalid.`);let t=e.name;E(t,`A name must be provided by the plugin.`),this.registerPlugins[t]||(this.registerPlugins[t]=e,this.lifecycleKeys.forEach(t=>{let n=e[t];n&&this.lifecycle[t].on(n)}))}removePlugin(e){E(e,`A name is required.`);let t=this.registerPlugins[e];E(t,`The plugin "${e}" is not registered.`),this.lifecycleKeys.forEach(e=>{let n=t[e];n&&this.lifecycle[e].remove(n)}),delete this.registerPlugins[e]}},U=class{constructor(e){this.type=``,this.listeners=new Set,e&&(this.type=e)}on(e){typeof e==`function`&&this.listeners.add(e)}once(e){let t=this;this.on(function n(...r){return t.remove(n),e.apply(null,r)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{let r=n(...e);r!==void 0&&(t=r)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},W=class extends U{emit(...e){let t,n=Array.from(this.listeners);if(n.length>0){let r=0,i=t=>t===!1?!1:r<n.length?Promise.resolve(n[r++].apply(null,e)).then(n=>n===void 0||e.length===1&&n===e[0]?i(t):i(n)):t;t=i()}return Promise.resolve(t)}};function ai(e,t){if(!Et(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var G=class extends U{constructor(e){super(),this.onerror=D,this.type=e}emit(e){Et(e)||D(`The data for the "${this.type}" hook should be an object.`);for(let t of this.listeners)try{let n=t(e);if(n===void 0)continue;if(ai(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){xt(e),this.onerror(e)}return e}},K=class extends U{constructor(e){super(),this.onerror=D,this.type=e}emit(e){Et(e)||D(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let n=0,r=t=>(xt(t),this.onerror(t),e),i=a=>{if(a!==void 0&&ai(e,a))e=a;else if(a!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(i,r)}catch(e){return r(e)}return e};return Promise.resolve(i(e))}return Promise.resolve(e)}},oi=`Remote loading is disabled by experiments.optimization.disableRemote.`,si=class{constructor(){this.hooks=new H({})}formatAndRegisterRemote(){return[]}loadRemote(){throw Error(oi)}preloadRemote(){throw Error(oi)}registerRemotes(){throw Error(oi)}getRemoteModuleAndOptions(){throw Error(oi)}initRawContainer(){throw Error(oi)}};function ci(e,t){let n=At(t);n.url||D(vr,R,{remoteName:e.name});let r=Le(t,n.url);!S&&!r.startsWith(`http`)&&(r=`https:${r}`),e.type=n.type,e.entryGlobalName=n.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}function li(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:i,remoteInfo:a,id:o}=e;if(!wt(t)||!Tt(t)){let{remoteSnapshot:s,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:ar(t.name,r)});ci(a,s);let l=[{nameOrAlias:n,exposes:[r],resourceCategory:`sync`,share:!1,depsRemote:!1,recordPreloadedAssets:!0}];await i.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:l,options:i.options,origin:i});let[u]=l;if(u){let e={remote:t,preloadConfig:u},n=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:e,remoteInfo:a,remote:t,remoteSnapshot:s,globalSnapshot:c});n&&ti(a,i,n,!1,{initiator:`loadRemote`,id:o},u.recordPreloadedAssets).catch(()=>void 0)}return{...e,remoteSnapshot:s}}return e}}}function ui(e){let t=e.split(`:`);return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function di(e,t,n,r,i={},a){let{value:o}=j(e,Ct(t)),s=a||o;if(s&&!Ue(s)&&(n(s,t,r),s.remotesInfo)){let t=Object.keys(s.remotesInfo);for(let r of t){if(i[r])continue;i[r]=!0;let t=ui(r),a=s.remotesInfo[r];di(e,{name:t.name,version:a.matchedVersion},n,!1,i,void 0)}}}var fi=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function pi(e,t,n,r,i){let a=[],o=[],s=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:d}=t,{depsRemote:f}=d;if(di(r,n,(t,n,r)=>{let i;if(r)i=d;else if(Array.isArray(f)){let e=f.find(e=>e.nameOrAlias===n.name||e.nameOrAlias===n.alias);if(!e)return;i=Kr(e)}else if(f===!0)i=d;else return;let c=Le(t,At(t).url);c&&s.push({name:n.name,moduleInfo:{name:n.name,entry:c,type:`remoteEntryType`in t?t.remoteEntryType:`global`,entryGlobalName:`globalName`in t?t.globalName:n.name,shareScope:``,version:`version`in t?t.version:void 0},url:c});let l=`modules`in t?t.modules:[],u=Jr(i.exposes);u.length&&`modules`in t&&(l=t?.modules?.reduce((e,t)=>(u?.indexOf(t.moduleName)!==-1&&e.push(t),e),[]));function p(e){let n=e.map(e=>Le(t,e));return i.filter?n.filter(i.filter):n}if(l){let r=l.length;for(let s=0;s<r;s++){let r=l[s],c=`${n.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:r.moduleName===`.`?n.name:c,name:n.name,remoteSnapshot:t,preloadConfig:i,remote:n,origin:e}),!qt(c)&&(i.resourceCategory===`all`?(a.push(...p(r.assets.css.async)),a.push(...p(r.assets.css.sync)),o.push(...p(r.assets.js.async)),o.push(...p(r.assets.js.sync))):i.resourceCategory===`sync`&&(a.push(...p(r.assets.css.sync)),o.push(...p(r.assets.js.sync))),Jt(c))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,n)=>{let{shared:r}=tr(e.shareScopeMap,n.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&typeof r.lib==`function`&&(n.assets.js.sync.forEach(e=>{c.add(e)}),n.assets.css.sync.forEach(e=>{l.add(e)}))};i.shared.forEach(e=>{let n=u.shared?.[e.sharedName];if(!n)return;let r=e.version?n.find(t=>t.version===e.version):n;r&&kt(r).forEach(n=>{t(n,e)})})}let p=o.filter(e=>!c.has(e)&&!fi(`script`,e));return{cssAssets:a.filter(e=>!l.has(e)&&!fi(`link`,e)),jsAssetsWithoutEntry:p,entryAssets:s.filter(e=>!fi(`script`,e.url))}}var mi=function(){return{name:`generate-preload-assets-plugin`,async generatePreloadAssets(e){let{origin:t,preloadOptions:n,remoteInfo:r,remote:i,globalSnapshot:a,remoteSnapshot:o}=e;return S?wt(i)&&Tt(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:r.name,entry:i.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(ci(r,o),pi(t,n,r,a,o)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function hi(e,t){let n=Ht({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&j(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:Bt(),remoteSnapshot:Ht({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Bt(),remoteSnapshot:Ht({name:e.name,version:`version`in e?e.version:void 0})}}var gi=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new H({beforeLoadRemoteSnapshot:new W(`beforeLoadRemoteSnapshot`),loadSnapshot:new K(`loadGlobalSnapshot`),loadRemoteSnapshot:new K(`loadRemoteSnapshot`),afterLoadSnapshot:new K(`afterLoadSnapshot`),beforeLoadManifest:new W(`beforeLoadManifest`),afterLoadManifest:new W(`afterLoadManifest`)}),this.manifestLoading=Nt.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n=`loadRemote`}){let{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let i=Ht({name:this.HostInstance.options.name,version:this.HostInstance.options.version});i||(i={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},Wt({[this.HostInstance.options.name]:i})),i&&`remotesInfo`in i&&!j(i.remotesInfo,e.name).value&&(`version`in e||`entry`in e)&&(i.remotesInfo={...i?.remotesInfo,[e.name]:{matchedVersion:`version`in e?e.version:e.entry}});let{hostGlobalSnapshot:a,remoteSnapshot:o,globalSnapshot:s}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:o,globalSnapshot:s}),u,d;if(c)if(Ue(c)){let r=S?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||``,i=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),a=Ut({...e,entry:r},i);u=i,d=a}else{let{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:`global`});u=t,d=l}else if(wt(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),i=Ut(e,r);u=r,d=i}else D(mr,R,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,B(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:d}}getGlobalRemoteInfo(e){return hi(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=z(t),i=this.manifestCache.get(e);if(i)return await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,manifestJson:i,cached:!0,origin:this.HostInstance}),i;await this.hooks.lifecycle.beforeLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,origin:this.HostInstance});let a,o,s=!1;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},n,r?{...r,url:e,resourceType:`manifest`}:void 0);(!t||!(t instanceof Response))&&(t=await fetch(e,{})),a=t,i=await t.json()}catch(c){o=c,i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:c,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),i||(delete this.manifestLoading[e],await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,response:a,error:c,origin:this.HostInstance}),D(ur,R,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${c}`,B(this.HostInstance.options))),s=!0}let c=[!i.metaData&&`metaData`,!i.exposes&&`exposes`,!i.shared&&`shared`].filter(Boolean),l=c.length>0?Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${c.join(`, `)}.`):void 0;return l&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:l,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,manifestJson:i,response:a,error:l||o,recovered:l?void 0:s||void 0,origin:this.HostInstance}),l&&D(br,R,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:c.join(`,`)},void 0,B(this.HostInstance.options)),this.manifestCache.set(e,i),i})()}async loadManifestSnapshot(e,t,n,r){let i=async()=>{let i=await this.getManifestJson(e,t,n,r),a=He(i,{version:e}),{remoteSnapshot:o}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:i,remoteSnapshot:a,manifestUrl:e,from:`manifest`});return o};return this.manifestLoading[e]||(this.manifestLoading[e]=i().then(e=>e)),this.manifestLoading[e]}},_i=class{constructor(){this.hooks=new H({})}},vi=class{constructor(e){this.hooks=new H({beforeRegisterShare:new G(`beforeRegisterShare`),afterRegisterShare:new U(`afterRegisterShare`),afterResolve:new K(`afterResolve`),beforeLoadShare:new K(`beforeLoadShare`),loadShare:new W,afterLoadShare:new U(`afterLoadShare`),errorLoadShare:new U(`errorLoadShare`),resolveShare:new G(`resolveShare`),initContainerShareScopeMap:new G(`initContainerShareScopeMap`)}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterRegisterShare(e,t){this.hooks.lifecycle.afterRegisterShare.emit({pkgName:e,...t,shareScopeMap:this.shareScopeMap,origin:this.host})}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:r,loadContext:i}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,loadContext:i,origin:this.host})}catch(e){xt(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:r,recovered:i,loadContext:a}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:i,loadContext:a})}catch(e){xt(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=Kn(e,t);return Object.keys(n).forEach(e=>{n[e].forEach(n=>{n.scope.forEach(r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:n});let i=this.shareScopeMap[r]?.[e],a=i?.[n.version];i||this.setShared({pkgName:e,lib:n.lib,get:n.get,loaded:n.loaded||!!n.lib,shared:n,from:t.name}),this.emitAfterRegisterShare(e,{scope:r,shared:n,previousShared:a,registeredShared:this.shareScopeMap[r]?.[e]?.[n.version],trigger:`runtime`})})})}),{newShareInfos:n,allShareInfos:r}}async loadShare(e,t){let{host:n}=this,r=t?.context,i=rr({pkgName:e,extraOptions:t,shareInfos:n.options.shared}),a=i;try{i?.scope&&await Promise.all(i.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:i.strategy,context:r}))}));let o=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:i,shared:n.options.shared,origin:n,loadContext:r});a=o.shareInfo,r=o.loadContext||r,E(a,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);let s=a,{shared:c,useTreesShaking:l}=tr(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,r)||{};if(c){let t=ir(c,l);if(t.lib)return L(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),t.lib;if(t.loading&&!t.loaded){let i=await t.loading;return t.loaded=!0,t.lib||=i,L(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),i}else{let i=(async()=>{let e=await t.get();return L(t,n.options.name),t.loaded=!0,t.lib=e,e})();this.setShared({pkgName:e,loaded:!1,shared:c,from:n.options.name,lib:null,loading:i,treeShaking:l?t:void 0});let a=await i;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),a}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,recovered:!0,loadContext:r}),!1;let i=qn(s.treeShaking),a=ir(s,i),o=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,L(a,n.options.name);let{shared:i,useTreesShaking:o}=tr(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,r)||{};if(i){let e=ir(i,o);e.lib=t,e.loaded=!0,i.from=s.from}return t})();this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:o,treeShaking:i?a:void 0});let c=await o;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:s,loadContext:r}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,error:t,loadContext:r}),t}}initializeSharing(e=Un,t){let{host:n}=this,r=t?.from,i=t?.strategy,a=t?.context?.trigger||r||`runtime`,o=t?.initScope,s=[];if(r!==`build`){let{initTokens:t}=this;o||=[];let n=t[e];if(n||=t[e]={from:this.host.name},o.indexOf(n)>=0)return s;o.push(n)}let c=this.shareScopeMap,l=n.options.name;c[e]||(c[e]={});let u=c[e],d=(t,n)=>{let{version:r,eager:i}=n;u[t]=u[t]||{};let o=u[t],s=o[r],c=s&&ir(s),d=!!(c&&(`eager`in c&&c.eager||`shareConfig`in c&&c.shareConfig?.eager));(!c||c.strategy!==`loaded-first`&&!c.loaded&&(!i==!d?l>o[r].from:i))&&(o[r]=n),this.emitAfterRegisterShare(t,{scope:e,shared:n,previousShared:s,registeredShared:o[r],trigger:a})},f=async e=>{let{module:t}=await n.remoteHandler.getRemoteModuleAndOptions({id:e}),r,i={initiator:`loadShare`,id:e,resourceType:`remoteEntry`,url:t.remoteInfo.entry};try{r=await t.getEntry(void 0,i)}catch(i){if(r=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:`runtime`,lifecycle:`beforeLoadShare`,remote:t.remoteInfo,origin:n}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,o,void 0,i))}};return Object.keys(n.options.shared).forEach(t=>{n.options.shared[t].forEach(n=>{n.scope.includes(e)&&d(t,n)})}),(n.options.shareStrategy===`version-first`||i===`version-first`)&&n.options.remotes.forEach(t=>{t.shareScope===e&&s.push(f(t.name))}),s}loadShareSync(e,t){let{host:n}=this,r=t?.context,i=rr({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{i?.scope&&i.scope.forEach(e=>{this.initializeSharing(e,{strategy:i.strategy,from:t?.from,context:r})});let{shared:a}=tr(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare,r)||{};if(a){if(typeof a.lib==`function`)return L(a,n.options.name),a.loaded||(a.loaded=!0,a.from===n.options.name&&(i.loaded=!0)),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:a,loadContext:r}),a.lib;if(typeof a.get==`function`){let t=a.get();if(!(t instanceof Promise))return L(a,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:t,shared:a}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:a,loadContext:r}),t}}if(i.lib)return i.loaded||=!0,this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:i,loadContext:r}),i.lib;if(i.get){let a=i.get();return a instanceof Promise&&D(t?.from===`build`?fr:pr,R,{hostName:n.options.name,sharedPkgName:e},void 0,B(n.options)),i.lib=a,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:i.lib,shared:i}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:i,loadContext:r}),i.lib}D(pr,R,{hostName:n.options.name,sharedPkgName:e},void 0,B(n.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,error:t,loadContext:r}),t}}initShareScopeMap(e,t,n={}){let{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:r,loading:i,loaded:a,get:o,treeShaking:s}){let{version:c,scope:l=`default`,...u}=t,d=Array.isArray(l)?l:[l],f=e=>{let t=(e,t,n)=>{n&&!e[t]&&(e[t]=n)},n=s?e.treeShaking:e;t(n,`loaded`,a),t(n,`loading`,i),t(n,`get`,o),t(n,`lib`,r)};d.forEach(t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][c]||(this.shareScopeMap[t][e][c]={version:c,scope:[t],...u,lib:r});let i=this.shareScopeMap[t][e][c];f(i),n&&i.from!==n&&(i.from=n)})}_setGlobalShareScopeMap(e){let t=nr(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},yi=class{constructor(){this.shareScopeMap={},this.hooks=new H({afterResolve:new K(`afterResolve`)})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw Error(`Shared dependency loading is disabled by experiments.optimization.disableShared.`)}loadShareSync(){throw Error(`Shared dependency loading is disabled by experiments.optimization.disableShared.`)}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},bi=class{constructor(e){this.hooks=new H({beforeRegisterRemote:new G(`beforeRegisterRemote`),registerRemote:new G(`registerRemote`),beforeRequest:new K(`beforeRequest`),afterMatchRemote:new W(`afterMatchRemote`),onLoad:new W(`onLoad`),afterLoadRemote:new W(`afterLoadRemote`),handlePreloadModule:new U(`handlePreloadModule`),errorLoadRemote:new W(`errorLoadRemote`),beforePreloadRemote:new W(`beforePreloadRemote`),generatePreloadAssets:new W(`generatePreloadAssets`),afterPreloadRemote:new W(`afterPreloadRemote`),loadEntry:new W}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:n,expose:r}=t,{name:i,alias:a}=n;if(this.idToRemoteMap[e]={name:n.name,expose:r},a&&e.startsWith(i)){let t=e.replace(i,a);this.idToRemoteMap[t]={name:n.name,expose:r};return}if(a&&e.startsWith(a)){let t=e.replace(a,i);this.idToRemoteMap[t]={name:n.name,expose:r}}}async loadRemote(e,t){let{host:n}=this,r=or(n.options.remotes,e),i=e,a=r?.expose,o=r?z(r.remote):void 0,s;try{let{loadFactory:r=!0}=t||{loadFactory:!0},{module:c,moduleOptions:l,remoteMatchInfo:u}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:d,remote:f,expose:p,id:m,remoteSnapshot:h}=u;i=m,a=p,o=z(f);let g=await c.get(m,p,t,h),_=await this.hooks.lifecycle.onLoad.emit({id:m,pkgNameOrAlias:d,expose:p,exposeModule:r?g:void 0,exposeModuleFactory:r?void 0:g,remote:f,options:l,moduleInstance:c,origin:n});return this.setIdToRemoteMap(e,u),s={id:i,expose:a,remote:o,options:t,origin:n},typeof _==`function`?_:g}catch(r){let{from:c=`runtime`}=t||{from:`runtime`},l;try{l=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:c,lifecycle:`onLoad`,expose:a,remote:o,origin:n})}catch(e){throw s={id:i,expose:a,remote:o,options:t,error:e,origin:n},e}if(!l)throw s={id:i,expose:a,remote:o,options:t,error:r,origin:n},r;return s={id:i,expose:a,remote:o,options:t,error:r,origin:n,recovered:!0},l}finally{s&&await this.hooks.lifecycle.afterLoadRemote.emit(s)}}async preloadRemote(e){let{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=qr(t.options.remotes,e),i=e=>{let{preloadConfig:t,remote:n}=e,r=t.exposes||[];return r.length?r.map(r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:ar(n.name,r)})):[{ops:e,id:`${n.name}/*`}]},a;await Promise.all(r.flatMap(i).map(async e=>{let{ops:r,id:i}=e,{remote:a,preloadConfig:o}=r,s=z(a);try{let{globalSnapshot:e,remoteSnapshot:c}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:a,id:i,initiator:`preloadRemote`}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:a,remoteInfo:s,globalSnapshot:e,remoteSnapshot:c});if(!l)return;let u=await ti(s,t,l,!0,{initiator:`preloadRemote`,id:i},o.recordPreloadedAssets);n.push({remote:a,remoteInfo:s,preloadConfig:o,id:i,results:u})}catch(e){n.push({remote:a,remoteInfo:s,preloadConfig:o,id:i,results:[{url:s.entry,status:`error`,resourceType:/\.json(?:$|[?#])/i.test(s.entry)?`manifest`:`remoteEntry`,initiator:`preloadRemote`,id:i,error:e}]})}}));let o=n.flatMap(e=>e.results.filter(e=>e.status===`error`||e.status===`timeout`));if(o.length>0&&(a=Error(`preloadRemote failed to load ${o.length} resource(s).`),Object.assign(a,{results:n,failedResults:o})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:a}),a)throw a}registerRemotes(e,t){let{host:n}=this;e.forEach(e=>{this.registerRemote(e,n.options.remotes,{force:t?.force})})}initRawContainer(e,t,n){let{host:r}=this,i=new ii({host:r,remoteInfo:z({name:e,entry:t})});return i.remoteEntryExports=n,r.moduleCache.set(e,i),i}async getRemoteModuleAndOptions(e){let{host:t}=this,{id:n}=e,r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:`runtime`,error:e,lifecycle:`beforeRequest`}),!r)throw e}let{id:i}=r,a=or(t.options.remotes,i);if(!a)try{D(dr,R,{hostName:t.options.name,requestId:i},void 0,B(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:i,options:t.options,error:e,origin:t}),e}let{remote:o}=a,s=z(o);await this.hooks.lifecycle.afterMatchRemote.emit({id:i,...a,options:t.options,remoteInfo:s,origin:t});let c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:i,...a,options:t.options,origin:t,remoteInfo:s}),{remote:l,expose:u}=c;E(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);let d=t.moduleCache.get(l.name),f={host:t,remoteInfo:s};return d||(d=new ii(f),t.moduleCache.set(l.name,d)),{module:d,moduleOptions:f,remoteMatchInfo:c}}registerRemote(e,t,n){let{host:r}=this,i=()=>{if(e.alias){let n=t.find(t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias)));E(!n,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${n&&n.name} name or alias`)}`entry`in e&&S&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=Un,e.type||=Wn};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});let a=t.find(t=>t.name===e.name);if(!a)i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r});else{let o=[`The remote "${e.name}" is already registered.`,`Please note that overriding it may cause unexpected errors.`];n?.force&&(this.removeRemote(a),i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),Re(o.join(` `)))}}removeRemote(e){try{let{host:t}=this,{name:n}=e,r=t.options.remotes.findIndex(e=>e.name===n);r!==-1&&t.options.remotes.splice(r,1);let i=j(O.__FEDERATION__.moduleInfo,Ct(e)).key;delete O.__FEDERATION__.moduleInfo[i],`entry`in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete Nt.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);let{hostGlobalSnapshot:a}=hi(e,t);if(a){let t=a&&`remotesInfo`in a&&a.remotesInfo&&j(a.remotesInfo,e.name).key;t&&delete a.remotesInfo[t]}let o=t.moduleCache.get(e.name);if(o){let n=o.remoteInfo,r=n.entryGlobalName;O[r]&&(Object.getOwnPropertyDescriptor(O,r)?.configurable?delete O[r]:O[r]=void 0);let i=zr(o.remoteInfo);A[i]&&delete A[i];let a=n.buildVersion?Ie(n.name,n.buildVersion):n.name,s=O.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===a:e.name===a);if(s!==-1){let e=O.__FEDERATION__.__INSTANCES__[s];a=e.options.id||a;let t=nr(),r=!0,i=[];Object.keys(t).forEach(e=>{let a=t[e];a&&Object.keys(a).forEach(t=>{let o=a[t];o&&Object.keys(o).forEach(a=>{let s=o[a];s&&Object.keys(s).forEach(o=>{let c=s[o];c&&typeof c==`object`&&c.from===n.name&&(c.loaded||c.loading?(c.useIn=c.useIn.filter(e=>e!==n.name),c.useIn.length?r=!1:i.push([e,t,a,o])):i.push([e,t,a,o]))})})})}),r&&(e.shareScopeMap={},delete t[a]),i.forEach(([e,n,r,i])=>{delete t[e]?.[n]?.[r]?.[i]}),O.__FEDERATION__.__INSTANCES__.splice(s,1)}t.moduleCache.delete(e.name)}}catch(e){bt.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},xi=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN!=`boolean`||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,Si=typeof FEDERATION_OPTIMIZE_NO_REMOTE!=`boolean`||!FEDERATION_OPTIMIZE_NO_REMOTE,Ci=typeof FEDERATION_OPTIMIZE_NO_SHARED!=`boolean`||!FEDERATION_OPTIMIZE_NO_SHARED,wi=class{constructor(e){this.hooks=new H({beforeInit:new G(`beforeInit`),init:new U,beforeInitContainer:new K(`beforeInitContainer`),initContainer:new K(`initContainer`)}),this.version=`2.9.0`,this.moduleCache=new Map,this.loaderHook=new H({getModuleInfo:new U,createScript:new U,createLink:new U,fetch:new W,loadEntryError:new W,afterLoadEntry:new W(`afterLoadEntry`),beforeInitRemote:new W(`beforeInitRemote`),afterInitRemote:new W(`afterInitRemote`),beforeGetExpose:new W(`beforeGetExpose`),afterGetExpose:new W(`afterGetExpose`),beforeExecuteFactory:new W(`beforeExecuteFactory`),afterExecuteFactory:new W(`afterExecuteFactory`),getModuleFactory:new W}),this.bridgeHook=new H({beforeBridgeRender:new U,afterBridgeRender:new U,beforeBridgeDestroy:new U,afterBridgeDestroy:new U,afterBridgeRouteSync:new U});let t=Si&&xi?[li(),mi()]:[],n={id:Vr(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:S};this.name=e.name,this.options=n,this.snapshotHandler=Si?new gi(this):new _i,this.sharedHandler=Ci?new vi(this):new yi,this.remoteHandler=Si?new bi(this):new si,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){e.name&&e.name!==this.options.name&&D(vt(_r,R)),this.registerPlugins(e.plugins);let t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=Un,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){return this.remoteHandler.initRawContainer(e,t,n)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,n={}){this.sharedHandler.initShareScopeMap(e,t,n)}formatOptions(e,t){let n=Ci?Kn(e,t).allShareInfos:{},{userOptions:r,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),a=this.remoteHandler.formatAndRegisterRemote(i,r),{allShareInfos:o}=this.sharedHandler.registerShared(i,r),s=[...i.plugins];r.plugins&&r.plugins.forEach(e=>{s.includes(e)||s.push(e)});let c={...e,...t,plugins:s,remotes:a,shared:o,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){this.options.plugins=Wr(e,this)}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};function Ti(e){let t=new((Rt())||wi)({id:`${e.name}@${e.version||Date.now()}`,...e});return Lt(t),t}zt(wi);var Ei=Ti({name:`luzmo-embed-runtime`,remotes:[]}),Di=new Map,Oi=0,ki=new Set;function Ai(e){if(typeof document>`u`)return;let t;try{t=new URL(p(e)).origin}catch{return}if(ki.has(t))return;ki.add(t);let n=document.createElement(`link`);n.rel=`preconnect`,n.href=t,n.crossOrigin=`anonymous`,(document.head??document.documentElement).append(n)}function ji(e,t){let n=p(e);if(e.startsWith(`http://localhost`))return`${n}/mf-manifest.json`;switch(t){case`DashboardApp`:case`VizItemApp`:return`${n}/dashboard-app/mf-manifest.json`;case`IQApp`:return`${n}/iq-app/mf-manifest.json`}}function Mi(e,t){return`${e}|${t}`}function Ni(e,t){let n=Mi(e,t),r=Di.get(n);if(r)return r;let i={entry:ji(e,t),registered:!1,remoteName:`luzmo_embed_${Oi++}`};return Di.set(n,i),i}function q(e,t=`DashboardApp`){Ai(e);let n=Ni(e,t);return n.module?Promise.resolve(n.module):n.loadPromise?n.loadPromise:(n.registered||=(Ei.registerRemotes([{name:n.remoteName,entry:n.entry}]),!0),n.loadPromise=Ei.loadRemote(`${n.remoteName}/${t}`).then(e=>{if(!e)throw Error(`Failed to load "${t}" from "${n.entry}".`);return n.module=e,e}).finally(()=>{n.loadPromise=void 0}),n.loadPromise)}var Pi=`0.1.104`,Fi=Object.defineProperty,Ii=Object.getOwnPropertyDescriptor,J=(e,t,n,r)=>{for(var i=r>1?void 0:r?Ii(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Fi(t,n,i),i},Y=`7.5.0`;function Li(e){let t={type:`error`,errorMsg:e,error:{msg:e}};return{...t,data:t}}function Ri(...e){return e.find(e=>typeof e==`string`&&e.length>0)}function zi(e){let t=e?.data??e??{};return Li(Ri(t.errorMsg,t.error?.msg)??`Unknown error`)}var Bi=new class{constructor(){this._dashboardComponents=[]}},Vi=()=>{typeof window.__luzmoMessageHandler!=`function`&&(window.__luzmoMessageHandler=e=>{let t=Bi._dashboardComponents.find(t=>e.data.name===t._iframeId);if(t)switch(e.data?.type){case`load`:t.dispatchEvent(new CustomEvent(`load`,{detail:{data:e.data}})),t._loadTimeoutHandle&&=(clearTimeout(t._loadTimeoutHandle),void 0),t.iframeLoaded=!0,t.dimensions=e.data.dimensions,t._calculateDimAfterDashboardLoaded();break;case`error`:t._handleEmbedError(e.data);break;case`data`:y(t,e.data.requestId,e.data.data);break;case`filters`:y(t,e.data.requestId,e.data.filters);break;case`insights`:e.data.error?b(t,e.data.requestId,Error(e.data.error.message)):y(t,e.data.requestId,e.data.summary);break;case`dashboardContext`:y(t,e.data.requestId,e.data.context);break;case`getAccessibleDashboards`:y(t,e.data.requestId,e.data.accessibleDashboards);break;case`dashboardAction`:t.dispatchEvent(new CustomEvent(`dashboardAction`,{detail:{data:e.data}}));break;case`export`:e.data.error?b(t,e.data.requestId,e.data):(t.dispatchEvent(new CustomEvent(`exported`,{detail:{data:e.data}})),y(t,e.data.requestId,e.data));break;case`changedFilters`:t.dispatchEvent(new CustomEvent(`changedFilters`,{detail:{data:e.data}}));break;case`contextChanged`:t.dispatchEvent(new CustomEvent(`contextChanged`,{detail:{data:e.data}}));break;case`customEvent`:t.dispatchEvent(new CustomEvent(`customEvent`,{detail:{data:e.data}}));break;case`chartsRendered`:case`itemsRendered`:e.data.type=`itemsRendered`,t.dispatchEvent(new CustomEvent(`itemsRendered`,{detail:{data:e.data}}));break;case`setEditMode`:e.data.error?b(t,e.data.requestId,e.data):(y(t,e.data.requestId,e.data),t.params.editMode=e.data.editMode,t._containerStyle=re(t),t.dimensions&&we(t));break;case`calculatedDimensions`:t.dimensions=e.data.dimensions,we(t);break;case`trackViewport`:e.data.enabled?t._startViewportTracking():t._stopViewportTracking();break;case`setSelectedData`:case`setFilters`:e.data.error?b(t,e.data.requestId,e.data):y(t,e.data.requestId,e.data);break;case`setPreview`:e.data.error?b(t,e.data.requestId,e.data):y(t,e.data.requestId,e.data);break}},window.addEventListener(`message`,window.__luzmoMessageHandler,!1))},Hi=t`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@-webkit-keyframes spin {
|
|
15
|
+
0% {
|
|
16
|
+
-webkit-transform: rotate(0deg);
|
|
17
|
+
transform: rotate(0deg);
|
|
18
|
+
}
|
|
19
|
+
100% {
|
|
20
|
+
-webkit-transform: rotate(360deg);
|
|
21
|
+
transform: rotate(360deg);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes spin {
|
|
26
|
+
0% {
|
|
27
|
+
-webkit-transform: rotate(0deg);
|
|
28
|
+
transform: rotate(0deg);
|
|
29
|
+
}
|
|
30
|
+
100% {
|
|
31
|
+
-webkit-transform: rotate(360deg);
|
|
32
|
+
transform: rotate(360deg);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
:host {
|
|
36
|
+
position: relative;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.luzmo-embed-dashboard {
|
|
41
|
+
background: transparent;
|
|
42
|
+
padding: 0;
|
|
43
|
+
border: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.luzmo-embed-dashboard-ede {
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.luzmo-embed-container-ede {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
* Web component mode: the dashboard app renders directly (no iframe). Make its host fill the
|
|
56
|
+
* sized .dashboard-container so the app's internal height:100% chain resolves to the calculated
|
|
57
|
+
* dashboard height - exactly like the iframe gets its height. Without this the app collapses to
|
|
58
|
+
* its intrinsic size and its inner scroll container produces a second scrollbar, and content can
|
|
59
|
+
* spill outside the container.
|
|
60
|
+
*/
|
|
61
|
+
#dashboard-wc-container {
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#dashboard-wc-container dashboard-component {
|
|
67
|
+
display: block;
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.luzmo-container-loader {
|
|
73
|
+
width: 100%;
|
|
74
|
+
position: relative;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.luzmo-lc {
|
|
78
|
+
margin: 0 auto;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.luzmo-loading-message {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 20px;
|
|
84
|
+
text-align: center;
|
|
85
|
+
margin-bottom: 16px;
|
|
86
|
+
font-family: Helvetica, Arial, sans-serif;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.luzmo-loading-circle {
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
margin: 16px auto;
|
|
93
|
+
position: relative;
|
|
94
|
+
text-indent: -9999em;
|
|
95
|
+
animation: spin 0.6s infinite linear;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.luzmo-loading-circle,
|
|
99
|
+
.luzmo-loading-circle:after {
|
|
100
|
+
border-radius: 50%;
|
|
101
|
+
width: 32px;
|
|
102
|
+
height: 32px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.itemEmbedding:after {
|
|
106
|
+
width: 24px;
|
|
107
|
+
height: 24px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.luzmo-error {
|
|
111
|
+
background: transparent;
|
|
112
|
+
padding: 48px 0;
|
|
113
|
+
margin: 0 auto;
|
|
114
|
+
width: 80%;
|
|
115
|
+
border: 0;
|
|
116
|
+
text-align: center;
|
|
117
|
+
min-height: 192px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.dashboard-error {
|
|
121
|
+
font-size: 30px;
|
|
122
|
+
background: transparent;
|
|
123
|
+
padding: 48px 0;
|
|
124
|
+
margin: 0 auto;
|
|
125
|
+
width: 80%;
|
|
126
|
+
border: 0;
|
|
127
|
+
text-align: center;
|
|
128
|
+
min-height: 192px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.luzmo-loader {
|
|
132
|
+
top: 0;
|
|
133
|
+
left: 0;
|
|
134
|
+
width: 100%;
|
|
135
|
+
min-height: 400px;
|
|
136
|
+
position: absolute;
|
|
137
|
+
transition-duration: 0.3s;
|
|
138
|
+
}
|
|
139
|
+
`,Ui=`DashboardApp`,X=class extends e{constructor(){super(),this.language=`auto`,this.editorLanguage=`auto`,this.screenMode=`auto`,this.switchScreenModeOnResize=!0,this.editMode=`view`,this.embedMode=`iframe`,this.iframeStyle={},this._containerStyle={},this._loaderStyle={},this._lcStyle={},this._loadingCircleStyle={},this._containerLoaderStyle={},this._loaderMsg=``,this._itemEmbedding=!1,this.browserError=!1,this.browserErrorMsg=``,this.dashboardError=!1,this.browserNotSupported=[],this.libVersion=Y+`-wc-luzmo`,this.isLibraryLoaded=!1,this.currentAuthKey=null,this.currentAuthToken=null,this.isInitCalled=!1,this.attributesMap={dashboardId:`dashboard-id`,dashboardSlug:`dashboard-slug`,itemId:`item-id`,language:`language`,editorLanguage:`editorLanguage`,screenMode:`screen-mode`,switchScreenModeOnResize:`switch-screen-mode-on-resize`,authKey:`auth-key`,authToken:`auth-token`,editMode:`edit-mode`,theme:`theme`,mainColor:`main-color`,loaderBackground:`loader-background`,loaderFontColor:`loader-font-color`,loaderSpinnerColor:`loader-spinner-color`,loaderSpinnerBackground:`loader-spinner-background`,appServer:`app-server`,apiHost:`api-host`,itemDimensions:`item-dimensions`,timezoneId:`timezone-id`},this.loaderSize=32,this.borderWidth=3,this.minHeight=400,this._viewportTrackingActive=!1,this._onViewportChange=()=>{this._postViewport()},this._containerId=v(),this._iframeId=`luzmo-dashboard-${this._containerId}`,this.iframeLoaded=!1,this.promises={},this.params=this._setOptions(),this._onResize=()=>{if(this.shadowRoot?.querySelector(`.dashboard-container`)){if(this.containerWidth=this.luzmoEmbedContainer.offsetWidth,this.params.switchScreenModeOnResize&&this.params.screenMode===`auto`)for(let e of u)e.width[0]<=window.innerWidth&&window.innerWidth<=e.width[1]&&(this.currentScreenMode=e.mode);this.iframeLoaded?this._calculateDimAfterDashboardLoaded():this.dimensions&&(this.containerWidth=this.luzmoEmbedContainer.offsetWidth,we(this))}},this._resizeObserver=new ResizeObserver(e=>{window.requestAnimationFrame(()=>{!Array.isArray(e)||e.length===0||this._onResize()})})}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect(),this._stopViewportTracking();for(let e of Object.keys(this.promises))this.promises[e].reject(Error(`Dashboard component was removed`))}_startViewportTracking(){this.embedMode===`iframe`&&(this._viewportTrackingActive||(this._viewportTrackingActive=!0,window.addEventListener(`scroll`,this._onViewportChange,{passive:!0,capture:!0}),window.addEventListener(`resize`,this._onViewportChange,{passive:!0})),this._postViewport())}_stopViewportTracking(){this._viewportTrackingActive&&(this._viewportTrackingActive=!1,window.removeEventListener(`scroll`,this._onViewportChange,{capture:!0}),window.removeEventListener(`resize`,this._onViewportChange))}_postViewport(){let e=this.iframe?.contentWindow;if(!e)return;let t=this.iframe.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=Math.max(t.top,0),i=Math.min(t.bottom,n),a=Math.max(i-r,0),o=Math.min(Math.max(-t.top,0),t.height);e.postMessage({action:`setViewport`,offsetTop:o,visibleHeight:a},`*`)}firstUpdated(){this._loaderMsg=ne(this)?.loadingMsg,this._loaderStyles(),Bi._dashboardComponents.push(this),this.luzmoEmbedContainer&&this._resizeObserver.observe(this.luzmoEmbedContainer)}initComponent(){this.params=this._setOptions(),this.isWebComponentViewMode()?q(this.params.appServer,Ui).then(async()=>{this.isLibraryLoaded=!0,await this.updateComplete;let e=document.createElement(`dashboard-component`);this.setAllAttributesOnElement(e),e.addEventListener(`load`,t=>{this.containerWidth=e.offsetWidth,this.dimensions=t.detail.dimensions,we(this),window.dispatchEvent(new Event(`resize`)),this.dispatchEvent(new CustomEvent(`load`,t))}),e.addEventListener(`itemsRendered`,e=>this.dispatchEvent(new CustomEvent(`itemsRendered`,e))),e.addEventListener(`error`,e=>{this._handleEmbedError(e.detail)}),e.addEventListener(`customEvent`,e=>this.dispatchEvent(new CustomEvent(`customEvent`,e))),e.addEventListener(`changedFilters`,e=>this.dispatchEvent(new CustomEvent(`changedFilters`,e))),e.addEventListener(`dashboardAction`,e=>this.dispatchEvent(new CustomEvent(`dashboardAction`,e))),e.addEventListener(`export`,e=>this.dispatchEvent(new CustomEvent(`exported`,e))),e.addEventListener(`contextChanged`,e=>this.dispatchEvent(new CustomEvent(`contextChanged`,e)));let t=this.renderRoot.querySelector(`#dashboard-wc-container`);t&&(t.append(e),this.dashboardReference=e)}):(this.containerWidth=this.container?.clientWidth,Te(this),c(this),this._setupLoader(),this.params.error||(this._loaderStyles(),Vi(),this._iframeUrl=te(this),this.iframe?.setAttribute(`src`,this._iframeUrl),this.iframeStyle=ce(this)))}setAllAttributes(){this.dashboardReference&&this.setAllAttributesOnElement(this.dashboardReference)}setAllAttributesOnElement(e){if(e){this.params.dashboardId&&e.setAttribute(`dashboard-id`,this.params.dashboardId),this.params.appServer&&e.setAttribute(`app-server`,this.params.appServer),this.params.apiHost&&e.setAttribute(`api-host`,p(this.params.apiHost));for(let t in this.attributesMap)![`authKey`,`authToken`,`apiHost`,`itemDimensions`,`dashboardId`,`appServer`].includes(t)&&this.params[t]&&e.setAttribute(this.attributesMap[t],this.params[t]);this.params.itemDimensions&&e.setAttribute(`item-dimensions`,JSON.stringify(this.params.itemDimensions)),this.params.key&&e.setAttribute(`auth-key`,this.params.key),this.params.token&&e.setAttribute(`auth-token`,this.params.token)}}updated(e){let t=new Set([`dashboardId`,`dashboardSlug`,`itemId`,`language`,`editorLanguage`,`theme`,`editMode`,`screenMode`,`switchScreenModeOnResize`,`authToken`,`authKey`,`appServer`,`apiHost`,`timezoneId`,`itemDimensions`]),n=[`dashboardId`,`dashboardSlug`,`itemId`],r=!1;for(let t of n)r||=e.get(t)===void 0&&this[t]!==void 0;if(r&&!this.isInitCalled){this.initComponent(),this.isInitCalled=!0;return}if(this.isWebComponentViewMode()){if(e.has(`editMode`)&&!this.dashboardReference){this.iframeLoaded=!1,this._loadTimeoutHandle&&=(clearTimeout(this._loadTimeoutHandle),void 0),this.params=this._setOptions(),this.initComponent();return}if(this.dashboardReference){for(let[t]of e.entries())if(t===`appSever`)q(e[t],Ui).then(async()=>{this.isLibraryLoaded=!0,await this.updateComplete,this.dashboardReference=this.renderRoot.querySelector(`dashboard-component`),this.setAllAttributes()});else if(this.attributesMap[t]){let e=this.attributesMap[t]??t,n=typeof this[t]==`object`?JSON.stringify(this[t]):this[t]?.toString()||this[t];this.dashboardReference.setAttribute(e,n)}}}else for(let[n]of e.entries())t.has(n)&&n!==`editMode`?this._reloadIframeContent():t.has(n)&&n===`editMode`&&(this.iframeLoaded?(this.setEditMode(this.editMode),this.params=this._setOptions()):this._reloadIframeContent())}_reloadIframeContent(){if(this.params=this._setOptions(),Te(this),this._setupLoader(),this.params.error){this._loadTimeoutHandle&&=(clearTimeout(this._loadTimeoutHandle),void 0),this._loaderStyles();return}this.iframeLoaded=!1,this._loadTimeoutHandle&&clearTimeout(this._loadTimeoutHandle),this._loadTimeoutHandle=setTimeout(()=>{console.warn(`Failed to load dashboard, appServer is likely down or unreachable.`)},15*1e3),this._loaderStyles(),this._iframeUrl=te(this),this.iframe&&this._updateIframeUrl(),this.iframeStyle=ce(this)}_setOptions(){let e={dashboardId:this.dashboardId,dashboardSlug:this.dashboardSlug};return this.itemId?(e.itemId=this.itemId,this._itemEmbedding=!0):this._itemEmbedding=!1,this.language&&(e.language=this.language),this.editorLanguage&&(e.editorLanguage=this.editorLanguage),this.screenMode&&(e.screenMode=this.screenMode),e.switchScreenModeOnResize=this.switchScreenModeOnResize,this.authToken&&(e.token=this.authToken),this.authKey&&(e.key=this.authKey),this.editMode&&(e.editMode=this.editMode),this.theme&&(e.theme=this.theme),this.mainColor&&(e.mainColor=this.mainColor),this.loaderBackground&&(e.loaderBackground=this.loaderBackground),this.loaderFontColor&&(e.loaderFontColor=this.loaderFontColor),this.loaderSpinnerColor&&(e.loaderSpinnerColor=this.loaderSpinnerColor),this.loaderSpinnerBackground&&(e.loaderSpinnerBackground=this.loaderSpinnerBackground),this.timezoneId&&(e.timezoneId=this.timezoneId),this.itemDimensions&&(e.itemDimensions=this.itemDimensions),this.appServer?(this.appServer=this.isWebComponentViewMode()?p(this.appServer):f(this.appServer),e.appServer=this.appServer):(this.appServer=f(l.appServer),e.appServer=this.appServer),this.apiHost?(this.apiHost=this.isWebComponentViewMode()?p(this.apiHost):f(this.apiHost),e.apiHost=this.apiHost):(this.apiHost=this.appServer.includes(`luzmo.com`)?this.appServer.replace(`app`,`api`):this.appServer,e.apiHost=this.apiHost),this.currentAuthKey=this.authKey,this.currentAuthToken=this.authToken,e}_updateIframeUrl(){ue(this.iframe,this._iframeUrl)}_setupLoader(){let e=ne(this);this._loaderMsg=e.loadingMsg,e.errorMsg&&this._handleEmbedError({errorMsg:e.errorMsg},`browser`)}_handleEmbedError(e,t=`dashboard`){let n=zi(e),r=n.errorMsg;t===`browser`?(this.browserError=!0,this.browserErrorMsg=r):(this.dashboardError=!0,this.iframeLoaded=!0),this._loadTimeoutHandle&&=(clearTimeout(this._loadTimeoutHandle),void 0),this._displayError(),console.error(`Dashboard error:`,r),this.dispatchEvent(new CustomEvent(`error`,{detail:n}))}_displayError(){this.dashboardError&&(this._loaderStyles(),this.iframeStyle.opacity=1),this.browserError&&(this._containerStyle.display=`none`)}_calculateDimAfterDashboardLoaded(){this.dashboardError=!1,this._loaderStyles(),we(this)}_loaderStyles(){this._containerStyle=re(this),this._loaderStyle=ae(this),this._loadingCircleStyle=oe(this),this._containerLoaderStyle=ie(this),this._lcStyle=se(this)}static get styles(){return[Hi]}render(){let e,t=n`
|
|
140
|
+
<div
|
|
141
|
+
class="luzmo-container-loader"
|
|
142
|
+
id="luzmo-container-loader-${this._containerId}"
|
|
143
|
+
style=${o(this._containerLoaderStyle)}
|
|
144
|
+
>
|
|
145
|
+
<div
|
|
146
|
+
class="luzmo-loader"
|
|
147
|
+
id="luzmo-loader-${this._containerId}"
|
|
148
|
+
style=${o(this._loaderStyle)}
|
|
149
|
+
>
|
|
150
|
+
<div
|
|
151
|
+
class="luzmo-lc"
|
|
152
|
+
style=${o(this._lcStyle)}
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
class="luzmo-loading-circle"
|
|
156
|
+
style=${o(this._loadingCircleStyle)}
|
|
157
|
+
></div>
|
|
158
|
+
${this._itemEmbedding?``:n`
|
|
159
|
+
<div
|
|
160
|
+
class="luzmo-loading-message"
|
|
161
|
+
style=${o({color:this.loaderFontColor})}
|
|
162
|
+
>
|
|
163
|
+
${this._loaderMsg}
|
|
164
|
+
</div>
|
|
165
|
+
`}
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
`;return e=this.isWebComponentViewMode()?this.isLibraryLoaded?n`
|
|
170
|
+
${this.dashboardId||this.dashboardSlug?n`
|
|
171
|
+
<div id="dashboard-wc-container"></div>
|
|
172
|
+
`:n`
|
|
173
|
+
<div id="luzmo-error-${this._containerId}">
|
|
174
|
+
<h3 class="luzmo-error">${this.browserErrorMsg}</h3>
|
|
175
|
+
</div>
|
|
176
|
+
`}
|
|
177
|
+
`:n`${t}`:n`
|
|
178
|
+
${this.dashboardId||this.dashboardSlug?n`
|
|
179
|
+
${t}
|
|
180
|
+
<iframe
|
|
181
|
+
class="luzmo-embed-dashboard ${this.isWebComponentViewMode()?``:`luzmo-embed-dashboard-ede`}"
|
|
182
|
+
id="${this._iframeId}"
|
|
183
|
+
name="${this._iframeId}"
|
|
184
|
+
style=${o(this.iframeStyle)}
|
|
185
|
+
src="${this._iframeUrl}"
|
|
186
|
+
frameborder="0"
|
|
187
|
+
></iframe>
|
|
188
|
+
`:n`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
|
|
189
|
+
${this.browserError?n`
|
|
190
|
+
<div id="luzmo-error-${this._containerId}">
|
|
191
|
+
<h3 class="luzmo-error">${this.browserErrorMsg}</h3>
|
|
192
|
+
</div>
|
|
193
|
+
`:``}
|
|
194
|
+
`,n`
|
|
195
|
+
<div class="${De} ${this.isWebComponentViewMode()?``:`${De}-ede`}">
|
|
196
|
+
<div
|
|
197
|
+
class="dashboard-container"
|
|
198
|
+
style=${o(Object.assign({},this._containerStyle,{width:this.iframeStyle.width??`100%`,height:this.iframeStyle.height??`100%`}))}
|
|
199
|
+
>
|
|
200
|
+
${e}
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
`}getDashboards(){return new Promise(e=>e(Bi._dashboardComponents))}getData(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getData(e):this.isWebComponentViewMode()?Promise.reject():me(this,this.iframe,e)}getFilters(){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getFilters():this.isWebComponentViewMode()?Promise.reject():he(this,this.iframe)}getInsights(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getInsights(e):this.isWebComponentViewMode()?Promise.reject(Error(`getInsights is not available: dashboard reference is not ready.`)):ge(this,this.iframe,e)}getDashboardContext(){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getDashboardContext():this.isWebComponentViewMode()?Promise.reject(Error(`getDashboardContext is not available: dashboard reference is not ready.`)):pe(this,this.iframe)}setSelectedData(e,t){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setSelectedData(e,t):this.isWebComponentViewMode()?Promise.reject():Ce(this,this.iframe,e,t)}setAuthorization(e,t){return this.currentAuthKey=e,this.currentAuthToken=t,this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setAuthorization(e,t):this.isWebComponentViewMode()?Promise.reject():be(this,this.iframe,e,t)}refreshData(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.refreshData(e):this.isWebComponentViewMode()?Promise.reject():e?_e(this,this.iframe,e):_e(this,this.iframe)}reloadDashboard(){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.reloadDashboard():this.isWebComponentViewMode()?Promise.reject():ve(this,this.iframe)}exportDashboard(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.exportDashboard(e):this.isWebComponentViewMode()?Promise.reject():e?de(this,this.iframe,e):de(this,this.iframe)}getAccessibleDashboards(){return fe(this)}addFilters(e,t){return this.dashboardReference.addFilters(e,t)}setEditMode(e){return this.dashboardReference&&e===`view`?(this.editMode=`view`,this.params.editMode=`view`,this.initComponent(),Promise.resolve({type:`setEditMode`,editMode:e})):this.dashboardReference&&[`editFull`,`editLimited`].includes(e)?(this.editMode=e,this.params.editMode=e,this.initComponent(),Promise.resolve({type:`setEditMode`,editMode:e})):this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setEditMode(e):this.isWebComponentViewMode()?Promise.reject():xe(this,this.iframe,e)}setPreview(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setPreview(e):Se(this,this.iframe,e)}sendExportEmail(e,t,n){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.sendExportEmail(e,t,n):this.isWebComponentViewMode()?Promise.reject():ye(this,this.iframe,e,t,n)}isWebComponentViewMode(){return this.embedMode===`webComponent`&&(this.editMode===`view`||this.editMode===void 0)}};J([i(`.dashboard-container`)],X.prototype,`container`,2),J([i(`.${De}`)],X.prototype,`luzmoEmbedContainer`,2),J([i(`iframe`)],X.prototype,`iframe`,2),J([r()],X.prototype,`dashboardId`,2),J([r()],X.prototype,`dashboardSlug`,2),J([r()],X.prototype,`itemId`,2),J([r()],X.prototype,`language`,2),J([r()],X.prototype,`editorLanguage`,2),J([r()],X.prototype,`screenMode`,2),J([r({converter:{fromAttribute:e=>e===`true`,toAttribute:String}})],X.prototype,`switchScreenModeOnResize`,2),J([r()],X.prototype,`editMode`,2),J([r()],X.prototype,`theme`,2),J([r()],X.prototype,`mainColor`,2),J([r()],X.prototype,`authToken`,2),J([r()],X.prototype,`authKey`,2),J([r()],X.prototype,`loaderBackground`,2),J([r()],X.prototype,`loaderFontColor`,2),J([r()],X.prototype,`loaderSpinnerColor`,2),J([r()],X.prototype,`loaderSpinnerBackground`,2),J([r()],X.prototype,`appServer`,2),J([r()],X.prototype,`timezoneId`,2),J([r()],X.prototype,`apiHost`,2),J([r({type:Object})],X.prototype,`itemDimensions`,2),J([r()],X.prototype,`embedMode`,2),J([r({attribute:!1})],X.prototype,`_containerId`,2),J([r({attribute:!1})],X.prototype,`_iframeId`,2),J([r({attribute:!1})],X.prototype,`params`,2),J([r({attribute:!1})],X.prototype,`_iframeUrl`,2),J([r({attribute:!1})],X.prototype,`iframeLoaded`,2),J([r({attribute:!1})],X.prototype,`promises`,2),J([r({attribute:!1})],X.prototype,`iframeStyle`,2),J([r({attribute:!1})],X.prototype,`_containerStyle`,2),J([r({attribute:!1})],X.prototype,`_loaderStyle`,2),J([r({attribute:!1})],X.prototype,`_lcStyle`,2),J([r({attribute:!1})],X.prototype,`_loadingCircleStyle`,2),J([r({attribute:!1})],X.prototype,`_containerLoaderStyle`,2),J([r({attribute:!1})],X.prototype,`_loaderMsg`,2),J([r({attribute:!1})],X.prototype,`containerWidth`,2),J([r({attribute:!1})],X.prototype,`dimensions`,2),J([r({attribute:!1})],X.prototype,`currentScreenMode`,2),J([r({attribute:!1})],X.prototype,`_itemEmbedding`,2),J([r({attribute:!1})],X.prototype,`browserError`,2),J([r({attribute:!1})],X.prototype,`browserErrorMsg`,2),J([r({attribute:!1})],X.prototype,`dashboardError`,2),J([r({attribute:!1})],X.prototype,`browserNotSupported`,2),J([r()],X.prototype,`libVersion`,2),J([a()],X.prototype,`isLibraryLoaded`,2),J([a()],X.prototype,`dashboardReference`,2),J([a()],X.prototype,`currentAuthKey`,2),J([a()],X.prototype,`currentAuthToken`,2),J([a()],X.prototype,`isInitCalled`,2);var Wi=class extends X{};customElements.get(`luzmo-embed-dashboard`)||customElements.define(`luzmo-embed-dashboard`,Wi);var Gi=Pi,Ki=`VizItemApp`;function qi(e){let t=new Set;for(let n of e??[])for(let e of n?.content??[]){let n=e,r=n.datasetId??n.set;r&&t.add(r)}return[...t]}var Z=class extends e{constructor(){super(...arguments),this.appServer=`https://app.luzmo.com`,this.apiHost=`https://api.luzmo.com`,this.slots=[],this.version=Y+`-wc-luzmo`,this.dashboardContentsVersion=Gi,this.libVersion=Y+`-wc-luzmo`,this.postInitCallQueue=[]}static{this.styles=t`
|
|
205
|
+
:host {
|
|
206
|
+
display: block;
|
|
207
|
+
width: 100%;
|
|
208
|
+
height: 100%;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
luzmo-embed-viz-item {
|
|
212
|
+
width: 100%;
|
|
213
|
+
height: 1000%;
|
|
214
|
+
display: block;
|
|
215
|
+
}
|
|
216
|
+
`}createRenderRoot(){return this.style.display||(this.style.display=`block`),this.style.height||(this.style.height=`100%`),this.style.width||(this.style.width=`100%`),this}canInitializeVizItem(){return!!(this.type||this.dashboardId&&this.itemId)}getFilters(){return this.chartElement.getFilters()}getVizItemContext(){let e=this.slots??[];return{id:this.contextId??this.getAttribute(`context-id`)??this.id??this.itemId??``,type:this.type,slots:e,options:this.options,filters:typeof this.chartElement?.getContextFilters==`function`?this.chartElement.getContextFilters():typeof this.chartElement?.getFilters==`function`?this.getFilters():[],datasetIds:qi(e)}}export(e=`png`){return this.chartElement.export(e)}getData(){return this.chartElement.getData()}getInsights(e){return this.chartElement.getInsights(e)}refreshData(){return this.chartElement.refreshData()}setSelectedData(e){return this.chartElement.setSelectedData(void 0,e)}setAuthorization(e,t){return this.chartElement.setAuthorization(e,t)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`selecteddata`&&(this.chartElement?this.setSelectedData(JSON.parse(n??`{}`)):this.postInitCallQueue.push([this.setSelectedData,[JSON.parse(n??`{}`)]]))}async firstUpdated(e){super.firstUpdated(e),this.canInitializeVizItem()&&(await q(this.appServer,Ki),this.createAndAppendElement())}createAndAppendElement(){this.chartElement||(this.chartElement=document.createElement(`chart-component`),this.chartElement.setAttribute(`embedding-mode`,`chart`),this.chartElement.style.height=`100%`,this.chartElement.style.width=`100%`,this.chartElement.style.display=`block`,this.chartElement.addEventListener(`load`,e=>this.dispatchEvent(new CustomEvent(`load`,e))),this.chartElement.addEventListener(`rendered`,e=>{if(this.postInitCallQueue?.length>0)for(let e of this.postInitCallQueue)e[0].bind(this)(...e[1]);else this.selectedData&&this.setSelectedData(this.selectedData);this.dispatchEvent(new CustomEvent(`rendered`,e))}),this.chartElement.addEventListener(`changedFilters`,e=>{this.dispatchEvent(new CustomEvent(`changedFilters`,e)),this.dispatchEvent(new CustomEvent(`contextChanged`,{detail:{data:{type:`contextChanged`,context:this.getVizItemContext()}}}))}),this.chartElement.addEventListener(`exported`,e=>this.dispatchEvent(new CustomEvent(`exported`,e))),this.chartElement.addEventListener(`customEvent`,e=>this.dispatchEvent(new CustomEvent(`customEvent`,e))),this.chartElement.addEventListener(`error`,e=>{this.dispatchEvent(new CustomEvent(`error`,{detail:zi(e.detail)}))}),this.chartElement.addEventListener(`authorizationExpired`,e=>this.dispatchEvent(new CustomEvent(`authorizationExpired`,e))),this.updateVizItemProperties(),this.renderRoot.append(this.chartElement))}updateVizItemProperties(){if(this.chartElement)for(let e in Ee){let t=this[e];if(t){let n=[`appServer`,`apiHost`].includes(e)?p(t):t;this.chartElement.setAttribute(Ee[e],typeof n==`object`?JSON.stringify(n):n)}}}async updated(e){if(this.chartElement)for(let[t]of e.entries()){let e=Ee[t]??t,n=typeof this[t]==`object`?JSON.stringify(this[t]):this[t]?.toString()??this[t];this.chartElement.setAttribute(e,n)}else this.canInitializeVizItem()&&(await q(this.appServer,Ki),this.createAndAppendElement())}render(){return n` `}};J([r()],Z.prototype,`appServer`,2),J([r()],Z.prototype,`apiHost`,2),J([r({type:Array})],Z.prototype,`slots`,2),J([r({type:Object})],Z.prototype,`options`,2),J([r()],Z.prototype,`type`,2),J([r()],Z.prototype,`authKey`,2),J([r()],Z.prototype,`authToken`,2),J([r()],Z.prototype,`version`,2),J([r()],Z.prototype,`contextId`,2),J([r({converter:e=>{try{return JSON.parse(e)}catch{return e}}})],Z.prototype,`canFilter`,2),J([r({type:Array})],Z.prototype,`filters`,2),J([r()],Z.prototype,`dashboardId`,2),J([r()],Z.prototype,`itemId`,2),J([r({attribute:`ai-message-asset-id`})],Z.prototype,`aiMessageAssetId`,2),J([r({type:Object})],Z.prototype,`selectedData`,2),J([r()],Z.prototype,`dashboardContentsVersion`,2),J([r()],Z.prototype,`libVersion`,2);var Ji=class extends Z{};customElements.get(`luzmo-embed-viz-item`)||customElements.define(`luzmo-embed-viz-item`,Ji);var Yi={aiEndpoint:`ai-endpoint`,appServer:`app-server`,apiHost:`api-host`,options:`options`,initialSuggestionsDatasetId:`initialSuggestionsDatasetId`,authKey:`auth-key`,authToken:`auth-token`,version:`version`,libVersion:`lib-version`,aydHost:`ayd-host`,availableDatasets:`available-datasets`,dashboardContext:`dashboard-context`,dashboardId:`dashboard-id`,contextIds:`context-ids`,agentId:`agent-id`},Xi=`luzmo-iq-embed-chat`,Zi=`luzmo-iq-chat-component`,Q=class extends e{constructor(){super(...arguments),this.appServer=`https://app.luzmo.com`,this.apiHost=`https://api.luzmo.com`,this.version=Y+`-wc-luzmo`,this.libVersion=Y+`-wc-luzmo`,this.remoteEntryServer=`http://localhost:4202/`,this.aydHost=`https://ayd.luzmo.com/`}static{this.styles=t`
|
|
217
|
+
:host {
|
|
218
|
+
display: block;
|
|
219
|
+
width: 100%;
|
|
220
|
+
height: 100%;
|
|
221
|
+
}
|
|
222
|
+
`}createRenderRoot(){return this}async firstUpdated(e){super.firstUpdated(e),await q(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}get calculatedAppServer(){return this.appServer.startsWith(`http://localhost`)?this.remoteEntryServer:this.appServer}createAndAppendElement(){this.chartElement||(this.chartElement=document.createElement(Zi),this.chartElement.addEventListener(`load`,e=>this.dispatchEvent(new CustomEvent(`load`,e))),this.chartElement.addEventListener(`connectionStatusChanged`,e=>this.dispatchEvent(new CustomEvent(`connectionStatusChanged`,{detail:e.detail}))),this.updateVizItemProperties(),this.renderRoot.append(this.chartElement))}updateVizItemProperties(){if(this.chartElement)for(let e in Yi){let t=this[e];if(t){let n=[`appServer`,`apiHost`,`aydHost`].includes(e)?p(t):t;this.chartElement.setAttribute(Yi[e],typeof n==`object`?JSON.stringify(n):n)}}}async updated(e){if(this.chartElement)for(let[t]of e.entries()){let e=Yi[t]??t,n=this[t];if(n==null){this.chartElement.removeAttribute(e);continue}let r=typeof n==`object`?JSON.stringify(n):n.toString();this.chartElement.setAttribute(e,r)}else await q(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}render(){return n``}connectedCallback(){super.connectedCallback();let e=document.querySelector(Xi);if(!e)return;let t=new MutationObserver(()=>{let n=e.querySelector(`*[slot="custom-chat-widget-content"]`);if(!n)return;let r=e.querySelector(Zi);r&&(r.append(n),t.disconnect())});t.observe(e,{childList:!0,subtree:!0})}};J([r()],Q.prototype,`appServer`,2),J([r()],Q.prototype,`apiHost`,2),J([r({type:Object})],Q.prototype,`options`,2),J([r({type:String})],Q.prototype,`initialSuggestionsDatasetId`,2),J([r()],Q.prototype,`aiEndpoint`,2),J([r()],Q.prototype,`authKey`,2),J([r()],Q.prototype,`authToken`,2),J([r()],Q.prototype,`version`,2),J([r()],Q.prototype,`libVersion`,2),J([r()],Q.prototype,`remoteEntryServer`,2),J([r()],Q.prototype,`aydHost`,2),J([r({type:Array})],Q.prototype,`availableDatasets`,2),J([r({type:Object})],Q.prototype,`dashboardContext`,2),J([r()],Q.prototype,`dashboardId`,2),J([r({type:Array})],Q.prototype,`contextIds`,2),J([r()],Q.prototype,`agentId`,2),customElements.get(Xi)||customElements.define(Xi,Q);var Qi={aiEndPoint:`ai-end-point`,appServer:`app-server`,apiHost:`api-host`,options:`options`,authKey:`auth-key`,authToken:`auth-token`,version:`version`,libVersion:`lib-version`,messages:`messages`},$i=`luzmo-iq-embed-answer`,$=class extends e{constructor(){super(...arguments),this.appServer=`https://app.luzmo.com`,this.apiHost=`https://api.luzmo.com`,this.version=Y+`-wc-luzmo`,this.libVersion=Y+`-wc-luzmo`,this.remoteEntryServer=`http://localhost:4202`}static{this.styles=t`
|
|
223
|
+
:host {
|
|
224
|
+
display: block;
|
|
225
|
+
width: 100%;
|
|
226
|
+
height: 100%;
|
|
227
|
+
}
|
|
228
|
+
`}createRenderRoot(){return this}async firstUpdated(e){super.firstUpdated(e),await q(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}get calculatedAppServer(){return this.appServer.startsWith(`http://localhost`)?this.remoteEntryServer:this.appServer}createAndAppendElement(){this.chartElement||(this.chartElement=document.createElement(`luzmo-iq-answer-component`),this.chartElement.addEventListener(`addQuestion`,e=>this.dispatchEvent(new CustomEvent(`addQuestion`,e))),this.chartElement.addEventListener(`addAnswer`,e=>this.dispatchEvent(new CustomEvent(`addAnswer`,e))),this.updateVizItemProperties(),this.renderRoot.append(this.chartElement))}updateVizItemProperties(){if(this.chartElement)for(let e in Qi){let t=this[e];if(t){let n=[`appServer`,`apiHost`].includes(e)?p(t):t;this.chartElement.setAttribute(Qi[e],typeof n==`object`?JSON.stringify(n):n)}}}async updated(e){if(this.chartElement)for(let[t]of e.entries()){let e=Qi[t]??t,n=typeof this[t]==`object`?JSON.stringify(this[t]):this[t]?.toString()??this[t];this.chartElement.setAttribute(e,n)}else await q(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}render(){return n` `}};J([r()],$.prototype,`appServer`,2),J([r()],$.prototype,`apiHost`,2),J([r({type:Object})],$.prototype,`options`,2),J([r()],$.prototype,`aiEndPoint`,2),J([r()],$.prototype,`authKey`,2),J([r()],$.prototype,`authToken`,2),J([r()],$.prototype,`messages`,2),J([r()],$.prototype,`version`,2),J([r()],$.prototype,`libVersion`,2),J([r()],$.prototype,`remoteEntryServer`,2),customElements.get($i)||customElements.define($i,$),e.disableWarning?.(`change-in-update`);
|