@wix/cli-app 1.1.81 → 1.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/build/{AddPermissionCommand-SFC44F4N.js → AddPermissionCommand-SXPAYSAF.js} +2 -2
  2. package/build/{CreateVersionCommand-DMS7UHEW.js → CreateVersionCommand-CL7JTSHV.js} +3 -3
  3. package/build/{DevCommand-IMACMU76.js → DevCommand-NKKM4UEH.js} +14 -14
  4. package/build/{GenerateCommand-BXBYWPR6.js → GenerateCommand-EK35R76L.js} +1009 -868
  5. package/build/GenerateCommand-EK35R76L.js.map +1 -0
  6. package/build/{LogsCommand-DXPP2Y63.js → LogsCommand-NCV5AKYF.js} +3 -3
  7. package/build/PreviewCommand-KCCZ4ECQ.js +20 -0
  8. package/build/ReleaseCommand-FJKPKE3Y.js +29 -0
  9. package/build/{ServeCommand-2ESXE2E2.js → ServeCommand-B4GJL65A.js} +13 -13
  10. package/build/{build-5B2A76I7.js → build-VSYNDSED.js} +8 -8
  11. package/build/{chunk-R3BD56LW.js → chunk-3GSDI3OJ.js} +2 -2
  12. package/build/{chunk-D7ONS7OD.js → chunk-3LJH5WAS.js} +5 -5
  13. package/build/{chunk-LNBDMMJU.js → chunk-5LGI6O3F.js} +2 -2
  14. package/build/{chunk-ZVADFZDF.js → chunk-75BL4FR5.js} +5 -5
  15. package/build/{chunk-32DDGTGH.js → chunk-FGCBIHDS.js} +7 -7
  16. package/build/{chunk-RZHKF2FT.js → chunk-FTEVVMFS.js} +2 -2
  17. package/build/{chunk-2Y6DEXNR.js → chunk-GGQMSU4O.js} +759 -516
  18. package/build/{chunk-2Y6DEXNR.js.map → chunk-GGQMSU4O.js.map} +1 -1
  19. package/build/{chunk-PJJ6F4A3.js → chunk-HR6CTO67.js} +2 -2
  20. package/build/{chunk-42T5NHSS.js → chunk-I2PLZT4A.js} +2 -2
  21. package/build/{chunk-CYJERK24.js → chunk-IB2KM2Q7.js} +7 -7
  22. package/build/{chunk-CYJERK24.js.map → chunk-IB2KM2Q7.js.map} +1 -1
  23. package/build/{chunk-GCHPKOS2.js → chunk-K4IODCQP.js} +11 -3
  24. package/build/{chunk-GCHPKOS2.js.map → chunk-K4IODCQP.js.map} +1 -1
  25. package/build/{chunk-3BX4VLQC.js → chunk-KU4PN6UU.js} +3 -3
  26. package/build/{chunk-JYPZQDKR.js → chunk-OGO22IKX.js} +3 -3
  27. package/build/{chunk-DBASREIW.js → chunk-PGKXOCZN.js} +1079 -458
  28. package/build/chunk-PGKXOCZN.js.map +1 -0
  29. package/build/{chunk-3FL4P2SD.js → chunk-PS7R6MWD.js} +3 -3
  30. package/build/{chunk-S426UONM.js → chunk-QSLRE7OK.js} +2 -2
  31. package/build/{chunk-6GF7ZOLW.js → chunk-VARU4VGB.js} +9 -9
  32. package/build/{chunk-VV2OOBF3.js → chunk-WBXDIEUS.js} +2 -2
  33. package/build/{chunk-OPFPQV74.js → chunk-XDWVTYW3.js} +61 -4
  34. package/build/{chunk-OPFPQV74.js.map → chunk-XDWVTYW3.js.map} +1 -1
  35. package/build/cloudflare-runtime/entry.js +34 -10
  36. package/build/cloudflare-runtime/getRegisteredExtensions.js +34 -10
  37. package/build/index.js +26 -26
  38. package/build/platform-sdk/chunk-3WHQP2RD.js +2 -0
  39. package/build/platform-sdk/chunk-3WHQP2RD.js.map +1 -0
  40. package/build/platform-sdk/chunk-42XIZ4MH.js +2 -0
  41. package/build/platform-sdk/chunk-42XIZ4MH.js.map +1 -0
  42. package/build/platform-sdk/chunk-MQEY2AKT.js +2 -0
  43. package/build/platform-sdk/chunk-MQEY2AKT.js.map +1 -0
  44. package/build/platform-sdk/dashboard.js +1 -1
  45. package/build/platform-sdk/editor.js +1 -1
  46. package/build/platform-sdk/sdk-context.js +1 -1
  47. package/build/platform-sdk/sdk-context.js.map +1 -1
  48. package/build/platform-sdk/site.js +1 -1
  49. package/build/{preview-XTPTMI6C.js → preview-CLBQELU3.js} +14 -14
  50. package/build/{release-MNTPIKSG.js → release-VZ2GWJE2.js} +16 -16
  51. package/build/{render-command-HQXTOVW5.js → render-command-OT7HQRPA.js} +6 -6
  52. package/build/src-MHMTXBSY.js +1120 -0
  53. package/build/src-MHMTXBSY.js.map +1 -0
  54. package/package.json +8 -7
  55. package/build/GenerateCommand-BXBYWPR6.js.map +0 -1
  56. package/build/PreviewCommand-IKMUVCVS.js +0 -20
  57. package/build/ReleaseCommand-ZZFTWS7J.js +0 -29
  58. package/build/chunk-DBASREIW.js.map +0 -1
  59. package/build/platform-sdk/chunk-6NLQHDP6.js +0 -2
  60. package/build/platform-sdk/chunk-6NLQHDP6.js.map +0 -1
  61. package/build/platform-sdk/chunk-BGEA2LRQ.js +0 -2
  62. package/build/platform-sdk/chunk-BGEA2LRQ.js.map +0 -1
  63. package/build/platform-sdk/chunk-BGTZ3RNN.js +0 -2
  64. package/build/platform-sdk/chunk-BGTZ3RNN.js.map +0 -1
  65. /package/build/{AddPermissionCommand-SFC44F4N.js.map → AddPermissionCommand-SXPAYSAF.js.map} +0 -0
  66. /package/build/{CreateVersionCommand-DMS7UHEW.js.map → CreateVersionCommand-CL7JTSHV.js.map} +0 -0
  67. /package/build/{DevCommand-IMACMU76.js.map → DevCommand-NKKM4UEH.js.map} +0 -0
  68. /package/build/{LogsCommand-DXPP2Y63.js.map → LogsCommand-NCV5AKYF.js.map} +0 -0
  69. /package/build/{PreviewCommand-IKMUVCVS.js.map → PreviewCommand-KCCZ4ECQ.js.map} +0 -0
  70. /package/build/{ReleaseCommand-ZZFTWS7J.js.map → ReleaseCommand-FJKPKE3Y.js.map} +0 -0
  71. /package/build/{ServeCommand-2ESXE2E2.js.map → ServeCommand-B4GJL65A.js.map} +0 -0
  72. /package/build/{build-5B2A76I7.js.map → build-VSYNDSED.js.map} +0 -0
  73. /package/build/{chunk-R3BD56LW.js.map → chunk-3GSDI3OJ.js.map} +0 -0
  74. /package/build/{chunk-D7ONS7OD.js.map → chunk-3LJH5WAS.js.map} +0 -0
  75. /package/build/{chunk-LNBDMMJU.js.map → chunk-5LGI6O3F.js.map} +0 -0
  76. /package/build/{chunk-ZVADFZDF.js.map → chunk-75BL4FR5.js.map} +0 -0
  77. /package/build/{chunk-32DDGTGH.js.map → chunk-FGCBIHDS.js.map} +0 -0
  78. /package/build/{chunk-RZHKF2FT.js.map → chunk-FTEVVMFS.js.map} +0 -0
  79. /package/build/{chunk-PJJ6F4A3.js.map → chunk-HR6CTO67.js.map} +0 -0
  80. /package/build/{chunk-42T5NHSS.js.map → chunk-I2PLZT4A.js.map} +0 -0
  81. /package/build/{chunk-3BX4VLQC.js.map → chunk-KU4PN6UU.js.map} +0 -0
  82. /package/build/{chunk-JYPZQDKR.js.map → chunk-OGO22IKX.js.map} +0 -0
  83. /package/build/{chunk-3FL4P2SD.js.map → chunk-PS7R6MWD.js.map} +0 -0
  84. /package/build/{chunk-S426UONM.js.map → chunk-QSLRE7OK.js.map} +0 -0
  85. /package/build/{chunk-6GF7ZOLW.js.map → chunk-VARU4VGB.js.map} +0 -0
  86. /package/build/{chunk-VV2OOBF3.js.map → chunk-WBXDIEUS.js.map} +0 -0
  87. /package/build/{preview-XTPTMI6C.js.map → preview-CLBQELU3.js.map} +0 -0
  88. /package/build/{release-MNTPIKSG.js.map → release-VZ2GWJE2.js.map} +0 -0
  89. /package/build/{render-command-HQXTOVW5.js.map → render-command-OT7HQRPA.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as N,b as q}from"./chunk-6NLQHDP6.js";import{a as K}from"./chunk-BGEA2LRQ.js";import"./chunk-BGTZ3RNN.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}import He,{useEffect as Le,useState as ge}from"react";function w(e){"@babel/helpers - typeof";return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(e)}function J(e,t){if(w(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(w(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function G(e){var t=J(e,"string");return w(t)=="symbol"?t:t+""}function Q(e,t,n){return(t=G(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=class extends Error{constructor(t){let{message:n,code:r}=t;super(n),Q(this,"code",void 0),this.message=n,this.code=r}};var $=()=>{let e=u=>{let{channel:o}=u;return function(){let f=o.showToast(...arguments);return{remove:()=>Promise.resolve(f).then(h=>h.remove())}}},t=u=>{let{channel:o}=u;return function(){let f=o.observeState(...arguments);return{disconnect:()=>Promise.resolve(f).then(h=>h.disconnect())}}};return{showToast:e,observeState:t,navigate:u=>{let{channel:o}=u;return function(){return o.navigate(...arguments)}},navigateBack:u=>{let{channel:o}=u;return()=>o.navigateBack()},openModal:u=>{let{channel:o}=u;return(f,g)=>{let[h,A]=typeof f=="string"?[f,g]:[f.modalId,f.params],E=o.openModal(h,A);return{modalClosed:Promise.resolve(E).then(y=>y.modalClosed)}}},closeModal:u=>{let{channel:o}=u;return f=>{if(f===void 0)return o.closeModal();let g=JSON.parse(JSON.stringify(f));return o.closeModal(g)}},getAccessToken:u=>{let{channel:o}=u;return()=>o.getAccessToken()},getPageUrl:u=>{let{channel:o}=u;return function(){return o.getPageUrl(...arguments)}},openMediaManager:u=>{let{channel:o}=u;return function(){return o.openMediaManager(...arguments)}},addSitePlugin:u=>{let{channel:o}=u;return(f,g)=>{let h="802c76e4-b381-4bb3-9152-96acabbf3194",A=g?.placement||{},E=o.openModal(h,{...A,pluginId:f,action:"populate"});return Promise.resolve(E).then(y=>y.modalClosed).then(y=>{if(y?.type===void 0)throw new S({message:"Aborted by user",code:3006});if(y?.type==="ERROR")throw new S(y.data.error)})}},onBeforeUnload:u=>{let{channel:o}=u;return function(){return o.onBeforeUnload(...arguments)}},setPageTitle:u=>{let{channel:o}=u;return f=>o.setPageTitle(f)},getLanguage:u=>{let o=null;return async()=>{var f;if(o)return o;let g=null;return o=await new Promise(h=>{g=t(u)((A,E)=>{h(E.language)})}),(f=g)==null||f.disconnect(),o}},requestFeedback:u=>{let{channel:o}=u;return function(){return o.requestFeedback(...arguments)}},onLayerStateChange:u=>{let{channel:o}=u;return function(){let f=o.onLayerStateChange(...arguments);return{remove:()=>Promise.resolve(f).then(h=>h.remove())}}},installApp:u=>{let{channel:o}=u;return o.installApp},getWidget:u=>{let{channel:o}=u;return function(){if("getWidget"in o)return o.getWidget(...arguments);throw new Error("Unsupported")}},getDashboardPlugins:u=>{let{channel:o}=u;return function(){if("getDashboardPlugins"in o)return o.getDashboardPlugins(...arguments);throw new Error("Unsupported")}},getDashboardMenuPlugins:u=>{let{channel:o}=u;return function(){if("getDashboardMenuPlugins"in o)return o.getDashboardMenuPlugins(...arguments);throw new Error("Unsupported")}}}};var X=e=>{let{createHost:t}=e,n=$();return{...N(n),host:t,auth:()=>({getAuthHeaders:async r=>({headers:{Authorization:await n.getAccessToken(r)()}})})}};var Z=Symbol("Comlink.proxy"),ye=Symbol("Comlink.endpoint"),D=Symbol("Comlink.releaseProxy"),L=Symbol("Comlink.thrown"),ee=e=>typeof e=="object"&&e!==null||typeof e=="function",be={canHandle:e=>ee(e)&&e[Z],serialize(e){let{port1:t,port2:n}=new MessageChannel;return _(e,t),[n,[n]]},deserialize(e){return e.start(),B(e)}},we={canHandle:e=>ee(e)&&L in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},te=new Map([["proxy",be],["throw",we]]);function _(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;let{id:s,type:a,path:c}=Object.assign({path:[]},r.data),i=(r.data.argumentList||[]).map(P),l;try{let d=c.slice(0,-1).reduce((m,b)=>m[b],e),p=c.reduce((m,b)=>m[b],e);switch(a){case 0:l=p;break;case 1:d[c.slice(-1)[0]]=P(r.data.value),l=!0;break;case 2:l=p.apply(d,i);break;case 3:{let m=new p(...i);l=k(m)}break;case 4:{let{port1:m,port2:b}=new MessageChannel;_(e,b),l=ve(m,[m])}break;case 5:l=void 0;break}}catch(d){l={value:d,[L]:0}}Promise.resolve(l).catch(d=>({value:d,[L]:0})).then(d=>{let[p,m]=W(d);t.postMessage(Object.assign(Object.assign({},p),{id:s}),m),a===5&&(t.removeEventListener("message",n),ne(t))})}),t.start&&t.start()}function Pe(e){return e.constructor.name==="MessagePort"}function ne(e){Pe(e)&&e.close()}function B(e,t){return R(e,[],t)}function C(e){if(e)throw new Error("Proxy has been released and is not useable")}function R(e,t=[],n=function(){}){let r=!1,s=new Proxy(n,{get(a,c){if(C(r),c===D)return()=>v(e,{type:5,path:t.map(i=>i.toString())}).then(()=>{ne(e),r=!0});if(c==="then"){if(t.length===0)return{then:()=>s};let i=v(e,{type:0,path:t.map(l=>l.toString())}).then(P);return i.then.bind(i)}return R(e,[...t,c])},set(a,c,i){C(r);let[l,d]=W(i);return v(e,{type:1,path:[...t,c].map(p=>p.toString()),value:l},d).then(P)},apply(a,c,i){C(r);let l=t[t.length-1];if(l===ye)return v(e,{type:4}).then(P);if(l==="bind")return R(e,t.slice(0,-1));let[d,p]=Y(i);return v(e,{type:2,path:t.map(m=>m.toString()),argumentList:d},p).then(P)},construct(a,c){C(r);let[i,l]=Y(c);return v(e,{type:3,path:t.map(d=>d.toString()),argumentList:i},l).then(P)}});return s}function xe(e){return Array.prototype.concat.apply([],e)}function Y(e){let t=e.map(W);return[t.map(n=>n[0]),xe(t.map(n=>n[1]))]}var re=new WeakMap;function ve(e,t){return re.set(e,t),e}function k(e){return Object.assign(e,{[Z]:!0})}function W(e){for(let[t,n]of te)if(n.canHandle(e)){let[r,s]=n.serialize(e);return[{type:3,name:t,value:r},s]}return[{type:0,value:e},re.get(e)||[]]}function P(e){switch(e.type){case 3:return te.get(e.name).deserialize(e.value);case 0:return e.value}}function v(e,t,n){return new Promise(r=>{let s=Me();e.addEventListener("message",function a(c){!c.data||!c.data.id||c.data.id!==s||(e.removeEventListener("message",a),r(c.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),n)})}function Me(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var T="__proxyCallbackId__wixSDK__",I="__proxyPromiseId__wixSDK__",se=e=>Se(e,t=>async function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];let[a,c]=j(r),i=await t(k(a),c);return ae(i)});var Ee=async e=>{let[t,n]=j(await e);return k({proxies:t,clonables:n})},ae=async e=>H(e?.proxies,await e?.clonables),j=e=>{let t=(s,a)=>{if(ie(a)){let c=oe();return s.promises[c]=a,{[I]:c}}if(ke(a)){let c=oe();return s.callbacks[c]=(i,l)=>{let d=H(i,l),p=a(...d);return Ee(p)},{[T]:c}}return Array.isArray(a)?a.map(c=>t(s,c)):O(a)?ce(a,c=>t(s,c)):a},n={promises:{},callbacks:{}},r=t(n,e);return[n,r]},H=(e,t)=>{if(Array.isArray(t))return t.map(n=>H(e,n));if(O(t)&&t.hasOwnProperty(I)){let n=t[I];return e.promises[n]}if(O(t)&&t.hasOwnProperty(T)){let n=t[T];return async function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];let[c,i]=j(s),l=await e.callbacks[n](k(c),i);return ae(l)}}return O(t)?ce(t,n=>H(e,n)):t},Se=(e,t)=>new Proxy(e,{get(n,r){return n[r]?t(n[r]):()=>{throw new Error(`Serialization error occurred while accessing ${r} property of ${n}`)}}}),ie=e=>e instanceof Promise,O=e=>e&&typeof e=="object"&&!ie(e),ke=e=>typeof e=="function",ce=(e,t)=>{let n=r=>{let[s,a]=r;return[s,t(a)]};return Object.fromEntries(Object.entries(e).map(n))},oe=(()=>{let e=0;return()=>++e})();var Ae="wix-sdk-bo-hello-handshake",ue=e=>{let{postMessage:t,origin:n}=e,{port1:r,port2:s}=new MessageChannel;t({code:Ae,version:"1.0.0",port:s},n,[s]);let i=se(B(r));return{channel:i,close:()=>i[D]()}};var le=(e,t)=>{let n=()=>e.updateHeight(t.offsetHeight),r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()};var Ue=["https://manage.wix.com","https://manage.editorx.com"],Ce=new Set(Ue),de=e=>Ce.has(e);var fe=e=>{let t=new EventTarget,n=typeof window>"u",r=i=>{t.dispatchEvent(new CustomEvent("beforeunload",{cancelable:!0}))||(i.preventDefault(),i.returnValue=!0)},s=e.onBeforeUnload(r),a=()=>{n||window.removeEventListener("beforeunload",r),s.then(i=>{let{remove:l}=i;return l()})};return n||(window.addEventListener("beforeunload",r),window.addEventListener("unload",a)),{onBeforeUnload:i=>(t.addEventListener("beforeunload",i),{remove:()=>{t.removeEventListener("beforeunload",i)}}),clearBeforeUnloadHandler:a}};function Oe(e){if(e)try{return JSON.parse(decodeURIComponent(e))}catch(t){console.warn('Failed to parse "essentials" query parameter. Make sure to run the code inside a supported Wix App extension.',t);return}}function me(e){return e.has("essentials")?Oe(e.get("essentials")):void 0}var pe=function(e){e===void 0&&(e={});let t=e.fullUrl&&new URL(e.fullUrl).search||typeof window<"u"&&window.location.search||"",n=new URLSearchParams(t),r=e.origin||n.get("origin")||"",s=e.postMessage||window.parent.postMessage.bind(window.parent);if(!de(r))throw new Error("Wix Dashboard SDK: Unable to establish a connection with the Wix dashboard. Please ensure that you are running your app within the Wix dashboard.");let{channel:a,close:c}=ue({postMessage:s,origin:r}),i=[c];if(e.autoHeightUpdate===void 0||e.autoHeightUpdate){let x=e.autoHeightElement||document.documentElement,M=le(a,x);i.push(()=>M())}let{onBeforeUnload:l,clearBeforeUnloadHandler:d}=fe(a);i.push(d);let p=new Proxy(a,{get(x,M,F){return M==="onBeforeUnload"?l:Reflect.get(x,M,F)}}),{monitoring:m,...b}=me(n)||{},V=q({hostContext:m?.context,monitoringConfig:m?.config,sentrySDK:typeof window<"u"?window.Sentry:void 0});return{channel:p,close:()=>i.forEach(x=>x()),getMonitoringClient:V,essentials:b}};var z=X({createHost:pe});var he=(e,t)=>{let[n,r]=ge(()=>e());return t(n)&&r(e()),n},Re=e=>t=>{let{host:n,compProps:r}=De(t);return he(()=>(K({auth:z.auth(),host:n}).enableContext("module"),n),s=>s!==n),r?He.createElement(e,U({host:n},r)):null},De=e=>{let{host:t,...n}=e,{host:r,hostType:s}=he(()=>t?{host:t,hostType:"local"}:{host:z.host(),hostType:"remote"},i=>!!t&&t!==i.host),[a,c]=ge(void 0);return Le(()=>{if(s==="local")return;let i=r.channel.observeState(d=>{c(d||{})}),l=async()=>{(await i).disconnect(),r.close()};return()=>{l()}},[r,s]),s==="local"?{host:r,compProps:n}:{host:r,compProps:a?{...a,...n}:void 0}};export{Re as withContextualWixClient};
