@zonos/elements 1.3.179 → 1.3.180

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 (40) hide show
  1. package/dist/cjs/index.cjs.js +7 -7
  2. package/dist/cjs/{paypal-b426662c.js → paypal-e032a7fc.js} +1 -1
  3. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +1 -1
  4. package/dist/cjs/zonos-checkout.cjs.entry.js +1 -1
  5. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +1 -1
  6. package/dist/collection/components/store/checkout/paypal.js +1 -1
  7. package/dist/collection/types/generated/graphql.internal.types.js +27 -0
  8. package/dist/esm/index.js +7 -7
  9. package/dist/esm/{paypal-f365b438.js → paypal-a1a69765.js} +1 -1
  10. package/dist/esm/zonos-cart-items_13.entry.js +1 -1
  11. package/dist/esm/zonos-checkout.entry.js +1 -1
  12. package/dist/esm/zonos-empty-state-payment_4.entry.js +1 -1
  13. package/dist/esm-es5/index.js +1 -1
  14. package/dist/esm-es5/{paypal-f365b438.js → paypal-a1a69765.js} +1 -1
  15. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  16. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  17. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  18. package/dist/scripts/index.d.ts +1 -0
  19. package/dist/scripts/index.js +1 -1
  20. package/dist/scripts/loadZonos.js +1 -1
  21. package/dist/scripts/zonos.js +1 -1
  22. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  23. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  24. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  25. package/dist/types/types/generated/graphql.internal.types.d.ts +192 -35
  26. package/dist/types/types/generated/graphql.internal.types.ts +200 -30
  27. package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -23
  28. package/dist/zonos-elements/index.esm.js +1 -1
  29. package/dist/zonos-elements/{p-92bae5f5.system.js → p-464a3633.system.js} +1 -1
  30. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  31. package/dist/zonos-elements/{p-c831bfcd.system.entry.js → p-797fab15.system.entry.js} +1 -1
  32. package/dist/zonos-elements/{p-c4ab09cd.entry.js → p-b7e1254e.entry.js} +1 -1
  33. package/dist/zonos-elements/{p-06fb8a1d.entry.js → p-b8c2c94d.entry.js} +1 -1
  34. package/dist/zonos-elements/{p-9719a7ef.system.js → p-bb1d560d.system.js} +1 -1
  35. package/dist/zonos-elements/{p-3b864e9c.js → p-cced0000.js} +1 -1
  36. package/dist/zonos-elements/{p-215afb3c.entry.js → p-d6eda1f8.entry.js} +1 -1
  37. package/dist/zonos-elements/{p-755f1a87.system.entry.js → p-f424d6b4.system.entry.js} +1 -1
  38. package/dist/zonos-elements/{p-4e6c5167.system.entry.js → p-ff6e291b.system.entry.js} +1 -1
  39. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function e(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o=()=>window.location.search.includes("zonosStagingMode=1"),n=()=>{var e;return(null===(e=window.Zonos.zonosApiKey)||void 0===e?void 0:e.includes("test"))||window.location.search.includes("zonosTestMode=1")},t=["cloudflare","vercel"],r=t[0],s={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},i=s[r],a=(e=r)=>{const o=t.indexOf(e),n=t[o+1];return n||null},d=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},l=performance.now(),c=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},p=(e,o,...n)=>{var t,r;const{elapsedTimePretty:s}=(()=>{const e=performance.now()-l,o=e>1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(2)}ms`;return{elapsedTime:e,elapsedTimePretty:o}})(),i=[`(${s})`,...n];i.map(c).join(" ");if(!(!!(null===(t=window.Zonos)||void 0===t?void 0:t.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...i));let a=document.querySelector("iframe#zonos---debug-logging-iframe");a||(a=document.createElement("iframe"),a.id="zonos---debug-logging-iframe",a.style.display="none",a.style.opacity="0",a.style.position="absolute",a.style.top="-9999px",a.style.left="-9999px",a.style.width="1px",a.style.height="1px",a.style.border="none",a.style.overflow="hidden",a.style.visibility="hidden",document.body.appendChild(a));const d=(null===(r=a.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(o){case"warn":d.warn(e,...i);break;case"info":d.info(e,...i);break;case"error":d.error(e,...i);break;default:d.groupCollapsed(e,...i),d.trace(),d.groupEnd()}},u=()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,n="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||n},w=["/api/zonos-elements/log-script-load","/api/zonos-elements/log-bulk-load-data"],m=({apiPath:e,apiType:o,loadTimeInternal:n,loadTimeTotal:t})=>{if(w.includes(e))return;const r=t-n;if(r<0)return;const s=e.split("?")[0]||e,i=(()=>{const e="userAgentData"in window.navigator?window.navigator.userAgentData:null,o=u();return{connectionDownlink:null==o?void 0:o.downlink,connectionEffectiveType:null==o?void 0:o.effectiveType,connectionRtt:null==o?void 0:o.rtt,connectionSaveData:null==o?void 0:o.saveData,isHostedCheckout:window.Zonos.isLegacyCheckout,screenHeight:window.screen.height,screenWidth:window.innerWidth,userAgent:e&&e.brands.length>0?e:window.navigator.userAgent}})(),a="object"==typeof i.userAgent&&i.userAgent.mobile,d={apiType:o,connectionType:i.connectionEffectiveType,href:s,isHostedCheckout:window.Zonos.isLegacyCheckout,isMobile:(l=a,l||window.innerWidth<890),loadTimeBrowserApi:r,loadTimeInternal:n,loadTimeTotal:t,metadata:Object.assign({},i),screenHeight:i.screenHeight,screenWidth:i.screenWidth,userAgent:"string"==typeof i.userAgent?i.userAgent:i.userAgent.brands.map((e=>e.brand)).filter((e=>!/Not.*A.*Brand.*/.test(e))).join(",")};var l;window.Zonos.loadTimeApiInfoList.push(d)},g=async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:t})=>{if(p("sendErrorLog","warn",e,n,o),t){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const r="userAgentData"in window.navigator?window.navigator.userAgentData:null,d={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:r&&r.brands.length>0?r:window.navigator.userAgent},n)};try{fetch(`${i}/api/zonos-elements/log-error`,{body:JSON.stringify(d),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=a();if(!o)return;fetch(`${s[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(d),method:"POST"})}},f=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{const o=await e.text(),n=d(o);if(!n)throw new Error(`Failed to parse content: ${o}`);return n}catch(e){if(n)throw e;return o&&console.error(e),null}},y=async({basePathType:e,options:o,path:n})=>{let t;const i=window.Zonos.zonosQaUrlApi||s[e]||r,a=new URL(i+n),d=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;a.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(d));try{t=await fetch(a.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:i,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:i,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const l=t.headers.get("Zonos-Mode"),c=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&l&&c&&(window.Zonos.modeAlerted=!0),t.ok){return{baseUrl:i,errors:[],json:await f({response:t}),response:t,zonosMode:l}}const p=t.status.toString();try{const e=await f({response:t,shouldThrow:!0});if(e&&"errors"in e&&Array.isArray(e.errors)){const o=e.errors;return{baseUrl:i,errors:o.map((e=>"string"==typeof e?{message:e,type:p}:e)),json:null,response:t,zonosMode:l}}return{baseUrl:i,errors:[{message:JSON.stringify(e),type:p}],json:null,response:t,zonosMode:l}}catch(e){return{baseUrl:i,errors:[{message:`${p}: ${"Unknown error"}`,type:p}],json:null,response:null,zonosMode:l}}},h=async({basePathType:o,options:n,path:t})=>{var r,i;const l=t.startsWith("/api/bigcommerce")?"vercel":o,c=performance.now(),u=await y({basePathType:l,options:n,path:t}),{errors:w,response:f}=u,v=e(u,["errors","response"]),Z=performance.now()-c;p(`${t} (${Z.toFixed(2)}ms)`,"info");const z=null==f?void 0:f.headers.get("Zonos-Duration");200===(null==f?void 0:f.status)&&m({apiPath:t,apiType:l,loadTimeInternal:z?Number(z):0,loadTimeTotal:Z});const S=a(l),b=!!w.find((({type:e})=>"unknown"===e))||404===(null==f?void 0:f.status),O=S&&b;return b&&g({endpoint:s[l]+t,errors:w.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:l,nextFallbackApiType:S,requestHeaders:null==n?void 0:n.headers,requestPayload:d(null===(r=null==n?void 0:n.body)||void 0===r?void 0:r.toString())||(null===(i=null==n?void 0:n.body)||void 0===i?void 0:i.toString()),status:null==f?void 0:f.status,statusText:null==f?void 0:f.statusText},shouldPostReleaseErrorReporting:!0}),O?(p(`=== "${t}" failed to fetch, trying next fallback ${S}`),h({basePathType:S,options:n,path:t})):Object.assign({errors:w,response:f},v)},v=async(t,s)=>{const i=e(s||{},[]),a=i.body?JSON.stringify(i.body):void 0,d=i.method||"GET",l=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Staging-Mode":o()?"1":void 0,"Zonos-Test-Mode":n()?"1":void 0,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},i.headers);Object.keys(l).forEach((e=>void 0===l[e]&&delete l[e]));const c=Object.assign(Object.assign({},i),{body:"GET"===d?void 0:a,headers:l,method:d}),p=new URLSearchParams(window.location.search).get("useFallbackApi");return h({basePathType:p||r,options:c,path:t})},Z=(e,...o)=>{p(e,"error",...o)},z=["jsdelivr","cdnjs","unpkg","vercel"],S=e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");if(!o)return null;return/[^a-zA-Z0-9-_]+/.test(o)?null:o},b=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,O=new RegExp(`^${b.source}$`),L=new RegExp(`^cart_${b.source}$`),I=/^[a-zA-Z0-9]{2,}$/,T=/^cart_[a-zA-Z0-9]{2,}$/,A=e=>e?e.includes("undefined")?{isDgsCartId:!1,isLegacyCartId:!1}:T.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:I.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:L.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:O.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1},C=async({cartId:e,retries:o})=>{const t=n(),{errors:r,json:s,zonosMode:i}=await v("/api/zonos-elements/get-cart",{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),a=!s||r.length;return a&&o?(p("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):a?null:Object.assign(Object.assign({},s),{zonosMode:i})};var U;const k=(()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=S(window.location.href),n="https://v1.3.179.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const t=`https://${o}.preview.js.zonos.com`;return p(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,n=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",n),window.location.reload(),null})),t})(),j=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrlApi");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),o=S(window.location.href),n=e||o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.demo.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.demo.elements.zonos.com";if(!e)return null;const t=`https://${e}.route.js.zonos.com`;return p(`[ZONOS-WARNING] using '${t}' for serverless API`,"warn"),t})();class ${}U=$,$.isNpm=!1,$.isBigCommerce=!1,$.requested=!1,$.zonosMode=null,$.cartData=null,$.domain=window.location!=window.parent.location?document.referrer:document.location.hostname,$.version="v1.3.179",$.isLegacyCheckout=!1,$.legacyStoreLogo=null,$.legacyStoreFavicon=null,$.parallelLoadTimes=[],$.parallelLoadState="off",$.releaseDate="1743782528334",$.loadTimeApiInfoList=[],$.cartSettings=null,$.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:n,metadata:t,scriptLoadUrl:r,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(r)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!n},t)))}catch(e){}},$.loadScriptLogParallelHandler=async e=>{try{if(U.parallelLoadTimes.push(e),2===U.parallelLoadTimes.length){const e=U.parallelLoadTimes.find((e=>"vercel"===e.type)),o=U.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void g({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});U.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},$.legacyCheckoutErrorHandler=({message:e,metadata:o})=>{Z(`[ZONOS - loadZonos] ${e}`),g({endpoint:"LegacyCheckoutInit",errors:[e],metadata:Object.assign(Object.assign({},o),{tempCartUUID:U.cartId})}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},$.getGithubCdn=({type:e,version:o})=>{let n="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.179";"cdnjs"===e?n="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.179":"unpkg"===e&&(n="https://unpkg.com/@zonos/elements@1.3.179");return o&&"alpha"!==o?n.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${o}`).replace(/\/zonos-elements\/(.+)/,`/zonos-elements/${o}`):n},$.injectZonos=({cdnType:e="jsdelivr",initConfig:o,parallelLoaded:n,vercelUrl:t,version:r})=>{var s;o=Object.assign(Object.assign({},o),{zonosApiKey:U.zonosApiKey}),r&&(window.Zonos.version=`v${r}`);const i="vercel"===e?t:U.getGithubCdn({type:e,version:r}),a=k||i,d=a.replace("https://","").replace("http://",""),l=document.createElement("script"),c=r&&r<"1.2.5"?"loadZonos.js":"zonos.js";l.src=`https://${d}/dist/scripts/${c}?timestamp=${Date.now()}`,p(`[ZONOS - loadZonos] Injecting "${c}" from "${d}"`,"info");const w="4g"===(null===(s=u())||void 0===s?void 0:s.effectiveType),m=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),f=z[0]===e,y=z[1],h="on"===U.parallelLoadState&&w&&f&&y&&!m;h&&U.injectZonos({cdnType:y,initConfig:o,parallelLoaded:!0,vercelUrl:t,version:r});const v=performance.now();l.addEventListener("load",(()=>{if(h||n?U.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:l.src,storeId:U.storeId,type:e}):U.loadScriptLogHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:l.src,storeId:U.storeId,type:e}),U.isBigCommerce||(U.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.isNpm=!1,window.Zonos.zonosQaUrl=k,window.Zonos.zonosQaUrlApi=j,window.Zonos.isBigCommerce=U.isBigCommerce,window.Zonos.loadTimeApiInfoList=U.loadTimeApiInfoList,U.cartId){if(!U.zonosApiKey)throw U.legacyCheckoutErrorHandler({message:"zonosApiKey is missing to initiate checkout"}),new Error("zonosApiKey is required for legacy checkout");if(!U.cartData)throw U.legacyCheckoutErrorHandler({message:"cartData is missing to initiate legacy checkout"}),new Error("cartData is required for legacy checkout");if(U.legacyStoreFavicon&&U.isLegacyCheckout){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=U.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.cartData=U.cartData,window.Zonos.isLegacyCheckout=U.isLegacyCheckout,window.Zonos.cartSettings=U.cartSettings;const e=Object.assign(Object.assign({},o),{appearance:Object.assign(Object.assign({},o.appearance),{logoUrl:U.legacyStoreLogo||""}),zonosApiKey:U.zonosApiKey});o=e}window.Zonos.version&&(p(`[ZONOS - loadZonos] Execute "Zonos.init" from "${c}" from "${d}"`,"info"),window.Zonos.init(o))})),l.addEventListener("error",(async()=>{const s=(e=>{const o=z.indexOf(e);return z[o+1]||null})(e);if(!h&&!n){if(!s)return;U.injectZonos({cdnType:s,initConfig:o,vercelUrl:t,version:r})}if(["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||k)return;if(h||n)return void U.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,isError:!0,scriptLoadUrl:l.src,storeId:U.storeId,type:e});["unpkg","cdnjs","vercel"].includes(e)?g({endpoint:l.src,errors:[`zonos.js - Failed to fetch ${e} CDN.`],metadata:{cdnLoadTime:performance.now()-v,cdnType:e,loadUrl:a,version:r},shouldPostReleaseErrorReporting:!!s}):g({endpoint:l.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{cdnType:e,vercelLoadTime:performance.now()-v}})})),document.head.appendChild(l)},$.init=async e=>{var t;if(p("=== Init zonos script release date","info",U.releaseDate),k&&!window.isZonosPreview){p(`[ZONOS - loadZonos] Re-inject "loadZonos.js" from zonosQaUrl: ${k}`,"info");const o=document.createElement("script");return o.src=`${k}/dist/scripts/loadZonos.js?timestamp=${Date.now()}`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=!1,window.Zonos.isBigCommerce=U.isBigCommerce,window.Zonos.isLegacyCheckout=U.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${k}`)})),void(window.isZonosPreview=!0)}const r=new URLSearchParams(window.location.search).get("tempCartUUID"),{isDgsCartId:s,isLegacyCartId:i}=A(r);if(r&&!i&&!s)return void U.legacyCheckoutErrorHandler({message:`[ZONOS - loadZonos] invalid &tempCartUUID=${r}`,metadata:{invalidCartId:!0}});U.cartId=r;const a="https://v1.3.179.js.zonos.com",d=document.querySelector('script[src*="/zonos.js"]'),l=null===(t=document.querySelector("script[src*='/loadZonos.js']"))||void 0===t?void 0:t.src;p(`[ZONOS - init] first load script src: ${l}`,"info"),window.Zonos.zonosQaUrl=k,window.Zonos.zonosQaUrlApi=j,window.Zonos.zonosQaUrl&&p(`[ZONOS - init] using zonosQaUrl: ${window.Zonos.zonosQaUrl}`,"info"),window.Zonos.zonosQaUrlApi&&p(`[ZONOS - init] using zonosQaUrlApi: ${window.Zonos.zonosQaUrlApi}`,"info");const c=null==l?void 0:l.includes("timestamp=");if(!(U.isNpm||l&&c))return void Z("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(d||!l||U.requested)return void p("[ZONOS - loadZonos] script is already loaded or requested","info");if(!e.zonosApiKey&&!U.cartId)return U.legacyCheckoutErrorHandler({message:"Zonos API key is required unless `tempCartUUID` is provided in url query params."}),void Z("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(U.requested=!0,U.zonosApiKey=e.zonosApiKey,U.storeId=e.storeId,U.cartId){const e=await(async e=>{const{isDgsCartId:o,isLegacyCartId:n}=A(e);if(!n&&!o)return Z("[ZONOS - loadZonos] invalid cart id"),null;const t=await C({cartId:e,retries:5});return p("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(Z("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(U.cartId);if(!e)throw U.legacyCheckoutErrorHandler({message:"Error getting cart data"}),new Error("Error getting cart data");U.cartData=e.cartData,U.cartSettings=e.settings,U.legacyStoreLogo=e.storeLogo,U.legacyStoreFavicon=e.storeFavicon,U.storeId=e.storeId,U.zonosApiKey=e.zonosApiKey}if(!U.zonosApiKey)return void Z('"zonosApiKey" is required to initialize Zonos');const u=await(async()=>{const e=n(),t=o();if(!e&&!t||!window.Zonos.zonosApiKey)return null;if(p("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return p("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:r,json:s}=await v("/api/get-test-public-credential");if(r.length||!s)return Z("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",r),null;const i=s.publicCredential;return i?(p(`[ZONOS - loadZonos] Retrieve new test public token ${i}`,"info"),i):(Z("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();if(u&&(p(`[ZONOS - loadZonos] Using test API key: ${u} for test mode`,"info"),U.zonosApiKey=u),!U.storeId)return p("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void U.injectZonos({initConfig:e,vercelUrl:a,version:null});const w=U.storeId||e.storeId;p(`[ZONOS - loadZonos] Store ID: ${w}`,"info");const m=new URLSearchParams;m.set("storeId",w.toString()),window.location.search.includes("_enableStoreVersionPinned=1")&&m.set("_enableStoreVersionPinned","1");const{errors:g,json:f}=await v(`/api/get-store-version?${m.toString()}`);if(g.length||!f)return p("[ZONOS - loadZonos] Error getting store version, loading the latest version.","error"),void U.injectZonos({initConfig:e,vercelUrl:a,version:null});const{isDifferent:y,source:h,version:z}=f;if(p(`[ZONOS - loadZonos] Store version: ${z}, source: ${h}`,"info"),y){p(`[ZONOS - loadZonos] Updating saved store version to ${z}`,"info");const e={storeId:w,version:z};v(`/api/set-store-version?${m.toString()}`,{body:e,method:"POST"}).catch((e=>Z("Unable to save store's vesrion",e)))}if(!d){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,n=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),t=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:t,isWhiteListed:n}})({loadScriptSrc:l}),r=t&&!n?o:`${"alpha"===z?"alpha":`v${z}`}.js.zonos.com`,s=t&&!n?null:z;p("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t,loadUrl:r,loadVersion:s,version:z}),U.injectZonos({initConfig:e,vercelUrl:r,version:s})}},(void 0===window.Zonos||window.isZonosPreview&&!window.Zonos.doneInit)&&(window.Zonos=$)})();
1
+ (function(){"use strict";function e(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o=()=>window.location.search.includes("zonosStagingMode=1"),n=()=>{var e;return(null===(e=window.Zonos.zonosApiKey)||void 0===e?void 0:e.includes("test"))||window.location.search.includes("zonosTestMode=1")},t=["cloudflare","vercel"],r=t[0],s={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},i=s[r],a=(e=r)=>{const o=t.indexOf(e),n=t[o+1];return n||null},d=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},l=performance.now(),c=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},p=(e,o,...n)=>{var t,r;const{elapsedTimePretty:s}=(()=>{const e=performance.now()-l,o=e>1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(2)}ms`;return{elapsedTime:e,elapsedTimePretty:o}})(),i=[`(${s})`,...n];i.map(c).join(" ");if(!(!!(null===(t=window.Zonos)||void 0===t?void 0:t.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...i));let a=document.querySelector("iframe#zonos---debug-logging-iframe");a||(a=document.createElement("iframe"),a.id="zonos---debug-logging-iframe",a.style.display="none",a.style.opacity="0",a.style.position="absolute",a.style.top="-9999px",a.style.left="-9999px",a.style.width="1px",a.style.height="1px",a.style.border="none",a.style.overflow="hidden",a.style.visibility="hidden",document.body.appendChild(a));const d=(null===(r=a.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(o){case"warn":d.warn(e,...i);break;case"info":d.info(e,...i);break;case"error":d.error(e,...i);break;default:d.groupCollapsed(e,...i),d.trace(),d.groupEnd()}},u=()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,n="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||n},w=["/api/zonos-elements/log-script-load","/api/zonos-elements/log-bulk-load-data"],m=({apiPath:e,apiType:o,loadTimeInternal:n,loadTimeTotal:t})=>{if(w.includes(e))return;const r=t-n;if(r<0)return;const s=e.split("?")[0]||e,i=(()=>{const e="userAgentData"in window.navigator?window.navigator.userAgentData:null,o=u();return{connectionDownlink:null==o?void 0:o.downlink,connectionEffectiveType:null==o?void 0:o.effectiveType,connectionRtt:null==o?void 0:o.rtt,connectionSaveData:null==o?void 0:o.saveData,isHostedCheckout:window.Zonos.isLegacyCheckout,screenHeight:window.screen.height,screenWidth:window.innerWidth,userAgent:e&&e.brands.length>0?e:window.navigator.userAgent}})(),a="object"==typeof i.userAgent&&i.userAgent.mobile,d={apiType:o,connectionType:i.connectionEffectiveType,href:s,isHostedCheckout:window.Zonos.isLegacyCheckout,isMobile:(l=a,l||window.innerWidth<890),loadTimeBrowserApi:r,loadTimeInternal:n,loadTimeTotal:t,metadata:Object.assign({},i),screenHeight:i.screenHeight,screenWidth:i.screenWidth,userAgent:"string"==typeof i.userAgent?i.userAgent:i.userAgent.brands.map((e=>e.brand)).filter((e=>!/Not.*A.*Brand.*/.test(e))).join(",")};var l;window.Zonos.loadTimeApiInfoList.push(d)},g=async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:t})=>{if(p("sendErrorLog","warn",e,n,o),t){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const r="userAgentData"in window.navigator?window.navigator.userAgentData:null,d={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:r&&r.brands.length>0?r:window.navigator.userAgent},n)};try{fetch(`${i}/api/zonos-elements/log-error`,{body:JSON.stringify(d),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=a();if(!o)return;fetch(`${s[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(d),method:"POST"})}},f=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{const o=await e.text(),n=d(o);if(!n)throw new Error(`Failed to parse content: ${o}`);return n}catch(e){if(n)throw e;return o&&console.error(e),null}},y=async({basePathType:e,options:o,path:n})=>{let t;const i=window.Zonos.zonosQaUrlApi||s[e]||r,a=new URL(i+n),d=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;a.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(d));try{t=await fetch(a.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:i,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:i,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const l=t.headers.get("Zonos-Mode"),c=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&l&&c&&(window.Zonos.modeAlerted=!0),t.ok){return{baseUrl:i,errors:[],json:await f({response:t}),response:t,zonosMode:l}}const p=t.status.toString();try{const e=await f({response:t,shouldThrow:!0});if(e&&"errors"in e&&Array.isArray(e.errors)){const o=e.errors;return{baseUrl:i,errors:o.map((e=>"string"==typeof e?{message:e,type:p}:e)),json:null,response:t,zonosMode:l}}return{baseUrl:i,errors:[{message:JSON.stringify(e),type:p}],json:null,response:t,zonosMode:l}}catch(e){return{baseUrl:i,errors:[{message:`${p}: ${"Unknown error"}`,type:p}],json:null,response:null,zonosMode:l}}},h=async({basePathType:o,options:n,path:t})=>{var r,i;const l=t.startsWith("/api/bigcommerce")?"vercel":o,c=performance.now(),u=await y({basePathType:l,options:n,path:t}),{errors:w,response:f}=u,v=e(u,["errors","response"]),Z=performance.now()-c;p(`${t} (${Z.toFixed(2)}ms)`,"info");const z=null==f?void 0:f.headers.get("Zonos-Duration");200===(null==f?void 0:f.status)&&m({apiPath:t,apiType:l,loadTimeInternal:z?Number(z):0,loadTimeTotal:Z});const S=a(l),b=!!w.find((({type:e})=>"unknown"===e))||404===(null==f?void 0:f.status),O=S&&b;return b&&g({endpoint:s[l]+t,errors:w.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:l,nextFallbackApiType:S,requestHeaders:null==n?void 0:n.headers,requestPayload:d(null===(r=null==n?void 0:n.body)||void 0===r?void 0:r.toString())||(null===(i=null==n?void 0:n.body)||void 0===i?void 0:i.toString()),status:null==f?void 0:f.status,statusText:null==f?void 0:f.statusText},shouldPostReleaseErrorReporting:!0}),O?(p(`=== "${t}" failed to fetch, trying next fallback ${S}`),h({basePathType:S,options:n,path:t})):Object.assign({errors:w,response:f},v)},v=async(t,s)=>{const i=e(s||{},[]),a=i.body?JSON.stringify(i.body):void 0,d=i.method||"GET",l=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Staging-Mode":o()?"1":void 0,"Zonos-Test-Mode":n()?"1":void 0,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},i.headers);Object.keys(l).forEach((e=>void 0===l[e]&&delete l[e]));const c=Object.assign(Object.assign({},i),{body:"GET"===d?void 0:a,headers:l,method:d}),p=new URLSearchParams(window.location.search).get("useFallbackApi");return h({basePathType:p||r,options:c,path:t})},Z=(e,...o)=>{p(e,"error",...o)},z=["jsdelivr","cdnjs","unpkg","vercel"],S=e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");if(!o)return null;return/[^a-zA-Z0-9-_]+/.test(o)?null:o},b=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,O=new RegExp(`^${b.source}$`),L=new RegExp(`^cart_${b.source}$`),I=/^[a-zA-Z0-9]{2,}$/,T=/^cart_[a-zA-Z0-9]{2,}$/,A=e=>e?e.includes("undefined")?{isDgsCartId:!1,isLegacyCartId:!1}:T.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:I.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:L.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:O.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1},C=async({cartId:e,retries:o})=>{const t=n(),{errors:r,json:s,zonosMode:i}=await v("/api/zonos-elements/get-cart",{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),a=!s||r.length;return a&&o?(p("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):a?null:Object.assign(Object.assign({},s),{zonosMode:i})};var U;const k=(()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=S(window.location.href),n="https://v1.3.180.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const t=`https://${o}.preview.js.zonos.com`;return p(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,n=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",n),window.location.reload(),null})),t})(),j=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrlApi");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),o=S(window.location.href),n=e||o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.demo.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.demo.elements.zonos.com";if(!e)return null;const t=`https://${e}.route.js.zonos.com`;return p(`[ZONOS-WARNING] using '${t}' for serverless API`,"warn"),t})();class ${}U=$,$.isNpm=!1,$.isBigCommerce=!1,$.requested=!1,$.zonosMode=null,$.cartData=null,$.domain=window.location!=window.parent.location?document.referrer:document.location.hostname,$.version="v1.3.180",$.isLegacyCheckout=!1,$.legacyStoreLogo=null,$.legacyStoreFavicon=null,$.parallelLoadTimes=[],$.parallelLoadState="off",$.releaseDate="1743787286110",$.loadTimeApiInfoList=[],$.cartSettings=null,$.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:n,metadata:t,scriptLoadUrl:r,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(r)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!n},t)))}catch(e){}},$.loadScriptLogParallelHandler=async e=>{try{if(U.parallelLoadTimes.push(e),2===U.parallelLoadTimes.length){const e=U.parallelLoadTimes.find((e=>"vercel"===e.type)),o=U.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void g({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});U.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},$.legacyCheckoutErrorHandler=({message:e,metadata:o})=>{Z(`[ZONOS - loadZonos] ${e}`),g({endpoint:"LegacyCheckoutInit",errors:[e],metadata:Object.assign(Object.assign({},o),{tempCartUUID:U.cartId})}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},$.getGithubCdn=({type:e,version:o})=>{let n="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.180";"cdnjs"===e?n="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.180":"unpkg"===e&&(n="https://unpkg.com/@zonos/elements@1.3.180");return o&&"alpha"!==o?n.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${o}`).replace(/\/zonos-elements\/(.+)/,`/zonos-elements/${o}`):n},$.injectZonos=({cdnType:e="jsdelivr",initConfig:o,parallelLoaded:n,vercelUrl:t,version:r})=>{var s;o=Object.assign(Object.assign({},o),{zonosApiKey:U.zonosApiKey}),r&&(window.Zonos.version=`v${r}`);const i="vercel"===e?t:U.getGithubCdn({type:e,version:r}),a=k||i,d=a.replace("https://","").replace("http://",""),l=document.createElement("script"),c=r&&r<"1.2.5"?"loadZonos.js":"zonos.js";l.src=`https://${d}/dist/scripts/${c}?timestamp=${Date.now()}`,p(`[ZONOS - loadZonos] Injecting "${c}" from "${d}"`,"info");const w="4g"===(null===(s=u())||void 0===s?void 0:s.effectiveType),m=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),f=z[0]===e,y=z[1],h="on"===U.parallelLoadState&&w&&f&&y&&!m;h&&U.injectZonos({cdnType:y,initConfig:o,parallelLoaded:!0,vercelUrl:t,version:r});const v=performance.now();l.addEventListener("load",(()=>{if(h||n?U.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:l.src,storeId:U.storeId,type:e}):U.loadScriptLogHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:l.src,storeId:U.storeId,type:e}),U.isBigCommerce||(U.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.isNpm=!1,window.Zonos.zonosQaUrl=k,window.Zonos.zonosQaUrlApi=j,window.Zonos.isBigCommerce=U.isBigCommerce,window.Zonos.loadTimeApiInfoList=U.loadTimeApiInfoList,U.cartId){if(!U.zonosApiKey)throw U.legacyCheckoutErrorHandler({message:"zonosApiKey is missing to initiate checkout"}),new Error("zonosApiKey is required for legacy checkout");if(!U.cartData)throw U.legacyCheckoutErrorHandler({message:"cartData is missing to initiate legacy checkout"}),new Error("cartData is required for legacy checkout");if(U.legacyStoreFavicon&&U.isLegacyCheckout){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=U.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.cartData=U.cartData,window.Zonos.isLegacyCheckout=U.isLegacyCheckout,window.Zonos.cartSettings=U.cartSettings;const e=Object.assign(Object.assign({},o),{appearance:Object.assign(Object.assign({},o.appearance),{logoUrl:U.legacyStoreLogo||""}),zonosApiKey:U.zonosApiKey});o=e}window.Zonos.version&&(p(`[ZONOS - loadZonos] Execute "Zonos.init" from "${c}" from "${d}"`,"info"),window.Zonos.init(o))})),l.addEventListener("error",(async()=>{const s=(e=>{const o=z.indexOf(e);return z[o+1]||null})(e);if(!h&&!n){if(!s)return;U.injectZonos({cdnType:s,initConfig:o,vercelUrl:t,version:r})}if(["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||k)return;if(h||n)return void U.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,isError:!0,scriptLoadUrl:l.src,storeId:U.storeId,type:e});["unpkg","cdnjs","vercel"].includes(e)?g({endpoint:l.src,errors:[`zonos.js - Failed to fetch ${e} CDN.`],metadata:{cdnLoadTime:performance.now()-v,cdnType:e,loadUrl:a,version:r},shouldPostReleaseErrorReporting:!!s}):g({endpoint:l.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{cdnType:e,vercelLoadTime:performance.now()-v}})})),document.head.appendChild(l)},$.init=async e=>{var t;if(p("=== Init zonos script release date","info",U.releaseDate),k&&!window.isZonosPreview){p(`[ZONOS - loadZonos] Re-inject "loadZonos.js" from zonosQaUrl: ${k}`,"info");const o=document.createElement("script");return o.src=`${k}/dist/scripts/loadZonos.js?timestamp=${Date.now()}`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=!1,window.Zonos.isBigCommerce=U.isBigCommerce,window.Zonos.isLegacyCheckout=U.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${k}`)})),void(window.isZonosPreview=!0)}const r=new URLSearchParams(window.location.search).get("tempCartUUID"),{isDgsCartId:s,isLegacyCartId:i}=A(r);if(r&&!i&&!s)return void U.legacyCheckoutErrorHandler({message:`[ZONOS - loadZonos] invalid &tempCartUUID=${r}`,metadata:{invalidCartId:!0}});U.cartId=r;const a="https://v1.3.180.js.zonos.com",d=document.querySelector('script[src*="/zonos.js"]'),l=null===(t=document.querySelector("script[src*='/loadZonos.js']"))||void 0===t?void 0:t.src;p(`[ZONOS - init] first load script src: ${l}`,"info"),window.Zonos.zonosQaUrl=k,window.Zonos.zonosQaUrlApi=j,window.Zonos.zonosQaUrl&&p(`[ZONOS - init] using zonosQaUrl: ${window.Zonos.zonosQaUrl}`,"info"),window.Zonos.zonosQaUrlApi&&p(`[ZONOS - init] using zonosQaUrlApi: ${window.Zonos.zonosQaUrlApi}`,"info");const c=null==l?void 0:l.includes("timestamp=");if(!(U.isNpm||l&&c))return void Z("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(d||!l||U.requested)return void p("[ZONOS - loadZonos] script is already loaded or requested","info");if(!e.zonosApiKey&&!U.cartId)return U.legacyCheckoutErrorHandler({message:"Zonos API key is required unless `tempCartUUID` is provided in url query params."}),void Z("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(U.requested=!0,U.zonosApiKey=e.zonosApiKey,U.storeId=e.storeId,U.cartId){const e=await(async e=>{const{isDgsCartId:o,isLegacyCartId:n}=A(e);if(!n&&!o)return Z("[ZONOS - loadZonos] invalid cart id"),null;const t=await C({cartId:e,retries:5});return p("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(Z("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(U.cartId);if(!e)throw U.legacyCheckoutErrorHandler({message:"Error getting cart data"}),new Error("Error getting cart data");U.cartData=e.cartData,U.cartSettings=e.settings,U.legacyStoreLogo=e.storeLogo,U.legacyStoreFavicon=e.storeFavicon,U.storeId=e.storeId,U.zonosApiKey=e.zonosApiKey}if(!U.zonosApiKey)return void Z('"zonosApiKey" is required to initialize Zonos');const u=await(async()=>{const e=n(),t=o();if(!e&&!t||!window.Zonos.zonosApiKey)return null;if(p("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return p("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:r,json:s}=await v("/api/get-test-public-credential");if(r.length||!s)return Z("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",r),null;const i=s.publicCredential;return i?(p(`[ZONOS - loadZonos] Retrieve new test public token ${i}`,"info"),i):(Z("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();if(u&&(p(`[ZONOS - loadZonos] Using test API key: ${u} for test mode`,"info"),U.zonosApiKey=u),!U.storeId)return p("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void U.injectZonos({initConfig:e,vercelUrl:a,version:null});const w=U.storeId||e.storeId;p(`[ZONOS - loadZonos] Store ID: ${w}`,"info");const m=new URLSearchParams;m.set("storeId",w.toString()),window.location.search.includes("_enableStoreVersionPinned=1")&&m.set("_enableStoreVersionPinned","1");const{errors:g,json:f}=await v(`/api/get-store-version?${m.toString()}`);if(g.length||!f)return p("[ZONOS - loadZonos] Error getting store version, loading the latest version.","error"),void U.injectZonos({initConfig:e,vercelUrl:a,version:null});const{isDifferent:y,source:h,version:z}=f;if(p(`[ZONOS - loadZonos] Store version: ${z}, source: ${h}`,"info"),y){p(`[ZONOS - loadZonos] Updating saved store version to ${z}`,"info");const e={storeId:w,version:z};v(`/api/set-store-version?${m.toString()}`,{body:e,method:"POST"}).catch((e=>Z("Unable to save store's vesrion",e)))}if(!d){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,n=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),t=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:t,isWhiteListed:n}})({loadScriptSrc:l}),r=t&&!n?o:`${"alpha"===z?"alpha":`v${z}`}.js.zonos.com`,s=t&&!n?null:z;p("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t,loadUrl:r,loadVersion:s,version:z}),U.injectZonos({initConfig:e,vercelUrl:r,version:s})}},(void 0===window.Zonos||window.isZonosPreview&&!window.Zonos.doneInit)&&(window.Zonos=$)})();
@@ -1 +1 @@
1
- (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>window.location.search.includes("zonosStagingMode=1"),l=()=>{var e;return(null===(e=window.Zonos.zonosApiKey)||void 0===e?void 0:e.includes("test"))||window.location.search.includes("zonosTestMode=1")};function c(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const d=["cloudflare","vercel"],u=d[0],p={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},m=p[u],w=(e=u)=>{const o=d.indexOf(e),t=d[o+1];return t||null},h=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},y=()=>{const e="userAgentData"in window.navigator?window.navigator.userAgentData:null,o=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||t})();return{connectionDownlink:null==o?void 0:o.downlink,connectionEffectiveType:null==o?void 0:o.effectiveType,connectionRtt:null==o?void 0:o.rtt,connectionSaveData:null==o?void 0:o.saveData,isHostedCheckout:window.Zonos.isLegacyCheckout,screenHeight:window.screen.height,screenWidth:window.innerWidth,userAgent:e&&e.brands.length>0?e:window.navigator.userAgent}},g=["/api/zonos-elements/log-script-load","/api/zonos-elements/log-bulk-load-data"],f=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=h(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},v=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||p[e]||u,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await f({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await f({response:n,shouldThrow:!0});if(e&&"errors"in e&&Array.isArray(e.errors)){const o=e.errors;return{baseUrl:r,errors:o.map((e=>"string"==typeof e?{message:e,type:c}:e)),json:null,response:n,zonosMode:a}}return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},b=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=performance.now(),l=await v({basePathType:i,options:o,path:n}),{errors:d,response:u}=l,f=c(l,["errors","response"]),S=performance.now()-a;t(`${n} (${S.toFixed(2)}ms)`,"info");const z=null==u?void 0:u.headers.get("Zonos-Duration");200===(null==u?void 0:u.status)&&(({apiPath:e,apiType:o,loadTimeInternal:t,loadTimeTotal:n})=>{if(g.includes(e))return;const r=n-t;if(r<0)return;const s=e.split("?")[0]||e,i=y(),a="object"==typeof i.userAgent&&i.userAgent.mobile,l={apiType:o,connectionType:i.connectionEffectiveType,href:s,isHostedCheckout:window.Zonos.isLegacyCheckout,isMobile:(c=a,c||window.innerWidth<890),loadTimeBrowserApi:r,loadTimeInternal:t,loadTimeTotal:n,metadata:Object.assign({},i),screenHeight:i.screenHeight,screenWidth:i.screenWidth,userAgent:"string"==typeof i.userAgent?i.userAgent:i.userAgent.brands.map((e=>e.brand)).filter((e=>!/Not.*A.*Brand.*/.test(e))).join(",")};var c;window.Zonos.loadTimeApiInfoList.push(l)})({apiPath:n,apiType:i,loadTimeInternal:z?Number(z):0,loadTimeTotal:S});const C=w(i),Z=!!d.find((({type:e})=>"unknown"===e))||404===(null==u?void 0:u.status),j=C&&Z;return Z&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${m}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=w();if(!o)return;fetch(`${p[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:p[i]+n,errors:d.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:C,requestHeaders:null==o?void 0:o.headers,requestPayload:h(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==u?void 0:u.status,statusText:null==u?void 0:u.statusText},shouldPostReleaseErrorReporting:!0}),j?(t(`=== "${n}" failed to fetch, trying next fallback ${C}`),b({basePathType:C,options:o,path:n})):Object.assign({errors:d,response:u},f)},S=async(e,o)=>{const t=c(o||{},[]),n=t.body?JSON.stringify(t.body):void 0,r=t.method||"GET",s=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Staging-Mode":a()?"1":void 0,"Zonos-Test-Mode":l()?"1":void 0,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},t.headers);Object.keys(s).forEach((e=>void 0===s[e]&&delete s[e]));const i=Object.assign(Object.assign({},t),{body:"GET"===r?void 0:n,headers:s,method:r}),d=new URLSearchParams(window.location.search).get("useFallbackApi");return b({basePathType:d||u,options:i,path:e})},z=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.179.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},C="https://js.stripe.com/v3",Z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,j="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let O=null;const k=e=>(null!==O||(O=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(j),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${C}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&Z.test(t.src))return t}return null})();r&&e?console.warn(j):r||(r=(e=>{const o=document.createElement("script");o.src=`${C}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),O),A=Promise.resolve().then((()=>k(null)));let I=!1;A.catch((e=>{I||console.warn(e)}));const T=async({cartId:e,retries:o})=>{const n=l(),{errors:r,json:s,zonosMode:i}=await S("/api/zonos-elements/get-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),a=!s||r.length;return a&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),T({cartId:e,retries:o-1})):a?null:Object.assign(Object.assign({},s),{zonosMode:i})},E=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,L=new RegExp(`^${E.source}$`),$=new RegExp(`^cart_${E.source}$`),N=/^[a-zA-Z0-9]{2,}$/,D=/^cart_[a-zA-Z0-9]{2,}$/,P=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?e.includes("undefined")?{isDgsCartId:!1,isLegacyCartId:!1}:D.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:N.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:$.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:L.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await T({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,window.Zonos.zonosMode=s.zonosMode,{cartData:s.cartData,settings:s.settings,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var U;const F=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),R="https://v1.3.179.js.zonos.com",M=F||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.179",x="https://fonts.googleapis.com",B=/^https:\/\/fonts\.googleapis\.com/;class q{}U=q,q.doneInit=!1,q.cartSettings=null,q.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),q.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),q._paypalMockResponse=null,q.isBigCommerce=!1,q.releaseDate="1743782528334",q.isLegacyCheckout=!1,q.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",q.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),q.isNpm=!0,q.zonosQaUrl=null,q.zonosQaUrlApi=null,q.version="v1.3.179",q.modeAlerted=!1,q.cartData=null,q.paypal=null,q.zonosMode=null,q.getCurrentTimestamp=()=>(new Date).getTime(),q.zonosController=null,q.loadTimeApiInfoList=[],q.logIntervalId=null,q.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:c,overrideCurrencyFormat:d,storeId:u,zonosApiKey:p}=e;if(U.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),U.doneInit)return;if(t(`====== ZONOS DEBUG MODE: on (${U.version}) ======`),U.zonosApiKey=p,U.storeId=u,U.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=z();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=U.isNpm,window.Zonos.isBigCommerce=U.isBigCommerce,window.Zonos.isLegacyCheckout=U.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!p&&!U.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!U.cartData&&U.cartId){t("Initialize cart data");const e=await P(U.cartId);if(!e)return void n("Failed to get cart data");U.cartData=e.cartData,U.zonosApiKey=e.zonosApiKey,U.cartSettings=e.settings}const r=await(async()=>{const e=l(),o=a();if(!e&&!o||!window.Zonos.zonosApiKey)return null;if(t("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return t("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:r,json:s}=await S("/api/get-test-public-credential");if(r.length||!s)return n("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",r),null;const i=s.publicCredential;return i?(t(`[ZONOS - loadZonos] Retrieve new test public token ${i}`,"info"),i):(n("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();r&&(U.zonosApiKey=r)}const m=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(U.cartId&&U.cartData||!!m){t("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),U.restoreNativeBrowserFunctions(),U.injectCustomScriptForHostedCheckout(),U.injectZonosCdn(),U.injectZonosCss(),U.injectFonts(),U.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:c,overrideCurrencyFormat:d}}),U.doneInit=!0},q.injectCustomScriptForHostedCheckout=()=>{const e=U.cartData,o=(null==e?void 0:e.metadata)||[],n=o.find((e=>"customHeaderScript"===e.key)),r=o.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(n||r)){if(n){t("Injecting custom header script");const e=document.createElement("script");e.textContent=n.value,document.head.appendChild(e)}if(r){t("Injecting custom footer script");const e=document.createElement("script");e.textContent=r.value,document.body.appendChild(e)}}else t("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:n,isLegacyCheckout:window.Zonos.isLegacyCheckout})},q.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},q.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},q.showNotification=e=>{var o;null===(o=U.zonosController)||void 0===o||o.showNotification(e)},q.updateOrganizationName=e=>{var o;null===(o=U.zonosController)||void 0===o||o.updateOrganizationName(e)},q.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},q.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const o="zonos---native-browser";let t=document.querySelector(`iframe#${o}`);t||(t=document.createElement("iframe"),t.id=o,t.style.display="none",t.style.opacity="0",t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.style.width="1px",t.style.height="1px",t.style.border="none",t.style.overflow="hidden",t.style.visibility="hidden",document.body.appendChild(t));const n=(null===(e=t.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=n,document.body.removeChild(t)},q.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;U.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{U.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=U.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{I=!0;const o=Date.now();return A.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),U.zonosController=r,t("Zonos controller injected!")},q.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${U.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&U.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},q.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return M;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.179";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.179";case"vercel":return R}};if(U.isNpm){return z()||o()}return o()},q.injectZonosCdn=()=>{U.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),U.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},q.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=U.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${R}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&U.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},q.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):(U.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},q.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void t("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${x}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!B.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=x,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${x}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(n),t("Zonos font injected!")},q.setupGoogleFont=e=>{var o;null===(o=U.zonosController)||void 0===o||o.setupGoogleFont(e)},q.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${x}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=x,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=q)})();
1
+ (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>window.location.search.includes("zonosStagingMode=1"),l=()=>{var e;return(null===(e=window.Zonos.zonosApiKey)||void 0===e?void 0:e.includes("test"))||window.location.search.includes("zonosTestMode=1")};function c(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const d=["cloudflare","vercel"],u=d[0],p={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},m=p[u],w=(e=u)=>{const o=d.indexOf(e),t=d[o+1];return t||null},h=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},y=()=>{const e="userAgentData"in window.navigator?window.navigator.userAgentData:null,o=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||t})();return{connectionDownlink:null==o?void 0:o.downlink,connectionEffectiveType:null==o?void 0:o.effectiveType,connectionRtt:null==o?void 0:o.rtt,connectionSaveData:null==o?void 0:o.saveData,isHostedCheckout:window.Zonos.isLegacyCheckout,screenHeight:window.screen.height,screenWidth:window.innerWidth,userAgent:e&&e.brands.length>0?e:window.navigator.userAgent}},g=["/api/zonos-elements/log-script-load","/api/zonos-elements/log-bulk-load-data"],f=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=h(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},v=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||p[e]||u,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await f({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await f({response:n,shouldThrow:!0});if(e&&"errors"in e&&Array.isArray(e.errors)){const o=e.errors;return{baseUrl:r,errors:o.map((e=>"string"==typeof e?{message:e,type:c}:e)),json:null,response:n,zonosMode:a}}return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},b=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=performance.now(),l=await v({basePathType:i,options:o,path:n}),{errors:d,response:u}=l,f=c(l,["errors","response"]),S=performance.now()-a;t(`${n} (${S.toFixed(2)}ms)`,"info");const z=null==u?void 0:u.headers.get("Zonos-Duration");200===(null==u?void 0:u.status)&&(({apiPath:e,apiType:o,loadTimeInternal:t,loadTimeTotal:n})=>{if(g.includes(e))return;const r=n-t;if(r<0)return;const s=e.split("?")[0]||e,i=y(),a="object"==typeof i.userAgent&&i.userAgent.mobile,l={apiType:o,connectionType:i.connectionEffectiveType,href:s,isHostedCheckout:window.Zonos.isLegacyCheckout,isMobile:(c=a,c||window.innerWidth<890),loadTimeBrowserApi:r,loadTimeInternal:t,loadTimeTotal:n,metadata:Object.assign({},i),screenHeight:i.screenHeight,screenWidth:i.screenWidth,userAgent:"string"==typeof i.userAgent?i.userAgent:i.userAgent.brands.map((e=>e.brand)).filter((e=>!/Not.*A.*Brand.*/.test(e))).join(",")};var c;window.Zonos.loadTimeApiInfoList.push(l)})({apiPath:n,apiType:i,loadTimeInternal:z?Number(z):0,loadTimeTotal:S});const C=w(i),Z=!!d.find((({type:e})=>"unknown"===e))||404===(null==u?void 0:u.status),j=C&&Z;return Z&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${m}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=w();if(!o)return;fetch(`${p[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:p[i]+n,errors:d.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:C,requestHeaders:null==o?void 0:o.headers,requestPayload:h(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==u?void 0:u.status,statusText:null==u?void 0:u.statusText},shouldPostReleaseErrorReporting:!0}),j?(t(`=== "${n}" failed to fetch, trying next fallback ${C}`),b({basePathType:C,options:o,path:n})):Object.assign({errors:d,response:u},f)},S=async(e,o)=>{const t=c(o||{},[]),n=t.body?JSON.stringify(t.body):void 0,r=t.method||"GET",s=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Staging-Mode":a()?"1":void 0,"Zonos-Test-Mode":l()?"1":void 0,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},t.headers);Object.keys(s).forEach((e=>void 0===s[e]&&delete s[e]));const i=Object.assign(Object.assign({},t),{body:"GET"===r?void 0:n,headers:s,method:r}),d=new URLSearchParams(window.location.search).get("useFallbackApi");return b({basePathType:d||u,options:i,path:e})},z=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.180.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},C="https://js.stripe.com/v3",Z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,j="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let O=null;const k=e=>(null!==O||(O=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(j),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${C}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&Z.test(t.src))return t}return null})();r&&e?console.warn(j):r||(r=(e=>{const o=document.createElement("script");o.src=`${C}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),O),A=Promise.resolve().then((()=>k(null)));let I=!1;A.catch((e=>{I||console.warn(e)}));const T=async({cartId:e,retries:o})=>{const n=l(),{errors:r,json:s,zonosMode:i}=await S("/api/zonos-elements/get-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),a=!s||r.length;return a&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),T({cartId:e,retries:o-1})):a?null:Object.assign(Object.assign({},s),{zonosMode:i})},E=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,L=new RegExp(`^${E.source}$`),$=new RegExp(`^cart_${E.source}$`),N=/^[a-zA-Z0-9]{2,}$/,D=/^cart_[a-zA-Z0-9]{2,}$/,P=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?e.includes("undefined")?{isDgsCartId:!1,isLegacyCartId:!1}:D.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:N.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:$.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:L.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await T({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,window.Zonos.zonosMode=s.zonosMode,{cartData:s.cartData,settings:s.settings,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var U;const F=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),R="https://v1.3.180.js.zonos.com",M=F||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.180",x="https://fonts.googleapis.com",B=/^https:\/\/fonts\.googleapis\.com/;class q{}U=q,q.doneInit=!1,q.cartSettings=null,q.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),q.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),q._paypalMockResponse=null,q.isBigCommerce=!1,q.releaseDate="1743787286110",q.isLegacyCheckout=!1,q.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",q.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),q.isNpm=!0,q.zonosQaUrl=null,q.zonosQaUrlApi=null,q.version="v1.3.180",q.modeAlerted=!1,q.cartData=null,q.paypal=null,q.zonosMode=null,q.getCurrentTimestamp=()=>(new Date).getTime(),q.zonosController=null,q.loadTimeApiInfoList=[],q.logIntervalId=null,q.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:c,overrideCurrencyFormat:d,storeId:u,zonosApiKey:p}=e;if(U.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),U.doneInit)return;if(t(`====== ZONOS DEBUG MODE: on (${U.version}) ======`),U.zonosApiKey=p,U.storeId=u,U.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=z();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=U.isNpm,window.Zonos.isBigCommerce=U.isBigCommerce,window.Zonos.isLegacyCheckout=U.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!p&&!U.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!U.cartData&&U.cartId){t("Initialize cart data");const e=await P(U.cartId);if(!e)return void n("Failed to get cart data");U.cartData=e.cartData,U.zonosApiKey=e.zonosApiKey,U.cartSettings=e.settings}const r=await(async()=>{const e=l(),o=a();if(!e&&!o||!window.Zonos.zonosApiKey)return null;if(t("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return t("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:r,json:s}=await S("/api/get-test-public-credential");if(r.length||!s)return n("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",r),null;const i=s.publicCredential;return i?(t(`[ZONOS - loadZonos] Retrieve new test public token ${i}`,"info"),i):(n("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();r&&(U.zonosApiKey=r)}const m=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(U.cartId&&U.cartData||!!m){t("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),U.restoreNativeBrowserFunctions(),U.injectCustomScriptForHostedCheckout(),U.injectZonosCdn(),U.injectZonosCss(),U.injectFonts(),U.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:c,overrideCurrencyFormat:d}}),U.doneInit=!0},q.injectCustomScriptForHostedCheckout=()=>{const e=U.cartData,o=(null==e?void 0:e.metadata)||[],n=o.find((e=>"customHeaderScript"===e.key)),r=o.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(n||r)){if(n){t("Injecting custom header script");const e=document.createElement("script");e.textContent=n.value,document.head.appendChild(e)}if(r){t("Injecting custom footer script");const e=document.createElement("script");e.textContent=r.value,document.body.appendChild(e)}}else t("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:n,isLegacyCheckout:window.Zonos.isLegacyCheckout})},q.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},q.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},q.showNotification=e=>{var o;null===(o=U.zonosController)||void 0===o||o.showNotification(e)},q.updateOrganizationName=e=>{var o;null===(o=U.zonosController)||void 0===o||o.updateOrganizationName(e)},q.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},q.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const o="zonos---native-browser";let t=document.querySelector(`iframe#${o}`);t||(t=document.createElement("iframe"),t.id=o,t.style.display="none",t.style.opacity="0",t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.style.width="1px",t.style.height="1px",t.style.border="none",t.style.overflow="hidden",t.style.visibility="hidden",document.body.appendChild(t));const n=(null===(e=t.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=n,document.body.removeChild(t)},q.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;U.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{U.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=U.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{I=!0;const o=Date.now();return A.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),U.zonosController=r,t("Zonos controller injected!")},q.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${U.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&U.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},q.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return M;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.180";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.180";case"vercel":return R}};if(U.isNpm){return z()||o()}return o()},q.injectZonosCdn=()=>{U.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),U.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},q.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=U.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${R}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&U.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},q.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):(U.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},q.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void t("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${x}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!B.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=x,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${x}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(n),t("Zonos font injected!")},q.setupGoogleFont=e=>{var o;null===(o=U.zonosController)||void 0===o||o.setupGoogleFont(e)},q.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${x}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=x,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=q)})();
@@ -4,7 +4,7 @@ export declare const getLocaleMessages: ({ countryCode, localeTo, storeId, }: {
4
4
  localeTo?: string;
5
5
  storeId: number;
6
6
  }) => Promise<{
7
- countryCodes: Array<string> | null;
7
+ countryCodes: Array<string>;
8
8
  countryCodesPageMessageLinks: Array<{
9
9
  id: number;
10
10
  message: {
@@ -559,7 +559,7 @@ export type FailToGetQuoteErrorsQuery = {
559
559
  };
560
560
  export type LocaleCountryMessagesQuery = {
561
561
  locale_countryCodesPage: Array<{
562
- countryCodes: Array<string> | null;
562
+ countryCodes: Array<string>;
563
563
  countryCodesPageMessageLinks: Array<{
564
564
  id: number;
565
565
  message: {
@@ -567,7 +567,7 @@ export type FailToGetQuoteErrorsQuery = {
567
567
 
568
568
  export type LocaleCountryMessagesQuery = {
569
569
  locale_countryCodesPage: Array<{
570
- countryCodes: Array<string> | null;
570
+ countryCodes: Array<string>;
571
571
  countryCodesPageMessageLinks: Array<{
572
572
  id: number;
573
573
  message: {
@@ -477,6 +477,11 @@ export declare const checkoutSuccessBehavior: {
477
477
  readonly ZonosSuccessPage: "ZONOS_SUCCESS_PAGE";
478
478
  };
479
479
  export type CheckoutSuccessBehavior = (typeof checkoutSuccessBehavior)[keyof typeof checkoutSuccessBehavior];
480
+ export declare const checkoutVarianceTestStatus: {
481
+ readonly Active: "ACTIVE";
482
+ readonly Inactive: "INACTIVE";
483
+ };
484
+ export type CheckoutVarianceTestStatus = (typeof checkoutVarianceTestStatus)[keyof typeof checkoutVarianceTestStatus];
480
485
  export declare const checkoutVisibilityStatus: {
481
486
  readonly Disabled: "DISABLED";
482
487
  readonly Enabled: "ENABLED";
@@ -1587,6 +1592,11 @@ export declare const fulfillmentCenterType: {
1587
1592
  readonly Standard: "STANDARD";
1588
1593
  };
1589
1594
  export type FulfillmentCenterType = (typeof fulfillmentCenterType)[keyof typeof fulfillmentCenterType];
1595
+ export declare const generalAdjustmentRecordCreateType: {
1596
+ readonly ConnectAccountAdjustment: "CONNECT_ACCOUNT_ADJUSTMENT";
1597
+ readonly InvoiceLineRecord: "INVOICE_LINE_RECORD";
1598
+ };
1599
+ export type GeneralAdjustmentRecordCreateType = (typeof generalAdjustmentRecordCreateType)[keyof typeof generalAdjustmentRecordCreateType];
1590
1600
  export declare const helloCurrencyBehavior: {
1591
1601
  readonly Disabled: "DISABLED";
1592
1602
  readonly Enabled: "ENABLED";
@@ -1807,8 +1817,11 @@ export declare const invoiceStatus: {
1807
1817
  };
1808
1818
  export type InvoiceStatus = (typeof invoiceStatus)[keyof typeof invoiceStatus];
1809
1819
  export declare const itemAmountTargetType: {
1820
+ readonly BillingCompany: "BILLING_COMPANY";
1821
+ readonly ItemProvided: "ITEM_PROVIDED";
1810
1822
  readonly MerchantBase: "MERCHANT_BASE";
1811
1823
  readonly MerchantProvided: "MERCHANT_PROVIDED";
1824
+ readonly MerchantSettled: "MERCHANT_SETTLED";
1812
1825
  readonly ShopperPresented: "SHOPPER_PRESENTED";
1813
1826
  readonly ZonosBase: "ZONOS_BASE";
1814
1827
  };
@@ -2057,6 +2070,11 @@ export declare const landedCostMethod: {
2057
2070
  readonly DdpPreferred: "DDP_PREFERRED";
2058
2071
  };
2059
2072
  export type LandedCostMethod = (typeof landedCostMethod)[keyof typeof landedCostMethod];
2073
+ export declare const landedCostPaymentProcessor: {
2074
+ readonly Paypal: "PAYPAL";
2075
+ readonly Stripe: "STRIPE";
2076
+ };
2077
+ export type LandedCostPaymentProcessor = (typeof landedCostPaymentProcessor)[keyof typeof landedCostPaymentProcessor];
2060
2078
  export declare const landedCostQuoteType: {
2061
2079
  readonly Api: "API";
2062
2080
  readonly Auditing: "AUDITING";
@@ -2289,6 +2307,8 @@ export declare const orderBillingAdjustmentFeeType: {
2289
2307
  readonly DutyTaxFee: "DUTY_TAX_FEE";
2290
2308
  readonly FxFee: "FX_FEE";
2291
2309
  readonly FxFeeNonRefundedAmounts: "FX_FEE_NON_REFUNDED_AMOUNTS";
2310
+ readonly GuaranteeOrder: "GUARANTEE_ORDER";
2311
+ readonly GuaranteePercent: "GUARANTEE_PERCENT";
2292
2312
  readonly InclusivePriceAdjustment: "INCLUSIVE_PRICE_ADJUSTMENT";
2293
2313
  readonly InclusivePricing: "INCLUSIVE_PRICING";
2294
2314
  readonly Item: "ITEM";
@@ -2636,6 +2656,7 @@ export declare const shipmentAmountType: {
2636
2656
  readonly FuelSurcharge: "FUEL_SURCHARGE";
2637
2657
  readonly Insurance: "INSURANCE";
2638
2658
  readonly PublishedRate: "PUBLISHED_RATE";
2659
+ readonly RateChart: "RATE_CHART";
2639
2660
  readonly Surcharge: "SURCHARGE";
2640
2661
  };
2641
2662
  export type ShipmentAmountType = (typeof shipmentAmountType)[keyof typeof shipmentAmountType];
@@ -2656,8 +2677,11 @@ export declare const shipmentConsolidationStatus: {
2656
2677
  };
2657
2678
  export type ShipmentConsolidationStatus = (typeof shipmentConsolidationStatus)[keyof typeof shipmentConsolidationStatus];
2658
2679
  export declare const shipmentRatingAmountTargetType: {
2680
+ readonly BillingCompany: "BILLING_COMPANY";
2659
2681
  readonly MerchantBase: "MERCHANT_BASE";
2660
2682
  readonly MerchantProvided: "MERCHANT_PROVIDED";
2683
+ readonly MerchantSettled: "MERCHANT_SETTLED";
2684
+ readonly ShipmentRatingProvided: "SHIPMENT_RATING_PROVIDED";
2661
2685
  readonly ShopperPresented: "SHOPPER_PRESENTED";
2662
2686
  readonly ZonosBase: "ZONOS_BASE";
2663
2687
  };
@@ -3046,6 +3070,168 @@ export declare const zonosAttribution: {
3046
3070
  readonly Enabled: "ENABLED";
3047
3071
  };
3048
3072
  export type ZonosAttribution = (typeof zonosAttribution)[keyof typeof zonosAttribution];
3073
+ export type CartCreateMutation = {
3074
+ cartCreate: {
3075
+ adjustments: Array<{
3076
+ amount: number;
3077
+ currencyCode: CurrencyCode;
3078
+ description: string | null;
3079
+ productId: string | null;
3080
+ sku: string | null;
3081
+ type: CartAdjustmentType;
3082
+ }>;
3083
+ id: string;
3084
+ items: Array<{
3085
+ amount: number;
3086
+ attributes: Array<{
3087
+ key: string | null;
3088
+ value: string | null;
3089
+ } | null> | null;
3090
+ currencyCode: CurrencyCode;
3091
+ description: string | null;
3092
+ id: string;
3093
+ imageUrl: string | null;
3094
+ metadata: Array<{
3095
+ key: string | null;
3096
+ value: string | null;
3097
+ } | null> | null;
3098
+ name: string | null;
3099
+ productId: string;
3100
+ quantity: number;
3101
+ restriction: {
3102
+ action: RestrictedItemAction;
3103
+ reason: string;
3104
+ } | null;
3105
+ sku: string | null;
3106
+ }>;
3107
+ metadata: Array<{
3108
+ key: string;
3109
+ value: string;
3110
+ }>;
3111
+ organizationId: string;
3112
+ };
3113
+ };
3114
+ export type CartUpdateMutation = {
3115
+ cartUpdate: {
3116
+ adjustments: Array<{
3117
+ amount: number;
3118
+ currencyCode: CurrencyCode;
3119
+ description: string | null;
3120
+ productId: string | null;
3121
+ sku: string | null;
3122
+ type: CartAdjustmentType;
3123
+ }>;
3124
+ id: string;
3125
+ items: Array<{
3126
+ amount: number;
3127
+ attributes: Array<{
3128
+ key: string | null;
3129
+ value: string | null;
3130
+ } | null> | null;
3131
+ currencyCode: CurrencyCode;
3132
+ description: string | null;
3133
+ id: string;
3134
+ imageUrl: string | null;
3135
+ metadata: Array<{
3136
+ key: string | null;
3137
+ value: string | null;
3138
+ } | null> | null;
3139
+ name: string | null;
3140
+ productId: string;
3141
+ quantity: number;
3142
+ restriction: {
3143
+ action: RestrictedItemAction;
3144
+ reason: string;
3145
+ } | null;
3146
+ sku: string | null;
3147
+ }>;
3148
+ metadata: Array<{
3149
+ key: string;
3150
+ value: string;
3151
+ }>;
3152
+ organizationId: string;
3153
+ };
3154
+ };
3155
+ export type CartByIdQuery = {
3156
+ cart: {
3157
+ adjustments: Array<{
3158
+ amount: number;
3159
+ currencyCode: CurrencyCode;
3160
+ description: string | null;
3161
+ productId: string | null;
3162
+ sku: string | null;
3163
+ type: CartAdjustmentType;
3164
+ }>;
3165
+ id: string;
3166
+ items: Array<{
3167
+ amount: number;
3168
+ attributes: Array<{
3169
+ key: string | null;
3170
+ value: string | null;
3171
+ } | null> | null;
3172
+ currencyCode: CurrencyCode;
3173
+ description: string | null;
3174
+ id: string;
3175
+ imageUrl: string | null;
3176
+ metadata: Array<{
3177
+ key: string | null;
3178
+ value: string | null;
3179
+ } | null> | null;
3180
+ name: string | null;
3181
+ productId: string;
3182
+ quantity: number;
3183
+ restriction: {
3184
+ action: RestrictedItemAction;
3185
+ reason: string;
3186
+ } | null;
3187
+ sku: string | null;
3188
+ }>;
3189
+ metadata: Array<{
3190
+ key: string;
3191
+ value: string;
3192
+ }>;
3193
+ organizationId: string;
3194
+ } | null;
3195
+ };
3196
+ export type CartFragmentFragment = {
3197
+ adjustments: Array<{
3198
+ amount: number;
3199
+ currencyCode: CurrencyCode;
3200
+ description: string | null;
3201
+ productId: string | null;
3202
+ sku: string | null;
3203
+ type: CartAdjustmentType;
3204
+ }>;
3205
+ id: string;
3206
+ items: Array<{
3207
+ amount: number;
3208
+ attributes: Array<{
3209
+ key: string | null;
3210
+ value: string | null;
3211
+ } | null> | null;
3212
+ currencyCode: CurrencyCode;
3213
+ description: string | null;
3214
+ id: string;
3215
+ imageUrl: string | null;
3216
+ metadata: Array<{
3217
+ key: string | null;
3218
+ value: string | null;
3219
+ } | null> | null;
3220
+ name: string | null;
3221
+ productId: string;
3222
+ quantity: number;
3223
+ restriction: {
3224
+ action: RestrictedItemAction;
3225
+ reason: string;
3226
+ } | null;
3227
+ sku: string | null;
3228
+ }>;
3229
+ metadata: Array<{
3230
+ key: string;
3231
+ value: string;
3232
+ }>;
3233
+ organizationId: string;
3234
+ };
3049
3235
  export type OrganizationQuery = {
3050
3236
  organization: {
3051
3237
  id: string;
@@ -4452,41 +4638,6 @@ export type GetCartOrganizationInfoQuery = {
4452
4638
  } | null;
4453
4639
  } | null;
4454
4640
  };
4455
- export type CartCreateMutation = {
4456
- cartCreate: {
4457
- adjustments: Array<{
4458
- amount: number;
4459
- currencyCode: CurrencyCode;
4460
- description: string | null;
4461
- productId: string | null;
4462
- sku: string | null;
4463
- type: CartAdjustmentType;
4464
- }>;
4465
- id: string;
4466
- items: Array<{
4467
- amount: number;
4468
- attributes: Array<{
4469
- key: string | null;
4470
- value: string | null;
4471
- } | null> | null;
4472
- description: string | null;
4473
- id: string;
4474
- imageUrl: string | null;
4475
- name: string | null;
4476
- quantity: number;
4477
- restriction: {
4478
- action: RestrictedItemAction;
4479
- reason: string;
4480
- } | null;
4481
- sku: string | null;
4482
- }>;
4483
- metadata: Array<{
4484
- key: string;
4485
- value: string;
4486
- }>;
4487
- organizationId: string;
4488
- };
4489
- };
4490
4641
  export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;
4491
4642
  export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
4492
4643
  activeDiscounts(variables?: {
@@ -4504,6 +4655,9 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
4504
4655
  cart(variables?: {
4505
4656
  [x: string]: never;
4506
4657
  }, requestHeaders?: GraphQLClientRequestHeaders): Promise<CartQuery>;
4658
+ cartById(variables?: {
4659
+ [x: string]: never;
4660
+ }, requestHeaders?: GraphQLClientRequestHeaders): Promise<CartByIdQuery>;
4507
4661
  cartCalculateLandedCost(variables?: {
4508
4662
  [x: string]: never;
4509
4663
  }, requestHeaders?: GraphQLClientRequestHeaders): Promise<CartCalculateLandedCostMutation>;
@@ -4513,6 +4667,9 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
4513
4667
  cartCreate(variables?: {
4514
4668
  [x: string]: never;
4515
4669
  }, requestHeaders?: GraphQLClientRequestHeaders): Promise<CartCreateMutation>;
4670
+ cartUpdate(variables?: {
4671
+ [x: string]: never;
4672
+ }, requestHeaders?: GraphQLClientRequestHeaders): Promise<CartUpdateMutation>;
4516
4673
  checkItemRestrictions(variables?: {
4517
4674
  [x: string]: never;
4518
4675
  }, requestHeaders?: GraphQLClientRequestHeaders): Promise<CheckItemRestrictionsMutation>;