@wix/cli-app 1.1.134 → 1.1.135

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 (77) hide show
  1. package/build/{AddPermissionCommand-TL46A3YR.js → AddPermissionCommand-J747FJOD.js} +2 -2
  2. package/build/{DevCommand-KKSEAF6U.js → DevCommand-WHO2FPZA.js} +11 -11
  3. package/build/{GenerateCommand-CHACGG6N.js → GenerateCommand-G7GZAQRU.js} +8 -8
  4. package/build/{LogsCommand-ONUNVGZR.js → LogsCommand-UYRXNYT6.js} +4 -4
  5. package/build/PreviewCommand-AK7QEFIM.js +19 -0
  6. package/build/ReleaseCommand-DK24QEHP.js +23 -0
  7. package/build/{ServeCommand-I57RKIFD.js → ServeCommand-P52GP36W.js} +4 -4
  8. package/build/{build-UZCNG6SL.js → build-QHEECRN2.js} +6 -6
  9. package/build/{chunk-PTXQ3EPG.js → chunk-3FSEHEJA.js} +3 -3
  10. package/build/{chunk-DLJA76CA.js → chunk-4GVN5OSZ.js} +15 -9
  11. package/build/{chunk-DLJA76CA.js.map → chunk-4GVN5OSZ.js.map} +1 -1
  12. package/build/{chunk-U2CR5VPH.js → chunk-5I6K4LMZ.js} +10 -7
  13. package/build/{chunk-U2CR5VPH.js.map → chunk-5I6K4LMZ.js.map} +1 -1
  14. package/build/{chunk-WOIU7VIM.js → chunk-CXBQHWIM.js} +2 -2
  15. package/build/{chunk-R5HMH6QX.js → chunk-HBEVHWYL.js} +2 -2
  16. package/build/{chunk-R5HMH6QX.js.map → chunk-HBEVHWYL.js.map} +1 -1
  17. package/build/{chunk-TNH2NG27.js → chunk-HPHTU6UB.js} +3 -3
  18. package/build/{chunk-GY4LG7V4.js → chunk-I2JVZXWM.js} +2 -2
  19. package/build/{chunk-NU7CPDB5.js → chunk-IPSCL6EX.js} +4 -4
  20. package/build/{chunk-NQ4YNX6A.js → chunk-KJXVS3IU.js} +4 -4
  21. package/build/{chunk-JPSY3QB7.js → chunk-L6XIG76V.js} +3 -3
  22. package/build/{chunk-3GHB2NXZ.js → chunk-MFPD7G6B.js} +2 -2
  23. package/build/{chunk-GWE3BRHX.js → chunk-P7IRRCF7.js} +4 -4
  24. package/build/chunk-P7IRRCF7.js.map +1 -0
  25. package/build/{chunk-FDSZMRFC.js → chunk-QVI67Q6A.js} +2 -2
  26. package/build/{chunk-UWCQA4MW.js → chunk-RPHZ4OP3.js} +6 -4
  27. package/build/{chunk-UWCQA4MW.js.map → chunk-RPHZ4OP3.js.map} +1 -1
  28. package/build/{chunk-PRRRKDRX.js → chunk-SMEOB2J6.js} +6 -6
  29. package/build/{chunk-YLUVMDX7.js → chunk-V4VNLYCR.js} +2 -2
  30. package/build/{chunk-FUAEI7OE.js → chunk-W6OUY5DV.js} +6 -6
  31. package/build/{chunk-NPYJ3GAT.js → chunk-Z6H5SRVH.js} +2 -2
  32. package/build/cloudflare-runtime/entry.js +3 -3
  33. package/build/cloudflare-runtime/getRegisteredExtensions.js +3 -3
  34. package/build/index.js +23 -23
  35. package/build/platform-sdk/{chunk-WBKL5IQV.js → chunk-RJD2G2AE.js} +2 -2
  36. package/build/platform-sdk/chunk-RJD2G2AE.js.map +1 -0
  37. package/build/platform-sdk/{chunk-R7FAXXP7.js → chunk-Y4HYNW3N.js} +1 -1
  38. package/build/platform-sdk/chunk-Y4HYNW3N.js.map +1 -0
  39. package/build/platform-sdk/dashboard.js +1 -1
  40. package/build/platform-sdk/editor.js +1 -1
  41. package/build/platform-sdk/sdk-context.js +1 -1
  42. package/build/platform-sdk/sdk-context.js.map +1 -1
  43. package/build/platform-sdk/site.js +1 -1
  44. package/build/{preview-6SJAV4D6.js → preview-3ABHWSP4.js} +13 -13
  45. package/build/{release-JUZK53KH.js → release-DZGPFN7M.js} +15 -15
  46. package/build/{render-command-FFAZSU54.js → render-command-TDM7CFXE.js} +5 -5
  47. package/package.json +5 -5
  48. package/templates/custom-element/files/element.tsx.ejs +1 -1
  49. package/build/PreviewCommand-Y7JEA26N.js +0 -19
  50. package/build/ReleaseCommand-QIDFQA2M.js +0 -23
  51. package/build/chunk-GWE3BRHX.js.map +0 -1
  52. package/build/platform-sdk/chunk-R7FAXXP7.js.map +0 -1
  53. package/build/platform-sdk/chunk-WBKL5IQV.js.map +0 -1
  54. /package/build/{AddPermissionCommand-TL46A3YR.js.map → AddPermissionCommand-J747FJOD.js.map} +0 -0
  55. /package/build/{DevCommand-KKSEAF6U.js.map → DevCommand-WHO2FPZA.js.map} +0 -0
  56. /package/build/{GenerateCommand-CHACGG6N.js.map → GenerateCommand-G7GZAQRU.js.map} +0 -0
  57. /package/build/{LogsCommand-ONUNVGZR.js.map → LogsCommand-UYRXNYT6.js.map} +0 -0
  58. /package/build/{PreviewCommand-Y7JEA26N.js.map → PreviewCommand-AK7QEFIM.js.map} +0 -0
  59. /package/build/{ReleaseCommand-QIDFQA2M.js.map → ReleaseCommand-DK24QEHP.js.map} +0 -0
  60. /package/build/{ServeCommand-I57RKIFD.js.map → ServeCommand-P52GP36W.js.map} +0 -0
  61. /package/build/{build-UZCNG6SL.js.map → build-QHEECRN2.js.map} +0 -0
  62. /package/build/{chunk-PTXQ3EPG.js.map → chunk-3FSEHEJA.js.map} +0 -0
  63. /package/build/{chunk-WOIU7VIM.js.map → chunk-CXBQHWIM.js.map} +0 -0
  64. /package/build/{chunk-TNH2NG27.js.map → chunk-HPHTU6UB.js.map} +0 -0
  65. /package/build/{chunk-GY4LG7V4.js.map → chunk-I2JVZXWM.js.map} +0 -0
  66. /package/build/{chunk-NU7CPDB5.js.map → chunk-IPSCL6EX.js.map} +0 -0
  67. /package/build/{chunk-NQ4YNX6A.js.map → chunk-KJXVS3IU.js.map} +0 -0
  68. /package/build/{chunk-JPSY3QB7.js.map → chunk-L6XIG76V.js.map} +0 -0
  69. /package/build/{chunk-3GHB2NXZ.js.map → chunk-MFPD7G6B.js.map} +0 -0
  70. /package/build/{chunk-FDSZMRFC.js.map → chunk-QVI67Q6A.js.map} +0 -0
  71. /package/build/{chunk-PRRRKDRX.js.map → chunk-SMEOB2J6.js.map} +0 -0
  72. /package/build/{chunk-YLUVMDX7.js.map → chunk-V4VNLYCR.js.map} +0 -0
  73. /package/build/{chunk-FUAEI7OE.js.map → chunk-W6OUY5DV.js.map} +0 -0
  74. /package/build/{chunk-NPYJ3GAT.js.map → chunk-Z6H5SRVH.js.map} +0 -0
  75. /package/build/{preview-6SJAV4D6.js.map → preview-3ABHWSP4.js.map} +0 -0
  76. /package/build/{release-JUZK53KH.js.map → release-DZGPFN7M.js.map} +0 -0
  77. /package/build/{render-command-FFAZSU54.js.map → render-command-TDM7CFXE.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as Q}from"./chunk-EZGPNUD5.js";import{a as G}from"./chunk-WBKL5IQV.js";import"./chunk-R7FAXXP7.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function A(){return A=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},A.apply(null,arguments)}import Be,{useEffect as Ke,useState as _e}from"react";import{wixContext as g}from"@wix/sdk-context";function X(){let e=typeof $wixContext<"u"&&$wixContext.initWixModules?$wixContext.initWixModules:typeof globalThis.__wix_context__<"u"&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(r,o){return O(()=>e(r,o))},fetchWithAuth(){throw new Error("fetchWithAuth is not available in this context")},graphql(){throw new Error("graphql is not available in this context")}};let t=typeof $wixContext<"u"?$wixContext.client:typeof g.client<"u"?g.client:typeof globalThis.__wix_context__<"u"?globalThis.__wix_context__.client:void 0,n=typeof $wixContext<"u"?$wixContext.elevatedClient:typeof g.elevatedClient<"u"?g.elevatedClient:typeof globalThis.__wix_context__<"u"?globalThis.__wix_context__.elevatedClient:void 0;if(!(!t&&!n))return{initWixModules(r,o){if(o){if(!n)throw new Error("An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules");return O(()=>n.use(r))}if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return O(()=>t.use(r))},fetchWithAuth:(r,o)=>{if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.fetchWithAuth(r,o)},getAuth(){if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.auth},async graphql(r,o,s){if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.graphql(r,o,s)}}}function O(e){let t=globalThis.__wix_context__,n={client:g.client,elevatedClient:g.elevatedClient},r;globalThis.__wix_context__=void 0,g.client=void 0,g.elevatedClient=void 0,typeof $wixContext<"u"&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,g.client=n.client,g.elevatedClient=n.elevatedClient,typeof $wixContext<"u"&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Y(e,t){return{...e,...Object.fromEntries(t.map(n=>[n,(...r)=>{let o=X();if(!o)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return o.initWixModules(e)[n].apply(void 0,r)}]))}}function Z(e){return Y({__type:"host",create:t=>Object.entries(e).reduce((n,[r,o])=>({...n,[r]:o(t)}),{})},Object.keys(e))}function b(e){"@babel/helpers - typeof";return b=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},b(e)}function ee(e,t){if(b(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function te(e){var t=ee(e,"string");return b(t)=="symbol"?t:t+""}function ne(e,t,n){return(t=te(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=class extends Error{constructor(t){let{message:n,code:r}=t;super(n),ne(this,"code",void 0),this.message=n,this.code=r}};var re=()=>{let e=a=>{let{channel:i}=a;return function(){let f=i.showToast(...arguments);return{remove:()=>Promise.resolve(f).then(x=>x.remove())}}},t=a=>{let{channel:i}=a;return function(){let f=i.observeState(...arguments);return{disconnect:()=>Promise.resolve(f).then(x=>x.disconnect())}}};return{showToast:e,observeState:t,navigate:a=>{let{channel:i}=a;return function(){return i.navigate(...arguments)}},navigateBack:a=>{let{channel:i}=a;return()=>i.navigateBack()},openModal:a=>{let{channel:i}=a;return(f,m)=>{let[x,k]=typeof f=="string"?[f,m]:[f.modalId,f.params],C=i.openModal(x,k);return{modalClosed:Promise.resolve(C).then(w=>w.modalClosed)}}},closeModal:a=>{let{channel:i}=a;return f=>{if(f===void 0)return i.closeModal();let m=JSON.parse(JSON.stringify(f));return i.closeModal(m)}},getAccessToken:a=>{let{channel:i}=a;return()=>i.getAccessToken()},getPageUrl:a=>{let{channel:i}=a;return function(){return i.getPageUrl(...arguments)}},openMediaManager:a=>{let{channel:i}=a;return function(){return i.openMediaManager(...arguments)}},addSitePlugin:a=>{let{channel:i}=a;return(f,m)=>{let x="802c76e4-b381-4bb3-9152-96acabbf3194",k=m?.placement||{},C=i.openModal(x,{...k,placementsSlotId:m?.slotId,pluginId:f,action:"populate"});return Promise.resolve(C).then(w=>w.modalClosed).then(w=>{if(w?.type===void 0)throw new E({message:"Aborted by user",code:3006});if(w?.type==="ERROR")throw new E(w.data.error)})}},onBeforeUnload:a=>{let{channel:i}=a;return function(){return i.onBeforeUnload(...arguments)}},setPageTitle:a=>{let{channel:i}=a;return f=>i.setPageTitle(f)},getLanguage:a=>{let i=null;return async()=>{var f;if(i)return i;let m=null;return i=await new Promise(x=>{m=t(a)((k,C)=>{x(C.language)})}),(f=m)==null||f.disconnect(),i}},requestFeedback:a=>{let{channel:i}=a;return function(){return i.requestFeedback(...arguments)}},onLayerStateChange:a=>{let{channel:i}=a;return function(){let f=i.onLayerStateChange(...arguments);return{remove:()=>Promise.resolve(f).then(x=>x.remove())}}},installApp:a=>{let{channel:i}=a;return i.installApp},getSiteInfo:a=>{let{channel:i}=a;return i.getSiteInfo},getWidget:a=>{let{channel:i}=a;return function(){if("getWidget"in i)return i.getWidget(...arguments);throw new Error("Unsupported")}},getDashboardPlugins:a=>{let{channel:i}=a;return function(){if("getDashboardPlugins"in i)return i.getDashboardPlugins(...arguments);throw new Error("Unsupported")}},getDashboardMenuPlugins:a=>{let{channel:i}=a;return function(){if("getDashboardMenuPlugins"in i)return i.getDashboardMenuPlugins(...arguments);throw new Error("Unsupported")}},createStore:a=>{let{channel:i}=a;if(i.createStore)return i.createStore},getStore:a=>{let{channel:i}=a;if(i.getStore)return i.getStore}}};var oe=e=>{let{createHost:t}=e,n=re();return{...Z(n),host:t,auth:()=>({getAuthHeaders:async r=>({headers:{Authorization:await n.getAccessToken(r)()}})})}};var se=Symbol("Comlink.proxy"),Pe=Symbol("Comlink.endpoint"),I=Symbol("Comlink.releaseProxy"),U=Symbol("Comlink.thrown"),ae=e=>typeof e=="object"&&e!==null||typeof e=="function",Ce={canHandle:e=>ae(e)&&e[se],serialize(e){let{port1:t,port2:n}=new MessageChannel;return R(e,t),[n,[n]]},deserialize(e){return e.start(),L(e)}},Ee={canHandle:e=>ae(e)&&U 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}},le=new Map([["proxy",Ce],["throw",Ee]]);function R(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;let{id:o,type:s,path:u}=Object.assign({path:[]},r.data),l=(r.data.argumentList||[]).map(v),c;try{let d=u.slice(0,-1).reduce((p,y)=>p[y],e),h=u.reduce((p,y)=>p[y],e);switch(s){case 0:c=h;break;case 1:d[u.slice(-1)[0]]=v(r.data.value),c=!0;break;case 2:c=h.apply(d,l);break;case 3:{let p=new h(...l);c=W(p)}break;case 4:{let{port1:p,port2:y}=new MessageChannel;R(e,y),c=Ae(p,[p])}break;case 5:c=void 0;break}}catch(d){c={value:d,[U]:0}}Promise.resolve(c).catch(d=>({value:d,[U]:0})).then(d=>{let[h,p]=B(d);t.postMessage(Object.assign(Object.assign({},h),{id:o}),p),s===5&&(t.removeEventListener("message",n),ue(t))})}),t.start&&t.start()}function We(e){return e.constructor.name==="MessagePort"}function ue(e){We(e)&&e.close()}function L(e,t){return H(e,[],t)}function T(e){if(e)throw new Error("Proxy has been released and is not useable")}function H(e,t=[],n=function(){}){let r=!1,o=new Proxy(n,{get(s,u){if(T(r),u===I)return()=>S(e,{type:5,path:t.map(l=>l.toString())}).then(()=>{ue(e),r=!0});if(u==="then"){if(t.length===0)return{then:()=>o};let l=S(e,{type:0,path:t.map(c=>c.toString())}).then(v);return l.then.bind(l)}return H(e,[...t,u])},set(s,u,l){T(r);let[c,d]=B(l);return S(e,{type:1,path:[...t,u].map(h=>h.toString()),value:c},d).then(v)},apply(s,u,l){T(r);let c=t[t.length-1];if(c===Pe)return S(e,{type:4}).then(v);if(c==="bind")return H(e,t.slice(0,-1));let[d,h]=ie(l);return S(e,{type:2,path:t.map(p=>p.toString()),argumentList:d},h).then(v)},construct(s,u){T(r);let[l,c]=ie(u);return S(e,{type:3,path:t.map(d=>d.toString()),argumentList:l},c).then(v)}});return o}function ke(e){return Array.prototype.concat.apply([],e)}function ie(e){let t=e.map(B);return[t.map(n=>n[0]),ke(t.map(n=>n[1]))]}var ce=new WeakMap;function Ae(e,t){return ce.set(e,t),e}function W(e){return Object.assign(e,{[se]:!0})}function B(e){for(let[t,n]of le)if(n.canHandle(e)){let[r,o]=n.serialize(e);return[{type:3,name:t,value:r},o]}return[{type:0,value:e},ce.get(e)||[]]}function v(e){switch(e.type){case 3:return le.get(e.name).deserialize(e.value);case 0:return e.value}}function S(e,t,n){return new Promise(r=>{let o=Te();e.addEventListener("message",function s(u){!u.data||!u.data.id||u.data.id!==o||(e.removeEventListener("message",s),r(u.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function Te(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var K="__proxyCallbackId__wixSDK__",j="__proxyPromiseId__wixSDK__",fe=e=>ze(e,t=>async function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];let[s,u]=$(r),l=await t(W(s),u);return pe(l)});var De=async e=>{let[t,n]=$(await e);return W({proxies:t,clonables:n})},pe=async e=>z(e?.proxies,await e?.clonables),$=e=>{let t=(o,s)=>{if(he(s)){let u=de();return o.promises[u]=s,{[j]:u}}if(Oe(s)){let u=de();return o.callbacks[u]=(l,c)=>{let d=z(l,c),h=s(...d);return De(h)},{[K]:u}}return Array.isArray(s)?s.map(u=>t(o,u)):D(s)?me(s,u=>t(o,u)):s},n={promises:{},callbacks:{}},r=t(n,e);return[n,r]},z=(e,t)=>{if(Array.isArray(t))return t.map(n=>z(e,n));if(D(t)&&t.hasOwnProperty(j)){let n=t[j];return e.promises[n]}if(D(t)&&t.hasOwnProperty(K)){let n=t[K];return async function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];let[u,l]=$(o),c=await e.callbacks[n](W(u),l);return pe(c)}}return D(t)?me(t,n=>z(e,n)):t},ze=(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}`)}}}),he=e=>e instanceof Promise,D=e=>e&&typeof e=="object"&&!he(e),Oe=e=>typeof e=="function",me=(e,t)=>{let n=r=>{let[o,s]=r;return[o,t(s)]};return Object.fromEntries(Object.entries(e).map(n))},de=(()=>{let e=0;return()=>++e})();var Ue="wix-sdk-bo-hello-handshake",xe=e=>{let{postMessage:t,origin:n}=e,{port1:r,port2:o}=new MessageChannel;t({code:Ue,version:"1.0.0",port:o},n,[o]);let l=fe(L(r));return{channel:l,close:()=>l[I]()}};var ge=(e,t)=>{let n=()=>e.updateHeight(t.offsetHeight),r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()};var He=["https://manage.wix.com","https://manage.editorx.com"],Ie=new Set(He),we=e=>Ie.has(e);var ye=e=>{let t=new EventTarget,n=typeof window>"u",r=l=>{t.dispatchEvent(new CustomEvent("beforeunload",{cancelable:!0}))||(l.preventDefault(),l.returnValue=!0)},o=e.onBeforeUnload(r),s=()=>{n||window.removeEventListener("beforeunload",r),o.then(l=>{let{remove:c}=l;return c()})};return n||(window.addEventListener("beforeunload",r),window.addEventListener("unload",s)),{onBeforeUnload:l=>(t.addEventListener("beforeunload",l),{remove:()=>{t.removeEventListener("beforeunload",l)}}),clearBeforeUnloadHandler:s}};function Re(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 be(e){return e.has("essentials")?Re(e.get("essentials")):void 0}var ve=e=>t=>{let{message:n,action:r,requestId:o}=t;n&&e.showToast({type:"error",details:o!=null?{requestId:o}:void 0,message:n,action:r&&{...r,removeToastOnClick:!0,uiType:"link"}})};var Me=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")||"",o=e.postMessage||window.parent.postMessage.bind(window.parent);if(!we(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:s,close:u}=xe({postMessage:o,origin:r}),l=[u];if(e.autoHeightUpdate===void 0||e.autoHeightUpdate){let M=e.autoHeightElement||document.documentElement,_=ge(s,M);l.push(()=>_())}let{onBeforeUnload:c,clearBeforeUnloadHandler:d}=ye(s);l.push(d);let h=Le(n.get("siteInfo")||"","siteInfo"),p=()=>h,y=new Proxy(s,{get(M,_,J){return _==="onBeforeUnload"?c:_==="getSiteInfo"?p:Reflect.get(M,_,J)}}),{monitoring:P,...q}=be(n)||{},F=Q({hostContext:P?.context,monitoringConfig:P?.config,sentrySDK:typeof window<"u"?window.Sentry:void 0}),N={openItemSelector:s.openItemSelector};return{channel:y,close:()=>l.forEach(M=>M()),getMonitoringClient:F,essentials:q,admin:N,showError:ve(s)}},Le=(e,t)=>{try{return JSON.parse(decodeURIComponent(e))}catch(n){return console.warn(`Failed to parse ${t} query parameter. Make sure to run the code inside a supported Wix App extension.`,n),{}}};var V=oe({createHost:Me});var Se=(e,t)=>{let[n,r]=_e(()=>e());return t(n)&&r(e()),n},je=e=>t=>{let{host:n,compProps:r}=$e(t);return Se(()=>(G({auth:V.auth(),host:n}).enableContext("module"),n),o=>o!==n),r?Be.createElement(e,A({host:n},r)):null},$e=e=>{let{host:t,...n}=e,{host:r,hostType:o}=Se(()=>t?{host:t,hostType:"local"}:{host:V.host(),hostType:"remote"},l=>!!t&&t!==l.host),[s,u]=_e(void 0);return Ke(()=>{if(o==="local")return;let l=r.channel.observeState(d=>{u(d||{})}),c=async()=>{(await l).disconnect(),r.close()};return()=>{c()}},[r,o]),o==="local"?{host:r,compProps:n}:{host:r,compProps:s?{...s,...n}:void 0}};export{je as withContextualWixClient};
