iobroker.javascript 9.0.13 → 9.0.18

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.
Files changed (39) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +6 -6
  3. package/admin/assets/{OpenAiDialog-BmcYPsVa.js → OpenAiDialog-BVH3CrDi.js} +1 -1
  4. package/admin/assets/{Save-DXaUpIPM.js → Save-C-o2LLTD.js} +1 -1
  5. package/admin/assets/{ScriptEditor-BoSBgnK-.js → ScriptEditor-CAoVSrVf.js} +1 -1
  6. package/admin/assets/{ScriptEditorVanillaMonaco-Xge2wqgO.js → ScriptEditorVanillaMonaco-Cf9lA3Q5.js} +1 -1
  7. package/admin/assets/{createSvgIcon-DlIk-fDn.js → createSvgIcon-XLoRKyxt.js} +5 -5
  8. package/admin/assets/hostInit-OBG53iVO.js +1 -1
  9. package/admin/assets/{index-Br_QjNUk.js → index-BDco9K7T.js} +36 -36
  10. package/admin/assets/{index-OIiv3PJA.js → index-C96hfBFW.js} +1 -1
  11. package/admin/assets/index-CFhFEZTW.js +5 -0
  12. package/admin/assets/{index-BWM5lJbO.js → index-Cm-iTDHo.js} +1 -1
  13. package/admin/assets/{index-CePzv5-W.js → index-DCTpQXgR.js} +69 -69
  14. package/admin/assets/{index-DwcZPzOL.js → index-DKvqhUY5.js} +1 -1
  15. package/admin/assets/{index-BMwfsknM.js → index-DcrzW8Zn.js} +1 -1
  16. package/admin/assets/{inheritsLoose-DNrhibGS.js → inheritsLoose-tR_kcxUR.js} +4 -4
  17. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__-6sH5wUl6.js +1 -0
  18. package/admin/assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CMP-NJnH.js +8 -0
  19. package/admin/assets/useTheme-C2oUi01-.js +1 -0
  20. package/admin/custom/assets/index-Bym4WjyH.js +908 -0
  21. package/admin/custom/customComponents.js +2 -2
  22. package/admin/mf-manifest.json +1 -1
  23. package/admin/remoteEntry.js +2 -2
  24. package/admin/tab.html +6 -6
  25. package/build/lib/debugger.js +9 -15
  26. package/build/lib/debugger.js.map +1 -1
  27. package/build/lib/mirror.js +21 -18
  28. package/build/lib/mirror.js.map +1 -1
  29. package/build/lib/utils.js.map +1 -1
  30. package/build/main.js +1 -1
  31. package/build/main.js.map +1 -1
  32. package/build/types.d.ts +1 -1
  33. package/io-package.json +66 -66
  34. package/package.json +4 -3
  35. package/admin/assets/index-Cjl4b70e.js +0 -5
  36. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js +0 -1
  37. package/admin/assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-DZdFIfoQ.js +0 -5
  38. package/admin/assets/useTheme-DakN8Abq.js +0 -1
  39. package/admin/custom/assets/index-BHN4DzE4.js +0 -908
