@myop/sdk 0.3.27 → 0.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled-declarations.d.ts +2 -0
- package/dist/cjs/{_IframeSDK.c817b148.js → _IframeSDK.7c201b5c.js} +4 -1
- package/dist/cjs/_IframeSDK.7c201b5c.js.map +7 -0
- package/dist/cjs/{_IframeSDK.dd678e0d.min.js → _IframeSDK.7cd7468c.min.js} +1 -1
- package/dist/cjs/{_MyopHelpers.859b9bc8.js → _MyopHelpers.3eeac406.js} +3 -0
- package/dist/cjs/{_MyopHelpers.859b9bc8.js.map → _MyopHelpers.3eeac406.js.map} +2 -2
- package/dist/cjs/{_MyopHelpers.6fb8c382.min.js → _MyopHelpers.e8e1216b.min.js} +1 -1
- package/dist/cjs/{_WebComponentSDK.4cff169e.js → _WebComponentSDK.952f7c87.js} +4 -1
- package/dist/cjs/_WebComponentSDK.952f7c87.js.map +7 -0
- package/dist/cjs/{_WebComponentSDK.c0523c9e.min.js → _WebComponentSDK.ead0b8a6.min.js} +1 -1
- package/dist/cjs/{_hostSDK.0100402a.js → _hostSDK.a73e7b24.js} +4 -1
- package/dist/cjs/_hostSDK.a73e7b24.js.map +7 -0
- package/dist/cjs/{_hostSDK.54316b46.min.js → _hostSDK.a882a5c1.min.js} +1 -1
- package/dist/cjs/myop_sdk.js +14 -14
- package/dist/cjs/myop_sdk.js.map +1 -1
- package/dist/cjs/myop_sdk.min.js +1 -1
- package/dist/cjs-bundled/myop_sdk.bundled.js +5 -2
- package/dist/cjs-bundled/myop_sdk.bundled.js.map +2 -2
- package/dist/cjs-bundled/myop_sdk.bundled.min.js +1 -1
- package/dist/module/Iframe/index.js +5 -2
- package/dist/module/Iframe/index.js.map +2 -2
- package/dist/module/SDK.js +5 -2
- package/dist/module/SDK.js.map +2 -2
- package/dist/module/common/index.d.ts +2 -0
- package/dist/module/common/index.js +1 -1
- package/dist/module/common/index.js.map +2 -2
- package/dist/module/embeddedSDK.js +1 -1
- package/dist/module/helpers/index.js +4 -1
- package/dist/module/helpers/index.js.map +2 -2
- package/dist/module/host/embeddedSDK.js +1 -1
- package/dist/module/host/index.js +5 -2
- package/dist/module/host/index.js.map +2 -2
- package/dist/module/webcomponent/index.js +5 -2
- package/dist/module/webcomponent/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/cjs/_IframeSDK.c817b148.js.map +0 -7
- package/dist/cjs/_WebComponentSDK.4cff169e.js.map +0 -7
- package/dist/cjs/_hostSDK.0100402a.js.map +0 -7
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* The embedded SDK content as a minified JavaScript string.
|
|
6
6
|
* This is the full @myop/sdk bundled for iframe injection.
|
|
7
7
|
*/
|
|
8
|
-
export const EMBEDDED_SDK_CONTENT = `"use strict";var MyopSDK=(()=>{var Xe=Object.defineProperty,ei=Object.defineProperties,ti=Object.getOwnPropertyDescriptor,ni=Object.getOwnPropertyDescriptors,oi=Object.getOwnPropertyNames,Wn=Object.getOwnPropertySymbols;var Fn=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable;var Nt=(o,n,e)=>n in o?Xe(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e,M=(o,n)=>{for(var e in n||(n={}))Fn.call(n,e)&&Nt(o,e,n[e]);if(Wn)for(var e of Wn(n))si.call(n,e)&&Nt(o,e,n[e]);return o},j=(o,n)=>ei(o,ni(n));var m=(o,n)=>()=>(o&&(n=o(o=0)),n);var se=(o,n)=>{for(var e in n)Xe(o,e,{get:n[e],enumerable:!0})},ii=(o,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of oi(n))!Fn.call(o,s)&&s!==e&&Xe(o,s,{get:()=>n[s],enumerable:!(t=ti(n,s))||t.enumerable});return o};var ri=o=>ii(Xe({},"__esModule",{value:!0}),o);var i=(o,n,e)=>Nt(o,typeof n!="symbol"?n+"":n,e);var Ze,et,Ut,N,ie=m(()=>{"use strict";Ze="__federation__",et="onLoad",Ut="moduleInstance",N=(o,n)=>{window[Ze]&&window[Ze][o]&&window[Ze][o][et]&&window[Ze][o][et]({[o]:n})}});var Ce,tt=m(()=>{Ce="0.3.27"});var g,C=m(()=>{"use strict";g={InitRequest:"InitRequest",InitResponse:"InitResponse",InitMessage:"InitMessage",DisposeMessage:"DisposeMessage",ChangeTextMessage:"ChangeTextMessage",BindClickMessage:"BindClickMessage",DetectMyopRefsMessage:"DetectMyopRefsMessage",ExecuteScriptMessage:"ExecuteScriptMessage",AddEventListenerMessage:"AddEventListenerMessage",SetAttributeMessage:"SetAttributeMessage",CreateRefComponentMessage:"CreateRefComponentMessage",EnvelopedMessage:"EnvelopedMessage",GetElementValueMessage:"GetElementValueMessage",GetAttributeMessage:"GetAttributeMessage",SetInnerHtml:"SetInnerHtml",ExecuteComponentMethod:"ExecuteComponentMethod",SetMutationObserverMessage:"SetMutationObserverMessage",SetResizeObserverMessage:"SetResizeObserverMessage",CleanupMessage:"CleanupMessage",In:{DetectedMyopRefsMessage:"DetectedMyopRefsMessage",ClickReplayMessage:"ClickReplayMessage",ExecuteScriptReplyMessage:"ExecuteScriptReplyMessage",EventListenerCallbackMessage:"EventListenerCallbackMessage",ElementValueReplayMessage:"ElementValueReplayMessage",GetAttributeReplayMessage:"GetAttributeReplayMessage",RefComponentCreatedMessage:"RefComponentCreatedMessage",EnvelopedMessage:"EnvelopedMessage",MutationObserverMessage:"MutationObserverMessage",CleanupReplayMessage:"CleanupReplayMessage",ResizeObserverMessage:"ResizeObserverMessage"}}});var E,ai,pi,qt,Vt=m(()=>{"use strict";E=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),ai=o=>{let n=[...o].map(e=>e.toString(16).padStart(2,"0")).join("");return[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20)].join("-")},pi=o=>{let n=o.replace(/-/g,"+").replace(/_/g,"/");for(;n.length%4;)n+="=";let e=atob(n);return Uint8Array.from(e,t=>t.charCodeAt(0))},qt=o=>{let n=pi(o);if(n.length%16!==0)throw new Error("Invalid input length");let e=[];for(let t=0;t<n.length;t+=16)e.push(ai(n.slice(t,t+16)));return e}});var Un,re=m(()=>{"use strict";Vt();Un=o=>new Promise(n=>setTimeout(n,o))});var v,I,jt,_,R,X,H=m(()=>{"use strict";re();v=class{};i(v,"down","down"),i(v,"up","up");I=class{constructor(){i(this,"id",E());i(this,"myop",!0);i(this,"content");i(this,"source");i(this,"destination");i(this,"route");i(this,"ref");i(this,"direction");i(this,"cleanable",!1)}static create(...n){return new this(...n)}isTypeof(n){return n.messageType===this.messageType}},jt=class extends I{constructor(e){super();this.ref=e}},_=class extends I{constructor(e){super();this.replayToHandler=e}},R=class extends I{constructor(e){super();this.handler=e;i(this,"handlerUniqueId",E())}},X=class o{constructor(n,e){this.refConfig=n;this.component=e;i(this,"myop",!0);i(this,"__nonProxied");this.__nonProxied=j(M({},this),{component:null})}static create(n,e,t){let s=e;return s||(s={id:"",name:"",description:"",selectorType:"id-attribute",selector:n,behavior:{type:"code"}}),new o(s,t)}}});var qn,Gt,ae,Vn=m(()=>{"use strict";H();qn="ClickReplayMessage",Gt=class extends R{constructor(e,t){super(t);this.ref=e;i(this,"replyMessageKey",qn);i(this,"messageType","BindClickMessage");i(this,"cleanable",!0)}},ae=class extends _{constructor(){super(...arguments);i(this,"messageType",qn)}}});var Yt,jn=m(()=>{"use strict";H();Yt=class extends I{constructor(e,t){super();this.ref=e;i(this,"messageType","ChangeTextMessage");this.content=t}}});var Gn,di,ci,Yn,k,pe,Qt=m(()=>{"use strict";H();Gn="ExecuteScriptReplyMessage",di=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,ci=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,Yn=o=>{let n=o.match(di);if(n)return n[1]||n[3];{let e=o.match(ci);if(e)return e[1].trim()}},k=class extends R{constructor(e,t=()=>{},s){super(t);this.scriptInputs=s;i(this,"replyMessageKey",Gn);i(this,"messageType","ExecuteScriptMessage");i(this,"script","");this.script=e.toString(),this.content=e.toString(),this.content=Yn(this.content)}};i(k,"replierKey","send"),i(k,"completeStreamKey","completeStream");pe=class extends _{constructor(e,t){super(e);this.replayToHandler=e;this.content=t;i(this,"messageType",Gn)}}});var G,Qn=m(()=>{"use strict";Qt();G=class extends k{constructor(e,t,s=()=>{}){super(({rootRef:r,elementId:a,_script:p,__scriptInputs:d})=>{let c=(r.shadowRoot||r.container).querySelectorAll("[myop-id='".concat(a,"']"));return c.length?(d.ref=c[0],new Function("return (".concat(p,")(...arguments)"))(d)):null},s);this.scriptInputs=t;this.scriptInputs=j(M({},t),{_script:e.toString()})}}});var Jn,Jt,de,Xn=m(()=>{"use strict";H();Jn="EventListenerCallbackMessage",Jt=class extends R{constructor(e,t,s){super(s);this.ref=e;this.type=t;this.handler=s;i(this,"replyMessageKey",Jn);i(this,"messageType","AddEventListenerMessage");i(this,"cleanable",!0);i(this,"serializableSkeleton",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},de=class extends _{constructor(e,t){super(e);this.replayToHandler=e;this.e=t;i(this,"messageType",Jn);this.content={e:t}}}});var Xt,Zn=m(()=>{"use strict";H();Xt=class extends I{constructor(e,t,s){super();this.ref=e;this.name=t;this.value=s;i(this,"messageType","SetAttributeMessage")}}});var eo,Zt,ce,en=m(()=>{"use strict";H();eo="ElementValueReplayMessage",Zt=class extends R{constructor(e,t){super(t);this.ref=e;i(this,"replyMessageKey",eo);i(this,"messageType","GetElementValueMessage")}},ce=class extends _{constructor(e){super();this.content=e;i(this,"messageType",eo)}}});var tn,to=m(()=>{"use strict";H();tn=class extends I{constructor(e,t){super();this.ref=e;i(this,"messageType","SetInnerHtml");this.content=t}}});var Ie,Pe,me,no=m(()=>{"use strict";H();Ie=class extends I{constructor(e){super();i(this,"messageType","InitMessage");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Pe=class extends Ie{constructor(){super(...arguments);i(this,"messageType","InitResponse")}},me=class extends I{constructor(){super(...arguments);i(this,"messageType","InitRequest")}}});var oo,Oe,Y,nt=m(()=>{"use strict";H();oo="RefComponentCreatedMessage",Oe=class extends R{constructor(e,t,s,r){super(r);this.refConfig=e;this.nestedComponentConfig=t;this.options=s;i(this,"replyMessageKey",oo);i(this,"messageType","CreateRefComponentMessage")}},Y=class extends _{constructor(e,t,s){super(e);this.replayToHandler=e;this.nestedRefs=t;this.failed=s;i(this,"messageType",oo)}}});var Ae,nn=m(()=>{"use strict";H();Ae=class extends I{constructor(e,t){super();this.destination=e;this.message=t;i(this,"messageType","EnvelopedMessage");let s=t;this.route=[e,...s.route?s.route:[]]}}});var so,on,le,io=m(()=>{"use strict";H();so="DetectedMyopRefsMessage",on=class extends R{constructor(){super(...arguments);i(this,"messageType","DetectMyopRefsMessage");i(this,"replyMessageKey",so)}},le=class extends _{constructor(e,t){super(e);this.replayToHandler=e;i(this,"messageType",so);this.content=t}isTypeof(e){return e.messageType===this.messageType}}});var ro,sn,Ke,ao=m(()=>{"use strict";H();ro="GetAttributeReplayMessage",sn=class extends R{constructor(e,t,s){super(s);this.ref=e;this.name=t;i(this,"replyMessageKey",ro);i(this,"messageType","GetAttributeMessage")}},Ke=class extends _{constructor(e){super();this.content=e;i(this,"messageType",ro)}}});var A,po=m(()=>{"use strict";H();A=class extends I{constructor(e){super();this.method=e;i(this,"messageType","ExecuteComponentMethod")}}});var rn,ze,co=m(()=>{"use strict";H();rn=class extends I{constructor(){super(...arguments);i(this,"messageType","SetMutationObserverMessage")}},ze=class extends I{constructor(){super(...arguments);i(this,"messageType","MutationObserverMessage")}}});var mo,$e,We,lo=m(()=>{"use strict";H();mo="CleanupReplayMessage",$e=class extends R{constructor(e,t){super(t);this.cleanupForMessageId=e;i(this,"replyMessageKey",mo);i(this,"messageType","CleanupMessage")}},We=class extends _{constructor(e){super();this.customCleanup=e;i(this,"messageType",mo)}}});var Fe,fo=m(()=>{"use strict";H();Fe=class extends I{constructor(){super(...arguments);i(this,"messageType","DisposeMessage")}}});var an,Ne,uo=m(()=>{"use strict";H();an=class extends I{constructor(){super(...arguments);i(this,"cleanable",!0);i(this,"messageType","SetResizeObserverMessage")}},Ne=class extends I{constructor(){super(...arguments);i(this,"messageType","ResizeObserverMessage")}}});var xe={};se(xe,{AddEventListenerMessage:()=>Jt,BaseMyopMessage:()=>I,BindClickMessage:()=>Gt,ChangeTextMessage:()=>Yt,CleanupMessage:()=>$e,CleanupReplayMessage:()=>We,ClickReplayMessage:()=>ae,CreateRefComponentMessage:()=>Oe,CustomRefMessage:()=>G,DetectMyopRefsMessage:()=>on,DetectedMyopRefsMessage:()=>le,DisposeMessage:()=>Fe,ElementValueReplayMessage:()=>ce,EnvelopedMessage:()=>Ae,EventListenerCallbackMessage:()=>de,ExecuteComponentMethod:()=>A,ExecuteScriptMessage:()=>k,ExecuteScriptReplyMessage:()=>pe,GetAttributeMessage:()=>sn,GetAttributeReplayMessage:()=>Ke,GetElementValueMessage:()=>Zt,InitMessage:()=>Ie,InitRequest:()=>me,InitResponse:()=>Pe,MessageDirection:()=>v,MutationObserverMessage:()=>ze,MyopBindMessage:()=>R,MyopBindReplayMessage:()=>_,MyopElementMessage:()=>jt,Ref:()=>X,RefComponentCreatedMessage:()=>Y,ResizeObserverMessage:()=>Ne,SetAttributeMessage:()=>Xt,SetInnerHtml:()=>tn,SetMutationObserverMessage:()=>rn,SetResizeObserverMessage:()=>an,stripFunction:()=>Yn});var b=m(()=>{"use strict";H();Vn();jn();Qt();Qn();Xn();Zn();en();to();no();nt();nn();io();en();ao();po();co();lo();fo();uo()});var U,Ue=m(()=>{"use strict";C();b();qe();U=class{constructor(n,e,t){this.componentDefinition=n;this.container=e;i(this,"id","");i(this,"messageHandlers",{});i(this,"element");i(this,"_markedForDisposed",!1);i(this,"bind",(n,e)=>{this.messageHandlers[n]||(this.messageHandlers[n]=[]),this.messageHandlers[n].includes(e)||this.messageHandlers[n].push(e)});i(this,"bindWhen",(n,e,t)=>{if(!t)throw new Error("can't use component.bindWhen without an handler");this.messageHandlers[n]||(this.messageHandlers[n]=[]);let s=this.messageHandlers[n],r=a=>e(a)?(t(a),!0):!1;return s.push(r),()=>{let a=s.indexOf(r);a>-1&&s.splice(a,1)}});i(this,"setInitiated",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});i(this,"isInitiated",!1);i(this,"_whenInitiatedResolve");i(this,"_whenInitiatedReject");i(this,"_whenInitiated",new Promise((n,e)=>{this._whenInitiatedResolve=n,this._whenInitiatedReject=e}));i(this,"initiated",()=>this._whenInitiated);i(this,"props",{});i(this,"refs",{});this.id=(t==null?void 0:t.id)||W.Instance().assignId(n);let s=t!=null&&t.timeout?t==null?void 0:t.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject("timeout_".concat(s," ").concat(this.id))},s),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(n){if(this._markedForDisposed)throw new Error("InvalidOperationException: The component is already in the process of being disposed. Dispose operation cannot be performed again until the current disposal process is complete.");this._markedForDisposed=n}onMessageReceived(n){if(n.messageType===g.ExecuteComponentMethod){let t=n;return this[t.method]?this[t.method](t.content):console.log("method not found ".concat(t.method," on component"),this),!0}let e=this.messageHandlers[n.messageType];if(e&&e.length){let t=!1;return e.forEach(s=>{t=t||s(n)}),t}return!1}sendCleanupMessage(n){n.source=this.id,n.destination=this.id,n.direction=v.down;let e=this.bindWhen(n.replyMessageKey,s=>s.replayToHandler===n.handlerUniqueId,s=>{n.handler(s),e()}),t=n.handler;delete n.handler,this.send(n),n.handler=t}send(n){n.source||(n.source=this.id),n.destination||(n.destination=this.id),n.direction=v.down;let e;if(n.handler){let t=n;e=this.bindWhen(t.replyMessageKey,s=>s.replayToHandler===t.handlerUniqueId,t.handler),delete n.handler}return n.ref&&(n.ref=n.ref.__nonProxied||n.ref),n.cleanable?()=>{this.sendCleanupMessage(new $e(n.id,t=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log("disposing component",this.id),this.send(new Fe);let n=this.messageHandlers.onDispose;n&&n.forEach(e=>{e(null)}),this.messageHandlers={},this.id+="_disposed",this.isInitiated=!1}}});var be,go=m(()=>{"use strict";be=class{constructor(n,e,t,s,r){this.myopId=n;this.htmlTagName=e;this.BoundingRect=t;this.offsetTop=s;this.offsetLeft=r;i(this,"type","MyopElementRef")}}});var yo,x,ot,ho=m(()=>{"use strict";yo=async o=>{if(typeof o=="function")o();else if(o instanceof Promise){let n=await o;typeof n=="function"&&n()}},x=class{constructor(n){this.messageToHost=n}},ot=class extends x{constructor(e,t){super(e);this.messageToHost=e;this.context=t}}});var pn,we,Mo=m(()=>{"use strict";C();w();b();pn=class{constructor(n,e){this.id=n;this.context=e;i(this,"send",n=>{})}},we=class{constructor(){i(this,"messageToHandleAfterInit",[]);i(this,"components",{});i(this,"alwaysPassEnvelopesToHost",!1);i(this,"messageCleanupCache",{})}handleIncomeMessages(n){let e=n.data?n.data:n.detail;if(!(!e||!e.myop)){let t=e;if(t.direction!==v.down)return;if(t.messageType===g.DisposeMessage){t.destination&&delete this.components[t.destination];return}if(t.messageType===g.InitMessage){let s=t.content.id;if(this.components[s])return;this.components[s]=new pn(s),this.messageToHost(new Pe(s));return}if(t.messageType===g.EnvelopedMessage){let s=t,r=s.message;if(t=r,this.alwaysPassEnvelopesToHost||this.components[t.destination]){let a=myop.hostSDK.components.find(d=>d.id===r.destination);if(a){a.send(r);return}let p=myop.hostSDK.components.find(d=>d.id===s.destination);if(p){p.send(r);return}}else return}if(t.messageType){if(t.messageType===g.CleanupMessage){let r=t,a=this.messageCleanupCache[r.cleanupForMessageId],p=new We(!!a);p.destination=t.destination,a?(delete this.messageCleanupCache[r.cleanupForMessageId],yo(a).then(()=>{this.messageToHost(p,r)}).catch(()=>{})):this.messageToHost(p,r);return}let s=!1;this.supportedHandlers.forEach(r=>{if(r.messageType===t.messageType){s=!0;let a=r.executor(t);if(t.cleanable&&a&&(this.messageCleanupCache[t.id]=a),a&&!t.cleanable)throw new Error("Cleanup handler generated for non-cleanable message. \\nmessageType - ".concat(t.messageType,", handler executor was - ").concat(r.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."));if(!a&&t.cleanable)throw new Error("No cleanup handler generated for a cleanable message. \\nmessageType - ".concat(t.messageType,", handler executor was - ").concat(r.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."))}})}else console.log("unsupported message type")}}}});var Q,fe,Te,Se,ue,st,Ee,w=m(()=>{"use strict";go();ho();Mo();Q={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},fe={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},Te={message:"message",code:"code"},Se=class{};i(Se,"code","code"),i(Se,"component","component");ue={Segmented:"Segmented",Dedicated:"Dedicated",Default:"Default"},st={Segment:"Segment",Promo:"Promo",AB:"AB"},Ee=class{constructor(n,e){this.container=n;this.shadowRoot=e;i(this,"getRootDiv",()=>(this.shadowRoot||this.container).querySelector("div"));i(this,"getRoot",()=>this.shadowRoot||this.container)}}});var dn,mi,cn,O,ge=m(()=>{"use strict";dn=o=>o!==Object(o),mi=o=>typeof o=="function",cn=o=>{if(dn(o))return!0;if(mi(o)||Object.getPrototypeOf(o))return!1;for(let n in o){let e=o[n];if(typeof e=="object"){if(!cn(e))return!1}else{if(dn(e))continue;return!1}}return!0},O=(o,n={},e=!0,t=new WeakMap)=>{if(dn(o))return o;if(Array.isArray(o)){if(t.has(o))return t.get(o);let s=[];t.set(o,s);for(let r=0;r<o.length;r++){let a=o[r];s[r]=O(a,n,e,t)}return s}if(o!==null&&typeof o=="object"){if(t.has(o))return t.get(o);let s={};t.set(o,s);for(let r in o){let a=typeof n=="boolean"?n:n[r];a&&(a===!0?(e?o[r]!==void 0:o[r])&&(s[r]=O(o[r],!0,e,t)):typeof a=="object"&&(s[r]=O(o[r],a,e,t)))}return s}return{}}});var Co,Io=m(()=>{"use strict";Co={notSerializableRefCall:(o,n)=>{throw new Error("\\nThe input provided to '".concat(o.toString(),"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \\nThe following types of data are considered non-serializable and cannot be processed:\\n\\n- Functions\\n- DOM elements\\n- Class instances\\n- Circular references\\n- Symbols\\n- BigInt values\\n\\nIn the following execution we detected :\\n~~~~~~~~\\n").concat(n," \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '").concat(o.toString(),"' are in a serializable format.\\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \\nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\\n\\nSuggested Fix:\\n1. Remove or replace non-serializable values from your input.\\n2. If using objects, ensure they do not contain any functions or circular references.\\n3. Convert any class instances to plain objects or JSON-compatible formats.\\n4. Use dedicated Myop message.\\n\\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\\n\\n"))}}});var Ve,xo=m(()=>{"use strict";Ue();b();nn();Ve=class extends U{constructor(e,t,s){super(e,t.container,s);this.componentDefinition=e;this.parent=t;i(this,"send",e=>{let t=e.handler,s=super.send(e);return this.parent.send(new Ae(this.id,e)),e.handler=t,s});i(this,"dispose",()=>{this.isInitiated&&this.send(new A("dispose")),super.dispose()})}hide(){this.send(new A("hide"))}show(){this.send(new A("show"))}inspect(){return this.send(new A("inspect"))}setHeightBasedOnDocumentElement(){this.send(new A("setHeightBasedOnDocumentElement"))}setHeightBasedOnScrollHeight(){this.send(new A("setHeightBasedOnScrollHeight"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var ye,mn=m(()=>{"use strict";Ue();je();ye=class extends U{constructor(e,t,s,r,a,p){super(e,s,p);this.container=s;this.customElement=r;this.tagName=a;i(this,"ctaCleanup");i(this,"_ctaHandler");i(this,"_ctaQueue",[]);i(this,"cleanupInspect",()=>{});i(this,"send",e=>{let t=super.send(e);return console.debug("[MyopExtractedWebComponent] send() called - web components use direct API instead",e),t});i(this,"dispose",()=>{var e;this.ctaCleanup&&this.ctaCleanup(),super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=r,this.setInitiated()}inspect(){return this.cleanupInspect=ve(this.id,"MyopExtractedWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){this.customElement.style.opacity="0",this.customElement.style.position="absolute",this.customElement.style.pointerEvents="none",this.customElement.style.visibility="hidden",this.customElement.style.height="0",this.customElement.style.width="0"}show(){this.customElement.style.opacity="1",this.customElement.style.position="unset",this.customElement.style.pointerEvents="all",this.customElement.style.visibility="visible",this.customElement.style.height="",this.customElement.style.width=""}initWithData(e){typeof this.customElement.myop_init_interface=="function"&&this.customElement.myop_init_interface(e)}getData(){if(typeof this.customElement.myop_init_interface=="function")return this.customElement.myop_init_interface()}setCtaHandler(e){if(this.ctaCleanup&&this.ctaCleanup(),this._ctaHandler=e,this._ctaQueue.length>0){let s=[...this._ctaQueue];this._ctaQueue=[],s.forEach(r=>{this.markedForDisposed||e(r.action,r.payload)})}let t=s=>{var a;let r=s;(a=r.detail)!=null&&a.action&&(this._ctaHandler&&!this.markedForDisposed?this._ctaHandler(r.detail.action,r.detail.payload):this._ctaHandler||this._ctaQueue.push({action:r.detail.action,payload:r.detail.payload}))};this.customElement.addEventListener("myop-cta",t),this.ctaCleanup=()=>{this.customElement.removeEventListener("myop-cta",t)}}}});var li,ve,bo,wo,So,fi,ln,fn,je=m(()=>{"use strict";b();b();w();ge();Io();xo();mn();li=(o,n,e)=>{let t=document.createElement("a");return t.textContent=o,t.style.position="relative",t.style.padding="0 5px",t.style.fontSize="14px",t.style.top="0",t.style.top="".concat(n,"px"),t.style.transform="translateX(-50%)",t.target="_blank",t.href="https://dashboard.myop.dev/dashboard/component/".concat(e.id),t},ve=(o,n,e,t,s,r)=>{let a=li("".concat(r.name," : ").concat(n),e,r);return t.insertBefore(a,s),s.style.border="1px solid #007BFF",s.style.display="block",()=>{s.style.border="unset",t.removeChild(a)}},bo=(o,n,e)=>o?!1:(console.error("Error: Undefined Prop\\n\\nIt looks like you've tried to use a prop that hasn't been defined.\\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\\n\\n"+"Prop Name: ".concat(n,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide.")),!0),wo=(o,n,e)=>{console.error("Error: Code Prop Not Supported\\n\\nCurrently, code props are only supported in local frame components.\\n\\u26A0\\uFE0F This is a work in progress feature \\u2014 code props will be supported in upcoming versions.\\n\\nIn the meantime, you can use message props.\\n\\n"+"Prop Name: ".concat(n,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide."))},So=(o,n,e)=>{let t=n.reduce((r,a)=>j(M({},r),{[a.name]:M({},a)}),{}),s={get:(r,a)=>{let p=t[a];if(bo(p,a,o))return!1;if(p.behavior.type===Te.code){if(o instanceof ye)return(p.behavior.remap||a)==="myop_init_interface"?u=>{if(u===void 0)return o.getData();o.initWithData(u)}:void 0;if(e.loader.type===Q.HTMLLoader&&e.loader.shadowRootMode===fe.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return wo(p,a,o),!1}return p.mode==="output"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(X.create(p.behavior.ref)),c.push(y=>{d(y)}),p.behavior.params&&c.push(...p.behavior.params);let u=xe[p.behavior.message];o.send(new u(...c))}):null},set:(r,a,p)=>{let d=t[a];if(bo(d,a,o))return!1;if(d.behavior.type===Te.code){if(o instanceof ye){let u=d.behavior.remap||a;if(u==="myop_cta_handler")return o.setCtaHandler(p),!0;if(u==="myop_init_interface")return o.initWithData(p),!0}if(e.loader.type===Q.HTMLLoader&&e.loader.shadowRootMode===fe.localFrame){let u=d.behavior,y=o.element.contentWindow,h=u.remap||a;if(y[h]=p,h==="myop_cta_handler"&&y.__myop_cta_queue){let f=y.__myop_cta_queue;y.__myop_cta_queue=null,f.forEach(l=>{o.markedForDisposed||p(l.action,l.payload)})}return!0}return wo(d,a,o),!1}else if(d.mode==="input")if(d.behavior.type==="message"){let c=[];d.behavior.ref&&c.push(X.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let u=xe[d.behavior.message];return o.send(new u(...c)),!0}else throw new Error("Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n"+"Component: ".concat(o.componentDefinition.name,", ID: ").concat(o.componentDefinition.id,"\\n\\n")+"Prop Name: ".concat(a,"\\n")+"Behavior Field: ".concat(d.behavior.type,"\\n\\n")+"Check the documentation for valid behavior options.");return!1}};return o.props={},o.props=new Proxy(o.props,s),o},fi=(o,n)=>new Proxy(o,{get(e,t){return e[t]?e[t]:(...r)=>new Promise(a=>{r.forEach(p=>{cn(p)||Co.notSerializableRefCall(t,p)}),n.send(new G(({ref:p,propName:d,functionArgs:c,makeSerializable:u})=>{if(p){let y=p[d];return u(typeof y=="function"?p[d](...c):y,!0)}return null},{elementId:e.refConfig.selector,propName:t,functionArgs:r},p=>{a(p.content)}))})},set(e,t,s){return n.send(new G(({ref:r,propName:a,propValue:p})=>{r&&(r[a]=p)},{elementId:e.refConfig.selector,propValue:s,propName:t},r=>{})),!0}}),ln=async(o,n,e,t)=>{let s=o.component;if(!s)throw new Error("cant createRefComponent with detached ref");return new Promise(async(r,a)=>{let p=new Ve(n.type,s,t);e.push(p),await s.initiated();let d=setTimeout(()=>{a("timeout")},5e3);s.send(new Oe(o.refConfig,n,j(M({},t||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a("CreateRefComponentMessage failed");return}let u=e.find(y=>y.id==p.id);if(u!==p){s.refs[o.refConfig.name]=u,r(u);return}else p.setInitiated(),s.refs[o.refConfig.name]=p;c.nestedRefs.forEach(y=>{let h=n.instance.resolvedNestedComponents.find(l=>l.type.id===y.componentDefinitionId).type,f=new Ve(h,p);f.setInitiated(),p.refs[y.refName]=f,e.push(f)});try{await fn(p,n,e,!0),s.setHeightBasedOnScrollHeight&&s.setHeightBasedOnScrollHeight(),r(p)}catch(y){a(y)}}))})},fn=async(o,n,e,t=!1)=>{o.refs||(o.refs={});let s=Object.values(o.componentDefinition.refs).map(r=>new Promise(async(a,p)=>{var d;if(r.behavior.type==Se.component){if(t){a();return}let c=r.behavior.componentId;c||(c=r.behavior.instance.componentId);let u=(d=n.instance.resolvedNestedComponents)==null?void 0:d.find(h=>h.type.id===c);if(!u)throw new Error("componentConfig provided without nestedComponentConfig check the config object");let y=X.create("",r,o);try{let h=await ln(y,u,e);o.refs[r.name]=h,a()}catch(h){p(h)}}else try{let c=X.create("",r,o);o.refs[r.name]=fi(c,o),a()}catch(c){}}));try{await Promise.all(s)}catch(r){throw r}}});var _e,un=m(()=>{"use strict";Ue();b();je();C();_e=class extends U{constructor(e,t,s,r,a){super(e,s,a);this.componentConfig=e;this.container=s;this.IframeElement=r;i(this,"_autoSizeCleanup");i(this,"_autoSizeOptions");i(this,"_autoSizeUpdate");i(this,"sizeMeta");i(this,"cleanupInspect");i(this,"setHeightBasedOnDocumentElement",()=>{let e=this.send(new k(()=>window.document.documentElement.scrollHeight,t=>{this.IframeElement.style.height="".concat(t.content,"px"),e()}))});i(this,"observeSizeBasedOnDocumentElement",()=>this.send(new k(({send:t})=>{let{height:s,width:r}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();t({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:s,width:r}},t=>{this.IframeElement.style.width="".concat(t.content.width,"px"),this.IframeElement.style.height="".concat(t.content.height,"px")})));i(this,"observeAutoSize",e=>{if(this._autoSizeOptions=e,this._autoSizeCleanup&&this._autoSizeUpdate)return this._autoSizeUpdate(),this._autoSizeCleanup;let t=this.IframeElement,s=t.contentDocument;if(!s)return console.warn("[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible"),()=>{};let r=(f,l,z)=>l!==void 0&&f<l?l:z!==void 0&&f>z?z:f,a=f=>{if(f===void 0)return;if(typeof f=="number")return f;let l=parseFloat(f);return isNaN(l)?void 0:l},p=()=>{var kn,Dn,Bn,Ln,Pn,On,An,Kn;let f=t.contentDocument;if(!f)return;let l=this._autoSizeOptions,z=a(l==null?void 0:l.minWidth),ke=a(l==null?void 0:l.maxWidth),ne=a(l==null?void 0:l.minHeight),$=a(l==null?void 0:l.maxHeight),B=(kn=l==null?void 0:l.loaderMinHeight)!=null?kn:50,P=((Dn=this.sizeMeta)==null?void 0:Dn.width)==="100%"?"100%":void 0,De=((Bn=this.sizeMeta)==null?void 0:Bn.height)==="100%"?"100%":void 0,F=(Pn=(Ln=l==null?void 0:l.explicitWidth)!=null?Ln:P)!=null?Pn:"100%",oe=(On=l==null?void 0:l.explicitHeight)!=null?On:De,wn=F!==void 0,Sn=oe!==void 0,Wt=this.container.getBoundingClientRect(),Us=Wt.width===0,qs=Wt.height===0||Wt.height===B,he=(l!=null&&l.forceAutoSize||Us)&&!wn,Me=(l!=null&&l.forceAutoSize||qs)&&!Sn;if(!he&&!Me){t.style.width=typeof F=="number"?"".concat(F,"px"):"100%",t.style.height=typeof oe=="number"?"".concat(oe,"px"):"100%",(An=l==null?void 0:l.onSizeChange)==null||An.call(l,{width:typeof F=="number"?F:void 0,height:typeof oe=="number"?oe:void 0,autoSizingWidth:!1,autoSizingHeight:!1});return}let Vs=t.style.transition,V=this.container,js=V.style.transition;t.style.transition="none",V.style.transition="none";let En=t.getBoundingClientRect().height,Tn=t.getBoundingClientRect().width,vn=Math.ceil(Math.max(f.documentElement.scrollHeight,f.body.scrollHeight,f.body.getBoundingClientRect().height)),_n=Math.ceil(Math.max(f.documentElement.scrollWidth,f.body.scrollWidth,f.body.getBoundingClientRect().width)),Be=_n,Le=vn,Gs=Me&&vn>En+1,Ys=he&&_n>Tn+1,Ye=Me&&!Gs,Qe=he&&!Ys;if(Ye||Qe){let Xs=V.style.minHeight,Zs=V.style.minWidth;Ye&&(V.style.minHeight="".concat(En,"px")),Qe&&(V.style.minWidth="".concat(Tn,"px")),Ye&&(t.style.height="0px"),Qe&&(t.style.width="0px"),Be=Math.ceil(Math.max(f.documentElement.scrollWidth,f.body.scrollWidth,f.body.getBoundingClientRect().width)),Le=Math.ceil(Math.max(f.documentElement.scrollHeight,f.body.scrollHeight,f.body.getBoundingClientRect().height));let zn=Ye&&Le<2,$n=Qe&&Be<2;if(zn||$n){let Je=f.createElement("style");Je.id="__myop_measure";let Ft=[];zn&&Ft.push("height: auto !important","min-height: 0 !important","max-height: none !important"),$n&&Ft.push("width: auto !important","min-width: 0 !important","max-width: none !important"),Je.textContent="*, *::before, *::after { ".concat(Ft.join("; "),"; flex-basis: auto !important; flex-grow: 0 !important; }"),f.head.appendChild(Je),Be=Math.ceil(Math.max(f.documentElement.scrollWidth,f.body.scrollWidth,f.body.getBoundingClientRect().width)),Le=Math.ceil(Math.max(f.documentElement.scrollHeight,f.body.scrollHeight,f.body.getBoundingClientRect().height)),Je.remove()}V.style.minHeight=Xs,V.style.minWidth=Zs}let Rn=r(Be,z,ke),Hn=r(Le,ne,$);he?t.style.width="".concat(Rn,"px"):t.style.width=typeof F=="number"?"".concat(F,"px"):"100%",Me?t.style.height="".concat(Hn,"px"):t.style.height=typeof oe=="number"?"".concat(oe,"px"):"100%",t.offsetHeight,t.style.transition=Vs,V.style.transition=js;let Qs=he&&ke!==void 0&&Be>ke,Js=Me&&$!==void 0&&Le>$;f.documentElement.style.overflowX=Qs?"auto":"",f.documentElement.style.overflowY=Js?"auto":"",(Kn=l==null?void 0:l.onSizeChange)==null||Kn.call(l,{width:Rn,height:Hn,autoSizingWidth:he,autoSizingHeight:Me})};p(),this._autoSizeUpdate=p;let d,c=()=>{d===void 0&&(d=requestAnimationFrame(()=>{d=void 0,p()}))},u=new ResizeObserver(()=>c());u.observe(s.body),u.observe(s.documentElement);let y=new MutationObserver(()=>c());y.observe(s.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let h=()=>{u.disconnect(),y.disconnect(),d!==void 0&&(cancelAnimationFrame(d),d=void 0),this._autoSizeUpdate=void 0,this._autoSizeCleanup=void 0};return this._autoSizeCleanup=h,h});i(this,"setSizeBasedOnDocumentElement",()=>{let e=this.send(new k(()=>{let{height:t,width:s}=document.documentElement.getBoundingClientRect();return{height:t,width:s}},t=>{this.IframeElement.style.width="".concat(t.content.width,"px"),this.IframeElement.style.height="".concat(t.content.height,"px"),e()}))});i(this,"setHeightBasedOnScrollHeight",()=>{let e=this.send(new k(()=>{let s=0;return s++,s--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+s+"px"},t=>{this.IframeElement.style.height=t.content,e()}))});i(this,"send",e=>{var r,a;let t=M({},e);if(t.messageType===g.ExecuteComponentMethod)return this[t.method](),()=>{};t.direction=v.down;let s=super.send(t);return(a=(r=this.IframeElement)==null?void 0:r.contentWindow)==null||a.postMessage(t,"*"),s});i(this,"dispose",()=>{this._autoSizeCleanup&&(this._autoSizeCleanup(),this._autoSizeCleanup=void 0),this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=ve(this.id,"MyopIframeComponent",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity="0",this.IframeElement.style.position="absolute",this.IframeElement.style.pointerEvents="none",this.IframeElement.style.visibility="hidden"}show(){this.IframeElement.style.opacity="1",this.IframeElement.style.position="unset",this.IframeElement.style.pointerEvents="all",this.IframeElement.style.visibility="visible"}onMessageReceived(e){return e.messageType===g.In.MutationObserverMessage||e.messageType===g.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var Z,it=m(()=>{"use strict";Z=class{constructor(){i(this,"appendChild",(n,e,t)=>{var s;if(t!=null&&t.relative){if(t.relative.direction==="before")return n.insertBefore(e,t.relative.child);if(t.relative.direction==="after"){let r=(s=t.relative.child)==null?void 0:s.nextSibling;return n.insertBefore(e,r||null)}}else return n.appendChild(e)})}}});var ui,rt,Eo=m(()=>{"use strict";un();it();re();w();ui=(o,n,e)=>{let t=new URL(o);return t.searchParams.append(n,e),t.toString()},rt=class extends Z{constructor(){super(...arguments);i(this,"type",Q.IframeLoader);i(this,"load",async(e,t,s,r)=>{let a,p=t.loader;if((s==null?void 0:s.nodeName)==="IFRAME")console.log("needs to load into an exsisting Iframe...",p.url,s),a=s,a.src=p.url;else{let d=E(),c="myop-comp-".concat(d);a=document.createElement("iframe"),a.id=c;let u="\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n height: ".concat(p.autoHeight||!p.height?"100%":p.height,";\\n width: 100%;\\n overflow: hidden;\\n border: none;\\n opacity: ").concat(r!=null&&r.hidden?"0":"1",";\\n pointer-events: ").concat(r!=null&&r.hidden?"none":"all",";\\n ");a.style.cssText=u,r!=null&&r.elementAttributes&&Object.entries(r.elementAttributes).forEach(([h,f])=>{f===""||f===null||f===void 0?a.setAttribute(h,""):a.setAttribute(h,String(f))});let y=t.loader.url;r!=null&&r._hasParent&&(y=ui(y,"_myop-comp",d)),a.src=y,s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),a=this.appendChild(s,a,r)}return new _e(e,t,s,a,r)})}}});var at,gn=m(()=>{"use strict";at={webcomponent_message_key:"myop_webcomponent_message"}});var Re,yn=m(()=>{"use strict";gn();Ue();je();Re=class extends U{constructor(e,t,s,r,a){super(e,s,a);this.container=s;this.customElement=r;i(this,"cleanupInspect",()=>{});i(this,"send",e=>{let t=M({},e),s=super.send(t),r=new CustomEvent(at.webcomponent_message_key,{detail:t});try{this.customElement.dispatchEvent(r)}catch(a){console.log("error while trying to dispatchEvent",a)}return s});i(this,"dispose",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=r}inspect(){return this.cleanupInspect=ve(this.id,"MyopWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){this.customElement.style.opacity="0",this.customElement.style.position="absolute",this.customElement.style.pointerEvents="none",this.customElement.style.visibility="hidden",this.customElement.style.height="0",this.customElement.style.width="0"}show(){this.customElement.style.opacity="1",this.customElement.style.position="unset",this.customElement.style.pointerEvents="all",this.customElement.style.visibility="visible",this.customElement.style.height="",this.customElement.style.width=""}}});var hn,pt,To=m(()=>{"use strict";yn();it();re();w();hn={},pt=class extends Z{constructor(){super(...arguments);i(this,"type",Q.WebComponentLoader);i(this,"load",async(e,t,s,r)=>{let a=t.loader;hn[a.url]?console.log("Module alreday loaded or in loading process"):hn[a.url]=new Promise((c,u)=>{let y=a.url,h=document.createElement("script");h.type="module",h.src=y,h.onload=()=>{c()},h.onerror=()=>{u()},document.head.appendChild(h)}),await hn[a.url],await Un(1);let p="myop-comp-".concat(E()),d=document.createElement(a.tag);return s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),d.id=p,r!=null&&r.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),r!=null&&r._environment&&(d._myopEnvironment=r==null?void 0:r._environment),this.appendChild(s,d,r),new Re(e,t,s,d,r)})}}});var T,q=m(()=>{"use strict";w();T=class extends ot{constructor(e,t){super(e);this.context=t;i(this,"executor",e=>{if(e.destination){let t=e.destination;if(this.context[t].context){let s=(r,a)=>{this.messageToHost(j(M({},r),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[t].context,s)}else debugger}else debugger})}}});var D,ee=m(()=>{"use strict";D={id:"myop-id"}});var S,vo,L=m(()=>{"use strict";ee();S=(o,n)=>n.querySelectorAll("[".concat(D.id,"='").concat(o.refConfig.selector,"']")),vo=(o,n)=>{let e=S(o,n);return e.length?e.item(0):null}});var dt,_o=m(()=>{"use strict";C();b();q();L();dt=class extends T{constructor(){super(...arguments);i(this,"messageType",g.BindClickMessage);i(this,"innerExecutor",(e,t,s)=>{let r=S(e.ref,t.shadowRoot),a=[];return r.forEach(p=>{let d=()=>{s(new ae(e.handlerUniqueId))};p.addEventListener("click",d),a.push(()=>{p.removeEventListener("click",d)})}),()=>{a.forEach(p=>p())}})}}});var ct,Ro=m(()=>{"use strict";C();q();L();ct=class extends T{constructor(){super(...arguments);i(this,"messageType",g.ChangeTextMessage);i(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(r=>{r.textContent=e.content})})}}});var mt,Ho=m(()=>{"use strict";w();mt=class extends Ee{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var lt,ko=m(()=>{"use strict";w();ee();q();b();C();lt=class extends T{constructor(){super(...arguments);i(this,"innerExecutor",(e,t)=>{let s=t.shadowRoot.querySelectorAll("[".concat(D.id,"]")),r=[];s.forEach(a=>{let p=a.getAttribute(D.id);p&&r.push(new be(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new le(e.handlerUniqueId,r))});i(this,"messageType",g.DetectMyopRefsMessage)}}});var ft,Do=m(()=>{"use strict";C();q();L();ft=class extends T{constructor(){super(...arguments);i(this,"messageType",g.SetAttributeMessage);i(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var ut,Bo=m(()=>{"use strict";C();b();q();L();ge();ut=class extends T{constructor(){super(...arguments);i(this,"messageType",g.AddEventListenerMessage);i(this,"innerExecutor",(e,t,s)=>{let r=S(e.ref,t.shadowRoot),a=[];return r.forEach(p=>{let d=c=>{s(new de(e.handlerUniqueId,O(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var gt,Lo=m(()=>{"use strict";C();ee();qe();nt();q();gt=class extends T{constructor(){super(...arguments);i(this,"messageType",g.CreateRefComponentMessage);i(this,"innerExecutor",(e,t,s)=>{(async()=>{let a=t.shadowRoot.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(a.length===1){let p=W.Instance(),d=p.components.find(h=>h.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let u=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),y=[];Object.keys(u.refs).forEach(h=>{let f=u.refs[h];f=f.__nonProxied||f,f.componentDefinition&&y.push({refName:h,componentDefinitionId:f.componentDefinition.id})}),s(new Y(e.handlerUniqueId,y))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new Y(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var yt,Mn=m(()=>{"use strict";ge();yt=(o,n,e)=>{let t=o.scriptInputs?o.scriptInputs:{};t.makeSerializable=O,t.send=n,t.rootRef=e,t.__scriptInputs=t;let r=new Function("return (".concat(o.script,")(...arguments)"))(t);n(r)}});var ht,Po=m(()=>{"use strict";C();b();q();Mn();ht=class extends T{constructor(){super(...arguments);i(this,"messageType",g.ExecuteScriptMessage);i(this,"innerExecutor",(e,t,s)=>{yt(e,a=>{s(new pe(e.handlerUniqueId,a))},t)})}}});var Oo,Mt,Ao=m(()=>{"use strict";C();b();q();L();ee();ge();Oo=o=>{if(!o)return null;if(o.tagName==="FORM"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll("input, select, textarea"),s=-1;return t.forEach(r=>{if(typeof r.value=="string"){let a=r.getAttribute(D.id),p=r.getAttribute("name"),d={id:r.id,name:p,value:Oo(r),required:r.required,validity:O(r.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Mt=class extends T{constructor(){super(...arguments);i(this,"messageType",g.GetElementValueMessage);i(this,"innerExecutor",(e,t,s)=>{S(e.ref,t.shadowRoot).forEach(a=>{s(new ce(Oo(a)),e)})})}}});var Ct,Ko=m(()=>{"use strict";C();q();L();Ct=class extends T{constructor(){super(...arguments);i(this,"messageType",g.SetInnerHtml);i(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(r=>{r.innerHTML=e.content})})}}});var zo={};se(zo,{WebComponentSDK:()=>He});var He,Cn=m(()=>{"use strict";w();C();gn();_o();Ro();Ho();ko();ie();b();Do();Bo();Lo();Po();Ao();Ko();He=class extends we{constructor(){super(...arguments);i(this,"alwaysPassEnvelopesToHost",!0);i(this,"connectedCallback",(e,t)=>{e.addEventListener(at.webcomponent_message_key,s=>{let r=s.data?s.data:s.detail;if(!r||!r.myop){debugger;throw new Error("recvied webcomponent_message with wrong type")}else{let a=r;if(this.handleIncomeMessages(s),a.messageType===g.InitMessage){let p=a.content.id;this.components[p].context=new mt(e,t)}}}),setTimeout(()=>{this.messageToHost(new me)},1)});i(this,"messageToHost",(e,t)=>{e.direction=v.up,!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId),window.myop.hostSDK.send(e)});i(this,"supportedHandlers",[new ct(this.messageToHost,this.components),new Ct(this.messageToHost,this.components),new dt(this.messageToHost,this.components),new lt(this.messageToHost,this.components),new ft(this.messageToHost,this.components),new ut(this.messageToHost,this.components),new ht(this.messageToHost,this.components),new Mt(this.messageToHost,this.components),new gt(this.messageToHost,this.components)]);i(this,"init",()=>{})}};N("WebComponentSDK",He)});var $o=m(()=>{"use strict";Cn()});var Wo,Fo=m(()=>{"use strict";Wo=""});function hi(o,n){return class extends HTMLElement{connectedCallback(){let e=n===fe.open?"open":"closed",t=this.attachShadow({mode:e});Vo().then(s=>{s.connectedCallback(this,t),t.innerHTML=o})}}}var gi,yi,Uo,qo,It,Vo,Mi,Ci,Ii,xt,jo=m(()=>{"use strict";yn();mn();it();re();w();$o();un();Fo();gi="<!-- myop-web-component -->",yi="myop-web-component",Uo=new Set,qo=[],Vo=async()=>(It||(It=new He,It.init()),It);Mi=(o,n,e)=>{customElements.define(o,hi(n,e)),console.log("define('".concat(o,"') was called, web component ready to use"))},Ci=o=>o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/(\\d+)/g,"-$1").toLowerCase(),Ii=o=>(o=Ci(o),o.replace(/_/g,"-")),xt=class extends Z{constructor(){super(...arguments);i(this,"type",Q.HTMLLoader);i(this,"load",async(e,t,s,r)=>{let a=t.loader;if(this.isMyopWebComponent(a.HTML))return this.loadExtractedWebComponent(e,t,s,a.HTML,r);let p="myop-comp-".concat(E()),d;if(a.shadowRootMode===fe.localFrame){let c=E(),u="myop-comp-".concat(c),y=document.createElement("iframe");y.id=u,y.style.cssText="\\n display: block;\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n overflow: hidden;\\n border: none;\\n opacity: ".concat(r!=null&&r.hidden?"0":"1",";\\n width: 100%;\\n height: 100%;\\n pointer-events: ").concat(r!=null&&r.hidden?"none":"all",";\\n "),s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),y=this.appendChild(s,y,r);let h=y.contentDocument||y.contentWindow.document;h.open();let f=null;{let P=new DOMParser().parseFromString(a.HTML,"text/html").querySelector('meta[name="myop:size"]');if(P)try{f=JSON.parse(P.getAttribute("content")||"{}")}catch(De){}}let l=a.HTML;if(r!=null&&r._inspection){let B=new DOMParser().parseFromString(a.HTML,"text/html"),P=B.getElementById("myop_preview");P==null||P.removeAttribute("type");let De=B.implementation.createHTMLDocument();De.body.innerHTML="<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>";let F=De.body.firstChild;F&&B.head&&B.head.insertBefore(B.importNode(F,!0),B.head.firstChild),l=B.documentElement.outerHTML}else if((r==null?void 0:r.data)!==void 0){let B=new DOMParser().parseFromString(a.HTML,"text/html"),P=B.getElementById("myop_preview");P&&(P.remove(),l=B.documentElement.outerHTML)}h.writeln(l);let z='<script src="'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'"><\\/script>'),ke="<script>\\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK();\\n sdk.init();\\n }\\n __myop_init().then();\\n <\\/script>";if(h.writeln("".concat(z).concat(ke)),(r==null?void 0:r.data)!==void 0){let $="<script>\\n window.__myop_cta_queue = [];\\n window.myop_cta_handler = function(action, payload) {\\n window.__myop_cta_queue.push({action: action, payload: payload});\\n };\\n <\\/script>",B=JSON.stringify(r.data).replace(/<\\/script/gi,"\\\\u003c/script"),P='<script id="__myop_init_data_script">\\n (function() {\\n var data = '.concat(B,";\\n var scriptEl = document.getElementById('__myop_init_data_script');\\n\\n var callInitInterface = function(fn) {\\n var startTime = performance.now();\\n // Mark as pre-injected data call for extension tracking\\n window.__myop_init_preinjected = true;\\n try {\\n fn(data);\\n } finally {\\n window.__myop_init_preinjected = false;\\n }\\n var duration = performance.now() - startTime;\\n\\n // Notify extension via postMessage (init* = pre-injected)\\n try {\\n window.parent.postMessage({\\n type: 'MYOP_PREINJECTED_INIT',\\n payload: {\\n data: data,\\n duration: duration,\\n timestamp: Date.now()\\n }\\n }, '*');\\n } catch (e) {}\\n\\n // Cleanup: remove script tag and stored data\\n if (scriptEl && scriptEl.parentNode) {\\n scriptEl.parentNode.removeChild(scriptEl);\\n }\\n delete window.__myop_init_data;\\n };\\n\\n if (typeof window.myop_init_interface === 'function') {\\n // Function already exists - call immediately\\n callInitInterface(window.myop_init_interface);\\n } else {\\n // Function not yet defined - store data and watch for definition\\n window.__myop_init_data = data;\\n\\n var _original;\\n Object.defineProperty(window, 'myop_init_interface', {\\n configurable: true,\\n enumerable: true,\\n set: function(fn) {\\n _original = fn;\\n if (window.__myop_init_data !== undefined) {\\n var storedData = window.__myop_init_data;\\n delete window.__myop_init_data;\\n callInitInterface(fn);\\n }\\n },\\n get: function() {\\n return _original;\\n }\\n });\\n }\\n })();\\n <\\/script>");h.writeln($+P)}h.close();let ne=new _e(e,t,s,y,r);return ne.sizeMeta=f,ne.initiated().then(()=>{if((r==null?void 0:r.autoSize)===!1)return;let $=!1;ne.observeAutoSize({forceAutoSize:!0,onSizeChange:()=>{!$&&!(r!=null&&r.hidden)&&($=!0,ne.show())}})}),ne}if(a.shadowRootMode===fe.none){let c=document.createElement("template");c.innerHTML=a.HTML,d=c.content.firstElementChild,Vo().then(u=>{u.connectedCallback(d,d)})}else{let c=Ii(e.name+t.id);qo.includes(c)||(Mi(c,a.HTML,a.shadowRootMode),qo.push(c)),d=document.createElement(c)}return s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),d.id=p,r!=null&&r.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),this.appendChild(s,d,r),new Re(e,t,s,d,r)})}isMyopWebComponent(e){return e.trimStart().startsWith(gi)}extractWebComponentScript(e){let r=new DOMParser().parseFromString(e,"text/html").getElementById(yi);return(r==null?void 0:r.textContent)||null}executeWebComponentScript(e,t){if(Uo.has(t)){console.log("[MyopWebComponent] Script already executed for ".concat(t,", skipping"));return}let s=document.createElement("script");s.textContent=e,s.id="myop-extracted-".concat(t),document.head.appendChild(s),Uo.add(t),console.log("[MyopWebComponent] Executed web component script: ".concat(t))}async loadExtractedWebComponent(e,t,s,r,a){let p=this.extractWebComponentScript(r);if(!p)throw new Error('[MyopWebComponent] No <script id="myop-web-component"> found in HTML');let d="".concat(e.id,"-").concat(t.id),c=window.__MYOP_TAG_NAME__;this.executeWebComponentScript(p,d);let u=window.__MYOP_TAG_NAME__;if(!u)throw new Error("[MyopWebComponent] Script did not set window.__MYOP_TAG_NAME__");c&&c!==u&&console.warn("[MyopWebComponent] __MYOP_TAG_NAME__ changed from ".concat(c," to ").concat(u));let y="myop-comp-".concat(E()),h=document.createElement(u);h.id=y,a!=null&&a.hidden&&(h.style.opacity="0",h.style.position="absolute",h.style.height="0",h.style.width="0",h.style.pointerEvents="none",h.style.visibility="hidden"),s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),this.appendChild(s,h,a);let f=new ye(e,t,s,h,u,a);return(a==null?void 0:a.data)!==void 0&&f.initWithData(a.data),console.log("[MyopWebComponent] Loaded <".concat(u,"> into container")),f}}});var Go,Yo,Qo=m(()=>{"use strict";re();b();Go=(o,n,e)=>{let t="myop-css-".concat(E());return o.send(new k(({rootRef:s,_stylesheet:r,_tagId:a,_css:p})=>{let d=document.createElement("style");d.type="text/css";let c=p;for(let u in r){c+="".concat(u," { ");let y=r[u];for(let h in y)c+="".concat(h,": ").concat(y[h],"; ");c+="} "}d.appendChild(document.createTextNode(c)),d.id=a,(s.shadowRoot||s.container).appendChild(d)},()=>{},{_stylesheet:n,_css:e||"",_tagId:t})),()=>{o.send(new k(({rootRef:s,_tagId:r})=>{let a=(s.shadowRoot||document).getElementById(r);a&&a.remove()},()=>{},{_tagId:t}))}},Yo=(o,n)=>{let e="myop-css-".concat(E());return o.send(new k(({rootRef:t,_tagId:s,_link:r})=>{let a=document.createElement("link");a.id=s,a.rel="stylesheet",a.href=r,document.head.appendChild(a),(t.shadowRoot||t.container).appendChild(a)},()=>{},{_link:n,_tagId:e})),()=>{o.send(new k(({rootRef:t,_tagId:s})=>{let r=(t.shadowRoot||document).getElementById(s);r&&r.remove()},()=>{},{_tagId:e}))}}});var xi,In,Jo,Xo=m(()=>{"use strict";xi=(o,n)=>{let e=new RegExp(Object.keys(n).join("|"),"g");return o.replace(e,t=>(n[t]||t).toString())},In=(o,n)=>{let e=o.loader;if(e.type!=="IframeLoader")throw new Error('iframeSkinUrlTokenizer received skin with loader type "'.concat(e.type,'", currently only "IframeLoader" is supported'));return o.loader=M({},o.loader),o.loader.url=xi(o.loader.url,n),o},Jo=o=>async n=>In(n,o)});var Zo,es,ts=m(()=>{"use strict";b();Zo=(o,n,e)=>{o.send(new G(({ref:t,_className:s})=>{t==null||t.classList.add(s)},{elementId:e,_className:n}))},es=(o,n,e)=>{o.send(new G(({ref:t,_className:s})=>{t==null||t.classList.remove(s)},{elementId:e,_className:n}))}});var St,bt,Et,wt,ns=m(()=>{"use strict";re();St=class St{constructor(){i(this,"_runTimeInstanceId","runtime-instance-id-"+E());i(this,"_runTimeId","runtime-id-"+E());i(this,"_runTimeName","runtime-name-"+E());i(this,"id",this._runTimeId);i(this,"name",this._runTimeName);i(this,"description","");i(this,"loader",null);i(this,"withLoader",n=>(this.loader=n,this));i(this,"withHTMLLoader",n=>(n.type="HTMLLoader",this.loader=n,this));i(this,"build",()=>this)}};i(St,"create",()=>new St);bt=St,Et=class Et{constructor(){i(this,"_runTimeInstanceId","runtime-instance-id-"+E());i(this,"_runTimeId","runtime-id-"+E());i(this,"_runTimeName","runtime-name-"+E());i(this,"instance",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});i(this,"name",this._runTimeName);i(this,"type",{id:this._runTimeId,name:this._runTimeName,description:"",props:[],refs:[],skins:[],defaultSkin:0});i(this,"withInstance",n=>(this.instance=n,this));i(this,"withType",n=>(this.type=n,this));i(this,"withName",n=>(this.name=n,this));i(this,"withDefaultSkin",n=>(this.type.skins.push(n),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:"Dedicated",skin:{id:n.id}},this));i(this,"withRef",n=>(this.type.refs.push(n),this));i(this,"withBasicRef",n=>{let e={id:"",name:n,description:"",selectorType:"id-attribute",selector:n,behavior:{type:"code"}};return this.type.refs.push(e),this});i(this,"build",()=>JSON.parse(JSON.stringify(this)))}};i(Et,"create",()=>new Et);wt=Et});var bi,Tt,wi,Si,te,K,os,xn=m(()=>{"use strict";w();bi=o=>({instance:{id:"auto",componentId:o.componentId,componentName:o.name,skinSelector:{type:"Dedicated",skin:{id:"skin_auto_v2_converted"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:"in_auto_v2_converted",name:"myop_init_interface",type:"any",behavior:{type:Te.code}},{id:"out_auto_v2_converted",name:"myop_cta_handler",type:"any",behavior:{type:Te.code}}],refs:[],skins:[{id:"skin_auto_v2_converted",name:"auto_v2_converted",description:"",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),Tt="__MYOP_CLOUD_REPOSITORY_MAIN__",wi=()=>{if(typeof window<"u")return window[Tt];if(typeof globalThis<"u")return globalThis[Tt]},Si=o=>{typeof window<"u"&&(window[Tt]=o),typeof globalThis<"u"&&(globalThis[Tt]=o)},te=class te{constructor(n="https://cloud.myop.dev"){this._baseUrl=n;i(this,"variants",{});i(this,"preloadedComponents",{});i(this,"userFlows",{});i(this,"_defaultEnv","production");i(this,"_envExplicitlySet",!1)}static get Main(){let n=wi();return n||(te._main||(te._main=new te,Si(te._main)),te._main)}setEnvironment(n){this._defaultEnv=n,this._envExplicitlySet=!0}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(n,e,t){return e!==void 0||t!==void 0?"".concat(n,":").concat(e||this._defaultEnv,":").concat(t?"preview":"live")in this.variants:n in this.preloadedComponents}getPreloadedParams(n){return this.preloadedComponents[n]}async fetchComponentV2(n,e,t){let s=this.preloadedComponents[n],r=e!==void 0||t!==void 0,a,p;if(!r&&s)a=s.env,p=s.preview;else{a=e||this._defaultEnv;let c=e||this._envExplicitlySet;p=t===!0?!0:t===!1?!1:!c}let d="".concat(n,":").concat(a,":").concat(p?"preview":"live");return console.log("[CloudRepository] fetchComponentV2",{componentId:n.slice(0,8)+"...",env:a,usePreview:p,cacheKey:d,cached:d in this.variants}),this.variants[d]||(this.preloadedComponents[n]||(this.preloadedComponents[n]={env:a,preview:p}),this.variants[d]=new Promise(async(c,u)=>{try{let y="".concat(this._baseUrl,"/consume?id=").concat(n,"&env=").concat(a);p&&(y+="&preview=true");let l=(await(await fetch(y)).json()).item;if(!l){u(new Error('Component "'.concat(n,'" not found')));return}if(!l.consume_variant||!l.consume_variant.length){u(new Error('Component "'.concat(n,'" has no implementation for environment "').concat(a,'"')));return}let z=bi(l);this.variants[d].resolved=z,c(z)}catch(y){u(y)}})),await this.variants[d]}getResolvedConfig(n,e,t){var c;let s=this.preloadedComponents[n],r=e!==void 0||t!==void 0,a,p;if(!r&&s)a=s.env,p=s.preview;else{a=e||this._defaultEnv;let u=e||this._envExplicitlySet;p=t===!0?!0:t===!1?!1:!u}let d="".concat(n,":").concat(a,":").concat(p?"preview":"live");return((c=this.variants[d])==null?void 0:c.resolved)||null}async fetchComponentV1(n,e){return e?(await this.fetchFlow(e)).components.find(s=>s.type.id===n):(await this.fetchAutoFlow(n)).components[0]}async fetchAutoFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let r=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(n,"&auto=true"))).json();e(r.item)}catch(s){t(s)}})),await this.userFlows[n]}async fetchFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let r=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(n,"&resolve=components"))).json();e(r.item)}catch(s){t(s)}})),await this.userFlows[n]}async fetchComponent(n,e){return this.fetchComponentV1(n,e)}};i(te,"_main",null);K=te,os=K});var ss,is=m(()=>{"use strict";ss=async o=>await o()});var J,rs,as,ps,ds,cs,ms,ls,fs,us,gs=m(()=>{"use strict";xn();J=K.Main,rs=()=>J,as=(o,n,e)=>J.isPreloaded(o,n,e),ps=o=>J.getPreloadedParams(o),ds=()=>{J=new K("http://localhost:9292")},cs=o=>{J=new K(o)},ms=o=>{J=o},ls=o=>{J.setEnvironment(o)},fs=(o,n,e)=>J.getResolvedConfig(o,n,e),us=async(o,n,e)=>Promise.allSettled(o.map(t=>J.fetchComponentV2(t,n,e)))});var bn={};se(bn,{CloudRepository:()=>K,ComponentConfig:()=>wt,SkinConfig:()=>bt,addClass:()=>Zo,applyStylesheet:()=>Go,applyStylesheetLink:()=>Yo,changeSkinUrlByTokenizer:()=>Jo,createIframeSkinByTokenizer:()=>In,enableLocalDev:()=>ds,exec:()=>ss,getCloudRepository:()=>rs,getPreloadedParams:()=>ps,getResolvedConfig:()=>fs,isPreloaded:()=>as,preloadComponents:()=>us,removeClass:()=>es,setCloudRepository:()=>ms,setCloudRepositoryUrl:()=>cs,setEnvironment:()=>ls,v2_CloudRepository:()=>os});var vt=m(()=>{"use strict";Qo();Xo();ts();ns();xn();is();gs()});var ys,hs=m(()=>{"use strict";Vt();vt();w();ys=async o=>{try{let n=new URL(window.location.href),t=new URLSearchParams(n.search).get("myopOverride");if(t){let[s,...r]=qt(t);switch(s){case"component":{let[a,p]=r,d=await K.Main.fetchComponent(a);if(d&&d.type.skins.find(u=>u.id===p))return d.instance.skinSelector={type:ue.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=qt(t),c=(await K.Main.fetchFlow(a)).components.find(u=>u.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ue.Segmented&&c.instance.resolvedExperiences){let u=c.instance.resolvedExperiences.find(y=>y.id===p);if((u==null?void 0:u.type)===st.Segment){let y=u,f=c.instance.skinSelector.segments.find(l=>l.segmentId===y.segment.id);if(f)return c.instance.skinSelector=f==null?void 0:f.skinSelector,c}}}break}}}finally{return null}}});var Is={};se(Is,{HostSDK:()=>W,hostSDK:()=>Cs});var Ms,W,Cs,qe=m(()=>{"use strict";ie();C();b();Eo();To();je();w();tt();jo();hs();Ms="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",W=class{constructor(){i(this,"components2init",[]);i(this,"components",[]);i(this,"componentsLoaders",[]);i(this,"initiated",!1);i(this,"version",Ce);i(this,"type2InstanceCount",{});i(this,"assignId",n=>(this.type2InstanceCount[n.id]||(this.type2InstanceCount[n.id]=0),"".concat(n.id,"_").concat(++this.type2InstanceCount[n.id])));i(this,"inspected",!1);i(this,"inspect",()=>{this.inspected||(this.inspected=!0,this.components.forEach(n=>{n.inspect&&n.inspect()}))});i(this,"incomingMessageHandler",n=>{if(n.origin,document.location.origin,n.data.myop){if(n.data.direction!==v.up&&n.data.messageType!==g.EnvelopedMessage)return;let e=n.data;if(e.messageType===g.InitRequest){this.components2init.forEach(s=>{s.send(new Ie(s.id))});return}if(e.messageType===g.InitResponse){this.components2init=this.components2init.filter(r=>r.id!==e.content.id);let s=this.components.find(r=>{var a;return r.id===((a=e.content)==null?void 0:a.id)});s==null||s.setInitiated();return}if(e.messageType===g.EnvelopedMessage){let s=e,r=this.components.find(a=>a.id===s.destination);if(r){if(s.direction===v.down){s.message.messageType===A.name?r.onMessageReceived(s.message):(s.message.route=s.route,r.send(s.message));return}}else{let a=this.components.find(p=>p.id===s.message.destination);a&&a.send(s.message)}return}let t=this.components.find(s=>s.id===e.destination);if(!t){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(t){if(t.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});i(this,"send",n=>{let e=new MessageEvent("",{data:n});this.incomingMessageHandler(e)});i(this,"init",n=>{if(this.initiated)throw new Error("hostSDK already initiated");let e=[new rt,new pt,new xt];if(this.componentsLoaders=[...e],n){let t={};n.forEach(s=>{let r=new s(this.componentsLoaders);t[r.type]=r}),this.componentsLoaders.forEach(s=>{t[s.type]||(t[s.type]=s)}),this.componentsLoaders=Object.values(t)}window.addEventListener("message",this.incomingMessageHandler,!1),console.log("myop hostSDK initiated",document.location.href),this.initiated=!0});i(this,"_getSkinIdBySkinSelector",async(n,e=[],t)=>{var r;async function s(a,p){for(let d of a)if(await p(d))return d}switch(n.type){case"DedicatedSkin":case ue.Dedicated:return((r=n.skin)==null?void 0:r.id)||n.skins[0].id;case ue.Segmented:{let p=await s(n.segments,async d=>{if(d.segmentId==="Default")return!0;let c=e.find(f=>f.type===st.Segment?f.segment.id===d.segmentId:!1);if(!c)throw new Error("experience not found");let y=c.segment,h=(t||{})[y.function];return h?await h():(console.warn("segmentId:".concat(d.segmentId,", ").concat(y.function," function not provided !")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return""});i(this,"runSkinSelector",async(n,e)=>{let t=await this._getSkinIdBySkinSelector(n.instance.skinSelector,n.instance.resolvedExperiences,e);return n.type.skins.find(s=>s.id===t)});i(this,"loaderHooks");i(this,"loadComponent",async(n,e,t)=>{var u,y,h,f;if(!e){debugger;throw new Error("no container was found for this component")}let s=await ys(n);s&&(n=s);let r=M(M({},(u=this.loaderHooks)!=null?u:{}),(y=t==null?void 0:t.hooks)!=null?y:{}),a=e;if(a.myop)if(a.component){n=M({},n),n.instance=M({},n.instance);let l=await this.runSkinSelector(n,r);if(!l)throw new Error("runSkinSelector failed to choose skin, check the provided config");return(h=t==null?void 0:t.hooks)!=null&&h.afterSkinSelected&&(l=await t.hooks.afterSkinSelected(M({},l))),n.instance.skinSelector={type:ue.Dedicated,skin:l},t&&(t=M({},t),delete t.hooks),await ln(a,n,this.components,t)}else throw new Error("load component got a detached ref.");e=e;let p=await this.runSkinSelector(n,r);if(!p)throw new Error("runSkinSelector failed to choose skin, check the provided config");(f=t==null?void 0:t.hooks)!=null&&f.afterSkinSelected&&(p=await t.hooks.afterSkinSelected(M({},p)));let d=this.componentsLoaders.find(l=>l.type===p.loader.type);if(!d){debugger;throw new Error('no loader "'.concat(p.loader.type,'" was found for component'))}let c=await d.load(n.type,p,e,t);c.isInitiated||this.components2init.push(c),c.bind("onDispose",()=>(this.components=this.components.filter(l=>l!==c),this.components2init=this.components2init.filter(l=>l!==c),!0)),this.components.push(c),(!t||t.connectProps!==!1)&&(c=So(c,n.type.props,p));try{await fn(c,n,this.components)}catch(l){throw l}return t!=null&&t.skipInit||await c.initiated(),c});i(this,"navigate",async(n,e,t)=>{if(n.parent)throw new Error("Navigating on remote ref components is not implemented yet");if(t!=null&&t.staged){let s=await this.loadComponent(e,n.container,M({hidden:!0,relative:{direction:"after",child:n.element}},t));return t.init&&await t.init(s),s.show(),n.dispose(),s}else{let s=n.element.nextSibling;return n.dispose(),this.loadComponent(e,n.container,M({relative:{direction:"before",child:s}},t))}})}};i(W,"Instance",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ms});if(!window.myop.hostSDK){let o=new W;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ms}),window.myop.hostSDK=o}Cs=window.myop.hostSDK;N("hostSDK",Cs)});var _t,xs=m(()=>{"use strict";C();ee();w();b();_t=class extends x{constructor(){super(...arguments);i(this,"messageType",g.DetectMyopRefsMessage);i(this,"executor",e=>{let t=document.querySelectorAll("[".concat(D.id,"]")),s=[];t.forEach(r=>{let a=r.getAttribute(D.id);a&&s.push(new be(a,r.tagName,r.getBoundingClientRect()))}),this.messageToHost(new le(e.handlerUniqueId,s))})}}});var Rt,bs=m(()=>{"use strict";C();w();b();L();Rt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.BindClickMessage);i(this,"executor",e=>{let t=[];return S(e.ref,document).forEach(r=>{let a=()=>{this.messageToHost(new ae,e)};r.addEventListener("click",a);let p=()=>{r.removeEventListener("click",a)};t.push(p)}),()=>{t.forEach(r=>r())}})}}});var Ht,ws=m(()=>{"use strict";C();w();L();Ht=class extends x{constructor(){super(...arguments);i(this,"messageType",g.ChangeTextMessage);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.textContent=e.content})})}}});var kt,Ss=m(()=>{"use strict";C();b();w();Mn();kt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.ExecuteScriptMessage);i(this,"executor",e=>{yt(e,s=>{this.messageToHost(new pe(e.handlerUniqueId,s))},new Ee(document.documentElement))})}}});var Dt,Es=m(()=>{"use strict";C();w();b();ge();L();Dt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.AddEventListenerMessage);i(this,"executor",e=>{let t=S(e.ref,document),s=[];return t.forEach(r=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new de(e.handlerUniqueId,O(p,e.serializableSkeleton)))})};r.addEventListener(e.type,a),s.push(()=>{r.removeEventListener(e.type,a)})}),()=>{s.forEach(r=>{r()})}})}}});var Bt,Ts=m(()=>{"use strict";C();w();L();Bt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetAttributeMessage);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.setAttribute(e.name,e.value)})})}}});var Lt,vs=m(()=>{"use strict";C();ee();w();qe();nt();Lt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.CreateRefComponentMessage);i(this,"executor",e=>{(async()=>{let s=document.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(s.length===1){let a=await W.Instance().loadComponent(e.nestedComponentConfig,s.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new Y(e.handlerUniqueId,p))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new Y(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var _s,Rs=m(()=>{"use strict";_s=(o,n)=>{if(!o){console.log("n");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let t=new e(n),s={attributes:!0,childList:!0,subtree:!0};return t.observe(o,s),t}else window.addEventListener&&(o.addEventListener("DOMNodeInserted",n,!1),o.addEventListener("DOMNodeRemoved",n,!1))}});var Pt,Hs=m(()=>{"use strict";C();b();w();Rs();Pt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetMutationObserverMessage);i(this,"executor",e=>{e.source&&_s(document.body,()=>{this.messageToHost(new ze)})})}}});var ks,Ot,Ds=m(()=>{"use strict";C();ee();w();b();ge();L();ks=o=>{if(!o)return null;if(o.tagName==="FORM"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll("input, select, textarea"),s=-1;return t.forEach(r=>{if(typeof r.value=="string"){let a=r.getAttribute(D.id),p=r.getAttribute("name"),d={id:r.id,name:p,value:ks(r),required:r.required,validity:O(r.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Ot=class extends x{constructor(){super(...arguments);i(this,"messageType",g.GetElementValueMessage);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{this.messageToHost(new ce(ks(s)),e)})})}}});var At,Bs=m(()=>{"use strict";C();w();b();L();At=class extends x{constructor(){super(...arguments);i(this,"messageType",g.GetAttributeMessage);i(this,"executor",e=>{let t=vo(e.ref,document);t&&this.messageToHost(new Ke(t.getAttribute(e.name)),e)})}}});var Kt,Ls=m(()=>{"use strict";b();C();w();Kt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetResizeObserverMessage);i(this,"executor",e=>{let t=new ResizeObserver(s=>{this.messageToHost(new Ne)});return t.observe(document.body),()=>{t.disconnect()}})}}});var zt,Ps=m(()=>{"use strict";C();w();L();zt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetInnerHtml);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.innerHTML=e.content})})}}});var Os={};se(Os,{IframeSDK:()=>$t});var $t,As=m(()=>{"use strict";w();xs();bs();ws();Ss();ie();Es();Ts();b();vs();Hs();Ds();tt();Bs();Ls();Ps();$t=class extends we{constructor(){super();i(this,"version",Ce);i(this,"messageToHost",(e,t)=>{var r;!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId);let s=Object.keys(this.components);e.destination||(t!=null&&t.route?e.destination=t.route[t.route.length-1]:e.destination=s[0]),e.source||(e.source=s[0]),e.direction=v.up,(r=window.parent)==null||r.postMessage(M({},e),"*")});i(this,"supportedHandlers",[new Ht(this.messageToHost),new zt(this.messageToHost),new Rt(this.messageToHost),new _t(this.messageToHost),new kt(this.messageToHost),new Dt(this.messageToHost),new Bt(this.messageToHost),new Ot(this.messageToHost),new Pt(this.messageToHost),new Kt(this.messageToHost),new At(this.messageToHost),new Lt(this.messageToHost)]);i(this,"init",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new me)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};N("IframeSDK",$t)});var Ti={};var Ei,Ks=m(()=>{"use strict";b();ie();Ei=M({},xe);N("MyopMessages",Ei)});var zs={};se(zs,{CloudRepository:()=>K,ComponentConfig:()=>wt,SkinConfig:()=>bt,addClass:()=>Zo,applyStylesheet:()=>Go,applyStylesheetLink:()=>Yo,changeSkinUrlByTokenizer:()=>Jo,createIframeSkinByTokenizer:()=>In,enableLocalDev:()=>ds,exec:()=>ss,getCloudRepository:()=>rs,getPreloadedParams:()=>ps,getResolvedConfig:()=>fs,isPreloaded:()=>as,preloadComponents:()=>us,removeClass:()=>es,setCloudRepository:()=>ms,setCloudRepositoryUrl:()=>cs,setEnvironment:()=>ls,v2_CloudRepository:()=>os});var $s=m(()=>{"use strict";ie();vt();vt();N("MyopHelpers",bn)});var ki={};se(ki,{getHostModule:()=>Ws,getIframeModule:()=>Fs,getWebcomponentModule:()=>Ns});ie();var Nn;if(window.__federation__)console.log("__federation__ loaded more than once.");else{let o=(Nn=document.currentScript)==null?void 0:Nn.src,n=o?o.split("/").slice(0,-1).join("/"):"";window.__federation__={__public_auto_path__:n,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,n,e)=>{if(window.__federation__[n])console.log("__federation__ module ".concat(n," already loaded.")),e(window.__federation__[n][Ut]);else{let t;window.__federation__[n]={},window.__federation__[n][et]=r=>{t&&(document.head.removeChild(t),t=null),window.__federation__[n][Ut]=r,e(r)};let s=r=>{t=document.createElement("script"),t.type="module",t.src=r,t.async=!0,t.onerror=()=>{var d,c;let a=(c=(d=window.myop)==null?void 0:d.__ROOT_SDK_PUBLIC_URL__)==null?void 0:c.split("/").slice(0,-1).join("/"),p=r.split("/").pop();a&&!r.startsWith(a)&&(console.warn("[myop] chunk load failed from ".concat(r,", retrying from CDN")),document.head.removeChild(t),s("".concat(a,"/").concat(p)))},document.head.appendChild(t)};s(o)}};tt();console.log("myop root sdk - loaded",document.location.origin);var vi="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",Ws=()=>Promise.resolve().then(()=>(qe(),Is)),Fs=()=>Promise.resolve().then(()=>(As(),Os)),Ns=()=>Promise.resolve().then(()=>(Cn(),zo)),_i=()=>Promise.resolve().then(()=>(Ks(),Ti)),Ri=()=>Promise.resolve().then(()=>($s(),zs)),Ge=o=>async()=>(await o()).get(),Hi={version:Ce,getHostModule:Ge(Ws),getIframeModule:Ge(Fs),getWebcomponentModule:Ge(Ns),getMyopMessages:Ge(_i),getMyopHelpers:Ge(Ri)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:vi});window.myop.rootSDK?console.log("myop root host loaded more than once."):window.myop=M({rootSDK:Hi},window.myop);return ri(ki);})();
|
|
8
|
+
export const EMBEDDED_SDK_CONTENT = `"use strict";var MyopSDK=(()=>{var Xe=Object.defineProperty,ei=Object.defineProperties,ti=Object.getOwnPropertyDescriptor,ni=Object.getOwnPropertyDescriptors,oi=Object.getOwnPropertyNames,Wn=Object.getOwnPropertySymbols;var Fn=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable;var Nt=(o,n,e)=>n in o?Xe(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e,M=(o,n)=>{for(var e in n||(n={}))Fn.call(n,e)&&Nt(o,e,n[e]);if(Wn)for(var e of Wn(n))si.call(n,e)&&Nt(o,e,n[e]);return o},j=(o,n)=>ei(o,ni(n));var m=(o,n)=>()=>(o&&(n=o(o=0)),n);var se=(o,n)=>{for(var e in n)Xe(o,e,{get:n[e],enumerable:!0})},ii=(o,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of oi(n))!Fn.call(o,s)&&s!==e&&Xe(o,s,{get:()=>n[s],enumerable:!(t=ti(n,s))||t.enumerable});return o};var ri=o=>ii(Xe({},"__esModule",{value:!0}),o);var i=(o,n,e)=>Nt(o,typeof n!="symbol"?n+"":n,e);var Ze,et,Ut,N,ie=m(()=>{"use strict";Ze="__federation__",et="onLoad",Ut="moduleInstance",N=(o,n)=>{window[Ze]&&window[Ze][o]&&window[Ze][o][et]&&window[Ze][o][et]({[o]:n})}});var Ce,tt=m(()=>{Ce="0.3.28"});var g,C=m(()=>{"use strict";g={InitRequest:"InitRequest",InitResponse:"InitResponse",InitMessage:"InitMessage",DisposeMessage:"DisposeMessage",ChangeTextMessage:"ChangeTextMessage",BindClickMessage:"BindClickMessage",DetectMyopRefsMessage:"DetectMyopRefsMessage",ExecuteScriptMessage:"ExecuteScriptMessage",AddEventListenerMessage:"AddEventListenerMessage",SetAttributeMessage:"SetAttributeMessage",CreateRefComponentMessage:"CreateRefComponentMessage",EnvelopedMessage:"EnvelopedMessage",GetElementValueMessage:"GetElementValueMessage",GetAttributeMessage:"GetAttributeMessage",SetInnerHtml:"SetInnerHtml",ExecuteComponentMethod:"ExecuteComponentMethod",SetMutationObserverMessage:"SetMutationObserverMessage",SetResizeObserverMessage:"SetResizeObserverMessage",CleanupMessage:"CleanupMessage",In:{DetectedMyopRefsMessage:"DetectedMyopRefsMessage",ClickReplayMessage:"ClickReplayMessage",ExecuteScriptReplyMessage:"ExecuteScriptReplyMessage",EventListenerCallbackMessage:"EventListenerCallbackMessage",ElementValueReplayMessage:"ElementValueReplayMessage",GetAttributeReplayMessage:"GetAttributeReplayMessage",RefComponentCreatedMessage:"RefComponentCreatedMessage",EnvelopedMessage:"EnvelopedMessage",MutationObserverMessage:"MutationObserverMessage",CleanupReplayMessage:"CleanupReplayMessage",ResizeObserverMessage:"ResizeObserverMessage"}}});var E,ai,pi,qt,Vt=m(()=>{"use strict";E=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+o/4).toString(16)),ai=o=>{let n=[...o].map(e=>e.toString(16).padStart(2,"0")).join("");return[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20)].join("-")},pi=o=>{let n=o.replace(/-/g,"+").replace(/_/g,"/");for(;n.length%4;)n+="=";let e=atob(n);return Uint8Array.from(e,t=>t.charCodeAt(0))},qt=o=>{let n=pi(o);if(n.length%16!==0)throw new Error("Invalid input length");let e=[];for(let t=0;t<n.length;t+=16)e.push(ai(n.slice(t,t+16)));return e}});var Un,re=m(()=>{"use strict";Vt();Un=o=>new Promise(n=>setTimeout(n,o))});var v,I,jt,_,R,X,H=m(()=>{"use strict";re();v=class{};i(v,"down","down"),i(v,"up","up");I=class{constructor(){i(this,"id",E());i(this,"myop",!0);i(this,"content");i(this,"source");i(this,"destination");i(this,"route");i(this,"ref");i(this,"direction");i(this,"cleanable",!1)}static create(...n){return new this(...n)}isTypeof(n){return n.messageType===this.messageType}},jt=class extends I{constructor(e){super();this.ref=e}},_=class extends I{constructor(e){super();this.replayToHandler=e}},R=class extends I{constructor(e){super();this.handler=e;i(this,"handlerUniqueId",E())}},X=class o{constructor(n,e){this.refConfig=n;this.component=e;i(this,"myop",!0);i(this,"__nonProxied");this.__nonProxied=j(M({},this),{component:null})}static create(n,e,t){let s=e;return s||(s={id:"",name:"",description:"",selectorType:"id-attribute",selector:n,behavior:{type:"code"}}),new o(s,t)}}});var qn,Gt,ae,Vn=m(()=>{"use strict";H();qn="ClickReplayMessage",Gt=class extends R{constructor(e,t){super(t);this.ref=e;i(this,"replyMessageKey",qn);i(this,"messageType","BindClickMessage");i(this,"cleanable",!0)}},ae=class extends _{constructor(){super(...arguments);i(this,"messageType",qn)}}});var Yt,jn=m(()=>{"use strict";H();Yt=class extends I{constructor(e,t){super();this.ref=e;i(this,"messageType","ChangeTextMessage");this.content=t}}});var Gn,di,ci,Yn,k,pe,Qt=m(()=>{"use strict";H();Gn="ExecuteScriptReplyMessage",di=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,ci=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,Yn=o=>{let n=o.match(di);if(n)return n[1]||n[3];{let e=o.match(ci);if(e)return e[1].trim()}},k=class extends R{constructor(e,t=()=>{},s){super(t);this.scriptInputs=s;i(this,"replyMessageKey",Gn);i(this,"messageType","ExecuteScriptMessage");i(this,"script","");this.script=e.toString(),this.content=e.toString(),this.content=Yn(this.content)}};i(k,"replierKey","send"),i(k,"completeStreamKey","completeStream");pe=class extends _{constructor(e,t){super(e);this.replayToHandler=e;this.content=t;i(this,"messageType",Gn)}}});var G,Qn=m(()=>{"use strict";Qt();G=class extends k{constructor(e,t,s=()=>{}){super(({rootRef:r,elementId:a,_script:p,__scriptInputs:d})=>{let c=(r.shadowRoot||r.container).querySelectorAll("[myop-id='".concat(a,"']"));return c.length?(d.ref=c[0],new Function("return (".concat(p,")(...arguments)"))(d)):null},s);this.scriptInputs=t;this.scriptInputs=j(M({},t),{_script:e.toString()})}}});var Jn,Jt,de,Xn=m(()=>{"use strict";H();Jn="EventListenerCallbackMessage",Jt=class extends R{constructor(e,t,s){super(s);this.ref=e;this.type=t;this.handler=s;i(this,"replyMessageKey",Jn);i(this,"messageType","AddEventListenerMessage");i(this,"cleanable",!0);i(this,"serializableSkeleton",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},de=class extends _{constructor(e,t){super(e);this.replayToHandler=e;this.e=t;i(this,"messageType",Jn);this.content={e:t}}}});var Xt,Zn=m(()=>{"use strict";H();Xt=class extends I{constructor(e,t,s){super();this.ref=e;this.name=t;this.value=s;i(this,"messageType","SetAttributeMessage")}}});var eo,Zt,ce,en=m(()=>{"use strict";H();eo="ElementValueReplayMessage",Zt=class extends R{constructor(e,t){super(t);this.ref=e;i(this,"replyMessageKey",eo);i(this,"messageType","GetElementValueMessage")}},ce=class extends _{constructor(e){super();this.content=e;i(this,"messageType",eo)}}});var tn,to=m(()=>{"use strict";H();tn=class extends I{constructor(e,t){super();this.ref=e;i(this,"messageType","SetInnerHtml");this.content=t}}});var Ie,Pe,me,no=m(()=>{"use strict";H();Ie=class extends I{constructor(e){super();i(this,"messageType","InitMessage");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Pe=class extends Ie{constructor(){super(...arguments);i(this,"messageType","InitResponse")}},me=class extends I{constructor(){super(...arguments);i(this,"messageType","InitRequest")}}});var oo,Oe,Y,nt=m(()=>{"use strict";H();oo="RefComponentCreatedMessage",Oe=class extends R{constructor(e,t,s,r){super(r);this.refConfig=e;this.nestedComponentConfig=t;this.options=s;i(this,"replyMessageKey",oo);i(this,"messageType","CreateRefComponentMessage")}},Y=class extends _{constructor(e,t,s){super(e);this.replayToHandler=e;this.nestedRefs=t;this.failed=s;i(this,"messageType",oo)}}});var Ae,nn=m(()=>{"use strict";H();Ae=class extends I{constructor(e,t){super();this.destination=e;this.message=t;i(this,"messageType","EnvelopedMessage");let s=t;this.route=[e,...s.route?s.route:[]]}}});var so,on,le,io=m(()=>{"use strict";H();so="DetectedMyopRefsMessage",on=class extends R{constructor(){super(...arguments);i(this,"messageType","DetectMyopRefsMessage");i(this,"replyMessageKey",so)}},le=class extends _{constructor(e,t){super(e);this.replayToHandler=e;i(this,"messageType",so);this.content=t}isTypeof(e){return e.messageType===this.messageType}}});var ro,sn,Ke,ao=m(()=>{"use strict";H();ro="GetAttributeReplayMessage",sn=class extends R{constructor(e,t,s){super(s);this.ref=e;this.name=t;i(this,"replyMessageKey",ro);i(this,"messageType","GetAttributeMessage")}},Ke=class extends _{constructor(e){super();this.content=e;i(this,"messageType",ro)}}});var A,po=m(()=>{"use strict";H();A=class extends I{constructor(e){super();this.method=e;i(this,"messageType","ExecuteComponentMethod")}}});var rn,ze,co=m(()=>{"use strict";H();rn=class extends I{constructor(){super(...arguments);i(this,"messageType","SetMutationObserverMessage")}},ze=class extends I{constructor(){super(...arguments);i(this,"messageType","MutationObserverMessage")}}});var mo,$e,We,lo=m(()=>{"use strict";H();mo="CleanupReplayMessage",$e=class extends R{constructor(e,t){super(t);this.cleanupForMessageId=e;i(this,"replyMessageKey",mo);i(this,"messageType","CleanupMessage")}},We=class extends _{constructor(e){super();this.customCleanup=e;i(this,"messageType",mo)}}});var Fe,fo=m(()=>{"use strict";H();Fe=class extends I{constructor(){super(...arguments);i(this,"messageType","DisposeMessage")}}});var an,Ne,uo=m(()=>{"use strict";H();an=class extends I{constructor(){super(...arguments);i(this,"cleanable",!0);i(this,"messageType","SetResizeObserverMessage")}},Ne=class extends I{constructor(){super(...arguments);i(this,"messageType","ResizeObserverMessage")}}});var xe={};se(xe,{AddEventListenerMessage:()=>Jt,BaseMyopMessage:()=>I,BindClickMessage:()=>Gt,ChangeTextMessage:()=>Yt,CleanupMessage:()=>$e,CleanupReplayMessage:()=>We,ClickReplayMessage:()=>ae,CreateRefComponentMessage:()=>Oe,CustomRefMessage:()=>G,DetectMyopRefsMessage:()=>on,DetectedMyopRefsMessage:()=>le,DisposeMessage:()=>Fe,ElementValueReplayMessage:()=>ce,EnvelopedMessage:()=>Ae,EventListenerCallbackMessage:()=>de,ExecuteComponentMethod:()=>A,ExecuteScriptMessage:()=>k,ExecuteScriptReplyMessage:()=>pe,GetAttributeMessage:()=>sn,GetAttributeReplayMessage:()=>Ke,GetElementValueMessage:()=>Zt,InitMessage:()=>Ie,InitRequest:()=>me,InitResponse:()=>Pe,MessageDirection:()=>v,MutationObserverMessage:()=>ze,MyopBindMessage:()=>R,MyopBindReplayMessage:()=>_,MyopElementMessage:()=>jt,Ref:()=>X,RefComponentCreatedMessage:()=>Y,ResizeObserverMessage:()=>Ne,SetAttributeMessage:()=>Xt,SetInnerHtml:()=>tn,SetMutationObserverMessage:()=>rn,SetResizeObserverMessage:()=>an,stripFunction:()=>Yn});var b=m(()=>{"use strict";H();Vn();jn();Qt();Qn();Xn();Zn();en();to();no();nt();nn();io();en();ao();po();co();lo();fo();uo()});var U,Ue=m(()=>{"use strict";C();b();qe();U=class{constructor(n,e,t){this.componentDefinition=n;this.container=e;i(this,"id","");i(this,"messageHandlers",{});i(this,"element");i(this,"_markedForDisposed",!1);i(this,"bind",(n,e)=>{this.messageHandlers[n]||(this.messageHandlers[n]=[]),this.messageHandlers[n].includes(e)||this.messageHandlers[n].push(e)});i(this,"bindWhen",(n,e,t)=>{if(!t)throw new Error("can't use component.bindWhen without an handler");this.messageHandlers[n]||(this.messageHandlers[n]=[]);let s=this.messageHandlers[n],r=a=>e(a)?(t(a),!0):!1;return s.push(r),()=>{let a=s.indexOf(r);a>-1&&s.splice(a,1)}});i(this,"setInitiated",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});i(this,"isInitiated",!1);i(this,"_whenInitiatedResolve");i(this,"_whenInitiatedReject");i(this,"_whenInitiated",new Promise((n,e)=>{this._whenInitiatedResolve=n,this._whenInitiatedReject=e}));i(this,"initiated",()=>this._whenInitiated);i(this,"props",{});i(this,"refs",{});this.id=(t==null?void 0:t.id)||W.Instance().assignId(n);let s=t!=null&&t.timeout?t==null?void 0:t.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject("timeout_".concat(s," ").concat(this.id))},s),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(n){if(this._markedForDisposed)throw new Error("InvalidOperationException: The component is already in the process of being disposed. Dispose operation cannot be performed again until the current disposal process is complete.");this._markedForDisposed=n}onMessageReceived(n){if(n.messageType===g.ExecuteComponentMethod){let t=n;return this[t.method]?this[t.method](t.content):console.log("method not found ".concat(t.method," on component"),this),!0}let e=this.messageHandlers[n.messageType];if(e&&e.length){let t=!1;return e.forEach(s=>{t=t||s(n)}),t}return!1}sendCleanupMessage(n){n.source=this.id,n.destination=this.id,n.direction=v.down;let e=this.bindWhen(n.replyMessageKey,s=>s.replayToHandler===n.handlerUniqueId,s=>{n.handler(s),e()}),t=n.handler;delete n.handler,this.send(n),n.handler=t}send(n){n.source||(n.source=this.id),n.destination||(n.destination=this.id),n.direction=v.down;let e;if(n.handler){let t=n;e=this.bindWhen(t.replyMessageKey,s=>s.replayToHandler===t.handlerUniqueId,t.handler),delete n.handler}return n.ref&&(n.ref=n.ref.__nonProxied||n.ref),n.cleanable?()=>{this.sendCleanupMessage(new $e(n.id,t=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log("disposing component",this.id),this.send(new Fe);let n=this.messageHandlers.onDispose;n&&n.forEach(e=>{e(null)}),this.messageHandlers={},this.id+="_disposed",this.isInitiated=!1}}});var be,go=m(()=>{"use strict";be=class{constructor(n,e,t,s,r){this.myopId=n;this.htmlTagName=e;this.BoundingRect=t;this.offsetTop=s;this.offsetLeft=r;i(this,"type","MyopElementRef")}}});var yo,x,ot,ho=m(()=>{"use strict";yo=async o=>{if(typeof o=="function")o();else if(o instanceof Promise){let n=await o;typeof n=="function"&&n()}},x=class{constructor(n){this.messageToHost=n}},ot=class extends x{constructor(e,t){super(e);this.messageToHost=e;this.context=t}}});var pn,we,Mo=m(()=>{"use strict";C();w();b();pn=class{constructor(n,e){this.id=n;this.context=e;i(this,"send",n=>{})}},we=class{constructor(){i(this,"messageToHandleAfterInit",[]);i(this,"components",{});i(this,"alwaysPassEnvelopesToHost",!1);i(this,"messageCleanupCache",{})}handleIncomeMessages(n){let e=n.data?n.data:n.detail;if(!(!e||!e.myop)){let t=e;if(t.direction!==v.down)return;if(t.messageType===g.DisposeMessage){t.destination&&delete this.components[t.destination];return}if(t.messageType===g.InitMessage){let s=t.content.id;if(this.components[s])return;this.components[s]=new pn(s),this.messageToHost(new Pe(s));return}if(t.messageType===g.EnvelopedMessage){let s=t,r=s.message;if(t=r,this.alwaysPassEnvelopesToHost||this.components[t.destination]){let a=myop.hostSDK.components.find(d=>d.id===r.destination);if(a){a.send(r);return}let p=myop.hostSDK.components.find(d=>d.id===s.destination);if(p){p.send(r);return}}else return}if(t.messageType){if(t.messageType===g.CleanupMessage){let r=t,a=this.messageCleanupCache[r.cleanupForMessageId],p=new We(!!a);p.destination=t.destination,a?(delete this.messageCleanupCache[r.cleanupForMessageId],yo(a).then(()=>{this.messageToHost(p,r)}).catch(()=>{})):this.messageToHost(p,r);return}let s=!1;this.supportedHandlers.forEach(r=>{if(r.messageType===t.messageType){s=!0;let a=r.executor(t);if(t.cleanable&&a&&(this.messageCleanupCache[t.id]=a),a&&!t.cleanable)throw new Error("Cleanup handler generated for non-cleanable message. \\nmessageType - ".concat(t.messageType,", handler executor was - ").concat(r.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."));if(!a&&t.cleanable)throw new Error("No cleanup handler generated for a cleanable message. \\nmessageType - ".concat(t.messageType,", handler executor was - ").concat(r.executor,"\\n\\nPlease review the message definition object & message handler.\\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers."))}})}else console.log("unsupported message type")}}}});var Q,fe,Te,Se,ue,st,Ee,w=m(()=>{"use strict";go();ho();Mo();Q={IframeLoader:"IframeLoader",WebComponentLoader:"WebComponentLoader",HTMLLoader:"HTMLLoader",MinimizedLoader:"MinimizedLoader"},fe={open:"open",closed:"closed",none:"none",localFrame:"localFrame"},Te={message:"message",code:"code"},Se=class{};i(Se,"code","code"),i(Se,"component","component");ue={Segmented:"Segmented",Dedicated:"Dedicated",Default:"Default"},st={Segment:"Segment",Promo:"Promo",AB:"AB"},Ee=class{constructor(n,e){this.container=n;this.shadowRoot=e;i(this,"getRootDiv",()=>(this.shadowRoot||this.container).querySelector("div"));i(this,"getRoot",()=>this.shadowRoot||this.container)}}});var dn,mi,cn,O,ge=m(()=>{"use strict";dn=o=>o!==Object(o),mi=o=>typeof o=="function",cn=o=>{if(dn(o))return!0;if(mi(o)||Object.getPrototypeOf(o))return!1;for(let n in o){let e=o[n];if(typeof e=="object"){if(!cn(e))return!1}else{if(dn(e))continue;return!1}}return!0},O=(o,n={},e=!0,t=new WeakMap)=>{if(dn(o))return o;if(Array.isArray(o)){if(t.has(o))return t.get(o);let s=[];t.set(o,s);for(let r=0;r<o.length;r++){let a=o[r];s[r]=O(a,n,e,t)}return s}if(o!==null&&typeof o=="object"){if(t.has(o))return t.get(o);let s={};t.set(o,s);for(let r in o){let a=typeof n=="boolean"?n:n[r];a&&(a===!0?(e?o[r]!==void 0:o[r])&&(s[r]=O(o[r],!0,e,t)):typeof a=="object"&&(s[r]=O(o[r],a,e,t)))}return s}return{}}});var Co,Io=m(()=>{"use strict";Co={notSerializableRefCall:(o,n)=>{throw new Error("\\nThe input provided to '".concat(o.toString(),"' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \\nThe following types of data are considered non-serializable and cannot be processed:\\n\\n- Functions\\n- DOM elements\\n- Class instances\\n- Circular references\\n- Symbols\\n- BigInt values\\n\\nIn the following execution we detected :\\n~~~~~~~~\\n").concat(n," \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '").concat(o.toString(),"' are in a serializable format.\\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \\nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\\n\\nSuggested Fix:\\n1. Remove or replace non-serializable values from your input.\\n2. If using objects, ensure they do not contain any functions or circular references.\\n3. Convert any class instances to plain objects or JSON-compatible formats.\\n4. Use dedicated Myop message.\\n\\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev.\\n\\n"))}}});var Ve,xo=m(()=>{"use strict";Ue();b();nn();Ve=class extends U{constructor(e,t,s){super(e,t.container,s);this.componentDefinition=e;this.parent=t;i(this,"send",e=>{let t=e.handler,s=super.send(e);return this.parent.send(new Ae(this.id,e)),e.handler=t,s});i(this,"dispose",()=>{this.isInitiated&&this.send(new A("dispose")),super.dispose()})}hide(){this.send(new A("hide"))}show(){this.send(new A("show"))}inspect(){return this.send(new A("inspect"))}setHeightBasedOnDocumentElement(){this.send(new A("setHeightBasedOnDocumentElement"))}setHeightBasedOnScrollHeight(){this.send(new A("setHeightBasedOnScrollHeight"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var ye,mn=m(()=>{"use strict";Ue();je();ye=class extends U{constructor(e,t,s,r,a,p){super(e,s,p);this.container=s;this.customElement=r;this.tagName=a;i(this,"ctaCleanup");i(this,"_ctaHandler");i(this,"_ctaQueue",[]);i(this,"cleanupInspect",()=>{});i(this,"send",e=>{let t=super.send(e);return console.debug("[MyopExtractedWebComponent] send() called - web components use direct API instead",e),t});i(this,"dispose",()=>{var e;this.ctaCleanup&&this.ctaCleanup(),super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=r,this.setInitiated()}inspect(){return this.cleanupInspect=ve(this.id,"MyopExtractedWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){this.customElement.style.opacity="0",this.customElement.style.position="absolute",this.customElement.style.pointerEvents="none",this.customElement.style.visibility="hidden",this.customElement.style.height="0",this.customElement.style.width="0"}show(){this.customElement.style.opacity="1",this.customElement.style.position="unset",this.customElement.style.pointerEvents="all",this.customElement.style.visibility="visible",this.customElement.style.height="",this.customElement.style.width=""}initWithData(e){typeof this.customElement.myop_init_interface=="function"&&this.customElement.myop_init_interface(e)}getData(){if(typeof this.customElement.myop_init_interface=="function")return this.customElement.myop_init_interface()}setCtaHandler(e){if(this.ctaCleanup&&this.ctaCleanup(),this._ctaHandler=e,this._ctaQueue.length>0){let s=[...this._ctaQueue];this._ctaQueue=[],s.forEach(r=>{this.markedForDisposed||e(r.action,r.payload)})}let t=s=>{var a;let r=s;(a=r.detail)!=null&&a.action&&(this._ctaHandler&&!this.markedForDisposed?this._ctaHandler(r.detail.action,r.detail.payload):this._ctaHandler||this._ctaQueue.push({action:r.detail.action,payload:r.detail.payload}))};this.customElement.addEventListener("myop-cta",t),this.ctaCleanup=()=>{this.customElement.removeEventListener("myop-cta",t)}}}});var li,ve,bo,wo,So,fi,ln,fn,je=m(()=>{"use strict";b();b();w();ge();Io();xo();mn();li=(o,n,e)=>{let t=document.createElement("a");return t.textContent=o,t.style.position="relative",t.style.padding="0 5px",t.style.fontSize="14px",t.style.top="0",t.style.top="".concat(n,"px"),t.style.transform="translateX(-50%)",t.target="_blank",t.href="https://dashboard.myop.dev/dashboard/component/".concat(e.id),t},ve=(o,n,e,t,s,r)=>{let a=li("".concat(r.name," : ").concat(n),e,r);return t.insertBefore(a,s),s.style.border="1px solid #007BFF",s.style.display="block",()=>{s.style.border="unset",t.removeChild(a)}},bo=(o,n,e)=>o?!1:(console.error("Error: Undefined Prop\\n\\nIt looks like you've tried to use a prop that hasn't been defined.\\nPlease check the prop name for any typos or ensure that it is properly defined in the component's prop list.\\n\\n"+"Prop Name: ".concat(n,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide.")),!0),wo=(o,n,e)=>{console.error("Error: Code Prop Not Supported\\n\\nCurrently, code props are only supported in local frame components.\\n\\u26A0\\uFE0F This is a work in progress feature \\u2014 code props will be supported in upcoming versions.\\n\\nIn the meantime, you can use message props.\\n\\n"+"Prop Name: ".concat(n,"\\n")+"Component: ".concat(e.componentDefinition.name,", ID: ").concat(e.componentDefinition.id,"\\n\\n")+"For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/".concat(e.componentDefinition.id," or consult the developer guide."))},So=(o,n,e)=>{let t=n.reduce((r,a)=>j(M({},r),{[a.name]:M({},a)}),{}),s={get:(r,a)=>{let p=t[a];if(bo(p,a,o))return!1;if(p.behavior.type===Te.code){if(o instanceof ye)return(p.behavior.remap||a)==="myop_init_interface"?u=>{if(u===void 0)return o.getData();o.initWithData(u)}:void 0;if(e.loader.type===Q.HTMLLoader&&e.loader.shadowRootMode===fe.localFrame){let c=p.behavior;return o.element.contentWindow[c.remap||a]}return wo(p,a,o),!1}return p.mode==="output"?new Promise(d=>{let c=[];p.behavior.ref&&c.push(X.create(p.behavior.ref)),c.push(y=>{d(y)}),p.behavior.params&&c.push(...p.behavior.params);let u=xe[p.behavior.message];o.send(new u(...c))}):null},set:(r,a,p)=>{let d=t[a];if(bo(d,a,o))return!1;if(d.behavior.type===Te.code){if(o instanceof ye){let u=d.behavior.remap||a;if(u==="myop_cta_handler")return o.setCtaHandler(p),!0;if(u==="myop_init_interface")return o.initWithData(p),!0}if(e.loader.type===Q.HTMLLoader&&e.loader.shadowRootMode===fe.localFrame){let u=d.behavior,y=o.element.contentWindow,h=u.remap||a;if(y[h]=p,h==="myop_cta_handler"&&y.__myop_cta_queue){let f=y.__myop_cta_queue;y.__myop_cta_queue=null,f.forEach(l=>{o.markedForDisposed||p(l.action,l.payload)})}return!0}return wo(d,a,o),!1}else if(d.mode==="input")if(d.behavior.type==="message"){let c=[];d.behavior.ref&&c.push(X.create(d.behavior.ref)),c.push(p),d.behavior.params&&c.push(...d.behavior.params);let u=xe[d.behavior.message];return o.send(new u(...c)),!0}else throw new Error("Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n"+"Component: ".concat(o.componentDefinition.name,", ID: ").concat(o.componentDefinition.id,"\\n\\n")+"Prop Name: ".concat(a,"\\n")+"Behavior Field: ".concat(d.behavior.type,"\\n\\n")+"Check the documentation for valid behavior options.");return!1}};return o.props={},o.props=new Proxy(o.props,s),o},fi=(o,n)=>new Proxy(o,{get(e,t){return e[t]?e[t]:(...r)=>new Promise(a=>{r.forEach(p=>{cn(p)||Co.notSerializableRefCall(t,p)}),n.send(new G(({ref:p,propName:d,functionArgs:c,makeSerializable:u})=>{if(p){let y=p[d];return u(typeof y=="function"?p[d](...c):y,!0)}return null},{elementId:e.refConfig.selector,propName:t,functionArgs:r},p=>{a(p.content)}))})},set(e,t,s){return n.send(new G(({ref:r,propName:a,propValue:p})=>{r&&(r[a]=p)},{elementId:e.refConfig.selector,propValue:s,propName:t},r=>{})),!0}}),ln=async(o,n,e,t)=>{let s=o.component;if(!s)throw new Error("cant createRefComponent with detached ref");return new Promise(async(r,a)=>{let p=new Ve(n.type,s,t);e.push(p),await s.initiated();let d=setTimeout(()=>{a("timeout")},5e3);s.send(new Oe(o.refConfig,n,j(M({},t||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(d),c.failed){a("CreateRefComponentMessage failed");return}let u=e.find(y=>y.id==p.id);if(u!==p){s.refs[o.refConfig.name]=u,r(u);return}else p.setInitiated(),s.refs[o.refConfig.name]=p;c.nestedRefs.forEach(y=>{let h=n.instance.resolvedNestedComponents.find(l=>l.type.id===y.componentDefinitionId).type,f=new Ve(h,p);f.setInitiated(),p.refs[y.refName]=f,e.push(f)});try{await fn(p,n,e,!0),s.setHeightBasedOnScrollHeight&&s.setHeightBasedOnScrollHeight(),r(p)}catch(y){a(y)}}))})},fn=async(o,n,e,t=!1)=>{o.refs||(o.refs={});let s=Object.values(o.componentDefinition.refs).map(r=>new Promise(async(a,p)=>{var d;if(r.behavior.type==Se.component){if(t){a();return}let c=r.behavior.componentId;c||(c=r.behavior.instance.componentId);let u=(d=n.instance.resolvedNestedComponents)==null?void 0:d.find(h=>h.type.id===c);if(!u)throw new Error("componentConfig provided without nestedComponentConfig check the config object");let y=X.create("",r,o);try{let h=await ln(y,u,e);o.refs[r.name]=h,a()}catch(h){p(h)}}else try{let c=X.create("",r,o);o.refs[r.name]=fi(c,o),a()}catch(c){}}));try{await Promise.all(s)}catch(r){throw r}}});var _e,un=m(()=>{"use strict";Ue();b();je();C();_e=class extends U{constructor(e,t,s,r,a){super(e,s,a);this.componentConfig=e;this.container=s;this.IframeElement=r;i(this,"_autoSizeCleanup");i(this,"_autoSizeOptions");i(this,"_autoSizeUpdate");i(this,"sizeMeta");i(this,"cleanupInspect");i(this,"setHeightBasedOnDocumentElement",()=>{let e=this.send(new k(()=>window.document.documentElement.scrollHeight,t=>{this.IframeElement.style.height="".concat(t.content,"px"),e()}))});i(this,"observeSizeBasedOnDocumentElement",()=>this.send(new k(({send:t})=>{let{height:s,width:r}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:d}=document.documentElement.getBoundingClientRect();t({height:p,width:d})});return a.observe(document.documentElement),a.observe(document.body),{height:s,width:r}},t=>{this.IframeElement.style.width="".concat(t.content.width,"px"),this.IframeElement.style.height="".concat(t.content.height,"px")})));i(this,"observeAutoSize",e=>{if(this._autoSizeOptions=e,this._autoSizeCleanup&&this._autoSizeUpdate)return this._autoSizeUpdate(),this._autoSizeCleanup;let t=this.IframeElement,s=t.contentDocument;if(!s)return console.warn("[MyopIframeComponent] Cannot observe auto size: contentDocument not accessible"),()=>{};let r=(f,l,z)=>l!==void 0&&f<l?l:z!==void 0&&f>z?z:f,a=f=>{if(f===void 0)return;if(typeof f=="number")return f;let l=parseFloat(f);return isNaN(l)?void 0:l},p=()=>{var kn,Dn,Bn,Ln,Pn,On,An,Kn;let f=t.contentDocument;if(!f)return;let l=this._autoSizeOptions,z=a(l==null?void 0:l.minWidth),ke=a(l==null?void 0:l.maxWidth),ne=a(l==null?void 0:l.minHeight),$=a(l==null?void 0:l.maxHeight),B=(kn=l==null?void 0:l.loaderMinHeight)!=null?kn:50,P=((Dn=this.sizeMeta)==null?void 0:Dn.width)==="100%"?"100%":void 0,De=((Bn=this.sizeMeta)==null?void 0:Bn.height)==="100%"?"100%":void 0,F=(Pn=(Ln=l==null?void 0:l.explicitWidth)!=null?Ln:P)!=null?Pn:"100%",oe=(On=l==null?void 0:l.explicitHeight)!=null?On:De,wn=F!==void 0,Sn=oe!==void 0,Wt=this.container.getBoundingClientRect(),Us=Wt.width===0,qs=Wt.height===0||Wt.height===B,he=(l!=null&&l.forceAutoSize||Us)&&!wn,Me=(l!=null&&l.forceAutoSize||qs)&&!Sn;if(!he&&!Me){t.style.width=typeof F=="number"?"".concat(F,"px"):"100%",t.style.height=typeof oe=="number"?"".concat(oe,"px"):"100%",(An=l==null?void 0:l.onSizeChange)==null||An.call(l,{width:typeof F=="number"?F:void 0,height:typeof oe=="number"?oe:void 0,autoSizingWidth:!1,autoSizingHeight:!1});return}let Vs=t.style.transition,V=this.container,js=V.style.transition;t.style.transition="none",V.style.transition="none";let En=t.getBoundingClientRect().height,Tn=t.getBoundingClientRect().width,vn=Math.ceil(Math.max(f.documentElement.scrollHeight,f.body.scrollHeight,f.body.getBoundingClientRect().height)),_n=Math.ceil(Math.max(f.documentElement.scrollWidth,f.body.scrollWidth,f.body.getBoundingClientRect().width)),Be=_n,Le=vn,Gs=Me&&vn>En+1,Ys=he&&_n>Tn+1,Ye=Me&&!Gs,Qe=he&&!Ys;if(Ye||Qe){let Xs=V.style.minHeight,Zs=V.style.minWidth;Ye&&(V.style.minHeight="".concat(En,"px")),Qe&&(V.style.minWidth="".concat(Tn,"px")),Ye&&(t.style.height="0px"),Qe&&(t.style.width="0px"),Be=Math.ceil(Math.max(f.documentElement.scrollWidth,f.body.scrollWidth,f.body.getBoundingClientRect().width)),Le=Math.ceil(Math.max(f.documentElement.scrollHeight,f.body.scrollHeight,f.body.getBoundingClientRect().height));let zn=Ye&&Le<2,$n=Qe&&Be<2;if(zn||$n){let Je=f.createElement("style");Je.id="__myop_measure";let Ft=[];zn&&Ft.push("height: auto !important","min-height: 0 !important","max-height: none !important"),$n&&Ft.push("width: auto !important","min-width: 0 !important","max-width: none !important"),Je.textContent="*, *::before, *::after { ".concat(Ft.join("; "),"; flex-basis: auto !important; flex-grow: 0 !important; }"),f.head.appendChild(Je),Be=Math.ceil(Math.max(f.documentElement.scrollWidth,f.body.scrollWidth,f.body.getBoundingClientRect().width)),Le=Math.ceil(Math.max(f.documentElement.scrollHeight,f.body.scrollHeight,f.body.getBoundingClientRect().height)),Je.remove()}V.style.minHeight=Xs,V.style.minWidth=Zs}let Rn=r(Be,z,ke),Hn=r(Le,ne,$);he?t.style.width="".concat(Rn,"px"):t.style.width=typeof F=="number"?"".concat(F,"px"):"100%",Me?t.style.height="".concat(Hn,"px"):t.style.height=typeof oe=="number"?"".concat(oe,"px"):"100%",t.offsetHeight,t.style.transition=Vs,V.style.transition=js;let Qs=he&&ke!==void 0&&Be>ke,Js=Me&&$!==void 0&&Le>$;f.documentElement.style.overflowX=Qs?"auto":"",f.documentElement.style.overflowY=Js?"auto":"",(Kn=l==null?void 0:l.onSizeChange)==null||Kn.call(l,{width:Rn,height:Hn,autoSizingWidth:he,autoSizingHeight:Me})};p(),this._autoSizeUpdate=p;let d,c=()=>{d===void 0&&(d=requestAnimationFrame(()=>{d=void 0,p()}))},u=new ResizeObserver(()=>c());u.observe(s.body),u.observe(s.documentElement);let y=new MutationObserver(()=>c());y.observe(s.body,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let h=()=>{u.disconnect(),y.disconnect(),d!==void 0&&(cancelAnimationFrame(d),d=void 0),this._autoSizeUpdate=void 0,this._autoSizeCleanup=void 0};return this._autoSizeCleanup=h,h});i(this,"setSizeBasedOnDocumentElement",()=>{let e=this.send(new k(()=>{let{height:t,width:s}=document.documentElement.getBoundingClientRect();return{height:t,width:s}},t=>{this.IframeElement.style.width="".concat(t.content.width,"px"),this.IframeElement.style.height="".concat(t.content.height,"px"),e()}))});i(this,"setHeightBasedOnScrollHeight",()=>{let e=this.send(new k(()=>{let s=0;return s++,s--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+s+"px"},t=>{this.IframeElement.style.height=t.content,e()}))});i(this,"send",e=>{var r,a;let t=M({},e);if(t.messageType===g.ExecuteComponentMethod)return this[t.method](),()=>{};t.direction=v.down;let s=super.send(t);return(a=(r=this.IframeElement)==null?void 0:r.contentWindow)==null||a.postMessage(t,"*"),s});i(this,"dispose",()=>{this._autoSizeCleanup&&(this._autoSizeCleanup(),this._autoSizeCleanup=void 0),this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=ve(this.id,"MyopIframeComponent",10,this.container,this.IframeElement,this.componentDefinition),()=>{this.cleanupInspect(),this.cleanupInspect=void 0})}hide(){this.IframeElement.style.opacity="0",this.IframeElement.style.position="absolute",this.IframeElement.style.pointerEvents="none",this.IframeElement.style.visibility="hidden"}show(){this.IframeElement.style.opacity="1",this.IframeElement.style.position="unset",this.IframeElement.style.pointerEvents="all",this.IframeElement.style.visibility="visible"}onMessageReceived(e){return e.messageType===g.In.MutationObserverMessage||e.messageType===g.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var Z,it=m(()=>{"use strict";Z=class{constructor(){i(this,"appendChild",(n,e,t)=>{var s;if(t!=null&&t.relative){if(t.relative.direction==="before")return n.insertBefore(e,t.relative.child);if(t.relative.direction==="after"){let r=(s=t.relative.child)==null?void 0:s.nextSibling;return n.insertBefore(e,r||null)}}else return n.appendChild(e)})}}});var ui,rt,Eo=m(()=>{"use strict";un();it();re();w();ui=(o,n,e)=>{let t=new URL(o);return t.searchParams.append(n,e),t.toString()},rt=class extends Z{constructor(){super(...arguments);i(this,"type",Q.IframeLoader);i(this,"load",async(e,t,s,r)=>{let a,p=t.loader;if((s==null?void 0:s.nodeName)==="IFRAME")console.log("needs to load into an exsisting Iframe...",p.url,s),a=s,a.src=p.url;else{let d=E(),c="myop-comp-".concat(d);a=document.createElement("iframe"),a.id=c;let u="\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n height: ".concat(p.autoHeight||!p.height?"100%":p.height,";\\n width: 100%;\\n overflow: hidden;\\n border: none;\\n opacity: ").concat(r!=null&&r.hidden?"0":"1",";\\n pointer-events: ").concat(r!=null&&r.hidden?"none":"all",";\\n ");a.style.cssText=u,r!=null&&r.elementAttributes&&Object.entries(r.elementAttributes).forEach(([h,f])=>{f===""||f===null||f===void 0?a.setAttribute(h,""):a.setAttribute(h,String(f))});let y=t.loader.url;r!=null&&r._hasParent&&(y=ui(y,"_myop-comp",d)),a.src=y,s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),a=this.appendChild(s,a,r)}return new _e(e,t,s,a,r)})}}});var at,gn=m(()=>{"use strict";at={webcomponent_message_key:"myop_webcomponent_message"}});var Re,yn=m(()=>{"use strict";gn();Ue();je();Re=class extends U{constructor(e,t,s,r,a){super(e,s,a);this.container=s;this.customElement=r;i(this,"cleanupInspect",()=>{});i(this,"send",e=>{let t=M({},e),s=super.send(t),r=new CustomEvent(at.webcomponent_message_key,{detail:t});try{this.customElement.dispatchEvent(r)}catch(a){console.log("error while trying to dispatchEvent",a)}return s});i(this,"dispose",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=r}inspect(){return this.cleanupInspect=ve(this.id,"MyopWebComponent",0,this.container,this.customElement,this.componentDefinition),this.cleanupInspect}hide(){this.customElement.style.opacity="0",this.customElement.style.position="absolute",this.customElement.style.pointerEvents="none",this.customElement.style.visibility="hidden",this.customElement.style.height="0",this.customElement.style.width="0"}show(){this.customElement.style.opacity="1",this.customElement.style.position="unset",this.customElement.style.pointerEvents="all",this.customElement.style.visibility="visible",this.customElement.style.height="",this.customElement.style.width=""}}});var hn,pt,To=m(()=>{"use strict";yn();it();re();w();hn={},pt=class extends Z{constructor(){super(...arguments);i(this,"type",Q.WebComponentLoader);i(this,"load",async(e,t,s,r)=>{let a=t.loader;hn[a.url]?console.log("Module alreday loaded or in loading process"):hn[a.url]=new Promise((c,u)=>{let y=a.url,h=document.createElement("script");h.type="module",h.src=y,h.onload=()=>{c()},h.onerror=()=>{u()},document.head.appendChild(h)}),await hn[a.url],await Un(1);let p="myop-comp-".concat(E()),d=document.createElement(a.tag);return s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),d.id=p,r!=null&&r.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),r!=null&&r._environment&&(d._myopEnvironment=r==null?void 0:r._environment),this.appendChild(s,d,r),new Re(e,t,s,d,r)})}}});var T,q=m(()=>{"use strict";w();T=class extends ot{constructor(e,t){super(e);this.context=t;i(this,"executor",e=>{if(e.destination){let t=e.destination;if(this.context[t].context){let s=(r,a)=>{this.messageToHost(j(M({},r),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[t].context,s)}else debugger}else debugger})}}});var D,ee=m(()=>{"use strict";D={id:"myop-id"}});var S,vo,L=m(()=>{"use strict";ee();S=(o,n)=>n.querySelectorAll("[".concat(D.id,"='").concat(o.refConfig.selector,"']")),vo=(o,n)=>{let e=S(o,n);return e.length?e.item(0):null}});var dt,_o=m(()=>{"use strict";C();b();q();L();dt=class extends T{constructor(){super(...arguments);i(this,"messageType",g.BindClickMessage);i(this,"innerExecutor",(e,t,s)=>{let r=S(e.ref,t.shadowRoot),a=[];return r.forEach(p=>{let d=()=>{s(new ae(e.handlerUniqueId))};p.addEventListener("click",d),a.push(()=>{p.removeEventListener("click",d)})}),()=>{a.forEach(p=>p())}})}}});var ct,Ro=m(()=>{"use strict";C();q();L();ct=class extends T{constructor(){super(...arguments);i(this,"messageType",g.ChangeTextMessage);i(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(r=>{r.textContent=e.content})})}}});var mt,Ho=m(()=>{"use strict";w();mt=class extends Ee{constructor(e,t){super(e,t);this.container=e;this.shadowRoot=t}}});var lt,ko=m(()=>{"use strict";w();ee();q();b();C();lt=class extends T{constructor(){super(...arguments);i(this,"innerExecutor",(e,t)=>{let s=t.shadowRoot.querySelectorAll("[".concat(D.id,"]")),r=[];s.forEach(a=>{let p=a.getAttribute(D.id);p&&r.push(new be(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new le(e.handlerUniqueId,r))});i(this,"messageType",g.DetectMyopRefsMessage)}}});var ft,Do=m(()=>{"use strict";C();q();L();ft=class extends T{constructor(){super(...arguments);i(this,"messageType",g.SetAttributeMessage);i(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var ut,Bo=m(()=>{"use strict";C();b();q();L();ge();ut=class extends T{constructor(){super(...arguments);i(this,"messageType",g.AddEventListenerMessage);i(this,"innerExecutor",(e,t,s)=>{let r=S(e.ref,t.shadowRoot),a=[];return r.forEach(p=>{let d=c=>{s(new de(e.handlerUniqueId,O(c,e.serializableSkeleton)))};p.addEventListener(e.type,d),a.push(()=>{p.removeEventListener(e.type,d)})}),()=>{a.forEach(p=>p())}})}}});var gt,Lo=m(()=>{"use strict";C();ee();qe();nt();q();gt=class extends T{constructor(){super(...arguments);i(this,"messageType",g.CreateRefComponentMessage);i(this,"innerExecutor",(e,t,s)=>{(async()=>{let a=t.shadowRoot.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(a.length===1){let p=W.Instance(),d=p.components.find(h=>h.id===e.options.id);d&&d.dispose();let c=p.components.indexOf(d);c!==-1&&p.components.splice(c,1);let u=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),y=[];Object.keys(u.refs).forEach(h=>{let f=u.refs[h];f=f.__nonProxied||f,f.componentDefinition&&y.push({refName:h,componentDefinitionId:f.componentDefinition.id})}),s(new Y(e.handlerUniqueId,y))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new Y(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var yt,Mn=m(()=>{"use strict";ge();yt=(o,n,e)=>{let t=o.scriptInputs?o.scriptInputs:{};t.makeSerializable=O,t.send=n,t.rootRef=e,t.__scriptInputs=t;let r=new Function("return (".concat(o.script,")(...arguments)"))(t);n(r)}});var ht,Po=m(()=>{"use strict";C();b();q();Mn();ht=class extends T{constructor(){super(...arguments);i(this,"messageType",g.ExecuteScriptMessage);i(this,"innerExecutor",(e,t,s)=>{yt(e,a=>{s(new pe(e.handlerUniqueId,a))},t)})}}});var Oo,Mt,Ao=m(()=>{"use strict";C();b();q();L();ee();ge();Oo=o=>{if(!o)return null;if(o.tagName==="FORM"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll("input, select, textarea"),s=-1;return t.forEach(r=>{if(typeof r.value=="string"){let a=r.getAttribute(D.id),p=r.getAttribute("name"),d={id:r.id,name:p,value:Oo(r),required:r.required,validity:O(r.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(d):(e.unmappedData.push(e.formData[p]),e.formData[p]=d):e.formData[p]=d:e.unmappedData.push(d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Mt=class extends T{constructor(){super(...arguments);i(this,"messageType",g.GetElementValueMessage);i(this,"innerExecutor",(e,t,s)=>{S(e.ref,t.shadowRoot).forEach(a=>{s(new ce(Oo(a)),e)})})}}});var Ct,Ko=m(()=>{"use strict";C();q();L();Ct=class extends T{constructor(){super(...arguments);i(this,"messageType",g.SetInnerHtml);i(this,"innerExecutor",(e,t)=>{S(e.ref,t.shadowRoot).forEach(r=>{r.innerHTML=e.content})})}}});var zo={};se(zo,{WebComponentSDK:()=>He});var He,Cn=m(()=>{"use strict";w();C();gn();_o();Ro();Ho();ko();ie();b();Do();Bo();Lo();Po();Ao();Ko();He=class extends we{constructor(){super(...arguments);i(this,"alwaysPassEnvelopesToHost",!0);i(this,"connectedCallback",(e,t)=>{e.addEventListener(at.webcomponent_message_key,s=>{let r=s.data?s.data:s.detail;if(!r||!r.myop){debugger;throw new Error("recvied webcomponent_message with wrong type")}else{let a=r;if(this.handleIncomeMessages(s),a.messageType===g.InitMessage){let p=a.content.id;this.components[p].context=new mt(e,t)}}}),setTimeout(()=>{this.messageToHost(new me)},1)});i(this,"messageToHost",(e,t)=>{e.direction=v.up,!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId),window.myop.hostSDK.send(e)});i(this,"supportedHandlers",[new ct(this.messageToHost,this.components),new Ct(this.messageToHost,this.components),new dt(this.messageToHost,this.components),new lt(this.messageToHost,this.components),new ft(this.messageToHost,this.components),new ut(this.messageToHost,this.components),new ht(this.messageToHost,this.components),new Mt(this.messageToHost,this.components),new gt(this.messageToHost,this.components)]);i(this,"init",()=>{})}};N("WebComponentSDK",He)});var $o=m(()=>{"use strict";Cn()});var Wo,Fo=m(()=>{"use strict";Wo=""});function hi(o,n){return class extends HTMLElement{connectedCallback(){let e=n===fe.open?"open":"closed",t=this.attachShadow({mode:e});Vo().then(s=>{s.connectedCallback(this,t),t.innerHTML=o})}}}var gi,yi,Uo,qo,It,Vo,Mi,Ci,Ii,xt,jo=m(()=>{"use strict";yn();mn();it();re();w();$o();un();Fo();gi="<!-- myop-web-component -->",yi="myop-web-component",Uo=new Set,qo=[],Vo=async()=>(It||(It=new He,It.init()),It);Mi=(o,n,e)=>{customElements.define(o,hi(n,e)),console.log("define('".concat(o,"') was called, web component ready to use"))},Ci=o=>o.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/(\\d+)/g,"-$1").toLowerCase(),Ii=o=>(o=Ci(o),o.replace(/_/g,"-")),xt=class extends Z{constructor(){super(...arguments);i(this,"type",Q.HTMLLoader);i(this,"load",async(e,t,s,r)=>{let a=t.loader;if(this.isMyopWebComponent(a.HTML))return this.loadExtractedWebComponent(e,t,s,a.HTML,r);let p="myop-comp-".concat(E()),d;if(a.shadowRootMode===fe.localFrame){let c=E(),u="myop-comp-".concat(c),y=document.createElement("iframe");y.id=u,y.style.cssText="\\n display: block;\\n padding: 0;\\n margin: 0;\\n position: absolute;\\n inset: 0;\\n overflow: hidden;\\n border: none;\\n opacity: ".concat(r!=null&&r.hidden?"0":"1",";\\n width: 100%;\\n height: 100%;\\n pointer-events: ").concat(r!=null&&r.hidden?"none":"all",";\\n "),s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),y=this.appendChild(s,y,r);let h=y.contentDocument||y.contentWindow.document;h.open();let f=null;{let P=new DOMParser().parseFromString(a.HTML,"text/html").querySelector('meta[name="myop:size"]');if(P)try{f=JSON.parse(P.getAttribute("content")||"{}")}catch(De){}}let l=a.HTML;if(r!=null&&r._inspection){let B=new DOMParser().parseFromString(a.HTML,"text/html"),P=B.getElementById("myop_preview");P==null||P.removeAttribute("type");let De=B.implementation.createHTMLDocument();De.body.innerHTML="<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>";let F=De.body.firstChild;F&&B.head&&B.head.insertBefore(B.importNode(F,!0),B.head.firstChild),l=B.documentElement.outerHTML}else if((r==null?void 0:r.data)!==void 0){let B=new DOMParser().parseFromString(a.HTML,"text/html"),P=B.getElementById("myop_preview");P&&(P.remove(),l=B.documentElement.outerHTML)}h.writeln(l);let z='<script src="'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'"><\\/script>'),ke="<script>\\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK();\\n sdk.init();\\n }\\n __myop_init().then();\\n <\\/script>";if(h.writeln("".concat(z).concat(ke)),(r==null?void 0:r.data)!==void 0){let $="<script>\\n window.__myop_cta_queue = [];\\n window.myop_cta_handler = function(action, payload) {\\n window.__myop_cta_queue.push({action: action, payload: payload});\\n };\\n <\\/script>",B=JSON.stringify(r.data).replace(/<\\/script/gi,"\\\\u003c/script"),P='<script id="__myop_init_data_script">\\n (function() {\\n var data = '.concat(B,";\\n var scriptEl = document.getElementById('__myop_init_data_script');\\n\\n var callInitInterface = function(fn) {\\n var startTime = performance.now();\\n // Mark as pre-injected data call for extension tracking\\n window.__myop_init_preinjected = true;\\n try {\\n fn(data);\\n } finally {\\n window.__myop_init_preinjected = false;\\n }\\n var duration = performance.now() - startTime;\\n\\n // Notify extension via postMessage (init* = pre-injected)\\n try {\\n window.parent.postMessage({\\n type: 'MYOP_PREINJECTED_INIT',\\n payload: {\\n data: data,\\n duration: duration,\\n timestamp: Date.now()\\n }\\n }, '*');\\n } catch (e) {}\\n\\n // Cleanup: remove script tag and stored data\\n if (scriptEl && scriptEl.parentNode) {\\n scriptEl.parentNode.removeChild(scriptEl);\\n }\\n delete window.__myop_init_data;\\n };\\n\\n if (typeof window.myop_init_interface === 'function') {\\n // Function already exists - call immediately\\n callInitInterface(window.myop_init_interface);\\n } else {\\n // Function not yet defined - store data and watch for definition\\n window.__myop_init_data = data;\\n\\n var _original;\\n Object.defineProperty(window, 'myop_init_interface', {\\n configurable: true,\\n enumerable: true,\\n set: function(fn) {\\n _original = fn;\\n if (window.__myop_init_data !== undefined) {\\n var storedData = window.__myop_init_data;\\n delete window.__myop_init_data;\\n callInitInterface(fn);\\n }\\n },\\n get: function() {\\n return _original;\\n }\\n });\\n }\\n })();\\n <\\/script>");h.writeln($+P)}h.close();let ne=new _e(e,t,s,y,r);return ne.sizeMeta=f,ne.initiated().then(()=>{if((r==null?void 0:r.autoSize)===!1)return;let $=!1;ne.observeAutoSize({forceAutoSize:!0,onSizeChange:()=>{!$&&!(r!=null&&r.hidden)&&($=!0,ne.show())}})}),ne}if(a.shadowRootMode===fe.none){let c=document.createElement("template");c.innerHTML=a.HTML,d=c.content.firstElementChild,Vo().then(u=>{u.connectedCallback(d,d)})}else{let c=Ii(e.name+t.id);qo.includes(c)||(Mi(c,a.HTML,a.shadowRootMode),qo.push(c)),d=document.createElement(c)}return s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),d.id=p,r!=null&&r.hidden&&(d.style.opacity="0",d.style.position="absolute",d.style.height="0",d.style.width="0",d.style.pointerEvents="none",d.style.visibility="hidden"),this.appendChild(s,d,r),new Re(e,t,s,d,r)})}isMyopWebComponent(e){return e.trimStart().startsWith(gi)}extractWebComponentScript(e){let r=new DOMParser().parseFromString(e,"text/html").getElementById(yi);return(r==null?void 0:r.textContent)||null}executeWebComponentScript(e,t){if(Uo.has(t)){console.log("[MyopWebComponent] Script already executed for ".concat(t,", skipping"));return}let s=document.createElement("script");s.textContent=e,s.id="myop-extracted-".concat(t),document.head.appendChild(s),Uo.add(t),console.log("[MyopWebComponent] Executed web component script: ".concat(t))}async loadExtractedWebComponent(e,t,s,r,a){let p=this.extractWebComponentScript(r);if(!p)throw new Error('[MyopWebComponent] No <script id="myop-web-component"> found in HTML');let d="".concat(e.id,"-").concat(t.id),c=window.__MYOP_TAG_NAME__;this.executeWebComponentScript(p,d);let u=window.__MYOP_TAG_NAME__;if(!u)throw new Error("[MyopWebComponent] Script did not set window.__MYOP_TAG_NAME__");c&&c!==u&&console.warn("[MyopWebComponent] __MYOP_TAG_NAME__ changed from ".concat(c," to ").concat(u));let y="myop-comp-".concat(E()),h=document.createElement(u);h.id=y,a!=null&&a.hidden&&(h.style.opacity="0",h.style.position="absolute",h.style.height="0",h.style.width="0",h.style.pointerEvents="none",h.style.visibility="hidden"),s.querySelector('[id^="myop-comp-"]')||(s.innerHTML=""),this.appendChild(s,h,a);let f=new ye(e,t,s,h,u,a);return(a==null?void 0:a.data)!==void 0&&f.initWithData(a.data),console.log("[MyopWebComponent] Loaded <".concat(u,"> into container")),f}}});var Go,Yo,Qo=m(()=>{"use strict";re();b();Go=(o,n,e)=>{let t="myop-css-".concat(E());return o.send(new k(({rootRef:s,_stylesheet:r,_tagId:a,_css:p})=>{let d=document.createElement("style");d.type="text/css";let c=p;for(let u in r){c+="".concat(u," { ");let y=r[u];for(let h in y)c+="".concat(h,": ").concat(y[h],"; ");c+="} "}d.appendChild(document.createTextNode(c)),d.id=a,(s.shadowRoot||s.container).appendChild(d)},()=>{},{_stylesheet:n,_css:e||"",_tagId:t})),()=>{o.send(new k(({rootRef:s,_tagId:r})=>{let a=(s.shadowRoot||document).getElementById(r);a&&a.remove()},()=>{},{_tagId:t}))}},Yo=(o,n)=>{let e="myop-css-".concat(E());return o.send(new k(({rootRef:t,_tagId:s,_link:r})=>{let a=document.createElement("link");a.id=s,a.rel="stylesheet",a.href=r,document.head.appendChild(a),(t.shadowRoot||t.container).appendChild(a)},()=>{},{_link:n,_tagId:e})),()=>{o.send(new k(({rootRef:t,_tagId:s})=>{let r=(t.shadowRoot||document).getElementById(s);r&&r.remove()},()=>{},{_tagId:e}))}}});var xi,In,Jo,Xo=m(()=>{"use strict";xi=(o,n)=>{let e=new RegExp(Object.keys(n).join("|"),"g");return o.replace(e,t=>(n[t]||t).toString())},In=(o,n)=>{let e=o.loader;if(e.type!=="IframeLoader")throw new Error('iframeSkinUrlTokenizer received skin with loader type "'.concat(e.type,'", currently only "IframeLoader" is supported'));return o.loader=M({},o.loader),o.loader.url=xi(o.loader.url,n),o},Jo=o=>async n=>In(n,o)});var Zo,es,ts=m(()=>{"use strict";b();Zo=(o,n,e)=>{o.send(new G(({ref:t,_className:s})=>{t==null||t.classList.add(s)},{elementId:e,_className:n}))},es=(o,n,e)=>{o.send(new G(({ref:t,_className:s})=>{t==null||t.classList.remove(s)},{elementId:e,_className:n}))}});var St,bt,Et,wt,ns=m(()=>{"use strict";re();St=class St{constructor(){i(this,"_runTimeInstanceId","runtime-instance-id-"+E());i(this,"_runTimeId","runtime-id-"+E());i(this,"_runTimeName","runtime-name-"+E());i(this,"id",this._runTimeId);i(this,"name",this._runTimeName);i(this,"description","");i(this,"loader",null);i(this,"withLoader",n=>(this.loader=n,this));i(this,"withHTMLLoader",n=>(n.type="HTMLLoader",this.loader=n,this));i(this,"build",()=>this)}};i(St,"create",()=>new St);bt=St,Et=class Et{constructor(){i(this,"_runTimeInstanceId","runtime-instance-id-"+E());i(this,"_runTimeId","runtime-id-"+E());i(this,"_runTimeName","runtime-name-"+E());i(this,"instance",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});i(this,"name",this._runTimeName);i(this,"type",{id:this._runTimeId,name:this._runTimeName,description:"",props:[],refs:[],skins:[],defaultSkin:0});i(this,"withInstance",n=>(this.instance=n,this));i(this,"withType",n=>(this.type=n,this));i(this,"withName",n=>(this.name=n,this));i(this,"withDefaultSkin",n=>(this.type.skins.push(n),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:"Dedicated",skin:{id:n.id}},this));i(this,"withRef",n=>(this.type.refs.push(n),this));i(this,"withBasicRef",n=>{let e={id:"",name:n,description:"",selectorType:"id-attribute",selector:n,behavior:{type:"code"}};return this.type.refs.push(e),this});i(this,"build",()=>JSON.parse(JSON.stringify(this)))}};i(Et,"create",()=>new Et);wt=Et});var bi,Tt,wi,Si,te,K,os,xn=m(()=>{"use strict";w();bi=o=>({instance:{id:"auto",componentId:o.componentId,componentName:o.name,skinSelector:{type:"Dedicated",skin:{id:"skin_auto_v2_converted"}}},type:{id:o.id,name:o.name,description:o.description,props:[{id:"in_auto_v2_converted",name:"myop_init_interface",type:"any",behavior:{type:Te.code}},{id:"out_auto_v2_converted",name:"myop_cta_handler",type:"any",behavior:{type:Te.code}}],refs:[],skins:[{id:"skin_auto_v2_converted",name:"auto_v2_converted",description:"",loader:o.consume_variant[0].loader}],defaultSkin:0},name:o.name}),Tt="__MYOP_CLOUD_REPOSITORY_MAIN__",wi=()=>{if(typeof window<"u")return window[Tt];if(typeof globalThis<"u")return globalThis[Tt]},Si=o=>{typeof window<"u"&&(window[Tt]=o),typeof globalThis<"u"&&(globalThis[Tt]=o)},te=class te{constructor(n="https://cloud.myop.dev"){this._baseUrl=n;i(this,"variants",{});i(this,"preloadedComponents",{});i(this,"userFlows",{});i(this,"_defaultEnv","production");i(this,"_envExplicitlySet",!1)}static get Main(){let n=wi();return n||(te._main||(te._main=new te,Si(te._main)),te._main)}setEnvironment(n){this._defaultEnv=n,this._envExplicitlySet=!0}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(n,e,t){return e!==void 0||t!==void 0?"".concat(n,":").concat(e||this._defaultEnv,":").concat(t?"preview":"live")in this.variants:n in this.preloadedComponents}getPreloadedParams(n){return this.preloadedComponents[n]}async fetchComponentV2(n,e,t){let s=this.preloadedComponents[n],r=e!==void 0||t!==void 0,a,p;if(!r&&s)a=s.env,p=s.preview;else{a=e||this._defaultEnv;let c=e||this._envExplicitlySet;p=t===!0?!0:t===!1?!1:!c}let d="".concat(n,":").concat(a,":").concat(p?"preview":"live");return console.log("[CloudRepository] fetchComponentV2",{componentId:n.slice(0,8)+"...",env:a,usePreview:p,cacheKey:d,cached:d in this.variants}),this.variants[d]||(this.preloadedComponents[n]||(this.preloadedComponents[n]={env:a,preview:p}),this.variants[d]=new Promise(async(c,u)=>{try{let y="".concat(this._baseUrl,"/consume?id=").concat(n,"&env=").concat(a);p&&(y+="&preview=true");let l=(await(await fetch(y)).json()).item;if(!l){u(new Error('Component "'.concat(n,'" not found')));return}if(!l.consume_variant||!l.consume_variant.length){u(new Error('Component "'.concat(n,'" has no implementation for environment "').concat(a,'"')));return}let z=bi(l);this.variants[d].resolved=z,c(z)}catch(y){delete this.variants[d],u(y)}})),await this.variants[d]}getResolvedConfig(n,e,t){var c;let s=this.preloadedComponents[n],r=e!==void 0||t!==void 0,a,p;if(!r&&s)a=s.env,p=s.preview;else{a=e||this._defaultEnv;let u=e||this._envExplicitlySet;p=t===!0?!0:t===!1?!1:!u}let d="".concat(n,":").concat(a,":").concat(p?"preview":"live");return((c=this.variants[d])==null?void 0:c.resolved)||null}async fetchComponentV1(n,e){return e?(await this.fetchFlow(e)).components.find(s=>s.type.id===n):(await this.fetchAutoFlow(n)).components[0]}async fetchAutoFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let r=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(n,"&auto=true"))).json();e(r.item)}catch(s){delete this.userFlows[n],t(s)}})),await this.userFlows[n]}async fetchFlow(n){return this.userFlows[n]||(this.userFlows[n]=new Promise(async(e,t)=>{try{let r=await(await fetch("".concat(this._baseUrl,"/flow?id=").concat(n,"&resolve=components"))).json();e(r.item)}catch(s){delete this.userFlows[n],t(s)}})),await this.userFlows[n]}async fetchComponent(n,e){return this.fetchComponentV1(n,e)}};i(te,"_main",null);K=te,os=K});var ss,is=m(()=>{"use strict";ss=async o=>await o()});var J,rs,as,ps,ds,cs,ms,ls,fs,us,gs=m(()=>{"use strict";xn();J=K.Main,rs=()=>J,as=(o,n,e)=>J.isPreloaded(o,n,e),ps=o=>J.getPreloadedParams(o),ds=()=>{J=new K("http://localhost:9292")},cs=o=>{J=new K(o)},ms=o=>{J=o},ls=o=>{J.setEnvironment(o)},fs=(o,n,e)=>J.getResolvedConfig(o,n,e),us=async(o,n,e)=>Promise.allSettled(o.map(t=>J.fetchComponentV2(t,n,e)))});var bn={};se(bn,{CloudRepository:()=>K,ComponentConfig:()=>wt,SkinConfig:()=>bt,addClass:()=>Zo,applyStylesheet:()=>Go,applyStylesheetLink:()=>Yo,changeSkinUrlByTokenizer:()=>Jo,createIframeSkinByTokenizer:()=>In,enableLocalDev:()=>ds,exec:()=>ss,getCloudRepository:()=>rs,getPreloadedParams:()=>ps,getResolvedConfig:()=>fs,isPreloaded:()=>as,preloadComponents:()=>us,removeClass:()=>es,setCloudRepository:()=>ms,setCloudRepositoryUrl:()=>cs,setEnvironment:()=>ls,v2_CloudRepository:()=>os});var vt=m(()=>{"use strict";Qo();Xo();ts();ns();xn();is();gs()});var ys,hs=m(()=>{"use strict";Vt();vt();w();ys=async o=>{try{let n=new URL(window.location.href),t=new URLSearchParams(n.search).get("myopOverride");if(t){let[s,...r]=qt(t);switch(s){case"component":{let[a,p]=r,d=await K.Main.fetchComponent(a);if(d&&d.type.skins.find(u=>u.id===p))return d.instance.skinSelector={type:ue.Dedicated,skin:{id:p}},d}break;default:{let[a,p]=qt(t),c=(await K.Main.fetchFlow(a)).components.find(u=>u.type.id===o.type.id);if(c&&c.instance.skinSelector.type===ue.Segmented&&c.instance.resolvedExperiences){let u=c.instance.resolvedExperiences.find(y=>y.id===p);if((u==null?void 0:u.type)===st.Segment){let y=u,f=c.instance.skinSelector.segments.find(l=>l.segmentId===y.segment.id);if(f)return c.instance.skinSelector=f==null?void 0:f.skinSelector,c}}}break}}}finally{return null}}});var Is={};se(Is,{HostSDK:()=>W,hostSDK:()=>Cs});var Ms,W,Cs,qe=m(()=>{"use strict";ie();C();b();Eo();To();je();w();tt();jo();hs();Ms="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",W=class{constructor(){i(this,"components2init",[]);i(this,"components",[]);i(this,"componentsLoaders",[]);i(this,"initiated",!1);i(this,"version",Ce);i(this,"type2InstanceCount",{});i(this,"assignId",n=>(this.type2InstanceCount[n.id]||(this.type2InstanceCount[n.id]=0),"".concat(n.id,"_").concat(++this.type2InstanceCount[n.id])));i(this,"inspected",!1);i(this,"inspect",()=>{this.inspected||(this.inspected=!0,this.components.forEach(n=>{n.inspect&&n.inspect()}))});i(this,"incomingMessageHandler",n=>{if(n.origin,document.location.origin,n.data.myop){if(n.data.direction!==v.up&&n.data.messageType!==g.EnvelopedMessage)return;let e=n.data;if(e.messageType===g.InitRequest){this.components2init.forEach(s=>{s.send(new Ie(s.id))});return}if(e.messageType===g.InitResponse){this.components2init=this.components2init.filter(r=>r.id!==e.content.id);let s=this.components.find(r=>{var a;return r.id===((a=e.content)==null?void 0:a.id)});s==null||s.setInitiated();return}if(e.messageType===g.EnvelopedMessage){let s=e,r=this.components.find(a=>a.id===s.destination);if(r){if(s.direction===v.down){s.message.messageType===A.name?r.onMessageReceived(s.message):(s.message.route=s.route,r.send(s.message));return}}else{let a=this.components.find(p=>p.id===s.message.destination);a&&a.send(s.message)}return}let t=this.components.find(s=>s.id===e.destination);if(!t){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(t){if(t.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});i(this,"send",n=>{let e=new MessageEvent("",{data:n});this.incomingMessageHandler(e)});i(this,"init",n=>{if(this.initiated)throw new Error("hostSDK already initiated");let e=[new rt,new pt,new xt];if(this.componentsLoaders=[...e],n){let t={};n.forEach(s=>{let r=new s(this.componentsLoaders);t[r.type]=r}),this.componentsLoaders.forEach(s=>{t[s.type]||(t[s.type]=s)}),this.componentsLoaders=Object.values(t)}window.addEventListener("message",this.incomingMessageHandler,!1),console.log("myop hostSDK initiated",document.location.href),this.initiated=!0});i(this,"_getSkinIdBySkinSelector",async(n,e=[],t)=>{var r;async function s(a,p){for(let d of a)if(await p(d))return d}switch(n.type){case"DedicatedSkin":case ue.Dedicated:return((r=n.skin)==null?void 0:r.id)||n.skins[0].id;case ue.Segmented:{let p=await s(n.segments,async d=>{if(d.segmentId==="Default")return!0;let c=e.find(f=>f.type===st.Segment?f.segment.id===d.segmentId:!1);if(!c)throw new Error("experience not found");let y=c.segment,h=(t||{})[y.function];return h?await h():(console.warn("segmentId:".concat(d.segmentId,", ").concat(y.function," function not provided !")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return""});i(this,"runSkinSelector",async(n,e)=>{let t=await this._getSkinIdBySkinSelector(n.instance.skinSelector,n.instance.resolvedExperiences,e);return n.type.skins.find(s=>s.id===t)});i(this,"loaderHooks");i(this,"loadComponent",async(n,e,t)=>{var u,y,h,f;if(!e){debugger;throw new Error("no container was found for this component")}let s=await ys(n);s&&(n=s);let r=M(M({},(u=this.loaderHooks)!=null?u:{}),(y=t==null?void 0:t.hooks)!=null?y:{}),a=e;if(a.myop)if(a.component){n=M({},n),n.instance=M({},n.instance);let l=await this.runSkinSelector(n,r);if(!l)throw new Error("runSkinSelector failed to choose skin, check the provided config");return(h=t==null?void 0:t.hooks)!=null&&h.afterSkinSelected&&(l=await t.hooks.afterSkinSelected(M({},l))),n.instance.skinSelector={type:ue.Dedicated,skin:l},t&&(t=M({},t),delete t.hooks),await ln(a,n,this.components,t)}else throw new Error("load component got a detached ref.");e=e;let p=await this.runSkinSelector(n,r);if(!p)throw new Error("runSkinSelector failed to choose skin, check the provided config");(f=t==null?void 0:t.hooks)!=null&&f.afterSkinSelected&&(p=await t.hooks.afterSkinSelected(M({},p)));let d=this.componentsLoaders.find(l=>l.type===p.loader.type);if(!d){debugger;throw new Error('no loader "'.concat(p.loader.type,'" was found for component'))}let c=await d.load(n.type,p,e,t);c.isInitiated||this.components2init.push(c),c.bind("onDispose",()=>(this.components=this.components.filter(l=>l!==c),this.components2init=this.components2init.filter(l=>l!==c),!0)),this.components.push(c),(!t||t.connectProps!==!1)&&(c=So(c,n.type.props,p));try{await fn(c,n,this.components)}catch(l){throw l}return t!=null&&t.skipInit||await c.initiated(),c});i(this,"navigate",async(n,e,t)=>{if(n.parent)throw new Error("Navigating on remote ref components is not implemented yet");if(t!=null&&t.staged){let s=await this.loadComponent(e,n.container,M({hidden:!0,relative:{direction:"after",child:n.element}},t));return t.init&&await t.init(s),s.show(),n.dispose(),s}else{let s=n.element.nextSibling;return n.dispose(),this.loadComponent(e,n.container,M({relative:{direction:"before",child:s}},t))}})}};i(W,"Instance",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ms});if(!window.myop.hostSDK){let o=new W;o.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Ms}),window.myop.hostSDK=o}Cs=window.myop.hostSDK;N("hostSDK",Cs)});var _t,xs=m(()=>{"use strict";C();ee();w();b();_t=class extends x{constructor(){super(...arguments);i(this,"messageType",g.DetectMyopRefsMessage);i(this,"executor",e=>{let t=document.querySelectorAll("[".concat(D.id,"]")),s=[];t.forEach(r=>{let a=r.getAttribute(D.id);a&&s.push(new be(a,r.tagName,r.getBoundingClientRect()))}),this.messageToHost(new le(e.handlerUniqueId,s))})}}});var Rt,bs=m(()=>{"use strict";C();w();b();L();Rt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.BindClickMessage);i(this,"executor",e=>{let t=[];return S(e.ref,document).forEach(r=>{let a=()=>{this.messageToHost(new ae,e)};r.addEventListener("click",a);let p=()=>{r.removeEventListener("click",a)};t.push(p)}),()=>{t.forEach(r=>r())}})}}});var Ht,ws=m(()=>{"use strict";C();w();L();Ht=class extends x{constructor(){super(...arguments);i(this,"messageType",g.ChangeTextMessage);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.textContent=e.content})})}}});var kt,Ss=m(()=>{"use strict";C();b();w();Mn();kt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.ExecuteScriptMessage);i(this,"executor",e=>{yt(e,s=>{this.messageToHost(new pe(e.handlerUniqueId,s))},new Ee(document.documentElement))})}}});var Dt,Es=m(()=>{"use strict";C();w();b();ge();L();Dt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.AddEventListenerMessage);i(this,"executor",e=>{let t=S(e.ref,document),s=[];return t.forEach(r=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new de(e.handlerUniqueId,O(p,e.serializableSkeleton)))})};r.addEventListener(e.type,a),s.push(()=>{r.removeEventListener(e.type,a)})}),()=>{s.forEach(r=>{r()})}})}}});var Bt,Ts=m(()=>{"use strict";C();w();L();Bt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetAttributeMessage);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.setAttribute(e.name,e.value)})})}}});var Lt,vs=m(()=>{"use strict";C();ee();w();qe();nt();Lt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.CreateRefComponentMessage);i(this,"executor",e=>{(async()=>{let s=document.querySelectorAll("[".concat(D.id,"='").concat(e.refConfig.selector,"']"));if(s.length===1){let a=await W.Instance().loadComponent(e.nestedComponentConfig,s.item(0),e.options),p=[];Object.keys(a.refs).forEach(d=>{let c=a.refs[d];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:d,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new Y(e.handlerUniqueId,p))}else{console.error("CreateRefComponentMessageHandler - DOM element not found"),this.messageToHost(new Y(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var _s,Rs=m(()=>{"use strict";_s=(o,n)=>{if(!o){console.log("n");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!o||o.nodeType!==1))if(e){let t=new e(n),s={attributes:!0,childList:!0,subtree:!0};return t.observe(o,s),t}else window.addEventListener&&(o.addEventListener("DOMNodeInserted",n,!1),o.addEventListener("DOMNodeRemoved",n,!1))}});var Pt,Hs=m(()=>{"use strict";C();b();w();Rs();Pt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetMutationObserverMessage);i(this,"executor",e=>{e.source&&_s(document.body,()=>{this.messageToHost(new ze)})})}}});var ks,Ot,Ds=m(()=>{"use strict";C();ee();w();b();ge();L();ks=o=>{if(!o)return null;if(o.tagName==="FORM"){let n=new FormData(o),e={formData:{},unmappedData:[]},t=o.querySelectorAll("input, select, textarea"),s=-1;return t.forEach(r=>{if(typeof r.value=="string"){let a=r.getAttribute(D.id),p=r.getAttribute("name"),d={id:r.id,name:p,value:ks(r),required:r.required,validity:O(r.validity,!0),myopId:a};e.unmappedData.push(d),p&&(!e.formData[p]||!e.formData[p].value||d.value)&&(e.formData[p]=d)}}),e}return o.type==="checkbox"||o.type==="radio"?o.checked?o.value:null:o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"?o.value:o.isContentEditable?o.innerText||o.textContent:null},Ot=class extends x{constructor(){super(...arguments);i(this,"messageType",g.GetElementValueMessage);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{this.messageToHost(new ce(ks(s)),e)})})}}});var At,Bs=m(()=>{"use strict";C();w();b();L();At=class extends x{constructor(){super(...arguments);i(this,"messageType",g.GetAttributeMessage);i(this,"executor",e=>{let t=vo(e.ref,document);t&&this.messageToHost(new Ke(t.getAttribute(e.name)),e)})}}});var Kt,Ls=m(()=>{"use strict";b();C();w();Kt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetResizeObserverMessage);i(this,"executor",e=>{let t=new ResizeObserver(s=>{this.messageToHost(new Ne)});return t.observe(document.body),()=>{t.disconnect()}})}}});var zt,Ps=m(()=>{"use strict";C();w();L();zt=class extends x{constructor(){super(...arguments);i(this,"messageType",g.SetInnerHtml);i(this,"executor",e=>{S(e.ref,document).forEach(s=>{s.innerHTML=e.content})})}}});var Os={};se(Os,{IframeSDK:()=>$t});var $t,As=m(()=>{"use strict";w();xs();bs();ws();Ss();ie();Es();Ts();b();vs();Hs();Ds();tt();Bs();Ls();Ps();$t=class extends we{constructor(){super();i(this,"version",Ce);i(this,"messageToHost",(e,t)=>{var r;!e.replayToHandler&&(t!=null&&t.handlerUniqueId)&&(e.replayToHandler=t.handlerUniqueId);let s=Object.keys(this.components);e.destination||(t!=null&&t.route?e.destination=t.route[t.route.length-1]:e.destination=s[0]),e.source||(e.source=s[0]),e.direction=v.up,(r=window.parent)==null||r.postMessage(M({},e),"*")});i(this,"supportedHandlers",[new Ht(this.messageToHost),new zt(this.messageToHost),new Rt(this.messageToHost),new _t(this.messageToHost),new kt(this.messageToHost),new Dt(this.messageToHost),new Bt(this.messageToHost),new Ot(this.messageToHost),new Pt(this.messageToHost),new Kt(this.messageToHost),new At(this.messageToHost),new Lt(this.messageToHost)]);i(this,"init",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new me)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};N("IframeSDK",$t)});var Ti={};var Ei,Ks=m(()=>{"use strict";b();ie();Ei=M({},xe);N("MyopMessages",Ei)});var zs={};se(zs,{CloudRepository:()=>K,ComponentConfig:()=>wt,SkinConfig:()=>bt,addClass:()=>Zo,applyStylesheet:()=>Go,applyStylesheetLink:()=>Yo,changeSkinUrlByTokenizer:()=>Jo,createIframeSkinByTokenizer:()=>In,enableLocalDev:()=>ds,exec:()=>ss,getCloudRepository:()=>rs,getPreloadedParams:()=>ps,getResolvedConfig:()=>fs,isPreloaded:()=>as,preloadComponents:()=>us,removeClass:()=>es,setCloudRepository:()=>ms,setCloudRepositoryUrl:()=>cs,setEnvironment:()=>ls,v2_CloudRepository:()=>os});var $s=m(()=>{"use strict";ie();vt();vt();N("MyopHelpers",bn)});var ki={};se(ki,{getHostModule:()=>Ws,getIframeModule:()=>Fs,getWebcomponentModule:()=>Ns});ie();var Nn;if(window.__federation__)console.log("__federation__ loaded more than once.");else{let o=(Nn=document.currentScript)==null?void 0:Nn.src,n=o?o.split("/").slice(0,-1).join("/"):"";window.__federation__={__public_auto_path__:n,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(o,n,e)=>{if(window.__federation__[n])console.log("__federation__ module ".concat(n," already loaded.")),e(window.__federation__[n][Ut]);else{let t;window.__federation__[n]={},window.__federation__[n][et]=r=>{t&&(document.head.removeChild(t),t=null),window.__federation__[n][Ut]=r,e(r)};let s=r=>{t=document.createElement("script"),t.type="module",t.src=r,t.async=!0,t.onerror=()=>{var d,c;let a=(c=(d=window.myop)==null?void 0:d.__ROOT_SDK_PUBLIC_URL__)==null?void 0:c.split("/").slice(0,-1).join("/"),p=r.split("/").pop();a&&!r.startsWith(a)&&(console.warn("[myop] chunk load failed from ".concat(r,", retrying from CDN")),document.head.removeChild(t),s("".concat(a,"/").concat(p)))},document.head.appendChild(t)};s(o)}};tt();console.log("myop root sdk - loaded",document.location.origin);var vi="https://cdn.myop.dev/sdk/next/myop_sdk.min.js",Ws=()=>Promise.resolve().then(()=>(qe(),Is)),Fs=()=>Promise.resolve().then(()=>(As(),Os)),Ns=()=>Promise.resolve().then(()=>(Cn(),zo)),_i=()=>Promise.resolve().then(()=>(Ks(),Ti)),Ri=()=>Promise.resolve().then(()=>($s(),zs)),Ge=o=>async()=>(await o()).get(),Hi={version:Ce,getHostModule:Ge(Ws),getIframeModule:Ge(Fs),getWebcomponentModule:Ge(Ns),getMyopMessages:Ge(_i),getMyopHelpers:Ge(Ri)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:vi});window.myop.rootSDK?console.log("myop root host loaded more than once."):window.myop=M({rootSDK:Hi},window.myop);return ri(ki);})();
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
11
|
/**
|