1
+ import{a as Q}from"./chunk-EZGPNUD5.js";import{a as G}from"./chunk-RJD2G2AE.js";import"./chunk-Y4HYNW3N.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function A(){return A=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},A.apply(null,arguments)}import Be,{useEffect as Ke,useState as _e}from"react";import{wixContext as g}from"@wix/sdk-context";function X(){let e=typeof $wixContext<"u"&&$wixContext.initWixModules?$wixContext.initWixModules:typeof globalThis.__wix_context__<"u"&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(r,o){return O(()=>e(r,o))},fetchWithAuth(){throw new Error("fetchWithAuth is not available in this context")},graphql(){throw new Error("graphql is not available in this context")}};let t=typeof $wixContext<"u"?$wixContext.client:typeof g.client<"u"?g.client:typeof globalThis.__wix_context__<"u"?globalThis.__wix_context__.client:void 0,n=typeof $wixContext<"u"?$wixContext.elevatedClient:typeof g.elevatedClient<"u"?g.elevatedClient:typeof globalThis.__wix_context__<"u"?globalThis.__wix_context__.elevatedClient:void 0;if(!(!t&&!n))return{initWixModules(r,o){if(o){if(!n)throw new Error("An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules");return O(()=>n.use(r))}if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return O(()=>t.use(r))},fetchWithAuth:(r,o)=>{if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.fetchWithAuth(r,o)},getAuth(){if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.auth},async graphql(r,o,s){if(!t)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return t.graphql(r,o,s)}}}function O(e){let t=globalThis.__wix_context__,n={client:g.client,elevatedClient:g.elevatedClient},r;globalThis.__wix_context__=void 0,g.client=void 0,g.elevatedClient=void 0,typeof $wixContext<"u"&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,g.client=n.client,g.elevatedClient=n.elevatedClient,typeof $wixContext<"u"&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Y(e,t){return{...e,...Object.fromEntries(t.map(n=>[n,(...r)=>{let o=X();if(!o)throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");return o.initWixModules(e)[n].apply(void 0,r)}]))}}function Z(e){return Y({__type:"host",create:t=>Object.entries(e).reduce((n,[r,o])=>({...n,[r]:o(t)}),{})},Object.keys(e))}function b(e){"@babel/helpers - typeof";return b=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},b(e)}function ee(e,t){if(b(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function te(e){var t=ee(e,"string");return b(t)=="symbol"?t:t+""}function ne(e,t,n){return(t=te(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=class extends Error{constructor(t){let{message:n,code:r}=t;super(n),ne(this,"code",void 0),this.message=n,this.code=r}};var re=()=>{let e=a=>{let{channel:i}=a;return function(){let f=i.showToast(...arguments);return{remove:()=>Promise.resolve(f).then(x=>x.remove())}}},t=a=>{let{channel:i}=a;return function(){let f=i.observeState(...arguments);return{disconnect:()=>Promise.resolve(f).then(x=>x.disconnect())}}};return{showToast:e,observeState:t,navigate:a=>{let{channel:i}=a;return function(){return i.navigate(...arguments)}},navigateBack:a=>{let{channel:i}=a;return()=>i.navigateBack()},openModal:a=>{let{channel:i}=a;return(f,m)=>{let[x,k]=typeof f=="string"?[f,m]:[f.modalId,f.params],C=i.openModal(x,k);return{modalClosed:Promise.resolve(C).then(w=>w.modalClosed)}}},closeModal:a=>{let{channel:i}=a;return f=>{if(f===void 0)return i.closeModal();let m=JSON.parse(JSON.stringify(f));return i.closeModal(m)}},getAccessToken:a=>{let{channel:i}=a;return()=>i.getAccessToken()},getPageUrl:a=>{let{channel:i}=a;return function(){return i.getPageUrl(...arguments)}},openMediaManager:a=>{let{channel:i}=a;return function(){return i.openMediaManager(...arguments)}},addSitePlugin:a=>{let{channel:i}=a;return(f,m)=>{let x="802c76e4-b381-4bb3-9152-96acabbf3194",k=m?.placement||{},C=i.openModal(x,{...k,placementsSlotId:m?.slotId,pluginId:f,action:"populate"});return Promise.resolve(C).then(w=>w.modalClosed).then(w=>{if(w?.type===void 0)throw new E({message:"Aborted by user",code:3006});if(w?.type==="ERROR")throw new E(w.data.error)})}},onBeforeUnload:a=>{let{channel:i}=a;return function(){return i.onBeforeUnload(...arguments)}},setPageTitle:a=>{let{channel:i}=a;return f=>i.setPageTitle(f)},getLanguage:a=>{let i=null;return async()=>{var f;if(i)return i;let m=null;return i=await new Promise(x=>{m=t(a)((k,C)=>{x(C.language)})}),(f=m)==null||f.disconnect(),i}},requestFeedback:a=>{let{channel:i}=a;return function(){return i.requestFeedback(...arguments)}},onLayerStateChange:a=>{let{channel:i}=a;return function(){let f=i.onLayerStateChange(...arguments);return{remove:()=>Promise.resolve(f).then(x=>x.remove())}}},installApp:a=>{let{channel:i}=a;return i.installApp},getSiteInfo:a=>{let{channel:i}=a;return i.getSiteInfo},getWidget:a=>{let{channel:i}=a;return function(){if("getWidget"in i)return i.getWidget(...arguments);throw new Error("Unsupported")}},getDashboardPlugins:a=>{let{channel:i}=a;return function(){if("getDashboardPlugins"in i)return i.getDashboardPlugins(...arguments);throw new Error("Unsupported")}},getDashboardMenuPlugins:a=>{let{channel:i}=a;return function(){if("getDashboardMenuPlugins"in i)return i.getDashboardMenuPlugins(...arguments);throw new Error("Unsupported")}},createStore:a=>{let{channel:i}=a;if(i.createStore)return i.createStore},getStore:a=>{let{channel:i}=a;if(i.getStore)return i.getStore}}};var oe=e=>{let{createHost:t}=e,n=re();return{...Z(n),host:t,auth:()=>({getAuthHeaders:async r=>({headers:{Authorization:await n.getAccessToken(r)()}})})}};var se=Symbol("Comlink.proxy"),Pe=Symbol("Comlink.endpoint"),I=Symbol("Comlink.releaseProxy"),U=Symbol("Comlink.thrown"),ae=e=>typeof e=="object"&&e!==null||typeof e=="function",Ce={canHandle:e=>ae(e)&&e[se],serialize(e){let{port1:t,port2:n}=new MessageChannel;return R(e,t),[n,[n]]},deserialize(e){return e.start(),L(e)}},Ee={canHandle:e=>ae(e)&&U 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}},le=new Map([["proxy",Ce],["throw",Ee]]);function R(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;let{id:o,type:s,path:u}=Object.assign({path:[]},r.data),l=(r.data.argumentList||[]).map(v),c;try{let d=u.slice(0,-1).reduce((p,y)=>p[y],e),h=u.reduce((p,y)=>p[y],e);switch(s){case 0:c=h;break;case 1:d[u.slice(-1)[0]]=v(r.data.value),c=!0;break;case 2:c=h.apply(d,l);break;case 3:{let p=new h(...l);c=W(p)}break;case 4:{let{port1:p,port2:y}=new MessageChannel;R(e,y),c=Ae(p,[p])}break;case 5:c=void 0;break}}catch(d){c={value:d,[U]:0}}Promise.resolve(c).catch(d=>({value:d,[U]:0})).then(d=>{let[h,p]=B(d);t.postMessage(Object.assign(Object.assign({},h),{id:o}),p),s===5&&(t.removeEventListener("message",n),ue(t))})}),t.start&&t.start()}function We(e){return e.constructor.name==="MessagePort"}function ue(e){We(e)&&e.close()}function L(e,t){return H(e,[],t)}function T(e){if(e)throw new Error("Proxy has been released and is not useable")}function H(e,t=[],n=function(){}){let r=!1,o=new Proxy(n,{get(s,u){if(T(r),u===I)return()=>S(e,{type:5,path:t.map(l=>l.toString())}).then(()=>{ue(e),r=!0});if(u==="then"){if(t.length===0)return{then:()=>o};let l=S(e,{type:0,path:t.map(c=>c.toString())}).then(v);return l.then.bind(l)}return H(e,[...t,u])},set(s,u,l){T(r);let[c,d]=B(l);return S(e,{type:1,path:[...t,u].map(h=>h.toString()),value:c},d).then(v)},apply(s,u,l){T(r);let c=t[t.length-1];if(c===Pe)return S(e,{type:4}).then(v);if(c==="bind")return H(e,t.slice(0,-1));let[d,h]=ie(l);return S(e,{type:2,path:t.map(p=>p.toString()),argumentList:d},h).then(v)},construct(s,u){T(r);let[l,c]=ie(u);return S(e,{type:3,path:t.map(d=>d.toString()),argumentList:l},c).then(v)}});return o}function ke(e){return Array.prototype.concat.apply([],e)}function ie(e){let t=e.map(B);return[t.map(n=>n[0]),ke(t.map(n=>n[1]))]}var ce=new WeakMap;function Ae(e,t){return ce.set(e,t),e}function W(e){return Object.assign(e,{[se]:!0})}function B(e){for(let[t,n]of le)if(n.canHandle(e)){let[r,o]=n.serialize(e);return[{type:3,name:t,value:r},o]}return[{type:0,value:e},ce.get(e)||[]]}function v(e){switch(e.type){case 3:return le.get(e.name).deserialize(e.value);case 0:return e.value}}function S(e,t,n){return new Promise(r=>{let o=Te();e.addEventListener("message",function s(u){!u.data||!u.data.id||u.data.id!==o||(e.removeEventListener("message",s),r(u.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function Te(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var K="__proxyCallbackId__wixSDK__",j="__proxyPromiseId__wixSDK__",fe=e=>ze(e,t=>async function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];let[s,u]=$(r),l=await t(W(s),u);return pe(l)});var De=async e=>{let[t,n]=$(await e);return W({proxies:t,clonables:n})},pe=async e=>z(e?.proxies,await e?.clonables),$=e=>{let t=(o,s)=>{if(he(s)){let u=de();return o.promises[u]=s,{[j]:u}}if(Oe(s)){let u=de();return o.callbacks[u]=(l,c)=>{let d=z(l,c),h=s(...d);return De(h)},{[K]:u}}return Array.isArray(s)?s.map(u=>t(o,u)):D(s)?me(s,u=>t(o,u)):s},n={promises:{},callbacks:{}},r=t(n,e);return[n,r]},z=(e,t)=>{if(Array.isArray(t))return t.map(n=>z(e,n));if(D(t)&&t.hasOwnProperty(j)){let n=t[j];return e.promises[n]}if(D(t)&&t.hasOwnProperty(K)){let n=t[K];return async function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];let[u,l]=$(o),c=await e.callbacks[n](W(u),l);return pe(c)}}return D(t)?me(t,n=>z(e,n)):t},ze=(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}`)}}}),he=e=>e instanceof Promise,D=e=>e&&typeof e=="object"&&!he(e),Oe=e=>typeof e=="function",me=(e,t)=>{let n=r=>{let[o,s]=r;return[o,t(s)]};return Object.fromEntries(Object.entries(e).map(n))},de=(()=>{let e=0;return()=>++e})();var Ue="wix-sdk-bo-hello-handshake",xe=e=>{let{postMessage:t,origin:n}=e,{port1:r,port2:o}=new MessageChannel;t({code:Ue,version:"1.0.0",port:o},n,[o]);let l=fe(L(r));return{channel:l,close:()=>l[I]()}};var ge=(e,t)=>{let n=()=>e.updateHeight(t.offsetHeight),r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()};var He=["https://manage.wix.com","https://manage.editorx.com"],Ie=new Set(He),we=e=>Ie.has(e);var ye=e=>{let t=new EventTarget,n=typeof window>"u",r=l=>{t.dispatchEvent(new CustomEvent("beforeunload",{cancelable:!0}))||(l.preventDefault(),l.returnValue=!0)},o=e.onBeforeUnload(r),s=()=>{n||window.removeEventListener("beforeunload",r),o.then(l=>{let{remove:c}=l;return c()})};return n||(window.addEventListener("beforeunload",r),window.addEventListener("unload",s)),{onBeforeUnload:l=>(t.addEventListener("beforeunload",l),{remove:()=>{t.removeEventListener("beforeunload",l)}}),clearBeforeUnloadHandler:s}};function Re(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 be(e){return e.has("essentials")?Re(e.get("essentials")):void 0}var ve=e=>t=>{let{message:n,action:r,requestId:o}=t;n&&e.showToast({type:"error",details:o!=null?{requestId:o}:void 0,message:n,action:r&&{...r,removeToastOnClick:!0,uiType:"link"}})};var Me=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")||"",o=e.postMessage||window.parent.postMessage.bind(window.parent);if(!we(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:s,close:u}=xe({postMessage:o,origin:r}),l=[u];if(e.autoHeightUpdate===void 0||e.autoHeightUpdate){let M=e.autoHeightElement||document.documentElement,_=ge(s,M);l.push(()=>_())}let{onBeforeUnload:c,clearBeforeUnloadHandler:d}=ye(s);l.push(d);let h=Le(n.get("siteInfo")||"","siteInfo"),p=()=>h,y=new Proxy(s,{get(M,_,J){return _==="onBeforeUnload"?c:_==="getSiteInfo"?p:Reflect.get(M,_,J)}}),{monitoring:P,...q}=be(n)||{},F=Q({hostContext:P?.context,monitoringConfig:P?.config,sentrySDK:typeof window<"u"?window.Sentry:void 0}),N={openItemSelector:s.openItemSelector};return{channel:y,close:()=>l.forEach(M=>M()),getMonitoringClient:F,essentials:q,admin:N,showError:ve(s)}},Le=(e,t)=>{try{return JSON.parse(decodeURIComponent(e))}catch(n){return console.warn(`Failed to parse ${t} query parameter. Make sure to run the code inside a supported Wix App extension.`,n),{}}};var V=oe({createHost:Me});var Se=(e,t)=>{let[n,r]=_e(()=>e());return t(n)&&r(e()),n},je=e=>t=>{let{host:n,compProps:r}=$e(t);return Se(()=>(G({auth:V.auth(),host:n}).enableContext("module"),n),o=>o!==n),r?Be.createElement(e,A({host:n},r)):null},$e=e=>{let{host:t,...n}=e,{host:r,hostType:o}=Se(()=>t?{host:t,hostType:"local"}:{host:V.host(),hostType:"remote"},l=>!!t&&t!==l.host),[s,u]=_e(void 0);return Ke(()=>{if(o==="local")return;let l=r.channel.observeState(d=>{u(d||{})}),c=async()=>{(await l).disconnect(),r.close()};return()=>{c()}},[r,o]),o==="local"?{host:r,compProps:n}:{host:r,compProps:s?{...s,...n}:void 0}};export{je as withContextualWixClient};
2
2
  //# sourceMappingURL=dashboard.js.map
@@ -1,4 +1,4 @@
1
- import{a as ke}from"./chunk-EZGPNUD5.js";import{a as Ne}from"./chunk-WBKL5IQV.js";import"./chunk-R7FAXXP7.js";import{c as fi,d as Pi}from"./chunk-7EYXEF6M.js";import{b as Se,d as Oe,e as ui,f as l,g as a,h,i as w,j as u}from"./chunk-SBZEOPXX.js";var Fe=Se(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.EventType=void 0;var We;(function(i){i.removeAppCompleted="removeAppCompleted",i.componentSelectionChanged="componentSelectionChanged",i.appInstalled="appInstalled",i.appUpdateCompleted="appUpdateCompleted"})(We||(ht.EventType=We={}))});var Ut=Se(A=>{"use strict";var gi=A&&A.__createBinding||(Object.create?function(i,t,e,n){n===void 0&&(n=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(i,n,s)}:function(i,t,e,n){n===void 0&&(n=e),i[n]=t[e]}),mi=A&&A.__setModuleDefault||(Object.create?function(i,t){Object.defineProperty(i,"default",{enumerable:!0,value:t})}:function(i,t){i.default=t}),Ii=A&&A.__importStar||function(){var i=function(t){return i=Object.getOwnPropertyNames||function(e){var n=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[n.length]=s);return n},i(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=i(t),s=0;s<n.length;s++)n[s]!=="default"&&gi(e,t,n[s]);return mi(e,t),e}}();Object.defineProperty(A,"__esModule",{value:!0});A.EventType=A.WixSDKTypes=void 0;var wi=Ii((Pi(),ui(fi)));A.WixSDKTypes=wi;var Ai=Fe();Object.defineProperty(A,"EventType",{enumerable:!0,get:function(){return Ai.EventType}})});var H=Oe(Ut(),1);var O=class O{constructor(){l(this,"uid",0);l(this,"callbacks",new Map);l(this,"inTransaction",!1);l(this,"isSilent",!1);l(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 n=e();if(n&&n.hasOwnProperty("then"))try{return this.notifyWithStep(t,O.EventSteps.Start),n=await n,this.notifyWithStep(t,O.EventSteps.End),n}catch(s){throw this.notifyWithStep({...t,meta:{...t.meta,error:s}},O.EventSteps.Error),s}else return this.notify(t),n}};l(O,"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}),l(O,"EventSteps",{Start:"start",End:"end",Error:"error"});var $t=O,ut=(i=>(i.WorkerSpawn="WorkerSpawn",i.HostEvent="HostEvent",i.ApplicationsSpecsReceived="ApplicationsSpecsReceived",i.InitApplicationApi="InitApplicationApi",i.RunApplication="RunApplication",i.getApplicationApi="getApplicationApi",i.IframeInit="IframeInit",i))(ut||{}),qt=(i=>(i.EditorReady="EditorReady",i))(qt||{});var x=(i=>(i.ApplicationInit="ApplicationInit",i.ApplicationExecute="ApplicationExecute",i.ApplicationRemoved="ApplicationRemoved",i.ApplicationLoad="ApplicationLoad",i.ApplicationApiInit="ApplicationApiInit",i.CustomEvent="CustomEvent",i.HostEvent="HostEvent",i.EditorReady="EditorReady",i))(x||{}),jt=class{createApplicationRemovedEvent(t){return{type:"ApplicationRemoved",payload:{appDefinitionId:t},meta:{bi:{evid:C.biEvents.PLATFORM_WORKER_SPAWN,appDefId:t}}}}createApplicationLoadEvent(t,e){return{type:"ApplicationLoad",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:C.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:C.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:C.biEvents.PLATFORM_APP_API_INIT,appDefId:t,scope:e}}}}},C=class extends $t{constructor(){super(...arguments);l(this,"factories",new jt)}},dt=class dt{constructor(t){this.events=t}mapToPlatformHostEvent(t){if(typeof t=="string")try{t=JSON.parse(t)}catch{}return{type:ut.HostEvent,payload:{type:t.args.eventType,...t.args.eventPayload},meta:{appDefinitionId:t.appDefinitionId??null,intent:t.intent}}}notify(t){let e=this.mapToPlatformHostEvent(t);dt.allowedEvents.includes(e.payload.type)&&this.events.notify(e)}};l(dt,"allowedEvents",[H.EventType.componentSelectionChanged,H.EventType.appInstalled,H.EventType.appUpdateCompleted,H.EventType.removeAppCompleted]);var Le=dt;var I=class i extends Error{constructor(e,n,s){let o=e?` ${e}`:"",r=`[${s}]#${n}`;super(`${r}.${o}`);l(this,"state",{});l(this,"displayName");l(this,"prefix");l(this,"errorMessage");l(this,"parent");l(this,"messages",[]);l(this,"code");this.displayName=r,this.errorMessage=e,this.prefix=s,this.code=n,this.name=r,Object.defineProperty(this,"message",{get:()=>this.getDisplayMessage()}),Error.captureStackTrace&&Error.captureStackTrace(this,i)}get parentError(){let e=this.parent;if(!e)return null;if(this.parent instanceof i)return this.parent;let n=e.name??"[Unknown Error]";return{getBreadcrumbs(){return[n]},getMessage(){return[n,e.message??"unknown error message"].join(`
1
+ import{a as ke}from"./chunk-EZGPNUD5.js";import{a as Ne}from"./chunk-RJD2G2AE.js";import"./chunk-Y4HYNW3N.js";import{c as fi,d as Pi}from"./chunk-7EYXEF6M.js";import{b as Se,d as Oe,e as ui,f as l,g as a,h,i as w,j as u}from"./chunk-SBZEOPXX.js";var Fe=Se(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.EventType=void 0;var We;(function(i){i.removeAppCompleted="removeAppCompleted",i.componentSelectionChanged="componentSelectionChanged",i.appInstalled="appInstalled",i.appUpdateCompleted="appUpdateCompleted"})(We||(ht.EventType=We={}))});var Ut=Se(A=>{"use strict";var gi=A&&A.__createBinding||(Object.create?function(i,t,e,n){n===void 0&&(n=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(i,n,s)}:function(i,t,e,n){n===void 0&&(n=e),i[n]=t[e]}),mi=A&&A.__setModuleDefault||(Object.create?function(i,t){Object.defineProperty(i,"default",{enumerable:!0,value:t})}:function(i,t){i.default=t}),Ii=A&&A.__importStar||function(){var i=function(t){return i=Object.getOwnPropertyNames||function(e){var n=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[n.length]=s);return n},i(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=i(t),s=0;s<n.length;s++)n[s]!=="default"&&gi(e,t,n[s]);return mi(e,t),e}}();Object.defineProperty(A,"__esModule",{value:!0});A.EventType=A.WixSDKTypes=void 0;var wi=Ii((Pi(),ui(fi)));A.WixSDKTypes=wi;var Ai=Fe();Object.defineProperty(A,"EventType",{enumerable:!0,get:function(){return Ai.EventType}})});var H=Oe(Ut(),1);var O=class O{constructor(){l(this,"uid",0);l(this,"callbacks",new Map);l(this,"inTransaction",!1);l(this,"isSilent",!1);l(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 n=e();if(n&&n.hasOwnProperty("then"))try{return this.notifyWithStep(t,O.EventSteps.Start),n=await n,this.notifyWithStep(t,O.EventSteps.End),n}catch(s){throw this.notifyWithStep({...t,meta:{...t.meta,error:s}},O.EventSteps.Error),s}else return this.notify(t),n}};l(O,"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}),l(O,"EventSteps",{Start:"start",End:"end",Error:"error"});var $t=O,ut=(i=>(i.WorkerSpawn="WorkerSpawn",i.HostEvent="HostEvent",i.ApplicationsSpecsReceived="ApplicationsSpecsReceived",i.InitApplicationApi="InitApplicationApi",i.RunApplication="RunApplication",i.getApplicationApi="getApplicationApi",i.IframeInit="IframeInit",i))(ut||{}),qt=(i=>(i.EditorReady="EditorReady",i))(qt||{});var x=(i=>(i.ApplicationInit="ApplicationInit",i.ApplicationExecute="ApplicationExecute",i.ApplicationRemoved="ApplicationRemoved",i.ApplicationLoad="ApplicationLoad",i.ApplicationApiInit="ApplicationApiInit",i.CustomEvent="CustomEvent",i.HostEvent="HostEvent",i.EditorReady="EditorReady",i))(x||{}),jt=class{createApplicationRemovedEvent(t){return{type:"ApplicationRemoved",payload:{appDefinitionId:t},meta:{bi:{evid:C.biEvents.PLATFORM_WORKER_SPAWN,appDefId:t}}}}createApplicationLoadEvent(t,e){return{type:"ApplicationLoad",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:C.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:C.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:C.biEvents.PLATFORM_APP_API_INIT,appDefId:t,scope:e}}}}},C=class extends $t{constructor(){super(...arguments);l(this,"factories",new jt)}},dt=class dt{constructor(t){this.events=t}mapToPlatformHostEvent(t){if(typeof t=="string")try{t=JSON.parse(t)}catch{}return{type:ut.HostEvent,payload:{type:t.args.eventType,...t.args.eventPayload},meta:{appDefinitionId:t.appDefinitionId??null,intent:t.intent}}}notify(t){let e=this.mapToPlatformHostEvent(t);dt.allowedEvents.includes(e.payload.type)&&this.events.notify(e)}};l(dt,"allowedEvents",[H.EventType.componentSelectionChanged,H.EventType.appInstalled,H.EventType.appUpdateCompleted,H.EventType.removeAppCompleted]);var Le=dt;var I=class i extends Error{constructor(e,n,s){let o=e?` ${e}`:"",r=`[${s}]#${n}`;super(`${r}.${o}`);l(this,"state",{});l(this,"displayName");l(this,"prefix");l(this,"errorMessage");l(this,"parent");l(this,"messages",[]);l(this,"code");this.displayName=r,this.errorMessage=e,this.prefix=s,this.code=n,this.name=r,Object.defineProperty(this,"message",{get:()=>this.getDisplayMessage()}),Error.captureStackTrace&&Error.captureStackTrace(this,i)}get parentError(){let e=this.parent;if(!e)return null;if(this.parent instanceof i)return this.parent;let n=e.name??"[Unknown Error]";return{getBreadcrumbs(){return[n]},getMessage(){return[n,e.message??"unknown error message"].join(`
2
2
  `)}}}getDisplayMessage(){return[(this.parentError?this.getBreadcrumbs():[]).join(" -> "),this.getMessage()].filter(n=>n.trim().length).join(`
3
3
  `)}getMessage(){let e=Object.entries(this.state).reduce((c,[p,d])=>(d&&c.push(` \u2013 ${p}: ${d}`),c),[]).join(`
4
4
  `),n=this.messages.reduce((c,p)=>(c.push(` - ${p.join(" ")}`),c),[]).join(`
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-R7FAXXP7.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function o(e,t=!1){return n(e,t)}var s=["wix.com","editorx.com"];var u=new RegExp(`\\.(${s.join("|")})$`),c=["42.wixprod.net","uw2-edt-1.wixprod.net"],a="dev.wix-code.com";var _=new RegExp(`\\.(${c.join("|")})$`),m=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 E=o(e=>(t,i)=>e.fetchWithAuth(t,i));export{r as enableContext};
1
+ import{a as n}from"./chunk-Y4HYNW3N.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function o(e,t=!1){return n(e,t)}var s=["wix.com","editorx.com"];var u=new RegExp(`\\.(${s.join("|")})$`),c=["42.wixprod.net","uw2-edt-1.wixprod.net"],a="dev.wix-code.com";var _=new RegExp(`\\.(${c.join("|")})$`),m=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 E=o(e=>(t,i)=>e.fetchWithAuth(t,i));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 // payloads with deep arrays or complex arrays are not serializable as URLSearchParams\n const isPayloadNonSerializableAsUrlSearchParams = Object.entries(flatten).some(([key, value]) => key.includes('.') ||\n (Array.isArray(value) && value.some((v) => typeof v === 'object')));\n const shouldSerializeToRParam = isComplexRequest && isPayloadNonSerializableAsUrlSearchParams;\n if (shouldSerializeToRParam) {\n return new URLSearchParams({ '.r': base64Encode(JSON.stringify(params)) });\n }\n else {\n return 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 ||\n param === null ||\n (Array.isArray(value) && typeof param === 'object')) {\n return;\n }\n urlSearchParams.append(key, param);\n });\n return urlSearchParams;\n }, new URLSearchParams());\n }\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 return mappings;\n }\n const rootDomainMappings = resolveRootDomain(domain, domainToMappings);\n if (!rootDomainMappings) {\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 rootDomainMappings ?? [];\n}\nfunction resolveRootDomain(domain, domainToMappings) {\n return Object.entries(domainToMappings).find(([entryDomain]) => {\n const [, ...rooDomainSegments] = domain.split('.');\n return rooDomainSegments.join('.') === entryDomain;\n })?.[1];\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,CAwDA,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,EClEnF,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 // payloads with deep arrays or complex arrays are not serializable as URLSearchParams\n const isPayloadNonSerializableAsUrlSearchParams = Object.entries(flatten).some(([key, value]) => key.includes('.') ||\n (Array.isArray(value) && value.some((v) => typeof v === 'object')));\n const shouldSerializeToRParam = isComplexRequest && isPayloadNonSerializableAsUrlSearchParams;\n if (shouldSerializeToRParam) {\n return new URLSearchParams({ '.r': base64Encode(JSON.stringify(params)) });\n }\n else {\n return 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 ||\n param === null ||\n (Array.isArray(value) && typeof param === 'object')) {\n return;\n }\n urlSearchParams.append(key, param);\n });\n return urlSearchParams;\n }, new URLSearchParams());\n }\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 return mappings;\n }\n const rootDomainMappings = resolveRootDomain(domain, domainToMappings);\n if (!rootDomainMappings) {\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 rootDomainMappings ?? [];\n}\nfunction resolveRootDomain(domain, domainToMappings) {\n return Object.entries(domainToMappings).find(([entryDomain]) => {\n const [, ...rooDomainSegments] = domain.split('.');\n return rooDomainSegments.join('.') === entryDomain;\n })?.[1];\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,CAwDA,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,EClEnF,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 as s}from"./chunk-WBKL5IQV.js";import"./chunk-R7FAXXP7.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function c(){let n=null,e=null;return{promise:new Promise((o,i)=>{n=o,e=i}),resolve:n,reject:e}}var d=({createHost:n})=>({__type:"host",create:e=>({}),host:e=>{let{applicationId:t}=e??{},o=typeof window<"u"?window.wixEmbedsAPI:void 0,i=n(e),r=m();return{...i,apiBaseUrl:r,getMonitoringClient:o?.getMonitoringClientFunction?.(t),essentials:{language:typeof window<"u"?window.commonConfig?.language:void 0,locale:typeof window<"u"?window.commonConfig?.locale:void 0}}},auth:e=>{let t=typeof window<"u"?window.wixEmbedsAPI:void 0;e||(e=t?.getAccessTokenFunction?.());let o=!1,{resolve:i,promise:r}=c();return{getAuthHeaders:async()=>{if(!e&&o&&(e=await r),!e)throw new Error("Failed to resolve auth token");return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(o=!0,u=>{i(u)})}}});function m(){let e=(typeof window<"u"?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!=="/"?`${t.hostname}${t.pathname}`:t.hostname}var l=({clientSdk:n,applicationId:e})=>({invoke:async({namespace:t,method:o,args:i})=>{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:t,method:o,args:i,applicationId:e,accessToken:"accessToken"})},getAccessToken:()=>{throw new Error("Not implemented")},observeState:()=>({disconnect:()=>{}})});var w=function(n){let e=(typeof $wixContext<"u"?$wixContext.clientSdk:void 0)??n?.clientSdk??(typeof window<"u"?window?.clientSdk:void 0),{applicationId:t}=n||{};if(!t)throw new Error('"createHost" was called without a required field "applicationId"');return{channel:l({clientSdk:e,applicationId:t}),close:()=>{}}};var a=d({createHost:w});var v=n=>{let e=a.host({applicationId:n}),t=a.auth(),o=t.getAccessTokenInjector();return s({auth:t,host:e}).enableContext("module"),{injectGetAccessToken:o}},P=({host:n,auth:e})=>{s({host:n,auth:e}).enableContext("module")};export{v as enableClient,P as enablePanelClient};
1
+ import{a as s}from"./chunk-RJD2G2AE.js";import"./chunk-Y4HYNW3N.js";import"./chunk-7EYXEF6M.js";import"./chunk-SBZEOPXX.js";function c(){let n=null,e=null;return{promise:new Promise((o,i)=>{n=o,e=i}),resolve:n,reject:e}}var d=({createHost:n})=>({__type:"host",create:e=>({}),host:e=>{let{applicationId:t}=e??{},o=typeof window<"u"?window.wixEmbedsAPI:void 0,i=n(e),r=m();return{...i,apiBaseUrl:r,getMonitoringClient:o?.getMonitoringClientFunction?.(t),essentials:{language:typeof window<"u"?window.commonConfig?.language:void 0,locale:typeof window<"u"?window.commonConfig?.locale:void 0}}},auth:e=>{let t=typeof window<"u"?window.wixEmbedsAPI:void 0;e||(e=t?.getAccessTokenFunction?.());let o=!1,{resolve:i,promise:r}=c();return{getAuthHeaders:async()=>{if(!e&&o&&(e=await r),!e)throw new Error("Failed to resolve auth token");return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(o=!0,u=>{i(u)})}}});function m(){let e=(typeof window<"u"?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!=="/"?`${t.hostname}${t.pathname}`:t.hostname}var l=({clientSdk:n,applicationId:e})=>({invoke:async({namespace:t,method:o,args:i})=>{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:t,method:o,args:i,applicationId:e,accessToken:"accessToken"})},getAccessToken:()=>{throw new Error("Not implemented")},observeState:()=>({disconnect:()=>{}})});var w=function(n){let e=(typeof $wixContext<"u"?$wixContext.clientSdk:void 0)??n?.clientSdk??(typeof window<"u"?window?.clientSdk:void 0),{applicationId:t}=n||{};if(!t)throw new Error('"createHost" was called without a required field "applicationId"');return{channel:l({clientSdk:e,applicationId:t}),close:()=>{}}};var a=d({createHost:w});var v=n=>{let e=a.host({applicationId:n}),t=a.auth(),o=t.getAccessTokenInjector();return s({auth:t,host:e}).enableContext("module"),{injectGetAccessToken:o}},P=({host:n,auth:e})=>{s({host:n,auth:e}).enableContext("module")};export{v as enableClient,P as enablePanelClient};
2
2
  //# sourceMappingURL=site.js.map
@@ -3,25 +3,25 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  executeCommand,
5
5
  log
6
- } from "./chunk-NQ4YNX6A.js";
6
+ } from "./chunk-KJXVS3IU.js";
7
7
  import {
8
8
  PreviewCommand
9
- } from "./chunk-PRRRKDRX.js";
10
- import "./chunk-WOIU7VIM.js";
9
+ } from "./chunk-SMEOB2J6.js";
10
+ import "./chunk-CXBQHWIM.js";
11
11
  import "./chunk-3QFT6UQF.js";
12
- import "./chunk-TNH2NG27.js";
13
- import "./chunk-U2CR5VPH.js";
14
- import "./chunk-YLUVMDX7.js";
15
- import "./chunk-PTXQ3EPG.js";
16
- import "./chunk-GWE3BRHX.js";
17
- import "./chunk-FDSZMRFC.js";
18
- import "./chunk-UWCQA4MW.js";
19
- import "./chunk-R5HMH6QX.js";
12
+ import "./chunk-HPHTU6UB.js";
13
+ import "./chunk-5I6K4LMZ.js";
14
+ import "./chunk-V4VNLYCR.js";
15
+ import "./chunk-3FSEHEJA.js";
16
+ import "./chunk-P7IRRCF7.js";
17
+ import "./chunk-QVI67Q6A.js";
18
+ import "./chunk-RPHZ4OP3.js";
19
+ import "./chunk-HBEVHWYL.js";
20
20
  import {
21
21
  CliError,
22
22
  CliErrorCode,
23
23
  require_react
24
- } from "./chunk-DLJA76CA.js";
24
+ } from "./chunk-4GVN5OSZ.js";
25
25
  import {
26
26
  __toESM,
27
27
  init_esm_shims
@@ -51,4 +51,4 @@ async function nonInteractivePreview(services, model, options) {
51
51
  export {
52
52
  nonInteractivePreview
53
53
  };
54
- //# sourceMappingURL=preview-6SJAV4D6.js.map
54
+ //# sourceMappingURL=preview-3ABHWSP4.js.map
@@ -3,28 +3,28 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  executeCommand,
5
5
  log
6
- } from "./chunk-NQ4YNX6A.js";
6
+ } from "./chunk-KJXVS3IU.js";
7
7
  import {
8
8
  ReleaseCommand
9
- } from "./chunk-FUAEI7OE.js";
10
- import "./chunk-PRRRKDRX.js";
11
- import "./chunk-WOIU7VIM.js";
9
+ } from "./chunk-W6OUY5DV.js";
10
+ import "./chunk-SMEOB2J6.js";
11
+ import "./chunk-CXBQHWIM.js";
12
12
  import "./chunk-3QFT6UQF.js";
13
- import "./chunk-TNH2NG27.js";
14
- import "./chunk-U2CR5VPH.js";
15
- import "./chunk-3GHB2NXZ.js";
16
- import "./chunk-YLUVMDX7.js";
17
- import "./chunk-PTXQ3EPG.js";
18
- import "./chunk-GWE3BRHX.js";
19
- import "./chunk-FDSZMRFC.js";
20
- import "./chunk-UWCQA4MW.js";
21
- import "./chunk-R5HMH6QX.js";
13
+ import "./chunk-HPHTU6UB.js";
14
+ import "./chunk-5I6K4LMZ.js";
15
+ import "./chunk-MFPD7G6B.js";
16
+ import "./chunk-V4VNLYCR.js";
17
+ import "./chunk-3FSEHEJA.js";
18
+ import "./chunk-P7IRRCF7.js";
19
+ import "./chunk-QVI67Q6A.js";
20
+ import "./chunk-RPHZ4OP3.js";
21
+ import "./chunk-HBEVHWYL.js";
22
22
  import {
23
23
  CliError,
24
24
  CliErrorCode,
25
25
  require_react,
26
26
  toJsonString
27
- } from "./chunk-DLJA76CA.js";
27
+ } from "./chunk-4GVN5OSZ.js";
28
28
  import {
29
29
  __toESM,
30
30
  init_esm_shims
@@ -56,4 +56,4 @@ async function nonInteractiveRelease(services, model, releaseProps) {
56
56
  export {
57
57
  nonInteractiveRelease
58
58
  };
59
- //# sourceMappingURL=release-JUZK53KH.js.map
59
+ //# sourceMappingURL=release-DZGPFN7M.js.map
@@ -3,14 +3,14 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  renderCommand,
5
5
  runCommand
6
- } from "./chunk-NU7CPDB5.js";
7
- import "./chunk-WOIU7VIM.js";
6
+ } from "./chunk-IPSCL6EX.js";
7
+ import "./chunk-CXBQHWIM.js";
8
8
  import "./chunk-3QFT6UQF.js";
9
- import "./chunk-FDSZMRFC.js";
10
- import "./chunk-DLJA76CA.js";
9
+ import "./chunk-QVI67Q6A.js";
10
+ import "./chunk-4GVN5OSZ.js";
11
11
  import "./chunk-4EFJZ3GQ.js";
12
12
  export {
13
13
  renderCommand,
14
14
  runCommand
15
15
  };
16
- //# sourceMappingURL=render-command-FFAZSU54.js.map
16
+ //# sourceMappingURL=render-command-TDM7CFXE.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wix/cli-app",
3
3
  "description": "CLI tool for Wix apps",
4
- "version": "1.1.134",
4
+ "version": "1.1.135",
5
5
  "author": "Amit Dahan",
6
6
  "dependencies": {
7
7
  "esbuild": "^0.25.0",
@@ -14,15 +14,15 @@
14
14
  "@types/mustache": "^4.2.5",
15
15
  "@types/react": "^18.3.3",
16
16
  "@types/semver": "^7.5.8",
17
- "@wix/ambassador-blocks-v1-application-structure": "^1.0.8",
17
+ "@wix/ambassador-blocks-v1-application-structure": "^1.0.9",
18
18
  "@wix/ambassador-blocks-v1-blocks-app": "^1.0.78",
19
19
  "@wix/ambassador-cli-site-override-service-v1-site-override": "^1.0.11",
20
20
  "@wix/ambassador-ctp-app-cloud-backend-service-v1-app-cloud-backend-deployment": "^1.0.15",
21
21
  "@wix/ambassador-ctp-gradual-rollout-v1-app-config": "^1.0.82",
22
- "@wix/ambassador-devcenter-apps-v1-app-old": "^1.0.124",
22
+ "@wix/ambassador-devcenter-apps-v1-app-old": "^1.0.125",
23
23
  "@wix/app-cloud-uploader": "^1.18.0",
24
24
  "@wix/arm-client": "0.0.0",
25
- "@wix/bi-logger-dev-tools-data": "^1.125.0",
25
+ "@wix/bi-logger-dev-tools-data": "^1.127.0",
26
26
  "@wix/cli-app-definitions": "0.0.0",
27
27
  "@wix/cli-app-manifest": "1.0.0",
28
28
  "@wix/cli-app-platform-sdk": "0.0.0",
@@ -155,5 +155,5 @@
155
155
  ]
156
156
  }
157
157
  },
