@myop/react-native 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -11
- package/dist/MyopComponent.d.ts +42 -2
- package/dist/MyopComponent.d.ts.map +1 -1
- package/dist/MyopComponent.js +227 -88
- package/dist/MyopComponent.js.map +1 -1
- package/dist/componentHost.html.d.ts +1 -1
- package/dist/componentHost.html.d.ts.map +1 -1
- package/dist/componentHost.html.js +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyopComponent.js","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+G;AAC/G,+CAA8C;AAC9C,+DAA6C;AAG7C,mEAA6C;
|
|
1
|
+
{"version":3,"file":"MyopComponent.js","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+G;AAC/G,+CAA8C;AAC9C,+DAA6C;AAG7C,mEAA6C;AAE7C,MAAM,OAAO,GAAG,CAAC,WAAoB,EAAE,gBAAyB,EAAE,EAAE;IAChE,IAAI,IAAI,GAAG,4BAAI,CAAC;IAEhB,eAAe;IACf,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,IAAI,GAAG,IAAI,CAAC,OAAO,CACf,uCAAuC,EACvC,4EAA4E,CAC/E,CAAC;IACN,CAAC;IAED,yCAAyC;IACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpB,MAAM,WAAW,GAAG;;;;;;;;;;;SAWnB,CAAC;QACF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;QAE1D,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AAU,IAAC,GAAG,EAAE,SAAS,GAAI,CAEjC,CACV;QACA,YAAY,IAAI,CACb,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,IAC9B,MAAA,KAAK,CAAC,QAAQ,mCAAI,8BAAC,2BAAY,OAAG,CAChC,CACV,CACE,CACV,CAAC;AACN,CAAC,CAAA;AAlUY,QAAA,aAAa,iBAkUzB;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE;QACF,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACjB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,CAAC;KACV;IACD,eAAe,kCACR,yBAAU,CAAC,kBAAkB,KAChC,MAAM,EAAE,CAAC,GACZ;CACJ,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const HTML = "\n<!DOCTYPE html>\n<html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <style>\n html, body {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-family: sans-serif;\n }\n #myop-container {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n }\n </style>\n <script>\"use strict\";var MyopSDK=(()=>{var Pe=Object.defineProperty,Zn=Object.defineProperties,Yn=Object.getOwnPropertyDescriptor,es=Object.getOwnPropertyDescriptors,ts=Object.getOwnPropertyNames,ro=Object.getOwnPropertySymbols;var io=Object.prototype.hasOwnProperty,os=Object.prototype.propertyIsEnumerable;var Et=(n,t,e)=>t in n?Pe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,y=(n,t)=>{for(var e in t||(t={}))io.call(t,e)&&Et(n,e,t[e]);if(ro)for(var e of ro(t))os.call(t,e)&&Et(n,e,t[e]);return n},F=(n,t)=>Zn(n,es(t));var d=(n,t)=>()=>(n&&(t=n(n=0)),t);var G=(n,t)=>{for(var e in t)Pe(n,e,{get:t[e],enumerable:!0})},ns=(n,t,e,o)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let r of ts(t))!io.call(n,r)&&r!==e&&Pe(n,r,{get:()=>t[r],enumerable:!(o=Yn(t,r))||o.enumerable});return n};var ss=n=>ns(Pe({},\"__esModule\",{value:!0}),n);var s=(n,t,e)=>Et(n,typeof t!=\"symbol\"?t+\"\":t,e);var Oe,Ke,Rt,K,J=d(()=>{\"use strict\";Oe=\"__federation__\",Ke=\"onLoad\",Rt=\"moduleInstance\",K=(n,t)=>{window[Oe]&&window[Oe][n]&&window[Oe][n][Ke]&&window[Oe][n][Ke]({[n]:t})}});var ae,Ae=d(()=>{ae=\"0.2.3\"});var l,M=d(()=>{\"use strict\";l={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 T,rs,is,vt,kt=d(()=>{\"use strict\";T=()=>\"10000000-1000-4000-8000-100000000000\".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),rs=n=>{let t=[...n].map(e=>e.toString(16).padStart(2,\"0\")).join(\"\");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join(\"-\")},is=n=>{let t=n.replace(/-/g,\"+\").replace(/_/g,\"/\");for(;t.length%4;)t+=\"=\";let e=atob(t);return Uint8Array.from(e,o=>o.charCodeAt(0))},vt=n=>{let t=is(n);if(t.length%16!==0)throw new Error(\"Invalid input length\");let e=[];for(let o=0;o<t.length;o+=16)e.push(rs(t.slice(o,o+16)));return e}});var po,X=d(()=>{\"use strict\";kt();po=n=>new Promise(t=>setTimeout(t,n))});var R,I,Ht,v,k,N,H=d(()=>{\"use strict\";X();R=class{};s(R,\"down\",\"down\"),s(R,\"up\",\"up\");I=class{constructor(){s(this,\"id\",T());s(this,\"myop\",!0);s(this,\"content\");s(this,\"source\");s(this,\"destination\");s(this,\"route\");s(this,\"ref\");s(this,\"direction\");s(this,\"cleanable\",!1)}static create(...t){return new this(...t)}isTypeof(t){return t.messageType===this.messageType}},Ht=class extends I{constructor(e){super();this.ref=e}},v=class extends I{constructor(e){super();this.replayToHandler=e}},k=class extends I{constructor(e){super();this.handler=e;s(this,\"handlerUniqueId\",T())}},N=class n{constructor(t,e){this.refConfig=t;this.component=e;s(this,\"myop\",!0);s(this,\"__nonProxied\");this.__nonProxied=F(y({},this),{component:null})}static create(t,e,o){let r=e;return r||(r={id:\"\",name:\"\",description:\"\",selectorType:\"id-attribute\",selector:t,behavior:{type:\"code\"}}),new n(r,o)}}});var mo,_t,Q,co=d(()=>{\"use strict\";H();mo=\"ClickReplayMessage\",_t=class extends k{constructor(e,o){super(o);this.ref=e;s(this,\"replyMessageKey\",mo);s(this,\"messageType\",\"BindClickMessage\");s(this,\"cleanable\",!0)}},Q=class extends v{constructor(){super(...arguments);s(this,\"messageType\",mo)}}});var Dt,lo=d(()=>{\"use strict\";H();Dt=class extends I{constructor(e,o){super();this.ref=e;s(this,\"messageType\",\"ChangeTextMessage\");this.content=o}}});var fo,as,ps,go,_,Z,Bt=d(()=>{\"use strict\";H();fo=\"ExecuteScriptReplyMessage\",as=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,ps=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,go=n=>{let t=n.match(as);if(t)return t[1]||t[3];{let e=n.match(ps);if(e)return e[1].trim()}},_=class extends k{constructor(e,o=()=>{},r){super(o);this.scriptInputs=r;s(this,\"replyMessageKey\",fo);s(this,\"messageType\",\"ExecuteScriptMessage\");s(this,\"script\",\"\");this.script=e.toString(),this.content=e.toString(),this.content=go(this.content)}};s(_,\"replierKey\",\"send\"),s(_,\"completeStreamKey\",\"completeStream\");Z=class extends v{constructor(e,o){super(e);this.replayToHandler=e;this.content=o;s(this,\"messageType\",fo)}}});var $,uo=d(()=>{\"use strict\";Bt();$=class extends _{constructor(e,o,r=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:m})=>{let c=(i.shadowRoot||i.container).querySelectorAll(\"[myop-id='\".concat(a,\"']\"));return c.length?(m.ref=c[0],new Function(\"return (\".concat(p,\")(...arguments)\"))(m)):null},r);this.scriptInputs=o;this.scriptInputs=F(y({},o),{_script:e.toString()})}}});var yo,Lt,Y,ho=d(()=>{\"use strict\";H();yo=\"EventListenerCallbackMessage\",Lt=class extends k{constructor(e,o,r){super(r);this.ref=e;this.type=o;this.handler=r;s(this,\"replyMessageKey\",yo);s(this,\"messageType\",\"AddEventListenerMessage\");s(this,\"cleanable\",!0);s(this,\"serializableSkeleton\",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},Y=class extends v{constructor(e,o){super(e);this.replayToHandler=e;this.e=o;s(this,\"messageType\",yo);this.content={e:o}}}});var Pt,Mo=d(()=>{\"use strict\";H();Pt=class extends I{constructor(e,o,r){super();this.ref=e;this.name=o;this.value=r;s(this,\"messageType\",\"SetAttributeMessage\")}}});var Io,Ot,ee,Kt=d(()=>{\"use strict\";H();Io=\"ElementValueReplayMessage\",Ot=class extends k{constructor(e,o){super(o);this.ref=e;s(this,\"replyMessageKey\",Io);s(this,\"messageType\",\"GetElementValueMessage\")}},ee=class extends v{constructor(e){super();this.content=e;s(this,\"messageType\",Io)}}});var At,Co=d(()=>{\"use strict\";H();At=class extends I{constructor(e,o){super();this.ref=e;s(this,\"messageType\",\"SetInnerHtml\");this.content=o}}});var pe,Ie,te,xo=d(()=>{\"use strict\";H();pe=class extends I{constructor(e){super();s(this,\"messageType\",\"InitMessage\");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Ie=class extends pe{constructor(){super(...arguments);s(this,\"messageType\",\"InitResponse\")}},te=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"InitRequest\")}}});var bo,Ce,U,Fe=d(()=>{\"use strict\";H();bo=\"RefComponentCreatedMessage\",Ce=class extends k{constructor(e,o,r,i){super(i);this.refConfig=e;this.nestedComponentConfig=o;this.options=r;s(this,\"replyMessageKey\",bo);s(this,\"messageType\",\"CreateRefComponentMessage\")}},U=class extends v{constructor(e,o,r){super(e);this.replayToHandler=e;this.nestedRefs=o;this.failed=r;s(this,\"messageType\",bo)}}});var xe,Ft=d(()=>{\"use strict\";H();xe=class extends I{constructor(e,o){super();this.destination=e;this.message=o;s(this,\"messageType\",\"EnvelopedMessage\");let r=o;this.route=[e,...r.route?r.route:[]]}}});var wo,$t,oe,To=d(()=>{\"use strict\";H();wo=\"DetectedMyopRefsMessage\",$t=class extends k{constructor(){super(...arguments);s(this,\"messageType\",\"DetectMyopRefsMessage\");s(this,\"replyMessageKey\",wo)}},oe=class extends v{constructor(e,o){super(e);this.replayToHandler=e;s(this,\"messageType\",wo);this.content=o}isTypeof(e){return e.messageType===this.messageType}}});var So,Ut,be,Eo=d(()=>{\"use strict\";H();So=\"GetAttributeReplayMessage\",Ut=class extends k{constructor(e,o,r){super(r);this.ref=e;this.name=o;s(this,\"replyMessageKey\",So);s(this,\"messageType\",\"GetAttributeMessage\")}},be=class extends v{constructor(e){super();this.content=e;s(this,\"messageType\",So)}}});var P,Ro=d(()=>{\"use strict\";H();P=class extends I{constructor(e){super();this.method=e;s(this,\"messageType\",\"ExecuteComponentMethod\")}}});var zt,we,vo=d(()=>{\"use strict\";H();zt=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"SetMutationObserverMessage\")}},we=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"MutationObserverMessage\")}}});var ko,Te,Se,Ho=d(()=>{\"use strict\";H();ko=\"CleanupReplayMessage\",Te=class extends k{constructor(e,o){super(o);this.cleanupForMessageId=e;s(this,\"replyMessageKey\",ko);s(this,\"messageType\",\"CleanupMessage\")}},Se=class extends v{constructor(e){super();this.customCleanup=e;s(this,\"messageType\",ko)}}});var Ee,_o=d(()=>{\"use strict\";H();Ee=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"DisposeMessage\")}}});var Nt,Re,Do=d(()=>{\"use strict\";H();Nt=class extends I{constructor(){super(...arguments);s(this,\"cleanable\",!0);s(this,\"messageType\",\"SetResizeObserverMessage\")}},Re=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"ResizeObserverMessage\")}}});var me={};G(me,{AddEventListenerMessage:()=>Lt,BaseMyopMessage:()=>I,BindClickMessage:()=>_t,ChangeTextMessage:()=>Dt,CleanupMessage:()=>Te,CleanupReplayMessage:()=>Se,ClickReplayMessage:()=>Q,CreateRefComponentMessage:()=>Ce,CustomRefMessage:()=>$,DetectMyopRefsMessage:()=>$t,DetectedMyopRefsMessage:()=>oe,DisposeMessage:()=>Ee,ElementValueReplayMessage:()=>ee,EnvelopedMessage:()=>xe,EventListenerCallbackMessage:()=>Y,ExecuteComponentMethod:()=>P,ExecuteScriptMessage:()=>_,ExecuteScriptReplyMessage:()=>Z,GetAttributeMessage:()=>Ut,GetAttributeReplayMessage:()=>be,GetElementValueMessage:()=>Ot,InitMessage:()=>pe,InitRequest:()=>te,InitResponse:()=>Ie,MessageDirection:()=>R,MutationObserverMessage:()=>we,MyopBindMessage:()=>k,MyopBindReplayMessage:()=>v,MyopElementMessage:()=>Ht,Ref:()=>N,RefComponentCreatedMessage:()=>U,ResizeObserverMessage:()=>Re,SetAttributeMessage:()=>Pt,SetInnerHtml:()=>At,SetMutationObserverMessage:()=>zt,SetResizeObserverMessage:()=>Nt,stripFunction:()=>go});var x=d(()=>{\"use strict\";H();co();lo();Bt();uo();ho();Mo();Kt();Co();xo();Fe();Ft();To();Kt();Eo();Ro();vo();Ho();_o();Do()});var V,ve=d(()=>{\"use strict\";M();x();de();V=class{constructor(t,e,o){this.componentDefinition=t;this.container=e;s(this,\"id\",\"\");s(this,\"messageHandlers\",{});s(this,\"element\");s(this,\"_markedForDisposed\",!1);s(this,\"bind\",(t,e)=>{this.messageHandlers[t]||(this.messageHandlers[t]=[]),this.messageHandlers[t].includes(e)||this.messageHandlers[t].push(e)});s(this,\"bindWhen\",(t,e,o)=>{if(!o)throw new Error(\"can't use component.bindWhen without an handler\");this.messageHandlers[t]||(this.messageHandlers[t]=[]);let r=this.messageHandlers[t],i=a=>e(a)?(o(a),!0):!1;return r.push(i),()=>{let a=r.indexOf(i);a>-1&&r.splice(a,1)}});s(this,\"setInitiated\",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});s(this,\"isInitiated\",!1);s(this,\"_whenInitiatedResolve\");s(this,\"_whenInitiatedReject\");s(this,\"_whenInitiated\",new Promise((t,e)=>{this._whenInitiatedResolve=t,this._whenInitiatedReject=e}));s(this,\"initiated\",()=>this._whenInitiated);s(this,\"props\",{});s(this,\"refs\",{});this.id=(o==null?void 0:o.id)||O.Instance().assignId(t);let r=o!=null&&o.timeout?o==null?void 0:o.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject(\"timeout_\".concat(r,\" \").concat(this.id))},r),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(t){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=t}onMessageReceived(t){if(t.messageType===l.ExecuteComponentMethod){let o=t;return this[o.method]?this[o.method](o.content):console.log(\"method not found \".concat(o.method,\" on component\"),this),!0}let e=this.messageHandlers[t.messageType];if(e&&e.length){let o=!1;return e.forEach(r=>{o=o||r(t)}),o}return!1}sendCleanupMessage(t){t.source=this.id,t.destination=this.id,t.direction=R.down;let e=this.bindWhen(t.replyMessageKey,r=>r.replayToHandler===t.handlerUniqueId,r=>{t.handler(r),e()}),o=t.handler;delete t.handler,this.send(t),t.handler=o}send(t){t.source||(t.source=this.id),t.destination||(t.destination=this.id),t.direction=R.down;let e;if(t.handler){let o=t;e=this.bindWhen(o.replyMessageKey,r=>r.replayToHandler===o.handlerUniqueId,o.handler),delete t.handler}return t.ref&&(t.ref=t.ref.__nonProxied||t.ref),t.cleanable?()=>{this.sendCleanupMessage(new Te(t.id,o=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log(\"disposing component\",this.id),this.send(new Ee);let t=this.messageHandlers.onDispose;t&&t.forEach(e=>{e(null)}),this.messageHandlers={},this.id+=\"_disposed\",this.isInitiated=!1}}});var ce,Bo=d(()=>{\"use strict\";ce=class{constructor(t,e,o,r,i){this.myopId=t;this.htmlTagName=e;this.BoundingRect=o;this.offsetTop=r;this.offsetLeft=i;s(this,\"type\",\"MyopElementRef\")}}});var Lo,C,$e,Po=d(()=>{\"use strict\";Lo=async n=>{if(typeof n==\"function\")n();else if(n instanceof Promise){let t=await n;typeof t==\"function\"&&t()}},C=class{constructor(t){this.messageToHost=t}},$e=class extends C{constructor(e,o){super(e);this.messageToHost=e;this.context=o}}});var Vt,le,Oo=d(()=>{\"use strict\";M();b();x();Vt=class{constructor(t,e){this.id=t;this.context=e;s(this,\"send\",t=>{})}},le=class{constructor(){s(this,\"messageToHandleAfterInit\",[]);s(this,\"components\",{});s(this,\"alwaysPassEnvelopesToHost\",!1);s(this,\"messageCleanupCache\",{})}handleIncomeMessages(t){let e=t.data?t.data:t.detail;if(!(!e||!e.myop)){let o=e;if(o.direction!==R.down)return;if(o.messageType===l.DisposeMessage){o.destination&&delete this.components[o.destination];return}if(o.messageType===l.InitMessage){let r=o.content.id;if(this.components[r])return;this.components[r]=new Vt(r),this.messageToHost(new Ie(r));return}if(o.messageType===l.EnvelopedMessage){let r=o,i=r.message;if(o=i,this.alwaysPassEnvelopesToHost||this.components[o.destination]){let a=myop.hostSDK.components.find(m=>m.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(m=>m.id===r.destination);if(p){p.send(i);return}}else return}if(o.messageType){if(o.messageType===l.CleanupMessage){let i=o,a=this.messageCleanupCache[i.cleanupForMessageId],p=new Se(!!a);p.destination=o.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],Lo(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let r=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===o.messageType){r=!0;let a=i.executor(o);if(o.cleanable&&a&&(this.messageCleanupCache[o.id]=a),a&&!o.cleanable)throw new Error(\"Cleanup handler generated for non-cleanable message. \\nmessageType - \".concat(o.messageType,\", handler executor was - \").concat(i.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&&o.cleanable)throw new Error(\"No cleanup handler generated for a cleanable message. \\nmessageType - \".concat(o.messageType,\", handler executor was - \").concat(i.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 z,ne,ue,fe,se,Ue,ge,b=d(()=>{\"use strict\";Bo();Po();Oo();z={IframeLoader:\"IframeLoader\",WebComponentLoader:\"WebComponentLoader\",HTMLLoader:\"HTMLLoader\",MinimizedLoader:\"MinimizedLoader\"},ne={open:\"open\",closed:\"closed\",none:\"none\",localFrame:\"localFrame\"},ue={message:\"message\",code:\"code\"},fe=class{};s(fe,\"code\",\"code\"),s(fe,\"component\",\"component\");se={Segmented:\"Segmented\",Dedicated:\"Dedicated\",Default:\"Default\"},Ue={Segment:\"Segment\",Promo:\"Promo\",AB:\"AB\"},ge=class{constructor(t,e){this.container=t;this.shadowRoot=e;s(this,\"getRootDiv\",()=>(this.shadowRoot||this.container).querySelector(\"div\"));s(this,\"getRoot\",()=>this.shadowRoot||this.container)}}});var qt,ms,Wt,L,re=d(()=>{\"use strict\";qt=n=>n!==Object(n),ms=n=>typeof n==\"function\",Wt=n=>{if(qt(n))return!0;if(ms(n)||Object.getPrototypeOf(n))return!1;for(let t in n){let e=n[t];if(typeof e==\"object\"){if(!Wt(e))return!1}else{if(qt(e))continue;return!1}}return!0},L=(n,t={},e=!0,o=new WeakMap)=>{if(qt(n))return n;if(Array.isArray(n)){if(o.has(n))return o.get(n);let r=[];o.set(n,r);for(let i=0;i<n.length;i++){let a=n[i];r[i]=L(a,t,e,o)}return r}if(n!==null&&typeof n==\"object\"){if(o.has(n))return o.get(n);let r={};o.set(n,r);for(let i in n){let a=typeof t==\"boolean\"?t:t[i];a&&(a===!0?(e?n[i]!==void 0:n[i])&&(r[i]=L(n[i],!0,e,o)):typeof a==\"object\"&&(r[i]=L(n[i],a,e,o)))}return r}return{}}});var Ko,Ao=d(()=>{\"use strict\";Ko={notSerializableRefCall:(n,t)=>{throw new Error(\"\\nThe input provided to '\".concat(n.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(t,\" \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '\").concat(n.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 ke,Fo=d(()=>{\"use strict\";ve();x();Ft();ke=class extends V{constructor(e,o,r){super(e,o.container,r);this.componentDefinition=e;this.parent=o;s(this,\"send\",e=>{let o=e.handler,r=super.send(e);return this.parent.send(new xe(this.id,e)),e.handler=o,r});s(this,\"dispose\",()=>{this.isInitiated&&this.send(new P(\"dispose\")),super.dispose()})}hide(){this.send(new P(\"hide\"))}show(){this.send(new P(\"show\"))}inspect(){return this.send(new P(\"inspect\"))}setHeightBasedOnDocumentElement(){this.send(new P(\"setHeightBasedOnDocumentElement\"))}setHeightBasedOnScrollHeight(){this.send(new P(\"setHeightBasedOnScrollHeight\"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var ds,ze,$o,Uo,zo,cs,jt,Gt,He=d(()=>{\"use strict\";x();x();b();re();Ao();Fo();ds=(n,t,e)=>{let o=document.createElement(\"a\");return o.textContent=n,o.style.position=\"relative\",o.style.padding=\"0 5px\",o.style.fontSize=\"14px\",o.style.top=\"0\",o.style.top=\"\".concat(t,\"px\"),o.style.transform=\"translateX(-50%)\",o.target=\"_blank\",o.href=\"https://dashboard.myop.dev/dashboard/component/\".concat(e.id),o},ze=(n,t,e,o,r,i)=>{let a=ds(\"\".concat(i.name,\" : \").concat(t),e,i);return o.insertBefore(a,r),r.style.border=\"1px solid #007BFF\",r.style.display=\"block\",()=>{r.style.border=\"unset\",o.removeChild(a)}},$o=(n,t,e)=>n?!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(t,\"\\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),Uo=(n,t,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(t,\"\\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.\"))},zo=(n,t,e)=>{let o=t.reduce((i,a)=>F(y({},i),{[a.name]:y({},a)}),{}),r={get:(i,a)=>{let p=o[a];if($o(p,a,n))return!1;if(p.behavior.type===ue.code){if(e.loader.type===z.HTMLLoader&&e.loader.shadowRootMode===ne.localFrame){let c=p.behavior;return n.element.contentWindow[c.remap||a]}return Uo(p,a,n),!1}return p.mode===\"output\"?new Promise(m=>{let c=[];p.behavior.ref&&c.push(N.create(p.behavior.ref)),c.push(g=>{m(g)}),p.behavior.params&&c.push(...p.behavior.params);let f=me[p.behavior.message];n.send(new f(...c))}):null},set:(i,a,p)=>{let m=o[a];if($o(m,a,n))return!1;if(m.behavior.type===ue.code){if(e.loader.type===z.HTMLLoader&&e.loader.shadowRootMode===ne.localFrame){let f=m.behavior;return n.element.contentWindow[f.remap||a]=p,!0}return Uo(m,a,n),!1}else if(m.mode===\"input\")if(m.behavior.type===\"message\"){let c=[];m.behavior.ref&&c.push(N.create(m.behavior.ref)),c.push(p),m.behavior.params&&c.push(...m.behavior.params);let f=me[m.behavior.message];return n.send(new f(...c)),!0}else throw new Error(\"Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n\"+\"Component: \".concat(n.componentDefinition.name,\", ID: \").concat(n.componentDefinition.id,\"\\n\\n\")+\"Prop Name: \".concat(a,\"\\n\")+\"Behavior Field: \".concat(m.behavior.type,\"\\n\\n\")+\"Check the documentation for valid behavior options.\");return!1}};return n.props={},n.props=new Proxy(n.props,r),n},cs=(n,t)=>new Proxy(n,{get(e,o){return e[o]?e[o]:(...i)=>new Promise(a=>{i.forEach(p=>{Wt(p)||Ko.notSerializableRefCall(o,p)}),t.send(new $(({ref:p,propName:m,functionArgs:c,makeSerializable:f})=>{if(p){let g=p[m];return f(typeof g==\"function\"?p[m](...c):g,!0)}return null},{elementId:e.refConfig.selector,propName:o,functionArgs:i},p=>{a(p.content)}))})},set(e,o,r){return t.send(new $(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:r,propName:o},i=>{})),!0}}),jt=async(n,t,e,o)=>{let r=n.component;if(!r)throw new Error(\"cant createRefComponent with detached ref\");return new Promise(async(i,a)=>{let p=new ke(t.type,r,o);e.push(p),await r.initiated();let m=setTimeout(()=>{a(\"timeout\")},5e3);r.send(new Ce(n.refConfig,t,F(y({},o||{}),{id:p.id,_hasParent:!0}),async c=>{if(clearTimeout(m),c.failed){a(\"CreateRefComponentMessage failed\");return}let f=e.find(g=>g.id==p.id);if(f!==p){r.refs[n.refConfig.name]=f,i(f);return}else p.setInitiated(),r.refs[n.refConfig.name]=p;c.nestedRefs.forEach(g=>{let u=t.instance.resolvedNestedComponents.find(E=>E.type.id===g.componentDefinitionId).type,h=new ke(u,p);h.setInitiated(),p.refs[g.refName]=h,e.push(h)});try{await Gt(p,t,e,!0),r.setHeightBasedOnScrollHeight&&r.setHeightBasedOnScrollHeight(),i(p)}catch(g){a(g)}}))})},Gt=async(n,t,e,o=!1)=>{n.refs||(n.refs={});let r=Object.values(n.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var m;if(i.behavior.type==fe.component){if(o){a();return}let c=i.behavior.componentId;c||(c=i.behavior.instance.componentId);let f=(m=t.instance.resolvedNestedComponents)==null?void 0:m.find(u=>u.type.id===c);if(!f)throw new Error(\"componentConfig provided without nestedComponentConfig check the config object\");let g=N.create(\"\",i,n);try{let u=await jt(g,f,e);n.refs[i.name]=u,a()}catch(u){p(u)}}else try{let c=N.create(\"\",i,n);n.refs[i.name]=cs(c,n),a()}catch(c){}}));try{await Promise.all(r)}catch(i){throw i}}});var ye,Jt=d(()=>{\"use strict\";ve();x();He();M();ye=class extends V{constructor(e,o,r,i,a){super(e,r,a);this.componentConfig=e;this.container=r;this.IframeElement=i;s(this,\"cleanupInspect\");s(this,\"setHeightBasedOnDocumentElement\",()=>{let e=this.send(new _(()=>window.document.documentElement.scrollHeight,o=>{this.IframeElement.style.height=\"\".concat(o.content,\"px\"),e()}))});s(this,\"observeSizeBasedOnDocumentElement\",()=>this.send(new _(({send:o})=>{let{height:r,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:m}=document.documentElement.getBoundingClientRect();o({height:p,width:m})});return a.observe(document.documentElement),a.observe(document.body),{height:r,width:i}},o=>{this.IframeElement.style.width=\"\".concat(o.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(o.content.height,\"px\")})));s(this,\"setSizeBasedOnDocumentElement\",()=>{let e=this.send(new _(()=>{let{height:o,width:r}=document.documentElement.getBoundingClientRect();return{height:o,width:r}},o=>{this.IframeElement.style.width=\"\".concat(o.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(o.content.height,\"px\"),e()}))});s(this,\"setHeightBasedOnScrollHeight\",()=>{let e=this.send(new _(()=>{let r=0;return r++,r--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+r+\"px\"},o=>{this.IframeElement.style.height=o.content,e()}))});s(this,\"send\",e=>{var i,a;let o=y({},e);if(o.messageType===l.ExecuteComponentMethod)return this[o.method](),()=>{};o.direction=R.down;let r=super.send(o);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(o,\"*\"),r});s(this,\"dispose\",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});o.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=ze(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===l.In.MutationObserverMessage||e.messageType===l.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var q,_e=d(()=>{\"use strict\";q=class{constructor(){s(this,\"appendChild\",(t,e,o)=>{var r;if(o!=null&&o.relative){if(o.relative.direction===\"before\")return t.insertBefore(e,o.relative.child);if(o.relative.direction===\"after\"){let i=(r=o.relative.child)==null?void 0:r.nextSibling;return t.insertBefore(e,i||null)}}else return t.appendChild(e)})}}});var ls,Ne,No=d(()=>{\"use strict\";Jt();_e();X();b();ls=(n,t,e)=>{let o=new URL(n);return o.searchParams.append(t,e),o.toString()},Ne=class extends q{constructor(){super(...arguments);s(this,\"type\",z.IframeLoader);s(this,\"load\",async(e,o,r,i)=>{let a,p=o.loader;if((r==null?void 0:r.nodeName)===\"IFRAME\")console.log(\"needs to load into an exsisting Iframe...\",p.url,r),a=r,a.src=p.url;else{let m=T(),c=\"myop-comp-\".concat(m);a=document.createElement(\"iframe\"),r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),i!=null&&i.hidden&&(a.style.visibility=\"hidden\"),a=this.appendChild(r,a,i);let f=o.loader.url;i!=null&&i._hasParent&&(f=ls(f,\"_myop-comp\",m));let g=\"\";i!=null&&i.elementAttributes&&(g=Object.entries(i==null?void 0:i.elementAttributes).map(([u,h])=>h===\"\"||h===null||h===void 0?u:\"\".concat(u,'=\"').concat(String(h),'\"')).join(\" \")),a.outerHTML='<iframe \\n id=\"'.concat(c,'\"\\n style=\"\\n padding: 0;\\n margin: 0;\\n height: ').concat(p.autoHeight||!p.height?\"\":p.height,\"; \\n width : 100%;\\n overflow: hidden;\\n border: none;\\n opacity: \").concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n position: \").concat(i!=null&&i.hidden?\"absolute\":\"static\",\";\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",';\\n \"\\n src=\"').concat(f,'\"\\n ').concat(g,\"\\n ></iframe>\"),a=r.querySelector(\"#\".concat(c))}return new ye(e,o,r,a,i)})}}});var Ve,Xt=d(()=>{\"use strict\";Ve={webcomponent_message_key:\"myop_webcomponent_message\"}});var he,Qt=d(()=>{\"use strict\";Xt();ve();He();he=class extends V{constructor(e,o,r,i,a){super(e,r,a);this.container=r;this.customElement=i;s(this,\"cleanupInspect\",()=>{});s(this,\"send\",e=>{let o=y({},e),r=super.send(o),i=new CustomEvent(Ve.webcomponent_message_key,{detail:o});try{this.customElement.dispatchEvent(i)}catch(a){console.log(\"error while trying to dispatchEvent\",a)}return r});s(this,\"dispose\",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=ze(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 Zt,qe,Vo=d(()=>{\"use strict\";Qt();_e();X();b();Zt={},qe=class extends q{constructor(){super(...arguments);s(this,\"type\",z.WebComponentLoader);s(this,\"load\",async(e,o,r,i)=>{let a=o.loader;Zt[a.url]?console.log(\"Module alreday loaded or in loading process\"):Zt[a.url]=new Promise((c,f)=>{let g=a.url,u=document.createElement(\"script\");u.type=\"module\",u.src=g,u.onload=()=>{c()},u.onerror=()=>{f()},document.head.appendChild(u)}),await Zt[a.url],await po(1);let p=\"myop-comp-\".concat(T()),m=document.createElement(a.tag);return r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),m.id=p,i!=null&&i.hidden&&(m.style.opacity=\"0\",m.style.position=\"absolute\",m.style.height=\"0\",m.style.width=\"0\",m.style.pointerEvents=\"none\",m.style.visibility=\"hidden\"),i!=null&&i._environment&&(m._myopEnvironment=i==null?void 0:i._environment),this.appendChild(r,m,i),new he(e,o,r,m,i)})}}});var S,A=d(()=>{\"use strict\";b();S=class extends $e{constructor(e,o){super(e);this.context=o;s(this,\"executor\",e=>{if(e.destination){let o=e.destination;if(this.context[o].context){let r=(i,a)=>{this.messageToHost(F(y({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[o].context,r)}else debugger}else debugger})}}});var D,W=d(()=>{\"use strict\";D={id:\"myop-id\"}});var w,qo,B=d(()=>{\"use strict\";W();w=(n,t)=>t.querySelectorAll(\"[\".concat(D.id,\"='\").concat(n.refConfig.selector,\"']\")),qo=(n,t)=>{let e=w(n,t);return e.length?e.item(0):null}});var We,Wo=d(()=>{\"use strict\";M();x();A();B();We=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.BindClickMessage);s(this,\"innerExecutor\",(e,o,r)=>{let i=w(e.ref,o.shadowRoot),a=[];return i.forEach(p=>{let m=()=>{r(new Q(e.handlerUniqueId))};p.addEventListener(\"click\",m),a.push(()=>{p.removeEventListener(\"click\",m)})}),()=>{a.forEach(p=>p())}})}}});var je,jo=d(()=>{\"use strict\";M();A();B();je=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.ChangeTextMessage);s(this,\"innerExecutor\",(e,o)=>{w(e.ref,o.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var Ge,Go=d(()=>{\"use strict\";b();Ge=class extends ge{constructor(e,o){super(e,o);this.container=e;this.shadowRoot=o}}});var Je,Jo=d(()=>{\"use strict\";b();W();A();x();M();Je=class extends S{constructor(){super(...arguments);s(this,\"innerExecutor\",(e,o)=>{let r=o.shadowRoot.querySelectorAll(\"[\".concat(D.id,\"]\")),i=[];r.forEach(a=>{let p=a.getAttribute(D.id);p&&i.push(new ce(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new oe(e.handlerUniqueId,i))});s(this,\"messageType\",l.DetectMyopRefsMessage)}}});var Xe,Xo=d(()=>{\"use strict\";M();A();B();Xe=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.SetAttributeMessage);s(this,\"innerExecutor\",(e,o)=>{w(e.ref,o.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var Qe,Qo=d(()=>{\"use strict\";M();x();A();B();re();Qe=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.AddEventListenerMessage);s(this,\"innerExecutor\",(e,o,r)=>{let i=w(e.ref,o.shadowRoot),a=[];return i.forEach(p=>{let m=c=>{r(new Y(e.handlerUniqueId,L(c,e.serializableSkeleton)))};p.addEventListener(e.type,m),a.push(()=>{p.removeEventListener(e.type,m)})}),()=>{a.forEach(p=>p())}})}}});var Ze,Zo=d(()=>{\"use strict\";M();W();de();Fe();A();Ze=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.CreateRefComponentMessage);s(this,\"innerExecutor\",(e,o,r)=>{(async()=>{let a=o.shadowRoot.querySelectorAll(\"[\".concat(D.id,\"='\").concat(e.refConfig.selector,\"']\"));if(a.length===1){let p=O.Instance(),m=p.components.find(u=>u.id===e.options.id);m&&m.dispose();let c=p.components.indexOf(m);c!==-1&&p.components.splice(c,1);let f=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),g=[];Object.keys(f.refs).forEach(u=>{let h=f.refs[u];h=h.__nonProxied||h,h.componentDefinition&&g.push({refName:u,componentDefinitionId:h.componentDefinition.id})}),r(new U(e.handlerUniqueId,g))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new U(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var Ye,Yt=d(()=>{\"use strict\";re();Ye=(n,t,e)=>{let o=n.scriptInputs?n.scriptInputs:{};o.makeSerializable=L,o.send=t,o.rootRef=e,o.__scriptInputs=o;let i=new Function(\"return (\".concat(n.script,\")(...arguments)\"))(o);t(i)}});var et,Yo=d(()=>{\"use strict\";M();x();A();Yt();et=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.ExecuteScriptMessage);s(this,\"innerExecutor\",(e,o,r)=>{Ye(e,a=>{r(new Z(e.handlerUniqueId,a))},o)})}}});var en,tt,tn=d(()=>{\"use strict\";M();x();A();B();W();re();en=n=>{if(!n)return null;if(n.tagName===\"FORM\"){let t=new FormData(n),e={formData:{},unmappedData:[]},o=n.querySelectorAll(\"input, select, textarea\"),r=-1;return o.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(D.id),p=i.getAttribute(\"name\"),m={id:i.id,name:p,value:en(i),required:i.required,validity:L(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(m):(e.unmappedData.push(e.formData[p]),e.formData[p]=m):e.formData[p]=m:e.unmappedData.push(m)}}),e}return n.type===\"checkbox\"||n.type===\"radio\"?n.checked?n.value:null:n.tagName===\"INPUT\"||n.tagName===\"TEXTAREA\"||n.tagName===\"SELECT\"?n.value:n.isContentEditable?n.innerText||n.textContent:null},tt=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.GetElementValueMessage);s(this,\"innerExecutor\",(e,o,r)=>{w(e.ref,o.shadowRoot).forEach(a=>{r(new ee(en(a)),e)})})}}});var ot,on=d(()=>{\"use strict\";M();A();B();ot=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.SetInnerHtml);s(this,\"innerExecutor\",(e,o)=>{w(e.ref,o.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var nn={};G(nn,{WebComponentSDK:()=>Me});var Me,eo=d(()=>{\"use strict\";b();M();Xt();Wo();jo();Go();Jo();J();x();Xo();Qo();Zo();Yo();tn();on();Me=class extends le{constructor(){super(...arguments);s(this,\"alwaysPassEnvelopesToHost\",!0);s(this,\"connectedCallback\",(e,o)=>{e.addEventListener(Ve.webcomponent_message_key,r=>{let i=r.data?r.data:r.detail;if(!i||!i.myop){debugger;throw new Error(\"recvied webcomponent_message with wrong type\")}else{let a=i;if(this.handleIncomeMessages(r),a.messageType===l.InitMessage){let p=a.content.id;this.components[p].context=new Ge(e,o)}}}),setTimeout(()=>{this.messageToHost(new te)},1)});s(this,\"messageToHost\",(e,o)=>{e.direction=R.up,!e.replayToHandler&&(o!=null&&o.handlerUniqueId)&&(e.replayToHandler=o.handlerUniqueId),window.myop.hostSDK.send(e)});s(this,\"supportedHandlers\",[new je(this.messageToHost,this.components),new ot(this.messageToHost,this.components),new We(this.messageToHost,this.components),new Je(this.messageToHost,this.components),new Xe(this.messageToHost,this.components),new Qe(this.messageToHost,this.components),new et(this.messageToHost,this.components),new tt(this.messageToHost,this.components),new Ze(this.messageToHost,this.components)]);s(this,\"init\",()=>{})}};K(\"WebComponentSDK\",Me)});var sn=d(()=>{\"use strict\";eo()});function fs(n,t){return class extends HTMLElement{connectedCallback(){let e=t===ne.open?\"open\":\"closed\",o=this.attachShadow({mode:e});an().then(r=>{r.connectedCallback(this,o),o.innerHTML=n})}}}var rn,nt,an,gs,us,ys,st,pn=d(()=>{\"use strict\";Qt();_e();X();b();sn();Jt();rn=[],an=async()=>(nt||(nt=new Me,nt.init()),nt);gs=(n,t,e)=>{customElements.define(n,fs(t,e)),console.log(\"define('\".concat(n,\"') was called, web component ready to use\"))},us=n=>n.replace(/([a-z])([A-Z])/g,\"$1-$2\").replace(/(\\d+)/g,\"-$1\").toLowerCase(),ys=n=>(n=us(n),n.replace(/_/g,\"-\")),st=class extends q{constructor(){super(...arguments);s(this,\"type\",z.HTMLLoader);s(this,\"load\",async(e,o,r,i)=>{let a=o.loader,p=\"myop-comp-\".concat(T()),m;if(a.shadowRootMode===ne.localFrame){let c=T(),f=\"myop-comp-\".concat(c),g=document.createElement(\"iframe\");r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),i!=null&&i.hidden&&(g.style.visibility=\"hidden\"),g=this.appendChild(r,g,i),g.id=f,g.setAttribute(\"style\",\"\\n display: block;\\n padding: 0;\\n margin: 0;\\n overflow: hidden;\\n border: none;\\n opacity: \".concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n width: 100%;\\n height: 100%;\\n position: \").concat(i!=null&&i.hidden?\"absolute\":\"static\",\";\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",\";\\n \")),r.appendChild(g);let u=g.contentDocument||g.contentWindow.document;u.open();let h=a.HTML;if(i!=null&&i._inspection){let j=new DOMParser().parseFromString(a.HTML,\"text/html\"),St=j.getElementById(\"myop_preview\");St==null||St.removeAttribute(\"type\");let no=j.implementation.createHTMLDocument();no.body.innerHTML=\"<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>\";let so=no.body.firstChild;so&&j.head&&j.head.insertBefore(j.importNode(so,!0),j.head.firstChild),h=j.documentElement.outerHTML}u.writeln(h),u.writeln('<script src=\"'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'\"><\\/script>\\n <script>\\n \\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n \\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK()\\n sdk.init();\\n }\\n \\n __myop_init().then();\\n \\n <\\/script>')),u.close();let E=new ye(e,o,r,g,i);return a.autoHeight&&(g.onload=()=>{E.observeSizeBasedOnDocumentElement()}),E}if(a.shadowRootMode===ne.none){let c=document.createElement(\"template\");c.innerHTML=a.HTML,m=c.content.firstElementChild,an().then(f=>{f.connectedCallback(m,m)})}else{let c=ys(e.name+o.id);rn.includes(c)||(gs(c,a.HTML,a.shadowRootMode),rn.push(c)),m=document.createElement(c)}return r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),m.id=p,i!=null&&i.hidden&&(m.style.opacity=\"0\",m.style.position=\"absolute\",m.style.height=\"0\",m.style.width=\"0\",m.style.pointerEvents=\"none\",m.style.visibility=\"hidden\"),this.appendChild(r,m,i),new he(e,o,r,m,i)})}}});var mn,dn,cn=d(()=>{\"use strict\";X();x();mn=(n,t,e)=>{let o=\"myop-css-\".concat(T());return n.send(new _(({rootRef:r,_stylesheet:i,_tagId:a,_css:p})=>{let m=document.createElement(\"style\");m.type=\"text/css\";let c=p;for(let f in i){c+=\"\".concat(f,\" { \");let g=i[f];for(let u in g)c+=\"\".concat(u,\": \").concat(g[u],\"; \");c+=\"} \"}m.appendChild(document.createTextNode(c)),m.id=a,(r.shadowRoot||r.container).appendChild(m)},()=>{},{_stylesheet:t,_css:e||\"\",_tagId:o})),()=>{n.send(new _(({rootRef:r,_tagId:i})=>{let a=(r.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:o}))}},dn=(n,t)=>{let e=\"myop-css-\".concat(T());return n.send(new _(({rootRef:o,_tagId:r,_link:i})=>{let a=document.createElement(\"link\");a.id=r,a.rel=\"stylesheet\",a.href=i,document.head.appendChild(a),(o.shadowRoot||o.container).appendChild(a)},()=>{},{_link:t,_tagId:e})),()=>{n.send(new _(({rootRef:o,_tagId:r})=>{let i=(o.shadowRoot||document).getElementById(r);i&&i.remove()},()=>{},{_tagId:e}))}}});var hs,to,ln,fn=d(()=>{\"use strict\";hs=(n,t)=>{let e=new RegExp(Object.keys(t).join(\"|\"),\"g\");return n.replace(e,o=>(t[o]||o).toString())},to=(n,t)=>{let e=n.loader;if(e.type!==\"IframeLoader\")throw new Error('iframeSkinUrlTokenizer received skin with loader type \"'.concat(e.type,'\", currently only \"IframeLoader\" is supported'));return n.loader=y({},n.loader),n.loader.url=hs(n.loader.url,t),n},ln=n=>async t=>to(t,n)});var gn,un,yn=d(()=>{\"use strict\";x();gn=(n,t,e)=>{n.send(new $(({ref:o,_className:r})=>{o==null||o.classList.add(r)},{elementId:e,_className:t}))},un=(n,t,e)=>{n.send(new $(({ref:o,_className:r})=>{o==null||o.classList.remove(r)},{elementId:e,_className:t}))}});var at,rt,pt,it,hn=d(()=>{\"use strict\";X();at=class at{constructor(){s(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+T());s(this,\"_runTimeId\",\"runtime-id-\"+T());s(this,\"_runTimeName\",\"runtime-name-\"+T());s(this,\"id\",this._runTimeId);s(this,\"name\",this._runTimeName);s(this,\"description\",\"\");s(this,\"loader\",null);s(this,\"withLoader\",t=>(this.loader=t,this));s(this,\"withHTMLLoader\",t=>(t.type=\"HTMLLoader\",this.loader=t,this));s(this,\"build\",()=>this)}};s(at,\"create\",()=>new at);rt=at,pt=class pt{constructor(){s(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+T());s(this,\"_runTimeId\",\"runtime-id-\"+T());s(this,\"_runTimeName\",\"runtime-name-\"+T());s(this,\"instance\",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});s(this,\"name\",this._runTimeName);s(this,\"type\",{id:this._runTimeId,name:this._runTimeName,description:\"\",props:[],refs:[],skins:[],defaultSkin:0});s(this,\"withInstance\",t=>(this.instance=t,this));s(this,\"withType\",t=>(this.type=t,this));s(this,\"withName\",t=>(this.name=t,this));s(this,\"withDefaultSkin\",t=>(this.type.skins.push(t),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:\"Dedicated\",skin:{id:t.id}},this));s(this,\"withRef\",t=>(this.type.refs.push(t),this));s(this,\"withBasicRef\",t=>{let e={id:\"\",name:t,description:\"\",selectorType:\"id-attribute\",selector:t,behavior:{type:\"code\"}};return this.type.refs.push(e),this});s(this,\"build\",()=>JSON.parse(JSON.stringify(this)))}};s(pt,\"create\",()=>new pt);it=pt});var mt,ie,Mn=d(()=>{\"use strict\";mt=class mt{constructor(t=\"https://cloud.myop.dev\"){this._baseUrl=t;s(this,\"userFlows\",{})}async fetchComponent(t,e){return e?(await this.fetchFlow(e)).components.find(r=>r.type.id===t):(await this.fetchAutoFlow(t)).components[0]}async fetchAutoFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,o)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(t,\"&auto=true\"))).json();e(i.item)}catch(r){o(r)}})),await this.userFlows[t]}async fetchFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,o)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(t,\"&resolve=components\"))).json();e(i.item)}catch(r){o(r)}})),await this.userFlows[t]}};s(mt,\"Main\",new mt);ie=mt});var In,Cn=d(()=>{\"use strict\";In=async n=>await n()});var xn=d(()=>{\"use strict\";de();ve();_e();He()});var dt,Be,bn,wn=d(()=>{\"use strict\";xn();b();dt=class dt{constructor(t=\"https://cloud.myop.dev\"){this._baseUrl=t;s(this,\"variants\",{})}async fetchComponent(t,e){return this.variants[t]||(this.variants[t]=new Promise(async(o,r)=>{try{let a=await(await fetch(\"\".concat(this._baseUrl,\"/consume?id=\").concat(t,\"&env=\").concat(e))).json();o(a.item)}catch(i){r(i)}})),await this.variants[t]}};s(dt,\"Main\",new dt);Be=dt,bn=(n,t)=>{let e=t||new Be;return{loadComponent:async(o,r,i)=>{let a=await e.fetchComponent(o,n);(!a.consume_variant||!a.consume_variant.length)&&console.warn('[Myop Warning] Component \"'.concat(o,'\" has no implementation for environment \"').concat(n,'\".'));let p={instance:{id:\"auto\",componentId:a.componentId,componentName:a.name,skinSelector:{type:\"Dedicated\",skin:{id:\"skin_auto_v2_converted\"}}},type:{id:a.id,name:a.name,description:a.description,props:[{id:\"in_auto_v2_converted\",name:\"myop_init_interface\",type:\"any\",behavior:{type:ue.code}},{id:\"out_auto_v2_converted\",name:\"myop_cta_handler\",type:\"any\",behavior:{type:ue.code}}],refs:[],skins:[{id:\"skin_auto_v2_converted\",name:\"auto_v2_converted\",description:\"\",loader:a.consume_variant[0].loader}],defaultSkin:0},name:a.name};return await De.loadComponent(p,r,i)}}}});var oo={};G(oo,{CloudRepository:()=>ie,ComponentConfig:()=>it,SkinConfig:()=>rt,addClass:()=>gn,applyStylesheet:()=>mn,applyStylesheetLink:()=>dn,changeSkinUrlByTokenizer:()=>ln,createIframeSkinByTokenizer:()=>to,enableV2:()=>bn,exec:()=>In,removeClass:()=>un,v2_CloudRepository:()=>Be});var ct=d(()=>{\"use strict\";cn();fn();yn();hn();Mn();Cn();wn()});var Tn,Sn=d(()=>{\"use strict\";kt();ct();b();Tn=async n=>{try{let t=new URL(window.location.href),o=new URLSearchParams(t.search).get(\"myopOverride\");if(o){let[r,...i]=vt(o);switch(r){case\"component\":{let[a,p]=i,m=await ie.Main.fetchComponent(a);if(m&&m.type.skins.find(f=>f.id===p))return m.instance.skinSelector={type:se.Dedicated,skin:{id:p}},m}break;default:{let[a,p]=vt(o),c=(await ie.Main.fetchFlow(a)).components.find(f=>f.type.id===n.type.id);if(c&&c.instance.skinSelector.type===se.Segmented&&c.instance.resolvedExperiences){let f=c.instance.resolvedExperiences.find(g=>g.id===p);if((f==null?void 0:f.type)===Ue.Segment){let g=f,h=c.instance.skinSelector.segments.find(E=>E.segmentId===g.segment.id);if(h)return c.instance.skinSelector=h==null?void 0:h.skinSelector,c}}}break}}}finally{return null}}});var Rn={};G(Rn,{HostSDK:()=>O,hostSDK:()=>De});var En,O,De,de=d(()=>{\"use strict\";J();M();x();No();Vo();He();b();Ae();pn();Sn();En=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",O=class{constructor(){s(this,\"components2init\",[]);s(this,\"components\",[]);s(this,\"componentsLoaders\",[]);s(this,\"initiated\",!1);s(this,\"version\",ae);s(this,\"type2InstanceCount\",{});s(this,\"assignId\",t=>(this.type2InstanceCount[t.id]||(this.type2InstanceCount[t.id]=0),\"\".concat(t.id,\"_\").concat(++this.type2InstanceCount[t.id])));s(this,\"inspected\",!1);s(this,\"inspect\",()=>{this.inspected||(this.inspected=!0,this.components.forEach(t=>{t.inspect&&t.inspect()}))});s(this,\"incomingMessageHandler\",t=>{if(t.origin,document.location.origin,t.data.myop){if(t.data.direction!==R.up&&t.data.messageType!==l.EnvelopedMessage)return;let e=t.data;if(e.messageType===l.InitRequest){this.components2init.forEach(r=>{r.send(new pe(r.id))});return}if(e.messageType===l.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let r=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});r==null||r.setInitiated();return}if(e.messageType===l.EnvelopedMessage){let r=e,i=this.components.find(a=>a.id===r.destination);if(i){if(r.direction===R.down){r.message.messageType===P.name?i.onMessageReceived(r.message):(r.message.route=r.route,i.send(r.message));return}}else{let a=this.components.find(p=>p.id===r.message.destination);a&&a.send(r.message)}return}let o=this.components.find(r=>r.id===e.destination);if(!o){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(o){if(o.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});s(this,\"send\",t=>{let e=new MessageEvent(\"\",{data:t});this.incomingMessageHandler(e)});s(this,\"init\",t=>{if(this.initiated)throw new Error(\"hostSDK already initiated\");let e=[new Ne,new qe,new st];if(this.componentsLoaders=[...e],t){let o={};t.forEach(r=>{let i=new r(this.componentsLoaders);o[i.type]=i}),this.componentsLoaders.forEach(r=>{o[r.type]||(o[r.type]=r)}),this.componentsLoaders=Object.values(o)}window.addEventListener(\"message\",this.incomingMessageHandler,!1),console.log(\"myop hostSDK initiated\",document.location.href),this.initiated=!0});s(this,\"_getSkinIdBySkinSelector\",async(t,e=[],o)=>{var i;async function r(a,p){for(let m of a)if(await p(m))return m}switch(t.type){case\"DedicatedSkin\":case se.Dedicated:return((i=t.skin)==null?void 0:i.id)||t.skins[0].id;case se.Segmented:{let p=await r(t.segments,async m=>{if(m.segmentId===\"Default\")return!0;let c=e.find(h=>h.type===Ue.Segment?h.segment.id===m.segmentId:!1);if(!c)throw new Error(\"experience not found\");let g=c.segment,u=(o||{})[g.function];return u?await u():(console.warn(\"segmentId:\".concat(m.segmentId,\", \").concat(g.function,\" function not provided !\")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return\"\"});s(this,\"runSkinSelector\",async(t,e)=>{let o=await this._getSkinIdBySkinSelector(t.instance.skinSelector,t.instance.resolvedExperiences,e);return t.type.skins.find(r=>r.id===o)});s(this,\"loaderHooks\");s(this,\"loadComponent\",async(t,e,o)=>{var f,g,u,h;if(!e){debugger;throw new Error(\"no container was found for this component\")}let r=await Tn(t);r&&(t=r);let i=y(y({},(f=this.loaderHooks)!=null?f:{}),(g=o==null?void 0:o.hooks)!=null?g:{}),a=e;if(a.myop)if(a.component){t=y({},t),t.instance=y({},t.instance);let E=await this.runSkinSelector(t,i);if(!E)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");return(u=o==null?void 0:o.hooks)!=null&&u.afterSkinSelected&&(E=await o.hooks.afterSkinSelected(y({},E))),t.instance.skinSelector={type:se.Dedicated,skin:E},o&&(o=y({},o),delete o.hooks),await jt(a,t,this.components,o)}else throw new Error(\"load component got a detached ref.\");e=e;let p=await this.runSkinSelector(t,i);if(!p)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");(h=o==null?void 0:o.hooks)!=null&&h.afterSkinSelected&&(p=await o.hooks.afterSkinSelected(y({},p)));let m=this.componentsLoaders.find(E=>E.type===p.loader.type);if(!m){debugger;throw new Error('no loader \"'.concat(p.loader.type,'\" was found for component'))}let c=await m.load(t.type,p,e,o);c.isInitiated||this.components2init.push(c),c.bind(\"onDispose\",()=>(this.components=this.components.filter(E=>E!==c),this.components2init=this.components2init.filter(E=>E!==c),!0)),this.components.push(c),(!o||o.connectProps!==!1)&&(c=zo(c,t.type.props,p));try{await Gt(c,t,this.components)}catch(E){throw E}return o!=null&&o.skipInit||await c.initiated(),c});s(this,\"navigate\",async(t,e,o)=>{if(t.parent)throw new Error(\"Navigating on remote ref components is not implemented yet\");if(o!=null&&o.staged){let r=await this.loadComponent(e,t.container,y({hidden:!0,relative:{direction:\"after\",child:t.element}},o));return o.init&&await o.init(r),r.show(),t.dispose(),r}else{let r=t.element.nextSibling;return t.dispose(),this.loadComponent(e,t.container,y({relative:{direction:\"before\",child:r}},o))}})}};s(O,\"Instance\",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:En});if(!window.myop.hostSDK){let n=new O;n.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:En}),window.myop.hostSDK=n}De=window.myop.hostSDK;K(\"hostSDK\",De)});var lt,vn=d(()=>{\"use strict\";M();W();b();x();lt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.DetectMyopRefsMessage);s(this,\"executor\",e=>{let o=document.querySelectorAll(\"[\".concat(D.id,\"]\")),r=[];o.forEach(i=>{let a=i.getAttribute(D.id);a&&r.push(new ce(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new oe(e.handlerUniqueId,r))})}}});var ft,kn=d(()=>{\"use strict\";M();b();x();B();ft=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.BindClickMessage);s(this,\"executor\",e=>{let o=[];return w(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new Q,e)};i.addEventListener(\"click\",a);let p=()=>{i.removeEventListener(\"click\",a)};o.push(p)}),()=>{o.forEach(i=>i())}})}}});var gt,Hn=d(()=>{\"use strict\";M();b();B();gt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.ChangeTextMessage);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{r.textContent=e.content})})}}});var ut,_n=d(()=>{\"use strict\";M();x();b();Yt();ut=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.ExecuteScriptMessage);s(this,\"executor\",e=>{Ye(e,r=>{this.messageToHost(new Z(e.handlerUniqueId,r))},new ge(document.documentElement))})}}});var yt,Dn=d(()=>{\"use strict\";M();b();x();re();B();yt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.AddEventListenerMessage);s(this,\"executor\",e=>{let o=w(e.ref,document),r=[];return o.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new Y(e.handlerUniqueId,L(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),r.push(()=>{i.removeEventListener(e.type,a)})}),()=>{r.forEach(i=>{i()})}})}}});var ht,Bn=d(()=>{\"use strict\";M();b();B();ht=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetAttributeMessage);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var Mt,Ln=d(()=>{\"use strict\";M();W();b();de();Fe();Mt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.CreateRefComponentMessage);s(this,\"executor\",e=>{(async()=>{let r=document.querySelectorAll(\"[\".concat(D.id,\"='\").concat(e.refConfig.selector,\"']\"));if(r.length===1){let a=await O.Instance().loadComponent(e.nestedComponentConfig,r.item(0),e.options),p=[];Object.keys(a.refs).forEach(m=>{let c=a.refs[m];c=c.__nonProxied||c,c.componentDefinition&&p.push({refName:m,componentDefinitionId:c.componentDefinition.id})}),this.messageToHost(new U(e.handlerUniqueId,p))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new U(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var Pn,On=d(()=>{\"use strict\";Pn=(n,t)=>{if(!n){console.log(\"n\");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!n||n.nodeType!==1))if(e){let o=new e(t),r={attributes:!0,childList:!0,subtree:!0};return o.observe(n,r),o}else window.addEventListener&&(n.addEventListener(\"DOMNodeInserted\",t,!1),n.addEventListener(\"DOMNodeRemoved\",t,!1))}});var It,Kn=d(()=>{\"use strict\";M();x();b();On();It=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetMutationObserverMessage);s(this,\"executor\",e=>{e.source&&Pn(document.body,()=>{this.messageToHost(new we)})})}}});var An,Ct,Fn=d(()=>{\"use strict\";M();W();b();x();re();B();An=n=>{if(!n)return null;if(n.tagName===\"FORM\"){let t=new FormData(n),e={formData:{},unmappedData:[]},o=n.querySelectorAll(\"input, select, textarea\"),r=-1;return o.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(D.id),p=i.getAttribute(\"name\"),m={id:i.id,name:p,value:An(i),required:i.required,validity:L(i.validity,!0),myopId:a};e.unmappedData.push(m),p&&(!e.formData[p]||!e.formData[p].value||m.value)&&(e.formData[p]=m)}}),e}return n.type===\"checkbox\"||n.type===\"radio\"?n.checked?n.value:null:n.tagName===\"INPUT\"||n.tagName===\"TEXTAREA\"||n.tagName===\"SELECT\"?n.value:n.isContentEditable?n.innerText||n.textContent:null},Ct=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.GetElementValueMessage);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{this.messageToHost(new ee(An(r)),e)})})}}});var xt,$n=d(()=>{\"use strict\";M();b();x();B();xt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.GetAttributeMessage);s(this,\"executor\",e=>{let o=qo(e.ref,document);o&&this.messageToHost(new be(o.getAttribute(e.name)),e)})}}});var bt,Un=d(()=>{\"use strict\";x();M();b();bt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetResizeObserverMessage);s(this,\"executor\",e=>{let o=new ResizeObserver(r=>{this.messageToHost(new Re)});return o.observe(document.body),()=>{o.disconnect()}})}}});var wt,zn=d(()=>{\"use strict\";M();b();B();wt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetInnerHtml);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{r.innerHTML=e.content})})}}});var Nn={};G(Nn,{IframeSDK:()=>Tt});var Tt,Vn=d(()=>{\"use strict\";b();vn();kn();Hn();_n();J();Dn();Bn();x();Ln();Kn();Fn();Ae();$n();Un();zn();Tt=class extends le{constructor(){super();s(this,\"version\",ae);s(this,\"messageToHost\",(e,o)=>{var i;!e.replayToHandler&&(o!=null&&o.handlerUniqueId)&&(e.replayToHandler=o.handlerUniqueId);let r=Object.keys(this.components);e.destination||(o!=null&&o.route?e.destination=o.route[o.route.length-1]:e.destination=r[0]),e.source||(e.source=r[0]),e.direction=R.up,(i=window.parent)==null||i.postMessage(y({},e),\"*\")});s(this,\"supportedHandlers\",[new gt(this.messageToHost),new wt(this.messageToHost),new ft(this.messageToHost),new lt(this.messageToHost),new ut(this.messageToHost),new yt(this.messageToHost),new ht(this.messageToHost),new Ct(this.messageToHost),new It(this.messageToHost),new bt(this.messageToHost),new xt(this.messageToHost),new Mt(this.messageToHost)]);s(this,\"init\",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new te)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};K(\"IframeSDK\",Tt)});var Is={};var Ms,qn=d(()=>{\"use strict\";x();J();Ms=y({},me);K(\"MyopMessages\",Ms)});var Wn={};G(Wn,{CloudRepository:()=>ie,ComponentConfig:()=>it,SkinConfig:()=>rt,addClass:()=>gn,applyStylesheet:()=>mn,applyStylesheetLink:()=>dn,changeSkinUrlByTokenizer:()=>ln,createIframeSkinByTokenizer:()=>to,enableV2:()=>bn,exec:()=>In,removeClass:()=>un,v2_CloudRepository:()=>Be});var jn=d(()=>{\"use strict\";J();ct();ct();K(\"MyopHelpers\",oo)});var Ts={};G(Ts,{getHostModule:()=>Gn,getIframeModule:()=>Jn,getWebcomponentModule:()=>Xn});J();var ao;if(window.__federation__)console.log(\"__federation__ loaded more than once.\");else{let n=(ao=document.currentScript)==null?void 0:ao.src,t=n?n.split(\"/\").slice(0,-1).join(\"/\"):\"\";window.__federation__={__public_auto_path__:t,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(n,t,e)=>{if(window.__federation__[t])console.log(\"__federation__ module \".concat(t,\" already loaded.\")),e(window.__federation__[t][Rt]);else{let o;window.__federation__[t]={},window.__federation__[t][Ke]=r=>{o&&(document.head.removeChild(o),o=null),window.__federation__[t][Rt]=r,e(r)},o=document.createElement(\"script\"),o.type=\"module\",o.src=n,o.async=!0,document.head.appendChild(o)}};Ae();console.log(\"myop root sdk - loaded\",document.location.origin);var Cs=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",Gn=()=>Promise.resolve().then(()=>(de(),Rn)),Jn=()=>Promise.resolve().then(()=>(Vn(),Nn)),Xn=()=>Promise.resolve().then(()=>(eo(),nn)),xs=()=>Promise.resolve().then(()=>(qn(),Is)),bs=()=>Promise.resolve().then(()=>(jn(),Wn)),Le=n=>async()=>(await n()).get(),ws={version:ae,getHostModule:Le(Gn),getIframeModule:Le(Jn),getWebcomponentModule:Le(Xn),getMyopMessages:Le(xs),getMyopHelpers:Le(bs)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:Cs});window.myop.rootSDK?console.log(\"myop root host loaded more than once.\"):window.myop=y({rootSDK:ws},window.myop);return ss(Ts);})();\n</script>\n </head>\n <body>\n <div id=\"myop-container\"></div>\n <script>\n // Initialize hostSDK on page load\n (async function initSDK() {\n try {\n // Use the internal getHostModule which returns the module directly\n const hostModule = await MyopSDK.getHostModule();\n // hostModule is the exports object with { hostSDK, HostSDK }\n window.__myopHostSDK = hostModule.hostSDK || window.myop.hostSDK;\n window.ReactNativeWebView.postMessage('WEBVIEW_READY');\n } catch (err) {\n window.ReactNativeWebView.postMessage('SDK_INIT_ERROR:' + err.message);\n }\n })();\n\n async function loadMyopComponent(configAsString) {\n try {\n const componentConfig = JSON.parse(decodeURIComponent(configAsString));\n const container = document.getElementById('myop-container');\n window.myopComponent = await window.__myopHostSDK.loadComponent(componentConfig, container);\n\n // Set up myop_cta_handler to forward calls to React Native\n if (window.myopComponent && window.myopComponent.element && window.myopComponent.element.contentWindow) {\n window.myopComponent.element.contentWindow.myop_cta_handler = function(action, payload) {\n window.ReactNativeWebView.postMessage('CTA:' + JSON.stringify({ action: action, payload: payload }));\n };\n }\n\n window.ReactNativeWebView.postMessage('COMPONENT_LOADED');\n } catch (err) {\n window.ReactNativeWebView.postMessage('COMPONENT_ERROR:' + err.message);\n }\n }\n </script>\n </body>\n</html>\n";
|
|
1
|
+
export declare const HTML = "\n<!DOCTYPE html>\n<html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <style>\n html, body {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-family: sans-serif;\n }\n #myop-container {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n }\n </style>\n <script>\"use strict\";var MyopSDK=(()=>{var He=Object.defineProperty,Gn=Object.defineProperties,Jn=Object.getOwnPropertyDescriptor,Xn=Object.getOwnPropertyDescriptors,Qn=Object.getOwnPropertyNames,oo=Object.getOwnPropertySymbols;var no=Object.prototype.hasOwnProperty,Zn=Object.prototype.propertyIsEnumerable;var wt=(n,t,e)=>t in n?He(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,y=(n,t)=>{for(var e in t||(t={}))no.call(t,e)&&wt(n,e,t[e]);if(oo)for(var e of oo(t))Zn.call(t,e)&&wt(n,e,t[e]);return n},$=(n,t)=>Gn(n,Xn(t));var c=(n,t)=>()=>(n&&(t=n(n=0)),t);var J=(n,t)=>{for(var e in t)He(n,e,{get:t[e],enumerable:!0})},Yn=(n,t,e,o)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let r of Qn(t))!no.call(n,r)&&r!==e&&He(n,r,{get:()=>t[r],enumerable:!(o=Jn(t,r))||o.enumerable});return n};var es=n=>Yn(He({},\"__esModule\",{value:!0}),n);var s=(n,t,e)=>wt(n,typeof t!=\"symbol\"?t+\"\":t,e);var _e,De,Tt,K,X=c(()=>{\"use strict\";_e=\"__federation__\",De=\"onLoad\",Tt=\"moduleInstance\",K=(n,t)=>{window[_e]&&window[_e][n]&&window[_e][n][De]&&window[_e][n][De]({[n]:t})}});var ae,Be=c(()=>{ae=\"0.2.6\"});var l,M=c(()=>{\"use strict\";l={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 T,ts,os,St,Et=c(()=>{\"use strict\";T=()=>\"10000000-1000-4000-8000-100000000000\".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),ts=n=>{let t=[...n].map(e=>e.toString(16).padStart(2,\"0\")).join(\"\");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join(\"-\")},os=n=>{let t=n.replace(/-/g,\"+\").replace(/_/g,\"/\");for(;t.length%4;)t+=\"=\";let e=atob(t);return Uint8Array.from(e,o=>o.charCodeAt(0))},St=n=>{let t=os(n);if(t.length%16!==0)throw new Error(\"Invalid input length\");let e=[];for(let o=0;o<t.length;o+=16)e.push(ts(t.slice(o,o+16)));return e}});var ro,Q=c(()=>{\"use strict\";Et();ro=n=>new Promise(t=>setTimeout(t,n))});var R,I,Rt,v,k,N,H=c(()=>{\"use strict\";Q();R=class{};s(R,\"down\",\"down\"),s(R,\"up\",\"up\");I=class{constructor(){s(this,\"id\",T());s(this,\"myop\",!0);s(this,\"content\");s(this,\"source\");s(this,\"destination\");s(this,\"route\");s(this,\"ref\");s(this,\"direction\");s(this,\"cleanable\",!1)}static create(...t){return new this(...t)}isTypeof(t){return t.messageType===this.messageType}},Rt=class extends I{constructor(e){super();this.ref=e}},v=class extends I{constructor(e){super();this.replayToHandler=e}},k=class extends I{constructor(e){super();this.handler=e;s(this,\"handlerUniqueId\",T())}},N=class n{constructor(t,e){this.refConfig=t;this.component=e;s(this,\"myop\",!0);s(this,\"__nonProxied\");this.__nonProxied=$(y({},this),{component:null})}static create(t,e,o){let r=e;return r||(r={id:\"\",name:\"\",description:\"\",selectorType:\"id-attribute\",selector:t,behavior:{type:\"code\"}}),new n(r,o)}}});var io,vt,Z,ao=c(()=>{\"use strict\";H();io=\"ClickReplayMessage\",vt=class extends k{constructor(e,o){super(o);this.ref=e;s(this,\"replyMessageKey\",io);s(this,\"messageType\",\"BindClickMessage\");s(this,\"cleanable\",!0)}},Z=class extends v{constructor(){super(...arguments);s(this,\"messageType\",io)}}});var kt,po=c(()=>{\"use strict\";H();kt=class extends I{constructor(e,o){super();this.ref=e;s(this,\"messageType\",\"ChangeTextMessage\");this.content=o}}});var mo,ns,ss,co,_,Y,Ht=c(()=>{\"use strict\";H();mo=\"ExecuteScriptReplyMessage\",ns=/(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/,ss=/\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/,co=n=>{let t=n.match(ns);if(t)return t[1]||t[3];{let e=n.match(ss);if(e)return e[1].trim()}},_=class extends k{constructor(e,o=()=>{},r){super(o);this.scriptInputs=r;s(this,\"replyMessageKey\",mo);s(this,\"messageType\",\"ExecuteScriptMessage\");s(this,\"script\",\"\");this.script=e.toString(),this.content=e.toString(),this.content=co(this.content)}};s(_,\"replierKey\",\"send\"),s(_,\"completeStreamKey\",\"completeStream\");Y=class extends v{constructor(e,o){super(e);this.replayToHandler=e;this.content=o;s(this,\"messageType\",mo)}}});var F,lo=c(()=>{\"use strict\";Ht();F=class extends _{constructor(e,o,r=()=>{}){super(({rootRef:i,elementId:a,_script:p,__scriptInputs:m})=>{let d=(i.shadowRoot||i.container).querySelectorAll(\"[myop-id='\".concat(a,\"']\"));return d.length?(m.ref=d[0],new Function(\"return (\".concat(p,\")(...arguments)\"))(m)):null},r);this.scriptInputs=o;this.scriptInputs=$(y({},o),{_script:e.toString()})}}});var fo,_t,ee,go=c(()=>{\"use strict\";H();fo=\"EventListenerCallbackMessage\",_t=class extends k{constructor(e,o,r){super(r);this.ref=e;this.type=o;this.handler=r;s(this,\"replyMessageKey\",fo);s(this,\"messageType\",\"AddEventListenerMessage\");s(this,\"cleanable\",!0);s(this,\"serializableSkeleton\",!1)}withSerializableSkeleton(e){return this.serializableSkeleton=e,this}},ee=class extends v{constructor(e,o){super(e);this.replayToHandler=e;this.e=o;s(this,\"messageType\",fo);this.content={e:o}}}});var Dt,uo=c(()=>{\"use strict\";H();Dt=class extends I{constructor(e,o,r){super();this.ref=e;this.name=o;this.value=r;s(this,\"messageType\",\"SetAttributeMessage\")}}});var yo,Bt,te,Lt=c(()=>{\"use strict\";H();yo=\"ElementValueReplayMessage\",Bt=class extends k{constructor(e,o){super(o);this.ref=e;s(this,\"replyMessageKey\",yo);s(this,\"messageType\",\"GetElementValueMessage\")}},te=class extends v{constructor(e){super();this.content=e;s(this,\"messageType\",yo)}}});var Pt,ho=c(()=>{\"use strict\";H();Pt=class extends I{constructor(e,o){super();this.ref=e;s(this,\"messageType\",\"SetInnerHtml\");this.content=o}}});var pe,Me,oe,Mo=c(()=>{\"use strict\";H();pe=class extends I{constructor(e){super();s(this,\"messageType\",\"InitMessage\");this.content={id:e}}isTypeof(e){return e.messageType===this.messageType}},Me=class extends pe{constructor(){super(...arguments);s(this,\"messageType\",\"InitResponse\")}},oe=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"InitRequest\")}}});var Io,Ie,U,Le=c(()=>{\"use strict\";H();Io=\"RefComponentCreatedMessage\",Ie=class extends k{constructor(e,o,r,i){super(i);this.refConfig=e;this.nestedComponentConfig=o;this.options=r;s(this,\"replyMessageKey\",Io);s(this,\"messageType\",\"CreateRefComponentMessage\")}},U=class extends v{constructor(e,o,r){super(e);this.replayToHandler=e;this.nestedRefs=o;this.failed=r;s(this,\"messageType\",Io)}}});var Ce,Ot=c(()=>{\"use strict\";H();Ce=class extends I{constructor(e,o){super();this.destination=e;this.message=o;s(this,\"messageType\",\"EnvelopedMessage\");let r=o;this.route=[e,...r.route?r.route:[]]}}});var Co,Kt,ne,xo=c(()=>{\"use strict\";H();Co=\"DetectedMyopRefsMessage\",Kt=class extends k{constructor(){super(...arguments);s(this,\"messageType\",\"DetectMyopRefsMessage\");s(this,\"replyMessageKey\",Co)}},ne=class extends v{constructor(e,o){super(e);this.replayToHandler=e;s(this,\"messageType\",Co);this.content=o}isTypeof(e){return e.messageType===this.messageType}}});var bo,At,xe,wo=c(()=>{\"use strict\";H();bo=\"GetAttributeReplayMessage\",At=class extends k{constructor(e,o,r){super(r);this.ref=e;this.name=o;s(this,\"replyMessageKey\",bo);s(this,\"messageType\",\"GetAttributeMessage\")}},xe=class extends v{constructor(e){super();this.content=e;s(this,\"messageType\",bo)}}});var P,To=c(()=>{\"use strict\";H();P=class extends I{constructor(e){super();this.method=e;s(this,\"messageType\",\"ExecuteComponentMethod\")}}});var $t,be,So=c(()=>{\"use strict\";H();$t=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"SetMutationObserverMessage\")}},be=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"MutationObserverMessage\")}}});var Eo,we,Te,Ro=c(()=>{\"use strict\";H();Eo=\"CleanupReplayMessage\",we=class extends k{constructor(e,o){super(o);this.cleanupForMessageId=e;s(this,\"replyMessageKey\",Eo);s(this,\"messageType\",\"CleanupMessage\")}},Te=class extends v{constructor(e){super();this.customCleanup=e;s(this,\"messageType\",Eo)}}});var Se,vo=c(()=>{\"use strict\";H();Se=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"DisposeMessage\")}}});var Ft,Ee,ko=c(()=>{\"use strict\";H();Ft=class extends I{constructor(){super(...arguments);s(this,\"cleanable\",!0);s(this,\"messageType\",\"SetResizeObserverMessage\")}},Ee=class extends I{constructor(){super(...arguments);s(this,\"messageType\",\"ResizeObserverMessage\")}}});var me={};J(me,{AddEventListenerMessage:()=>_t,BaseMyopMessage:()=>I,BindClickMessage:()=>vt,ChangeTextMessage:()=>kt,CleanupMessage:()=>we,CleanupReplayMessage:()=>Te,ClickReplayMessage:()=>Z,CreateRefComponentMessage:()=>Ie,CustomRefMessage:()=>F,DetectMyopRefsMessage:()=>Kt,DetectedMyopRefsMessage:()=>ne,DisposeMessage:()=>Se,ElementValueReplayMessage:()=>te,EnvelopedMessage:()=>Ce,EventListenerCallbackMessage:()=>ee,ExecuteComponentMethod:()=>P,ExecuteScriptMessage:()=>_,ExecuteScriptReplyMessage:()=>Y,GetAttributeMessage:()=>At,GetAttributeReplayMessage:()=>xe,GetElementValueMessage:()=>Bt,InitMessage:()=>pe,InitRequest:()=>oe,InitResponse:()=>Me,MessageDirection:()=>R,MutationObserverMessage:()=>be,MyopBindMessage:()=>k,MyopBindReplayMessage:()=>v,MyopElementMessage:()=>Rt,Ref:()=>N,RefComponentCreatedMessage:()=>U,ResizeObserverMessage:()=>Ee,SetAttributeMessage:()=>Dt,SetInnerHtml:()=>Pt,SetMutationObserverMessage:()=>$t,SetResizeObserverMessage:()=>Ft,stripFunction:()=>co});var x=c(()=>{\"use strict\";H();ao();po();Ht();lo();go();uo();Lt();ho();Mo();Le();Ot();xo();Lt();wo();To();So();Ro();vo();ko()});var V,Pe=c(()=>{\"use strict\";M();x();Re();V=class{constructor(t,e,o){this.componentDefinition=t;this.container=e;s(this,\"id\",\"\");s(this,\"messageHandlers\",{});s(this,\"element\");s(this,\"_markedForDisposed\",!1);s(this,\"bind\",(t,e)=>{this.messageHandlers[t]||(this.messageHandlers[t]=[]),this.messageHandlers[t].includes(e)||this.messageHandlers[t].push(e)});s(this,\"bindWhen\",(t,e,o)=>{if(!o)throw new Error(\"can't use component.bindWhen without an handler\");this.messageHandlers[t]||(this.messageHandlers[t]=[]);let r=this.messageHandlers[t],i=a=>e(a)?(o(a),!0):!1;return r.push(i),()=>{let a=r.indexOf(i);a>-1&&r.splice(a,1)}});s(this,\"setInitiated\",()=>{this.isInitiated=!0,this._whenInitiatedResolve&&this._whenInitiatedResolve()});s(this,\"isInitiated\",!1);s(this,\"_whenInitiatedResolve\");s(this,\"_whenInitiatedReject\");s(this,\"_whenInitiated\",new Promise((t,e)=>{this._whenInitiatedResolve=t,this._whenInitiatedReject=e}));s(this,\"initiated\",()=>this._whenInitiated);s(this,\"props\",{});s(this,\"refs\",{});this.id=(o==null?void 0:o.id)||O.Instance().assignId(t);let r=o!=null&&o.timeout?o==null?void 0:o.timeout:5*1e3;setTimeout(()=>{!this.isInitiated&&this._whenInitiatedReject&&!this._markedForDisposed&&this._whenInitiatedReject(\"timeout_\".concat(r,\" \").concat(this.id))},r),this.initiated().then(()=>{window.myop.hostSDK.inspected&&this.inspect()})}get markedForDisposed(){return this._markedForDisposed}set markedForDisposed(t){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=t}onMessageReceived(t){if(t.messageType===l.ExecuteComponentMethod){let o=t;return this[o.method]?this[o.method](o.content):console.log(\"method not found \".concat(o.method,\" on component\"),this),!0}let e=this.messageHandlers[t.messageType];if(e&&e.length){let o=!1;return e.forEach(r=>{o=o||r(t)}),o}return!1}sendCleanupMessage(t){t.source=this.id,t.destination=this.id,t.direction=R.down;let e=this.bindWhen(t.replyMessageKey,r=>r.replayToHandler===t.handlerUniqueId,r=>{t.handler(r),e()}),o=t.handler;delete t.handler,this.send(t),t.handler=o}send(t){t.source||(t.source=this.id),t.destination||(t.destination=this.id),t.direction=R.down;let e;if(t.handler){let o=t;e=this.bindWhen(o.replyMessageKey,r=>r.replayToHandler===o.handlerUniqueId,o.handler),delete t.handler}return t.ref&&(t.ref=t.ref.__nonProxied||t.ref),t.cleanable?()=>{this.sendCleanupMessage(new we(t.id,o=>{})),e&&e()}:()=>{}}dispose(){if(this.markedForDisposed=!0,!this.isInitiated)return;console.log(\"disposing component\",this.id),this.send(new Se);let t=this.messageHandlers.onDispose;t&&t.forEach(e=>{e(null)}),this.messageHandlers={},this.id+=\"_disposed\",this.isInitiated=!1}}});var de,Ho=c(()=>{\"use strict\";de=class{constructor(t,e,o,r,i){this.myopId=t;this.htmlTagName=e;this.BoundingRect=o;this.offsetTop=r;this.offsetLeft=i;s(this,\"type\",\"MyopElementRef\")}}});var _o,C,Oe,Do=c(()=>{\"use strict\";_o=async n=>{if(typeof n==\"function\")n();else if(n instanceof Promise){let t=await n;typeof t==\"function\"&&t()}},C=class{constructor(t){this.messageToHost=t}},Oe=class extends C{constructor(e,o){super(e);this.messageToHost=e;this.context=o}}});var Ut,ce,Bo=c(()=>{\"use strict\";M();b();x();Ut=class{constructor(t,e){this.id=t;this.context=e;s(this,\"send\",t=>{})}},ce=class{constructor(){s(this,\"messageToHandleAfterInit\",[]);s(this,\"components\",{});s(this,\"alwaysPassEnvelopesToHost\",!1);s(this,\"messageCleanupCache\",{})}handleIncomeMessages(t){let e=t.data?t.data:t.detail;if(!(!e||!e.myop)){let o=e;if(o.direction!==R.down)return;if(o.messageType===l.DisposeMessage){o.destination&&delete this.components[o.destination];return}if(o.messageType===l.InitMessage){let r=o.content.id;if(this.components[r])return;this.components[r]=new Ut(r),this.messageToHost(new Me(r));return}if(o.messageType===l.EnvelopedMessage){let r=o,i=r.message;if(o=i,this.alwaysPassEnvelopesToHost||this.components[o.destination]){let a=myop.hostSDK.components.find(m=>m.id===i.destination);if(a){a.send(i);return}let p=myop.hostSDK.components.find(m=>m.id===r.destination);if(p){p.send(i);return}}else return}if(o.messageType){if(o.messageType===l.CleanupMessage){let i=o,a=this.messageCleanupCache[i.cleanupForMessageId],p=new Te(!!a);p.destination=o.destination,a?(delete this.messageCleanupCache[i.cleanupForMessageId],_o(a).then(()=>{this.messageToHost(p,i)}).catch(()=>{})):this.messageToHost(p,i);return}let r=!1;this.supportedHandlers.forEach(i=>{if(i.messageType===o.messageType){r=!0;let a=i.executor(o);if(o.cleanable&&a&&(this.messageCleanupCache[o.id]=a),a&&!o.cleanable)throw new Error(\"Cleanup handler generated for non-cleanable message. \\nmessageType - \".concat(o.messageType,\", handler executor was - \").concat(i.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&&o.cleanable)throw new Error(\"No cleanup handler generated for a cleanable message. \\nmessageType - \".concat(o.messageType,\", handler executor was - \").concat(i.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 z,se,ge,le,re,Ke,fe,b=c(()=>{\"use strict\";Ho();Do();Bo();z={IframeLoader:\"IframeLoader\",WebComponentLoader:\"WebComponentLoader\",HTMLLoader:\"HTMLLoader\",MinimizedLoader:\"MinimizedLoader\"},se={open:\"open\",closed:\"closed\",none:\"none\",localFrame:\"localFrame\"},ge={message:\"message\",code:\"code\"},le=class{};s(le,\"code\",\"code\"),s(le,\"component\",\"component\");re={Segmented:\"Segmented\",Dedicated:\"Dedicated\",Default:\"Default\"},Ke={Segment:\"Segment\",Promo:\"Promo\",AB:\"AB\"},fe=class{constructor(t,e){this.container=t;this.shadowRoot=e;s(this,\"getRootDiv\",()=>(this.shadowRoot||this.container).querySelector(\"div\"));s(this,\"getRoot\",()=>this.shadowRoot||this.container)}}});var zt,rs,Nt,L,ie=c(()=>{\"use strict\";zt=n=>n!==Object(n),rs=n=>typeof n==\"function\",Nt=n=>{if(zt(n))return!0;if(rs(n)||Object.getPrototypeOf(n))return!1;for(let t in n){let e=n[t];if(typeof e==\"object\"){if(!Nt(e))return!1}else{if(zt(e))continue;return!1}}return!0},L=(n,t={},e=!0,o=new WeakMap)=>{if(zt(n))return n;if(Array.isArray(n)){if(o.has(n))return o.get(n);let r=[];o.set(n,r);for(let i=0;i<n.length;i++){let a=n[i];r[i]=L(a,t,e,o)}return r}if(n!==null&&typeof n==\"object\"){if(o.has(n))return o.get(n);let r={};o.set(n,r);for(let i in n){let a=typeof t==\"boolean\"?t:t[i];a&&(a===!0?(e?n[i]!==void 0:n[i])&&(r[i]=L(n[i],!0,e,o)):typeof a==\"object\"&&(r[i]=L(n[i],a,e,o)))}return r}return{}}});var Lo,Po=c(()=>{\"use strict\";Lo={notSerializableRefCall:(n,t)=>{throw new Error(\"\\nThe input provided to '\".concat(n.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(t,\" \\n~~~~~~~~\\nas not serializable.\\n\\nTo resolve this issue, please ensure that all inputs passed to '\").concat(n.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,Oo=c(()=>{\"use strict\";Pe();x();Ot();ve=class extends V{constructor(e,o,r){super(e,o.container,r);this.componentDefinition=e;this.parent=o;s(this,\"send\",e=>{let o=e.handler,r=super.send(e);return this.parent.send(new Ce(this.id,e)),e.handler=o,r});s(this,\"dispose\",()=>{this.isInitiated&&this.send(new P(\"dispose\")),super.dispose()})}hide(){this.send(new P(\"hide\"))}show(){this.send(new P(\"show\"))}inspect(){return this.send(new P(\"inspect\"))}setHeightBasedOnDocumentElement(){this.send(new P(\"setHeightBasedOnDocumentElement\"))}setHeightBasedOnScrollHeight(){this.send(new P(\"setHeightBasedOnScrollHeight\"))}onMessageReceived(e){return super.onMessageReceived(e)}}});var is,Ae,Ko,Ao,$o,as,Vt,qt,$e=c(()=>{\"use strict\";x();x();b();ie();Po();Oo();is=(n,t,e)=>{let o=document.createElement(\"a\");return o.textContent=n,o.style.position=\"relative\",o.style.padding=\"0 5px\",o.style.fontSize=\"14px\",o.style.top=\"0\",o.style.top=\"\".concat(t,\"px\"),o.style.transform=\"translateX(-50%)\",o.target=\"_blank\",o.href=\"https://dashboard.myop.dev/dashboard/component/\".concat(e.id),o},Ae=(n,t,e,o,r,i)=>{let a=is(\"\".concat(i.name,\" : \").concat(t),e,i);return o.insertBefore(a,r),r.style.border=\"1px solid #007BFF\",r.style.display=\"block\",()=>{r.style.border=\"unset\",o.removeChild(a)}},Ko=(n,t,e)=>n?!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(t,\"\\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),Ao=(n,t,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(t,\"\\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.\"))},$o=(n,t,e)=>{let o=t.reduce((i,a)=>$(y({},i),{[a.name]:y({},a)}),{}),r={get:(i,a)=>{let p=o[a];if(Ko(p,a,n))return!1;if(p.behavior.type===ge.code){if(e.loader.type===z.HTMLLoader&&e.loader.shadowRootMode===se.localFrame){let d=p.behavior;return n.element.contentWindow[d.remap||a]}return Ao(p,a,n),!1}return p.mode===\"output\"?new Promise(m=>{let d=[];p.behavior.ref&&d.push(N.create(p.behavior.ref)),d.push(f=>{m(f)}),p.behavior.params&&d.push(...p.behavior.params);let g=me[p.behavior.message];n.send(new g(...d))}):null},set:(i,a,p)=>{let m=o[a];if(Ko(m,a,n))return!1;if(m.behavior.type===ge.code){if(e.loader.type===z.HTMLLoader&&e.loader.shadowRootMode===se.localFrame){let g=m.behavior;return n.element.contentWindow[g.remap||a]=p,!0}return Ao(m,a,n),!1}else if(m.mode===\"input\")if(m.behavior.type===\"message\"){let d=[];m.behavior.ref&&d.push(N.create(m.behavior.ref)),d.push(p),m.behavior.params&&d.push(...m.behavior.params);let g=me[m.behavior.message];return n.send(new g(...d)),!0}else throw new Error(\"Error: Unsupported Behavior\\n\\nThe 'behavior' field provided is not supported.\\n\"+\"Component: \".concat(n.componentDefinition.name,\", ID: \").concat(n.componentDefinition.id,\"\\n\\n\")+\"Prop Name: \".concat(a,\"\\n\")+\"Behavior Field: \".concat(m.behavior.type,\"\\n\\n\")+\"Check the documentation for valid behavior options.\");return!1}};return n.props={},n.props=new Proxy(n.props,r),n},as=(n,t)=>new Proxy(n,{get(e,o){return e[o]?e[o]:(...i)=>new Promise(a=>{i.forEach(p=>{Nt(p)||Lo.notSerializableRefCall(o,p)}),t.send(new F(({ref:p,propName:m,functionArgs:d,makeSerializable:g})=>{if(p){let f=p[m];return g(typeof f==\"function\"?p[m](...d):f,!0)}return null},{elementId:e.refConfig.selector,propName:o,functionArgs:i},p=>{a(p.content)}))})},set(e,o,r){return t.send(new F(({ref:i,propName:a,propValue:p})=>{i&&(i[a]=p)},{elementId:e.refConfig.selector,propValue:r,propName:o},i=>{})),!0}}),Vt=async(n,t,e,o)=>{let r=n.component;if(!r)throw new Error(\"cant createRefComponent with detached ref\");return new Promise(async(i,a)=>{let p=new ve(t.type,r,o);e.push(p),await r.initiated();let m=setTimeout(()=>{a(\"timeout\")},5e3);r.send(new Ie(n.refConfig,t,$(y({},o||{}),{id:p.id,_hasParent:!0}),async d=>{if(clearTimeout(m),d.failed){a(\"CreateRefComponentMessage failed\");return}let g=e.find(f=>f.id==p.id);if(g!==p){r.refs[n.refConfig.name]=g,i(g);return}else p.setInitiated(),r.refs[n.refConfig.name]=p;d.nestedRefs.forEach(f=>{let u=t.instance.resolvedNestedComponents.find(E=>E.type.id===f.componentDefinitionId).type,h=new ve(u,p);h.setInitiated(),p.refs[f.refName]=h,e.push(h)});try{await qt(p,t,e,!0),r.setHeightBasedOnScrollHeight&&r.setHeightBasedOnScrollHeight(),i(p)}catch(f){a(f)}}))})},qt=async(n,t,e,o=!1)=>{n.refs||(n.refs={});let r=Object.values(n.componentDefinition.refs).map(i=>new Promise(async(a,p)=>{var m;if(i.behavior.type==le.component){if(o){a();return}let d=i.behavior.componentId;d||(d=i.behavior.instance.componentId);let g=(m=t.instance.resolvedNestedComponents)==null?void 0:m.find(u=>u.type.id===d);if(!g)throw new Error(\"componentConfig provided without nestedComponentConfig check the config object\");let f=N.create(\"\",i,n);try{let u=await Vt(f,g,e);n.refs[i.name]=u,a()}catch(u){p(u)}}else try{let d=N.create(\"\",i,n);n.refs[i.name]=as(d,n),a()}catch(d){}}));try{await Promise.all(r)}catch(i){throw i}}});var ue,Wt=c(()=>{\"use strict\";Pe();x();$e();M();ue=class extends V{constructor(e,o,r,i,a){super(e,r,a);this.componentConfig=e;this.container=r;this.IframeElement=i;s(this,\"cleanupInspect\");s(this,\"setHeightBasedOnDocumentElement\",()=>{let e=this.send(new _(()=>window.document.documentElement.scrollHeight,o=>{this.IframeElement.style.height=\"\".concat(o.content,\"px\"),e()}))});s(this,\"observeSizeBasedOnDocumentElement\",()=>this.send(new _(({send:o})=>{let{height:r,width:i}=document.documentElement.getBoundingClientRect(),a=new ResizeObserver(()=>{let{height:p,width:m}=document.documentElement.getBoundingClientRect();o({height:p,width:m})});return a.observe(document.documentElement),a.observe(document.body),{height:r,width:i}},o=>{this.IframeElement.style.width=\"\".concat(o.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(o.content.height,\"px\")})));s(this,\"setSizeBasedOnDocumentElement\",()=>{let e=this.send(new _(()=>{let{height:o,width:r}=document.documentElement.getBoundingClientRect();return{height:o,width:r}},o=>{this.IframeElement.style.width=\"\".concat(o.content.width,\"px\"),this.IframeElement.style.height=\"\".concat(o.content.height,\"px\"),e()}))});s(this,\"setHeightBasedOnScrollHeight\",()=>{let e=this.send(new _(()=>{let r=0;return r++,r--,Math.max(Math.max(window.document.body.clientHeight,window.document.body.scrollHeight),window.document.body.offsetHeight)+r+\"px\"},o=>{this.IframeElement.style.height=o.content,e()}))});s(this,\"send\",e=>{var i,a;let o=y({},e);if(o.messageType===l.ExecuteComponentMethod)return this[o.method](),()=>{};o.direction=R.down;let r=super.send(o);return(a=(i=this.IframeElement)==null?void 0:i.contentWindow)==null||a.postMessage(o,\"*\"),r});s(this,\"dispose\",()=>{this.cleanupInspect&&this.cleanupInspect(),super.dispose(),this.IframeElement.parentNode.removeChild(this.IframeElement)});o.loader.autoHeight&&this.initiated().then(()=>{this.setHeightBasedOnScrollHeight()}),this.element=this.IframeElement}inspect(){return this.cleanupInspect?this.cleanupInspect:(this.cleanupInspect=Ae(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===l.In.MutationObserverMessage||e.messageType===l.In.ResizeObserverMessage?(this.setHeightBasedOnScrollHeight(),!0):super.onMessageReceived(e)}}});var q,Fe=c(()=>{\"use strict\";q=class{constructor(){s(this,\"appendChild\",(t,e,o)=>{var r;if(o!=null&&o.relative){if(o.relative.direction===\"before\")return t.insertBefore(e,o.relative.child);if(o.relative.direction===\"after\"){let i=(r=o.relative.child)==null?void 0:r.nextSibling;return t.insertBefore(e,i||null)}}else return t.appendChild(e)})}}});var ps,Ue,Fo=c(()=>{\"use strict\";Wt();Fe();Q();b();ps=(n,t,e)=>{let o=new URL(n);return o.searchParams.append(t,e),o.toString()},Ue=class extends q{constructor(){super(...arguments);s(this,\"type\",z.IframeLoader);s(this,\"load\",async(e,o,r,i)=>{let a,p=o.loader;if((r==null?void 0:r.nodeName)===\"IFRAME\")console.log(\"needs to load into an exsisting Iframe...\",p.url,r),a=r,a.src=p.url;else{let m=T(),d=\"myop-comp-\".concat(m);a=document.createElement(\"iframe\"),r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),i!=null&&i.hidden&&(a.style.visibility=\"hidden\"),a=this.appendChild(r,a,i);let g=o.loader.url;i!=null&&i._hasParent&&(g=ps(g,\"_myop-comp\",m));let f=\"\";i!=null&&i.elementAttributes&&(f=Object.entries(i==null?void 0:i.elementAttributes).map(([u,h])=>h===\"\"||h===null||h===void 0?u:\"\".concat(u,'=\"').concat(String(h),'\"')).join(\" \")),a.outerHTML='<iframe \\n id=\"'.concat(d,'\"\\n style=\"\\n padding: 0;\\n margin: 0;\\n height: ').concat(p.autoHeight||!p.height?\"\":p.height,\"; \\n width : 100%;\\n overflow: hidden;\\n border: none;\\n opacity: \").concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n position: \").concat(i!=null&&i.hidden?\"absolute\":\"static\",\";\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",';\\n \"\\n src=\"').concat(g,'\"\\n ').concat(f,\"\\n ></iframe>\"),a=r.querySelector(\"#\".concat(d))}return new ue(e,o,r,a,i)})}}});var ze,jt=c(()=>{\"use strict\";ze={webcomponent_message_key:\"myop_webcomponent_message\"}});var ye,Gt=c(()=>{\"use strict\";jt();Pe();$e();ye=class extends V{constructor(e,o,r,i,a){super(e,r,a);this.container=r;this.customElement=i;s(this,\"cleanupInspect\",()=>{});s(this,\"send\",e=>{let o=y({},e),r=super.send(o),i=new CustomEvent(ze.webcomponent_message_key,{detail:o});try{this.customElement.dispatchEvent(i)}catch(a){console.log(\"error while trying to dispatchEvent\",a)}return r});s(this,\"dispose\",()=>{var e;super.dispose(),(e=this.customElement.parentNode)==null||e.removeChild(this.customElement)});this.element=i}inspect(){return this.cleanupInspect=Ae(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 Jt,Ne,Uo=c(()=>{\"use strict\";Gt();Fe();Q();b();Jt={},Ne=class extends q{constructor(){super(...arguments);s(this,\"type\",z.WebComponentLoader);s(this,\"load\",async(e,o,r,i)=>{let a=o.loader;Jt[a.url]?console.log(\"Module alreday loaded or in loading process\"):Jt[a.url]=new Promise((d,g)=>{let f=a.url,u=document.createElement(\"script\");u.type=\"module\",u.src=f,u.onload=()=>{d()},u.onerror=()=>{g()},document.head.appendChild(u)}),await Jt[a.url],await ro(1);let p=\"myop-comp-\".concat(T()),m=document.createElement(a.tag);return r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),m.id=p,i!=null&&i.hidden&&(m.style.opacity=\"0\",m.style.position=\"absolute\",m.style.height=\"0\",m.style.width=\"0\",m.style.pointerEvents=\"none\",m.style.visibility=\"hidden\"),i!=null&&i._environment&&(m._myopEnvironment=i==null?void 0:i._environment),this.appendChild(r,m,i),new ye(e,o,r,m,i)})}}});var S,A=c(()=>{\"use strict\";b();S=class extends Oe{constructor(e,o){super(e);this.context=o;s(this,\"executor\",e=>{if(e.destination){let o=e.destination;if(this.context[o].context){let r=(i,a)=>{this.messageToHost($(y({},i),{source:e.destination?e.destination:e.source,destination:e.source?e.source:e.destination}),a)};return this.innerExecutor(e,this.context[o].context,r)}else debugger}else debugger})}}});var D,W=c(()=>{\"use strict\";D={id:\"myop-id\"}});var w,zo,B=c(()=>{\"use strict\";W();w=(n,t)=>t.querySelectorAll(\"[\".concat(D.id,\"='\").concat(n.refConfig.selector,\"']\")),zo=(n,t)=>{let e=w(n,t);return e.length?e.item(0):null}});var Ve,No=c(()=>{\"use strict\";M();x();A();B();Ve=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.BindClickMessage);s(this,\"innerExecutor\",(e,o,r)=>{let i=w(e.ref,o.shadowRoot),a=[];return i.forEach(p=>{let m=()=>{r(new Z(e.handlerUniqueId))};p.addEventListener(\"click\",m),a.push(()=>{p.removeEventListener(\"click\",m)})}),()=>{a.forEach(p=>p())}})}}});var qe,Vo=c(()=>{\"use strict\";M();A();B();qe=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.ChangeTextMessage);s(this,\"innerExecutor\",(e,o)=>{w(e.ref,o.shadowRoot).forEach(i=>{i.textContent=e.content})})}}});var We,qo=c(()=>{\"use strict\";b();We=class extends fe{constructor(e,o){super(e,o);this.container=e;this.shadowRoot=o}}});var je,Wo=c(()=>{\"use strict\";b();W();A();x();M();je=class extends S{constructor(){super(...arguments);s(this,\"innerExecutor\",(e,o)=>{let r=o.shadowRoot.querySelectorAll(\"[\".concat(D.id,\"]\")),i=[];r.forEach(a=>{let p=a.getAttribute(D.id);p&&i.push(new de(p,a.tagName,a.getBoundingClientRect(),a.offsetTop,a.offsetLeft))}),this.messageToHost(new ne(e.handlerUniqueId,i))});s(this,\"messageType\",l.DetectMyopRefsMessage)}}});var Ge,jo=c(()=>{\"use strict\";M();A();B();Ge=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.SetAttributeMessage);s(this,\"innerExecutor\",(e,o)=>{w(e.ref,o.shadowRoot).forEach(i=>{i.setAttribute(e.name,e.value)})})}}});var Je,Go=c(()=>{\"use strict\";M();x();A();B();ie();Je=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.AddEventListenerMessage);s(this,\"innerExecutor\",(e,o,r)=>{let i=w(e.ref,o.shadowRoot),a=[];return i.forEach(p=>{let m=d=>{r(new ee(e.handlerUniqueId,L(d,e.serializableSkeleton)))};p.addEventListener(e.type,m),a.push(()=>{p.removeEventListener(e.type,m)})}),()=>{a.forEach(p=>p())}})}}});var Xe,Jo=c(()=>{\"use strict\";M();W();Re();Le();A();Xe=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.CreateRefComponentMessage);s(this,\"innerExecutor\",(e,o,r)=>{(async()=>{let a=o.shadowRoot.querySelectorAll(\"[\".concat(D.id,\"='\").concat(e.refConfig.selector,\"']\"));if(a.length===1){let p=O.Instance(),m=p.components.find(u=>u.id===e.options.id);m&&m.dispose();let d=p.components.indexOf(m);d!==-1&&p.components.splice(d,1);let g=await p.loadComponent(e.nestedComponentConfig,a.item(0),e.options),f=[];Object.keys(g.refs).forEach(u=>{let h=g.refs[u];h=h.__nonProxied||h,h.componentDefinition&&f.push({refName:u,componentDefinitionId:h.componentDefinition.id})}),r(new U(e.handlerUniqueId,f))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new U(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var Qe,Xt=c(()=>{\"use strict\";ie();Qe=(n,t,e)=>{let o=n.scriptInputs?n.scriptInputs:{};o.makeSerializable=L,o.send=t,o.rootRef=e,o.__scriptInputs=o;let i=new Function(\"return (\".concat(n.script,\")(...arguments)\"))(o);t(i)}});var Ze,Xo=c(()=>{\"use strict\";M();x();A();Xt();Ze=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.ExecuteScriptMessage);s(this,\"innerExecutor\",(e,o,r)=>{Qe(e,a=>{r(new Y(e.handlerUniqueId,a))},o)})}}});var Qo,Ye,Zo=c(()=>{\"use strict\";M();x();A();B();W();ie();Qo=n=>{if(!n)return null;if(n.tagName===\"FORM\"){let t=new FormData(n),e={formData:{},unmappedData:[]},o=n.querySelectorAll(\"input, select, textarea\"),r=-1;return o.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(D.id),p=i.getAttribute(\"name\"),m={id:i.id,name:p,value:Qo(i),required:i.required,validity:L(i.validity,!0),myopId:a};p?e.formData[p]?e.formData[p].value?e.unmappedData.push(m):(e.unmappedData.push(e.formData[p]),e.formData[p]=m):e.formData[p]=m:e.unmappedData.push(m)}}),e}return n.type===\"checkbox\"||n.type===\"radio\"?n.checked?n.value:null:n.tagName===\"INPUT\"||n.tagName===\"TEXTAREA\"||n.tagName===\"SELECT\"?n.value:n.isContentEditable?n.innerText||n.textContent:null},Ye=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.GetElementValueMessage);s(this,\"innerExecutor\",(e,o,r)=>{w(e.ref,o.shadowRoot).forEach(a=>{r(new te(Qo(a)),e)})})}}});var et,Yo=c(()=>{\"use strict\";M();A();B();et=class extends S{constructor(){super(...arguments);s(this,\"messageType\",l.SetInnerHtml);s(this,\"innerExecutor\",(e,o)=>{w(e.ref,o.shadowRoot).forEach(i=>{i.innerHTML=e.content})})}}});var en={};J(en,{WebComponentSDK:()=>he});var he,Qt=c(()=>{\"use strict\";b();M();jt();No();Vo();qo();Wo();X();x();jo();Go();Jo();Xo();Zo();Yo();he=class extends ce{constructor(){super(...arguments);s(this,\"alwaysPassEnvelopesToHost\",!0);s(this,\"connectedCallback\",(e,o)=>{e.addEventListener(ze.webcomponent_message_key,r=>{let i=r.data?r.data:r.detail;if(!i||!i.myop){debugger;throw new Error(\"recvied webcomponent_message with wrong type\")}else{let a=i;if(this.handleIncomeMessages(r),a.messageType===l.InitMessage){let p=a.content.id;this.components[p].context=new We(e,o)}}}),setTimeout(()=>{this.messageToHost(new oe)},1)});s(this,\"messageToHost\",(e,o)=>{e.direction=R.up,!e.replayToHandler&&(o!=null&&o.handlerUniqueId)&&(e.replayToHandler=o.handlerUniqueId),window.myop.hostSDK.send(e)});s(this,\"supportedHandlers\",[new qe(this.messageToHost,this.components),new et(this.messageToHost,this.components),new Ve(this.messageToHost,this.components),new je(this.messageToHost,this.components),new Ge(this.messageToHost,this.components),new Je(this.messageToHost,this.components),new Ze(this.messageToHost,this.components),new Ye(this.messageToHost,this.components),new Xe(this.messageToHost,this.components)]);s(this,\"init\",()=>{})}};K(\"WebComponentSDK\",he)});var tn=c(()=>{\"use strict\";Qt()});function ms(n,t){return class extends HTMLElement{connectedCallback(){let e=t===se.open?\"open\":\"closed\",o=this.attachShadow({mode:e});nn().then(r=>{r.connectedCallback(this,o),o.innerHTML=n})}}}var on,tt,nn,ds,cs,ls,ot,sn=c(()=>{\"use strict\";Gt();Fe();Q();b();tn();Wt();on=[],nn=async()=>(tt||(tt=new he,tt.init()),tt);ds=(n,t,e)=>{customElements.define(n,ms(t,e)),console.log(\"define('\".concat(n,\"') was called, web component ready to use\"))},cs=n=>n.replace(/([a-z])([A-Z])/g,\"$1-$2\").replace(/(\\d+)/g,\"-$1\").toLowerCase(),ls=n=>(n=cs(n),n.replace(/_/g,\"-\")),ot=class extends q{constructor(){super(...arguments);s(this,\"type\",z.HTMLLoader);s(this,\"load\",async(e,o,r,i)=>{let a=o.loader,p=\"myop-comp-\".concat(T()),m;if(a.shadowRootMode===se.localFrame){let d=T(),g=\"myop-comp-\".concat(d),f=document.createElement(\"iframe\");r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),i!=null&&i.hidden&&(f.style.visibility=\"hidden\"),f=this.appendChild(r,f,i),f.id=g,f.setAttribute(\"style\",\"\\n display: block;\\n padding: 0;\\n margin: 0;\\n overflow: hidden;\\n border: none;\\n opacity: \".concat(i!=null&&i.hidden?\"0\":\"1\",\";\\n width: 100%;\\n height: 100%;\\n position: \").concat(i!=null&&i.hidden?\"absolute\":\"static\",\";\\n pointer-events: \").concat(i!=null&&i.hidden?\"none\":\"all\",\";\\n \")),r.appendChild(f);let u=f.contentDocument||f.contentWindow.document;u.open();let h=a.HTML;if(i!=null&&i._inspection){let G=new DOMParser().parseFromString(a.HTML,\"text/html\"),bt=G.getElementById(\"myop_preview\");bt==null||bt.removeAttribute(\"type\");let eo=G.implementation.createHTMLDocument();eo.body.innerHTML=\"<script>\\n const beforeKeysWindow = new Set(Object.keys(window));\\n window.myopState = {\\n beforeKeysWindow,\\n };\\n <\\/script>\";let to=eo.body.firstChild;to&&G.head&&G.head.insertBefore(G.importNode(to,!0),G.head.firstChild),h=G.documentElement.outerHTML}u.writeln(h),u.writeln('<script src=\"'.concat(window.myop.__ROOT_SDK_PUBLIC_URL__,'\"><\\/script>\\n <script>\\n \\n window.__federation__.__public_path__ = window.__federation__.__public_path__;\\n \\n const __myop_init = async () => {\\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\\n const sdk = new IframeSDK()\\n sdk.init();\\n }\\n \\n __myop_init().then();\\n \\n <\\/script>')),u.close();let E=new ue(e,o,r,f,i);return a.autoHeight&&(f.onload=()=>{E.observeSizeBasedOnDocumentElement()}),E}if(a.shadowRootMode===se.none){let d=document.createElement(\"template\");d.innerHTML=a.HTML,m=d.content.firstElementChild,nn().then(g=>{g.connectedCallback(m,m)})}else{let d=ls(e.name+o.id);on.includes(d)||(ds(d,a.HTML,a.shadowRootMode),on.push(d)),m=document.createElement(d)}return r.querySelector('[id^=\"myop-comp-\"]')||(r.innerHTML=\"\"),m.id=p,i!=null&&i.hidden&&(m.style.opacity=\"0\",m.style.position=\"absolute\",m.style.height=\"0\",m.style.width=\"0\",m.style.pointerEvents=\"none\",m.style.visibility=\"hidden\"),this.appendChild(r,m,i),new ye(e,o,r,m,i)})}}});var rn,an,pn=c(()=>{\"use strict\";Q();x();rn=(n,t,e)=>{let o=\"myop-css-\".concat(T());return n.send(new _(({rootRef:r,_stylesheet:i,_tagId:a,_css:p})=>{let m=document.createElement(\"style\");m.type=\"text/css\";let d=p;for(let g in i){d+=\"\".concat(g,\" { \");let f=i[g];for(let u in f)d+=\"\".concat(u,\": \").concat(f[u],\"; \");d+=\"} \"}m.appendChild(document.createTextNode(d)),m.id=a,(r.shadowRoot||r.container).appendChild(m)},()=>{},{_stylesheet:t,_css:e||\"\",_tagId:o})),()=>{n.send(new _(({rootRef:r,_tagId:i})=>{let a=(r.shadowRoot||document).getElementById(i);a&&a.remove()},()=>{},{_tagId:o}))}},an=(n,t)=>{let e=\"myop-css-\".concat(T());return n.send(new _(({rootRef:o,_tagId:r,_link:i})=>{let a=document.createElement(\"link\");a.id=r,a.rel=\"stylesheet\",a.href=i,document.head.appendChild(a),(o.shadowRoot||o.container).appendChild(a)},()=>{},{_link:t,_tagId:e})),()=>{n.send(new _(({rootRef:o,_tagId:r})=>{let i=(o.shadowRoot||document).getElementById(r);i&&i.remove()},()=>{},{_tagId:e}))}}});var fs,Zt,mn,dn=c(()=>{\"use strict\";fs=(n,t)=>{let e=new RegExp(Object.keys(t).join(\"|\"),\"g\");return n.replace(e,o=>(t[o]||o).toString())},Zt=(n,t)=>{let e=n.loader;if(e.type!==\"IframeLoader\")throw new Error('iframeSkinUrlTokenizer received skin with loader type \"'.concat(e.type,'\", currently only \"IframeLoader\" is supported'));return n.loader=y({},n.loader),n.loader.url=fs(n.loader.url,t),n},mn=n=>async t=>Zt(t,n)});var cn,ln,fn=c(()=>{\"use strict\";x();cn=(n,t,e)=>{n.send(new F(({ref:o,_className:r})=>{o==null||o.classList.add(r)},{elementId:e,_className:t}))},ln=(n,t,e)=>{n.send(new F(({ref:o,_className:r})=>{o==null||o.classList.remove(r)},{elementId:e,_className:t}))}});var rt,nt,it,st,gn=c(()=>{\"use strict\";Q();rt=class rt{constructor(){s(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+T());s(this,\"_runTimeId\",\"runtime-id-\"+T());s(this,\"_runTimeName\",\"runtime-name-\"+T());s(this,\"id\",this._runTimeId);s(this,\"name\",this._runTimeName);s(this,\"description\",\"\");s(this,\"loader\",null);s(this,\"withLoader\",t=>(this.loader=t,this));s(this,\"withHTMLLoader\",t=>(t.type=\"HTMLLoader\",this.loader=t,this));s(this,\"build\",()=>this)}};s(rt,\"create\",()=>new rt);nt=rt,it=class it{constructor(){s(this,\"_runTimeInstanceId\",\"runtime-instance-id-\"+T());s(this,\"_runTimeId\",\"runtime-id-\"+T());s(this,\"_runTimeName\",\"runtime-name-\"+T());s(this,\"instance\",{id:this._runTimeInstanceId,componentId:this._runTimeId,componentName:this._runTimeName,skinSelector:null});s(this,\"name\",this._runTimeName);s(this,\"type\",{id:this._runTimeId,name:this._runTimeName,description:\"\",props:[],refs:[],skins:[],defaultSkin:0});s(this,\"withInstance\",t=>(this.instance=t,this));s(this,\"withType\",t=>(this.type=t,this));s(this,\"withName\",t=>(this.name=t,this));s(this,\"withDefaultSkin\",t=>(this.type.skins.push(t),this.type.defaultSkin=this.type.skins.length-1,this.instance.skinSelector={type:\"Dedicated\",skin:{id:t.id}},this));s(this,\"withRef\",t=>(this.type.refs.push(t),this));s(this,\"withBasicRef\",t=>{let e={id:\"\",name:t,description:\"\",selectorType:\"id-attribute\",selector:t,behavior:{type:\"code\"}};return this.type.refs.push(e),this});s(this,\"build\",()=>JSON.parse(JSON.stringify(this)))}};s(it,\"create\",()=>new it);st=it});var gs,at,j,un,yn=c(()=>{\"use strict\";b();gs=n=>({instance:{id:\"auto\",componentId:n.componentId,componentName:n.name,skinSelector:{type:\"Dedicated\",skin:{id:\"skin_auto_v2_converted\"}}},type:{id:n.id,name:n.name,description:n.description,props:[{id:\"in_auto_v2_converted\",name:\"myop_init_interface\",type:\"any\",behavior:{type:ge.code}},{id:\"out_auto_v2_converted\",name:\"myop_cta_handler\",type:\"any\",behavior:{type:ge.code}}],refs:[],skins:[{id:\"skin_auto_v2_converted\",name:\"auto_v2_converted\",description:\"\",loader:n.consume_variant[0].loader}],defaultSkin:0},name:n.name}),at=class at{constructor(t=\"https://cloud.myop.dev\"){this._baseUrl=t;s(this,\"variants\",{});s(this,\"userFlows\",{});s(this,\"_defaultEnv\",\"production\")}setEnvironment(t){this._defaultEnv=t}getDefaultEnvironment(){return this._defaultEnv}isPreloaded(t,e,o){return\"\".concat(t,\":\").concat(e||this._defaultEnv,\":\").concat(o?\"preview\":\"live\")in this.variants}async fetchComponentV2(t,e,o){let r=e||this._defaultEnv,i=\"\".concat(t,\":\").concat(r,\":\").concat(o?\"preview\":\"live\");return this.variants[i]||(this.variants[i]=new Promise(async(a,p)=>{try{let m=\"\".concat(this._baseUrl,\"/consume?id=\").concat(t,\"&env=\").concat(r);o&&(m+=\"&preview=true\");let f=(await(await fetch(m)).json()).item;if(!f){p(new Error('Component \"'.concat(t,'\" not found')));return}if(!f.consume_variant||!f.consume_variant.length){p(new Error('Component \"'.concat(t,'\" has no implementation for environment \"').concat(r,'\"')));return}let u=gs(f);a(u)}catch(m){p(m)}})),await this.variants[i]}async fetchComponentV1(t,e){return e?(await this.fetchFlow(e)).components.find(r=>r.type.id===t):(await this.fetchAutoFlow(t)).components[0]}async fetchAutoFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,o)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(t,\"&auto=true\"))).json();e(i.item)}catch(r){o(r)}})),await this.userFlows[t]}async fetchFlow(t){return this.userFlows[t]||(this.userFlows[t]=new Promise(async(e,o)=>{try{let i=await(await fetch(\"\".concat(this._baseUrl,\"/flow?id=\").concat(t,\"&resolve=components\"))).json();e(i.item)}catch(r){o(r)}})),await this.userFlows[t]}async fetchComponent(t,e){return this.fetchComponentV1(t,e)}};s(at,\"Main\",new at);j=at,un=j});var hn,Mn=c(()=>{\"use strict\";hn=async n=>await n()});var Yt={};J(Yt,{CloudRepository:()=>j,ComponentConfig:()=>st,SkinConfig:()=>nt,addClass:()=>cn,applyStylesheet:()=>rn,applyStylesheetLink:()=>an,changeSkinUrlByTokenizer:()=>mn,createIframeSkinByTokenizer:()=>Zt,exec:()=>hn,removeClass:()=>ln,v2_CloudRepository:()=>un});var pt=c(()=>{\"use strict\";pn();dn();fn();gn();yn();Mn()});var In,Cn=c(()=>{\"use strict\";Et();pt();b();In=async n=>{try{let t=new URL(window.location.href),o=new URLSearchParams(t.search).get(\"myopOverride\");if(o){let[r,...i]=St(o);switch(r){case\"component\":{let[a,p]=i,m=await j.Main.fetchComponent(a);if(m&&m.type.skins.find(g=>g.id===p))return m.instance.skinSelector={type:re.Dedicated,skin:{id:p}},m}break;default:{let[a,p]=St(o),d=(await j.Main.fetchFlow(a)).components.find(g=>g.type.id===n.type.id);if(d&&d.instance.skinSelector.type===re.Segmented&&d.instance.resolvedExperiences){let g=d.instance.resolvedExperiences.find(f=>f.id===p);if((g==null?void 0:g.type)===Ke.Segment){let f=g,h=d.instance.skinSelector.segments.find(E=>E.segmentId===f.segment.id);if(h)return d.instance.skinSelector=h==null?void 0:h.skinSelector,d}}}break}}}finally{return null}}});var wn={};J(wn,{HostSDK:()=>O,hostSDK:()=>bn});var xn,O,bn,Re=c(()=>{\"use strict\";X();M();x();Fo();Uo();$e();b();Be();sn();Cn();xn=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",O=class{constructor(){s(this,\"components2init\",[]);s(this,\"components\",[]);s(this,\"componentsLoaders\",[]);s(this,\"initiated\",!1);s(this,\"version\",ae);s(this,\"type2InstanceCount\",{});s(this,\"assignId\",t=>(this.type2InstanceCount[t.id]||(this.type2InstanceCount[t.id]=0),\"\".concat(t.id,\"_\").concat(++this.type2InstanceCount[t.id])));s(this,\"inspected\",!1);s(this,\"inspect\",()=>{this.inspected||(this.inspected=!0,this.components.forEach(t=>{t.inspect&&t.inspect()}))});s(this,\"incomingMessageHandler\",t=>{if(t.origin,document.location.origin,t.data.myop){if(t.data.direction!==R.up&&t.data.messageType!==l.EnvelopedMessage)return;let e=t.data;if(e.messageType===l.InitRequest){this.components2init.forEach(r=>{r.send(new pe(r.id))});return}if(e.messageType===l.InitResponse){this.components2init=this.components2init.filter(i=>i.id!==e.content.id);let r=this.components.find(i=>{var a;return i.id===((a=e.content)==null?void 0:a.id)});r==null||r.setInitiated();return}if(e.messageType===l.EnvelopedMessage){let r=e,i=this.components.find(a=>a.id===r.destination);if(i){if(r.direction===R.down){r.message.messageType===P.name?i.onMessageReceived(r.message):(r.message.route=r.route,i.send(r.message));return}}else{let a=this.components.find(p=>p.id===r.message.destination);a&&a.send(r.message)}return}let o=this.components.find(r=>r.id===e.destination);if(!o){window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e);return}if(o){if(o.onMessageReceived(e))return;window.myop.IframeSDK&&window.myop.IframeSDK.messageToHost(e)}}});s(this,\"send\",t=>{let e=new MessageEvent(\"\",{data:t});this.incomingMessageHandler(e)});s(this,\"init\",t=>{if(this.initiated)throw new Error(\"hostSDK already initiated\");let e=[new Ue,new Ne,new ot];if(this.componentsLoaders=[...e],t){let o={};t.forEach(r=>{let i=new r(this.componentsLoaders);o[i.type]=i}),this.componentsLoaders.forEach(r=>{o[r.type]||(o[r.type]=r)}),this.componentsLoaders=Object.values(o)}window.addEventListener(\"message\",this.incomingMessageHandler,!1),console.log(\"myop hostSDK initiated\",document.location.href),this.initiated=!0});s(this,\"_getSkinIdBySkinSelector\",async(t,e=[],o)=>{var i;async function r(a,p){for(let m of a)if(await p(m))return m}switch(t.type){case\"DedicatedSkin\":case re.Dedicated:return((i=t.skin)==null?void 0:i.id)||t.skins[0].id;case re.Segmented:{let p=await r(t.segments,async m=>{if(m.segmentId===\"Default\")return!0;let d=e.find(h=>h.type===Ke.Segment?h.segment.id===m.segmentId:!1);if(!d)throw new Error(\"experience not found\");let f=d.segment,u=(o||{})[f.function];return u?await u():(console.warn(\"segmentId:\".concat(m.segmentId,\", \").concat(f.function,\" function not provided !\")),!1)});if(p)return this._getSkinIdBySkinSelector(p.skinSelector,e);debugger}break;default:debugger}return\"\"});s(this,\"runSkinSelector\",async(t,e)=>{let o=await this._getSkinIdBySkinSelector(t.instance.skinSelector,t.instance.resolvedExperiences,e);return t.type.skins.find(r=>r.id===o)});s(this,\"loaderHooks\");s(this,\"loadComponent\",async(t,e,o)=>{var g,f,u,h;if(!e){debugger;throw new Error(\"no container was found for this component\")}let r=await In(t);r&&(t=r);let i=y(y({},(g=this.loaderHooks)!=null?g:{}),(f=o==null?void 0:o.hooks)!=null?f:{}),a=e;if(a.myop)if(a.component){t=y({},t),t.instance=y({},t.instance);let E=await this.runSkinSelector(t,i);if(!E)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");return(u=o==null?void 0:o.hooks)!=null&&u.afterSkinSelected&&(E=await o.hooks.afterSkinSelected(y({},E))),t.instance.skinSelector={type:re.Dedicated,skin:E},o&&(o=y({},o),delete o.hooks),await Vt(a,t,this.components,o)}else throw new Error(\"load component got a detached ref.\");e=e;let p=await this.runSkinSelector(t,i);if(!p)throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");(h=o==null?void 0:o.hooks)!=null&&h.afterSkinSelected&&(p=await o.hooks.afterSkinSelected(y({},p)));let m=this.componentsLoaders.find(E=>E.type===p.loader.type);if(!m){debugger;throw new Error('no loader \"'.concat(p.loader.type,'\" was found for component'))}let d=await m.load(t.type,p,e,o);d.isInitiated||this.components2init.push(d),d.bind(\"onDispose\",()=>(this.components=this.components.filter(E=>E!==d),this.components2init=this.components2init.filter(E=>E!==d),!0)),this.components.push(d),(!o||o.connectProps!==!1)&&(d=$o(d,t.type.props,p));try{await qt(d,t,this.components)}catch(E){throw E}return o!=null&&o.skipInit||await d.initiated(),d});s(this,\"navigate\",async(t,e,o)=>{if(t.parent)throw new Error(\"Navigating on remote ref components is not implemented yet\");if(o!=null&&o.staged){let r=await this.loadComponent(e,t.container,y({hidden:!0,relative:{direction:\"after\",child:t.element}},o));return o.init&&await o.init(r),r.show(),t.dispose(),r}else{let r=t.element.nextSibling;return t.dispose(),this.loadComponent(e,t.container,y({relative:{direction:\"before\",child:r}},o))}})}};s(O,\"Instance\",()=>window.myop.hostSDK);window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:xn});if(!window.myop.hostSDK){let n=new O;n.init(),window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:xn}),window.myop.hostSDK=n}bn=window.myop.hostSDK;K(\"hostSDK\",bn)});var mt,Tn=c(()=>{\"use strict\";M();W();b();x();mt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.DetectMyopRefsMessage);s(this,\"executor\",e=>{let o=document.querySelectorAll(\"[\".concat(D.id,\"]\")),r=[];o.forEach(i=>{let a=i.getAttribute(D.id);a&&r.push(new de(a,i.tagName,i.getBoundingClientRect()))}),this.messageToHost(new ne(e.handlerUniqueId,r))})}}});var dt,Sn=c(()=>{\"use strict\";M();b();x();B();dt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.BindClickMessage);s(this,\"executor\",e=>{let o=[];return w(e.ref,document).forEach(i=>{let a=()=>{this.messageToHost(new Z,e)};i.addEventListener(\"click\",a);let p=()=>{i.removeEventListener(\"click\",a)};o.push(p)}),()=>{o.forEach(i=>i())}})}}});var ct,En=c(()=>{\"use strict\";M();b();B();ct=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.ChangeTextMessage);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{r.textContent=e.content})})}}});var lt,Rn=c(()=>{\"use strict\";M();x();b();Xt();lt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.ExecuteScriptMessage);s(this,\"executor\",e=>{Qe(e,r=>{this.messageToHost(new Y(e.handlerUniqueId,r))},new fe(document.documentElement))})}}});var ft,vn=c(()=>{\"use strict\";M();b();x();ie();B();ft=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.AddEventListenerMessage);s(this,\"executor\",e=>{let o=w(e.ref,document),r=[];return o.forEach(i=>{let a=p=>{requestAnimationFrame(()=>{this.messageToHost(new ee(e.handlerUniqueId,L(p,e.serializableSkeleton)))})};i.addEventListener(e.type,a),r.push(()=>{i.removeEventListener(e.type,a)})}),()=>{r.forEach(i=>{i()})}})}}});var gt,kn=c(()=>{\"use strict\";M();b();B();gt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetAttributeMessage);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{r.setAttribute(e.name,e.value)})})}}});var ut,Hn=c(()=>{\"use strict\";M();W();b();Re();Le();ut=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.CreateRefComponentMessage);s(this,\"executor\",e=>{(async()=>{let r=document.querySelectorAll(\"[\".concat(D.id,\"='\").concat(e.refConfig.selector,\"']\"));if(r.length===1){let a=await O.Instance().loadComponent(e.nestedComponentConfig,r.item(0),e.options),p=[];Object.keys(a.refs).forEach(m=>{let d=a.refs[m];d=d.__nonProxied||d,d.componentDefinition&&p.push({refName:m,componentDefinitionId:d.componentDefinition.id})}),this.messageToHost(new U(e.handlerUniqueId,p))}else{console.error(\"CreateRefComponentMessageHandler - DOM element not found\"),this.messageToHost(new U(e.handlerUniqueId,[],!0));debugger}})().then()})}}});var _n,Dn=c(()=>{\"use strict\";_n=(n,t)=>{if(!n){console.log(\"n\");return}let e=window.MutationObserver||window.WebKitMutationObserver;if(!(!n||n.nodeType!==1))if(e){let o=new e(t),r={attributes:!0,childList:!0,subtree:!0};return o.observe(n,r),o}else window.addEventListener&&(n.addEventListener(\"DOMNodeInserted\",t,!1),n.addEventListener(\"DOMNodeRemoved\",t,!1))}});var yt,Bn=c(()=>{\"use strict\";M();x();b();Dn();yt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetMutationObserverMessage);s(this,\"executor\",e=>{e.source&&_n(document.body,()=>{this.messageToHost(new be)})})}}});var Ln,ht,Pn=c(()=>{\"use strict\";M();W();b();x();ie();B();Ln=n=>{if(!n)return null;if(n.tagName===\"FORM\"){let t=new FormData(n),e={formData:{},unmappedData:[]},o=n.querySelectorAll(\"input, select, textarea\"),r=-1;return o.forEach(i=>{if(typeof i.value==\"string\"){let a=i.getAttribute(D.id),p=i.getAttribute(\"name\"),m={id:i.id,name:p,value:Ln(i),required:i.required,validity:L(i.validity,!0),myopId:a};e.unmappedData.push(m),p&&(!e.formData[p]||!e.formData[p].value||m.value)&&(e.formData[p]=m)}}),e}return n.type===\"checkbox\"||n.type===\"radio\"?n.checked?n.value:null:n.tagName===\"INPUT\"||n.tagName===\"TEXTAREA\"||n.tagName===\"SELECT\"?n.value:n.isContentEditable?n.innerText||n.textContent:null},ht=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.GetElementValueMessage);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{this.messageToHost(new te(Ln(r)),e)})})}}});var Mt,On=c(()=>{\"use strict\";M();b();x();B();Mt=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.GetAttributeMessage);s(this,\"executor\",e=>{let o=zo(e.ref,document);o&&this.messageToHost(new xe(o.getAttribute(e.name)),e)})}}});var It,Kn=c(()=>{\"use strict\";x();M();b();It=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetResizeObserverMessage);s(this,\"executor\",e=>{let o=new ResizeObserver(r=>{this.messageToHost(new Ee)});return o.observe(document.body),()=>{o.disconnect()}})}}});var Ct,An=c(()=>{\"use strict\";M();b();B();Ct=class extends C{constructor(){super(...arguments);s(this,\"messageType\",l.SetInnerHtml);s(this,\"executor\",e=>{w(e.ref,document).forEach(r=>{r.innerHTML=e.content})})}}});var $n={};J($n,{IframeSDK:()=>xt});var xt,Fn=c(()=>{\"use strict\";b();Tn();Sn();En();Rn();X();vn();kn();x();Hn();Bn();Pn();Be();On();Kn();An();xt=class extends ce{constructor(){super();s(this,\"version\",ae);s(this,\"messageToHost\",(e,o)=>{var i;!e.replayToHandler&&(o!=null&&o.handlerUniqueId)&&(e.replayToHandler=o.handlerUniqueId);let r=Object.keys(this.components);e.destination||(o!=null&&o.route?e.destination=o.route[o.route.length-1]:e.destination=r[0]),e.source||(e.source=r[0]),e.direction=R.up,(i=window.parent)==null||i.postMessage(y({},e),\"*\")});s(this,\"supportedHandlers\",[new ct(this.messageToHost),new Ct(this.messageToHost),new dt(this.messageToHost),new mt(this.messageToHost),new lt(this.messageToHost),new ft(this.messageToHost),new gt(this.messageToHost),new ht(this.messageToHost),new yt(this.messageToHost),new It(this.messageToHost),new Mt(this.messageToHost),new ut(this.messageToHost)]);s(this,\"init\",()=>{window.onmessage=this.handleIncomeMessages.bind(this),this.messageToHost(new oe)});window.myop||(window.myop={}),window.myop.IframeSDK=this}};K(\"IframeSDK\",xt)});var ys={};var us,Un=c(()=>{\"use strict\";x();X();us=y({},me);K(\"MyopMessages\",us)});var zn={};J(zn,{CloudRepository:()=>j,ComponentConfig:()=>st,SkinConfig:()=>nt,addClass:()=>cn,applyStylesheet:()=>rn,applyStylesheetLink:()=>an,changeSkinUrlByTokenizer:()=>mn,createIframeSkinByTokenizer:()=>Zt,exec:()=>hn,removeClass:()=>ln,v2_CloudRepository:()=>un});var Nn=c(()=>{\"use strict\";X();pt();pt();K(\"MyopHelpers\",Yt)});var xs={};J(xs,{getHostModule:()=>Vn,getIframeModule:()=>qn,getWebcomponentModule:()=>Wn});X();var so;if(window.__federation__)console.log(\"__federation__ loaded more than once.\");else{let n=(so=document.currentScript)==null?void 0:so.src,t=n?n.split(\"/\").slice(0,-1).join(\"/\"):\"\";window.__federation__={__public_auto_path__:t,__use_public_auto_path__:!0,__public_path__:void 0,__loading_timeout__:5*1e3}}window.__federation__.load__federation__=(n,t,e)=>{if(window.__federation__[t])console.log(\"__federation__ module \".concat(t,\" already loaded.\")),e(window.__federation__[t][Tt]);else{let o;window.__federation__[t]={},window.__federation__[t][De]=r=>{o&&(document.head.removeChild(o),o=null),window.__federation__[t][Tt]=r,e(r)},o=document.createElement(\"script\"),o.type=\"module\",o.src=n,o.async=!0,document.head.appendChild(o)}};Be();console.log(\"myop root sdk - loaded\",document.location.origin);var hs=\"https://cdn.myop.dev/sdk/next/myop_sdk.min.js\",Vn=()=>Promise.resolve().then(()=>(Re(),wn)),qn=()=>Promise.resolve().then(()=>(Fn(),$n)),Wn=()=>Promise.resolve().then(()=>(Qt(),en)),Ms=()=>Promise.resolve().then(()=>(Un(),ys)),Is=()=>Promise.resolve().then(()=>(Nn(),zn)),ke=n=>async()=>(await n()).get(),Cs={version:ae,getHostModule:ke(Vn),getIframeModule:ke(qn),getWebcomponentModule:ke(Wn),getMyopMessages:ke(Ms),getMyopHelpers:ke(Is)};window.myop||(window.myop={__ROOT_SDK_PUBLIC_URL__:hs});window.myop.rootSDK?console.log(\"myop root host loaded more than once.\"):window.myop=y({rootSDK:Cs},window.myop);return es(xs);})();\n</script>\n </head>\n <body>\n <div id=\"myop-container\"></div>\n <script>\n // Initialize hostSDK on page load\n (async function initSDK() {\n try {\n // Use the internal getHostModule which returns the module directly\n const hostModule = await MyopSDK.getHostModule();\n // hostModule is the exports object with { hostSDK, HostSDK }\n window.__myopHostSDK = hostModule.hostSDK || window.myop.hostSDK;\n window.ReactNativeWebView.postMessage('WEBVIEW_READY');\n } catch (err) {\n window.ReactNativeWebView.postMessage('SDK_INIT_ERROR:' + err.message);\n }\n })();\n\n async function loadMyopComponent(configAsString) {\n try {\n const componentConfig = JSON.parse(decodeURIComponent(configAsString));\n const container = document.getElementById('myop-container');\n window.myopComponent = await window.__myopHostSDK.loadComponent(componentConfig, container);\n\n // Set up myop_cta_handler to forward calls to React Native\n if (window.myopComponent && window.myopComponent.element && window.myopComponent.element.contentWindow) {\n window.myopComponent.element.contentWindow.myop_cta_handler = function(action, payload) {\n window.ReactNativeWebView.postMessage('CTA:' + JSON.stringify({ action: action, payload: payload }));\n };\n }\n\n window.ReactNativeWebView.postMessage('COMPONENT_LOADED');\n } catch (err) {\n window.ReactNativeWebView.postMessage('COMPONENT_ERROR:' + err.message);\n }\n }\n </script>\n </body>\n</html>\n";
|
|
2
2
|
//# sourceMappingURL=componentHost.html.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentHost.html.d.ts","sourceRoot":"","sources":["../src/componentHost.html.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"componentHost.html.d.ts","sourceRoot":"","sources":["../src/componentHost.html.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,2y+DA+DhB,CAAC"}
|