@myop/vue 0.0.29 → 0.0.31

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.
@@ -1,17 +1,17 @@
1
- (function(d,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("@myop/sdk/host"),require("@myop/sdk/helpers")):typeof define=="function"&&define.amd?define(["exports","vue","@myop/sdk/host","@myop/sdk/helpers"],i):(d=typeof globalThis<"u"?globalThis:d||self,i(d["@myop/vue"]={},d.Vue,d.host,d.helpers))})(this,(function(d,i,V,P){"use strict";const Be=["innerHTML"],me=i.defineComponent({__name:"MyopLoader",props:{opacity:{default:1},fadeDuration:{default:200}},setup(e){const t=e,n=i.useSlots(),o=a=>!a||a.length===0?!1:a.some(u=>typeof u.children=="string"?u.children.trim()!=="":Array.isArray(u.children)?o(u.children):!!(u.type&&typeof u.type!="symbol"||u.children)),s=i.computed(()=>{const a=n.default;if(!a)return!1;const u=a();return o(u)}),r=i.computed(()=>({...V.containerStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),l=i.computed(()=>({...V.loaderStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),c=V.getMyopLogoHtml();return(a,u)=>s.value?(i.openBlock(),i.createElementBlock("div",{key:0,style:i.normalizeStyle(r.value)},[i.renderSlot(a.$slots,"default")],4)):(i.openBlock(),i.createElementBlock("div",{key:1,style:i.normalizeStyle(l.value),innerHTML:i.unref(c)},null,12,Be))}}),ve=["innerHTML"],he=i.defineComponent({__name:"MyopFallback",setup(e){const t=i.useSlots(),n=c=>!c||c.length===0?!1:c.some(a=>typeof a.children=="string"?a.children.trim()!=="":Array.isArray(a.children)?n(a.children):!!(a.type&&typeof a.type!="symbol"||a.children)),o=i.computed(()=>{const c=t.default;if(!c)return!1;const a=c();return n(a)}),s={position:"absolute",top:"0",left:"0",right:"0",bottom:"0"},r={...V.fallbackStyleObject},l=V.getMyopLogoHtml();return(c,a)=>o.value?(i.openBlock(),i.createElementBlock("div",{key:0,style:s},[i.renderSlot(c.$slots,"default")])):(i.openBlock(),i.createElementBlock("div",{key:1,style:r,innerHTML:i.unref(l)},null,8,ve))}}),Je=i.defineComponent({name:"MyopComponent",__name:"MyopComponent",props:{componentId:{},componentConfig:{},data:{},fadeDuration:{default:200},autoSize:{type:Boolean,default:!1},environment:{},preview:{type:Boolean},on:{}},emits:["load","error","sizeChange","cta"],setup(e,{expose:t,emit:n}){const o=i.useSlots(),s=f=>!f||f.length===0?!1:f.some(p=>typeof p.children=="string"?p.children.trim()!=="":Array.isArray(p.children)?s(p.children):!!(p.type&&typeof p.type!="symbol"||p.children)),r=i.computed(()=>{const f=o.loader;if(!f)return!1;const p=f();return s(p)});i.computed(()=>{const f=o.fallback;if(!f)return!1;const p=f();return s(p)});const l=e,c=n,a=i.ref(null),u=i.shallowRef(null),m=l.componentId?Pe(l.componentId):!1,g=i.ref(!m),R=i.ref(1),b=i.ref(!1),A=i.ref(!1),D=i.ref(void 0),ue=i.ref(!1),Y=i.ref(null);let M=null;const fe=()=>{R.value=0,setTimeout(()=>{g.value=!1},l.fadeDuration)},pe=f=>{console.error("[MyopComponent] Error:",f),fe(),b.value=!0,c("error",f)},de=async f=>{var O,G;ue.value=!0;let p=!1;try{const y=JSON.parse(JSON.stringify({componentId:f.componentId,data:f.data,environment:f.environment,preview:f.preview,autoSize:f.autoSize}));if(!y.componentId&&!f.componentConfig){pe("No component configuration provided");return}const Kt=y.preview===!0?!0:void 0,Yt=f.componentConfig?JSON.parse(JSON.stringify(f.componentConfig)):await ze().fetchComponentV2(y.componentId,y.environment,Kt);if(!a.value){pe("Container element not found");return}const Gt=i.markRaw({data:y.data,_environment:{props:y}}),je=await V.hostSDK.loadComponent(Yt,a.value,Gt);if(p){je.dispose();return}if(u.value=i.markRaw(je),await u.value.initiated(),p){(O=u.value)==null||O.dispose();return}if(await new Promise(Q=>requestAnimationFrame(Q)),p||!u.value||u.value.markedForDisposed){u.value&&!u.value.markedForDisposed&&u.value.dispose();return}A.value=!0,l.autoSize||fe(),(G=u.value)!=null&&G.props&&(u.value.props.myop_cta_handler=(Q,Ue)=>{l.on&&l.on(Q,Ue),c("cta",Q,Ue)}),c("load",u.value)}catch(y){p||pe((y==null?void 0:y.message)||"Unknown error")}finally{if(ue.value=!1,Y.value!==null&&!p){const y=Y.value;Y.value=null,await de(y)}}return()=>{p=!0}},Jt=()=>{var p;if(!A.value||!((p=u.value)!=null&&p.observeAutoSize))return;let f=!0;M=u.value.observeAutoSize({explicitWidth:void 0,explicitHeight:void 0,forceAutoSize:l.autoSize,loaderMinHeight:50,onSizeChange:O=>{c("sizeChange",O),D.value=O,f&&(f=!1,fe())}})};i.watch(()=>l.componentId,async(f,p)=>{f!==p&&(A.value=!1,b.value=!1,g.value=!0,R.value=1,u.value&&(u.value.dispose(),u.value=null),M&&(M(),M=null),ue.value?Y.value={...l}:await de(l))}),i.watch(()=>l.data,f=>{var p;if(A.value&&f!==void 0&&u.value){const O=(p=u.value.props)==null?void 0:p.myop_init_interface;if(O){const G=JSON.parse(JSON.stringify(f));O(G)}}},{deep:!0}),i.watch(()=>A.value,f=>{f&&l.autoSize&&Jt()}),i.onMounted(async()=>{(l.componentId||l.componentConfig)&&await de(l)}),i.onUnmounted(()=>{M&&M(),u.value&&u.value.dispose()});const xe=i.computed(()=>{var f,p;return((f=D.value)==null?void 0:f.autoSizingWidth)||((p=D.value)==null?void 0:p.autoSizingHeight)}),Le=i.computed(()=>g.value?50:void 0),Wt=i.computed(()=>{var f,p;return{position:"relative",width:(f=D.value)!=null&&f.autoSizingWidth?`${D.value.width}px`:"100%",height:(p=D.value)!=null&&p.autoSizingHeight?`${D.value.height}px`:"100%",minHeight:Le.value?`${Le.value}px`:void 0,overflow:xe.value?"hidden":"inherit"}}),qt=i.computed(()=>({position:"absolute",inset:"0",overflow:xe.value?"hidden":void 0}));return t({myopComponent:u,isLoaded:A}),(f,p)=>(i.openBlock(),i.createElementBlock("div",{style:i.normalizeStyle(Wt.value)},[i.createElementVNode("div",{ref_key:"myopContainer",ref:a,style:i.normalizeStyle(qt.value)},null,4),g.value&&r.value?(i.openBlock(),i.createBlock(me,{key:0,opacity:R.value,"fade-duration":e.fadeDuration},{default:i.withCtx(()=>[i.renderSlot(f.$slots,"loader")]),_:3},8,["opacity","fade-duration"])):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(he,{key:1},{default:i.withCtx(()=>[i.renderSlot(f.$slots,"fallback")]),_:3})):i.createCommentVNode("",!0)],4))}});/**
1
+ (function(d,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("@myop/sdk/host"),require("@myop/sdk/helpers")):typeof define=="function"&&define.amd?define(["exports","vue","@myop/sdk/host","@myop/sdk/helpers"],s):(d=typeof globalThis<"u"?globalThis:d||self,s(d["@myop/vue"]={},d.Vue,d.host,d.helpers))})(this,(function(d,s,V,g){"use strict";const Je=["innerHTML"],he=s.defineComponent({__name:"MyopLoader",props:{opacity:{default:1},fadeDuration:{default:200}},setup(e){const t=e,n=s.useSlots(),o=a=>!a||a.length===0?!1:a.some(u=>typeof u.children=="string"?u.children.trim()!=="":Array.isArray(u.children)?o(u.children):!!(u.type&&typeof u.type!="symbol"||u.children)),i=s.computed(()=>{const a=n.default;if(!a)return!1;const u=a();return o(u)}),r=s.computed(()=>({...V.containerStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),l=s.computed(()=>({...V.loaderStyleObject,opacity:t.opacity,transition:`opacity ${t.fadeDuration}ms ease-out`})),c=V.getMyopLogoHtml();return(a,u)=>i.value?(s.openBlock(),s.createElementBlock("div",{key:0,style:s.normalizeStyle(r.value)},[s.renderSlot(a.$slots,"default")],4)):(s.openBlock(),s.createElementBlock("div",{key:1,style:s.normalizeStyle(l.value),innerHTML:s.unref(c)},null,12,Je))}}),We=["innerHTML"],ye=s.defineComponent({__name:"MyopFallback",setup(e){const t=s.useSlots(),n=c=>!c||c.length===0?!1:c.some(a=>typeof a.children=="string"?a.children.trim()!=="":Array.isArray(a.children)?n(a.children):!!(a.type&&typeof a.type!="symbol"||a.children)),o=s.computed(()=>{const c=t.default;if(!c)return!1;const a=c();return n(a)}),i={position:"absolute",top:"0",left:"0",right:"0",bottom:"0"},r={...V.fallbackStyleObject},l=V.getMyopLogoHtml();return(c,a)=>o.value?(s.openBlock(),s.createElementBlock("div",{key:0,style:i},[s.renderSlot(c.$slots,"default")])):(s.openBlock(),s.createElementBlock("div",{key:1,style:r,innerHTML:s.unref(l)},null,8,We))}}),qe=s.defineComponent({name:"MyopComponent",__name:"MyopComponent",props:{componentId:{},componentConfig:{},data:{},fadeDuration:{default:200},autoSize:{type:Boolean,default:!0},environment:{},preview:{type:Boolean},on:{}},emits:["load","error","sizeChange","cta"],setup(e,{expose:t,emit:n}){const o=s.useSlots(),i=f=>!f||f.length===0?!1:f.some(p=>typeof p.children=="string"?p.children.trim()!=="":Array.isArray(p.children)?i(p.children):!!(p.type&&typeof p.type!="symbol"||p.children)),r=s.computed(()=>{const f=o.loader;if(!f)return!1;const p=f();return i(p)});s.computed(()=>{const f=o.fallback;if(!f)return!1;const p=f();return i(p)});const l=e,c=n,a=s.ref(null),u=s.shallowRef(null),m=l.componentId?g.isPreloaded(l.componentId):!1,_=s.ref(!m),D=s.ref(1),w=s.ref(!1),R=s.ref(!1),F=s.ref(void 0),ze=s.ref({fillWidth:!1,fillHeight:!1}),fe=s.ref(!1),Y=s.ref(null);let A=null;const pe=()=>{D.value=0,setTimeout(()=>{_.value=!1},l.fadeDuration)},de=f=>{console.error("[MyopComponent] Error:",f),pe(),w.value=!0,c("error",f)},me=async f=>{var O,Q,je;fe.value=!0;let p=!1;try{const y=JSON.parse(JSON.stringify({componentId:f.componentId,data:f.data,environment:f.environment,preview:f.preview,autoSize:f.autoSize}));if(!y.componentId&&!f.componentConfig){de("No component configuration provided");return}const Bt=y.preview===!0?!0:void 0,Jt=f.componentConfig?JSON.parse(JSON.stringify(f.componentConfig)):await g.getCloudRepository().fetchComponentV2(y.componentId,y.environment,Bt);if(!a.value){de("Container element not found");return}const Wt=s.markRaw({data:y.data,_environment:{props:y}}),Le=await V.hostSDK.loadComponent(Jt,a.value,Wt);if(p){Le.dispose();return}if(u.value=s.markRaw(Le),await u.value.initiated(),p){(O=u.value)==null||O.dispose();return}if(await new Promise(X=>requestAnimationFrame(X)),p||!u.value||u.value.markedForDisposed){u.value&&!u.value.markedForDisposed&&u.value.dispose();return}R.value=!0;const H=(Q=u.value)==null?void 0:Q.sizeMeta,ve=(H==null?void 0:H.width)==="100%",Ue=(H==null?void 0:H.height)==="100%";ze.value={fillWidth:ve,fillHeight:Ue},(!(l.autoSize??!0)||ve&&Ue)&&pe(),(je=u.value)!=null&&je.props&&(u.value.props.myop_cta_handler=(X,Be)=>{l.on&&l.on(X,Be),c("cta",X,Be)}),c("load",u.value)}catch(y){p||de((y==null?void 0:y.message)||"Unknown error")}finally{if(fe.value=!1,Y.value!==null&&!p){const y=Y.value;Y.value=null,await me(y)}}return()=>{p=!0}},Lt=()=>{var p;if(!R.value||!((p=u.value)!=null&&p.observeAutoSize))return;let f=!0;A=u.value.observeAutoSize({explicitWidth:void 0,explicitHeight:void 0,forceAutoSize:l.autoSize??!0,loaderMinHeight:50,onSizeChange:O=>{c("sizeChange",O),F.value=O,f&&(f=!1,pe())}})};s.watch(()=>l.componentId,async(f,p)=>{f!==p&&(R.value=!1,w.value=!1,_.value=!0,D.value=1,u.value&&(u.value.dispose(),u.value=null),A&&(A(),A=null),fe.value?Y.value={...l}:await me(l))}),s.watch(()=>l.data,f=>{var p;if(R.value&&f!==void 0&&u.value){const O=(p=u.value.props)==null?void 0:p.myop_init_interface;if(O){const Q=JSON.parse(JSON.stringify(f));O(Q)}}},{deep:!0}),s.watch(()=>R.value,f=>{f&&Lt()}),s.onMounted(async()=>{(l.componentId||l.componentConfig)&&await me(l)}),s.onUnmounted(()=>{A&&A(),u.value&&u.value.dispose()});const G=s.computed(()=>_.value?50:void 0),xe=s.computed(()=>!(l.autoSize??!0)||!R.value||ze.value.fillHeight),vt=s.computed(()=>{var f,p;return xe.value?{position:"relative",width:"100%",height:"100%",minHeight:G.value?`${G.value}px`:void 0}:{position:"relative",width:(f=F.value)!=null&&f.autoSizingWidth?`${F.value.width}px`:"100%",height:(p=F.value)!=null&&p.height?`${F.value.height}px`:void 0,minHeight:G.value?`${G.value}px`:void 0}}),Ut=s.computed(()=>{var f;return xe.value?{position:"absolute",inset:"0"}:{width:"100%",height:(f=F.value)!=null&&f.height?`${F.value.height}px`:void 0}});return t({myopComponent:u,isLoaded:R}),(f,p)=>(s.openBlock(),s.createElementBlock("div",{style:s.normalizeStyle(vt.value)},[s.createElementVNode("div",{ref_key:"myopContainer",ref:a,style:s.normalizeStyle(Ut.value)},null,4),_.value&&r.value?(s.openBlock(),s.createBlock(he,{key:0,opacity:D.value,"fade-duration":e.fadeDuration},{default:s.withCtx(()=>[s.renderSlot(f.$slots,"loader")]),_:3},8,["opacity","fade-duration"])):s.createCommentVNode("",!0),w.value?(s.openBlock(),s.createBlock(ye,{key:1},{default:s.withCtx(()=>[s.renderSlot(f.$slots,"fallback")]),_:3})):s.createCommentVNode("",!0)],4))}});/**
2
2
  * @vue/shared v3.5.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/const We=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const ye=()=>{},qe=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),X=Object.assign,_=Array.isArray,C=e=>typeof e=="function",S=e=>typeof e=="string",Ke=e=>typeof e=="symbol",H=e=>e!==null&&typeof e=="object",Ye=e=>(H(e)||C(e))&&C(e.then)&&C(e.catch),ge=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Ge=ge(e=>e.charAt(0).toUpperCase()+e.slice(1)),Qe=ge(e=>e?`on${Ge(e)}`:"");let _e;const x=()=>_e||(_e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Z(e){if(_(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=S(o)?tt(o):Z(o);if(s)for(const r in s)t[r]=s[r]}return t}else if(S(e)||H(e))return e}const Xe=/;(?![^(]*\))/g,Ze=/:([^]+)/,et=/\/\*[^]*?\*\//g;function tt(e){const t={};return e.replace(et,"").split(Xe).forEach(n=>{if(n){const o=n.split(Ze);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ee(e){let t="";if(S(e))t=e;else if(_(e))for(let n=0;n<e.length;n++){const o=ee(e[n]);o&&(t+=o+" ")}else if(H(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
5
+ **/const Ke=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const ge=()=>{},Ye=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Z=Object.assign,C=Array.isArray,b=e=>typeof e=="function",S=e=>typeof e=="string",Ge=e=>typeof e=="symbol",P=e=>e!==null&&typeof e=="object",Qe=e=>(P(e)||b(e))&&b(e.then)&&b(e.catch),_e=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Xe=_e(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ze=_e(e=>e?`on${Xe(e)}`:"");let Ce;const x=()=>Ce||(Ce=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ee(e){if(C(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],i=S(o)?ot(o):ee(o);if(i)for(const r in i)t[r]=i[r]}return t}else if(S(e)||P(e))return e}const et=/;(?![^(]*\))/g,tt=/:([^]+)/,nt=/\/\*[^]*?\*\//g;function ot(e){const t={};return e.replace(nt,"").split(et).forEach(n=>{if(n){const o=n.split(tt);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function te(e){let t="";if(S(e))t=e;else if(C(e))for(let n=0;n<e.length;n++){const o=te(e[n]);o&&(t+=o+" ")}else if(P(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
6
6
  * @vue/reactivity v3.5.27
7
7
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
8
  * @license MIT
9
- **/process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ke));function te(e){return e?!!e.__v_raw:!1}function L(e){const t=e&&e.__v_raw;return t?L(t):e}function Ce(e){return e?e.__v_isRef===!0:!1}/**
9
+ **/process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV,new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ge));function ne(e){return e?!!e.__v_raw:!1}function j(e){const t=e&&e.__v_raw;return t?j(t):e}function be(e){return e?e.__v_isRef===!0:!1}/**
10
10
  * @vue/runtime-core v3.5.27
11
11
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
12
  * @license MIT
13
- **/const I=[];function nt(e){I.push(e)}function ot(){I.pop()}let ne=!1;function N(e,...t){if(ne)return;ne=!0;const n=I.length?I[I.length-1].component:null,o=n&&n.appContext.config.warnHandler,s=rt();if(o)j(o,n,11,[e+t.map(r=>{var l,c;return(c=(l=r.toString)==null?void 0:l.call(r))!=null?c:JSON.stringify(r)}).join(""),n&&n.proxy,s.map(({vnode:r})=>`at <${Me(n,r.type)}>`).join(`
14
- `),s]);else{const r=[`[Vue warn]: ${e}`,...t];s.length&&r.push(`
15
- `,...st(s)),console.warn(...r)}ne=!1}function rt(){let e=I[I.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}function st(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
16
- `],...it(n))}),t}function it({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=e.component?e.component.parent==null:!1,s=` at <${Me(e.component,e.type,o)}`,r=">"+n;return e.props?[s,...lt(e.props),r]:[s+r]}function lt(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...Ee(o,e[o]))}),n.length>3&&t.push(" ..."),t}function Ee(e,t,n){return S(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Ce(t)?(t=Ee(e,L(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):C(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=L(t),n?t:[`${e}=`,t])}const oe={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function j(e,t,n,o){try{return o?e(...o):e()}catch(s){re(s,t,n)}}function Se(e,t,n,o){if(C(e)){const s=j(e,t,n,o);return s&&Ye(s)&&s.catch(r=>{re(r,t,n)}),s}if(_(e)){const s=[];for(let r=0;r<e.length;r++)s.push(Se(e[r],t,n,o));return s}else process.env.NODE_ENV!=="production"&&N(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function re(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||We;if(t){let c=t.parent;const a=t.proxy,u=process.env.NODE_ENV!=="production"?oe[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const m=c.ec;if(m){for(let g=0;g<m.length;g++)if(m[g](e,a,u)===!1)return}c=c.parent}if(r){j(r,null,10,[e,a,u]);return}}at(e,n,s,o,l)}function at(e,t,n,o=!0,s=!1){if(process.env.NODE_ENV!=="production"){const r=oe[t];if(n&&nt(n),N(`Unhandled error${r?` during execution of ${r}`:""}`),n&&ot(),o)throw e;console.error(e)}else{if(s)throw e;console.error(e)}}const h=[];let E=-1;const F=[];let w=null,T=0;const ct=Promise.resolve();let se=null;const ut=100;function ft(e){let t=E+1,n=h.length;for(;t<n;){const o=t+n>>>1,s=h[o],r=z(s);r<e||r===e&&s.flags&2?t=o+1:n=o}return t}function pt(e){if(!(e.flags&1)){const t=z(e),n=h[h.length-1];!n||!(e.flags&2)&&t>=z(n)?h.push(e):h.splice(ft(t),0,e),e.flags|=1,Ne()}}function Ne(){se||(se=ct.then(we))}function dt(e){_(e)?F.push(...e):w&&e.id===-1?w.splice(T+1,0,e):e.flags&1||(F.push(e),e.flags|=1),Ne()}function mt(e){if(F.length){const t=[...new Set(F)].sort((n,o)=>z(n)-z(o));if(F.length=0,w){w.push(...t);return}for(w=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),T=0;T<w.length;T++){const n=w[T];process.env.NODE_ENV!=="production"&&ke(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}w=null,T=0}}const z=e=>e.id==null?e.flags&2?-1:1/0:e.id;function we(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>ke(e,n):ye;try{for(E=0;E<h.length;E++){const n=h[E];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),j(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;E<h.length;E++){const n=h[E];n&&(n.flags&=-2)}E=-1,h.length=0,mt(e),se=null,(h.length||F.length)&&we(e)}}function ke(e,t){const n=e.get(t)||0;if(n>ut){const o=t.i,s=o&&Ae(o.type);return re(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const ie=new Map;process.env.NODE_ENV!=="production"&&(x().__VUE_HMR_RUNTIME__={createRecord:le(ht),rerender:le(yt),reload:le(gt)});const U=new Map;function ht(e,t){return U.has(e)?!1:(U.set(e,{initialDef:B(t),instances:new Set}),!0)}function B(e){return He(e)?e.__vccOpts:e}function yt(e,t){const n=U.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,B(o.type).render=t),o.renderCache=[],o.job.flags&8||o.update()}))}function gt(e,t){const n=U.get(e);if(!n)return;t=B(t),be(n.initialDef,t);const o=[...n.instances];for(let s=0;s<o.length;s++){const r=o[s],l=B(r.type);let c=ie.get(l);c||(l!==n.initialDef&&be(l,t),ie.set(l,c=new Set)),c.add(r),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(c.add(r),r.ceReload(t.styles),c.delete(r)):r.parent?pt(()=>{r.job.flags&8||(r.parent.update(),c.delete(r))}):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),r.root.ce&&r!==r.root&&r.root.ce._removeChildStyle(l)}dt(()=>{ie.clear()})}function be(e,t){X(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function le(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let $,v=[];function Oe(e,t){var n,o;$=e,$?($.enabled=!0,v.forEach(({event:s,args:r})=>$.emit(s,...r)),v=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{Oe(r,t)}),setTimeout(()=>{$||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,v=[])},3e3)):v=[]}let J=null,_t=null;const Ct=e=>e.__isTeleport;function Ve(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ve(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}x().requestIdleCallback,x().cancelIdleCallback;function Et(e,t,n=K,o=!1){if(n){const s=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...l)=>{const c=Mt(n),a=Se(t,n,e,l);return c(),a});return o?s.unshift(r):s.push(r),r}else if(process.env.NODE_ENV!=="production"){const s=Qe(oe[e].replace(/ hook$/,""));N(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const St=(e=>(t,n=K)=>{(!$e||e==="sp")&&Et(e,(...o)=>t(...o),n)})("u"),Nt=Symbol.for("v-ndc"),wt={};process.env.NODE_ENV!=="production"&&(wt.ownKeys=e=>(N("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));const kt={},Ie=e=>Object.getPrototypeOf(e)===kt,bt=e=>e.__isSuspense,Re=Symbol.for("v-fgt"),Ot=Symbol.for("v-txt"),Vt=Symbol.for("v-cmt");function It(e){return e?e.__v_isVNode===!0:!1}const Rt=(...e)=>Fe(...e),De=({key:e})=>e??null,W=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?S(e)||Ce(e)||C(e)?{i:J,r:e,k:t,f:!!n}:e:null);function Dt(e,t=null,n=null,o=0,s=null,r=e===Re?0:1,l=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&De(t),ref:t&&W(t),scopeId:_t,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:J};return c?(ae(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=S(n)?8:16),process.env.NODE_ENV!=="production"&&a.key!==a.key&&N("VNode created with invalid key (NaN). VNode type:",a.type),a}const Ft=process.env.NODE_ENV!=="production"?Rt:Fe;function Fe(e,t=null,n=null,o=0,s=null,r=!1){if((!e||e===Nt)&&(process.env.NODE_ENV!=="production"&&!e&&N(`Invalid vnode type when creating vnode: ${e}.`),e=Vt),It(e)){const c=q(e,t,!0);return n&&ae(c,n),c.patchFlag=-2,c}if(He(e)&&(e=e.__vccOpts),t){t=Tt(t);let{class:c,style:a}=t;c&&!S(c)&&(t.class=ee(c)),H(a)&&(te(a)&&!_(a)&&(a=X({},a)),t.style=Z(a))}const l=S(e)?1:bt(e)?128:Ct(e)?64:H(e)?4:C(e)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&te(e)&&(e=L(e),N("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
17
- Component that was made reactive: `,e)),Dt(e,t,n,o,s,l,r,!0)}function Tt(e){return e?te(e)||Ie(e)?X({},e):e:null}function q(e,t,n=!1,o=!1){const{props:s,ref:r,patchFlag:l,children:c,transition:a}=e,u=t?At(s||{},t):s,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&De(u),ref:t&&t.ref?n&&r?_(r)?r.concat(W(t)):[r,W(t)]:W(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&_(c)?c.map(Te):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&q(e.ssContent),ssFallback:e.ssFallback&&q(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Ve(m,a.clone(m)),m}function Te(e){const t=q(e);return _(e.children)&&(t.children=e.children.map(Te)),t}function $t(e=" ",t=0){return Ft(Ot,null,e,t)}function ae(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(_(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),ae(e,s()),s._c&&(s._d=!0));return}else n=32,!t._&&!Ie(t)&&(t._ctx=J);else C(t)?(t={default:t,_ctx:J},n=32):(t=String(t),o&64?(n=16,t=[$t(t)]):n=8);e.children=t,e.shapeFlag|=n}function At(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=ee([t.class,o.class]));else if(s==="style")t.style=Z([t.style,o.style]);else if(qe(s)){const r=t[s],l=o[s];l&&r!==l&&!(_(r)&&r.includes(l))&&(t[s]=r?[].concat(r,l):l)}else s!==""&&(t[s]=o[s])}return t}let K=null,ce;{const e=x(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),r=>{s.length>1?s.forEach(l=>l(r)):s[0](r)}};ce=t("__VUE_INSTANCE_SETTERS__",n=>K=n),t("__VUE_SSR_SETTERS__",n=>$e=n)}const Mt=e=>{const t=K;return ce(e),e.scope.on(),()=>{e.scope.off(),ce(t)}};let $e=!1;process.env.NODE_ENV;const Ht=/(?:^|[-_])\w/g,zt=e=>e.replace(Ht,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ae(e,t=!0){return C(e)?e.displayName||e.name:e.name||t&&e.__name}function Me(e,t,n=!1){let o=Ae(t);if(!o&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(o=s[1])}if(!o&&e){const s=r=>{for(const l in r)if(r[l]===t)return l};o=s(e.components)||e.parent&&s(e.parent.type.components)||s(e.appContext.components)}return o?zt(o):n?"App":"Anonymous"}function He(e){return C(e)&&"__vccOpts"in e}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;const Pt=i.defineComponent({inheritAttrs:!0,__name:"MyopVueComponent",props:{flowId:{},componentId:{},onReady:{type:Function}},setup(e,{expose:t}){const n=e,o=i.useAttrs(),s=i.useSlots(),r=i.ref(null),l=i.ref(!0),c=i.ref(null),a=i.ref(null),u=i.getCurrentInstance(),m=i.ref(null);St(()=>{a&&a.value&&a.value(o)}),i.onMounted(async()=>{if(r.value){const R=await P.CloudRepository.Main.fetchComponent(n.componentId,n.flowId);c.value=await V.hostSDK.loadComponent(R,r==null?void 0:r.value,{_environment:{props:o,slots:s,context:u==null?void 0:u.appContext,vueContainerRef:r,defineUpdater:b=>{a.value=b},defineInnerVueComponentRef:b=>{m.value=b.value}}}),l.value=!1,n.onReady&&n.onReady(c.value,m.value)}});const g=i.reactive({});return t(g),i.watchEffect(()=>{Object.assign(g,m.value)}),(R,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps(i.unref(o),{ref_key:"myopContainer",ref:r}),null,16),l.value?i.renderSlot(R.$slots,"loading",{key:0}):i.createCommentVNode("",!0)],64))}});let k=P.CloudRepository.Main;const ze=()=>k,Pe=(e,t,n)=>k.isPreloaded(e,t,n),xt=e=>k.getPreloadedParams(e),Lt=()=>{k=new P.CloudRepository("http://localhost:9292")},jt=e=>{k=new P.CloudRepository(e)},Ut=e=>{k=e},Bt=e=>{k.setEnvironment(e)},vt=async(e,t,n)=>Promise.allSettled(e.map(o=>k.fetchComponentV2(o,t,n)));d.MyopComponent=Je,d.MyopContainer=Pt,d.MyopFallback=he,d.MyopLoader=me,d.enableLocalDev=Lt,d.getCloudRepository=ze,d.getPreloadedParams=xt,d.isPreloaded=Pe,d.preloadComponents=vt,d.setCloudRepository=Ut,d.setCloudRepositoryUrl=jt,d.setEnvironment=Bt,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
13
+ **/const I=[];function rt(e){I.push(e)}function it(){I.pop()}let oe=!1;function N(e,...t){if(oe)return;oe=!0;const n=I.length?I[I.length-1].component:null,o=n&&n.appContext.config.warnHandler,i=st();if(o)L(o,n,11,[e+t.map(r=>{var l,c;return(c=(l=r.toString)==null?void 0:l.call(r))!=null?c:JSON.stringify(r)}).join(""),n&&n.proxy,i.map(({vnode:r})=>`at <${He(n,r.type)}>`).join(`
14
+ `),i]);else{const r=[`[Vue warn]: ${e}`,...t];i.length&&r.push(`
15
+ `,...lt(i)),console.warn(...r)}oe=!1}function st(){let e=I[I.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}function lt(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
16
+ `],...at(n))}),t}function at({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=e.component?e.component.parent==null:!1,i=` at <${He(e.component,e.type,o)}`,r=">"+n;return e.props?[i,...ct(e.props),r]:[i+r]}function ct(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...Ee(o,e[o]))}),n.length>3&&t.push(" ..."),t}function Ee(e,t,n){return S(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:be(t)?(t=Ee(e,j(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):b(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=j(t),n?t:[`${e}=`,t])}const re={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function L(e,t,n,o){try{return o?e(...o):e()}catch(i){ie(i,t,n)}}function Se(e,t,n,o){if(b(e)){const i=L(e,t,n,o);return i&&Qe(i)&&i.catch(r=>{ie(r,t,n)}),i}if(C(e)){const i=[];for(let r=0;r<e.length;r++)i.push(Se(e[r],t,n,o));return i}else process.env.NODE_ENV!=="production"&&N(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function ie(e,t,n,o=!0){const i=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||Ke;if(t){let c=t.parent;const a=t.proxy,u=process.env.NODE_ENV!=="production"?re[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const m=c.ec;if(m){for(let _=0;_<m.length;_++)if(m[_](e,a,u)===!1)return}c=c.parent}if(r){L(r,null,10,[e,a,u]);return}}ut(e,n,i,o,l)}function ut(e,t,n,o=!0,i=!1){if(process.env.NODE_ENV!=="production"){const r=re[t];if(n&&rt(n),N(`Unhandled error${r?` during execution of ${r}`:""}`),n&&it(),o)throw e;console.error(e)}else{if(i)throw e;console.error(e)}}const h=[];let E=-1;const T=[];let k=null,$=0;const ft=Promise.resolve();let se=null;const pt=100;function dt(e){let t=E+1,n=h.length;for(;t<n;){const o=t+n>>>1,i=h[o],r=z(i);r<e||r===e&&i.flags&2?t=o+1:n=o}return t}function mt(e){if(!(e.flags&1)){const t=z(e),n=h[h.length-1];!n||!(e.flags&2)&&t>=z(n)?h.push(e):h.splice(dt(t),0,e),e.flags|=1,Ne()}}function Ne(){se||(se=ft.then(ke))}function ht(e){C(e)?T.push(...e):k&&e.id===-1?k.splice($+1,0,e):e.flags&1||(T.push(e),e.flags|=1),Ne()}function yt(e){if(T.length){const t=[...new Set(T)].sort((n,o)=>z(n)-z(o));if(T.length=0,k){k.push(...t);return}for(k=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),$=0;$<k.length;$++){const n=k[$];process.env.NODE_ENV!=="production"&&we(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}k=null,$=0}}const z=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ke(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>we(e,n):ge;try{for(E=0;E<h.length;E++){const n=h[E];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),L(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;E<h.length;E++){const n=h[E];n&&(n.flags&=-2)}E=-1,h.length=0,yt(e),se=null,(h.length||T.length)&&ke(e)}}function we(e,t){const n=e.get(t)||0;if(n>pt){const o=t.i,i=o&&Ae(o.type);return ie(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const le=new Map;process.env.NODE_ENV!=="production"&&(x().__VUE_HMR_RUNTIME__={createRecord:ae(gt),rerender:ae(_t),reload:ae(Ct)});const v=new Map;function gt(e,t){return v.has(e)?!1:(v.set(e,{initialDef:U(t),instances:new Set}),!0)}function U(e){return Pe(e)?e.__vccOpts:e}function _t(e,t){const n=v.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,U(o.type).render=t),o.renderCache=[],o.job.flags&8||o.update()}))}function Ct(e,t){const n=v.get(e);if(!n)return;t=U(t),Oe(n.initialDef,t);const o=[...n.instances];for(let i=0;i<o.length;i++){const r=o[i],l=U(r.type);let c=le.get(l);c||(l!==n.initialDef&&Oe(l,t),le.set(l,c=new Set)),c.add(r),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(c.add(r),r.ceReload(t.styles),c.delete(r)):r.parent?mt(()=>{r.job.flags&8||(r.parent.update(),c.delete(r))}):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),r.root.ce&&r!==r.root&&r.root.ce._removeChildStyle(l)}ht(()=>{le.clear()})}function Oe(e,t){Z(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function ae(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let M,B=[];function Ve(e,t){var n,o;M=e,M?(M.enabled=!0,B.forEach(({event:i,args:r})=>M.emit(i,...r)),B=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{Ve(r,t)}),setTimeout(()=>{M||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,B=[])},3e3)):B=[]}let J=null,bt=null;const Et=e=>e.__isTeleport;function Ie(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ie(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}x().requestIdleCallback,x().cancelIdleCallback;function St(e,t,n=K,o=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...l)=>{const c=Pt(n),a=Se(t,n,e,l);return c(),a});return o?i.unshift(r):i.push(r),r}else if(process.env.NODE_ENV!=="production"){const i=Ze(re[e].replace(/ hook$/,""));N(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Nt=(e=>(t,n=K)=>{(!Me||e==="sp")&&St(e,(...o)=>t(...o),n)})("u"),kt=Symbol.for("v-ndc"),wt={};process.env.NODE_ENV!=="production"&&(wt.ownKeys=e=>(N("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));const Ot={},De=e=>Object.getPrototypeOf(e)===Ot,Vt=e=>e.__isSuspense,Re=Symbol.for("v-fgt"),It=Symbol.for("v-txt"),Dt=Symbol.for("v-cmt");function Rt(e){return e?e.__v_isVNode===!0:!1}const Ft=(...e)=>Te(...e),Fe=({key:e})=>e??null,W=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?S(e)||be(e)||b(e)?{i:J,r:e,k:t,f:!!n}:e:null);function Tt(e,t=null,n=null,o=0,i=null,r=e===Re?0:1,l=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fe(t),ref:t&&W(t),scopeId:bt,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:J};return c?(ce(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=S(n)?8:16),process.env.NODE_ENV!=="production"&&a.key!==a.key&&N("VNode created with invalid key (NaN). VNode type:",a.type),a}const $t=process.env.NODE_ENV!=="production"?Ft:Te;function Te(e,t=null,n=null,o=0,i=null,r=!1){if((!e||e===kt)&&(process.env.NODE_ENV!=="production"&&!e&&N(`Invalid vnode type when creating vnode: ${e}.`),e=Dt),Rt(e)){const c=q(e,t,!0);return n&&ce(c,n),c.patchFlag=-2,c}if(Pe(e)&&(e=e.__vccOpts),t){t=Mt(t);let{class:c,style:a}=t;c&&!S(c)&&(t.class=te(c)),P(a)&&(ne(a)&&!C(a)&&(a=Z({},a)),t.style=ee(a))}const l=S(e)?1:Vt(e)?128:Et(e)?64:P(e)?4:b(e)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&ne(e)&&(e=j(e),N("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
17
+ Component that was made reactive: `,e)),Tt(e,t,n,o,i,l,r,!0)}function Mt(e){return e?ne(e)||De(e)?Z({},e):e:null}function q(e,t,n=!1,o=!1){const{props:i,ref:r,patchFlag:l,children:c,transition:a}=e,u=t?Ht(i||{},t):i,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Fe(u),ref:t&&t.ref?n&&r?C(r)?r.concat(W(t)):[r,W(t)]:W(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&C(c)?c.map($e):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&q(e.ssContent),ssFallback:e.ssFallback&&q(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Ie(m,a.clone(m)),m}function $e(e){const t=q(e);return C(e.children)&&(t.children=e.children.map($e)),t}function At(e=" ",t=0){return $t(It,null,e,t)}function ce(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(C(t))n=16;else if(typeof t=="object")if(o&65){const i=t.default;i&&(i._c&&(i._d=!1),ce(e,i()),i._c&&(i._d=!0));return}else n=32,!t._&&!De(t)&&(t._ctx=J);else b(t)?(t={default:t,_ctx:J},n=32):(t=String(t),o&64?(n=16,t=[At(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ht(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const i in o)if(i==="class")t.class!==o.class&&(t.class=te([t.class,o.class]));else if(i==="style")t.style=ee([t.style,o.style]);else if(Ye(i)){const r=t[i],l=o[i];l&&r!==l&&!(C(r)&&r.includes(l))&&(t[i]=r?[].concat(r,l):l)}else i!==""&&(t[i]=o[i])}return t}let K=null,ue;{const e=x(),t=(n,o)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(o),r=>{i.length>1?i.forEach(l=>l(r)):i[0](r)}};ue=t("__VUE_INSTANCE_SETTERS__",n=>K=n),t("__VUE_SSR_SETTERS__",n=>Me=n)}const Pt=e=>{const t=K;return ue(e),e.scope.on(),()=>{e.scope.off(),ue(t)}};let Me=!1;process.env.NODE_ENV;const zt=/(?:^|[-_])\w/g,xt=e=>e.replace(zt,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ae(e,t=!0){return b(e)?e.displayName||e.name:e.name||t&&e.__name}function He(e,t,n=!1){let o=Ae(t);if(!o&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(o=i[1])}if(!o&&e){const i=r=>{for(const l in r)if(r[l]===t)return l};o=i(e.components)||e.parent&&i(e.parent.type.components)||i(e.appContext.components)}return o?xt(o):n?"App":"Anonymous"}function Pe(e){return b(e)&&"__vccOpts"in e}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;const jt=s.defineComponent({inheritAttrs:!0,__name:"MyopVueComponent",props:{flowId:{},componentId:{},onReady:{type:Function}},setup(e,{expose:t}){const n=e,o=s.useAttrs(),i=s.useSlots(),r=s.ref(null),l=s.ref(!0),c=s.ref(null),a=s.ref(null),u=s.getCurrentInstance(),m=s.ref(null);Nt(()=>{a&&a.value&&a.value(o)}),s.onMounted(async()=>{if(r.value){const D=await g.CloudRepository.Main.fetchComponent(n.componentId,n.flowId);c.value=await V.hostSDK.loadComponent(D,r==null?void 0:r.value,{_environment:{props:o,slots:i,context:u==null?void 0:u.appContext,vueContainerRef:r,defineUpdater:w=>{a.value=w},defineInnerVueComponentRef:w=>{m.value=w.value}}}),l.value=!1,n.onReady&&n.onReady(c.value,m.value)}});const _=s.reactive({});return t(_),s.watchEffect(()=>{Object.assign(_,m.value)}),(D,w)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",s.mergeProps(s.unref(o),{ref_key:"myopContainer",ref:r}),null,16),l.value?s.renderSlot(D.$slots,"loading",{key:0}):s.createCommentVNode("",!0)],64))}});Object.defineProperty(d,"enableLocalDev",{enumerable:!0,get:()=>g.enableLocalDev}),Object.defineProperty(d,"getCloudRepository",{enumerable:!0,get:()=>g.getCloudRepository}),Object.defineProperty(d,"getPreloadedParams",{enumerable:!0,get:()=>g.getPreloadedParams}),Object.defineProperty(d,"isPreloaded",{enumerable:!0,get:()=>g.isPreloaded}),Object.defineProperty(d,"preloadComponents",{enumerable:!0,get:()=>g.preloadComponents}),Object.defineProperty(d,"setCloudRepository",{enumerable:!0,get:()=>g.setCloudRepository}),Object.defineProperty(d,"setCloudRepositoryUrl",{enumerable:!0,get:()=>g.setCloudRepositoryUrl}),Object.defineProperty(d,"setEnvironment",{enumerable:!0,get:()=>g.setEnvironment}),d.MyopComponent=qe,d.MyopContainer=jt,d.MyopFallback=ye,d.MyopLoader=he,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myop/vue",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -21,6 +21,7 @@
21
21
  "scripts": {
22
22
  "dev": "vite",
23
23
  "build": "vite build && vue-tsc --emitDeclarationOnly",
24
+ "test": "vitest run",
24
25
  "preview": "vite preview",
25
26
  "release": "npm publish --access public"
26
27
  },
@@ -29,13 +30,14 @@
29
30
  "vue": "^3.5.13"
30
31
  },
31
32
  "devDependencies": {
32
- "@myop/sdk": "^0.3.17",
33
+ "@myop/sdk": "^0.3.19",
33
34
  "@types/node": "^22.14.0",
34
35
  "@vitejs/plugin-vue": "^5.2.1",
35
36
  "@vue/tsconfig": "^0.7.0",
36
37
  "prettier": "^3.5.3",
37
38
  "typescript": "~5.7.2",
38
39
  "vite": "^6.2.0",
40
+ "vitest": "^4.0.18",
39
41
  "vue-tsc": "^2.2.4"
40
42
  },
41
43
  "keywords": [