158
- "falconPackageHash": "7b058ab80a6868685c1d9afa83ffa59cfe67d6ba2396870fdbee7f9c"
158
+ "falconPackageHash": "ac05e143d963bf2c0d793ee99c645f0d96a937127000b973b5fc08b5"
159
159
  }
@@ -18,7 +18,7 @@ const CustomElement: FC<Props> = ({
18
18
  <h2>{displayName}</h2>
19
19
  <hr />
20
20
  <p>
21
- This is a Site Widget generated by Wix CLI.<br />
21
+ This is a Custom Element generated by Wix CLI.<br />
22
22
  Continue to develop this widget at <code>'<%- readablePath %>'</code>.
23
23
  </p>
24
24
  </div>
@@ -1,19 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import {
4
- PreviewCommand
5
- } from "./chunk-PRRRKDRX.js";
6
- import "./chunk-TNH2NG27.js";
7
- import "./chunk-U2CR5VPH.js";
8
- import "./chunk-YLUVMDX7.js";
9
- import "./chunk-PTXQ3EPG.js";
10
- import "./chunk-GWE3BRHX.js";
11
- import "./chunk-FDSZMRFC.js";
12
- import "./chunk-UWCQA4MW.js";
13
- import "./chunk-R5HMH6QX.js";
14
- import "./chunk-DLJA76CA.js";
15
- import "./chunk-4EFJZ3GQ.js";
16
- export {
17
- PreviewCommand
18
- };
19
- //# sourceMappingURL=PreviewCommand-Y7JEA26N.js.map
@@ -1,23 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import {
4
- ReleaseCommand,
5
- ReleaseVersionType
6
- } from "./chunk-FUAEI7OE.js";
7
- import "./chunk-PRRRKDRX.js";
8
- import "./chunk-TNH2NG27.js";
9
- import "./chunk-U2CR5VPH.js";
10
- import "./chunk-3GHB2NXZ.js";
11
- import "./chunk-YLUVMDX7.js";
12
- import "./chunk-PTXQ3EPG.js";
13
- import "./chunk-GWE3BRHX.js";
14
- import "./chunk-FDSZMRFC.js";
15
- import "./chunk-UWCQA4MW.js";
16
- import "./chunk-R5HMH6QX.js";
17
- import "./chunk-DLJA76CA.js";
18
- import "./chunk-4EFJZ3GQ.js";
19
- export {
20
- ReleaseCommand,
21
- ReleaseVersionType
22
- };
23
- //# sourceMappingURL=ReleaseCommand-QIDFQA2M.js.map