1
+ import{a as N,b as q}from"./chunk-MQEY2AKT.js";import{a as K}from"./chunk-3WHQP2RD.js";import"./chunk-42XIZ4MH.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}import He,{useEffect as Le,useState as ge}from"react";function w(e){"@babel/helpers - typeof";return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(e)}function J(e,t){if(w(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(w(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function G(e){var t=J(e,"string");return w(t)=="symbol"?t:t+""}function Q(e,t,n){return(t=G(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=class extends Error{constructor(t){let{message:n,code:r}=t;super(n),Q(this,"code",void 0),this.message=n,this.code=r}};var $=()=>{let e=u=>{let{channel:o}=u;return function(){let f=o.showToast(...arguments);return{remove:()=>Promise.resolve(f).then(h=>h.remove())}}},t=u=>{let{channel:o}=u;return function(){let f=o.observeState(...arguments);return{disconnect:()=>Promise.resolve(f).then(h=>h.disconnect())}}};return{showToast:e,observeState:t,navigate:u=>{let{channel:o}=u;return function(){return o.navigate(...arguments)}},navigateBack:u=>{let{channel:o}=u;return()=>o.navigateBack()},openModal:u=>{let{channel:o}=u;return(f,g)=>{let[h,A]=typeof f=="string"?[f,g]:[f.modalId,f.params],E=o.openModal(h,A);return{modalClosed:Promise.resolve(E).then(y=>y.modalClosed)}}},closeModal:u=>{let{channel:o}=u;return f=>{if(f===void 0)return o.closeModal();let g=JSON.parse(JSON.stringify(f));return o.closeModal(g)}},getAccessToken:u=>{let{channel:o}=u;return()=>o.getAccessToken()},getPageUrl:u=>{let{channel:o}=u;return function(){return o.getPageUrl(...arguments)}},openMediaManager:u=>{let{channel:o}=u;return function(){return o.openMediaManager(...arguments)}},addSitePlugin:u=>{let{channel:o}=u;return(f,g)=>{let h="802c76e4-b381-4bb3-9152-96acabbf3194",A=g?.placement||{},E=o.openModal(h,{...A,pluginId:f,action:"populate"});return Promise.resolve(E).then(y=>y.modalClosed).then(y=>{if(y?.type===void 0)throw new S({message:"Aborted by user",code:3006});if(y?.type==="ERROR")throw new S(y.data.error)})}},onBeforeUnload:u=>{let{channel:o}=u;return function(){return o.onBeforeUnload(...arguments)}},setPageTitle:u=>{let{channel:o}=u;return f=>o.setPageTitle(f)},getLanguage:u=>{let o=null;return async()=>{var f;if(o)return o;let g=null;return o=await new Promise(h=>{g=t(u)((A,E)=>{h(E.language)})}),(f=g)==null||f.disconnect(),o}},requestFeedback:u=>{let{channel:o}=u;return function(){return o.requestFeedback(...arguments)}},onLayerStateChange:u=>{let{channel:o}=u;return function(){let f=o.onLayerStateChange(...arguments);return{remove:()=>Promise.resolve(f).then(h=>h.remove())}}},installApp:u=>{let{channel:o}=u;return o.installApp},getWidget:u=>{let{channel:o}=u;return function(){if("getWidget"in o)return o.getWidget(...arguments);throw new Error("Unsupported")}},getDashboardPlugins:u=>{let{channel:o}=u;return function(){if("getDashboardPlugins"in o)return o.getDashboardPlugins(...arguments);throw new Error("Unsupported")}},getDashboardMenuPlugins:u=>{let{channel:o}=u;return function(){if("getDashboardMenuPlugins"in o)return o.getDashboardMenuPlugins(...arguments);throw new Error("Unsupported")}}}};var X=e=>{let{createHost:t}=e,n=$();return{...N(n),host:t,auth:()=>({getAuthHeaders:async r=>({headers:{Authorization:await n.getAccessToken(r)()}})})}};var Z=Symbol("Comlink.proxy"),ye=Symbol("Comlink.endpoint"),D=Symbol("Comlink.releaseProxy"),L=Symbol("Comlink.thrown"),ee=e=>typeof e=="object"&&e!==null||typeof e=="function",be={canHandle:e=>ee(e)&&e[Z],serialize(e){let{port1:t,port2:n}=new MessageChannel;return _(e,t),[n,[n]]},deserialize(e){return e.start(),B(e)}},we={canHandle:e=>ee(e)&&L in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},te=new Map([["proxy",be],["throw",we]]);function _(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;let{id:s,type:a,path:c}=Object.assign({path:[]},r.data),i=(r.data.argumentList||[]).map(P),l;try{let d=c.slice(0,-1).reduce((m,b)=>m[b],e),p=c.reduce((m,b)=>m[b],e);switch(a){case 0:l=p;break;case 1:d[c.slice(-1)[0]]=P(r.data.value),l=!0;break;case 2:l=p.apply(d,i);break;case 3:{let m=new p(...i);l=k(m)}break;case 4:{let{port1:m,port2:b}=new MessageChannel;_(e,b),l=ve(m,[m])}break;case 5:l=void 0;break}}catch(d){l={value:d,[L]:0}}Promise.resolve(l).catch(d=>({value:d,[L]:0})).then(d=>{let[p,m]=W(d);t.postMessage(Object.assign(Object.assign({},p),{id:s}),m),a===5&&(t.removeEventListener("message",n),ne(t))})}),t.start&&t.start()}function Pe(e){return e.constructor.name==="MessagePort"}function ne(e){Pe(e)&&e.close()}function B(e,t){return R(e,[],t)}function C(e){if(e)throw new Error("Proxy has been released and is not useable")}function R(e,t=[],n=function(){}){let r=!1,s=new Proxy(n,{get(a,c){if(C(r),c===D)return()=>v(e,{type:5,path:t.map(i=>i.toString())}).then(()=>{ne(e),r=!0});if(c==="then"){if(t.length===0)return{then:()=>s};let i=v(e,{type:0,path:t.map(l=>l.toString())}).then(P);return i.then.bind(i)}return R(e,[...t,c])},set(a,c,i){C(r);let[l,d]=W(i);return v(e,{type:1,path:[...t,c].map(p=>p.toString()),value:l},d).then(P)},apply(a,c,i){C(r);let l=t[t.length-1];if(l===ye)return v(e,{type:4}).then(P);if(l==="bind")return R(e,t.slice(0,-1));let[d,p]=Y(i);return v(e,{type:2,path:t.map(m=>m.toString()),argumentList:d},p).then(P)},construct(a,c){C(r);let[i,l]=Y(c);return v(e,{type:3,path:t.map(d=>d.toString()),argumentList:i},l).then(P)}});return s}function xe(e){return Array.prototype.concat.apply([],e)}function Y(e){let t=e.map(W);return[t.map(n=>n[0]),xe(t.map(n=>n[1]))]}var re=new WeakMap;function ve(e,t){return re.set(e,t),e}function k(e){return Object.assign(e,{[Z]:!0})}function W(e){for(let[t,n]of te)if(n.canHandle(e)){let[r,s]=n.serialize(e);return[{type:3,name:t,value:r},s]}return[{type:0,value:e},re.get(e)||[]]}function P(e){switch(e.type){case 3:return te.get(e.name).deserialize(e.value);case 0:return e.value}}function v(e,t,n){return new Promise(r=>{let s=Me();e.addEventListener("message",function a(c){!c.data||!c.data.id||c.data.id!==s||(e.removeEventListener("message",a),r(c.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),n)})}function Me(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var T="__proxyCallbackId__wixSDK__",I="__proxyPromiseId__wixSDK__",se=e=>Se(e,t=>async function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];let[a,c]=j(r),i=await t(k(a),c);return ae(i)});var Ee=async e=>{let[t,n]=j(await e);return k({proxies:t,clonables:n})},ae=async e=>H(e?.proxies,await e?.clonables),j=e=>{let t=(s,a)=>{if(ie(a)){let c=oe();return s.promises[c]=a,{[I]:c}}if(ke(a)){let c=oe();return s.callbacks[c]=(i,l)=>{let d=H(i,l),p=a(...d);return Ee(p)},{[T]:c}}return Array.isArray(a)?a.map(c=>t(s,c)):O(a)?ce(a,c=>t(s,c)):a},n={promises:{},callbacks:{}},r=t(n,e);return[n,r]},H=(e,t)=>{if(Array.isArray(t))return t.map(n=>H(e,n));if(O(t)&&t.hasOwnProperty(I)){let n=t[I];return e.promises[n]}if(O(t)&&t.hasOwnProperty(T)){let n=t[T];return async function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];let[c,i]=j(s),l=await e.callbacks[n](k(c),i);return ae(l)}}return O(t)?ce(t,n=>H(e,n)):t},Se=(e,t)=>new Proxy(e,{get(n,r){return n[r]?t(n[r]):()=>{throw new Error(`Serialization error occurred while accessing ${r} property of ${n}`)}}}),ie=e=>e instanceof Promise,O=e=>e&&typeof e=="object"&&!ie(e),ke=e=>typeof e=="function",ce=(e,t)=>{let n=r=>{let[s,a]=r;return[s,t(a)]};return Object.fromEntries(Object.entries(e).map(n))},oe=(()=>{let e=0;return()=>++e})();var Ae="wix-sdk-bo-hello-handshake",ue=e=>{let{postMessage:t,origin:n}=e,{port1:r,port2:s}=new MessageChannel;t({code:Ae,version:"1.0.0",port:s},n,[s]);let i=se(B(r));return{channel:i,close:()=>i[D]()}};var le=(e,t)=>{let n=()=>e.updateHeight(t.offsetHeight),r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()};var Ue=["https://manage.wix.com","https://manage.editorx.com"],Ce=new Set(Ue),de=e=>Ce.has(e);var fe=e=>{let t=new EventTarget,n=typeof window>"u",r=i=>{t.dispatchEvent(new CustomEvent("beforeunload",{cancelable:!0}))||(i.preventDefault(),i.returnValue=!0)},s=e.onBeforeUnload(r),a=()=>{n||window.removeEventListener("beforeunload",r),s.then(i=>{let{remove:l}=i;return l()})};return n||(window.addEventListener("beforeunload",r),window.addEventListener("unload",a)),{onBeforeUnload:i=>(t.addEventListener("beforeunload",i),{remove:()=>{t.removeEventListener("beforeunload",i)}}),clearBeforeUnloadHandler:a}};function Oe(e){if(e)try{return JSON.parse(decodeURIComponent(e))}catch(t){console.warn('Failed to parse "essentials" query parameter. Make sure to run the code inside a supported Wix App extension.',t);return}}function me(e){return e.has("essentials")?Oe(e.get("essentials")):void 0}var pe=function(e){e===void 0&&(e={});let t=e.fullUrl&&new URL(e.fullUrl).search||typeof window<"u"&&window.location.search||"",n=new URLSearchParams(t),r=e.origin||n.get("origin")||"",s=e.postMessage||window.parent.postMessage.bind(window.parent);if(!de(r))throw new Error("Wix Dashboard SDK: Unable to establish a connection with the Wix dashboard. Please ensure that you are running your app within the Wix dashboard.");let{channel:a,close:c}=ue({postMessage:s,origin:r}),i=[c];if(e.autoHeightUpdate===void 0||e.autoHeightUpdate){let x=e.autoHeightElement||document.documentElement,M=le(a,x);i.push(()=>M())}let{onBeforeUnload:l,clearBeforeUnloadHandler:d}=fe(a);i.push(d);let p=new Proxy(a,{get(x,M,F){return M==="onBeforeUnload"?l:Reflect.get(x,M,F)}}),{monitoring:m,...b}=me(n)||{},V=q({hostContext:m?.context,monitoringConfig:m?.config,sentrySDK:typeof window<"u"?window.Sentry:void 0});return{channel:p,close:()=>i.forEach(x=>x()),getMonitoringClient:V,essentials:b}};var z=X({createHost:pe});var he=(e,t)=>{let[n,r]=ge(()=>e());return t(n)&&r(e()),n},Re=e=>t=>{let{host:n,compProps:r}=De(t);return he(()=>(K({auth:z.auth(),host:n}).enableContext("module"),n),s=>s!==n),r?He.createElement(e,U({host:n},r)):null},De=e=>{let{host:t,...n}=e,{host:r,hostType:s}=he(()=>t?{host:t,hostType:"local"}:{host:z.host(),hostType:"remote"},i=>!!t&&t!==i.host),[a,c]=ge(void 0);return Le(()=>{if(s==="local")return;let i=r.channel.observeState(d=>{c(d||{})}),l=async()=>{(await i).disconnect(),r.close()};return()=>{l()}},[r,s]),s==="local"?{host:r,compProps:n}:{host:r,compProps:a?{...a,...n}:void 0}};export{Re as withContextualWixClient};
2
2
  //# sourceMappingURL=dashboard.js.map
