import{w as f}from"./_virtual_wix-context-reexport-script.ch.CnSZZUzD.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const S={_id:"id",_createdDate:"createdDate",_updatedDate:"updatedDate"};function w(e){return N(e).map(t=>t.toLocaleUpperCase()).join("_")}const D=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),O=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),I="$1\0$2",W=/[^\p{L}\d]+/giu;function N(e){let t=e.trim();t=t.replace(D,I).replace(O,I),t=t.replace(W,"\0");let n=0,r=t.length;for(;t.charAt(n)==="\0";)n++;if(n===r)return[];for(;t.charAt(r-1)==="\0";)r--;return t.slice(n,r).split(/\0/g)}const q=e=>{var t,n;return"validationError"in(((n=(t=e.response)==null?void 0:t.data)==null?void 0:n.details)??{})},C=e=>{var t,n;return"applicationError"in(((n=(t=e.response)==null?void 0:t.data)==null?void 0:n.details)??{})},L=e=>{var t,n;return(((t=e.response)==null?void 0:t.status)??-1)>=400&&(((n=e.response)==null?void 0:n.status)??-1)<500};function U(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){var r,o,s,a;if(typeof e!="object"||e===null)throw e;if(q(e))return K(e,t,n);if(C(e))return F(e);if(L(e)){const i=(r=e.response)==null?void 0:r.status,c=((o=e.response)==null?void 0:o.statusText)??"UNKNOWN",u=((a=(s=e.response)==null?void 0:s.data)==null?void 0:a.message)??c,d={applicationError:{description:c,code:w(c),data:{}},requestId:e.requestId};return m(e,{message:JSON.stringify({message:u,details:d},null,2),extraProperties:{details:d,status:i}})}return X(e)}const K=(e,t,n)=>{var u,d,l,p;const r=(u=e.response)==null?void 0:u.data,o=e.requestId,{fieldViolations:s}=r.details.validationError,a=(d=j(t,s,n))==null?void 0:d.sort((x,_)=>x.field<_.field?-1:1),i=`INVALID_ARGUMENT: ${(l=a==null?void 0:a.map(({field:x,description:_})=>`"${x}" ${_}`))==null?void 0:l.join(", ")}`,c={validationError:{fieldViolations:a},requestId:o};return m(e,{message:JSON.stringify({message:i,details:c},null,2),extraProperties:{details:c,status:(p=e.response)==null?void 0:p.status,requestId:o}})},m=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),F=e=>{var u,d,l,p,x,_,v,h,y,b,P,A,T,R,E,$;const t=(u=e.response)==null?void 0:u.status,n=((d=e.response)==null?void 0:d.statusText)??"UNKNOWN",r=((p=(l=e.response)==null?void 0:l.data)==null?void 0:p.message)??n,o=((h=(v=(_=(x=e.response)==null?void 0:x.data)==null?void 0:_.details)==null?void 0:v.applicationError)==null?void 0:h.description)??n,s=((A=(P=(b=(y=e.response)==null?void 0:y.data)==null?void 0:b.details)==null?void 0:P.applicationError)==null?void 0:A.code)??w(n),a=(($=(E=(R=(T=e.response)==null?void 0:T.data)==null?void 0:R.details)==null?void 0:E.applicationError)==null?void 0:$.data)??{},i=r===o?r:`${r}: ${o}`,c={applicationError:{description:o,code:s,data:a},requestId:e.requestId};return m(e,{message:JSON.stringify({message:i,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},X=e=>{var n,r;const t=e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`;return m(e,{message:t,extraProperties:{requestId:e.requestId,status:(n=e.response)==null?void 0:n.status,code:w(((r=e.response)==null?void 0:r.statusText)??"UNKNOWN"),...!e.response&&{runtimeError:e}}})},j=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,o)=>{const s={...e,...t},a=Object.keys(s);return r==null?void 0:r.filter(i=>!r.some(u=>u.field.length>i.field.length&&u.field.startsWith(i.field)&&a.includes(u.field))).map(i=>{var d;const c=t[i.field];if(c)return{...i,field:M(c,o)};const u=(d=a==null?void 0:a.sort((l,p)=>p.length-l.length))==null?void 0:d.find(l=>i.field.startsWith(l));if(u){const l=s[u];if(l)return{...i,field:i.field.replace(u,M(l,o))}}return n?{...i,field:`${o[0]}.${i.field}`}:i})},M=(e,t)=>{const n=k(e);return n!==null&&typeof n<"u"?e.replace(`$[${n}]`,t[n]):e},k=e=>{const t=e.match(/\$\[(?\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function G(e,t,n){const r=s=>n.includes(s),o=(s,a)=>{if(Array.isArray(s))s.forEach(i=>{o(i,a)});else if(typeof s=="object"&&s!==null){const i=s;Object.keys(i).forEach(c=>{const u=a===""?c:`${a}.${c}`;r(u)||(c in t&&!(t[c]in i)&&(i[t[c]]=i[c],delete i[c]),o(i[c],u))})}};return o(e,""),e}function z(e,t=[]){return G(e,S,t)}function J(){const 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 g(()=>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")}};const t=typeof $wixContext<"u"?$wixContext.client:typeof f.client<"u"?f.client:typeof globalThis.__wix_context__<"u"?globalThis.__wix_context__.client:void 0,n=typeof $wixContext<"u"?$wixContext.elevatedClient:typeof f.elevatedClient<"u"?f.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 g(()=>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 g(()=>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 g(e){const t=globalThis.__wix_context__,n={client:f.client,elevatedClient:f.elevatedClient};let r;globalThis.__wix_context__=void 0,f.client=void 0,f.elevatedClient=void 0,typeof $wixContext<"u"&&(r={client:$wixContext==null?void 0:$wixContext.client,elevatedClient:$wixContext==null?void 0:$wixContext.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,f.client=n.client,f.elevatedClient=n.elevatedClient,typeof $wixContext<"u"&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function B(e,t){return((...n)=>{const r=J();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function H(e,t=!1){return B(e,t)}function Q(e){const t=se(e.host),n=ae(t,e.domainToMappings),r=de(e.protoPath,e.data||{});return pe(r,n)}const Y=["wix.com","editorx.com"],Z="_",V=new RegExp(`\\.(${Y.join("|")})$`),ee=["42.wixprod.net","uw2-edt-1.wixprod.net"],te="dev.wix-code.com",ne=/{(.*)}/,re=new RegExp(`\\.(${ee.join("|")})$`),oe=new RegExp(`.*\\.${te}$`);function se(e){return ie(e).replace(V,"._base_domain_").replace(re,"._api_base_domain_").replace(oe,"*.dev.wix-code.com")}function ie(e){return e.replace("create.editorx.com","editor.editorx.com")}function ae(e,t){const n=t[e]||t[Z];return!n&&ce(e)?t[ue]:n}function ce(e){return!!e.match(/\._base_domain_$/)}const ue="www._base_domain_";function de(e,t){return e.split("/").map(n=>le(n,t)).join("/")}function le(e,t){const n=e.match(ne)||[],r=n[1];if(r){const o=e.replace(n[0],"");return fe(t,r,e,o)}return e}function fe(e,t,n,r){let o=e;for(const s of t.split(".")){if(!o)return n;o=o[s]}return`${o}${r}`}function pe(e,t){const n=t==null?void 0:t.find(r=>e.startsWith(r.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function xe(e){return Q(Object.assign(e,{domainToMappings:{"www._base_domain_":[{srcPath:"/_serverless/analytics-reporter",destPath:""}],_:[{srcPath:"/_serverless/analytics-reporter",destPath:""}],"api._api_base_domain_":[{srcPath:"/analytics-reporter",destPath:""}],"www.wixapis.com":[{srcPath:"/meta-analytics",destPath:""}]}}))}var _e="@wix/auto_sdk_promote_analytics";function me(e){function t({host:n}){return{entityFqdn:"wix.promote.meta_event_reporter.v1.event",method:"POST",methodFqn:"com.wixpress.serverless.promote_analytics_reporter.MetaEventReporter.ReportMetaEvent",packageName:_e,migrationOptions:{optInTransformResponse:!0},url:xe({protoPath:"/v1/events/report",data:e,host:n}),data:e}}return t}async function ge(e,t){var a,i,c;const{httpClient:n,sideEffects:r}=arguments[2],o=z({event:e,metaTrackingParams:t==null?void 0:t.metaTrackingParams}),s=me(o);(a=r==null?void 0:r.onSiteCall)==null||a.call(r);try{const u=await n.request(s);(i=r==null?void 0:r.onSuccess)==null||i.call(r,u)}catch(u){const d=U(u,{spreadPathsToArguments:{},explicitPathsToArguments:{event:"$[0]",metaTrackingParams:"$[1].metaTrackingParams"},singleArgumentUnchanged:!1},["event","options"]);throw(c=r==null?void 0:r.onError)==null||c.call(r,u),d}}function we(e){return(t,n)=>ge(t,n,{httpClient:e})}var ve=H(we);if(wixTagManager.getConfig().experiments["specs.CapiCliEmbeddedScriptMigration"]){let e=function(){window.wixDevelopersAnalytics.register("cf06bdf3-5bab-4f20-b165-97fb723dac6a",async(n,r)=>{try{const o=t("_fbp"),s=t("_fbc");await ve({name:n,data:r},{metaTrackingParams:{...o&&{fbp:o},...s&&{fbc:s}}})}catch(o){console.error("Error reporting event:",n,o)}})},t=function(n){const r=document.cookie.match(new RegExp(`${n}=(.+?);`));return r?r[1]:null};window.wixDevelopersAnalytics?e():window.addEventListener("wixDevelopersAnalyticsReady",e)}else{let e=function(){window.wixDevelopersAnalytics.register("cf06bdf3-5bab-4f20-b165-97fb723dac6a",(n,r,o)=>{const s=t();fetch(`${window.location.origin}/_serverless/analytics-reporter/facebook/event`,{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":s},body:JSON.stringify({eventName:n,data:r})})});function t(){var n=document.cookie.match(new RegExp("XSRF-TOKEN=(.+?);"));return n?n[1]:""}};window.wixDevelopersAnalytics?e():window.addEventListener("wixDevelopersAnalyticsReady",e)} //# sourceMappingURL=3f1cd43a-87ec-4b1f-b07f-8a443a683fbd.ch.Cl_S_FY0.js.map