@zonos/elements 1.3.68 → 1.3.70
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.
- package/dist/cjs/{cart-8a585d9b.js → cart-11d066b2.js} +165 -56
- package/dist/cjs/{createCustomEvent-1ad96183.js → createCustomEvent-68af46cb.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/{paypal-81274880.js → paypal-aa0570f4.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-badge_13.cjs.entry.js +14 -16
- package/dist/cjs/zonos-checkout.cjs.entry.js +14 -10
- package/dist/cjs/zonos-controller.cjs.entry.js +5 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +11 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +10 -12
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +31 -29
- package/dist/collection/components/store/checkout/stripe.js +9 -9
- package/dist/collection/components/store/translationStore/strings.arabic.js +6 -0
- package/dist/collection/components/store/translationStore/strings.base.js +6 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +6 -0
- package/dist/collection/components/store/translationStore/strings.french.js +6 -0
- package/dist/collection/components/store/translationStore/strings.german.js +6 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +6 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +6 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +6 -0
- package/dist/collection/components/store/translationStore.js +3 -3
- package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +2 -1
- package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +3 -3
- package/dist/collection/components/utils/hello/initHello.js +4 -0
- package/dist/collection/scripts/_zonosBase.js +1 -1
- package/dist/collection/types/generated/graphql.customer.types.js +13 -0
- package/dist/esm/{cart-53bd48de.js → cart-7f82d6bf.js} +165 -56
- package/dist/esm/{createCustomEvent-0376082a.js → createCustomEvent-3a894453.js} +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/{paypal-09ebeb63.js → paypal-91a34d75.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-badge_13.entry.js +14 -16
- package/dist/esm/zonos-checkout.entry.js +14 -10
- package/dist/esm/zonos-controller.entry.js +5 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/cart-7f82d6bf.js +1 -0
- package/dist/esm-es5/{createCustomEvent-0376082a.js → createCustomEvent-3a894453.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-09ebeb63.js → paypal-91a34d75.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/scripts/index.d.ts +14 -10
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +4 -5
- package/dist/types/components/store/checkout/stripe.d.ts +2 -2
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +6 -0
- package/dist/types/components/store/translationStore.d.ts +4 -3
- package/dist/types/types/generated/graphql.customer.types.d.ts +47 -37
- package/dist/types/types/generated/graphql.customer.types.ts +57 -40
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-f3d02a32.js → p-11c9a75c.js} +1 -1
- package/dist/zonos-elements/{p-9a868fb6.entry.js → p-12fa5286.entry.js} +1 -1
- package/dist/zonos-elements/{p-a58cb682.system.entry.js → p-2264efbe.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-05478b55.js → p-229f7399.js} +1 -1
- package/dist/zonos-elements/{p-d9c86ca5.system.entry.js → p-351f3207.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3b904bf5.js +1 -0
- package/dist/zonos-elements/{p-bf8ae6bb.entry.js → p-3f0eb9df.entry.js} +1 -1
- package/dist/zonos-elements/p-43a5653e.system.entry.js +1 -0
- package/dist/zonos-elements/p-45dcfef2.system.js +1 -0
- package/dist/zonos-elements/{p-54bacb24.system.js → p-52c9d64e.system.js} +1 -1
- package/dist/zonos-elements/{p-3b1a5f38.entry.js → p-68e27f6d.entry.js} +1 -1
- package/dist/zonos-elements/{p-917aced6.system.entry.js → p-70794698.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b3eed5e5.system.js → p-7348fcb1.system.js} +1 -1
- package/dist/zonos-elements/{p-e2e28c07.system.entry.js → p-76faa16f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-77b8c1b6.entry.js +1 -0
- package/dist/zonos-elements/p-7a4fc640.entry.js +1 -0
- package/dist/zonos-elements/{p-12ade4bb.system.entry.js → p-88a79bdb.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9a5a403b.system.entry.js → p-96702555.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0f90a98b.entry.js → p-a048ee0a.entry.js} +1 -1
- package/dist/zonos-elements/{p-ef0913d2.system.entry.js → p-b2b52158.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4a4ce63c.entry.js → p-c71c9fbd.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-f8acfefd.system.entry.js → p-c93473ba.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-11bcfa61.system.entry.js → p-cc779ac1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d491eab9.system.entry.js +1 -0
- package/dist/zonos-elements/{p-6f087aaf.entry.js → p-d559e191.entry.js} +1 -1
- package/dist/zonos-elements/p-da400c8f.entry.js +1 -0
- package/dist/zonos-elements/{p-e7347556.entry.js → p-ddd3099b.entry.js} +1 -1
- package/dist/zonos-elements/p-fce17550.entry.js +1 -0
- package/dist/zonos-elements/{p-1d4b6884.system.js → p-fff15925.system.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-53bd48de.js +0 -1
- package/dist/zonos-elements/p-12e3af70.system.entry.js +0 -1
- package/dist/zonos-elements/p-4baa8211.entry.js +0 -1
- package/dist/zonos-elements/p-5b0470ad.entry.js +0 -1
- package/dist/zonos-elements/p-aaa4693a.system.js +0 -1
- package/dist/zonos-elements/p-cfe17508.js +0 -1
- package/dist/zonos-elements/p-e3b0a988.entry.js +0 -1
- package/dist/zonos-elements/p-f4a27b43.entry.js +0 -1
- package/dist/zonos-elements/p-ff905aef.system.entry.js +0 -1
package/dist/scripts/zonos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o=["jsdelivr","cdnjs","unpkg","vercel"],n="jsdelivr",r=e=>{const t=o.indexOf(e);return o[t+1]||null},s=()=>{const t=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||t)return null;const o=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href),n="https://v1.3.68.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 e(`[ZONOS-WARNING] using '${r}' for loading 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:t}=window.location,o=`${t}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),r},i="https://js.stripe.com/v3",l=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let c=null;const d=e=>(null!==c||(c=new Promise(((o,n)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(a),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${i}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&l.test(o.src))return o}return null})();r&&e?console.warn(a):r||(r=(e=>{const o=document.createElement("script");o.src=`${i}`;const n=document.head||document.body;return n?(n.appendChild(o),o):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):n(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else o(null)}))),c),u=Promise.resolve().then((()=>d(null)));let p=!1;u.catch((e=>{p||console.warn(e)}));function m(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;const h=["cloudflare","vercel"],y=h[0],w={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},g=w[y],f=(e=y)=>{const t=h.indexOf(e),o=h[t+1];return o||null},v=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},b=async({response:e,shouldLog:t=!0,shouldThrow:o=!1})=>{try{return await e.json()}catch(e){if(o)throw e;return t&&console.error(e),null}},S=async({basePathType:e,options:t,path:o})=>{let n;const r=window.Zonos.zonosQaUrlApi||w[e]||y,s=new URL(r+o);s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(t){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{n=await fetch(s.toString(),t)}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 i=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&i&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await b({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await b({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:a}],json:null,response:n,zonosMode:i}}catch(e){return{baseUrl:r,errors:[{message:`${a}: ${"Unknown error"}`,type:a}],json:null,response:null,zonosMode:i}}},z=async({basePathType:t,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":t,l=await S({basePathType:i,options:o,path:n}),{errors:a,response:c}=l,d=m(l,["errors","response"]),u=f(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),h=u&&p;return p&&(async({endpoint:e,errors:t,metadata:o,shouldPostReleaseErrorReporting:n})=>{if(n){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const r="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:r&&r.brands.length>0?r:window.navigator.userAgent},o)};try{fetch(`${g}/api/zonos-elements/log-error`,{body:JSON.stringify(s),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const t=f();if(!t)return;fetch(`${w[t]}/api/zonos-elements/log-error`,{body:JSON.stringify(s),method:"POST"})}})({endpoint:w[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:v(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==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),h?(e(`=== "${n}" failed to fetch, trying next fallback ${u}`),z({basePathType:u,options:o,path:n})):Object.assign({errors:a,response:c},d)},j=async e=>{const{errors:t,json:o}=await(async(e,t)=>{const o=m(t||{},[]),n=o.body?JSON.stringify(o.body):void 0,r=o.method||"GET",s=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},o.headers),i=Object.assign(Object.assign({},o),{body:"GET"===r?void 0:n,headers:s,method:r}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return z({basePathType:l||y,options:i,path:e})})("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!o||t.length?null:o};var O;const C=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})(),k="https://v1.3.68.js.zonos.com",A=C||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.68",E="https://rsms.me",Z="https://fonts.googleapis.com",U=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class T{}O=T,T.doneInit=!1,T.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),T.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),T._paypalMockResponse=null,T.isBigCommerce=!1,T.releaseDate="1728149874821",T.isLegacyCheckout=!1,T.isNpm=!0,T.zonosQaUrl=null,T.zonosQaUrlApi=null,T.version="v1.3.68",T.modeAlerted=!1,T.cartData=null,T.paypal=null,T.getCurrentTimestamp=()=>(new Date).getTime(),T.zonosController=null,T.init=async({appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(O.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!O.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${O.version}) ======`),O.zonosApiKey=c,O.storeId=a,O.isNpm){if(e("====== ZONOS LOADING FROM NPM ======"),!c&&!O.cartId)return void t("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!O.cartData&&O.cartId){e("Initialize cart data");const o=await(async o=>{const n=await j(o);return e("[ZONOS - loadZonos] getting temp cart data","info",n),n?{cartData:n.cartData,storeFavicon:n.storeFaviconUrl,storeId:n.cartData.storeId,storeLogo:n.storeLogoUrl,zonosApiKey:n.cartData.credentialToken}:(t("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(O.cartId);if(!o)return void t("Failed to get cart data");O.cartData=o.cartData,O.zonosApiKey=o.zonosApiKey}}if(O.cartId&&O.cartData){e("Cart data is available, inject hidden button and trigger checkout");const t=document.createElement("button");t.style.display="none",t.id="zonos--checkout-hidden-button",document.body.appendChild(t)}e("init zonos"),O.injectZonosCdn(),O.injectZonosCss(),O.injectFonts(),O.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),O.doneInit=!0}},T.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},T.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},T.showNotification=e=>{var t;null===(t=O.zonosController)||void 0===t||t.showNotification(e)},T.updateOrganizationName=e=>{var t;null===(t=O.zonosController)||void 0===t||t.updateOrganizationName(e)},T.disablePlaceOrderButtons=({autoEnable:e=!0,config:t,disable:o,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=t.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const t=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};t.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&o&&setTimeout((()=>{t.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},T.injectController=({config:o})=>{var n;if(document.querySelector("zonos-controller"))return;if(null===(n=o.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=o,r.zonosApiKey=O.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async o=>{const{detail:n}=o;e("loading Stripe");const s=await(async(...e)=>{p=!0;const t=Date.now();return u.then((o=>((e,t,o)=>{if(null===e)return null;const n=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(n,o),n})(o,e,t)))})(n.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),O.zonosController=r,e("Zonos controller injected!")},T.injectScript=({cdnType:o,isModule:n,theRestUrl:s})=>{const i=`${O.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");n?a.type="module":a.noModule=!0,a.src=i,a.crossOrigin="anonymous",a.onerror=()=>{t(`Failed to load ${a.src}`);const e=r(o);e&&O.injectScript({cdnType:e,isModule:n,theRestUrl:s})},l.appendChild(a)},T.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return A;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.68";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.68";case"vercel":return k}};if(O.isNpm){return s()||t()}return t()},T.injectZonosCdn=()=>{O.injectScript({cdnType:n,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),O.injectScript({cdnType:n,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},T.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const n=O.getZonosUrl(e),s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${k}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${n}/${o}`,l.onerror=()=>{t(`Failed to load ${l.href}`);const n=r(e);n&&O.injectStylesheet({cdnType:n,theRestUrl:o})},s.appendChild(l)},T.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(O.injectStylesheet({cdnType:n,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},T.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${E}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!U.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=E,t.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${E}/inter/inter.css`,t.appendChild(n),e("Zonos font injected!")},T.setupGoogleFont=e=>{var t;null===(t=O.zonosController)||void 0===t||t.setupGoogleFont(e)},T.injectSupportGoogleFont=t=>{var o;e(`[FONT] injecting ${t}`);const n=null===(o=t.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${Z}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=Z,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=T)})();
|
|
1
|
+
(function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o=["jsdelivr","cdnjs","unpkg","vercel"],n="jsdelivr",r=e=>{const t=o.indexOf(e);return o[t+1]||null},s=()=>{const t=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||t)return null;const o=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href),n="https://v1.3.70.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 e(`[ZONOS-WARNING] using '${r}' for loading 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:t}=window.location,o=`${t}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),r},i="https://js.stripe.com/v3",l=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let c=null;const d=e=>(null!==c||(c=new Promise(((o,n)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(a),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${i}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&l.test(o.src))return o}return null})();r&&e?console.warn(a):r||(r=(e=>{const o=document.createElement("script");o.src=`${i}`;const n=document.head||document.body;return n?(n.appendChild(o),o):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):n(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else o(null)}))),c),u=Promise.resolve().then((()=>d(null)));let p=!1;u.catch((e=>{p||console.warn(e)}));function m(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;const h=["cloudflare","vercel"],y=h[0],w={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},g=w[y],f=(e=y)=>{const t=h.indexOf(e),o=h[t+1];return o||null},v=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},b=async({response:e,shouldLog:t=!0,shouldThrow:o=!1})=>{try{return await e.json()}catch(e){if(o)throw e;return t&&console.error(e),null}},S=async({basePathType:e,options:t,path:o})=>{let n;const r=window.Zonos.zonosQaUrlApi||w[e]||y,s=new URL(r+o);s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(t){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{n=await fetch(s.toString(),t)}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 i=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&i&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await b({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await b({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:a}],json:null,response:n,zonosMode:i}}catch(e){return{baseUrl:r,errors:[{message:`${a}: ${"Unknown error"}`,type:a}],json:null,response:null,zonosMode:i}}},z=async({basePathType:t,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":t,l=await S({basePathType:i,options:o,path:n}),{errors:a,response:c}=l,d=m(l,["errors","response"]),u=f(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),h=u&&p;return p&&(async({endpoint:e,errors:t,metadata:o,shouldPostReleaseErrorReporting:n})=>{if(n){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const r="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:r&&r.brands.length>0?r:window.navigator.userAgent},o)};try{fetch(`${g}/api/zonos-elements/log-error`,{body:JSON.stringify(s),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const t=f();if(!t)return;fetch(`${w[t]}/api/zonos-elements/log-error`,{body:JSON.stringify(s),method:"POST"})}})({endpoint:w[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:v(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==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),h?(e(`=== "${n}" failed to fetch, trying next fallback ${u}`),z({basePathType:u,options:o,path:n})):Object.assign({errors:a,response:c},d)},j=async e=>{const{errors:t,json:o}=await(async(e,t)=>{const o=m(t||{},[]),n=o.body?JSON.stringify(o.body):void 0,r=o.method||"GET",s=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},o.headers),i=Object.assign(Object.assign({},o),{body:"GET"===r?void 0:n,headers:s,method:r}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return z({basePathType:l||y,options:i,path:e})})("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!o||t.length?null:o};var O;const C=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})(),k="https://v1.3.70.js.zonos.com",A=C||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.70",E="https://rsms.me",Z="https://fonts.googleapis.com",U=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class T{}O=T,T.doneInit=!1,T.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),T.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),T._paypalMockResponse=null,T.isBigCommerce=!1,T.releaseDate="1728333230244",T.isLegacyCheckout=!1,T.isNpm=!0,T.zonosQaUrl=null,T.zonosQaUrlApi=null,T.version="v1.3.70",T.modeAlerted=!1,T.cartData=null,T.paypal=null,T.getCurrentTimestamp=()=>(new Date).getTime(),T.zonosController=null,T.init=async({appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(O.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!O.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${O.version}) ======`),O.zonosApiKey=c,O.storeId=a,O.isNpm){if(e("====== ZONOS LOADING FROM NPM ======"),!c&&!O.cartId)return void t("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!O.cartData&&O.cartId){e("Initialize cart data");const o=await(async o=>{const n=await j(o);return e("[ZONOS - loadZonos] getting temp cart data","info",n),n?{cartData:n.cartData,storeFavicon:n.storeFaviconUrl,storeId:n.cartData.storeId,storeLogo:n.storeLogoUrl,zonosApiKey:n.cartData.credentialToken}:(t("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(O.cartId);if(!o)return void t("Failed to get cart data");O.cartData=o.cartData,O.zonosApiKey=o.zonosApiKey}}if(O.cartId&&O.cartData){e("Cart data is available, inject hidden button and trigger checkout");const t=document.createElement("button");t.style.display="none",t.id="zonos--checkout-hidden-button",document.body.appendChild(t)}e("init zonos"),O.injectZonosCdn(),O.injectZonosCss(),O.injectFonts(),O.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),O.doneInit=!0}},T.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},T.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},T.showNotification=e=>{var t;null===(t=O.zonosController)||void 0===t||t.showNotification(e)},T.updateOrganizationName=e=>{var t;null===(t=O.zonosController)||void 0===t||t.updateOrganizationName(e)},T.disablePlaceOrderButtons=({autoEnable:e=!0,config:t,disable:o,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=t.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const t=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};t.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&o&&setTimeout((()=>{t.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},T.injectController=({config:o})=>{var n;if(document.querySelector("zonos-controller"))return;if(null===(n=o.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=o,r.zonosApiKey=O.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async o=>{const{detail:n}=o;e("loading Stripe");const s=await(async(...e)=>{p=!0;const t=Date.now();return u.then((o=>((e,t,o)=>{if(null===e)return null;const n=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(n,o),n})(o,e,t)))})(n.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),O.zonosController=r,e("Zonos controller injected!")},T.injectScript=({cdnType:o,isModule:n,theRestUrl:s})=>{const i=`${O.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");n?a.type="module":a.noModule=!0,a.src=i,a.crossOrigin="anonymous",a.onerror=()=>{t(`Failed to load ${a.src}`);const e=r(o);e&&O.injectScript({cdnType:e,isModule:n,theRestUrl:s})},l.appendChild(a)},T.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return A;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.70";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.70";case"vercel":return k}};if(O.isNpm){return s()||t()}return t()},T.injectZonosCdn=()=>{O.injectScript({cdnType:n,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),O.injectScript({cdnType:n,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},T.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const n=O.getZonosUrl(e),s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${k}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${n}/${o}`,l.onerror=()=>{t(`Failed to load ${l.href}`);const n=r(e);n&&O.injectStylesheet({cdnType:n,theRestUrl:o})},s.appendChild(l)},T.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(O.injectStylesheet({cdnType:n,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},T.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${E}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!U.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=E,t.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${E}/inter/inter.css`,t.appendChild(n),e("Zonos font injected!")},T.setupGoogleFont=e=>{var t;null===(t=O.zonosController)||void 0===t||t.setupGoogleFont(e)},T.injectSupportGoogleFont=t=>{var o;e(`[FONT] injecting ${t}`);const n=null===(o=t.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${Z}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=Z,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=T)})();
|
|
@@ -92,7 +92,6 @@ type CartStore = {
|
|
|
92
92
|
restrictedItems: RestrictedItem[];
|
|
93
93
|
selectedLandedCost: MappedCheckoutLandedCost | null;
|
|
94
94
|
selectedShippingOption: ShipmentRatingFragment | null;
|
|
95
|
-
selectedShippingOptionExpectedDate: string;
|
|
96
95
|
selectedShippingOptionTransitTime: string;
|
|
97
96
|
shipping: number;
|
|
98
97
|
shippingData: ShipmentRatingFragment[] | null;
|
|
@@ -110,10 +109,10 @@ declare const cartStore: CartStore;
|
|
|
110
109
|
* - minTransit: 3
|
|
111
110
|
*/
|
|
112
111
|
declare const cartStoreGetShippingTransitInfo: (item: ShipmentRatingFragment) => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
};
|
|
112
|
+
maxTransit: number;
|
|
113
|
+
minTransit: number;
|
|
114
|
+
unit: string;
|
|
115
|
+
} | null;
|
|
117
116
|
/**
|
|
118
117
|
* Check and set restricted items in cart
|
|
119
118
|
*/
|
|
@@ -17,7 +17,7 @@ export type StripeStoreContactOption = {
|
|
|
17
17
|
};
|
|
18
18
|
type StripeStore = {
|
|
19
19
|
clientSecret: string | null;
|
|
20
|
-
|
|
20
|
+
fetchingLandedCostAbortController: AbortController | null;
|
|
21
21
|
hasPaymentError: boolean;
|
|
22
22
|
isFetchingLandedCost: boolean;
|
|
23
23
|
isFetchingSession: boolean;
|
|
@@ -64,7 +64,7 @@ declare const stripeStoreCleanupDomesticShippingSession: () => void;
|
|
|
64
64
|
declare const stripeStoreSaveDomesticShippingSession: (props: DomesticShippingSession) => void;
|
|
65
65
|
declare const stripeStoreGetDomesticShippingSession: () => DomesticShippingSession | null;
|
|
66
66
|
declare const initStripeElements: (props?: {
|
|
67
|
-
|
|
67
|
+
overrideBorderRadius?: ElementsUiStyle;
|
|
68
68
|
overridePrimaryColor?: string;
|
|
69
69
|
overrideSecondaryColor?: string;
|
|
70
70
|
overrideTheme?: ElementsUiTheme;
|
|
@@ -344,10 +344,16 @@ export declare const stringsArabic: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsBase: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsChinese: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsDanish: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsDutch: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsFrench: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsGerman: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsHebrew: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsIndonesian: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsItalian: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsJapanese: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsKorean: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsNorwegian: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsPolish: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsPortuguese: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsRussian: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsSpanish: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsSwedish: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsTurkish: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -344,10 +344,16 @@ export declare const stringsVietnamese: {
|
|
|
344
344
|
'click to learn more': {
|
|
345
345
|
value: string;
|
|
346
346
|
};
|
|
347
|
+
days: {
|
|
348
|
+
value: string;
|
|
349
|
+
};
|
|
347
350
|
or: {
|
|
348
351
|
value: string;
|
|
349
352
|
};
|
|
350
353
|
'restricted items': {
|
|
351
354
|
value: string;
|
|
352
355
|
};
|
|
356
|
+
weeks: {
|
|
357
|
+
value: string;
|
|
358
|
+
};
|
|
353
359
|
};
|
|
@@ -4,7 +4,8 @@ type TranslationStore = {
|
|
|
4
4
|
translatedChunks: typeof stringsBase;
|
|
5
5
|
};
|
|
6
6
|
declare const translationStore: TranslationStore;
|
|
7
|
-
|
|
7
|
+
export { translationStore };
|
|
8
|
+
export declare const translationStoreUpdateLanguage: (language: Locale_ElementsSupportedLocationCode_Enum | {
|
|
8
9
|
_placeholder?: never;
|
|
9
10
|
}) => void;
|
|
10
11
|
/**
|
|
@@ -22,6 +23,7 @@ type ExtractVariables<S extends string> = S extends `${infer _Start}[${infer Var
|
|
|
22
23
|
* // Params = ['[percentage] GST due on any order above [threshold].', variables: { percentage: string, threshold: string }]
|
|
23
24
|
*/
|
|
24
25
|
type TranslateParams<T extends string> = ExtractVariables<T> extends never ? [T, variables?: never] : [T, variables: Record<ExtractVariables<T>, string>];
|
|
26
|
+
export type ITranslationKey = keyof typeof stringsBase;
|
|
25
27
|
/**
|
|
26
28
|
* Translate a string with variables if variable pattern is present in the string
|
|
27
29
|
* @example
|
|
@@ -30,5 +32,4 @@ type TranslateParams<T extends string> = ExtractVariables<T> extends never ? [T,
|
|
|
30
32
|
* // No variables:
|
|
31
33
|
* translate('Above de minimis threshold for')
|
|
32
34
|
*/
|
|
33
|
-
declare const translate: <T extends "Shipping" | "Email" | "Name" | "Guaranteed" | "Customer" | "Country" | "Failure" | "Success" | "Hide" | "or" | "Delivery" | "Payment" | "Above de minimis threshold for" | "Address" | "Address line 1" | "Address line 2" | "An unexpected error occurred when processing PayPal order." | "Are you sure?" | "Back" | "Billing" | "Billing address" | "Cancel" | "Card number copied to clipboard" | "Cart subtotal" | "City" | "Click to copy the card number. Use any future expiration date and three number CVC." | "Close" | "Contact" | "Continue to shipping" | "Couldn't place order" | "Customer information" | "Delivery options" | "Discounts" | "Don't close" | "Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders." | "Duties and taxes will be applied to items and shipping." | "Duties will apply to all orders." | "Duties, taxes, and fees" | "Error creating Checkout" | "Error updating Checkout" | "Expected delivery" | "Failed to create PayPal order. Please try again, or consider using an alternative method." | "First name" | "Go to payment" | "Keep shopping" | "Know about duties and taxes before you buy. Shop with confidence!" | "Last name" | "Learn more." | "Missing required fields. Make sure all fields are completed." | "No countries found" | "No shipping method selected" | "No shipping methods found - please review and update your address details by selecting the \"Customer\" tab above. If you continue to encounter issues, contact our support team for assistance." | "No shipping methods found - try editing your address or contacting support if the error persists" | "Nothing due at the door" | "Order total" | "Orders to [countryName] must be over [threshold] to ship." | "Pay [orderTotal]" | "Pay [organizationName]" | "Payment failed" | "Payment failed. Please try another payment method." | "Payment method" | "Payment processing. We'll update you when payment is received." | "Phone number" | "Please ensure your text uses the Latin alphabet only (A-Z, a-z)." | "Postal code" | "Powered by" | "Prepay duties and taxes at checkout" | "Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions." | "Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions." | "Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions." | "Product prices already include duties. No additional duties will be added at checkout, with rare exceptions." | "Product prices already include fees. No additional fees will be added at checkout, with rare exceptions." | "Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions." | "Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions." | "Reload" | "Restricted item" | "Restricted items found" | "Return to cart" | "Search countries" | "See duty and tax thresholds" | "Select a country" | "Select a language" | "Session timed out" | "Shipping address same as billing" | "Shipping method" | "Show" | "Something went wrong." | "Spend [threshold] duty free." | "Spend [threshold] tax free." | "State" | "State/Province" | "Taxes will apply to all orders." | "Test cards" | "Test mode" | "The following items are unable to be shipped to your country and are not included in your cart total." | "The low-value GST law passed July 1st, 2018 applies to this retailer." | "There's been an error creating your checkout session. Please reload and try again or contact support if the error persists" | "There's been an error updating your checkout session. Please reload and try again or contact support if the error persists" | "To ensure delivery all address details must be in Latin characters." | "Translated address" | "Unable to check inventory. Please try again." | "Update address" | "Update your address" | "We couldn't complete your payment. Please verify the payment details and try again." | "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time." | "Welcome to [storeName]" | "Welcome!" | "What you entered" | "Would you like to close checkout and return to the site?" | "You're all set!" | "Your checkout session has expired. Please reload the page to continue." | "Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us." | "[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy." | "[percentage] GST due on any order above [threshold]." | "business days" | "click to learn more" | "restricted items">(...[key, replacement]: TranslateParams<T>) => string;
|
|
34
|
-
export { translate, translationStore, translationStoreUpdateLanguage };
|
|
35
|
+
export declare const translate: <T extends "Shipping" | "Email" | "Name" | "Guaranteed" | "Customer" | "Country" | "Failure" | "Success" | "Hide" | "or" | "Delivery" | "Payment" | "Above de minimis threshold for" | "Address" | "Address line 1" | "Address line 2" | "An unexpected error occurred when processing PayPal order." | "Are you sure?" | "Back" | "Billing" | "Billing address" | "Cancel" | "Card number copied to clipboard" | "Cart subtotal" | "City" | "Click to copy the card number. Use any future expiration date and three number CVC." | "Close" | "Contact" | "Continue to shipping" | "Couldn't place order" | "Customer information" | "Delivery options" | "Discounts" | "Don't close" | "Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders." | "Duties and taxes will be applied to items and shipping." | "Duties will apply to all orders." | "Duties, taxes, and fees" | "Error creating Checkout" | "Error updating Checkout" | "Expected delivery" | "Failed to create PayPal order. Please try again, or consider using an alternative method." | "First name" | "Go to payment" | "Keep shopping" | "Know about duties and taxes before you buy. Shop with confidence!" | "Last name" | "Learn more." | "Missing required fields. Make sure all fields are completed." | "No countries found" | "No shipping method selected" | "No shipping methods found - please review and update your address details by selecting the \"Customer\" tab above. If you continue to encounter issues, contact our support team for assistance." | "No shipping methods found - try editing your address or contacting support if the error persists" | "Nothing due at the door" | "Order total" | "Orders to [countryName] must be over [threshold] to ship." | "Pay [orderTotal]" | "Pay [organizationName]" | "Payment failed" | "Payment failed. Please try another payment method." | "Payment method" | "Payment processing. We'll update you when payment is received." | "Phone number" | "Please ensure your text uses the Latin alphabet only (A-Z, a-z)." | "Postal code" | "Powered by" | "Prepay duties and taxes at checkout" | "Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions." | "Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions." | "Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions." | "Product prices already include duties. No additional duties will be added at checkout, with rare exceptions." | "Product prices already include fees. No additional fees will be added at checkout, with rare exceptions." | "Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions." | "Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions." | "Reload" | "Restricted item" | "Restricted items found" | "Return to cart" | "Search countries" | "See duty and tax thresholds" | "Select a country" | "Select a language" | "Session timed out" | "Shipping address same as billing" | "Shipping method" | "Show" | "Something went wrong." | "Spend [threshold] duty free." | "Spend [threshold] tax free." | "State" | "State/Province" | "Taxes will apply to all orders." | "Test cards" | "Test mode" | "The following items are unable to be shipped to your country and are not included in your cart total." | "The low-value GST law passed July 1st, 2018 applies to this retailer." | "There's been an error creating your checkout session. Please reload and try again or contact support if the error persists" | "There's been an error updating your checkout session. Please reload and try again or contact support if the error persists" | "To ensure delivery all address details must be in Latin characters." | "Translated address" | "Unable to check inventory. Please try again." | "Update address" | "Update your address" | "We couldn't complete your payment. Please verify the payment details and try again." | "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time." | "Welcome to [storeName]" | "Welcome!" | "What you entered" | "Would you like to close checkout and return to the site?" | "You're all set!" | "Your checkout session has expired. Please reload the page to continue." | "Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us." | "[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy." | "[percentage] GST due on any order above [threshold]." | "business days" | "click to learn more" | "days" | "restricted items" | "weeks">(...[key, replacement]: TranslateParams<T>) => string;
|