@@ -1,4 +1,4 @@
1
- import{a as ve,b as Ee}from"./chunk-6NLQHDP6.js";import{a as we}from"./chunk-BGEA2LRQ.js";import"./chunk-BGTZ3RNN.js";import{c as Xe,d as Qe}from"./chunk-7EYXEF6M.js";import{b as ge,d as Ie,e as He,f as p,g as a,h as l,i as w,j as u}from"./chunk-SBZEOPXX.js";var Te=ge(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.EventType=void 0;var be;(function(n){n.removeAppCompleted="removeAppCompleted",n.componentSelectionChanged="componentSelectionChanged",n.appInstalled="appInstalled",n.appUpdateCompleted="appUpdateCompleted"})(be||(pt.EventType=be={}))});var kt=ge(A=>{"use strict";var Ze=A&&A.__createBinding||(Object.create?function(n,t,e,i){i===void 0&&(i=e);var s=Object.getOwnPropertyDescriptor(t,e);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,i,s)}:function(n,t,e,i){i===void 0&&(i=e),n[i]=t[e]}),tn=A&&A.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),en=A&&A.__importStar||function(){var n=function(t){return n=Object.getOwnPropertyNames||function(e){var i=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[i.length]=s);return i},n(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i=n(t),s=0;s<i.length;s++)i[s]!=="default"&&Ze(e,t,i[s]);return tn(e,t),e}}();Object.defineProperty(A,"__esModule",{value:!0});A.EventType=A.WixSDKTypes=void 0;var nn=en((Qe(),He(Xe)));A.WixSDKTypes=nn;var sn=Te();Object.defineProperty(A,"EventType",{enumerable:!0,get:function(){return sn.EventType}})});var V=Ie(kt(),1);var D=class D{constructor(){p(this,"uid",0);p(this,"callbacks",new Map);p(this,"inTransaction",!1);p(this,"isSilent",!1);p(this,"queue",[])}silent(t=!0){this.isSilent=t}startTransaction(){this.inTransaction=!0}commit(){this.inTransaction=!1;let t=this.queue;this.queue=[],this.isSilent||t.forEach(e=>{this.notify(e)})}notify(t){this.isSilent||(this.inTransaction?this.queue.push(t):this.callbacks.forEach(e=>{e(t)}))}subscribe(t){let e=this.uid++;return this.callbacks.set(e,t),()=>{this.callbacks.delete(e)}}notifyWithStep(t,e){this.notify({...t,meta:{...t.meta,step:e}})}async withEvent(t,e){let i=e();if(i&&i.hasOwnProperty("then"))try{return this.notifyWithStep(t,D.EventSteps.Start),i=await i,this.notifyWithStep(t,D.EventSteps.End),i}catch(s){throw this.notifyWithStep({...t,meta:{...t.meta,error:s}},D.EventSteps.Error),s}else return this.notify(t),i}};p(D,"biEvents",{PLATFORM_WORKER_SPAWN:123,PLATFORM_APP_RUNNER_INIT_APP_API:124,PLATFORM_APP_RUNNER_RUN_APP:125,PLATFORM_APP_RUNNER_REMOVE_APP:126,PLATFORM_WORKER_APP_BUNDLE_LOAD:127,PLATFORM_WORKER_APP_BUNDLE_EXECUTE:128,PLATFORM_IFRAME_INIT:129,PLATFORM_APP_API_INIT:130,PLATFORM_APP_API_GET:131}),p(D,"EventSteps",{Start:"start",End:"end",Error:"error"});var Lt=D,ht=(n=>(n.WorkerSpawn="WorkerSpawn",n.HostEvent="HostEvent",n.ApplicationsSpecsReceived="ApplicationsSpecsReceived",n.InitApplicationApi="InitApplicationApi",n.RunApplication="RunApplication",n.getApplicationApi="getApplicationApi",n.IframeInit="IframeInit",n))(ht||{}),Ut=(n=>(n.EditorReady="EditorReady",n))(Ut||{});var v=(n=>(n.ApplicationInit="ApplicationInit",n.ApplicationExecute="ApplicationExecute",n.ApplicationRemoved="ApplicationRemoved",n.ApplicationLoad="ApplicationLoad",n.ApplicationApiInit="ApplicationApiInit",n.CustomEvent="CustomEvent",n.HostEvent="HostEvent",n.EditorReady="EditorReady",n))(v||{}),jt=class{createApplicationRemovedEvent(t){return{type:"ApplicationRemoved",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_SPAWN,appDefId:t}}}}createApplicationLoadEvent(t,e){return{type:"ApplicationLoad",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_LOAD,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationExecuteEvent(t,e){return{type:"ApplicationExecute",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_EXECUTE,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationApiInitEvent(t,e){return{type:"ApplicationApiInit",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_APP_API_INIT,appDefId:t,scope:e}}}}},E=class extends Lt{constructor(){super(...arguments);p(this,"factories",new jt)}},lt=class lt{constructor(t){this.events=t}mapToPlatformHostEvent(t){if(typeof t=="string")try{t=JSON.parse(t)}catch{}return{type:ht.HostEvent,payload:{type:t.args.eventType,...t.args.eventPayload},meta:{appDefinitionId:t.appDefinitionId??null,intent:t.intent}}}notify(t){let e=this.mapToPlatformHostEvent(t);lt.allowedEvents.includes(e.payload.type)&&this.events.notify(e)}};p(lt,"allowedEvents",[V.EventType.componentSelectionChanged,V.EventType.appInstalled,V.EventType.appUpdateCompleted,V.EventType.removeAppCompleted]);var xe=lt;var g=class n extends Error{constructor(e,i,s){let r=e?` ${e}`:"",o=`[${s}]#${i}`;super(`${o}.${r}`);p(this,"state",{});p(this,"displayName");p(this,"prefix");p(this,"errorMessage");p(this,"parent");p(this,"messages",[]);p(this,"code");this.displayName=o,this.errorMessage=e,this.prefix=s,this.code=i,this.name=o,Object.defineProperty(this,"message",{get:()=>this.getDisplayMessage()}),Error.captureStackTrace&&Error.captureStackTrace(this,n)}get parentError(){let e=this.parent;if(!e)return null;if(this.parent instanceof n)return this.parent;let i=e.name??"[Unknown Error]";return{getBreadcrumbs(){return[i]},getMessage(){return[i,e.message??"unknown error message"].join(`
1
+ import{a as ve,b as Ee}from"./chunk-MQEY2AKT.js";import{a as we}from"./chunk-3WHQP2RD.js";import"./chunk-42XIZ4MH.js";import{c as Xe,d as Qe}from"./chunk-7EYXEF6M.js";import{b as ge,d as Ie,e as He,f as p,g as a,h as l,i as w,j as u}from"./chunk-SBZEOPXX.js";var Te=ge(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.EventType=void 0;var be;(function(n){n.removeAppCompleted="removeAppCompleted",n.componentSelectionChanged="componentSelectionChanged",n.appInstalled="appInstalled",n.appUpdateCompleted="appUpdateCompleted"})(be||(pt.EventType=be={}))});var kt=ge(A=>{"use strict";var Ze=A&&A.__createBinding||(Object.create?function(n,t,e,i){i===void 0&&(i=e);var s=Object.getOwnPropertyDescriptor(t,e);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,i,s)}:function(n,t,e,i){i===void 0&&(i=e),n[i]=t[e]}),tn=A&&A.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),en=A&&A.__importStar||function(){var n=function(t){return n=Object.getOwnPropertyNames||function(e){var i=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[i.length]=s);return i},n(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i=n(t),s=0;s<i.length;s++)i[s]!=="default"&&Ze(e,t,i[s]);return tn(e,t),e}}();Object.defineProperty(A,"__esModule",{value:!0});A.EventType=A.WixSDKTypes=void 0;var nn=en((Qe(),He(Xe)));A.WixSDKTypes=nn;var sn=Te();Object.defineProperty(A,"EventType",{enumerable:!0,get:function(){return sn.EventType}})});var V=Ie(kt(),1);var D=class D{constructor(){p(this,"uid",0);p(this,"callbacks",new Map);p(this,"inTransaction",!1);p(this,"isSilent",!1);p(this,"queue",[])}silent(t=!0){this.isSilent=t}startTransaction(){this.inTransaction=!0}commit(){this.inTransaction=!1;let t=this.queue;this.queue=[],this.isSilent||t.forEach(e=>{this.notify(e)})}notify(t){this.isSilent||(this.inTransaction?this.queue.push(t):this.callbacks.forEach(e=>{e(t)}))}subscribe(t){let e=this.uid++;return this.callbacks.set(e,t),()=>{this.callbacks.delete(e)}}notifyWithStep(t,e){this.notify({...t,meta:{...t.meta,step:e}})}async withEvent(t,e){let i=e();if(i&&i.hasOwnProperty("then"))try{return this.notifyWithStep(t,D.EventSteps.Start),i=await i,this.notifyWithStep(t,D.EventSteps.End),i}catch(s){throw this.notifyWithStep({...t,meta:{...t.meta,error:s}},D.EventSteps.Error),s}else return this.notify(t),i}};p(D,"biEvents",{PLATFORM_WORKER_SPAWN:123,PLATFORM_APP_RUNNER_INIT_APP_API:124,PLATFORM_APP_RUNNER_RUN_APP:125,PLATFORM_APP_RUNNER_REMOVE_APP:126,PLATFORM_WORKER_APP_BUNDLE_LOAD:127,PLATFORM_WORKER_APP_BUNDLE_EXECUTE:128,PLATFORM_IFRAME_INIT:129,PLATFORM_APP_API_INIT:130,PLATFORM_APP_API_GET:131}),p(D,"EventSteps",{Start:"start",End:"end",Error:"error"});var Lt=D,ht=(n=>(n.WorkerSpawn="WorkerSpawn",n.HostEvent="HostEvent",n.ApplicationsSpecsReceived="ApplicationsSpecsReceived",n.InitApplicationApi="InitApplicationApi",n.RunApplication="RunApplication",n.getApplicationApi="getApplicationApi",n.IframeInit="IframeInit",n))(ht||{}),Ut=(n=>(n.EditorReady="EditorReady",n))(Ut||{});var v=(n=>(n.ApplicationInit="ApplicationInit",n.ApplicationExecute="ApplicationExecute",n.ApplicationRemoved="ApplicationRemoved",n.ApplicationLoad="ApplicationLoad",n.ApplicationApiInit="ApplicationApiInit",n.CustomEvent="CustomEvent",n.HostEvent="HostEvent",n.EditorReady="EditorReady",n))(v||{}),jt=class{createApplicationRemovedEvent(t){return{type:"ApplicationRemoved",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_SPAWN,appDefId:t}}}}createApplicationLoadEvent(t,e){return{type:"ApplicationLoad",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_LOAD,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationExecuteEvent(t,e){return{type:"ApplicationExecute",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_EXECUTE,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationApiInitEvent(t,e){return{type:"ApplicationApiInit",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_APP_API_INIT,appDefId:t,scope:e}}}}},E=class extends Lt{constructor(){super(...arguments);p(this,"factories",new jt)}},lt=class lt{constructor(t){this.events=t}mapToPlatformHostEvent(t){if(typeof t=="string")try{t=JSON.parse(t)}catch{}return{type:ht.HostEvent,payload:{type:t.args.eventType,...t.args.eventPayload},meta:{appDefinitionId:t.appDefinitionId??null,intent:t.intent}}}notify(t){let e=this.mapToPlatformHostEvent(t);lt.allowedEvents.includes(e.payload.type)&&this.events.notify(e)}};p(lt,"allowedEvents",[V.EventType.componentSelectionChanged,V.EventType.appInstalled,V.EventType.appUpdateCompleted,V.EventType.removeAppCompleted]);var xe=lt;var g=class n extends Error{constructor(e,i,s){let r=e?` ${e}`:"",o=`[${s}]#${i}`;super(`${o}.${r}`);p(this,"state",{});p(this,"displayName");p(this,"prefix");p(this,"errorMessage");p(this,"parent");p(this,"messages",[]);p(this,"code");this.displayName=o,this.errorMessage=e,this.prefix=s,this.code=i,this.name=o,Object.defineProperty(this,"message",{get:()=>this.getDisplayMessage()}),Error.captureStackTrace&&Error.captureStackTrace(this,n)}get parentError(){let e=this.parent;if(!e)return null;if(this.parent instanceof n)return this.parent;let i=e.name??"[Unknown Error]";return{getBreadcrumbs(){return[i]},getMessage(){return[i,e.message??"unknown error message"].join(`
2
2
  `)}}}getDisplayMessage(){return[(this.parentError?this.getBreadcrumbs():[]).join(" -> "),this.getMessage()].filter(i=>i.trim().length).join(`
3
3
  `)}getMessage(){let e=Object.entries(this.state).reduce((c,[h,d])=>(d&&c.push(` \u2013 ${h}: ${d}`),c),[]).join(`
4
4
  `),i=this.messages.reduce((c,h)=>(c.push(` - ${h.join(" ")}`),c),[]).join(`
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-BGTZ3RNN.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function o(e,t=!1){return n(e,t)}var i=["wix.com","editorx.com"];var _=new RegExp(`\\.(${i.join("|")})$`),s=["42.wixprod.net","uw2-edt-1.wixprod.net"],a="dev.wix-code.com";var u=new RegExp(`\\.(${s.join("|")})$`),p=new RegExp(`.*\\.${a}$`);import{wixContext as f}from"@wix/sdk-context";function r(e,t){t==="global"?globalThis.__wix_context__!=null?globalThis.__wix_context__.client=e:globalThis.__wix_context__={client:e}:f.client=e}var b=o(e=>(t,c)=>e.fetchWithAuth(t,c));export{r as enableContext};
1
+ import{b as n}from"./chunk-42XIZ4MH.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function o(e,t=!1){return n(e,t)}var i=["wix.com","editorx.com"];var _=new RegExp(`\\.(${i.join("|")})$`),s=["42.wixprod.net","uw2-edt-1.wixprod.net"],a="dev.wix-code.com";var u=new RegExp(`\\.(${s.join("|")})$`),p=new RegExp(`.*\\.${a}$`);import{wixContext as f}from"@wix/sdk-context";function r(e,t){t==="global"?globalThis.__wix_context__!=null?globalThis.__wix_context__.client=e:globalThis.__wix_context__={client:e}:f.client=e}var b=o(e=>(t,c)=>e.fetchWithAuth(t,c));export{r as enableContext};
2
2
  //# sourceMappingURL=sdk-context.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/rest-modules.js","../../../node_modules/@wix/sdk/build/enable-context.js","../../../node_modules/@wix/sdk/build/context.js"],"sourcesContent":["import { contextualizeRESTModuleV2 } from './context-v2.js';\nexport function createRESTModule(descriptor, elevated = false) {\n return contextualizeRESTModuleV2(descriptor, elevated);\n}\nexport function toURLSearchParams(params, isComplexRequest) {\n const flatten = flattenParams(params);\n const searchParams = Object.entries(flatten).reduce((urlSearchParams, [key, value]) => {\n // inorder to make `foo: [1,2]` turn into `foo=1&foo=2` and not `foo[]=1&foo[]=2`\n const keyParams = Array.isArray(value) ? value : [value];\n keyParams.forEach((param) => {\n if (param === undefined || param === null) {\n return;\n }\n urlSearchParams.append(key, param);\n });\n return urlSearchParams;\n }, new URLSearchParams());\n if (isComplexRequest) {\n searchParams.append('.r', base64Encode(JSON.stringify(params)));\n }\n return searchParams;\n}\nexport function resolveUrl(opts) {\n const domain = resolveDomain(opts.host);\n const mappings = resolveMappingsByDomain(domain, opts.domainToMappings);\n const path = injectDataIntoProtoPath(opts.protoPath, opts.data || {});\n return resolvePathFromMappings(path, mappings);\n}\nfunction flattenParams(data, path = '') {\n const params = {};\n Object.entries(data).forEach(([key, value]) => {\n const isObject = value !== null && typeof value === 'object' && !Array.isArray(value);\n const fieldPath = resolvePath(path, key);\n if (isObject) {\n const serializedObject = flattenParams(value, fieldPath);\n Object.assign(params, serializedObject);\n }\n else {\n params[fieldPath] = value;\n }\n });\n return params;\n}\nfunction resolvePath(path, key) {\n return `${path}${path ? '.' : ''}${key}`;\n}\nconst base64Encode = (value) => {\n const base64 = typeof btoa !== 'undefined'\n ? btoa(value)\n : Buffer.from(value, 'utf-8').toString('base64');\n return base64.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n};\nconst DOMAINS = ['wix.com', 'editorx.com'];\nconst USER_DOMAIN = '_';\nconst REGEX_CAPTURE_DOMAINS = new RegExp(`\\\\.(${DOMAINS.join('|')})$`);\nconst WIX_API_DOMAINS = ['42.wixprod.net', 'uw2-edt-1.wixprod.net'];\nconst DEV_WIX_CODE_DOMAIN = 'dev.wix-code.com';\nconst REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;\nconst REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\\\.(${WIX_API_DOMAINS.join('|')})$`);\nconst REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\\\.${DEV_WIX_CODE_DOMAIN}$`);\nfunction resolveDomain(host) {\n const resolvedHost = fixHostExceptions(host);\n return resolvedHost\n .replace(REGEX_CAPTURE_DOMAINS, '._base_domain_')\n .replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_')\n .replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, '*.dev.wix-code.com');\n}\n// hosts which standard string replacing doesn't apply to them, will be fixed here.\nfunction fixHostExceptions(host) {\n // https://system-kb.wixanswers.com/kb/en/article/editorx-domains-matching-to-wixcom\n return host.replace('create.editorx.com', 'editor.editorx.com');\n}\nfunction resolveMappingsByDomain(domain, domainToMappings) {\n const mappings = domainToMappings[domain] || domainToMappings[USER_DOMAIN];\n if (!mappings) {\n if (isBaseDomain(domain)) {\n // fallback <lang>.wix.com sub domains to www.wix.com\n // since all of the languages subdomain are not mapped automatically in FP and we want to support those kind of calls\n // for example: fr.wix.com\n return domainToMappings[wwwBaseDomain];\n }\n }\n return mappings;\n}\nfunction isBaseDomain(domain) {\n return !!domain.match(/\\._base_domain_$/);\n}\nconst wwwBaseDomain = 'www._base_domain_';\nfunction injectDataIntoProtoPath(protoPath, data) {\n return protoPath\n .split('/')\n .map((path) => maybeProtoPathToData(path, data))\n .join('/');\n}\nfunction maybeProtoPathToData(protoPath, data) {\n const protoRegExpMatch = protoPath.match(REGEX_CAPTURE_PROTO_FIELD) || [];\n const field = protoRegExpMatch[1];\n if (field) {\n const suffix = protoPath.replace(protoRegExpMatch[0], '');\n return findByPath(data, field, protoPath, suffix);\n }\n return protoPath;\n}\nfunction findByPath(obj, path, defaultValue, suffix) {\n let result = obj;\n for (const field of path.split('.')) {\n if (!result) {\n return defaultValue;\n }\n result = result[field];\n }\n return `${result}${suffix}`;\n}\nfunction resolvePathFromMappings(protoPath, mappings) {\n const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));\n if (!mapping) {\n // todo: should we return the path? if no - what should we do in case of testings?\n return protoPath;\n }\n return mapping.srcPath + protoPath.slice(mapping.destPath.length);\n}\n","import { wixContext } from '@wix/sdk-context';\nexport function enableContext(wixClient, contextType) {\n if (contextType === 'global') {\n if (globalThis.__wix_context__ != null) {\n globalThis.__wix_context__.client = wixClient;\n }\n else {\n globalThis.__wix_context__ = { client: wixClient };\n }\n }\n else {\n wixContext.client = wixClient;\n }\n}\n","import { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nexport function elevate(restModule) {\n return createRESTModule(restModule, true);\n}\nexport const fetchWithAuth = createRESTModule((restModuleOpts) => {\n return ((url, options) => restModuleOpts.fetchWithAuth(url, options));\n});\nexport { graphql } from './graphql.js';\nexport { setGlobalWixContext } from './wix-context.js';\nexport { enableContext } from './enable-context.js';\n"],"mappings":"gGACO,SAASA,EAAiBC,EAAYC,EAAW,GAAO,CAC3D,OAAOC,EAA0BF,EAAYC,CAAQ,CACzD,CAiDA,IAAME,EAAU,CAAC,UAAW,aAAa,EAEzC,IAAMC,EAAwB,IAAI,OAAO,OAAOC,EAAQ,KAAK,GAAG,CAAC,IAAI,EAC/DC,EAAkB,CAAC,iBAAkB,uBAAuB,EAC5DC,EAAsB,mBAE5B,IAAMC,EAA4B,IAAI,OAAO,OAAOC,EAAgB,KAAK,GAAG,CAAC,IAAI,EAC3EC,EAAoC,IAAI,OAAO,QAAQC,CAAmB,GAAG,EC3DnF,OAAS,cAAAC,MAAkB,mBACpB,SAASC,EAAcC,EAAWC,EAAa,CAC9CA,IAAgB,SACZ,WAAW,iBAAmB,KAC9B,WAAW,gBAAgB,OAASD,EAGpC,WAAW,gBAAkB,CAAE,OAAQA,CAAU,EAIrDF,EAAW,OAASE,CAE5B,CCTO,IAAME,EAAgBC,EAAkBC,GACnC,CAACC,EAAKC,IAAYF,EAAe,cAAcC,EAAKC,CAAO,CACtE","names":["createRESTModule","descriptor","elevated","contextualizeRESTModuleV2","DOMAINS","REGEX_CAPTURE_DOMAINS","DOMAINS","WIX_API_DOMAINS","DEV_WIX_CODE_DOMAIN","REGEX_CAPTURE_API_DOMAINS","WIX_API_DOMAINS","REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN","DEV_WIX_CODE_DOMAIN","wixContext","enableContext","wixClient","contextType","fetchWithAuth","createRESTModule","restModuleOpts","url","options"]}
1
+ {"version":3,"sources":["../../../node_modules/@wix/sdk-runtime/build/rest-modules.js","../../../node_modules/@wix/sdk/build/enable-context.js","../../../node_modules/@wix/sdk/build/context.js"],"sourcesContent":["import { contextualizeRESTModuleV2 } from './context-v2.js';\nexport function createRESTModule(descriptor, elevated = false) {\n return contextualizeRESTModuleV2(descriptor, elevated);\n}\nexport function toURLSearchParams(params, isComplexRequest) {\n const flatten = flattenParams(params);\n const searchParams = Object.entries(flatten).reduce((urlSearchParams, [key, value]) => {\n // inorder to make `foo: [1,2]` turn into `foo=1&foo=2` and not `foo[]=1&foo[]=2`\n const keyParams = Array.isArray(value) ? value : [value];\n keyParams.forEach((param) => {\n if (param === undefined || param === null) {\n return;\n }\n urlSearchParams.append(key, param);\n });\n return urlSearchParams;\n }, new URLSearchParams());\n if (isComplexRequest) {\n searchParams.append('.r', base64Encode(JSON.stringify(params)));\n }\n return searchParams;\n}\nexport function resolveUrl(opts) {\n const domain = resolveDomain(opts.host);\n const mappings = resolveMappingsByDomain(domain, opts.domainToMappings);\n const path = injectDataIntoProtoPath(opts.protoPath, opts.data || {});\n return resolvePathFromMappings(path, mappings);\n}\nfunction flattenParams(data, path = '') {\n const params = {};\n Object.entries(data).forEach(([key, value]) => {\n const isObject = value !== null && typeof value === 'object' && !Array.isArray(value);\n const fieldPath = resolvePath(path, key);\n if (isObject) {\n const serializedObject = flattenParams(value, fieldPath);\n Object.assign(params, serializedObject);\n }\n else {\n params[fieldPath] = value;\n }\n });\n return params;\n}\nfunction resolvePath(path, key) {\n return `${path}${path ? '.' : ''}${key}`;\n}\nconst base64Encode = (value) => {\n const base64 = typeof btoa !== 'undefined'\n ? btoa(value)\n : Buffer.from(value, 'utf-8').toString('base64');\n return base64.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n};\nconst DOMAINS = ['wix.com', 'editorx.com'];\nconst USER_DOMAIN = '_';\nconst REGEX_CAPTURE_DOMAINS = new RegExp(`\\\\.(${DOMAINS.join('|')})$`);\nconst WIX_API_DOMAINS = ['42.wixprod.net', 'uw2-edt-1.wixprod.net'];\nconst DEV_WIX_CODE_DOMAIN = 'dev.wix-code.com';\nconst REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;\nconst REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\\\.(${WIX_API_DOMAINS.join('|')})$`);\nconst REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\\\.${DEV_WIX_CODE_DOMAIN}$`);\nfunction resolveDomain(host) {\n const resolvedHost = fixHostExceptions(host);\n return resolvedHost\n .replace(REGEX_CAPTURE_DOMAINS, '._base_domain_')\n .replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_')\n .replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, '*.dev.wix-code.com');\n}\n// hosts which standard string replacing doesn't apply to them, will be fixed here.\nfunction fixHostExceptions(host) {\n // https://system-kb.wixanswers.com/kb/en/article/editorx-domains-matching-to-wixcom\n return host.replace('create.editorx.com', 'editor.editorx.com');\n}\nfunction resolveMappingsByDomain(domain, domainToMappings) {\n const mappings = domainToMappings[domain] || domainToMappings[USER_DOMAIN];\n if (!mappings) {\n if (isBaseDomain(domain)) {\n // fallback <lang>.wix.com sub domains to www.wix.com\n // since all of the languages subdomain are not mapped automatically in FP and we want to support those kind of calls\n // for example: fr.wix.com\n return domainToMappings[wwwBaseDomain];\n }\n }\n return mappings;\n}\nfunction isBaseDomain(domain) {\n return !!domain.match(/\\._base_domain_$/);\n}\nconst wwwBaseDomain = 'www._base_domain_';\nfunction injectDataIntoProtoPath(protoPath, data) {\n return protoPath\n .split('/')\n .map((path) => maybeProtoPathToData(path, data))\n .join('/');\n}\nfunction maybeProtoPathToData(protoPath, data) {\n const protoRegExpMatch = protoPath.match(REGEX_CAPTURE_PROTO_FIELD) || [];\n const field = protoRegExpMatch[1];\n if (field) {\n const suffix = protoPath.replace(protoRegExpMatch[0], '');\n return findByPath(data, field, protoPath, suffix);\n }\n return protoPath;\n}\nfunction findByPath(obj, path, defaultValue, suffix) {\n let result = obj;\n for (const field of path.split('.')) {\n if (!result) {\n return defaultValue;\n }\n result = result[field];\n }\n return `${result}${suffix}`;\n}\nfunction resolvePathFromMappings(protoPath, mappings) {\n const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));\n if (!mapping) {\n // todo: should we return the path? if no - what should we do in case of testings?\n return protoPath;\n }\n return mapping.srcPath + protoPath.slice(mapping.destPath.length);\n}\n","import { wixContext } from '@wix/sdk-context';\nexport function enableContext(wixClient, contextType) {\n if (contextType === 'global') {\n if (globalThis.__wix_context__ != null) {\n globalThis.__wix_context__.client = wixClient;\n }\n else {\n globalThis.__wix_context__ = { client: wixClient };\n }\n }\n else {\n wixContext.client = wixClient;\n }\n}\n","import { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nexport function elevate(restModule) {\n return createRESTModule(restModule, true);\n}\nexport const fetchWithAuth = createRESTModule((restModuleOpts) => {\n return ((url, options) => restModuleOpts.fetchWithAuth(url, options));\n});\nexport { graphql } from './graphql.js';\nexport { setGlobalWixContext } from './wix-context.js';\nexport { enableContext } from './enable-context.js';\n"],"mappings":"gGACO,SAASA,EAAiBC,EAAYC,EAAW,GAAO,CAC3D,OAAOC,EAA0BF,EAAYC,CAAQ,CACzD,CAiDA,IAAME,EAAU,CAAC,UAAW,aAAa,EAEzC,IAAMC,EAAwB,IAAI,OAAO,OAAOC,EAAQ,KAAK,GAAG,CAAC,IAAI,EAC/DC,EAAkB,CAAC,iBAAkB,uBAAuB,EAC5DC,EAAsB,mBAE5B,IAAMC,EAA4B,IAAI,OAAO,OAAOC,EAAgB,KAAK,GAAG,CAAC,IAAI,EAC3EC,EAAoC,IAAI,OAAO,QAAQC,CAAmB,GAAG,EC3DnF,OAAS,cAAAC,MAAkB,mBACpB,SAASC,EAAcC,EAAWC,EAAa,CAC9CA,IAAgB,SACZ,WAAW,iBAAmB,KAC9B,WAAW,gBAAgB,OAASD,EAGpC,WAAW,gBAAkB,CAAE,OAAQA,CAAU,EAIrDF,EAAW,OAASE,CAE5B,CCTO,IAAME,EAAgBC,EAAkBC,GACnC,CAACC,EAAKC,IAAYF,EAAe,cAAcC,EAAKC,CAAO,CACtE","names":["createRESTModule","descriptor","elevated","contextualizeRESTModuleV2","DOMAINS","REGEX_CAPTURE_DOMAINS","DOMAINS","WIX_API_DOMAINS","DEV_WIX_CODE_DOMAIN","REGEX_CAPTURE_API_DOMAINS","WIX_API_DOMAINS","REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN","DEV_WIX_CODE_DOMAIN","wixContext","enableContext","wixClient","contextType","fetchWithAuth","createRESTModule","restModuleOpts","url","options"]}
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-BGEA2LRQ.js";import"./chunk-BGTZ3RNN.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function d(){let t=null,n=null;return{promise:new Promise((o,i)=>{t=o,n=i}),resolve:t,reject:n}}var u=t=>{let{createHost:n}=t;return{__type:"host",create:e=>({}),host:e=>{var o,i;let{applicationId:s}=e??{},r=typeof window<"u"?window.wixEmbedsAPI:void 0,l=n(e),p=f();return{...l,apiBaseUrl:p,getMonitoringClient:r==null||r.getMonitoringClientFunction==null?void 0:r.getMonitoringClientFunction(s),essentials:{language:typeof window<"u"?(o=window.commonConfig)==null?void 0:o.language:void 0,locale:typeof window<"u"?(i=window.commonConfig)==null?void 0:i.locale:void 0}}},auth:e=>{let o=typeof window<"u"?window.wixEmbedsAPI:void 0;e||(e=o==null||o.getAccessTokenFunction==null?void 0:o.getAccessTokenFunction());let i=!1,{resolve:s,promise:r}=d();return{getAuthHeaders:async()=>{if(!e&&i&&(e=await r),!e)throw new Error("Failed to resolve auth token");return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(i=!0,l=>{s(l)})}}}};function f(){let t=typeof window<"u"?window.wixEmbedsAPI:void 0,n=t==null||t.getExternalBaseUrl==null?void 0:t.getExternalBaseUrl();if(!n)return;let e=new URL(n);return e!=null&&e.pathname&&e.pathname!=="/"?""+e.hostname+e.pathname:e.hostname}var w=t=>{let{clientSdk:n,applicationId:e}=t;return{invoke:async o=>{let{namespace:i,method:s,args:r}=o;if(!n)throw new Error("Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction");return n.invoke({namespace:i,method:s,args:r,applicationId:e,accessToken:"accessToken"})},getAccessToken:()=>{throw new Error("Not implemented")},observeState:()=>({disconnect:()=>{}})}};var m=function(t){let n=typeof $wixContext<"u"&&$wixContext.clientSdk||t?.clientSdk||window.clientSdk,{applicationId:e}=t||{};if(!e)throw new Error('"createHost" was called without a required field "applicationId"');return{channel:w({clientSdk:n,applicationId:e}),close:()=>{}}};var c=u({createHost:m});var S=t=>{let n=c.host({applicationId:t}),e=c.auth(),o=e.getAccessTokenInjector();return a({auth:e,host:n}).enableContext("module"),{injectGetAccessToken:o}};export{S as enableClient};
1
+ import{a}from"./chunk-3WHQP2RD.js";import"./chunk-42XIZ4MH.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function d(){let t=null,n=null;return{promise:new Promise((o,i)=>{t=o,n=i}),resolve:t,reject:n}}var u=t=>{let{createHost:n}=t;return{__type:"host",create:e=>({}),host:e=>{var o,i;let{applicationId:s}=e??{},r=typeof window<"u"?window.wixEmbedsAPI:void 0,l=n(e),p=f();return{...l,apiBaseUrl:p,getMonitoringClient:r==null||r.getMonitoringClientFunction==null?void 0:r.getMonitoringClientFunction(s),essentials:{language:typeof window<"u"?(o=window.commonConfig)==null?void 0:o.language:void 0,locale:typeof window<"u"?(i=window.commonConfig)==null?void 0:i.locale:void 0}}},auth:e=>{let o=typeof window<"u"?window.wixEmbedsAPI:void 0;e||(e=o==null||o.getAccessTokenFunction==null?void 0:o.getAccessTokenFunction());let i=!1,{resolve:s,promise:r}=d();return{getAuthHeaders:async()=>{if(!e&&i&&(e=await r),!e)throw new Error("Failed to resolve auth token");return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(i=!0,l=>{s(l)})}}}};function f(){let t=typeof window<"u"?window.wixEmbedsAPI:void 0,n=t==null||t.getExternalBaseUrl==null?void 0:t.getExternalBaseUrl();if(!n)return;let e=new URL(n);return e!=null&&e.pathname&&e.pathname!=="/"?""+e.hostname+e.pathname:e.hostname}var w=t=>{let{clientSdk:n,applicationId:e}=t;return{invoke:async o=>{let{namespace:i,method:s,args:r}=o;if(!n)throw new Error("Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction");return n.invoke({namespace:i,method:s,args:r,applicationId:e,accessToken:"accessToken"})},getAccessToken:()=>{throw new Error("Not implemented")},observeState:()=>({disconnect:()=>{}})}};var m=function(t){let n=typeof $wixContext<"u"&&$wixContext.clientSdk||t?.clientSdk||window.clientSdk,{applicationId:e}=t||{};if(!e)throw new Error('"createHost" was called without a required field "applicationId"');return{channel:w({clientSdk:n,applicationId:e}),close:()=>{}}};var c=u({createHost:m});var S=t=>{let n=c.host({applicationId:t}),e=c.auth(),o=e.getAccessTokenInjector();return a({auth:e,host:n}).enableContext("module"),{injectGetAccessToken:o}};export{S as enableClient};
2
2
  //# sourceMappingURL=site.js.map
@@ -3,26 +3,26 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  executeCommand,
5
5
  log
6
- } from "./chunk-D7ONS7OD.js";
7
- import "./chunk-42T5NHSS.js";
8
- import "./chunk-GCHPKOS2.js";
6
+ } from "./chunk-3LJH5WAS.js";
9
7
  import {
10
8
  PreviewCommand
11
- } from "./chunk-32DDGTGH.js";
12
- import "./chunk-3FL4P2SD.js";
13
- import "./chunk-JYPZQDKR.js";
14
- import "./chunk-CYJERK24.js";
15
- import "./chunk-PJJ6F4A3.js";
16
- import "./chunk-R3BD56LW.js";
9
+ } from "./chunk-FGCBIHDS.js";
10
+ import "./chunk-PS7R6MWD.js";
11
+ import "./chunk-I2PLZT4A.js";
12
+ import "./chunk-K4IODCQP.js";
13
+ import "./chunk-OGO22IKX.js";
14
+ import "./chunk-IB2KM2Q7.js";
15
+ import "./chunk-HR6CTO67.js";
16
+ import "./chunk-3GSDI3OJ.js";
17
17
  import "./chunk-ZR3N5INU.js";
18
- import "./chunk-LNBDMMJU.js";
19
- import "./chunk-DBASREIW.js";
20
- import "./chunk-OPFPQV74.js";
18
+ import "./chunk-5LGI6O3F.js";
19
+ import "./chunk-PGKXOCZN.js";
20
+ import "./chunk-XDWVTYW3.js";
21
21
  import {
22
22
  CliError,
23
23
  CliErrorCode,
24
24
  require_react
25
- } from "./chunk-2Y6DEXNR.js";
25
+ } from "./chunk-GGQMSU4O.js";
26
26
  import {
27
27
  __toESM,
28
28
  init_esm_shims
@@ -52,4 +52,4 @@ async function nonInteractivePreview(services, model, options) {
52
52
  export {
53
53
  nonInteractivePreview
54
54
  };
55
- //# sourceMappingURL=preview-XTPTMI6C.js.map
55
+ //# sourceMappingURL=preview-CLBQELU3.js.map
@@ -3,29 +3,29 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  executeCommand,
5
5
  log
6
- } from "./chunk-D7ONS7OD.js";
6
+ } from "./chunk-3LJH5WAS.js";
7
7
  import {
8
8
  ReleaseCommand
9
- } from "./chunk-6GF7ZOLW.js";
10
- import "./chunk-42T5NHSS.js";
11
- import "./chunk-GCHPKOS2.js";
12
- import "./chunk-S426UONM.js";
13
- import "./chunk-32DDGTGH.js";
14
- import "./chunk-3FL4P2SD.js";
15
- import "./chunk-JYPZQDKR.js";
16
- import "./chunk-CYJERK24.js";
17
- import "./chunk-PJJ6F4A3.js";
18
- import "./chunk-R3BD56LW.js";
9
+ } from "./chunk-VARU4VGB.js";
10
+ import "./chunk-FGCBIHDS.js";
11
+ import "./chunk-PS7R6MWD.js";
12
+ import "./chunk-I2PLZT4A.js";
13
+ import "./chunk-K4IODCQP.js";
14
+ import "./chunk-OGO22IKX.js";
15
+ import "./chunk-IB2KM2Q7.js";
16
+ import "./chunk-QSLRE7OK.js";
17
+ import "./chunk-HR6CTO67.js";
18
+ import "./chunk-3GSDI3OJ.js";
19
19
  import "./chunk-ZR3N5INU.js";
20
- import "./chunk-LNBDMMJU.js";
21
- import "./chunk-DBASREIW.js";
22
- import "./chunk-OPFPQV74.js";
20
+ import "./chunk-5LGI6O3F.js";
21
+ import "./chunk-PGKXOCZN.js";
22
+ import "./chunk-XDWVTYW3.js";
23
23
  import {
24
24
  CliError,
25
25
  CliErrorCode,
26
26
  require_react,
27
27
  toJsonString
28
- } from "./chunk-2Y6DEXNR.js";
28
+ } from "./chunk-GGQMSU4O.js";
29
29
  import {
30
30
  __toESM,
31
31
  init_esm_shims
@@ -57,4 +57,4 @@ async function nonInteractiveRelease(services, model, releaseProps) {
57
57
  export {
58
58
  nonInteractiveRelease
59
59
  };
60
- //# sourceMappingURL=release-MNTPIKSG.js.map
60
+ //# sourceMappingURL=release-VZ2GWJE2.js.map
@@ -3,14 +3,14 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  renderCommand,
5
5
  runCommand
6
- } from "./chunk-ZVADFZDF.js";
7
- import "./chunk-42T5NHSS.js";
8
- import "./chunk-GCHPKOS2.js";
9
- import "./chunk-LNBDMMJU.js";
10
- import "./chunk-2Y6DEXNR.js";
6
+ } from "./chunk-75BL4FR5.js";
7
+ import "./chunk-I2PLZT4A.js";
8
+ import "./chunk-K4IODCQP.js";
9
+ import "./chunk-5LGI6O3F.js";
10
+ import "./chunk-GGQMSU4O.js";
11
11
  import "./chunk-PYIAC2GK.js";
12
12
  export {
13
13
  renderCommand,
14
14
  runCommand
15
15
  };
16
- //# sourceMappingURL=render-command-HQXTOVW5.js.map
16
+ //# sourceMappingURL=render-command-OT7HQRPA.js.map