@@ -1,4 +1,4 @@
1
- import{g as Na}from"./_commonjsHelpers-Cpj98o6Y.js";import{i as Pa}from"./iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js";function za(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const u=Object.getOwnPropertyDescriptor(r,l);u&&Object.defineProperty(e,l,u.get?u:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Co={exports:{}},ve={},xo={exports:{}},_o={};/**
1
+ import{g as Na}from"./_commonjsHelpers-Cpj98o6Y.js";import{i as Pa}from"./iobroker_javascript__loadShare__react__loadShare__-6sH5wUl6.js";function za(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const u=Object.getOwnPropertyDescriptor(r,l);u&&Object.defineProperty(e,l,u.get?u:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Co={exports:{}},ve={},xo={exports:{}},_o={};/**
2
2
  * @license React
3
3
  * scheduler.production.min.js
4
4
  *
@@ -1 +1 @@
1
- import{j as t}from"./createSvgIcon-DlIk-fDn.js";import{i as u}from"./iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js";import{u as pe,a as xe,i as x,M as X,C as te,G as be,b as Ce,c as he,I as we,S as J,d as ve,e as le,j as je,D as Ie,f as Oe}from"./index-CePzv5-W.js";import{i as N,C as Se}from"./index-Cjl4b70e.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./iobroker_javascript__mf_v__runtimeInit__mf_v__-DZdFIfoQ.js";import"./inheritsLoose-DNrhibGS.js";import"./preload-helper-BDBacUwf.js";function Ae(n){const s=pe().getMonitor(),[i,r]=xe(s,n);return u.useEffect(()=>s.subscribeToOffsetChange(r)),u.useEffect(()=>s.subscribeToStateChange(r)),i}let V;function ye(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const De="_wrapperRules_nnott_1",ke="_rootWrapper_nnott_9",Ne="_addClass_nnott_14",ne={wrapperRules:De,rootWrapper:ke,addClass:Ne},$e="_switchesItem_10ls3_1",Be="_switchesItemActive_10ls3_28",Ee="_iconTheme_10ls3_36",se={switchesItem:$e,switchesItemActive:Be,iconTheme:Ee},ue=({name:n,id:e,active:s,icon:i,adapter:r,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:I})=>t.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?x.I18n.t(l):void 0,className:x.Utils.clsx(se.switchesItem,s&&se.switchesItemActive,`block-${e}`),children:[t.jsx(X,{iconName:i,className:se.iconTheme,adapter:r,socket:o,style:I}),t.jsx("span",{children:n?x.I18n.t(n):""})]},e),Me="_cardStyle_8rq8v_1",qe="_cardStyleActive_8rq8v_17",He="_controlMenu_8rq8v_22",Te="_closeBtn_8rq8v_31",We="_isDelete_8rq8v_73",Pe="_drag_mobile_8rq8v_90",G={cardStyle:Me,cardStyleActive:qe,controlMenu:He,closeBtn:Te,isDelete:We,drag_mobile:Pe};function K(n,e,s){let i;switch(n){case"actions":if(s==="else")return i={...e,actions:{...e[n],else:[...e[n].else]}},i;if(s==="then")return i={...e,actions:{...e[n],then:[...e[n].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...e,triggers:[...e.triggers]},i;case"conditions":return i={...e,conditions:[...e.conditions]},i;default:throw new Error(`Unknown name: ${n}`)}}function z(n,e,s,i){var r;switch(n){case"actions":return e.actions[s]=e.actions[s].filter(o=>o._id!==i),e;case"conditions":return e.conditions[s]=(r=e.conditions[s])==null?void 0:r.filter(o=>o._id!==i),e;case"triggers":default:return e.triggers=e.triggers.filter(o=>o._id!==i),e}}function Fe(n,e,s){const{_id:i,acceptedBy:r}=n;let o;if(!r||!e[r])return console.warn(`Cannot find ${r}`),e;switch(r){case"actions":if(o=e.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.actions[s].indexOf(o);e.actions[s][c]=n}return e;case"conditions":if(o=e.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.conditions[s].indexOf(o);e.conditions[s][c]=n}return e;default:if(o=e.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.triggers.indexOf(o);e.triggers[c]=n}return e}}const me=u.memo(n=>{var B;const{setUserRules:e,userRules:s,_id:i,id:r,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:I,tourStep:S}=n,[O,_]=u.useState(null),{blocks:a,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:b}=u.useContext(te),p=u.useCallback(m=>a==null?void 0:a.find(C=>C.getStaticData().id===m),[a]),h=u.useCallback(m=>{const C=Fe(m,s,o);C&&e(C)},[s]),v=m=>{m.currentTarget!==O&&_(m.currentTarget)},M=()=>_(null),W=u.useMemo(()=>{const m=p(r)||be;return t.jsx(m,{...n,notFound:!p(r),isTourOpen:d,setTourStep:I,tourStep:S,onUpdate:H,setOnUpdate:w,enableSimulation:b,onDebugMessage:f,onChange:h,className:void 0,socket:k})},[s,H,f,b]),[$,q]=u.useState(!1);return t.jsxs("div",{onMouseMove:v,onMouseEnter:v,onMouseLeave:M,onMouseDown:m=>{if(m.ctrlKey){let C;const j=K(l,s,o);l==="conditions"?(C=j.conditions[o].find(g=>g._id===i),C&&j.conditions[o].splice(j.conditions[o].indexOf(C),0,{...C,_id:Date.now()})):l==="actions"?(C=j.actions[o].find(g=>g._id===i),C&&j.actions[o].splice(j.actions[o].indexOf(C),0,{...C,_id:Date.now()})):(C=j.triggers.find(g=>g._id===i),C&&j.triggers.splice(j[l].indexOf(C),0,{...C,_id:Date.now()})),e(j)}},id:"height",style:c?{width:(((B=document.getElementById("width"))==null?void 0:B.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${$?G.isDelete:null}`,children:[t.jsx("div",{className:G.drag_mobile}),W,e&&t.jsx("div",{className:G.controlMenu,style:O?{opacity:1}:{opacity:0},children:t.jsx("div",{onClick:()=>{let m=K(l,s,o);m=z(l,m,o,i),q(!0),setTimeout(()=>{l==="triggers"&&w(!0),e(m)},300)},className:G.closeBtn})})]})}),Ue={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Je=(n,e,s)=>{if(!n||!e)return{display:"none"};let{x:i,y:r}=e;const o=`translate(${i}px, ${r}px)`;return{transform:o,WebkitTransform:o}},Le=n=>{const{itemType:e,isDragging:s,item:i,initialOffset:r,currentOffset:o,targetIds:c}=Ae(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>{switch(e){case"box":return c.length?t.jsx(me,{active:!0,...i,allBlocks:n.allBlocks}):t.jsx(ue,{active:!0,...i,socket:n.socket});default:return null}};return s?t.jsx("div",{style:Ue,children:t.jsx("div",{style:Je(r,o),children:l()})}):null},ze="_border_wrpm3_1",Ge="_emptyBlockStyle_wrpm3_6",Ke="_emptyBlock_wrpm3_6",Qe="_selectOnChange_wrpm3_22",Xe="_selectOnChangeHelp_wrpm3_28",Ye="_selectOnChangeHelpIcon_wrpm3_34",Ze="_emptyBlockNone_wrpm3_49",Ve="_mainBlockItemRules_wrpm3_55",Re="_nameBlockItems_wrpm3_63",et="_contentBlockItem_wrpm3_73",tt="_wrapperMargin_wrpm3_81",nt="_contentHeightOn_wrpm3_87",st="_contentHeightOff_wrpm3_99",ot="_cardAdd_wrpm3_105",it="_blockCardAdd_wrpm3_125",ct="_addClassOverflow_wrpm3_136",at="_addClassHeight_wrpm3_140",D={border:ze,emptyBlockStyle:Ge,emptyBlock:Ke,selectOnChange:Qe,selectOnChangeHelp:Xe,selectOnChangeHelpIcon:Ye,emptyBlockNone:Ze,mainBlockItemRules:Ve,nameBlockItems:Re,contentBlockItem:et,wrapperMargin:tt,contentHeightOn:nt,contentHeightOff:st,cardAdd:ot,blockCardAdd:it,addClassOverflow:ct,addClassHeight:at};function re(n,e){const[s,i]=u.useState(window.localStorage.getItem(e)?JSON.parse(window.localStorage.getItem(e)||""):n);return[s,o=>{window.localStorage.setItem(e,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(e)]}function rt(n,e){let s=0,i=null,r;return function(...o){const c=Date.now();r=o,c-s>=e?(s=c,n.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,n.apply(this,r)},e-(c-s)))}}function ee(n){if(Array.isArray(n))return n.map(e=>ee(e));if(typeof n=="function")return n.bind(null);if(n&&typeof n=="object"){const e={};return Object.keys(n).forEach(s=>{e[s]=ee(n[s])}),e}return n}const oe=rt((n,e)=>n(e),0);function R(n,e){const s=e.find(i=>i._id===n);return{card:s,index:s?e.indexOf(s):-1}}function ie(n,e,s,i,r,o,c,l,d){const{card:I,index:S}=R(n,s);if(!(S<e&&l<d)&&!(S>e&&l>d)&&I&&S!==e){const O=ee(s);O.splice(S,1),O.splice(e,0,I);const _=ee(r);switch(o){case"actions":_.actions[c]=O,oe(i,_);return;case"conditions":_.conditions[c]=O,oe(i,_);return;default:_.triggers=O,oe(i,_);return}}}const lt="_drag_7xfhc_1",dt="_root_7xfhc_11",de={drag:lt,root:dt},_e=({typeBlock:n,allProperties:e,id:s,isActive:i,setUserRules:r,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:I}=u.useContext(te),[{opacity:S},O,_]=Ce({type:"box",item:()=>({...e,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:b}=w,p=f.getDropResult();let h;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(h=K(b,o,d),h=z(b,h,d,l),r(h)),null;if(p.blockValue!==d){const v=typeof l=="number"?l:Date.now();h=K(b,o,p.blockValue);const M={id:w.id,acceptedBy:w.acceptedBy};switch(b){case"actions":return d&&(h=z("actions",h,d,v)),h=z("actions",h,p.blockValue,v),h.actions[p.blockValue].push({...M,_id:v}),r(h);case"conditions":return typeof d=="number"&&(h=z("conditions",h,d,v)),h=z("conditions",h,p.blockValue,v),h.conditions[p.blockValue].push({...M,_id:v}),r(h);default:return I(!0),h=z("triggers",h,p.blockValue,v),h.triggers.push({...M,_id:v}),r(h)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),a=u.useRef(null),[,k]=he({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},b){var W;if(!a.current||n!==f)return;const p=(W=a.current)==null?void 0:W.getBoundingClientRect(),h=(p.bottom-p.top)/2,v=b.getClientOffset(),M=((v==null?void 0:v.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:$}=R(l,o.actions[d]);$!==w&&ie(w,$,o[f][d],r,o,f,d,M,h)}return;case"conditions":if(typeof d=="number"){const{index:$}=R(l,o[f][d]);$!==w&&ie(w,$,o[f][d],r,o,f,d,M,h)}return;default:{const{index:$}=R(l,o[f]);$!==w&&ie(w,$,o[f],r,o,f,void 0,M,h);return}}}});u.useEffect(()=>{_(ye(),{captureDraggingState:!0})},[]),O(k(a));const H=window.innerWidth<600;return t.jsxs("div",{ref:H&&l?null:a,className:de.root,style:{opacity:S},children:[t.jsx("div",{className:l?de.drag:null,ref:l&&H?a:null}),c]})},ft=({onClose:n,open:e})=>t.jsxs(N.Dialog,{open:e,onClose:n,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[t.jsx(N.DialogContent,{children:t.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[t.jsx("h3",{children:x.I18n.t("On condition change")}),t.jsx("div",{children:x.I18n.t("help_on_change")}),t.jsx("h3",{children:x.I18n.t("Just check")}),t.jsx("div",{children:x.I18n.t("help_just_check")})]})}),t.jsx(N.DialogActions,{children:t.jsx(N.Button,{onClick:n,color:"primary",autoFocus:!0,startIcon:t.jsx(Se,{}),children:x.I18n.t("OK")})})]}),gt=({onClose:n,open:e})=>t.jsxs(N.Dialog,{open:e,onClose:n,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[t.jsx(N.DialogContent,{children:t.jsxs(N.DialogContentText,{id:"alert-dialog-description",children:[t.jsx("h3",{children:x.I18n.t("On condition change")}),t.jsx("div",{children:x.I18n.t("help_on_change")}),t.jsx("h3",{children:x.I18n.t("Just check")}),t.jsx("div",{children:x.I18n.t("help_just_check")})]})}),t.jsx(N.DialogActions,{children:t.jsx(N.Button,{onClick:n,color:"primary",autoFocus:!0,children:x.I18n.t("OK")})})]}),fe=({size:n,blockValue:e,boolean:s,typeBlock:i,userRules:r,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:I,theme:S,themeType:O,themeName:_})=>{var T;const[a,k]=u.useState(!1),[H,w]=u.useState(!1),[f,b]=u.useState(!1),[p,h]=u.useState("");s===void 0&&(s=!0);const v=he({accept:"box",drop:()=>({blockValue:e}),hover:({acceptedBy:A,_id:L},Y)=>{k(A===i),b(!!L),h(Y.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),M=v[0],{canDrop:W,isOver:$,offset:q,targetId:B}=M,m=v[1];u.useEffect(()=>{h("")},[q]);const C=W&&$;let j="";C?j=a?"#00fb003d":"#fb00002e":W?j=H?"#00fb003d":"#fb00002e":q&&(j=B===p?"#fb00002e":"");let g;return i==="actions"?g=r.actions[e]:i==="conditions"?g=r.conditions[e]:g=r.triggers,t.jsx("div",{ref:m,style:{backgroundColor:j},className:`${x.Utils.clsx(D.contentBlockItem,n&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:t.jsxs("div",{className:D.wrapperMargin,children:[g.map(A=>t.jsx(_e,{typeBlock:i,...A,blockValue:e,allProperties:A,userRules:r,setUserRules:o,children:t.jsx(me,{...A,isTourOpen:I,setTourStep:l,tourStep:d,settings:A,blockValue:e,userRules:r,setUserRules:o,theme:S,themeType:O,themeName:_})},A._id)),t.jsx("div",{style:C&&a&&!f?{height:((T=document.getElementById("height"))==null?void 0:T.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${C&&a&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},ce=({size:n,typeBlock:e,name:s,nameAdditionally:i,additionally:r,border:o,userRules:c,setUserRules:l,iconName:d,adapter:I,socket:S,setTourStep:O,tourStep:_,isTourOpen:a,theme:k,themeType:H,themeName:w})=>{const[f,b,p]=re(e==="actions"?!1:[],`additionallyClickItems_${e}`),[h,v]=u.useState(!1),[M,W]=u.useState(!1);u.useEffect(()=>{if(e==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const B=[];c.conditions.forEach((m,C)=>{C>0&&B.push({_id:Date.now(),open:!0})}),b([...f,...B])}e==="actions"&&!p&&c.actions.else.length&&b(!0)},[]);const[$,q]=u.useState(!1);return t.jsxs("div",{className:`${x.Utils.clsx(D.mainBlockItemRules,n&&D.addClassOverflow)} ${o&&!n?D.border:null}`,children:[t.jsxs("span",{id:"width",className:D.nameBlockItems,children:[t.jsx(X,{iconName:d,className:D.iconThemCard,adapter:I,socket:S}),s]}),e==="conditions"?t.jsxs("div",{style:{width:"100%"},children:[t.jsxs(N.Select,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:B=>{const m=K("conditions",c);m.justCheck=B.target.value==="true",l(m)},children:[t.jsx(N.MenuItem,{value:"false",children:x.I18n.t("on condition change")}),t.jsx(N.MenuItem,{value:"true",children:x.I18n.t("just check")})]}),t.jsx(N.IconButton,{size:"small",title:x.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>v(!0),children:t.jsx(we,{className:D.selectOnChangeHelpIcon})})]}):null,t.jsx(fe,{setTourStep:O,tourStep:_,isTourOpen:a,blockValue:e==="actions"?"then":e==="conditions"?0:e,typeBlock:e,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:n}),r&&[...Array(e==="actions"?1:c.conditions.length-1)].map((B,m)=>{const C=(j=m)=>e==="actions"?!!f:!!f.find((g,T)=>T===j&&g.open);return t.jsxs(u.Fragment,{children:[t.jsxs("div",{onClick:()=>{if(e==="actions")return b(!f),null;let j=JSON.parse(JSON.stringify(f));if(c.conditions[m+1].length)return j[m].open=!j[m].open,b(j),null;j=j.filter((g,T)=>T!==m),b(j),q(m),setTimeout(()=>{q(!1),l({...c,conditions:[...c.conditions.filter((g,T)=>T!==m+1)]})},250)},className:D.blockCardAdd,children:[C()?"-":"+",t.jsx("div",{className:D.cardAdd,children:i})]},m),t.jsx(fe,{blockValue:e==="actions"?"else":e==="conditions"?m+1:e,typeBlock:e,setUserRules:l,userRules:c,boolean:C(),animation:$===m,size:n,theme:k,themeName:w,themeType:H})]},`${m}_block_${e}`)}),r&&e==="conditions"&&t.jsxs("div",{onClick:()=>{b([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),q(c.conditions.length-1),setTimeout(()=>q(!1),1e3)},className:D.blockCardAdd,children:["+",t.jsx("div",{className:D.cardAdd,children:i})]}),t.jsx(ft,{open:h,onClose:()=>v(!1)}),t.jsx(gt,{open:M,onClose:()=>W(!1)})]})},ht="_menuRules_1qqcb_1",ut="_switchesRenderWrapper_1qqcb_13",mt="_menuOff_1qqcb_22",_t="_menuTitle_1qqcb_28",pt="_marginAuto_1qqcb_42",xt="_inputWidth_1qqcb_47",bt="_menuWrapper_1qqcb_52",Ct="_hamburgerWrapper_1qqcb_57",wt="_hamburgerOff_1qqcb_74",vt="_nothingFound_1qqcb_82",jt="_resetSearch_1qqcb_89",It="_controlPanel_1qqcb_101",Ot="_controlPanelAppBar_1qqcb_112",St="_addClassMenu_1qqcb_126",At="_addClassBackground_1qqcb_132",yt="_addClassPosition_1qqcb_136",E={menuRules:ht,switchesRenderWrapper:ut,menuOff:mt,menuTitle:_t,marginAuto:pt,inputWidth:xt,menuWrapper:bt,hamburgerWrapper:Ct,hamburgerOff:wt,nothingFound:vt,resetSearch:jt,controlPanel:It,controlPanelAppBar:Ot,addClassMenu:St,addClassBackground:At,addClassPosition:yt},Dt=n=>{const{allProperties:e,allProperties:{acceptedBy:s,id:i},setUserRules:r,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:I,isActive:S}=n;return t.jsx(_e,{allProperties:e,id:e.id,isActive:S,setUserRules:r,userRules:o,children:t.jsx(ue,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const O=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const a=K(s,o,_),k={id:i,_id:O,acceptedBy:s};_!==void 0?s==="actions"?a.actions[_].push({...k}):s==="conditions"&&a.conditions[_].push({...k}):a.triggers.push({...k}),r(a)},...n,...e,onTouchMove:I})})},kt="_hamburgerMenu_hqnsm_8",Nt="_animate_hqnsm_21",ge={hamburgerMenu:kt,animate:Nt};function $t({bool:n}){return t.jsx("div",{className:`${ge.hamburgerMenu} ${n?ge.animate:""}`})}const Bt=({addClass:n,setAllBlocks:e,allBlocks:s,userRules:i,onChangeBlocks:r,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:I}=u.useContext(te),[S,O]=re(!1,"hamburgerOnOff"),[_,a]=re({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,b=_.type)=>{if(!d)return;let p=[...d];p=p.filter(h=>{if(!f)return!0;const{name:v}=h.getStaticData();return v&&x.I18n.t(v).toLowerCase().includes(f.toLowerCase())}),p=p.filter(h=>b===h.getStaticData().acceptedBy),e(p)},H=(f,b)=>{l&&b===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&b===2&&c===J.selectActions&&o(J.addActionPrintText),a({..._,index:b,type:["triggers","conditions","actions"][b]}),k(_.text,["triggers","conditions","actions"][b])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return u.useEffect(()=>{k()},[d]),t.jsx(N.ClickAwayListener,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>O(!0),children:t.jsxs("div",{className:x.Utils.clsx(E.menuWrapper,n[1035]&&E.addClassMenu),children:[t.jsx("div",{className:`${E.hamburgerWrapper} ${S?E.hamburgerOff:null}`,onClick:()=>O(!S),children:t.jsx($t,{bool:!S})}),t.jsxs("div",{className:`${x.Utils.clsx(E.menuRules,n[1035]&&E.addClassBackground,n[835]&&E.addClassPosition)} ${S?E.menuOff:null}`,children:[t.jsx("div",{className:E.controlPanel,children:t.jsx(N.AppBar,{className:E.controlPanelAppBar,position:"static",children:t.jsxs(N.Tabs,{value:_.index,onChange:H,children:[t.jsx(N.Tab,{className:"blocks-triggers",title:x.I18n.t("Triggers"),icon:t.jsx(X,{iconName:"FlashOn"}),...w(0)}),t.jsx(N.Tab,{title:x.I18n.t("Conditions"),className:"blocks-conditions",icon:t.jsx(X,{iconName:"Help"}),...w(1)}),t.jsx(N.Tab,{title:x.I18n.t("Actions"),className:"blocks-actions",icon:t.jsx(X,{iconName:"PlayForWork"}),...w(2)})]})})}),t.jsx("div",{className:E.switchesRenderWrapper,children:t.jsxs("span",{children:[s.map(f=>{const{name:b,id:p,icon:h,adapter:v}=f.getStaticData();return t.jsx(u.Fragment,{children:t.jsx(Dt,{adapter:v,allProperties:f.getStaticData(),icon:h,id:p,isActive:!1,isTourOpen:l,name:b,onTouchMove:()=>O(!0),setTourStep:o,setUserRules:r,socket:I,tourStep:c,userRules:i})},p)}),!s.length&&t.jsxs("div",{className:E.nothingFound,children:[x.I18n.t("Nothing found"),"...",t.jsx("div",{className:E.resetSearch,onClick:()=>{a({..._,text:""}),k("")},children:x.I18n.t("reset search")})]})]})}),t.jsx("div",{className:x.Utils.clsx(E.menuTitle,E.marginAuto)}),t.jsx(ve,{className:E.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:x.I18n.t("search"),variant:"outlined",onChange:f=>{a({..._,text:f}),k(f)}})]})]})})};let ae=[];const Ut=({code:n,onChange:e,themeName:s,themeType:i,theme:r,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:I,changed:S,running:O})=>{var j;const{blocks:_,socket:a,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=u.useContext(te),[f,b]=u.useState([]),[p,h]=u.useState(le(n)),[v,M]=u.useState(""),[W,$]=u.useState(!1);u.useEffect(()=>{let g,T;const A=(F,y)=>{F===`${g}.alive`&&T!==(y==null?void 0:y.val)&&(T=!!(y!=null&&y.val),T&&g&&(a==null||a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOn",I)))},L=(F,y)=>{var U,Q;a&&g!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(g&&(a.unsubscribeState(`${g}.alive`,A),T&&a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOn",I)),g=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,g&&g&&a.subscribeState(`${g}.alive`,A))},Y=(F,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===I&&Q-U.ts<1e3){const P=[...ae,{blockId:U.blockId,data:U.data,ts:U.ts}];P.length>200&&P.splice(0,200-P.length);for(let Z=P.length-1;Z>=0;Z--)if(P[Z].ts<Q-5e3){P.splice(0,Z);break}console.log(`Debug1: ${JSON.stringify(ae)}`),console.log(`Debug2: ${JSON.stringify(P)}`),ae=P,H(P)}}catch{console.error(`Cannot parse: ${y.val}`)}};return a==null||a.getObject(I).then(F=>{var y;g=(y=F==null?void 0:F.common)==null?void 0:y.engine,a.subscribeObject(I,L),g&&(a.subscribeState(`${g}.alive`,A),a.subscribeState(`${g.replace(/^system\.adapter\./,"")}.debug.rules`,Y))}),function(){a==null||a.unsubscribeState(I,A),g&&(a==null||a.unsubscribeObject(`${g}.alive`,L),T&&(a==null||a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOff",I)),a==null||a.unsubscribeState(`${g.replace(/^system\.adapter\./,"")}.debug.rules`,Y))}},[]),u.useEffect(()=>{w(!S&&O)},[S,O,w]),u.useEffect(()=>{d&&(M(d),W||$(!0))},[d]),u.useEffect(()=>{const g=le(n);JSON.stringify(g)!==JSON.stringify(p)&&(h(g),k(!0))},[n]),u.useEffect(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const q=u.useCallback(g=>{h(g),_&&e(je(g,_))},[_,e]),B=u.useRef(null),[m,C]=u.useState({835:!1,1035:!1});return u.useEffect(()=>{B.current&&(B.current.clientWidth<=1035&&C({835:!1,1035:!0}),B.current.clientWidth<=835&&C({1035:!0,835:!0}),B.current.clientWidth>1035&&C({835:!1,1035:!1}))},[((j=B.current)==null?void 0:j.clientWidth)||0]),!_||!a?null:t.jsxs("div",{className:ne.wrapperRules,ref:B,children:[t.jsx(Le,{allBlocks:f,socket:a}),W?v==="export"?t.jsx(Ie,{scriptId:I,themeType:i,onClose:()=>$(!1),text:JSON.stringify(p,null,2)}):t.jsx(Oe,{themeType:i,onClose:g=>{$(!1),g&&q(JSON.parse(g))}}):null,t.jsxs("div",{className:x.Utils.clsx(ne.rootWrapper,m[835]&&ne.addClass),children:[t.jsx(Bt,{setAllBlocks:b,allBlocks:f,userRules:p,onChangeBlocks:q,setTourStep:o,tourStep:c,addClass:m,isTourOpen:l}),t.jsx(ce,{socket:a,setUserRules:q,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${x.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:m[835],themeType:i,themeName:s,theme:r}),t.jsx(ce,{socket:a,setUserRules:q,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${x.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:x.I18n.t("or"),additionally:!0,border:!0,size:m[835],themeType:i,themeName:s,theme:r}),t.jsx(ce,{socket:a,setUserRules:q,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${x.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:x.I18n.t("else"),additionally:!0,size:m[835],themeType:i,themeName:s,theme:r})]})]},"rulesEditor")};export{Ut as default};
1
+ import{j as t}from"./createSvgIcon-XLoRKyxt.js";import{i as u}from"./iobroker_javascript__loadShare__react__loadShare__-6sH5wUl6.js";import{u as pe,a as xe,i as x,M as X,C as te,G as be,b as Ce,c as he,I as we,S as J,d as ve,e as le,j as je,D as Ie,f as Oe}from"./index-DCTpQXgR.js";import{i as N,C as Se}from"./index-CFhFEZTW.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CMP-NJnH.js";import"./inheritsLoose-tR_kcxUR.js";import"./preload-helper-BDBacUwf.js";function Ae(n){const s=pe().getMonitor(),[i,r]=xe(s,n);return u.useEffect(()=>s.subscribeToOffsetChange(r)),u.useEffect(()=>s.subscribeToStateChange(r)),i}let V;function ye(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const De="_wrapperRules_nnott_1",ke="_rootWrapper_nnott_9",Ne="_addClass_nnott_14",ne={wrapperRules:De,rootWrapper:ke,addClass:Ne},$e="_switchesItem_10ls3_1",Be="_switchesItemActive_10ls3_28",Ee="_iconTheme_10ls3_36",se={switchesItem:$e,switchesItemActive:Be,iconTheme:Ee},ue=({name:n,id:e,active:s,icon:i,adapter:r,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:I})=>t.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?x.I18n.t(l):void 0,className:x.Utils.clsx(se.switchesItem,s&&se.switchesItemActive,`block-${e}`),children:[t.jsx(X,{iconName:i,className:se.iconTheme,adapter:r,socket:o,style:I}),t.jsx("span",{children:n?x.I18n.t(n):""})]},e),Me="_cardStyle_8rq8v_1",qe="_cardStyleActive_8rq8v_17",He="_controlMenu_8rq8v_22",Te="_closeBtn_8rq8v_31",We="_isDelete_8rq8v_73",Pe="_drag_mobile_8rq8v_90",G={cardStyle:Me,cardStyleActive:qe,controlMenu:He,closeBtn:Te,isDelete:We,drag_mobile:Pe};function K(n,e,s){let i;switch(n){case"actions":if(s==="else")return i={...e,actions:{...e[n],else:[...e[n].else]}},i;if(s==="then")return i={...e,actions:{...e[n],then:[...e[n].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...e,triggers:[...e.triggers]},i;case"conditions":return i={...e,conditions:[...e.conditions]},i;default:throw new Error(`Unknown name: ${n}`)}}function z(n,e,s,i){var r;switch(n){case"actions":return e.actions[s]=e.actions[s].filter(o=>o._id!==i),e;case"conditions":return e.conditions[s]=(r=e.conditions[s])==null?void 0:r.filter(o=>o._id!==i),e;case"triggers":default:return e.triggers=e.triggers.filter(o=>o._id!==i),e}}function Fe(n,e,s){const{_id:i,acceptedBy:r}=n;let o;if(!r||!e[r])return console.warn(`Cannot find ${r}`),e;switch(r){case"actions":if(o=e.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.actions[s].indexOf(o);e.actions[s][c]=n}return e;case"conditions":if(o=e.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.conditions[s].indexOf(o);e.conditions[s][c]=n}return e;default:if(o=e.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=e.triggers.indexOf(o);e.triggers[c]=n}return e}}const me=u.memo(n=>{var B;const{setUserRules:e,userRules:s,_id:i,id:r,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:I,tourStep:S}=n,[O,_]=u.useState(null),{blocks:a,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:b}=u.useContext(te),p=u.useCallback(m=>a==null?void 0:a.find(C=>C.getStaticData().id===m),[a]),h=u.useCallback(m=>{const C=Fe(m,s,o);C&&e(C)},[s]),v=m=>{m.currentTarget!==O&&_(m.currentTarget)},M=()=>_(null),W=u.useMemo(()=>{const m=p(r)||be;return t.jsx(m,{...n,notFound:!p(r),isTourOpen:d,setTourStep:I,tourStep:S,onUpdate:H,setOnUpdate:w,enableSimulation:b,onDebugMessage:f,onChange:h,className:void 0,socket:k})},[s,H,f,b]),[$,q]=u.useState(!1);return t.jsxs("div",{onMouseMove:v,onMouseEnter:v,onMouseLeave:M,onMouseDown:m=>{if(m.ctrlKey){let C;const j=K(l,s,o);l==="conditions"?(C=j.conditions[o].find(g=>g._id===i),C&&j.conditions[o].splice(j.conditions[o].indexOf(C),0,{...C,_id:Date.now()})):l==="actions"?(C=j.actions[o].find(g=>g._id===i),C&&j.actions[o].splice(j.actions[o].indexOf(C),0,{...C,_id:Date.now()})):(C=j.triggers.find(g=>g._id===i),C&&j.triggers.splice(j[l].indexOf(C),0,{...C,_id:Date.now()})),e(j)}},id:"height",style:c?{width:(((B=document.getElementById("width"))==null?void 0:B.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${$?G.isDelete:null}`,children:[t.jsx("div",{className:G.drag_mobile}),W,e&&t.jsx("div",{className:G.controlMenu,style:O?{opacity:1}:{opacity:0},children:t.jsx("div",{onClick:()=>{let m=K(l,s,o);m=z(l,m,o,i),q(!0),setTimeout(()=>{l==="triggers"&&w(!0),e(m)},300)},className:G.closeBtn})})]})}),Ue={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Je=(n,e,s)=>{if(!n||!e)return{display:"none"};let{x:i,y:r}=e;const o=`translate(${i}px, ${r}px)`;return{transform:o,WebkitTransform:o}},Le=n=>{const{itemType:e,isDragging:s,item:i,initialOffset:r,currentOffset:o,targetIds:c}=Ae(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>{switch(e){case"box":return c.length?t.jsx(me,{active:!0,...i,allBlocks:n.allBlocks}):t.jsx(ue,{active:!0,...i,socket:n.socket});default:return null}};return s?t.jsx("div",{style:Ue,children:t.jsx("div",{style:Je(r,o),children:l()})}):null},ze="_border_wrpm3_1",Ge="_emptyBlockStyle_wrpm3_6",Ke="_emptyBlock_wrpm3_6",Qe="_selectOnChange_wrpm3_22",Xe="_selectOnChangeHelp_wrpm3_28",Ye="_selectOnChangeHelpIcon_wrpm3_34",Ze="_emptyBlockNone_wrpm3_49",Ve="_mainBlockItemRules_wrpm3_55",Re="_nameBlockItems_wrpm3_63",et="_contentBlockItem_wrpm3_73",tt="_wrapperMargin_wrpm3_81",nt="_contentHeightOn_wrpm3_87",st="_contentHeightOff_wrpm3_99",ot="_cardAdd_wrpm3_105",it="_blockCardAdd_wrpm3_125",ct="_addClassOverflow_wrpm3_136",at="_addClassHeight_wrpm3_140",D={border:ze,emptyBlockStyle:Ge,emptyBlock:Ke,selectOnChange:Qe,selectOnChangeHelp:Xe,selectOnChangeHelpIcon:Ye,emptyBlockNone:Ze,mainBlockItemRules:Ve,nameBlockItems:Re,contentBlockItem:et,wrapperMargin:tt,contentHeightOn:nt,contentHeightOff:st,cardAdd:ot,blockCardAdd:it,addClassOverflow:ct,addClassHeight:at};function re(n,e){const[s,i]=u.useState(window.localStorage.getItem(e)?JSON.parse(window.localStorage.getItem(e)||""):n);return[s,o=>{window.localStorage.setItem(e,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(e)]}function rt(n,e){let s=0,i=null,r;return function(...o){const c=Date.now();r=o,c-s>=e?(s=c,n.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,n.apply(this,r)},e-(c-s)))}}function ee(n){if(Array.isArray(n))return n.map(e=>ee(e));if(typeof n=="function")return n.bind(null);if(n&&typeof n=="object"){const e={};return Object.keys(n).forEach(s=>{e[s]=ee(n[s])}),e}return n}const oe=rt((n,e)=>n(e),0);function R(n,e){const s=e.find(i=>i._id===n);return{card:s,index:s?e.indexOf(s):-1}}function ie(n,e,s,i,r,o,c,l,d){const{card:I,index:S}=R(n,s);if(!(S<e&&l<d)&&!(S>e&&l>d)&&I&&S!==e){const O=ee(s);O.splice(S,1),O.splice(e,0,I);const _=ee(r);switch(o){case"actions":_.actions[c]=O,oe(i,_);return;case"conditions":_.conditions[c]=O,oe(i,_);return;default:_.triggers=O,oe(i,_);return}}}const lt="_drag_7xfhc_1",dt="_root_7xfhc_11",de={drag:lt,root:dt},_e=({typeBlock:n,allProperties:e,id:s,isActive:i,setUserRules:r,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:I}=u.useContext(te),[{opacity:S},O,_]=Ce({type:"box",item:()=>({...e,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:b}=w,p=f.getDropResult();let h;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(h=K(b,o,d),h=z(b,h,d,l),r(h)),null;if(p.blockValue!==d){const v=typeof l=="number"?l:Date.now();h=K(b,o,p.blockValue);const M={id:w.id,acceptedBy:w.acceptedBy};switch(b){case"actions":return d&&(h=z("actions",h,d,v)),h=z("actions",h,p.blockValue,v),h.actions[p.blockValue].push({...M,_id:v}),r(h);case"conditions":return typeof d=="number"&&(h=z("conditions",h,d,v)),h=z("conditions",h,p.blockValue,v),h.conditions[p.blockValue].push({...M,_id:v}),r(h);default:return I(!0),h=z("triggers",h,p.blockValue,v),h.triggers.push({...M,_id:v}),r(h)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),a=u.useRef(null),[,k]=he({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},b){var W;if(!a.current||n!==f)return;const p=(W=a.current)==null?void 0:W.getBoundingClientRect(),h=(p.bottom-p.top)/2,v=b.getClientOffset(),M=((v==null?void 0:v.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:$}=R(l,o.actions[d]);$!==w&&ie(w,$,o[f][d],r,o,f,d,M,h)}return;case"conditions":if(typeof d=="number"){const{index:$}=R(l,o[f][d]);$!==w&&ie(w,$,o[f][d],r,o,f,d,M,h)}return;default:{const{index:$}=R(l,o[f]);$!==w&&ie(w,$,o[f],r,o,f,void 0,M,h);return}}}});u.useEffect(()=>{_(ye(),{captureDraggingState:!0})},[]),O(k(a));const H=window.innerWidth<600;return t.jsxs("div",{ref:H&&l?null:a,className:de.root,style:{opacity:S},children:[t.jsx("div",{className:l?de.drag:null,ref:l&&H?a:null}),c]})},ft=({onClose:n,open:e})=>t.jsxs(N.Dialog,{open:e,onClose:n,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[t.jsx(N.DialogContent,{children:t.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[t.jsx("h3",{children:x.I18n.t("On condition change")}),t.jsx("div",{children:x.I18n.t("help_on_change")}),t.jsx("h3",{children:x.I18n.t("Just check")}),t.jsx("div",{children:x.I18n.t("help_just_check")})]})}),t.jsx(N.DialogActions,{children:t.jsx(N.Button,{onClick:n,color:"primary",autoFocus:!0,startIcon:t.jsx(Se,{}),children:x.I18n.t("OK")})})]}),gt=({onClose:n,open:e})=>t.jsxs(N.Dialog,{open:e,onClose:n,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[t.jsx(N.DialogContent,{children:t.jsxs(N.DialogContentText,{id:"alert-dialog-description",children:[t.jsx("h3",{children:x.I18n.t("On condition change")}),t.jsx("div",{children:x.I18n.t("help_on_change")}),t.jsx("h3",{children:x.I18n.t("Just check")}),t.jsx("div",{children:x.I18n.t("help_just_check")})]})}),t.jsx(N.DialogActions,{children:t.jsx(N.Button,{onClick:n,color:"primary",autoFocus:!0,children:x.I18n.t("OK")})})]}),fe=({size:n,blockValue:e,boolean:s,typeBlock:i,userRules:r,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:I,theme:S,themeType:O,themeName:_})=>{var T;const[a,k]=u.useState(!1),[H,w]=u.useState(!1),[f,b]=u.useState(!1),[p,h]=u.useState("");s===void 0&&(s=!0);const v=he({accept:"box",drop:()=>({blockValue:e}),hover:({acceptedBy:A,_id:L},Y)=>{k(A===i),b(!!L),h(Y.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),M=v[0],{canDrop:W,isOver:$,offset:q,targetId:B}=M,m=v[1];u.useEffect(()=>{h("")},[q]);const C=W&&$;let j="";C?j=a?"#00fb003d":"#fb00002e":W?j=H?"#00fb003d":"#fb00002e":q&&(j=B===p?"#fb00002e":"");let g;return i==="actions"?g=r.actions[e]:i==="conditions"?g=r.conditions[e]:g=r.triggers,t.jsx("div",{ref:m,style:{backgroundColor:j},className:`${x.Utils.clsx(D.contentBlockItem,n&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:t.jsxs("div",{className:D.wrapperMargin,children:[g.map(A=>t.jsx(_e,{typeBlock:i,...A,blockValue:e,allProperties:A,userRules:r,setUserRules:o,children:t.jsx(me,{...A,isTourOpen:I,setTourStep:l,tourStep:d,settings:A,blockValue:e,userRules:r,setUserRules:o,theme:S,themeType:O,themeName:_})},A._id)),t.jsx("div",{style:C&&a&&!f?{height:((T=document.getElementById("height"))==null?void 0:T.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${C&&a&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},ce=({size:n,typeBlock:e,name:s,nameAdditionally:i,additionally:r,border:o,userRules:c,setUserRules:l,iconName:d,adapter:I,socket:S,setTourStep:O,tourStep:_,isTourOpen:a,theme:k,themeType:H,themeName:w})=>{const[f,b,p]=re(e==="actions"?!1:[],`additionallyClickItems_${e}`),[h,v]=u.useState(!1),[M,W]=u.useState(!1);u.useEffect(()=>{if(e==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const B=[];c.conditions.forEach((m,C)=>{C>0&&B.push({_id:Date.now(),open:!0})}),b([...f,...B])}e==="actions"&&!p&&c.actions.else.length&&b(!0)},[]);const[$,q]=u.useState(!1);return t.jsxs("div",{className:`${x.Utils.clsx(D.mainBlockItemRules,n&&D.addClassOverflow)} ${o&&!n?D.border:null}`,children:[t.jsxs("span",{id:"width",className:D.nameBlockItems,children:[t.jsx(X,{iconName:d,className:D.iconThemCard,adapter:I,socket:S}),s]}),e==="conditions"?t.jsxs("div",{style:{width:"100%"},children:[t.jsxs(N.Select,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:B=>{const m=K("conditions",c);m.justCheck=B.target.value==="true",l(m)},children:[t.jsx(N.MenuItem,{value:"false",children:x.I18n.t("on condition change")}),t.jsx(N.MenuItem,{value:"true",children:x.I18n.t("just check")})]}),t.jsx(N.IconButton,{size:"small",title:x.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>v(!0),children:t.jsx(we,{className:D.selectOnChangeHelpIcon})})]}):null,t.jsx(fe,{setTourStep:O,tourStep:_,isTourOpen:a,blockValue:e==="actions"?"then":e==="conditions"?0:e,typeBlock:e,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:n}),r&&[...Array(e==="actions"?1:c.conditions.length-1)].map((B,m)=>{const C=(j=m)=>e==="actions"?!!f:!!f.find((g,T)=>T===j&&g.open);return t.jsxs(u.Fragment,{children:[t.jsxs("div",{onClick:()=>{if(e==="actions")return b(!f),null;let j=JSON.parse(JSON.stringify(f));if(c.conditions[m+1].length)return j[m].open=!j[m].open,b(j),null;j=j.filter((g,T)=>T!==m),b(j),q(m),setTimeout(()=>{q(!1),l({...c,conditions:[...c.conditions.filter((g,T)=>T!==m+1)]})},250)},className:D.blockCardAdd,children:[C()?"-":"+",t.jsx("div",{className:D.cardAdd,children:i})]},m),t.jsx(fe,{blockValue:e==="actions"?"else":e==="conditions"?m+1:e,typeBlock:e,setUserRules:l,userRules:c,boolean:C(),animation:$===m,size:n,theme:k,themeName:w,themeType:H})]},`${m}_block_${e}`)}),r&&e==="conditions"&&t.jsxs("div",{onClick:()=>{b([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),q(c.conditions.length-1),setTimeout(()=>q(!1),1e3)},className:D.blockCardAdd,children:["+",t.jsx("div",{className:D.cardAdd,children:i})]}),t.jsx(ft,{open:h,onClose:()=>v(!1)}),t.jsx(gt,{open:M,onClose:()=>W(!1)})]})},ht="_menuRules_1qqcb_1",ut="_switchesRenderWrapper_1qqcb_13",mt="_menuOff_1qqcb_22",_t="_menuTitle_1qqcb_28",pt="_marginAuto_1qqcb_42",xt="_inputWidth_1qqcb_47",bt="_menuWrapper_1qqcb_52",Ct="_hamburgerWrapper_1qqcb_57",wt="_hamburgerOff_1qqcb_74",vt="_nothingFound_1qqcb_82",jt="_resetSearch_1qqcb_89",It="_controlPanel_1qqcb_101",Ot="_controlPanelAppBar_1qqcb_112",St="_addClassMenu_1qqcb_126",At="_addClassBackground_1qqcb_132",yt="_addClassPosition_1qqcb_136",E={menuRules:ht,switchesRenderWrapper:ut,menuOff:mt,menuTitle:_t,marginAuto:pt,inputWidth:xt,menuWrapper:bt,hamburgerWrapper:Ct,hamburgerOff:wt,nothingFound:vt,resetSearch:jt,controlPanel:It,controlPanelAppBar:Ot,addClassMenu:St,addClassBackground:At,addClassPosition:yt},Dt=n=>{const{allProperties:e,allProperties:{acceptedBy:s,id:i},setUserRules:r,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:I,isActive:S}=n;return t.jsx(_e,{allProperties:e,id:e.id,isActive:S,setUserRules:r,userRules:o,children:t.jsx(ue,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const O=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const a=K(s,o,_),k={id:i,_id:O,acceptedBy:s};_!==void 0?s==="actions"?a.actions[_].push({...k}):s==="conditions"&&a.conditions[_].push({...k}):a.triggers.push({...k}),r(a)},...n,...e,onTouchMove:I})})},kt="_hamburgerMenu_hqnsm_8",Nt="_animate_hqnsm_21",ge={hamburgerMenu:kt,animate:Nt};function $t({bool:n}){return t.jsx("div",{className:`${ge.hamburgerMenu} ${n?ge.animate:""}`})}const Bt=({addClass:n,setAllBlocks:e,allBlocks:s,userRules:i,onChangeBlocks:r,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:I}=u.useContext(te),[S,O]=re(!1,"hamburgerOnOff"),[_,a]=re({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,b=_.type)=>{if(!d)return;let p=[...d];p=p.filter(h=>{if(!f)return!0;const{name:v}=h.getStaticData();return v&&x.I18n.t(v).toLowerCase().includes(f.toLowerCase())}),p=p.filter(h=>b===h.getStaticData().acceptedBy),e(p)},H=(f,b)=>{l&&b===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&b===2&&c===J.selectActions&&o(J.addActionPrintText),a({..._,index:b,type:["triggers","conditions","actions"][b]}),k(_.text,["triggers","conditions","actions"][b])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return u.useEffect(()=>{k()},[d]),t.jsx(N.ClickAwayListener,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>O(!0),children:t.jsxs("div",{className:x.Utils.clsx(E.menuWrapper,n[1035]&&E.addClassMenu),children:[t.jsx("div",{className:`${E.hamburgerWrapper} ${S?E.hamburgerOff:null}`,onClick:()=>O(!S),children:t.jsx($t,{bool:!S})}),t.jsxs("div",{className:`${x.Utils.clsx(E.menuRules,n[1035]&&E.addClassBackground,n[835]&&E.addClassPosition)} ${S?E.menuOff:null}`,children:[t.jsx("div",{className:E.controlPanel,children:t.jsx(N.AppBar,{className:E.controlPanelAppBar,position:"static",children:t.jsxs(N.Tabs,{value:_.index,onChange:H,children:[t.jsx(N.Tab,{className:"blocks-triggers",title:x.I18n.t("Triggers"),icon:t.jsx(X,{iconName:"FlashOn"}),...w(0)}),t.jsx(N.Tab,{title:x.I18n.t("Conditions"),className:"blocks-conditions",icon:t.jsx(X,{iconName:"Help"}),...w(1)}),t.jsx(N.Tab,{title:x.I18n.t("Actions"),className:"blocks-actions",icon:t.jsx(X,{iconName:"PlayForWork"}),...w(2)})]})})}),t.jsx("div",{className:E.switchesRenderWrapper,children:t.jsxs("span",{children:[s.map(f=>{const{name:b,id:p,icon:h,adapter:v}=f.getStaticData();return t.jsx(u.Fragment,{children:t.jsx(Dt,{adapter:v,allProperties:f.getStaticData(),icon:h,id:p,isActive:!1,isTourOpen:l,name:b,onTouchMove:()=>O(!0),setTourStep:o,setUserRules:r,socket:I,tourStep:c,userRules:i})},p)}),!s.length&&t.jsxs("div",{className:E.nothingFound,children:[x.I18n.t("Nothing found"),"...",t.jsx("div",{className:E.resetSearch,onClick:()=>{a({..._,text:""}),k("")},children:x.I18n.t("reset search")})]})]})}),t.jsx("div",{className:x.Utils.clsx(E.menuTitle,E.marginAuto)}),t.jsx(ve,{className:E.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:x.I18n.t("search"),variant:"outlined",onChange:f=>{a({..._,text:f}),k(f)}})]})]})})};let ae=[];const Ut=({code:n,onChange:e,themeName:s,themeType:i,theme:r,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:I,changed:S,running:O})=>{var j;const{blocks:_,socket:a,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=u.useContext(te),[f,b]=u.useState([]),[p,h]=u.useState(le(n)),[v,M]=u.useState(""),[W,$]=u.useState(!1);u.useEffect(()=>{let g,T;const A=(F,y)=>{F===`${g}.alive`&&T!==(y==null?void 0:y.val)&&(T=!!(y!=null&&y.val),T&&g&&(a==null||a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOn",I)))},L=(F,y)=>{var U,Q;a&&g!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(g&&(a.unsubscribeState(`${g}.alive`,A),T&&a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOn",I)),g=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,g&&g&&a.subscribeState(`${g}.alive`,A))},Y=(F,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===I&&Q-U.ts<1e3){const P=[...ae,{blockId:U.blockId,data:U.data,ts:U.ts}];P.length>200&&P.splice(0,200-P.length);for(let Z=P.length-1;Z>=0;Z--)if(P[Z].ts<Q-5e3){P.splice(0,Z);break}console.log(`Debug1: ${JSON.stringify(ae)}`),console.log(`Debug2: ${JSON.stringify(P)}`),ae=P,H(P)}}catch{console.error(`Cannot parse: ${y.val}`)}};return a==null||a.getObject(I).then(F=>{var y;g=(y=F==null?void 0:F.common)==null?void 0:y.engine,a.subscribeObject(I,L),g&&(a.subscribeState(`${g}.alive`,A),a.subscribeState(`${g.replace(/^system\.adapter\./,"")}.debug.rules`,Y))}),function(){a==null||a.unsubscribeState(I,A),g&&(a==null||a.unsubscribeObject(`${g}.alive`,L),T&&(a==null||a.sendTo(g.replace(/^system\.adapter\./,""),"rulesOff",I)),a==null||a.unsubscribeState(`${g.replace(/^system\.adapter\./,"")}.debug.rules`,Y))}},[]),u.useEffect(()=>{w(!S&&O)},[S,O,w]),u.useEffect(()=>{d&&(M(d),W||$(!0))},[d]),u.useEffect(()=>{const g=le(n);JSON.stringify(g)!==JSON.stringify(p)&&(h(g),k(!0))},[n]),u.useEffect(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const q=u.useCallback(g=>{h(g),_&&e(je(g,_))},[_,e]),B=u.useRef(null),[m,C]=u.useState({835:!1,1035:!1});return u.useEffect(()=>{B.current&&(B.current.clientWidth<=1035&&C({835:!1,1035:!0}),B.current.clientWidth<=835&&C({1035:!0,835:!0}),B.current.clientWidth>1035&&C({835:!1,1035:!1}))},[((j=B.current)==null?void 0:j.clientWidth)||0]),!_||!a?null:t.jsxs("div",{className:ne.wrapperRules,ref:B,children:[t.jsx(Le,{allBlocks:f,socket:a}),W?v==="export"?t.jsx(Ie,{scriptId:I,themeType:i,onClose:()=>$(!1),text:JSON.stringify(p,null,2)}):t.jsx(Oe,{themeType:i,onClose:g=>{$(!1),g&&q(JSON.parse(g))}}):null,t.jsxs("div",{className:x.Utils.clsx(ne.rootWrapper,m[835]&&ne.addClass),children:[t.jsx(Bt,{setAllBlocks:b,allBlocks:f,userRules:p,onChangeBlocks:q,setTourStep:o,tourStep:c,addClass:m,isTourOpen:l}),t.jsx(ce,{socket:a,setUserRules:q,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${x.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:m[835],themeType:i,themeName:s,theme:r}),t.jsx(ce,{socket:a,setUserRules:q,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${x.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:x.I18n.t("or"),additionally:!0,border:!0,size:m[835],themeType:i,themeName:s,theme:r}),t.jsx(ce,{socket:a,setUserRules:q,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${x.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:x.I18n.t("else"),additionally:!0,size:m[835],themeType:i,themeName:s,theme:r})]})]},"rulesEditor")};export{Ut as default};
@@ -1,11 +1,11 @@
1
- import{g as Be}from"./_commonjsHelpers-Cpj98o6Y.js";import{a as gt,b as bt}from"./iobroker_javascript__mf_v__runtimeInit__mf_v__-DZdFIfoQ.js";import{i,a as Ct}from"./iobroker_javascript__loadShare__react__loadShare__-i8pXne9X.js";import{ai as Qe,aj as vt,ak as Ze,al as Fe,am as _t,an as $t,ao as xt,ap as Mt,j as b,aq as Et,ar as Tt,as as wt,u as Pt,at as jt,n as et,au as kt,T as N,b as Ot,ad as It,h as At}from"./createSvgIcon-DlIk-fDn.js";const{loadShare:Lt}=bt,{initPromise:Rt}=gt,Dt=Rt.then(e=>Lt("react-dom",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Vt=await Dt.then(e=>e());var Nt=Vt;const jr=Be(Nt);var tt={exports:{}},d={};/** @license React v16.13.1
1
+ import{g as Be}from"./_commonjsHelpers-Cpj98o6Y.js";import{a as gt}from"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CMP-NJnH.js";import{i,a as bt}from"./iobroker_javascript__loadShare__react__loadShare__-6sH5wUl6.js";import{ai as Qe,aj as Ct,ak as Ze,al as Fe,am as vt,an as _t,ao as $t,ap as xt,j as b,aq as Mt,ar as Et,as as Tt,u as wt,at as Pt,n as et,au as jt,T as N,b as kt,ad as Ot,h as It}from"./createSvgIcon-XLoRKyxt.js";const{initPromise:At}=gt,Lt=At.then(e=>e.loadShare("react-dom",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Rt=await Lt.then(e=>e());var Dt=Rt;const wr=Be(Dt);var tt={exports:{}},d={};/** @license React v16.13.1
2
2
  * react-is.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
- */var C=typeof Symbol=="function"&&Symbol.for,ye=C?Symbol.for("react.element"):60103,pe=C?Symbol.for("react.portal"):60106,J=C?Symbol.for("react.fragment"):60107,X=C?Symbol.for("react.strict_mode"):60108,W=C?Symbol.for("react.profiler"):60114,B=C?Symbol.for("react.provider"):60109,Q=C?Symbol.for("react.context"):60110,Se=C?Symbol.for("react.async_mode"):60111,Z=C?Symbol.for("react.concurrent_mode"):60111,ee=C?Symbol.for("react.forward_ref"):60112,te=C?Symbol.for("react.suspense"):60113,Ft=C?Symbol.for("react.suspense_list"):60120,re=C?Symbol.for("react.memo"):60115,oe=C?Symbol.for("react.lazy"):60116,Kt=C?Symbol.for("react.block"):60121,qt=C?Symbol.for("react.fundamental"):60117,Gt=C?Symbol.for("react.responder"):60118,zt=C?Symbol.for("react.scope"):60119;function M(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ye:switch(e=e.type,e){case Se:case Z:case J:case W:case X:case te:return e;default:switch(e=e&&e.$$typeof,e){case Q:case ee:case oe:case re:case B:return e;default:return t}}case pe:return t}}}function rt(e){return M(e)===Z}d.AsyncMode=Se;d.ConcurrentMode=Z;d.ContextConsumer=Q;d.ContextProvider=B;d.Element=ye;d.ForwardRef=ee;d.Fragment=J;d.Lazy=oe;d.Memo=re;d.Portal=pe;d.Profiler=W;d.StrictMode=X;d.Suspense=te;d.isAsyncMode=function(e){return rt(e)||M(e)===Se};d.isConcurrentMode=rt;d.isContextConsumer=function(e){return M(e)===Q};d.isContextProvider=function(e){return M(e)===B};d.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ye};d.isForwardRef=function(e){return M(e)===ee};d.isFragment=function(e){return M(e)===J};d.isLazy=function(e){return M(e)===oe};d.isMemo=function(e){return M(e)===re};d.isPortal=function(e){return M(e)===pe};d.isProfiler=function(e){return M(e)===W};d.isStrictMode=function(e){return M(e)===X};d.isSuspense=function(e){return M(e)===te};d.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===J||e===Z||e===W||e===X||e===te||e===Ft||typeof e=="object"&&e!==null&&(e.$$typeof===oe||e.$$typeof===re||e.$$typeof===B||e.$$typeof===Q||e.$$typeof===ee||e.$$typeof===qt||e.$$typeof===Gt||e.$$typeof===zt||e.$$typeof===Kt)};d.typeOf=M;tt.exports=d;var Ht=tt.exports,ge=Ht,Ut={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Yt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Jt={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ot={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},be={};be[ge.ForwardRef]=Jt;be[ge.Memo]=ot;function Ke(e){return ge.isMemo(e)?ot:be[e.$$typeof]||Ut}var Xt=Object.defineProperty,Wt=Object.getOwnPropertyNames,qe=Object.getOwnPropertySymbols,Bt=Object.getOwnPropertyDescriptor,Qt=Object.getPrototypeOf,Ge=Object.prototype;function nt(e,t,r){if(typeof t!="string"){if(Ge){var o=Qt(t);o&&o!==Ge&&nt(e,o,r)}var c=Wt(t);qe&&(c=c.concat(qe(t)));for(var s=Ke(e),n=Ke(t),l=0;l<c.length;++l){var a=c[l];if(!Yt[a]&&!(r&&r[a])&&!(n&&n[a])&&!(s&&s[a])){var S=Bt(t,a);try{Xt(e,a,S)}catch{}}}}return e}var Zt=nt;const kr=Be(Zt);var ze=function(t,r){var o=arguments;if(r==null||!$t.call(r,"css"))return i.createElement.apply(void 0,o);var c=o.length,s=new Array(c);s[0]=xt,s[1]=Mt(t,r);for(var n=2;n<c;n++)s[n]=o[n];return i.createElement.apply(null,s)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(ze||(ze={}));var er=vt(function(e,t){var r=e.styles,o=Qe([r],void 0,i.useContext(Ze)),c=i.useRef();return Fe(function(){var s=t.key+"-global",n=new t.sheet.constructor({key:s,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,a=document.querySelector('style[data-emotion="'+s+" "+o.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),a!==null&&(l=!0,a.setAttribute("data-emotion",s),n.hydrate([a])),c.current=[n,l],function(){n.flush()}},[t]),Fe(function(){var s=c.current,n=s[0],l=s[1];if(l){s[1]=!1;return}if(o.next!==void 0&&_t(t,o.next,!0),n.tags.length){var a=n.tags[n.tags.length-1].nextElementSibling;n.before=a,n.flush()}t.insert("",o,n,!1)},[t,o.name]),null});function tr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Qe(t)}function Or(){var e=tr.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}const fe=new Map,rr=(e,t)=>{const r=Tt(e);return r.sheet=new t({key:r.key,nonce:r.sheet.nonce,container:r.sheet.container,speedy:r.sheet.isSpeedy,prepend:r.sheet.prepend,insertionPoint:r.sheet.insertionPoint}),r};let I;if(typeof document=="object"&&(I=document.querySelector('[name="emotion-insertion-point"]'),!I)){I=document.createElement("meta"),I.setAttribute("name","emotion-insertion-point"),I.setAttribute("content","");const e=document.querySelector("head");e&&e.prepend(I)}function or(e,t){if(e||t){class r extends wt{insert(s,n){return this.key&&this.key.endsWith("global")&&(this.before=I),super.insert(s,n)}}const o=rr({key:"css",insertionPoint:e?I:void 0},r);if(t){const c=o.insert;o.insert=(...s)=>(s[1].styles.match(/^@layer\s+[^{]*$/)||(s[1].styles=`@layer mui {${s[1].styles}}`),c(...s))}return o}}function Ir(e){const{injectFirst:t,enableCssLayer:r,children:o}=e,c=i.useMemo(()=>{const s=`${t}-${r}`;if(typeof document=="object"&&fe.has(s))return fe.get(s);const n=or(t,r);return fe.set(s,n),n},[t,r]);return c?b.jsx(Et,{value:c,children:o}):o}function nr(e){return e==null||Object.keys(e).length===0}function st(e){const{styles:t,defaultTheme:r={}}=e,o=typeof t=="function"?c=>t(nr(c)?r:c):t;return b.jsx(er,{styles:o})}function de(e){const t=jt(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function sr({styles:e,themeId:t,defaultTheme:r={}}){const o=Pt(r),c=t&&o[t]||o;let s=typeof e=="function"?e(c):e;return c.modularCssLayers&&(Array.isArray(s)?s=s.map(n=>de(typeof n=="function"?n(c):n)):s=de(s)),b.jsx(st,{styles:s})}const ct=typeof window<"u"?i.useLayoutEffect:i.useEffect;let He=0;function cr(e){const[t,r]=i.useState(e),o=e||t;return i.useEffect(()=>{t==null&&(He+=1,r(`mui-${He}`))},[t]),o}const ir={...Ct},Ue=ir.useId;function ar(e){if(Ue!==void 0){const t=Ue();return e??t}return cr(e)}const it=i.createContext(null);function Ce(){return i.useContext(it)}const lr=typeof Symbol=="function"&&Symbol.for,ur=lr?Symbol.for("mui.nested"):"__THEME_NESTED__";function fr(e,t){return typeof t=="function"?t(e):{...e,...t}}function dr(e){const{children:t,theme:r}=e,o=Ce(),c=i.useMemo(()=>{const s=o===null?{...r}:fr(o,r);return s!=null&&(s[ur]=o!==null),s},[r,o]);return b.jsx(it.Provider,{value:c,children:t})}const at=i.createContext();function mr({value:e,...t}){return b.jsx(at.Provider,{value:e??!0,...t})}const Ar=()=>i.useContext(at)??!1;function hr(e){const t=et(),r=ar()||"",{modularCssLayers:o}=e;let c="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!o||t!==null?c="":typeof o=="string"?c=o.replace(/mui(?!\.)/g,c):c=`@layer ${c};`,ct(()=>{var l,a;const s=document.querySelector("head");if(!s)return;const n=s.firstChild;if(c){if(n&&((l=n.hasAttribute)!=null&&l.call(n,"data-mui-layer-order"))&&n.getAttribute("data-mui-layer-order")===r)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",r),S.textContent=c,s.prepend(S)}else(a=s.querySelector(`style[data-mui-layer-order="${r}"]`))==null||a.remove()},[c,r]),c?b.jsx(sr,{styles:c}):null}const Ye={};function Je(e,t,r,o=!1){return i.useMemo(()=>{const c=e&&t[e]||t;if(typeof r=="function"){const s=r(c),n=e?{...t,[e]:s}:s;return o?()=>n:n}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,o])}function lt(e){const{children:t,theme:r,themeId:o}=e,c=et(Ye),s=Ce()||Ye,n=Je(o,c,r),l=Je(o,s,r,!0),a=(o?n[o]:n).direction==="rtl",S=hr(n);return b.jsx(dr,{theme:l,children:b.jsx(Ze.Provider,{value:n,children:b.jsx(mr,{value:a,children:b.jsxs(kt,{value:o?n[o].components:n.components,children:[S,t]})})})})}const ve="mode",_e="color-scheme",yr="data-color-scheme";function pr(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:o="dark",modeStorageKey:c=ve,colorSchemeStorageKey:s=_e,attribute:n=yr,colorSchemeNode:l="document.documentElement",nonce:a}=e||{};let S="",v=n;if(n==="class"&&(v=".%s"),n==="data"&&(v="[data-%s]"),v.startsWith(".")){const p=v.substring(1);S+=`${l}.classList.remove('${p}'.replace('%s', light), '${p}'.replace('%s', dark));
8
+ */var C=typeof Symbol=="function"&&Symbol.for,ye=C?Symbol.for("react.element"):60103,pe=C?Symbol.for("react.portal"):60106,J=C?Symbol.for("react.fragment"):60107,X=C?Symbol.for("react.strict_mode"):60108,W=C?Symbol.for("react.profiler"):60114,B=C?Symbol.for("react.provider"):60109,Q=C?Symbol.for("react.context"):60110,Se=C?Symbol.for("react.async_mode"):60111,Z=C?Symbol.for("react.concurrent_mode"):60111,ee=C?Symbol.for("react.forward_ref"):60112,te=C?Symbol.for("react.suspense"):60113,Vt=C?Symbol.for("react.suspense_list"):60120,re=C?Symbol.for("react.memo"):60115,oe=C?Symbol.for("react.lazy"):60116,Nt=C?Symbol.for("react.block"):60121,Ft=C?Symbol.for("react.fundamental"):60117,Kt=C?Symbol.for("react.responder"):60118,qt=C?Symbol.for("react.scope"):60119;function M(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ye:switch(e=e.type,e){case Se:case Z:case J:case W:case X:case te:return e;default:switch(e=e&&e.$$typeof,e){case Q:case ee:case oe:case re:case B:return e;default:return t}}case pe:return t}}}function rt(e){return M(e)===Z}d.AsyncMode=Se;d.ConcurrentMode=Z;d.ContextConsumer=Q;d.ContextProvider=B;d.Element=ye;d.ForwardRef=ee;d.Fragment=J;d.Lazy=oe;d.Memo=re;d.Portal=pe;d.Profiler=W;d.StrictMode=X;d.Suspense=te;d.isAsyncMode=function(e){return rt(e)||M(e)===Se};d.isConcurrentMode=rt;d.isContextConsumer=function(e){return M(e)===Q};d.isContextProvider=function(e){return M(e)===B};d.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ye};d.isForwardRef=function(e){return M(e)===ee};d.isFragment=function(e){return M(e)===J};d.isLazy=function(e){return M(e)===oe};d.isMemo=function(e){return M(e)===re};d.isPortal=function(e){return M(e)===pe};d.isProfiler=function(e){return M(e)===W};d.isStrictMode=function(e){return M(e)===X};d.isSuspense=function(e){return M(e)===te};d.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===J||e===Z||e===W||e===X||e===te||e===Vt||typeof e=="object"&&e!==null&&(e.$$typeof===oe||e.$$typeof===re||e.$$typeof===B||e.$$typeof===Q||e.$$typeof===ee||e.$$typeof===Ft||e.$$typeof===Kt||e.$$typeof===qt||e.$$typeof===Nt)};d.typeOf=M;tt.exports=d;var Gt=tt.exports,ge=Gt,zt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ht={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ut={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ot={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},be={};be[ge.ForwardRef]=Ut;be[ge.Memo]=ot;function Ke(e){return ge.isMemo(e)?ot:be[e.$$typeof]||zt}var Yt=Object.defineProperty,Jt=Object.getOwnPropertyNames,qe=Object.getOwnPropertySymbols,Xt=Object.getOwnPropertyDescriptor,Wt=Object.getPrototypeOf,Ge=Object.prototype;function nt(e,t,r){if(typeof t!="string"){if(Ge){var o=Wt(t);o&&o!==Ge&&nt(e,o,r)}var c=Jt(t);qe&&(c=c.concat(qe(t)));for(var s=Ke(e),n=Ke(t),l=0;l<c.length;++l){var a=c[l];if(!Ht[a]&&!(r&&r[a])&&!(n&&n[a])&&!(s&&s[a])){var S=Xt(t,a);try{Yt(e,a,S)}catch{}}}}return e}var Bt=nt;const Pr=Be(Bt);var ze=function(t,r){var o=arguments;if(r==null||!_t.call(r,"css"))return i.createElement.apply(void 0,o);var c=o.length,s=new Array(c);s[0]=$t,s[1]=xt(t,r);for(var n=2;n<c;n++)s[n]=o[n];return i.createElement.apply(null,s)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(ze||(ze={}));var Qt=Ct(function(e,t){var r=e.styles,o=Qe([r],void 0,i.useContext(Ze)),c=i.useRef();return Fe(function(){var s=t.key+"-global",n=new t.sheet.constructor({key:s,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,a=document.querySelector('style[data-emotion="'+s+" "+o.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),a!==null&&(l=!0,a.setAttribute("data-emotion",s),n.hydrate([a])),c.current=[n,l],function(){n.flush()}},[t]),Fe(function(){var s=c.current,n=s[0],l=s[1];if(l){s[1]=!1;return}if(o.next!==void 0&&vt(t,o.next,!0),n.tags.length){var a=n.tags[n.tags.length-1].nextElementSibling;n.before=a,n.flush()}t.insert("",o,n,!1)},[t,o.name]),null});function Zt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Qe(t)}function jr(){var e=Zt.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}const fe=new Map,er=(e,t)=>{const r=Et(e);return r.sheet=new t({key:r.key,nonce:r.sheet.nonce,container:r.sheet.container,speedy:r.sheet.isSpeedy,prepend:r.sheet.prepend,insertionPoint:r.sheet.insertionPoint}),r};let I;if(typeof document=="object"&&(I=document.querySelector('[name="emotion-insertion-point"]'),!I)){I=document.createElement("meta"),I.setAttribute("name","emotion-insertion-point"),I.setAttribute("content","");const e=document.querySelector("head");e&&e.prepend(I)}function tr(e,t){if(e||t){class r extends Tt{insert(s,n){return this.key&&this.key.endsWith("global")&&(this.before=I),super.insert(s,n)}}const o=er({key:"css",insertionPoint:e?I:void 0},r);if(t){const c=o.insert;o.insert=(...s)=>(s[1].styles.match(/^@layer\s+[^{]*$/)||(s[1].styles=`@layer mui {${s[1].styles}}`),c(...s))}return o}}function kr(e){const{injectFirst:t,enableCssLayer:r,children:o}=e,c=i.useMemo(()=>{const s=`${t}-${r}`;if(typeof document=="object"&&fe.has(s))return fe.get(s);const n=tr(t,r);return fe.set(s,n),n},[t,r]);return c?b.jsx(Mt,{value:c,children:o}):o}function rr(e){return e==null||Object.keys(e).length===0}function st(e){const{styles:t,defaultTheme:r={}}=e,o=typeof t=="function"?c=>t(rr(c)?r:c):t;return b.jsx(Qt,{styles:o})}function de(e){const t=Pt(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function or({styles:e,themeId:t,defaultTheme:r={}}){const o=wt(r),c=t&&o[t]||o;let s=typeof e=="function"?e(c):e;return c.modularCssLayers&&(Array.isArray(s)?s=s.map(n=>de(typeof n=="function"?n(c):n)):s=de(s)),b.jsx(st,{styles:s})}const ct=typeof window<"u"?i.useLayoutEffect:i.useEffect;let He=0;function nr(e){const[t,r]=i.useState(e),o=e||t;return i.useEffect(()=>{t==null&&(He+=1,r(`mui-${He}`))},[t]),o}const sr={...bt},Ue=sr.useId;function cr(e){if(Ue!==void 0){const t=Ue();return e??t}return nr(e)}const it=i.createContext(null);function Ce(){return i.useContext(it)}const ir=typeof Symbol=="function"&&Symbol.for,ar=ir?Symbol.for("mui.nested"):"__THEME_NESTED__";function lr(e,t){return typeof t=="function"?t(e):{...e,...t}}function ur(e){const{children:t,theme:r}=e,o=Ce(),c=i.useMemo(()=>{const s=o===null?{...r}:lr(o,r);return s!=null&&(s[ar]=o!==null),s},[r,o]);return b.jsx(it.Provider,{value:c,children:t})}const at=i.createContext();function fr({value:e,...t}){return b.jsx(at.Provider,{value:e??!0,...t})}const Or=()=>i.useContext(at)??!1;function dr(e){const t=et(),r=cr()||"",{modularCssLayers:o}=e;let c="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!o||t!==null?c="":typeof o=="string"?c=o.replace(/mui(?!\.)/g,c):c=`@layer ${c};`,ct(()=>{var l,a;const s=document.querySelector("head");if(!s)return;const n=s.firstChild;if(c){if(n&&((l=n.hasAttribute)!=null&&l.call(n,"data-mui-layer-order"))&&n.getAttribute("data-mui-layer-order")===r)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",r),S.textContent=c,s.prepend(S)}else(a=s.querySelector(`style[data-mui-layer-order="${r}"]`))==null||a.remove()},[c,r]),c?b.jsx(or,{styles:c}):null}const Ye={};function Je(e,t,r,o=!1){return i.useMemo(()=>{const c=e&&t[e]||t;if(typeof r=="function"){const s=r(c),n=e?{...t,[e]:s}:s;return o?()=>n:n}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,o])}function lt(e){const{children:t,theme:r,themeId:o}=e,c=et(Ye),s=Ce()||Ye,n=Je(o,c,r),l=Je(o,s,r,!0),a=(o?n[o]:n).direction==="rtl",S=dr(n);return b.jsx(ur,{theme:l,children:b.jsx(Ze.Provider,{value:n,children:b.jsx(fr,{value:a,children:b.jsxs(jt,{value:o?n[o].components:n.components,children:[S,t]})})})})}const ve="mode",_e="color-scheme",mr="data-color-scheme";function hr(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:o="dark",modeStorageKey:c=ve,colorSchemeStorageKey:s=_e,attribute:n=mr,colorSchemeNode:l="document.documentElement",nonce:a}=e||{};let S="",v=n;if(n==="class"&&(v=".%s"),n==="data"&&(v="[data-%s]"),v.startsWith(".")){const p=v.substring(1);S+=`${l}.classList.remove('${p}'.replace('%s', light), '${p}'.replace('%s', dark));
9
9
  ${l}.classList.add('${p}'.replace('%s', colorScheme));`}const P=v.match(/\[([^\]]+)\]/);if(P){const[p,h]=P[1].split("=");h||(S+=`${l}.removeAttribute('${p}'.replace('%s', light));
10
10
  ${l}.removeAttribute('${p}'.replace('%s', dark));`),S+=`
11
11
  ${l}.setAttribute('${p}'.replace('%s', colorScheme), ${h?`${h}.replace('%s', colorScheme)`:'""'});`}else S+=`${l}.setAttribute('${v}', colorScheme);`;return b.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?a:"",dangerouslySetInnerHTML:{__html:`(function() {
@@ -32,5 +32,5 @@ try {
32
32
  if (colorScheme) {
33
33
  ${S}
34
34
  }
35
- } catch(e){}})();`}},"mui-color-scheme-init")}function Sr(){}const gr=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(r){if(typeof window>"u")return;if(!t)return r;let o;try{o=t.localStorage.getItem(e)}catch{}return o||r},set:r=>{if(t)try{t.localStorage.setItem(e,r)}catch{}},subscribe:r=>{if(!t)return Sr;const o=c=>{const s=c.newValue;c.key===e&&r(s)};return t.addEventListener("storage",o),()=>{t.removeEventListener("storage",o)}}});function me(){}function Xe(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ut(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function br(e){return ut(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function Cr(e){const{defaultMode:t="light",defaultLightColorScheme:r,defaultDarkColorScheme:o,supportedColorSchemes:c=[],modeStorageKey:s=ve,colorSchemeStorageKey:n=_e,storageWindow:l=typeof window>"u"?void 0:window,storageManager:a=gr,noSsr:S=!1}=e,v=c.join(","),P=c.length>1,p=i.useMemo(()=>a==null?void 0:a({key:s,storageWindow:l}),[a,s,l]),h=i.useMemo(()=>a==null?void 0:a({key:`${n}-light`,storageWindow:l}),[a,n,l]),g=i.useMemo(()=>a==null?void 0:a({key:`${n}-dark`,storageWindow:l}),[a,n,l]),[k,R]=i.useState(()=>{const u=(p==null?void 0:p.get(t))||t,f=(h==null?void 0:h.get(r))||r,m=(g==null?void 0:g.get(o))||o;return{mode:u,systemMode:Xe(u),lightColorScheme:f,darkColorScheme:m}}),[A,ne]=i.useState(S||!P);i.useEffect(()=>{ne(!0)},[]);const F=br(k),K=i.useCallback(u=>{R(f=>{if(u===f.mode)return f;const m=u??t;return p==null||p.set(m),{...f,mode:m,systemMode:Xe(m)}})},[p,t]),D=i.useCallback(u=>{u?typeof u=="string"?u&&!v.includes(u)?console.error(`\`${u}\` does not exist in \`theme.colorSchemes\`.`):R(f=>{const m={...f};return ut(f,y=>{y==="light"&&(h==null||h.set(u),m.lightColorScheme=u),y==="dark"&&(g==null||g.set(u),m.darkColorScheme=u)}),m}):R(f=>{const m={...f},y=u.light===null?r:u.light,L=u.dark===null?o:u.dark;return y&&(v.includes(y)?(m.lightColorScheme=y,h==null||h.set(y)):console.error(`\`${y}\` does not exist in \`theme.colorSchemes\`.`)),L&&(v.includes(L)?(m.darkColorScheme=L,g==null||g.set(L)):console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`)),m}):R(f=>(h==null||h.set(r),g==null||g.set(o),{...f,lightColorScheme:r,darkColorScheme:o}))},[v,h,g,r,o]),q=i.useCallback(u=>{k.mode==="system"&&R(f=>{const m=u!=null&&u.matches?"dark":"light";return f.systemMode===m?f:{...f,systemMode:m}})},[k.mode]),U=i.useRef(q);return U.current=q,i.useEffect(()=>{if(typeof window.matchMedia!="function"||!P)return;const u=(...m)=>U.current(...m),f=window.matchMedia("(prefers-color-scheme: dark)");return f.addListener(u),u(f),()=>{f.removeListener(u)}},[P]),i.useEffect(()=>{if(P){const u=(p==null?void 0:p.subscribe(y=>{(!y||["light","dark","system"].includes(y))&&K(y||t)}))||me,f=(h==null?void 0:h.subscribe(y=>{(!y||v.match(y))&&D({light:y})}))||me,m=(g==null?void 0:g.subscribe(y=>{(!y||v.match(y))&&D({dark:y})}))||me;return()=>{u(),f(),m()}}},[D,K,v,t,l,P,p,h,g]),{...k,mode:A?k.mode:void 0,systemMode:A?k.systemMode:void 0,colorScheme:A?F:void 0,setMode:K,setColorScheme:D}}const vr="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function _r(e){const{themeId:t,theme:r={},modeStorageKey:o=ve,colorSchemeStorageKey:c=_e,disableTransitionOnChange:s=!1,defaultColorScheme:n,resolveTheme:l}=e,a={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},S=i.createContext(void 0),v=()=>i.useContext(S)||a,P={},p={};function h(A){var Re,De,Ve,Ne;const{children:ne,theme:F,modeStorageKey:K=o,colorSchemeStorageKey:D=c,disableTransitionOnChange:q=s,storageManager:U,storageWindow:u=typeof window>"u"?void 0:window,documentNode:f=typeof document>"u"?void 0:document,colorSchemeNode:m=typeof document>"u"?void 0:document.documentElement,disableNestedContext:y=!1,disableStyleSheetGeneration:L=!1,defaultMode:dt="system",noSsr:mt}=A,se=i.useRef(!1),ce=Ce(),ie=i.useContext(S),ae=!!ie&&!y,$e=i.useMemo(()=>F||(typeof r=="function"?r():r),[F]),xe=$e[t],E=xe||$e,{colorSchemes:O=P,components:Me=p,cssVarPrefix:le}=E,Ee=Object.keys(O).filter(_=>!!O[_]).join(","),V=i.useMemo(()=>Ee.split(","),[Ee]),Te=typeof n=="string"?n:n.light,we=typeof n=="string"?n:n.dark,ht=O[Te]&&O[we]?dt:((De=(Re=O[E.defaultColorScheme])==null?void 0:Re.palette)==null?void 0:De.mode)||((Ve=E.palette)==null?void 0:Ve.mode),{mode:yt,setMode:Pe,systemMode:je,lightColorScheme:ke,darkColorScheme:Oe,colorScheme:pt,setColorScheme:Ie}=Cr({supportedColorSchemes:V,defaultLightColorScheme:Te,defaultDarkColorScheme:we,modeStorageKey:K,colorSchemeStorageKey:D,defaultMode:ht,storageManager:U,storageWindow:u,noSsr:mt});let ue=yt,T=pt;ae&&(ue=ie.mode,T=ie.colorScheme);const G=i.useMemo(()=>{var H;const _=T||E.defaultColorScheme,$=((H=E.generateThemeVars)==null?void 0:H.call(E))||E.vars,x={...E,components:Me,colorSchemes:O,cssVarPrefix:le,vars:$};if(typeof x.generateSpacing=="function"&&(x.spacing=x.generateSpacing()),_){const w=O[_];w&&typeof w=="object"&&Object.keys(w).forEach(j=>{w[j]&&typeof w[j]=="object"?x[j]={...x[j],...w[j]}:x[j]=w[j]})}return l?l(x):x},[E,T,Me,O,le]),z=E.colorSchemeSelector;ct(()=>{if(T&&m&&z&&z!=="media"){const _=z;let $=z;if(_==="class"&&($=".%s"),_==="data"&&($="[data-%s]"),_!=null&&_.startsWith("data-")&&!_.includes("%s")&&($=`[${_}="%s"]`),$.startsWith("."))m.classList.remove(...V.map(x=>$.substring(1).replace("%s",x))),m.classList.add($.substring(1).replace("%s",T));else{const x=$.replace("%s",T).match(/\[([^\]]+)\]/);if(x){const[H,w]=x[1].split("=");w||V.forEach(j=>{m.removeAttribute(H.replace(T,j))}),m.setAttribute(H,w?w.replace(/"|'/g,""):"")}else m.setAttribute($,T)}}},[T,z,m,V]),i.useEffect(()=>{let _;if(q&&se.current&&f){const $=f.createElement("style");$.appendChild(f.createTextNode(vr)),f.head.appendChild($),window.getComputedStyle(f.body),_=setTimeout(()=>{f.head.removeChild($)},1)}return()=>{clearTimeout(_)}},[T,q,f]),i.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const St=i.useMemo(()=>({allColorSchemes:V,colorScheme:T,darkColorScheme:Oe,lightColorScheme:ke,mode:ue,setColorScheme:Ie,setMode:Pe,systemMode:je}),[V,T,Oe,ke,ue,Ie,Pe,je,G.colorSchemeSelector]);let Ae=!0;(L||E.cssVariables===!1||ae&&(ce==null?void 0:ce.cssVarPrefix)===le)&&(Ae=!1);const Le=b.jsxs(i.Fragment,{children:[b.jsx(lt,{themeId:xe?t:void 0,theme:G,children:ne}),Ae&&b.jsx(st,{styles:((Ne=G.generateStyleSheets)==null?void 0:Ne.call(G))||[]})]});return ae?Le:b.jsx(S.Provider,{value:St,children:Le})}const g=typeof n=="string"?n:n.light,k=typeof n=="string"?n:n.dark;return{CssVarsProvider:h,useColorScheme:v,getInitColorSchemeScript:A=>pr({colorSchemeStorageKey:c,defaultLightColorScheme:g,defaultDarkColorScheme:k,modeStorageKey:o,...A})}}function $r({theme:e,...t}){const r=N in e?e[N]:void 0;return b.jsx(lt,{...t,themeId:r?N:void 0,theme:r||e})}const Y={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:ft,useColorScheme:Lr,getInitColorSchemeScript:xr}=_r({themeId:N,theme:()=>Ot({cssVariables:!0}),colorSchemeStorageKey:Y.colorSchemeStorageKey,modeStorageKey:Y.modeStorageKey,defaultColorScheme:{light:Y.defaultLightColorScheme,dark:Y.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:It(e.palette,e.typography)};return t.unstable_sx=function(o){return At({sx:o,theme:this})},t}});function Rr(e){return b.jsx(ft,{...e})}let We=!1;const Dr=e=>(We||(console.warn(["MUI: The getInitColorSchemeScript function has been deprecated.","","You should use `import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'`","and replace the function call with `<InitColorSchemeScript />` instead."].join(`
36
- `)),We=!0),xr(e)),Mr=ft;function Vr({theme:e,...t}){const r=i.useMemo(()=>{if(typeof e=="function")return e;const o=N in e?e[N]:e;return"colorSchemes"in o?null:"vars"in o?e:{...e,vars:null}},[e]);return r?b.jsx($r,{theme:r,...t}):b.jsx(Mr,{theme:e,...t})}const Nr={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};function Fr(e,t){if(e==null)return{};var r={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;r[o]=e[o]}return r}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},he(e,t)}function Kr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,he(e,t)}export{Mr as C,Rr as E,sr as G,jr as R,Ir as S,Vr as T,Kr as _,Fr as a,ar as b,tr as c,Ar as d,Lr as e,Dr as g,Nt as i,Or as k,kr as m,ct as u,Nr as y};
35
+ } catch(e){}})();`}},"mui-color-scheme-init")}function yr(){}const pr=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(r){if(typeof window>"u")return;if(!t)return r;let o;try{o=t.localStorage.getItem(e)}catch{}return o||r},set:r=>{if(t)try{t.localStorage.setItem(e,r)}catch{}},subscribe:r=>{if(!t)return yr;const o=c=>{const s=c.newValue;c.key===e&&r(s)};return t.addEventListener("storage",o),()=>{t.removeEventListener("storage",o)}}});function me(){}function Xe(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ut(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function Sr(e){return ut(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function gr(e){const{defaultMode:t="light",defaultLightColorScheme:r,defaultDarkColorScheme:o,supportedColorSchemes:c=[],modeStorageKey:s=ve,colorSchemeStorageKey:n=_e,storageWindow:l=typeof window>"u"?void 0:window,storageManager:a=pr,noSsr:S=!1}=e,v=c.join(","),P=c.length>1,p=i.useMemo(()=>a==null?void 0:a({key:s,storageWindow:l}),[a,s,l]),h=i.useMemo(()=>a==null?void 0:a({key:`${n}-light`,storageWindow:l}),[a,n,l]),g=i.useMemo(()=>a==null?void 0:a({key:`${n}-dark`,storageWindow:l}),[a,n,l]),[k,R]=i.useState(()=>{const u=(p==null?void 0:p.get(t))||t,f=(h==null?void 0:h.get(r))||r,m=(g==null?void 0:g.get(o))||o;return{mode:u,systemMode:Xe(u),lightColorScheme:f,darkColorScheme:m}}),[A,ne]=i.useState(S||!P);i.useEffect(()=>{ne(!0)},[]);const F=Sr(k),K=i.useCallback(u=>{R(f=>{if(u===f.mode)return f;const m=u??t;return p==null||p.set(m),{...f,mode:m,systemMode:Xe(m)}})},[p,t]),D=i.useCallback(u=>{u?typeof u=="string"?u&&!v.includes(u)?console.error(`\`${u}\` does not exist in \`theme.colorSchemes\`.`):R(f=>{const m={...f};return ut(f,y=>{y==="light"&&(h==null||h.set(u),m.lightColorScheme=u),y==="dark"&&(g==null||g.set(u),m.darkColorScheme=u)}),m}):R(f=>{const m={...f},y=u.light===null?r:u.light,L=u.dark===null?o:u.dark;return y&&(v.includes(y)?(m.lightColorScheme=y,h==null||h.set(y)):console.error(`\`${y}\` does not exist in \`theme.colorSchemes\`.`)),L&&(v.includes(L)?(m.darkColorScheme=L,g==null||g.set(L)):console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`)),m}):R(f=>(h==null||h.set(r),g==null||g.set(o),{...f,lightColorScheme:r,darkColorScheme:o}))},[v,h,g,r,o]),q=i.useCallback(u=>{k.mode==="system"&&R(f=>{const m=u!=null&&u.matches?"dark":"light";return f.systemMode===m?f:{...f,systemMode:m}})},[k.mode]),U=i.useRef(q);return U.current=q,i.useEffect(()=>{if(typeof window.matchMedia!="function"||!P)return;const u=(...m)=>U.current(...m),f=window.matchMedia("(prefers-color-scheme: dark)");return f.addListener(u),u(f),()=>{f.removeListener(u)}},[P]),i.useEffect(()=>{if(P){const u=(p==null?void 0:p.subscribe(y=>{(!y||["light","dark","system"].includes(y))&&K(y||t)}))||me,f=(h==null?void 0:h.subscribe(y=>{(!y||v.match(y))&&D({light:y})}))||me,m=(g==null?void 0:g.subscribe(y=>{(!y||v.match(y))&&D({dark:y})}))||me;return()=>{u(),f(),m()}}},[D,K,v,t,l,P,p,h,g]),{...k,mode:A?k.mode:void 0,systemMode:A?k.systemMode:void 0,colorScheme:A?F:void 0,setMode:K,setColorScheme:D}}const br="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Cr(e){const{themeId:t,theme:r={},modeStorageKey:o=ve,colorSchemeStorageKey:c=_e,disableTransitionOnChange:s=!1,defaultColorScheme:n,resolveTheme:l}=e,a={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},S=i.createContext(void 0),v=()=>i.useContext(S)||a,P={},p={};function h(A){var Re,De,Ve,Ne;const{children:ne,theme:F,modeStorageKey:K=o,colorSchemeStorageKey:D=c,disableTransitionOnChange:q=s,storageManager:U,storageWindow:u=typeof window>"u"?void 0:window,documentNode:f=typeof document>"u"?void 0:document,colorSchemeNode:m=typeof document>"u"?void 0:document.documentElement,disableNestedContext:y=!1,disableStyleSheetGeneration:L=!1,defaultMode:dt="system",noSsr:mt}=A,se=i.useRef(!1),ce=Ce(),ie=i.useContext(S),ae=!!ie&&!y,$e=i.useMemo(()=>F||(typeof r=="function"?r():r),[F]),xe=$e[t],E=xe||$e,{colorSchemes:O=P,components:Me=p,cssVarPrefix:le}=E,Ee=Object.keys(O).filter(_=>!!O[_]).join(","),V=i.useMemo(()=>Ee.split(","),[Ee]),Te=typeof n=="string"?n:n.light,we=typeof n=="string"?n:n.dark,ht=O[Te]&&O[we]?dt:((De=(Re=O[E.defaultColorScheme])==null?void 0:Re.palette)==null?void 0:De.mode)||((Ve=E.palette)==null?void 0:Ve.mode),{mode:yt,setMode:Pe,systemMode:je,lightColorScheme:ke,darkColorScheme:Oe,colorScheme:pt,setColorScheme:Ie}=gr({supportedColorSchemes:V,defaultLightColorScheme:Te,defaultDarkColorScheme:we,modeStorageKey:K,colorSchemeStorageKey:D,defaultMode:ht,storageManager:U,storageWindow:u,noSsr:mt});let ue=yt,T=pt;ae&&(ue=ie.mode,T=ie.colorScheme);const G=i.useMemo(()=>{var H;const _=T||E.defaultColorScheme,$=((H=E.generateThemeVars)==null?void 0:H.call(E))||E.vars,x={...E,components:Me,colorSchemes:O,cssVarPrefix:le,vars:$};if(typeof x.generateSpacing=="function"&&(x.spacing=x.generateSpacing()),_){const w=O[_];w&&typeof w=="object"&&Object.keys(w).forEach(j=>{w[j]&&typeof w[j]=="object"?x[j]={...x[j],...w[j]}:x[j]=w[j]})}return l?l(x):x},[E,T,Me,O,le]),z=E.colorSchemeSelector;ct(()=>{if(T&&m&&z&&z!=="media"){const _=z;let $=z;if(_==="class"&&($=".%s"),_==="data"&&($="[data-%s]"),_!=null&&_.startsWith("data-")&&!_.includes("%s")&&($=`[${_}="%s"]`),$.startsWith("."))m.classList.remove(...V.map(x=>$.substring(1).replace("%s",x))),m.classList.add($.substring(1).replace("%s",T));else{const x=$.replace("%s",T).match(/\[([^\]]+)\]/);if(x){const[H,w]=x[1].split("=");w||V.forEach(j=>{m.removeAttribute(H.replace(T,j))}),m.setAttribute(H,w?w.replace(/"|'/g,""):"")}else m.setAttribute($,T)}}},[T,z,m,V]),i.useEffect(()=>{let _;if(q&&se.current&&f){const $=f.createElement("style");$.appendChild(f.createTextNode(br)),f.head.appendChild($),window.getComputedStyle(f.body),_=setTimeout(()=>{f.head.removeChild($)},1)}return()=>{clearTimeout(_)}},[T,q,f]),i.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const St=i.useMemo(()=>({allColorSchemes:V,colorScheme:T,darkColorScheme:Oe,lightColorScheme:ke,mode:ue,setColorScheme:Ie,setMode:Pe,systemMode:je}),[V,T,Oe,ke,ue,Ie,Pe,je,G.colorSchemeSelector]);let Ae=!0;(L||E.cssVariables===!1||ae&&(ce==null?void 0:ce.cssVarPrefix)===le)&&(Ae=!1);const Le=b.jsxs(i.Fragment,{children:[b.jsx(lt,{themeId:xe?t:void 0,theme:G,children:ne}),Ae&&b.jsx(st,{styles:((Ne=G.generateStyleSheets)==null?void 0:Ne.call(G))||[]})]});return ae?Le:b.jsx(S.Provider,{value:St,children:Le})}const g=typeof n=="string"?n:n.light,k=typeof n=="string"?n:n.dark;return{CssVarsProvider:h,useColorScheme:v,getInitColorSchemeScript:A=>hr({colorSchemeStorageKey:c,defaultLightColorScheme:g,defaultDarkColorScheme:k,modeStorageKey:o,...A})}}function vr({theme:e,...t}){const r=N in e?e[N]:void 0;return b.jsx(lt,{...t,themeId:r?N:void 0,theme:r||e})}const Y={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:ft,useColorScheme:Ir,getInitColorSchemeScript:_r}=Cr({themeId:N,theme:()=>kt({cssVariables:!0}),colorSchemeStorageKey:Y.colorSchemeStorageKey,modeStorageKey:Y.modeStorageKey,defaultColorScheme:{light:Y.defaultLightColorScheme,dark:Y.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:Ot(e.palette,e.typography)};return t.unstable_sx=function(o){return It({sx:o,theme:this})},t}});function Ar(e){return b.jsx(ft,{...e})}let We=!1;const Lr=e=>(We||(console.warn(["MUI: The getInitColorSchemeScript function has been deprecated.","","You should use `import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'`","and replace the function call with `<InitColorSchemeScript />` instead."].join(`
36
+ `)),We=!0),_r(e)),$r=ft;function Rr({theme:e,...t}){const r=i.useMemo(()=>{if(typeof e=="function")return e;const o=N in e?e[N]:e;return"colorSchemes"in o?null:"vars"in o?e:{...e,vars:null}},[e]);return r?b.jsx(vr,{theme:r,...t}):b.jsx($r,{theme:e,...t})}const Dr={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};function Vr(e,t){if(e==null)return{};var r={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;r[o]=e[o]}return r}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},he(e,t)}function Nr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,he(e,t)}export{$r as C,Ar as E,or as G,wr as R,kr as S,Rr as T,Nr as _,Vr as a,cr as b,Zt as c,Or as d,Ir as e,Lr as g,Dt as i,jr as k,Pr as m,ct as u,Dr as y};
@@ -0,0 +1 @@
1
+ import{g as i}from"./_commonjsHelpers-Cpj98o6Y.js";import{a as _}from"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CMP-NJnH.js";function c(e,n){for(var o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&!Array.isArray(r)){for(const t in r)if(t!=="default"&&!(t in e)){const a=Object.getOwnPropertyDescriptor(r,t);a&&Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>r[t]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const{initPromise:f}=_,l=f.then(e=>e.loadShare("react",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),u=await l.then(e=>e());var s=u;const p=i(s),d=c({__proto__:null,default:p},[s]);export{p as R,d as a,s as i};
@@ -0,0 +1,8 @@
1
+ var index_cjs$2={},index_cjs$1={},define_process_env_default={};const FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return typeof window<"u"&&typeof window.document<"u"}function isReactNativeEnv(){return typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch{return!1}return!1}function isDebugMode(){return typeof process<"u"&&define_process_env_default&&define_process_env_default.FEDERATION_DEBUG?!!define_process_env_default.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:isBrowserDebug()}const getProcessEnv=function(){return typeof process<"u"&&define_process_env_default?define_process_env_default:{}},LOG_CATEGORY$1="[ Federation Runtime ]",parseEntry=(t,e,r=SEPARATOR)=>{const o=t.split(r),n=getProcessEnv().NODE_ENV==="development"&&e,a="*",i=s=>s.startsWith("http")||s.includes(MANIFEST_EXT);if(o.length>=2){let[s,...c]=o;t.startsWith(r)&&(s=o.slice(0,2).join(r),c=[n||o.slice(2).join(r)]);let l=n||c.join(r);return i(l)?{name:s,entry:l}:{name:s,version:l||a}}else if(o.length===1){const[s]=o;return n&&i(n)?{name:s,entry:n}:{name:s,version:n||a}}else throw`Invalid entry value: ${t}`},composeKeyWithSeparator=function(...t){return t.length?t.reduce((e,r)=>r?e?`${e}${SEPARATOR}${r}`:r:e,""):""},encodeName=function(t,e="",r=!1){try{const o=r?".js":"";return`${e}${t.replace(new RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(new RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(new RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${o}`}catch(o){throw o}},decodeName=function(t,e,r){try{let o=t;if(e){if(!o.startsWith(e))return o;o=o.replace(new RegExp(e,"g"),"")}return o=o.replace(new RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),r&&(o=o.replace(".js","")),o}catch(o){throw o}},generateExposeFilename=(t,e)=>{if(!t)return"";let r=t;return r==="."&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),encodeName(r,"__federation_expose_",e)},generateShareFilename=(t,e)=>t?encodeName(t,"__federation_shared_",e):"",getResourceUrl=(t,e)=>{if("getPublicPath"in t){let r;return t.getPublicPath.startsWith("function")?r=new Function("return "+t.getPublicPath)()():r=new Function(t.getPublicPath)(),`${r}${e}`}else return"publicPath"in t?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in t?`${t.ssrPublicPath}${e}`:`${t.publicPath}${e}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",t,e),"")},assert$1=(t,e)=>{t||error$1(e)},error$1=t=>{throw new Error(`${LOG_CATEGORY$1}: ${t}`)},warn$1=t=>{console.warn(`${LOG_CATEGORY$1}: ${t}`)};function safeToString(t){try{return JSON.stringify(t,null,2)}catch{return""}}const VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(t){return VERSION_PATTERN_REGEXP.test(t)}const simpleJoinRemoteEntry=(t,e)=>{if(!t)return e;const o=(n=>{if(n===".")return"";if(n.startsWith("./"))return n.replace("./","");if(n.startsWith("/")){const a=n.slice(1);return a.endsWith("/")?a.slice(0,-1):a}return n})(t);return o?o.endsWith("/")?`${o}${e}`:`${o}/${e}`:e};function inferAutoPublicPath(t){return t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(t,e={}){var S,b,I;const{remotes:r={},overrides:o={},version:n}=e;let a;const i=()=>"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&n?inferAutoPublicPath(n):t.metaData.publicPath:t.metaData.getPublicPath,s=Object.keys(o);let c={};Object.keys(r).length||(c=((S=t.remotes)==null?void 0:S.reduce((E,R)=>{let T;const $=R.federationContainerName;return s.includes($)?T=o[$]:"version"in R?T=R.version:T=R.entry,E[$]={matchedVersion:T},E},{}))||{}),Object.keys(r).forEach(E=>c[E]={matchedVersion:s.includes(E)?o[E]:r[E]});const{remoteEntry:{path:l,name:d,type:u},types:h={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:m},globalName:_,ssrRemoteEntry:g}=t.metaData,{exposes:p}=t;let y={version:n||"",buildVersion:m,globalName:_,remoteEntry:simpleJoinRemoteEntry(l,d),remoteEntryType:u,remoteTypes:simpleJoinRemoteEntry(h.path,h.name),remoteTypesZip:h.zip||"",remoteTypesAPI:h.api||"",remotesInfo:c,shared:t==null?void 0:t.shared.map(E=>({assets:E.assets,sharedName:E.name,version:E.version})),modules:p==null?void 0:p.map(E=>({moduleName:E.name,modulePath:E.path,assets:E.assets}))};if((b=t.metaData)!=null&&b.prefetchInterface){const E=t.metaData.prefetchInterface;y={...y,prefetchInterface:E}}if((I=t.metaData)!=null&&I.prefetchEntry){const{path:E,name:R,type:T}=t.metaData.prefetchEntry;y={...y,prefetchEntry:simpleJoinRemoteEntry(E,R),prefetchEntryType:T}}if("publicPath"in t.metaData?a={...y,publicPath:i(),ssrPublicPath:t.metaData.ssrPublicPath}:a={...y,getPublicPath:i()},g){const E=simpleJoinRemoteEntry(g.path,g.name);a.ssrRemoteEntry=E,a.ssrRemoteEntryType=g.type||"commonjs-module"}return a}function isManifestProvider(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(MANIFEST_EXT))}function getManifestFileName(t){if(!t)return{statsFileName:StatsFileName,manifestFileName:ManifestFileName};let e=typeof t=="boolean"?"":t.filePath||"",r=typeof t=="boolean"?"":t.fileName||"";const o=".json",n=c=>c.endsWith(o)?c:`${c}${o}`,a=(c,l)=>c.replace(o,`${l}${o}`),i=r?n(r):ManifestFileName,s=r?a(i,"-stats"):StatsFileName;return{statsFileName:simpleJoinRemoteEntry(e,s),manifestFileName:simpleJoinRemoteEntry(e,i)}}const PREFIX="[ Module Federation ]",DEFAULT_DELEGATE=console,LOGGER_STACK_SKIP_TOKENS=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function captureStackTrace(){try{const t=new Error().stack;if(!t)return;const[,...e]=t.split(`
2
+ `),r=e.filter(n=>!LOGGER_STACK_SKIP_TOKENS.some(a=>n.includes(a)));return r.length?`Stack trace:
3
+ ${r.slice(0,5).join(`
4
+ `)}`:void 0}catch{return}}class Logger{constructor(e,r=DEFAULT_DELEGATE){this.prefix=e,this.delegate=r??DEFAULT_DELEGATE}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??DEFAULT_DELEGATE}emit(e,r){const o=this.delegate,a=isDebugMode()?captureStackTrace():void 0,i=a?[...r,a]:r,s=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];case"debug":default:return["debug","log"]}})();for(const c of s){const l=o[c];if(typeof l=="function"){l.call(o,this.prefix,...i);return}}for(const c of s){const l=DEFAULT_DELEGATE[c];if(typeof l=="function"){l.call(DEFAULT_DELEGATE,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){isDebugMode()&&this.emit("debug",e)}}function createLogger(t){return new Logger(t)}function createInfrastructureLogger(t){const e=new Logger(t);return Object.defineProperty(e,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),e}function bindLoggerToCompiler(t,e,r){if(t.__mf_infrastructure_logger__&&e!=null&&e.getInfrastructureLogger)try{const o=e.getInfrastructureLogger(r);o&&typeof o=="object"&&(typeof o.log=="function"||typeof o.info=="function"||typeof o.warn=="function"||typeof o.error=="function")&&t.setDelegate(o)}catch{t.setDelegate(void 0)}}const logger$1=createLogger(PREFIX),infrastructureLogger=createInfrastructureLogger(PREFIX);async function safeWrapper$1(t,e){try{return await t()}catch(r){!e&&warn$1(r);return}}function isStaticResourcesEqual$1(t,e){const r=/^(https?:)?\/\//i,o=t.replace(r,"").replace(/\/$/,""),n=e.replace(r,"").replace(/\/$/,"");return o===n}function createScript(t){let e=null,r=!0,o=2e4,n;const a=document.getElementsByTagName("script");for(let s=0;s<a.length;s++){const c=a[s],l=c.getAttribute("src");if(l&&isStaticResourcesEqual$1(l,t.url)){e=c,r=!1;break}}if(!e){const s=t.attrs;e=document.createElement("script"),e.type=(s==null?void 0:s.type)==="module"?"module":"text/javascript";let c;t.createScriptHook&&(c=t.createScriptHook(t.url,t.attrs),c instanceof HTMLScriptElement?e=c:typeof c=="object"&&("script"in c&&c.script&&(e=c.script),"timeout"in c&&c.timeout&&(o=c.timeout))),e.src||(e.src=t.url),s&&!c&&Object.keys(s).forEach(l=>{e&&(l==="async"||l==="defer"?e[l]=s[l]:e.getAttribute(l)||e.setAttribute(l,s[l]))})}const i=async(s,c)=>{clearTimeout(n);const l=()=>{(c==null?void 0:c.type)==="error"?t!=null&&t.onErrorCallback&&(t==null||t.onErrorCallback(c)):t!=null&&t.cb&&(t==null||t.cb())};if(e&&(e.onerror=null,e.onload=null,safeWrapper$1(()=>{const{needDeleteScript:d=!0}=t;d&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),s&&typeof s=="function")){const d=s(c);if(d instanceof Promise){const u=await d;return l(),u}return l(),d}l()};return e.onerror=i.bind(null,e.onerror),e.onload=i.bind(null,e.onload),n=setTimeout(()=>{i(null,new Error(`Remote script "${t.url}" time-outed.`))},o),{script:e,needAttach:r}}function createLink(t){let e=null,r=!0;const o=document.getElementsByTagName("link");for(let a=0;a<o.length;a++){const i=o[a],s=i.getAttribute("href"),c=i.getAttribute("rel");if(s&&isStaticResourcesEqual$1(s,t.url)&&c===t.attrs.rel){e=i,r=!1;break}}if(!e){e=document.createElement("link"),e.setAttribute("href",t.url);let a;const i=t.attrs;t.createLinkHook&&(a=t.createLinkHook(t.url,i),a instanceof HTMLLinkElement&&(e=a)),i&&!a&&Object.keys(i).forEach(s=>{e&&!e.getAttribute(s)&&e.setAttribute(s,i[s])})}const n=(a,i)=>{const s=()=>{(i==null?void 0:i.type)==="error"?t!=null&&t.onErrorCallback&&(t==null||t.onErrorCallback(i)):t!=null&&t.cb&&(t==null||t.cb())};if(e&&(e.onerror=null,e.onload=null,safeWrapper$1(()=>{const{needDeleteLink:c=!0}=t;c&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),a)){const c=a(i);return s(),c}s()};return e.onerror=n.bind(null,e.onerror),e.onload=n.bind(null,e.onload),{link:e,needAttach:r}}function loadScript(t,e){const{attrs:r={},createScriptHook:o}=e;return new Promise((n,a)=>{const{script:i,needAttach:s}=createScript({url:t,cb:n,onErrorCallback:a,attrs:{fetchpriority:"high",...r},createScriptHook:o,needDeleteScript:!0});s&&document.head.appendChild(i)})}const sdkImportCache=new Map;function importNodeModule(t){if(!t)throw new Error("import specifier is required");if(sdkImportCache.has(t))return sdkImportCache.get(t);const r=new Function("name","return import(name)")(t).then(o=>o).catch(o=>{throw console.error(`Error importing module ${t}:`,o),sdkImportCache.delete(t),o});return sdkImportCache.set(t,r),r}const loadNodeFetch=async()=>{const t=await importNodeModule("node-fetch");return t.default||t},lazyLoaderHookFetch=async(t,e,r)=>{const n=await((a,i)=>r.lifecycle.fetch.emit(a,i))(t,e||{});return!n||!(n instanceof Response)?(typeof fetch>"u"?await loadNodeFetch():fetch)(t,e||{}):n},createScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(url,cb,attrs,loaderHook)=>{if(loaderHook!=null&&loaderHook.createScriptHook){const t=loaderHook.createScriptHook(url);t&&typeof t=="object"&&"url"in t&&(url=t.url)}let urlObj;try{urlObj=new URL(url)}catch(t){console.error("Error constructing URL:",t),cb(new Error(`Invalid URL: ${t}`));return}const getFetch=async()=>loaderHook!=null&&loaderHook.fetch?(t,e)=>lazyLoaderHookFetch(t,e,loaderHook):typeof fetch>"u"?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{var t;try{const res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
5
+ })`,{filename,importModuleDynamically:((t=vm.constants)==null?void 0:t.USE_MAIN_CONTEXT_DEFAULT_LOADER)??importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){const e=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,e);return}cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:new Error(`Script execution error: ${e}`))}};getFetch().then(async t=>{if((attrs==null?void 0:attrs.type)==="esm"||(attrs==null?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:t,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:new Error(`Script execution error: ${e}`))});handleScriptFetch(t,urlObj)}).catch(t=>{cb(t)})}:(t,e,r,o)=>{e(new Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(t,e)=>new Promise((r,o)=>{createScriptNode(t,(n,a)=>{var i,s;if(n)o(n);else{const c=((i=e==null?void 0:e.attrs)==null?void 0:i.globalName)||`__FEDERATION_${(s=e==null?void 0:e.attrs)==null?void 0:s.name}:custom__`,l=globalThis[c]=a;r(l)}},e.attrs,e.loaderHook)}):(t,e)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(t,e){if(esmModuleCache.has(t))return esmModuleCache.get(t);const{fetch:r,vm:o}=e,a=await(await r(t)).text(),i=new o.SourceTextModule(a,{importModuleDynamically:async(s,c)=>{const l=new URL(s,t).href;return loadModule(l,e)}});return esmModuleCache.set(t,i),await i.link(async s=>{const c=new URL(s,t).href;return await loadModule(c,e)}),i}function normalizeOptions(t,e,r){return function(o){if(o===!1)return!1;if(typeof o>"u")return t?e:!1;if(o===!0)return e;if(o&&typeof o=="object")return{...e,...o};throw new Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof o}`)}}const createModuleFederationConfig=t=>t;index_cjs$1.BROWSER_LOG_KEY=BROWSER_LOG_KEY;index_cjs$1.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX;index_cjs$1.EncodedNameTransformMap=EncodedNameTransformMap;index_cjs$1.FederationModuleManifest=FederationModuleManifest;index_cjs$1.MANIFEST_EXT=MANIFEST_EXT;index_cjs$1.MFModuleType=MFModuleType;index_cjs$1.MFPrefetchCommon=MFPrefetchCommon;index_cjs$1.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER;index_cjs$1.ManifestFileName=ManifestFileName;index_cjs$1.NameTransformMap=NameTransformMap;index_cjs$1.NameTransformSymbol=NameTransformSymbol;index_cjs$1.SEPARATOR=SEPARATOR;index_cjs$1.StatsFileName=StatsFileName;index_cjs$1.TEMP_DIR=TEMP_DIR;index_cjs$1.assert=assert$1;index_cjs$1.bindLoggerToCompiler=bindLoggerToCompiler;index_cjs$1.composeKeyWithSeparator=composeKeyWithSeparator;index_cjs$1.containerPlugin=ContainerPlugin;index_cjs$1.containerReferencePlugin=ContainerReferencePlugin;index_cjs$1.createInfrastructureLogger=createInfrastructureLogger;index_cjs$1.createLink=createLink;index_cjs$1.createLogger=createLogger;index_cjs$1.createModuleFederationConfig=createModuleFederationConfig;index_cjs$1.createScript=createScript;index_cjs$1.createScriptNode=createScriptNode;index_cjs$1.decodeName=decodeName;index_cjs$1.encodeName=encodeName;index_cjs$1.error=error$1;index_cjs$1.generateExposeFilename=generateExposeFilename;index_cjs$1.generateShareFilename=generateShareFilename;index_cjs$1.generateSnapshotFromManifest=generateSnapshotFromManifest;index_cjs$1.getManifestFileName=getManifestFileName;index_cjs$1.getProcessEnv=getProcessEnv;index_cjs$1.getResourceUrl=getResourceUrl;index_cjs$1.inferAutoPublicPath=inferAutoPublicPath;index_cjs$1.infrastructureLogger=infrastructureLogger;index_cjs$1.isBrowserEnv=isBrowserEnv;index_cjs$1.isDebugMode=isDebugMode;index_cjs$1.isManifestProvider=isManifestProvider;index_cjs$1.isReactNativeEnv=isReactNativeEnv;index_cjs$1.isRequiredVersion=isRequiredVersion;index_cjs$1.isStaticResourcesEqual=isStaticResourcesEqual$1;index_cjs$1.loadScript=loadScript;index_cjs$1.loadScriptNode=loadScriptNode;index_cjs$1.logger=logger$1;index_cjs$1.moduleFederationPlugin=ModuleFederationPlugin;index_cjs$1.normalizeOptions=normalizeOptions;index_cjs$1.parseEntry=parseEntry;index_cjs$1.safeToString=safeToString;index_cjs$1.safeWrapper=safeWrapper$1;index_cjs$1.sharePlugin=SharePlugin;index_cjs$1.simpleJoinRemoteEntry=simpleJoinRemoteEntry;index_cjs$1.warn=warn$1;var index_cjs={};const RUNTIME_001="RUNTIME-001",RUNTIME_002="RUNTIME-002",RUNTIME_003="RUNTIME-003",RUNTIME_004="RUNTIME-004",RUNTIME_005="RUNTIME-005",RUNTIME_006="RUNTIME-006",RUNTIME_007="RUNTIME-007",RUNTIME_008="RUNTIME-008",RUNTIME_009="RUNTIME-009",TYPE_001="TYPE-001",BUILD_001="BUILD-001",BUILD_002="BUILD-002",getDocsUrl=t=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t.split("-")[0].toLowerCase()}/${t}`,getShortErrorMsg=(t,e,r,o)=>{const n=[`${[e[t]]} #${t}`];return r&&n.push(`args: ${JSON.stringify(r)}`),n.push(getDocsUrl(t)),o&&n.push(`Original Error Message:
6
+ ${o}`),n.join(`
7
+ `)},runtimeDescMap={[RUNTIME_001]:"Failed to get remoteEntry exports.",[RUNTIME_002]:'The remote entry interface does not contain "init"',[RUNTIME_003]:"Failed to get manifest.",[RUNTIME_004]:"Failed to locate remote.",[RUNTIME_005]:"Invalid loadShareSync function call from bundler runtime",[RUNTIME_006]:"Invalid loadShareSync function call from runtime",[RUNTIME_007]:"Failed to get remote snapshot.",[RUNTIME_008]:"Failed to load script resources.",[RUNTIME_009]:"Please call createInstance first."},typeDescMap={[TYPE_001]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},buildDescMap={[BUILD_001]:"Failed to find expose module.",[BUILD_002]:"PublicPath is required in prod mode."},errorDescMap={...runtimeDescMap,...typeDescMap,...buildDescMap};index_cjs.BUILD_001=BUILD_001;index_cjs.BUILD_002=BUILD_002;index_cjs.RUNTIME_001=RUNTIME_001;index_cjs.RUNTIME_002=RUNTIME_002;index_cjs.RUNTIME_003=RUNTIME_003;index_cjs.RUNTIME_004=RUNTIME_004;index_cjs.RUNTIME_005=RUNTIME_005;index_cjs.RUNTIME_006=RUNTIME_006;index_cjs.RUNTIME_007=RUNTIME_007;index_cjs.RUNTIME_008=RUNTIME_008;index_cjs.RUNTIME_009=RUNTIME_009;index_cjs.TYPE_001=TYPE_001;index_cjs.buildDescMap=buildDescMap;index_cjs.errorDescMap=errorDescMap;index_cjs.getShortErrorMsg=getShortErrorMsg;index_cjs.runtimeDescMap=runtimeDescMap;index_cjs.typeDescMap=typeDescMap;var sdk=index_cjs$1,errorCodes$1=index_cjs;const LOG_CATEGORY="[ Federation Runtime ]",logger=sdk.createLogger(LOG_CATEGORY);function assert(t,e){t||error(e)}function error(t){throw t instanceof Error?(t.message.startsWith(LOG_CATEGORY)||(t.message=`${LOG_CATEGORY}: ${t.message}`),t):new Error(`${LOG_CATEGORY}: ${t}`)}function warn(t){t instanceof Error&&(t.message.startsWith(LOG_CATEGORY)||(t.message=`${LOG_CATEGORY}: ${t.message}`)),logger.warn(t)}function addUniqueItem(t,e){return t.findIndex(r=>r===e)===-1&&t.push(e),t}function getFMId(t){return"version"in t&&t.version?`${t.name}:${t.version}`:"entry"in t&&t.entry?`${t.name}:${t.entry}`:`${t.name}`}function isRemoteInfoWithEntry(t){return typeof t.entry<"u"}function isPureRemoteEntry(t){return!t.entry.includes(".json")}async function safeWrapper(t,e){try{return await t()}catch(r){!e&&warn(r);return}}function isObject(t){return t&&typeof t=="object"}const objectToString=Object.prototype.toString;function isPlainObject(t){return objectToString.call(t)==="[object Object]"}function isStaticResourcesEqual(t,e){const r=/^(https?:)?\/\//i,o=t.replace(r,"").replace(/\/$/,""),n=e.replace(r,"").replace(/\/$/,"");return o===n}function arrayOptions(t){return Array.isArray(t)?t:[t]}function getRemoteEntryInfoFromSnapshot(t){const e={url:"",type:"global",globalName:""};return sdk.isBrowserEnv()||sdk.isReactNativeEnv()?"remoteEntry"in t?{url:t.remoteEntry,type:t.remoteEntryType,globalName:t.globalName}:e:"ssrRemoteEntry"in t?{url:t.ssrRemoteEntry||e.url,type:t.ssrRemoteEntryType||e.type,globalName:t.globalName}:e}const processModuleAlias=(t,e)=>{let r;return t.endsWith("/")?r=t.slice(0,-1):r=t,e.startsWith(".")&&(e=e.slice(1)),r=r+e,r},CurrentGlobal=typeof globalThis=="object"?globalThis:window,nativeGlobal=(()=>{try{return document.defaultView}catch{return CurrentGlobal}})(),Global=nativeGlobal;function definePropertyGlobalVal(t,e,r){Object.defineProperty(t,e,{value:r,configurable:!1,writable:!0})}function includeOwnProperty(t,e){return Object.hasOwnProperty.call(t,e)}includeOwnProperty(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__")||definePropertyGlobalVal(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(t){includeOwnProperty(t,"__VMOK__")&&!includeOwnProperty(t,"__FEDERATION__")&&definePropertyGlobalVal(t,"__FEDERATION__",t.__VMOK__),includeOwnProperty(t,"__FEDERATION__")||(definePropertyGlobalVal(t,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),definePropertyGlobalVal(t,"__VMOK__",t.__FEDERATION__)),t.__FEDERATION__.__GLOBAL_PLUGIN__??=[],t.__FEDERATION__.__INSTANCES__??=[],t.__FEDERATION__.moduleInfo??={},t.__FEDERATION__.__SHARE__??={},t.__FEDERATION__.__MANIFEST_LOADING__??={},t.__FEDERATION__.__PRELOADED_MAP__??=new Map}setGlobalDefaultVal(CurrentGlobal);setGlobalDefaultVal(nativeGlobal);function resetFederationGlobalInfo(){CurrentGlobal.__FEDERATION__.__GLOBAL_PLUGIN__=[],CurrentGlobal.__FEDERATION__.__INSTANCES__=[],CurrentGlobal.__FEDERATION__.moduleInfo={},CurrentGlobal.__FEDERATION__.__SHARE__={},CurrentGlobal.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(globalLoading).forEach(t=>{delete globalLoading[t]})}function setGlobalFederationInstance(t){CurrentGlobal.__FEDERATION__.__INSTANCES__.push(t)}function getGlobalFederationConstructor(){return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function setGlobalFederationConstructor(t,e=sdk.isDebugMode()){e&&(CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__=t,CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.21.6")}function getInfoWithoutType(t,e){if(typeof e=="string"){if(t[e])return{value:t[e],key:e};{const o=Object.keys(t);for(const n of o){const[a,i]=n.split(":"),s=`${a}:${e}`,c=t[s];if(c)return{value:c,key:s}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t),o=getInfoWithoutType(e,r).value;if(o&&!o.version&&"version"in t&&t.version&&(o.version=t.version),o)return o;if("version"in t&&t.version){const{version:n,...a}=t,i=getFMId(a),s=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,i).value;if((s==null?void 0:s.version)===n)return s}},getGlobalSnapshotInfoByModuleInfo=t=>getTargetSnapshotInfoByModuleInfo(t,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t);return nativeGlobal.__FEDERATION__.moduleInfo[r]=e,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=t=>(nativeGlobal.__FEDERATION__.moduleInfo={...nativeGlobal.__FEDERATION__.moduleInfo,...t},()=>{const e=Object.keys(t);for(const r of e)delete nativeGlobal.__FEDERATION__.moduleInfo[r]}),getRemoteEntryExports=(t,e)=>{const r=e||`__FEDERATION_${t}:custom__`,o=CurrentGlobal[r];return{remoteEntryKey:r,entryExports:o}},registerGlobalPlugins=t=>{const{__GLOBAL_PLUGIN__:e}=nativeGlobal.__FEDERATION__;t.forEach(r=>{e.findIndex(o=>o.name===r.name)===-1?e.push(r):warn(`The plugin ${r.name} has been registered.`)})},getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__,getPreloaded=t=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(t),setPreloaded=t=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(t,!0),DEFAULT_SCOPE="default",DEFAULT_REMOTE_TYPE="global",buildIdentifier="[0-9A-Za-z-]+",build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`,numericIdentifier="0|[1-9]\\d*",numericIdentifierLoose="[0-9]+",nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*",preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`,preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`,preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`,preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`,xRangeIdentifier=`${numericIdentifier}|x|X|\\*`,xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`,hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`,mainVersionLoose=`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`,loosePlain=`[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`,gtlt="((?:<|>)?=?)",comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`,loneTilde="(?:~>?)",tildeTrim=`(\\s*)${loneTilde}\\s+`,loneCaret="(?:\\^)",caretTrim=`(\\s*)${loneCaret}\\s+`,star="(<|>)?=?\\s*\\*",caret=`^${loneCaret}${xRangePlain}$`,mainVersion=`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`,fullPlain=`v?${mainVersion}${preRelease}?${build}?`,tilde=`^${loneTilde}${xRangePlain}$`,xRange=`^${gtlt}\\s*${xRangePlain}$`,comparator=`^${gtlt}\\s*(${fullPlain})$|^$`,gte0="^\\s*>=\\s*0.0.0\\s*$";function parseRegex(t){return new RegExp(t)}function isXVersion(t){return!t||t.toLowerCase()==="x"||t==="*"}function pipe(...t){return e=>t.reduce((r,o)=>o(r),e)}function extractComparator(t){return t.match(parseRegex(comparator))}function combineVersion(t,e,r,o){const n=`${t}.${e}.${r}`;return o?`${n}-${o}`:n}function parseHyphen(t){return t.replace(parseRegex(hyphenRange),(e,r,o,n,a,i,s,c,l,d,u,h)=>(isXVersion(o)?r="":isXVersion(n)?r=`>=${o}.0.0`:isXVersion(a)?r=`>=${o}.${n}.0`:r=`>=${r}`,isXVersion(l)?c="":isXVersion(d)?c=`<${Number(l)+1}.0.0-0`:isXVersion(u)?c=`<${l}.${Number(d)+1}.0-0`:h?c=`<=${l}.${d}.${u}-${h}`:c=`<=${c}`,`${r} ${c}`.trim()))}function parseComparatorTrim(t){return t.replace(parseRegex(comparatorTrim),"$1$2$3")}function parseTildeTrim(t){return t.replace(parseRegex(tildeTrim),"$1~")}function parseCaretTrim(t){return t.replace(parseRegex(caretTrim),"$1^")}function parseCarets(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(caret),(r,o,n,a,i)=>isXVersion(o)?"":isXVersion(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:isXVersion(a)?o==="0"?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.0 <${Number(o)+1}.0.0-0`:i?o==="0"?n==="0"?`>=${o}.${n}.${a}-${i} <${o}.${n}.${Number(a)+1}-0`:`>=${o}.${n}.${a}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${a}-${i} <${Number(o)+1}.0.0-0`:o==="0"?n==="0"?`>=${o}.${n}.${a} <${o}.${n}.${Number(a)+1}-0`:`>=${o}.${n}.${a} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${a} <${Number(o)+1}.0.0-0`)).join(" ")}function parseTildes(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(tilde),(r,o,n,a,i)=>isXVersion(o)?"":isXVersion(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:isXVersion(a)?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:i?`>=${o}.${n}.${a}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${a} <${o}.${Number(n)+1}.0-0`)).join(" ")}function parseXRanges(t){return t.split(/\s+/).map(e=>e.trim().replace(parseRegex(xRange),(r,o,n,a,i,s)=>{const c=isXVersion(n),l=c||isXVersion(a),d=l||isXVersion(i);return o==="="&&d&&(o=""),s="",c?o===">"||o==="<"?"<0.0.0-0":"*":o&&d?(l&&(a=0),i=0,o===">"?(o=">=",l?(n=Number(n)+1,a=0,i=0):(a=Number(a)+1,i=0)):o==="<="&&(o="<",l?n=Number(n)+1:a=Number(a)+1),o==="<"&&(s="-0"),`${o+n}.${a}.${i}${s}`):l?`>=${n}.0.0${s} <${Number(n)+1}.0.0-0`:d?`>=${n}.${a}.0${s} <${n}.${Number(a)+1}.0-0`:r})).join(" ")}function parseStar(t){return t.trim().replace(parseRegex(star),"")}function parseGTE0(t){return t.trim().replace(parseRegex(gte0),"")}function compareAtom(t,e){return t=Number(t)||t,e=Number(e)||e,t>e?1:t===e?0:-1}function comparePreRelease(t,e){const{preRelease:r}=t,{preRelease:o}=e;if(r===void 0&&o)return 1;if(r&&o===void 0)return-1;if(r===void 0&&o===void 0)return 0;for(let n=0,a=r.length;n<=a;n++){const i=r[n],s=o[n];if(i!==s)return i===void 0&&s===void 0?0:i?s?compareAtom(i,s):-1:1}return 0}function compareVersion(t,e){return compareAtom(t.major,e.major)||compareAtom(t.minor,e.minor)||compareAtom(t.patch,e.patch)||comparePreRelease(t,e)}function eq(t,e){return t.version===e.version}function compare(t,e){switch(t.operator){case"":case"=":return eq(t,e);case">":return compareVersion(t,e)<0;case">=":return eq(t,e)||compareVersion(t,e)<0;case"<":return compareVersion(t,e)>0;case"<=":return eq(t,e)||compareVersion(t,e)>0;case void 0:return!0;default:return!1}}function parseComparatorString(t){return pipe(parseCarets,parseTildes,parseXRanges,parseStar)(t)}function parseRange(t){return pipe(parseHyphen,parseComparatorTrim,parseTildeTrim,parseCaretTrim)(t.trim()).split(/\s+/).join(" ")}function satisfy(t,e){if(!t)return!1;const r=extractComparator(t);if(!r)return!1;const[,o,,n,a,i,s]=r,c={operator:o,version:combineVersion(n,a,i,s),major:n,minor:a,patch:i,preRelease:s==null?void 0:s.split(".")},l=e.split("||");for(const d of l){const u=d.trim();if(!u||u==="*"||u==="x")return!0;try{const h=parseRange(u);if(!h.trim())return!0;const m=h.split(" ").map(p=>parseComparatorString(p)).join(" ");if(!m.trim())return!0;const _=m.split(/\s+/).map(p=>parseGTE0(p)).filter(Boolean);if(_.length===0)continue;let g=!0;for(const p of _){const y=extractComparator(p);if(!y){g=!1;break}const[,S,,b,I,E,R]=y,T={operator:S,version:combineVersion(b,I,E,R),major:b,minor:I,patch:E,preRelease:R==null?void 0:R.split(".")};if(!compare(T,c)){g=!1;break}}if(g)return!0}catch(h){console.error(`[semver] Error processing range part "${u}":`,h);continue}}return!1}function formatShare(t,e,r,o){let n;return"get"in t?n=t.get:"lib"in t?n=()=>Promise.resolve(t.lib):n=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)}),{deps:[],useIn:[],from:e,loading:null,...t,shareConfig:{requiredVersion:`^${t.version}`,singleton:!1,eager:!1,strictVersion:!1,...t.shareConfig},get:n,loaded:t!=null&&t.loaded||"lib"in t?!0:void 0,version:t.version??"0",scope:Array.isArray(t.scope)?t.scope:[t.scope??"default"],strategy:(t.strategy??o)||"version-first"}}function formatShareConfigs(t,e){const r=e.shared||{},o=e.name,n=Object.keys(r).reduce((i,s)=>{const c=arrayOptions(r[s]);return i[s]=i[s]||[],c.forEach(l=>{i[s].push(formatShare(l,o,s,e.shareStrategy))}),i},{}),a={...t.shared};return Object.keys(n).forEach(i=>{a[i]?n[i].forEach(s=>{a[i].find(l=>l.version===s.version)||a[i].push(s)}):a[i]=n[i]}),{shared:a,shareInfos:n}}function versionLt(t,e){const r=o=>{if(!Number.isNaN(Number(o))){const a=o.split(".");let i=o;for(let s=0;s<3-a.length;s++)i+=".0";return i}return o};return!!satisfy(r(t),`<=${r(e)}`)}const findVersion=(t,e)=>{const r=e||function(o,n){return versionLt(o,n)};return Object.keys(t).reduce((o,n)=>!o||r(o,n)||o==="0"?n:o,0)},isLoaded=t=>!!t.loaded||typeof t.lib=="function",isLoading=t=>!!t.loading;function findSingletonVersionOrderByVersion(t,e,r){const o=t[e][r],n=function(a,i){return!isLoaded(o[a])&&versionLt(a,i)};return findVersion(t[e][r],n)}function findSingletonVersionOrderByLoaded(t,e,r){const o=t[e][r],n=function(a,i){const s=c=>isLoaded(c)||isLoading(c);return s(o[i])?s(o[a])?!!versionLt(a,i):!0:s(o[a])?!1:versionLt(a,i)};return findVersion(t[e][r],n)}function getFindShareFunction(t){return t==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(t,e,r,o){if(!t)return;const{shareConfig:n,scope:a=DEFAULT_SCOPE,strategy:i}=r,s=Array.isArray(a)?a:[a];for(const c of s)if(n&&t[c]&&t[c][e]){const{requiredVersion:l}=n,u=getFindShareFunction(i)(t,c,e),h=()=>{if(n.singleton){if(typeof l=="string"&&!satisfy(u,l)){const g=`Version ${u} from ${u&&t[c][e][u].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${l})`;n.strictVersion?error(g):warn(g)}return t[c][e][u]}else{if(l===!1||l==="*"||satisfy(u,l))return t[c][e][u];for(const[g,p]of Object.entries(t[c][e]))if(satisfy(g,l))return p}},m={shareScopeMap:t,scope:c,pkgName:e,version:u,GlobalFederation:Global.__FEDERATION__,resolver:h};return(o.emit(m)||m).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(t){const{pkgName:e,extraOptions:r,shareInfos:o}=t,n=i=>{if(!i)return;const s={};i.forEach(d=>{s[d.version]=d});const l=findVersion(s,function(d,u){return!isLoaded(s[d])&&versionLt(d,u)});return s[l]},a=(r==null?void 0:r.resolver)??n;return Object.assign({},a(o[e]),r==null?void 0:r.customShareInfo)}function getBuilderId$1(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function matchRemoteWithNameAndExpose(t,e){for(const r of t){const o=e.startsWith(r.name);let n=e.replace(r.name,"");if(o){if(n.startsWith("/")){const s=r.name;return n=`.${n}`,{pkgNameOrAlias:s,expose:n,remote:r}}else if(n==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const a=r.alias&&e.startsWith(r.alias);let i=r.alias&&e.replace(r.alias,"");if(r.alias&&a){if(i&&i.startsWith("/")){const s=r.alias;return i=`.${i}`,{pkgNameOrAlias:s,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function matchRemote(t,e){for(const r of t)if(e===r.name||r.alias&&e===r.alias)return r}function registerPlugins(t,e){const r=getGlobalHostPlugins(),o=[e.hooks,e.remoteHandler.hooks,e.sharedHandler.hooks,e.snapshotHandler.hooks,e.loaderHook,e.bridgeHook];return r.length>0&&r.forEach(n=>{t!=null&&t.find(a=>a.name!==n.name)&&t.push(n)}),t&&t.length>0&&t.forEach(n=>{o.forEach(a=>{a.applyPlugin(n,e)})}),t}const importCallback=".then(callbacks[0]).catch(callbacks[1])";async function loadEsmEntry({entry:t,remoteEntryExports:e}){return new Promise((r,o)=>{try{e?r(e):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${t}")${importCallback}`)([r,o]):import(t).then(r).catch(o)}catch(n){o(n)}})}async function loadSystemJsEntry({entry:t,remoteEntryExports:e}){return new Promise((r,o)=>{try{e?r(e):typeof __system_context__>"u"?System.import(t).then(r).catch(o):new Function("callbacks",`System.import("${t}")${importCallback}`)([r,o])}catch(n){o(n)}})}function handleRemoteEntryLoaded(t,e,r){const{remoteEntryKey:o,entryExports:n}=getRemoteEntryExports(t,e);return assert(n,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_001,errorCodes$1.runtimeDescMap,{remoteName:t,remoteEntryUrl:r,remoteEntryKey:o})),n}async function loadEntryScript({name:t,globalName:e,entry:r,loaderHook:o,getEntryUrl:n}){const{entryExports:a}=getRemoteEntryExports(t,e);if(a)return a;const i=n?n(r):r;return sdk.loadScript(i,{attrs:{},createScriptHook:(s,c)=>{const l=o.lifecycle.createScript.emit({url:s,attrs:c});if(l&&(l instanceof HTMLScriptElement||"script"in l||"timeout"in l))return l}}).then(()=>handleRemoteEntryLoaded(t,e,r)).catch(s=>{throw assert(void 0,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_008,errorCodes$1.runtimeDescMap,{remoteName:t,resourceUrl:r})),s})}async function loadEntryDom({remoteInfo:t,remoteEntryExports:e,loaderHook:r,getEntryUrl:o}){const{entry:n,entryGlobalName:a,name:i,type:s}=t;switch(s){case"esm":case"module":return loadEsmEntry({entry:n,remoteEntryExports:e});case"system":return loadSystemJsEntry({entry:n,remoteEntryExports:e});default:return loadEntryScript({entry:n,globalName:a,name:i,loaderHook:r,getEntryUrl:o})}}async function loadEntryNode({remoteInfo:t,loaderHook:e}){const{entry:r,entryGlobalName:o,name:n,type:a}=t,{entryExports:i}=getRemoteEntryExports(n,o);return i||sdk.loadScriptNode(r,{attrs:{name:n,globalName:o,type:a},loaderHook:{createScriptHook:(s,c={})=>{const l=e.lifecycle.createScript.emit({url:s,attrs:c});if(l&&"url"in l)return l}}}).then(()=>handleRemoteEntryLoaded(n,o,r)).catch(s=>{throw s})}function getRemoteEntryUniqueKey(t){const{entry:e,name:r}=t;return sdk.composeKeyWithSeparator(r,e)}async function getRemoteEntry(t){const{origin:e,remoteEntryExports:r,remoteInfo:o,getEntryUrl:n,_inErrorHandling:a=!1}=t,i=getRemoteEntryUniqueKey(o);if(r)return r;if(!globalLoading[i]){const s=e.remoteHandler.hooks.lifecycle.loadEntry,c=e.loaderHook;globalLoading[i]=s.emit({loaderHook:c,remoteInfo:o,remoteEntryExports:r}).then(l=>l||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":sdk.isBrowserEnv())?loadEntryDom({remoteInfo:o,remoteEntryExports:r,loaderHook:c,getEntryUrl:n}):loadEntryNode({remoteInfo:o,loaderHook:c}))).catch(async l=>{const d=getRemoteEntryUniqueKey(o);if(l instanceof Error&&l.message.includes(errorCodes$1.RUNTIME_008)&&!a){const h=_=>getRemoteEntry({..._,_inErrorHandling:!0}),m=await e.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:h,origin:e,remoteInfo:o,remoteEntryExports:r,globalLoading,uniqueKey:d});if(m)return m}throw l})}return globalLoading[i]}function getRemoteInfo(t){return{...t,entry:"entry"in t?t.entry:"",type:t.type||DEFAULT_REMOTE_TYPE,entryGlobalName:t.entryGlobalName||t.name,shareScope:t.shareScope||DEFAULT_SCOPE}}function defaultPreloadArgs(t){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...t}}function formatPreloadArgs(t,e){return e.map(r=>{const o=matchRemote(t,r.nameOrAlias);return assert(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&sdk.safeToString({remoteInfo:o,remotes:t})}`),{remote:o,preloadConfig:defaultPreloadArgs(r)}})}function normalizePreloadExposes(t){return t?t.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function preloadAssets(t,e,r,o=!0){const{cssAssets:n,jsAssetsWithoutEntry:a,entryAssets:i}=r;if(e.options.inBrowser){if(i.forEach(s=>{const{moduleInfo:c}=s,l=e.moduleCache.get(t.name);getRemoteEntry(l?{origin:e,remoteInfo:c,remoteEntryExports:l.remoteEntryExports}:{origin:e,remoteInfo:c,remoteEntryExports:void 0})}),o){const s={rel:"preload",as:"style"};n.forEach(c=>{const{link:l,needAttach:d}=sdk.createLink({url:c,cb:()=>{},attrs:s,createLinkHook:(u,h)=>{const m=e.loaderHook.lifecycle.createLink.emit({url:u,attrs:h});if(m instanceof HTMLLinkElement)return m}});d&&document.head.appendChild(l)})}else{const s={rel:"stylesheet",type:"text/css"};n.forEach(c=>{const{link:l,needAttach:d}=sdk.createLink({url:c,cb:()=>{},attrs:s,createLinkHook:(u,h)=>{const m=e.loaderHook.lifecycle.createLink.emit({url:u,attrs:h});if(m instanceof HTMLLinkElement)return m},needDeleteLink:!1});d&&document.head.appendChild(l)})}if(o){const s={rel:"preload",as:"script"};a.forEach(c=>{const{link:l,needAttach:d}=sdk.createLink({url:c,cb:()=>{},attrs:s,createLinkHook:(u,h)=>{const m=e.loaderHook.lifecycle.createLink.emit({url:u,attrs:h});if(m instanceof HTMLLinkElement)return m}});d&&document.head.appendChild(l)})}else{const s={fetchpriority:"high",type:(t==null?void 0:t.type)==="module"?"module":"text/javascript"};a.forEach(c=>{const{script:l,needAttach:d}=sdk.createScript({url:c,cb:()=>{},attrs:s,createScriptHook:(u,h)=>{const m=e.loaderHook.lifecycle.createScript.emit({url:u,attrs:h});if(m instanceof HTMLScriptElement)return m},needDeleteScript:!0});d&&document.head.appendChild(l)})}}}const ShareUtils={getRegisteredShare,getGlobalShareScope},GlobalUtils={Global,nativeGlobal,resetFederationGlobalInfo,setGlobalFederationInstance,getGlobalFederationConstructor,setGlobalFederationConstructor,getInfoWithoutType,getGlobalSnapshot,getTargetSnapshotInfoByModuleInfo,getGlobalSnapshotInfoByModuleInfo,setGlobalSnapshotInfoByModuleInfo,addGlobalSnapshot,getRemoteEntryExports,registerGlobalPlugins,getGlobalHostPlugins,getPreloaded,setPreloaded};var helpers={global:GlobalUtils,share:ShareUtils,utils:{matchRemoteWithNameAndExpose,preloadAssets,getRemoteInfo}};class Module{constructor({remoteInfo:e,host:r}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=r}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;let e;return e=await getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports}),assert(e,`remoteEntryExports is undefined
8
+ ${sdk.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,r,o,n){const{loadFactory:a=!0}=o||{loadFactory:!0},i=await this.getEntry();if(!this.inited){const u=this.host.shareScopeMap,h=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];h.length||h.push("default"),h.forEach(y=>{u[y]||(u[y]={})});const m=u[h[0]],_=[],g={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?h:this.remoteInfo.shareScope||"default"};Object.defineProperty(g,"shareScopeMap",{value:u,enumerable:!1});const p=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:m,remoteEntryInitOptions:g,initScope:_,remoteInfo:this.remoteInfo,origin:this.host});typeof(i==null?void 0:i.init)>"u"&&error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_002,errorCodes$1.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await i.init(p.shareScope,p.initScope,p.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...p,id:e,remoteSnapshot:n,remoteEntryExports:i})}this.lib=i,this.inited=!0;let s;s=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:i,expose:r,moduleInfo:this.remoteInfo}),s||(s=await i.get(r)),assert(s,`${getFMId(this.remoteInfo)} remote don't export ${r}.`);const c=processModuleAlias(this.remoteInfo.name,r),l=this.wraperFactory(s,c);return a?await l():l}wraperFactory(e,r){function o(n,a){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:a,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return o(n,r),n}:()=>{const n=e();return o(n,r),n}}}class SyncHook{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const r=this;this.on(function o(...n){return r.remove(o),e.apply(null,n)})}emit(...e){let r;return this.listeners.size>0&&this.listeners.forEach(o=>{r=o(...e)}),r}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}}class AsyncHook extends SyncHook{emit(...e){let r;const o=Array.from(this.listeners);if(o.length>0){let n=0;const a=i=>i===!1?!1:n<o.length?Promise.resolve(o[n++].apply(null,e)).then(a):i;r=a()}return Promise.resolve(r)}}function checkReturnData(t,e){if(!isObject(e))return!1;if(t!==e){for(const r in t)if(!(r in e))return!1}return!0}class SyncWaterfallHook extends SyncHook{constructor(e){super(),this.onerror=error,this.type=e}emit(e){isObject(e)||error(`The data for the "${this.type}" hook should be an object.`);for(const r of this.listeners)try{const o=r(e);if(checkReturnData(e,o))e=o;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(o){warn(o),this.onerror(o)}return e}}class AsyncWaterfallHook extends SyncHook{constructor(e){super(),this.onerror=error,this.type=e}emit(e){isObject(e)||error(`The response data for the "${this.type}" hook must be an object.`);const r=Array.from(this.listeners);if(r.length>0){let o=0;const n=i=>(warn(i),this.onerror(i),e),a=i=>{if(checkReturnData(e,i)){if(e=i,o<r.length)try{return Promise.resolve(r[o++](e)).then(a,n)}catch(s){return n(s)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(a(e))}return Promise.resolve(e)}}class PluginSystem{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,r){var n;assert(isPlainObject(e),"Plugin configuration is invalid.");const o=e.name;assert(o,"A name must be provided by the plugin."),this.registerPlugins[o]||(this.registerPlugins[o]=e,(n=e.apply)==null||n.call(e,r),Object.keys(this.lifecycle).forEach(a=>{const i=e[a];i&&this.lifecycle[a].on(i)}))}removePlugin(e){assert(e,"A name is required.");const r=this.registerPlugins[e];assert(r,`The plugin "${e}" is not registered.`),Object.keys(r).forEach(o=>{o!=="name"&&this.lifecycle[o].remove(r[o])})}}function assignRemoteInfo(t,e){const r=getRemoteEntryInfoFromSnapshot(e);r.url||error(`The attribute remoteEntry of ${t.name} must not be undefined.`);let o=sdk.getResourceUrl(e,r.url);!sdk.isBrowserEnv()&&!o.startsWith("http")&&(o=`https:${o}`),t.type=r.type,t.entryGlobalName=r.globalName,t.entry=o,t.version=e.version,t.buildVersion=e.buildVersion}function snapshotPlugin(){return{name:"snapshot-plugin",async afterResolve(t){const{remote:e,pkgNameOrAlias:r,expose:o,origin:n,remoteInfo:a,id:i}=t;if(!isRemoteInfoWithEntry(e)||!isPureRemoteEntry(e)){const{remoteSnapshot:s,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:e,id:i});assignRemoteInfo(a,s);const l={remote:e,preloadConfig:{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},d=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:l,remoteInfo:a,remote:e,remoteSnapshot:s,globalSnapshot:c});return d&&preloadAssets(a,n,d,!1),{...t,remoteSnapshot:s}}return t}}}function splitId(t){const e=t.split(":");return e.length===1?{name:e[0],version:void 0}:e.length===2?{name:e[0],version:e[1]}:{name:e[1],version:e[2]}}function traverseModuleInfo(t,e,r,o,n={},a){const i=getFMId(e),{value:s}=getInfoWithoutType(t,i),c=a||s;if(c&&!sdk.isManifestProvider(c)&&(r(c,e,o),c.remotesInfo)){const l=Object.keys(c.remotesInfo);for(const d of l){if(n[d])continue;n[d]=!0;const u=splitId(d),h=c.remotesInfo[d];traverseModuleInfo(t,{name:u.name,version:h.matchedVersion},r,!1,n,void 0)}}}const isExisted=(t,e)=>document.querySelector(`${t}[${t==="link"?"href":"src"}="${e}"]`);function generatePreloadAssets(t,e,r,o,n){const a=[],i=[],s=[],c=new Set,l=new Set,{options:d}=t,{preloadConfig:u}=e,{depsRemote:h}=u;if(traverseModuleInfo(o,r,(p,y,S)=>{var $;let b;if(S)b=u;else if(Array.isArray(h)){const M=h.find(N=>N.nameOrAlias===y.name||N.nameOrAlias===y.alias);if(!M)return;b=defaultPreloadArgs(M)}else if(h===!0)b=u;else return;const I=sdk.getResourceUrl(p,getRemoteEntryInfoFromSnapshot(p).url);I&&s.push({name:y.name,moduleInfo:{name:y.name,entry:I,type:"remoteEntryType"in p?p.remoteEntryType:"global",entryGlobalName:"globalName"in p?p.globalName:y.name,shareScope:"",version:"version"in p?p.version:void 0},url:I});let E="modules"in p?p.modules:[];const R=normalizePreloadExposes(b.exposes);R.length&&"modules"in p&&(E=($=p==null?void 0:p.modules)==null?void 0:$.reduce((M,N)=>((R==null?void 0:R.indexOf(N.moduleName))!==-1&&M.push(N),M),[]));function T(M){const N=M.map(A=>sdk.getResourceUrl(p,A));return b.filter?N.filter(b.filter):N}if(E){const M=E.length;for(let N=0;N<M;N++){const A=E[N],P=`${y.name}/${A.moduleName}`;t.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:A.moduleName==="."?y.name:P,name:y.name,remoteSnapshot:p,preloadConfig:b,remote:y,origin:t}),!getPreloaded(P)&&(b.resourceCategory==="all"?(a.push(...T(A.assets.css.async)),a.push(...T(A.assets.css.sync)),i.push(...T(A.assets.js.async)),i.push(...T(A.assets.js.sync))):(b.resourceCategory="sync")&&(a.push(...T(A.assets.css.sync)),i.push(...T(A.assets.js.sync))),setPreloaded(P))}}},!0,{},n),n.shared&&n.shared.length>0){const p=(y,S)=>{const b=getRegisteredShare(t.shareScopeMap,S.sharedName,y,t.sharedHandler.hooks.lifecycle.resolveShare);b&&typeof b.lib=="function"&&(S.assets.js.sync.forEach(I=>{c.add(I)}),S.assets.css.sync.forEach(I=>{l.add(I)}))};n.shared.forEach(y=>{var E;const S=(E=d.shared)==null?void 0:E[y.sharedName];if(!S)return;const b=y.version?S.find(R=>R.version===y.version):S;if(!b)return;arrayOptions(b).forEach(R=>{p(R,y)})})}const _=i.filter(p=>!c.has(p)&&!isExisted("script",p));return{cssAssets:a.filter(p=>!l.has(p)&&!isExisted("link",p)),jsAssetsWithoutEntry:_,entryAssets:s.filter(p=>!isExisted("script",p.url))}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(t){const{origin:e,preloadOptions:r,remoteInfo:o,remote:n,globalSnapshot:a,remoteSnapshot:i}=t;return sdk.isBrowserEnv()?isRemoteInfoWithEntry(n)&&isPureRemoteEntry(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:o.name,entry:n.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(assignRemoteInfo(o,i),generatePreloadAssets(e,r,o,a,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function getGlobalRemoteInfo(t,e){const r=getGlobalSnapshotInfoByModuleInfo({name:e.name,version:e.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&getInfoWithoutType(r.remotesInfo,t.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:t.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:t.name,version:"version"in t?t.version:void 0})}}class SnapshotHandler{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new PluginSystem({beforeLoadRemoteSnapshot:new AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new AsyncWaterfallHook("loadRemoteSnapshot"),afterLoadSnapshot:new AsyncWaterfallHook("afterLoadSnapshot")}),this.manifestLoading=Global.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:r,expose:o}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let a=getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});a||(a={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},addGlobalSnapshot({[this.HostInstance.options.name]:a})),a&&"remotesInfo"in a&&!getInfoWithoutType(a.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(a.remotesInfo={...a==null?void 0:a.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:i,remoteSnapshot:s,globalSnapshot:c}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:d}=await this.hooks.lifecycle.loadSnapshot.emit({options:n,moduleInfo:e,hostGlobalSnapshot:i,remoteSnapshot:s,globalSnapshot:c});let u,h;if(l)if(sdk.isManifestProvider(l)){const m=sdk.isBrowserEnv()?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||"",_=await this.getManifestJson(m,e,{}),g=setGlobalSnapshotInfoByModuleInfo({...e,entry:m},_);u=_,h=g}else{const{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});u=m,h=d}else if(isRemoteInfoWithEntry(e)){const m=await this.getManifestJson(e.entry,e,{}),_=setGlobalSnapshotInfoByModuleInfo(e,m),{remoteSnapshot:g}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:m,from:"global"});u=g,h=_}else error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_007,errorCodes$1.runtimeDescMap,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(d)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:r,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:h}}getGlobalRemoteInfo(e){return getGlobalRemoteInfo(e,this.HostInstance)}async getManifestJson(e,r,o){const n=async()=>{let i=this.manifestCache.get(e);if(i)return i;try{let s=await this.loaderHook.lifecycle.fetch.emit(e,{});(!s||!(s instanceof Response))&&(s=await fetch(e,{})),i=await s.json()}catch(s){i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:s,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),i||(delete this.manifestLoading[e],error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_003,errorCodes$1.runtimeDescMap,{manifestUrl:e,moduleName:r.name,hostName:this.HostInstance.options.name},`${s}`)))}return assert(i.metaData&&i.exposes&&i.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,i),i},a=async()=>{const i=await n(),s=sdk.generateSnapshotFromManifest(i,{version:e}),{remoteSnapshot:c}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:r,manifestJson:i,remoteSnapshot:s,manifestUrl:e,from:"manifest"});return c};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(i=>i)),this.manifestLoading[e]}}class SharedHandler{constructor(e){this.hooks=new PluginSystem({afterResolve:new AsyncWaterfallHook("afterResolve"),beforeLoadShare:new AsyncWaterfallHook("beforeLoadShare"),loadShare:new AsyncHook,resolveShare:new SyncWaterfallHook("resolveShare"),initContainerShareScopeMap:new SyncWaterfallHook("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,r){const{shareInfos:o,shared:n}=formatShareConfigs(e,r);return Object.keys(o).forEach(i=>{o[i].forEach(c=>{c.scope.forEach(l=>{var u;((u=this.shareScopeMap[l])==null?void 0:u[i])||this.setShared({pkgName:i,lib:c.lib,get:c.get,loaded:c.loaded||!!c.lib,shared:c,from:r.name})})})}),{shareInfos:o,shared:n}}async loadShare(e,r){const{host:o}=this,n=getTargetSharedOptions({pkgName:e,extraOptions:r,shareInfos:o.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async l=>{await Promise.all(this.initializeSharing(l,{strategy:n.strategy}))}));const a=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:o.options.shared,origin:o}),{shareInfo:i}=a;assert(i,`Cannot find ${e} Share in the ${o.options.name}. Please ensure that the ${e} Share parameters have been injected`);const s=getRegisteredShare(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare),c=l=>{l.useIn||(l.useIn=[]),addUniqueItem(l.useIn,o.options.name)};if(s&&s.lib)return c(s),s.lib;if(s&&s.loading&&!s.loaded){const l=await s.loading;return s.loaded=!0,s.lib||(s.lib=l),c(s),l}else if(s){const d=(async()=>{const u=await s.get();return c(s),s.loaded=!0,s.lib=u,u})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:o.options.name,lib:null,loading:d}),d}else{if(r!=null&&r.customShareInfo)return!1;const d=(async()=>{const u=await i.get();i.lib=u,i.loaded=!0,c(i);const h=getRegisteredShare(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare);return h&&(h.lib=u,h.loaded=!0,h.from=i.from),u})();return this.setShared({pkgName:e,loaded:!1,shared:i,from:o.options.name,lib:null,loading:d}),d}}initializeSharing(e=DEFAULT_SCOPE,r){const{host:o}=this,n=r==null?void 0:r.from,a=r==null?void 0:r.strategy;let i=r==null?void 0:r.initScope;const s=[];if(n!=="build"){const{initTokens:_}=this;i||(i=[]);let g=_[e];if(g||(g=_[e]={from:this.host.name}),i.indexOf(g)>=0)return s;i.push(g)}const c=this.shareScopeMap,l=o.options.name;c[e]||(c[e]={});const d=c[e],u=(_,g)=>{var E;const{version:p,eager:y}=g;d[_]=d[_]||{};const S=d[_],b=S[p],I=!!(b&&(b.eager||(E=b.shareConfig)!=null&&E.eager));(!b||b.strategy!=="loaded-first"&&!b.loaded&&(!y!=!I?y:l>b.from))&&(S[p]=g)},h=_=>_&&_.init&&_.init(c[e],i),m=async _=>{const{module:g}=await o.remoteHandler.getRemoteModuleAndOptions({id:_});if(g.getEntry){let p;try{p=await g.getEntry()}catch(y){p=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:_,error:y,from:"runtime",lifecycle:"beforeLoadShare",origin:o})}g.inited||(await h(p),g.inited=!0)}};return Object.keys(o.options.shared).forEach(_=>{o.options.shared[_].forEach(p=>{p.scope.includes(e)&&u(_,p)})}),(o.options.shareStrategy==="version-first"||a==="version-first")&&o.options.remotes.forEach(_=>{_.shareScope===e&&s.push(m(_.name))}),s}loadShareSync(e,r){const{host:o}=this,n=getTargetSharedOptions({pkgName:e,extraOptions:r,shareInfos:o.options.shared});n!=null&&n.scope&&n.scope.forEach(s=>{this.initializeSharing(s,{strategy:n.strategy})});const a=getRegisteredShare(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare),i=s=>{s.useIn||(s.useIn=[]),addUniqueItem(s.useIn,o.options.name)};if(a){if(typeof a.lib=="function")return i(a),a.loaded||(a.loaded=!0,a.from===o.options.name&&(n.loaded=!0)),a.lib;if(typeof a.get=="function"){const s=a.get();if(!(s instanceof Promise))return i(a),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:s,shared:a}),s}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const s=n.get();if(s instanceof Promise){const c=(r==null?void 0:r.from)==="build"?errorCodes$1.RUNTIME_005:errorCodes$1.RUNTIME_006;throw new Error(errorCodes$1.getShortErrorMsg(c,errorCodes$1.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}return n.lib=s,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:n.lib,shared:n}),n.lib}throw new Error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_006,errorCodes$1.runtimeDescMap,{hostName:o.options.name,sharedPkgName:e}))}initShareScopeMap(e,r,o={}){const{host:n}=this;this.shareScopeMap[e]=r,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:r,options:n.options,origin:n,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:r,from:o,lib:n,loading:a,loaded:i,get:s}){const{version:c,scope:l="default",...d}=r;(Array.isArray(l)?l:[l]).forEach(h=>{if(this.shareScopeMap[h]||(this.shareScopeMap[h]={}),this.shareScopeMap[h][e]||(this.shareScopeMap[h][e]={}),!this.shareScopeMap[h][e][c]){this.shareScopeMap[h][e][c]={version:c,scope:[h],...d,lib:n,loaded:i,loading:a},s&&(this.shareScopeMap[h][e][c].get=s);return}const m=this.shareScopeMap[h][e][c];a&&!m.loading&&(m.loading=a),i&&!m.loaded&&(m.loaded=i),o&&m.from!==o&&(m.from=o)})}_setGlobalShareScopeMap(e){const r=getGlobalShareScope(),o=e.id||e.name;o&&!r[o]&&(r[o]=this.shareScopeMap)}}class RemoteHandler{constructor(e){this.hooks=new PluginSystem({beforeRegisterRemote:new SyncWaterfallHook("beforeRegisterRemote"),registerRemote:new SyncWaterfallHook("registerRemote"),beforeRequest:new AsyncWaterfallHook("beforeRequest"),onLoad:new AsyncHook("onLoad"),handlePreloadModule:new SyncHook("handlePreloadModule"),errorLoadRemote:new AsyncHook("errorLoadRemote"),beforePreloadRemote:new AsyncHook("beforePreloadRemote"),generatePreloadAssets:new AsyncHook("generatePreloadAssets"),afterPreloadRemote:new AsyncHook,loadEntry:new AsyncHook}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,r){return(r.remotes||[]).reduce((n,a)=>(this.registerRemote(a,n,{force:!1}),n),e.remotes)}setIdToRemoteMap(e,r){const{remote:o,expose:n}=r,{name:a,alias:i}=o;if(this.idToRemoteMap[e]={name:o.name,expose:n},i&&e.startsWith(a)){const s=e.replace(a,i);this.idToRemoteMap[s]={name:o.name,expose:n};return}if(i&&e.startsWith(i)){const s=e.replace(i,a);this.idToRemoteMap[s]={name:o.name,expose:n}}}async loadRemote(e,r){const{host:o}=this;try{const{loadFactory:n=!0}=r||{loadFactory:!0},{module:a,moduleOptions:i,remoteMatchInfo:s}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:c,remote:l,expose:d,id:u,remoteSnapshot:h}=s,m=await a.get(u,d,r,h),_=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:c,expose:d,exposeModule:n?m:void 0,exposeModuleFactory:n?void 0:m,remote:l,options:i,moduleInstance:a,origin:o});return this.setIdToRemoteMap(e,s),typeof _=="function"?_:m}catch(n){const{from:a="runtime"}=r||{from:"runtime"},i=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:a,lifecycle:"onLoad",origin:o});if(!i)throw n;return i}}async preloadRemote(e){const{host:r}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:r.options,origin:r});const o=formatPreloadArgs(r.options.remotes,e);await Promise.all(o.map(async n=>{const{remote:a}=n,i=getRemoteInfo(a),{globalSnapshot:s,remoteSnapshot:c}=await r.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:a}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:r,preloadOptions:n,remote:a,remoteInfo:i,globalSnapshot:s,remoteSnapshot:c});l&&preloadAssets(i,r,l)}))}registerRemotes(e,r){const{host:o}=this;e.forEach(n=>{this.registerRemote(n,o.options.remotes,{force:r==null?void 0:r.force})})}async getRemoteModuleAndOptions(e){const{host:r}=this,{id:o}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:r.options,origin:r})}catch(_){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:r.options,origin:r,from:"runtime",error:_,lifecycle:"beforeRequest"}),!n)throw _}const{id:a}=n,i=matchRemoteWithNameAndExpose(r.options.remotes,a);assert(i,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_004,errorCodes$1.runtimeDescMap,{hostName:r.options.name,requestId:a}));const{remote:s}=i,c=getRemoteInfo(s),l=await r.sharedHandler.hooks.lifecycle.afterResolve.emit({id:a,...i,options:r.options,origin:r,remoteInfo:c}),{remote:d,expose:u}=l;assert(d&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let h=r.moduleCache.get(d.name);const m={host:r,remoteInfo:c};return h||(h=new Module(m),r.moduleCache.set(d.name,h)),{module:h,moduleOptions:m,remoteMatchInfo:l}}registerRemote(e,r,o){const{host:n}=this,a=()=>{if(e.alias){const s=r.find(c=>{var l;return e.alias&&(c.name.startsWith(e.alias)||((l=c.alias)==null?void 0:l.startsWith(e.alias)))});assert(!s,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${s&&s.name} name or alias`)}"entry"in e&&sdk.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=DEFAULT_SCOPE),e.type||(e.type=DEFAULT_REMOTE_TYPE)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const i=r.find(s=>s.name===e.name);if(!i)a(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});else{const s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o!=null&&o.force&&(this.removeRemote(i),a(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),sdk.warn(s.join(" ")))}}removeRemote(e){var r;try{const{host:o}=this,{name:n}=e,a=o.options.remotes.findIndex(s=>s.name===n);a!==-1&&o.options.remotes.splice(a,1);const i=o.moduleCache.get(e.name);if(i){const s=i.remoteInfo,c=s.entryGlobalName;CurrentGlobal[c]&&((r=Object.getOwnPropertyDescriptor(CurrentGlobal,c))!=null&&r.configurable?delete CurrentGlobal[c]:CurrentGlobal[c]=void 0);const l=getRemoteEntryUniqueKey(i.remoteInfo);globalLoading[l]&&delete globalLoading[l],o.snapshotHandler.manifestCache.delete(s.entry);let d=s.buildVersion?sdk.composeKeyWithSeparator(s.name,s.buildVersion):s.name;const u=CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex(m=>s.buildVersion?m.options.id===d:m.name===d);if(u!==-1){const m=CurrentGlobal.__FEDERATION__.__INSTANCES__[u];d=m.options.id||d;const _=getGlobalShareScope();let g=!0;const p=[];Object.keys(_).forEach(y=>{const S=_[y];S&&Object.keys(S).forEach(b=>{const I=S[b];I&&Object.keys(I).forEach(E=>{const R=I[E];R&&Object.keys(R).forEach(T=>{const $=R[T];$&&typeof $=="object"&&$.from===s.name&&($.loaded||$.loading?($.useIn=$.useIn.filter(M=>M!==s.name),$.useIn.length?g=!1:p.push([y,b,E,T])):p.push([y,b,E,T]))})})})}),g&&(m.shareScopeMap={},delete _[d]),p.forEach(([y,S,b,I])=>{var E,R,T;(T=(R=(E=_[y])==null?void 0:E[S])==null?void 0:R[b])==null||delete T[I]}),CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(u,1)}const{hostGlobalSnapshot:h}=getGlobalRemoteInfo(e,o);if(h){const m=h&&"remotesInfo"in h&&h.remotesInfo&&getInfoWithoutType(h.remotesInfo,e.name).key;m&&(delete h.remotesInfo[m],Global.__FEDERATION__.__MANIFEST_LOADING__[m]&&delete Global.__FEDERATION__.__MANIFEST_LOADING__[m])}o.moduleCache.delete(e.name)}}catch(o){logger.log("removeRemote fail: ",o)}}}const USE_SNAPSHOT=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;class ModuleFederation{constructor(e){this.hooks=new PluginSystem({beforeInit:new SyncWaterfallHook("beforeInit"),init:new SyncHook,beforeInitContainer:new AsyncWaterfallHook("beforeInitContainer"),initContainer:new AsyncWaterfallHook("initContainer")}),this.version="0.21.6",this.moduleCache=new Map,this.loaderHook=new PluginSystem({getModuleInfo:new SyncHook,createScript:new SyncHook,createLink:new SyncHook,fetch:new AsyncHook,loadEntryError:new AsyncHook,getModuleFactory:new AsyncHook}),this.bridgeHook=new PluginSystem({beforeBridgeRender:new SyncHook,afterBridgeRender:new SyncHook,beforeBridgeDestroy:new SyncHook,afterBridgeDestroy:new SyncHook});const r=USE_SNAPSHOT?[snapshotPlugin(),generatePreloadAssetsPlugin()]:[],o={id:getBuilderId$1(),name:e.name,plugins:r,remotes:[],shared:{},inBrowser:sdk.isBrowserEnv()};this.name=e.name,this.options=o,this.snapshotHandler=new SnapshotHandler(this),this.sharedHandler=new SharedHandler(this),this.remoteHandler=new RemoteHandler(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}initOptions(e){this.registerPlugins(e.plugins);const r=this.formatOptions(this.options,e);return this.options=r,r}async loadShare(e,r){return this.sharedHandler.loadShare(e,r)}loadShareSync(e,r){return this.sharedHandler.loadShareSync(e,r)}initializeSharing(e=DEFAULT_SCOPE,r){return this.sharedHandler.initializeSharing(e,r)}initRawContainer(e,r,o){const n=getRemoteInfo({name:e,entry:r}),a=new Module({host:this,remoteInfo:n});return a.remoteEntryExports=o,this.moduleCache.set(e,a),a}async loadRemote(e,r){return this.remoteHandler.loadRemote(e,r)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,r,o={}){this.sharedHandler.initShareScopeMap(e,r,o)}formatOptions(e,r){const{shared:o}=formatShareConfigs(e,r),{userOptions:n,options:a}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:r,options:e,shareInfo:o}),i=this.remoteHandler.formatAndRegisterRemote(a,n),{shared:s}=this.sharedHandler.registerShared(a,n),c=[...a.plugins];n.plugins&&n.plugins.forEach(d=>{c.includes(d)||c.push(d)});const l={...e,...r,plugins:c,remotes:i,shared:s};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){const r=registerPlugins(e,this);this.options.plugins=this.options.plugins.reduce((o,n)=>(n&&o&&!o.find(a=>a.name===n.name)&&o.push(n),o),r||[])}registerRemotes(e,r){return this.remoteHandler.registerRemotes(e,r)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}}var index=Object.freeze({__proto__:null});index_cjs$2.loadScript=sdk.loadScript;index_cjs$2.loadScriptNode=sdk.loadScriptNode;index_cjs$2.CurrentGlobal=CurrentGlobal;index_cjs$2.Global=Global;index_cjs$2.Module=Module;index_cjs$2.ModuleFederation=ModuleFederation;index_cjs$2.addGlobalSnapshot=addGlobalSnapshot;index_cjs$2.assert=assert;index_cjs$2.getGlobalFederationConstructor=getGlobalFederationConstructor;index_cjs$2.getGlobalSnapshot=getGlobalSnapshot;index_cjs$2.getInfoWithoutType=getInfoWithoutType;index_cjs$2.getRegisteredShare=getRegisteredShare;index_cjs$2.getRemoteEntry=getRemoteEntry;index_cjs$2.getRemoteInfo=getRemoteInfo;index_cjs$2.helpers=helpers;index_cjs$2.isStaticResourcesEqual=isStaticResourcesEqual;index_cjs$2.matchRemoteWithNameAndExpose=matchRemoteWithNameAndExpose;index_cjs$2.registerGlobalPlugins=registerGlobalPlugins;index_cjs$2.resetFederationGlobalInfo=resetFederationGlobalInfo;index_cjs$2.safeWrapper=safeWrapper;index_cjs$2.satisfy=satisfy;index_cjs$2.setGlobalFederationConstructor=setGlobalFederationConstructor;index_cjs$2.setGlobalFederationInstance=setGlobalFederationInstance;index_cjs$2.types=index;var utils_cjs={},runtimeCore$1=index_cjs$2;function getBuilderId(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function getGlobalFederationInstance(t,e){const r=getBuilderId();return runtimeCore$1.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(o=>!!(r&&o.options.id===r||o.options.name===t&&!o.options.version&&!e||o.options.name===t&&e&&o.options.version===e))}utils_cjs.getGlobalFederationInstance=getGlobalFederationInstance;var runtimeCore=index_cjs$2,errorCodes=index_cjs,utils=utils_cjs;function createInstance(t){const e=runtimeCore.getGlobalFederationConstructor()||runtimeCore.ModuleFederation,r=new e(t);return runtimeCore.setGlobalFederationInstance(r),r}let FederationInstance=null;function init(t){const e=utils.getGlobalFederationInstance(t.name,t.version);return e?(e.initOptions(t),FederationInstance||(FederationInstance=e),e):(FederationInstance=createInstance(t),FederationInstance)}function loadRemote(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.loadRemote.apply(FederationInstance,t)}function registerRemotes(...t){return runtimeCore.assert(FederationInstance,errorCodes.getShortErrorMsg(errorCodes.RUNTIME_009,errorCodes.runtimeDescMap)),FederationInstance.registerRemotes.apply(FederationInstance,t)}runtimeCore.setGlobalFederationConstructor(runtimeCore.ModuleFederation);runtimeCore.Module;runtimeCore.ModuleFederation;runtimeCore.getRemoteEntry;runtimeCore.getRemoteInfo;runtimeCore.loadScript;runtimeCore.loadScriptNode;runtimeCore.registerGlobalPlugins;var init_1=init,loadRemote_1=loadRemote,registerRemotes_1=registerRemotes;const globalKey="__mf_init____mf__virtual/iobroker_javascript__mf_v__runtimeInit__mf_v__.js__";if(!globalThis[globalKey]){let t,e;const r=new Promise((o,n)=>{t=o,e=n});globalThis[globalKey]={initPromise:r,initResolve:t,initReject:e}}var iobroker_javascript__mf_v__runtimeInit__mf_v__=globalThis[globalKey];export{iobroker_javascript__mf_v__runtimeInit__mf_v__ as a,init_1 as i,loadRemote_1 as l,registerRemotes_1 as r};
@@ -0,0 +1 @@
1
+ import"./iobroker_javascript__loadShare__react__loadShare__-6sH5wUl6.js";import{u as t,T as m,F as s}from"./createSvgIcon-XLoRKyxt.js";function r(){const e=t(s);return e[m]||e}export{r as u};