ui.shipaid.com 0.3.73 → 0.3.75
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/widget.es.js
CHANGED
|
@@ -1985,6 +1985,7 @@ class CheckoutPackageProtection extends s$1 {
|
|
|
1985
1985
|
super(...arguments);
|
|
1986
1986
|
this.protectionPrice = 0;
|
|
1987
1987
|
this.checkoutTotal = 0;
|
|
1988
|
+
this.shipaidVariant = null;
|
|
1988
1989
|
this.logo = "";
|
|
1989
1990
|
this.originalClasses = "";
|
|
1990
1991
|
}
|
|
@@ -1994,9 +1995,6 @@ class CheckoutPackageProtection extends s$1 {
|
|
|
1994
1995
|
handleAbout() {
|
|
1995
1996
|
this.dispatchEvent(new Event("shipaid-about"));
|
|
1996
1997
|
}
|
|
1997
|
-
handleCheckoutWithProtection() {
|
|
1998
|
-
this.dispatchEvent(new Event("shipaid-add-protection"));
|
|
1999
|
-
}
|
|
2000
1998
|
handleCheckoutWithoutProtection() {
|
|
2001
1999
|
this.dispatchEvent(new Event("shipaid-remove-protection"));
|
|
2002
2000
|
}
|
|
@@ -2019,11 +2017,11 @@ class CheckoutPackageProtection extends s$1 {
|
|
|
2019
2017
|
</div>
|
|
2020
2018
|
</div>
|
|
2021
2019
|
|
|
2022
|
-
<
|
|
2020
|
+
<a id="shipaid-checkout-button" class="${this.originalClasses}" href="/checkout${this.shipaidVariant ? `?attributes[_shipaid-internal]=1&updates[${this.shipaidVariant}]=1` : ""}">
|
|
2023
2021
|
CHECKOUT+ ${this.checkoutTotal}
|
|
2024
|
-
</
|
|
2022
|
+
</a>
|
|
2025
2023
|
|
|
2026
|
-
<a href="#" class="continue-link" @click=${this.handleCheckoutWithoutProtection}>
|
|
2024
|
+
<a id="shipaid-continue-button" href="#" class="continue-link" @click=${this.handleCheckoutWithoutProtection}>
|
|
2027
2025
|
Continue without delivery guarantee
|
|
2028
2026
|
</a>
|
|
2029
2027
|
</div>
|
|
@@ -2036,6 +2034,9 @@ __decorateClass$1([
|
|
|
2036
2034
|
__decorateClass$1([
|
|
2037
2035
|
n$7()
|
|
2038
2036
|
], CheckoutPackageProtection.prototype, "checkoutTotal");
|
|
2037
|
+
__decorateClass$1([
|
|
2038
|
+
n$7()
|
|
2039
|
+
], CheckoutPackageProtection.prototype, "shipaidVariant");
|
|
2039
2040
|
__decorateClass$1([
|
|
2040
2041
|
n$7()
|
|
2041
2042
|
], CheckoutPackageProtection.prototype, "logo");
|
|
@@ -2950,8 +2951,10 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2950
2951
|
style.id = "shipaid-styles";
|
|
2951
2952
|
style.textContent = `
|
|
2952
2953
|
checkout-package-protection {
|
|
2954
|
+
width: 100%;
|
|
2955
|
+
justify-content: center;
|
|
2956
|
+
display: flex;
|
|
2953
2957
|
${styles2}
|
|
2954
|
-
width: var(--shipaid-checkout-width, 100%);
|
|
2955
2958
|
}
|
|
2956
2959
|
|
|
2957
2960
|
`;
|
|
@@ -2960,7 +2963,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2960
2963
|
const originalCheckoutButtons = document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);
|
|
2961
2964
|
if (!originalCheckoutButtons.length) return;
|
|
2962
2965
|
originalCheckoutButtons.forEach((originalCheckoutButton, index) => {
|
|
2963
|
-
var _a2, _b2;
|
|
2966
|
+
var _a2, _b2, _c2;
|
|
2964
2967
|
const containerId = `shipaid-checkout-container-${index}`;
|
|
2965
2968
|
originalCheckoutButton.style.display = "none";
|
|
2966
2969
|
const originalClasses = originalCheckoutButton.className;
|
|
@@ -2969,6 +2972,8 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2969
2972
|
container = document.createElement("div");
|
|
2970
2973
|
container.id = containerId;
|
|
2971
2974
|
container.style.width = "100%";
|
|
2975
|
+
container.style.display = "flex";
|
|
2976
|
+
container.style.justifyContent = "center";
|
|
2972
2977
|
originalCheckoutButton.insertAdjacentElement("afterend", container);
|
|
2973
2978
|
}
|
|
2974
2979
|
const protectionPrice = Number((_a2 = this._protectionVariant) == null ? void 0 : _a2.price) || 0;
|
|
@@ -2986,14 +2991,17 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2986
2991
|
x`
|
|
2987
2992
|
<style>
|
|
2988
2993
|
.shipaid-container {
|
|
2994
|
+
width: var(--shipaid-checkout-width, 100%);
|
|
2989
2995
|
margin: var(--shipaid-checkout-margin, 0);
|
|
2990
2996
|
padding: var(--shipaid-checkout-padding, 0);
|
|
2991
2997
|
}
|
|
2992
|
-
.shipaid-container button {
|
|
2998
|
+
.shipaid-container a#shipaid-checkout-button {
|
|
2993
2999
|
width: 100%;
|
|
3000
|
+
margin: 0px;
|
|
2994
3001
|
}
|
|
2995
|
-
.shipaid-container a {
|
|
3002
|
+
.shipaid-container a#shipaid-continue-button {
|
|
2996
3003
|
display: block;
|
|
3004
|
+
margin: 1rem 0px 0px;
|
|
2997
3005
|
}
|
|
2998
3006
|
.shipaid-loader {
|
|
2999
3007
|
margin-left: 0.5rem;
|
|
@@ -3054,6 +3062,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3054
3062
|
</style>
|
|
3055
3063
|
|
|
3056
3064
|
<checkout-package-protection
|
|
3065
|
+
.shipaidVariant=${(_c2 = this._protectionVariant) == null ? void 0 : _c2.id}
|
|
3057
3066
|
.protectionPrice=${protectionPrice ? this._currencyFormat(protectionPrice) : loading2}
|
|
3058
3067
|
.checkoutTotal=${cartTotal ? this._currencyFormat(cartTotal) : loading2}
|
|
3059
3068
|
.logo=${ShipAidReducedLogo}
|
|
@@ -3064,12 +3073,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3064
3073
|
this.setPopupKey();
|
|
3065
3074
|
}
|
|
3066
3075
|
}}
|
|
3067
|
-
|
|
3068
|
-
var _a3, _b3;
|
|
3069
|
-
sessionStorage.setItem("shipaid_variant", JSON.stringify((_a3 = this._protectionVariant) == null ? void 0 : _a3.id));
|
|
3070
|
-
window.location.href = `/checkout?attributes[_shipaid-internal]=1&updates[${(_b3 = this._protectionVariant) == null ? void 0 : _b3.id}]=1`;
|
|
3071
|
-
}}
|
|
3072
|
-
@shipaid-remove-protection=${async () => {
|
|
3076
|
+
@shipaid-remove-protection=${async () => {
|
|
3073
3077
|
await this.removeProtection();
|
|
3074
3078
|
window.location.href = "/checkout";
|
|
3075
3079
|
}}
|
package/dist/widget.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ShipAidWidget=function(t){"use strict";function e(t){var e;return(null==(e=null==t?void 0:t.match(/\d+/))?void 0:e[0])??null}const i={calculateProtectionTotal:function(t,e,i){var o,r;if(!t)throw new Error("Missing store settings.");if(!e)throw new Error("Missing protectionProduct.");if(!i)throw new Error("Missing Shopify cart.");const n=null==t?void 0:t.protectionSettings;if(!n)throw new Error("Tried to find protection variant, but protection settings for this store are missing.");const a=Array.isArray(null==t?void 0:t.excludedProductSkus)?t.excludedProductSkus.map((t=>t.trim())):[],s=Array.isArray(null==t?void 0:t.excludedProductsVariantsId)?t.excludedProductsVariantsId.map((t=>{var e;return parseInt((null==(e=t.match(/\d+/))?void 0:e[0])??"",10)})):[],
|
|
1
|
+
var ShipAidWidget=function(t){"use strict";function e(t){var e;return(null==(e=null==t?void 0:t.match(/\d+/))?void 0:e[0])??null}const i={calculateProtectionTotal:function(t,e,i){var o,r;if(!t)throw new Error("Missing store settings.");if(!e)throw new Error("Missing protectionProduct.");if(!i)throw new Error("Missing Shopify cart.");const n=null==t?void 0:t.protectionSettings;if(!n)throw new Error("Tried to find protection variant, but protection settings for this store are missing.");const a=Array.isArray(null==t?void 0:t.excludedProductSkus)?t.excludedProductSkus.map((t=>t.trim())):[],s=Array.isArray(null==t?void 0:t.excludedProductsVariantsId)?t.excludedProductsVariantsId.map((t=>{var e;return parseInt((null==(e=t.match(/\d+/))?void 0:e[0])??"",10)})):[],p=(i.items??[]).reduce(((t,e)=>(t=>!(!t.sku||!a.includes(t.sku.trim()))||!(!t.variant_id||!s.includes(t.variant_id)))(e)?t-e.final_line_price:t),i.total_price||0)-((null==(o=i.items)?void 0:o.filter((t=>{var i;return null==(i=null==e?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})))??[]).reduce(((t,e)=>t+e.final_line_price),0);if(0===p)return p;if("FIXED"===n.protectionType){if("number"!=typeof n.defaultFee)throw new Error("Missing default fee amount.");if(!(null==(r=n.rules)?void 0:r.length))return n.defaultFee;const t=p/100,e=n.rules.sort(((t,e)=>t.rangeLower&&e.rangeLower?t.rangeLower-e.rangeLower:0)).find((e=>{const i=Boolean(e.rangeLower&&e.rangeLower<t);return e.rangeUpper?i&&e.rangeUpper>=t:i}));return"number"==typeof(null==e?void 0:e.fee)?e.fee:n.defaultFee}if("PERCENTAGE"===n.protectionType){const t=p*n.percentage/100;return t>=n.minimumFee?t:n.minimumFee}throw new Error("No protection type handler found for this store.")},findProtectionVariant:function(t,e,i){var o;if(!(null==t?void 0:t.protectionSettings)||!(null==(o=null==e?void 0:e.variants)?void 0:o.length))throw new Error("Missing product and variants from protection settings.");const r=null==e?void 0:e.variants.flatMap((t=>{if(!(null==t?void 0:t.price))return[];const e=Number(t.price);return[{...t,formattedPrice:e}]})).sort(((t,e)=>t.formattedPrice-e.formattedPrice)),n=r.find((t=>t.formattedPrice>=i));return n||r[r.length-1]}},o=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}},r=(t,e,i)=>{e.constructor.createProperty(i,t)};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
@@ -19,23 +19,23 @@ var ShipAidWidget=function(t){"use strict";function e(t){var e;return(null==(e=n
|
|
|
19
19
|
* Copyright 2019 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const p=window,d=p.ShadowRoot&&(void 0===p.ShadyCSS||p.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,l=Symbol(),c=new WeakMap;let h=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(d&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=c.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&c.set(e,t))}return t}toString(){return this.cssText}};const u=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new h(i,t,l)},m=d?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,l))(e)})(t):t
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/;var g;const f=window,v=f.trustedTypes,b=v?v.emptyScript:"",y=f.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},w=(t,e)=>e!==t&&(e==e||t==t),C={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:w},x="finalized";let $=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||C}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(m(t))}else void 0!==t&&e.push(m(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{
|
|
27
|
+
*/;var g;const f=window,v=f.trustedTypes,b=v?v.emptyScript:"",y=f.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},w=(t,e)=>e!==t&&(e==e||t==t),C={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:w},x="finalized";let $=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||C}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(m(t))}else void 0!==t&&e.push(m(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{d?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=p.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=C){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:_).toAttribute(e,i.type);this._$El=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(t,e){var i;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:_;this._$El=r,this[r]=n.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||w)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(o){throw e=!1,this._$Ek(),o}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};
|
|
28
28
|
/**
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
32
|
*/
|
|
33
|
-
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,M=`<${E}>`,I=document,T=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,R=/>/g,U=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,D=/"/g,F=/^(?:script|style|textarea|title)$/i,H=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),W=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),G=new WeakMap,K=I.createTreeWalker(I,129,null,!1);var Q;function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const a=t.length-1,s=this.parts,[d
|
|
33
|
+
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,M=`<${E}>`,I=document,T=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,R=/>/g,U=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,D=/"/g,F=/^(?:script|style|textarea|title)$/i,H=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),W=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),G=new WeakMap,K=I.createTreeWalker(I,129,null,!1);var Q;function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const a=t.length-1,s=this.parts,[p,d]=((t,e)=>{const i=t.length-1,o=[];let r,n=2===e?"<svg>":"",a=O;for(let s=0;s<i;s++){const e=t[s];let i,p,d=-1,l=0;for(;l<e.length&&(a.lastIndex=l,p=a.exec(e),null!==p);)l=a.lastIndex,a===O?"!--"===p[1]?a=V:void 0!==p[1]?a=R:void 0!==p[2]?(F.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=U):void 0!==p[3]&&(a=U):a===U?">"===p[0]?(a=null!=r?r:O,d=-1):void 0===p[1]?d=-2:(d=a.lastIndex-p[2].length,i=p[1],a=void 0===p[3]?U:'"'===p[3]?D:B):a===D||a===B?a=U:a===V||a===R?a=O:(a=U,r=void 0);const c=a===U&&t[s+1].startsWith("/>")?" ":"";n+=a===O?e+M:d>=0?(o.push(i),e.slice(0,d)+L+e.slice(d)+z+c):e+z+(-2===d?(o.push(void 0),s):c)}return[Y(t,n+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=J.createElement(p,i),K.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=K.nextNode())&&s.length<a;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(L)||e.startsWith(z)){const i=d[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+L).split(z),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?ot:"?"===e[1]?nt:"@"===e[1]?at:it})}else s.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(F.test(o.tagName)){const t=o.textContent.split(z),e=t.length-1;if(e>0){o.textContent=A?A.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),K.nextNode(),s.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===E)s.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(z,t+1));)s.push({type:7,index:r}),t+=z.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,o){var r,n,a,s;if(e===W)return e;let p=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const d=q(e)?void 0:e._$litDirective$;return(null==p?void 0:p.constructor)!==d&&(null===(n=null==p?void 0:p._$AO)||void 0===n||n.call(p,!1),void 0===d?p=void 0:(p=new d(t),p._$AT(t,i,o)),void 0!==o?(null!==(a=(s=i)._$Co)&&void 0!==a?a:s._$Co=[])[o]=p:i._$Cl=p),void 0!==p&&(e=X(t,p._$AS(t,e.values),p,o)),e}class tt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:I).importNode(i,!0);K.currentNode=r;let n=K.nextNode(),a=0,s=0,p=o[0];for(;void 0!==p;){if(a===p.index){let e;2===p.type?e=new et(n,n.nextSibling,this,t):1===p.type?e=new p.ctor(n,p.name,p.strings,this,t):6===p.type&&(e=new st(n,this,t)),this._$AV.push(e),p=o[++s]}a!==(null==p?void 0:p.index)&&(n=K.nextNode(),a++)}return K.currentNode=I,r}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,o){var r;this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=null===(r=null==o?void 0:o.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),q(t)?t===Z||null==t||""===t?(this._$AH!==Z&&this._$AR(),this._$AH=Z):t!==this._$AH&&t!==W&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Z&&q(this._$AH)?this._$AA.nextSibling.data=t:this.$(I.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=J.createElement(Y(o.h,o.h[0]),this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.v(i);else{const t=new tt(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new J(t)),e}T(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new et(this.k(T()),this.k(T()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,o,r){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let n=!1;if(void 0===r)t=X(this,t,e,0),n=!q(t)||t!==this._$AH&&t!==W,n&&(this._$AH=t);else{const o=t;let a,s;for(t=r[0],a=0;a<r.length-1;a++)s=X(this,o[i+a],e,a),s===W&&(s=this._$AH[a]),n||(n=!q(s)||s!==this._$AH[a]),s===Z?t=Z:t!==Z&&(t+=(null!=s?s:"")+r[a+1]),this._$AH[a]=s}n&&!o&&this.j(t)}j(t){t===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ot extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Z?void 0:t}}const rt=A?A.emptyScript:"";class nt extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Z?this.element.setAttribute(this.name,rt):this.element.removeAttribute(this.name)}}class at extends it{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=X(this,t,e,0))&&void 0!==i?i:Z)===W)return;const o=this._$AH,r=t===Z&&o!==Z||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==Z&&(o===Z||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const pt=S.litHtmlPolyfillSupport;null==pt||pt(J,et),(null!==(k=S.litHtmlVersions)&&void 0!==k?k:S.litHtmlVersions=[]).push("2.8.0");const dt=(t,e,i)=>{var o,r;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let a=n._$litPart$;if(void 0===a){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;n._$litPart$=a=new et(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return a._$AI(t),a};
|
|
34
34
|
/**
|
|
35
35
|
* @license
|
|
36
36
|
* Copyright 2017 Google LLC
|
|
37
37
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
-
*/var lt,ct;let ht=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=
|
|
38
|
+
*/var lt,ct;let ht=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return W}};ht.finalized=!0,ht._$litElement$=!0,null===(lt=globalThis.litElementHydrateSupport)||void 0===lt||lt.call(globalThis,{LitElement:ht});const ut=globalThis.litElementPolyfillSupport;null==ut||ut({LitElement:ht}),(null!==(ct=globalThis.litElementVersions)&&void 0!==ct?ct:globalThis.litElementVersions=[]).push("3.3.3");const mt="langChanged";function gt(t,e,i){return Object.entries(vt(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[ ]*${e}[ ]*}}`,"gm"),String(vt(i)))),t)}function ft(t,e){const i=t.split(".");let o=e.strings;for(;null!=o&&i.length>0;)o=o[i.shift()];return null!=o?o.toString():null}function vt(t){return"function"==typeof t?t():t}let bt={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:ft,interpolate:gt,translationCache:{}};function yt(t,e,i=bt){var o;o={previousStrings:i.strings,previousLang:i.lang,lang:i.lang=t,strings:i.strings=e},window.dispatchEvent(new CustomEvent(mt,{detail:o}))}
|
|
39
39
|
/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
@@ -986,7 +986,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
986
986
|
fill: var(--shipaid-svg-fill);
|
|
987
987
|
stroke: var(--shipaid-svg-stroke);
|
|
988
988
|
}
|
|
989
|
-
`;let ie=ee;te([n({type:Boolean,attribute:!0})],ie.prototype,"open"),te([n({type:String,attribute:!0})],ie.prototype,"product"),te([n({type:String,attribute:!0})],ie.prototype,"imageUrl"),te([n({type:String,attribute:!0})],ie.prototype,"priceOfVariant"),te([n({type:String,attribute:!0})],ie.prototype,"quantity"),te([n({type:Boolean})],ie.prototype,"dontShowAgain"),customElements.get("shipaid-cart-confirmation")||customElements.define("shipaid-cart-confirmation",ie);var oe=Object.defineProperty,re=(t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);return n&&oe(e,i,n),n};class ne extends ht{constructor(){super(...arguments),this.protectionPrice=0,this.checkoutTotal=0,this.logo="",this.originalClasses=""}createRenderRoot(){return this}handleAbout(){this.dispatchEvent(new Event("shipaid-about"))}
|
|
989
|
+
`;let ie=ee;te([n({type:Boolean,attribute:!0})],ie.prototype,"open"),te([n({type:String,attribute:!0})],ie.prototype,"product"),te([n({type:String,attribute:!0})],ie.prototype,"imageUrl"),te([n({type:String,attribute:!0})],ie.prototype,"priceOfVariant"),te([n({type:String,attribute:!0})],ie.prototype,"quantity"),te([n({type:Boolean})],ie.prototype,"dontShowAgain"),customElements.get("shipaid-cart-confirmation")||customElements.define("shipaid-cart-confirmation",ie);var oe=Object.defineProperty,re=(t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);return n&&oe(e,i,n),n};class ne extends ht{constructor(){super(...arguments),this.protectionPrice=0,this.checkoutTotal=0,this.shipaidVariant=null,this.logo="",this.originalClasses=""}createRenderRoot(){return this}handleAbout(){this.dispatchEvent(new Event("shipaid-about"))}handleCheckoutWithoutProtection(){this.dispatchEvent(new Event("shipaid-remove-protection"))}render(){return H`
|
|
990
990
|
<div class="shipaid-container">
|
|
991
991
|
<div class="protection-info">
|
|
992
992
|
<div class="protection-text">
|
|
@@ -1004,15 +1004,15 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1004
1004
|
</div>
|
|
1005
1005
|
</div>
|
|
1006
1006
|
|
|
1007
|
-
<
|
|
1007
|
+
<a id="shipaid-checkout-button" class="${this.originalClasses}" href="/checkout${this.shipaidVariant?`?attributes[_shipaid-internal]=1&updates[${this.shipaidVariant}]=1`:""}">
|
|
1008
1008
|
CHECKOUT+ ${this.checkoutTotal}
|
|
1009
|
-
</
|
|
1009
|
+
</a>
|
|
1010
1010
|
|
|
1011
|
-
<a href="#" class="continue-link" @click=${this.handleCheckoutWithoutProtection}>
|
|
1011
|
+
<a id="shipaid-continue-button" href="#" class="continue-link" @click=${this.handleCheckoutWithoutProtection}>
|
|
1012
1012
|
Continue without delivery guarantee
|
|
1013
1013
|
</a>
|
|
1014
1014
|
</div>
|
|
1015
|
-
`}}re([n()],ne.prototype,"protectionPrice"),re([n()],ne.prototype,"checkoutTotal"),re([n()],ne.prototype,"logo"),re([n({type:String})],ne.prototype,"originalClasses"),customElements.get("checkout-package-protection")||customElements.define("checkout-package-protection",ne);const ae="Loading ShipAid Widget...",se="Delivery Guarantee",
|
|
1015
|
+
`}}re([n()],ne.prototype,"protectionPrice"),re([n()],ne.prototype,"checkoutTotal"),re([n()],ne.prototype,"shipaidVariant"),re([n()],ne.prototype,"logo"),re([n({type:String})],ne.prototype,"originalClasses"),customElements.get("checkout-package-protection")||customElements.define("checkout-package-protection",ne);const ae="Loading ShipAid Widget...",se="Delivery Guarantee",pe="in case of Loss, Damage or Theft",de={button:"Powered by"},le={add:"Add",remove:"Remove",loading:"Loading..."},ce={loading:ae,title:se,description:pe,footer:de,actions:le,"learn-more-popup":{close:"Close",title:"Delivery Guarantee",disclaimer:{"subtitle-enable":"We enable your favorite brands to provide a delivery guarantee because we know that every order is precious, and things happen!","subtitle-monitor":"We continuously monitor your package and offer a convenient portal for you to track your order's progress at any moment!","subtitle-notify":"You'll be notified throughout the entire shipping process, ensuring you stay up to date every step of the way.","subtitle-resolution":"In case of any issues during transit, we offer a quick and easy method to report the problem directly to the brand, for a swift resolution.",text:"By purchasing this delivery guarantee, you agree to our Terms Of Service and Privacy Policy. You are not obligated to purchase this guarantee. This guarantee is NOT insurance and does not provide indemnification against loss, damage, or liability arising from a contingent or unknown event, but rather, through ShipAid brands provide a delivery guarantee whereby if the product you ordered is not delivered in satisfactory condition, the brand from which you ordered the product may replace the product free of charge. ShipAid does not provide any products or services directly to consumers, but instead provides a service that allow brands to facilitate product replacement to their customers. Purchasing this guarantee does not mean that you will automatically be reimbursed for any product or shipping costs because the resolution process and decision for compensation is strictly decided by the brand you a purchasing from. The brand will require proof of damage or undelivered product."},links:{terms:"Terms of Service",privacy:"Privacy Policy"}}},he=Object.freeze(Object.defineProperty({__proto__:null,actions:le,default:ce,description:pe,footer:de,loading:ae,title:se},Symbol.toStringTag,{value:"Module"})),ue=u`
|
|
1016
1016
|
:host {
|
|
1017
1017
|
--shipaid-primary: #002bd6;
|
|
1018
1018
|
--shipaid-secondary: #0076ff;
|
|
@@ -1168,7 +1168,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1168
1168
|
.shipaid-prompt .prompt-footer .prompt-footer-badge svg {
|
|
1169
1169
|
height:var(--shipaid-footer-badge-logo-height, 9px);
|
|
1170
1170
|
}
|
|
1171
|
-
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-protection",$e="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n useCustomApp\n }\n}",ke=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>qe)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>ii)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>pi)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>fi)).then((t=>t.default))});var Se;Se={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(ke,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Se);const Ae=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,a;const s=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(a=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:a.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",s)}return new Intl.NumberFormat(void 0,{currency:s,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request($e,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:$e,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(a){throw console.error(a),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,a,s,d,p,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(a=o.data)?void 0:a.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(d=null==(s=o.data.sellingPlanFromVariant)?void 0:s.sellingPlanGroups)?void 0:d.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(p=g[0])?void 0:p.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,a,s;try{let d;if(this.useCustomStoreFront){const p=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:xe});if(null==p?void 0:p.product){const l=p.product;d={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(s=null==(a=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:a.node)?void 0:s.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else d=(await this._fetch.get(`/products/${xe}.json`)).product;return d}catch(d){throw _e(d.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,a;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);a=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:a}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:a};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn))return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const a=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),s=null==(r=this._cart)?void 0:r.items[a];if(this._hasProtectionInCart=!!s,1===this._cart.item_count&&s)return;!!sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1171
|
+
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-protection",$e="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n useCustomApp\n }\n}",ke=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>qe)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>ii)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>di)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>fi)).then((t=>t.default))});var Se;Se={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(ke,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Se);const Ae=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,a;const s=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(a=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:a.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",s)}return new Intl.NumberFormat(void 0,{currency:s,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request($e,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:$e,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(a){throw console.error(a),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,a,s,p,d,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(a=o.data)?void 0:a.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(p=null==(s=o.data.sellingPlanFromVariant)?void 0:s.sellingPlanGroups)?void 0:p.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(d=g[0])?void 0:d.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,a,s;try{let p;if(this.useCustomStoreFront){const d=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:xe});if(null==d?void 0:d.product){const l=d.product;p={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(s=null==(a=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:a.node)?void 0:s.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else p=(await this._fetch.get(`/products/${xe}.json`)).product;return p}catch(p){throw _e(p.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,a;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);a=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:a}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:a};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn))return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const a=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),s=null==(r=this._cart)?void 0:r.items[a];if(this._hasProtectionInCart=!!s,1===this._cart.item_count&&s)return;!!sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1172
1172
|
<shipaid-popup-learn-more
|
|
1173
1173
|
?active=${"learn-more"===this._popup}
|
|
1174
1174
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
@@ -1179,24 +1179,27 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1179
1179
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1180
1180
|
@remove-protection=${()=>{this.removeProtection(),this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1181
1181
|
></shipaid-popup-confirmation>
|
|
1182
|
-
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r){const t=document.createElement("style");t.id="shipaid-styles",t.textContent=`\n checkout-package-protection {\n ${r}\n
|
|
1182
|
+
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r){const t=document.createElement("style");t.id="shipaid-styles",t.textContent=`\n checkout-package-protection {\n width: 100%;\n justify-content: center;\n display: flex;\n ${r}\n }\n\n `,document.head.appendChild(t)}const n=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(n.length)return n.forEach(((t,e)=>{var i,o,r;const n=`shipaid-checkout-container-${e}`;t.style.display="none";const a=t.className;let s=document.getElementById(n);s||(s=document.createElement("div"),s.id=n,s.style.width="100%",s.style.display="flex",s.style.justifyContent="center",t.insertAdjacentElement("afterend",s));const p=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,l=this._hasProtectionInCart?d:p+d,c=H`
|
|
1183
1183
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1184
1184
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
1185
1185
|
<path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
|
|
1186
1186
|
<animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite"/>
|
|
1187
1187
|
</path>
|
|
1188
1188
|
</svg>
|
|
1189
|
-
`;
|
|
1189
|
+
`;dt(H`
|
|
1190
1190
|
<style>
|
|
1191
1191
|
.shipaid-container {
|
|
1192
|
+
width: var(--shipaid-checkout-width, 100%);
|
|
1192
1193
|
margin: var(--shipaid-checkout-margin, 0);
|
|
1193
1194
|
padding: var(--shipaid-checkout-padding, 0);
|
|
1194
1195
|
}
|
|
1195
|
-
.shipaid-container button {
|
|
1196
|
+
.shipaid-container a#shipaid-checkout-button {
|
|
1196
1197
|
width: 100%;
|
|
1198
|
+
margin: 0px;
|
|
1197
1199
|
}
|
|
1198
|
-
.shipaid-container a {
|
|
1200
|
+
.shipaid-container a#shipaid-continue-button {
|
|
1199
1201
|
display: block;
|
|
1202
|
+
margin: 1rem 0px 0px;
|
|
1200
1203
|
}
|
|
1201
1204
|
.shipaid-loader {
|
|
1202
1205
|
margin-left: 0.5rem;
|
|
@@ -1257,15 +1260,15 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1257
1260
|
</style>
|
|
1258
1261
|
|
|
1259
1262
|
<checkout-package-protection
|
|
1260
|
-
.
|
|
1261
|
-
.
|
|
1263
|
+
.shipaidVariant=${null==(r=this._protectionVariant)?void 0:r.id}
|
|
1264
|
+
.protectionPrice=${p?this._currencyFormat(p):c}
|
|
1265
|
+
.checkoutTotal=${l?this._currencyFormat(l):c}
|
|
1262
1266
|
.logo=${Vt}
|
|
1263
|
-
.originalClasses=${
|
|
1267
|
+
.originalClasses=${a}
|
|
1264
1268
|
@shipaid-about=${()=>{this._popup="learn-more",this.persistPopup&&this.setPopupKey()}}
|
|
1265
|
-
|
|
1266
|
-
@shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
|
|
1269
|
+
@shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
|
|
1267
1270
|
></checkout-package-protection>
|
|
1268
|
-
`,
|
|
1271
|
+
`,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return;const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,a=this._hasProtectionInCart?n:r+n,s=H`
|
|
1269
1272
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1270
1273
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
1271
1274
|
<path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
|
|
@@ -1435,7 +1438,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1435
1438
|
</a>
|
|
1436
1439
|
</div>
|
|
1437
1440
|
</div>
|
|
1438
|
-
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(a){console.warn(a)}return await n};return window.fetch=o,()=>{window.fetch===o?window.fetch=e:i=!1}}((async(t,e)=>{var i,o,r,n;if(null==(o=null==(i=t[1])?void 0:i.headers)?void 0:o["X-ShipAid"])return;if(!t[0].startsWith("/cart/change")&&!t[0].startsWith("/cart/update"))return;const a=(null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.checkoutButtonSelector)||'button[type="submit"][name="checkout"][form="cart"]',s=document.querySelector(a);if(console.log("q",s),s){s.setAttribute("disabled","true"),console.debug("button","t");try{await e,await this.updateCart(),await this.updateProtection()}finally{s.removeAttribute("disabled"),console.debug("button","f")}}}))}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.fetchInterceptorCleanup)||t.call(this)}async updateProtection(){var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const n=null==(i=this._cart.items)?void 0:i.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(o=this._cart)?void 0:o.items[n];if(this._hasProtectionInCart=!!a,!this._store)return;const s=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&a&&(this._cart.total_price===(null==a?void 0:a.final_line_price)||!s)){const t=await this.updateCartProtectionVariant(0,a);return sessionStorage.removeItem(we),await this._handleRefresh(t)}const
|
|
1441
|
+
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(a){console.warn(a)}return await n};return window.fetch=o,()=>{window.fetch===o?window.fetch=e:i=!1}}((async(t,e)=>{var i,o,r,n;if(null==(o=null==(i=t[1])?void 0:i.headers)?void 0:o["X-ShipAid"])return;if(!t[0].startsWith("/cart/change")&&!t[0].startsWith("/cart/update"))return;const a=(null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.checkoutButtonSelector)||'button[type="submit"][name="checkout"][form="cart"]',s=document.querySelector(a);if(console.log("q",s),s){s.setAttribute("disabled","true"),console.debug("button","t");try{await e,await this.updateCart(),await this.updateProtection()}finally{s.removeAttribute("disabled"),console.debug("button","f")}}}))}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.fetchInterceptorCleanup)||t.call(this)}async updateProtection(){var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const n=null==(i=this._cart.items)?void 0:i.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(o=this._cart)?void 0:o.items[n];if(this._hasProtectionInCart=!!a,!this._store)return;const s=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&a&&(this._cart.total_price===(null==a?void 0:a.final_line_price)||!s)){const t=await this.updateCartProtectionVariant(0,a);return sessionStorage.removeItem(we),await this._handleRefresh(t)}const p=this._findProtectionVariant(s);if(s?(this._protectionVariant=p,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==p?void 0:p.id))return this._shouldShowWidget=!1,void _e("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!a)return;if(this.supportSubscriptions){const t=this._cart.items.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));let i=null;if(!t&&(null==a?void 0:a.selling_plan_allocation))i={id:a.key,quantity:1,selling_plan:null};else if(t&&!(null==a?void 0:a.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:a.key,quantity:1,selling_plan:r}}if(i){const t=await this.updateCartProtectionVariant(i.quantity,a,i.selling_plan);await this._handleRefresh(t)}}if(p.id===a.variant_id){if(this._protectionCartItem={...a,index:n,position:n+1},1===a.quantity)return;const t=await this.updateCartProtectionVariant(1,a);return this._handleRefreshCart(),await this._handleRefresh(t)}const d={updates:{[a.variant_id]:0,[p.id]:1}},l=await this._fetch.post("/cart/update.js",d);await this._handleRefresh(l)}render(){return Tt(this,(async()=>{var t,e,i,o,r,n;const a=document.createElement("link");a.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),a.setAttribute("rel","stylesheet"),document.head.appendChild(a);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(s){return _e(s.message),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)}return this.planActive?(null==(e=null==(t=this._store)?void 0:t.protectionSettings)?void 0:e.protectionType)?this._protectionProduct?(this._hasFinishedSetup=!0,this._dispatchEvent(me.LOADED,this._store),setTimeout((async()=>{var t,e,i,o;(null==(t=this._store)?void 0:t.widgetAutoOptIn)&&(null==(e=this._cart)?void 0:e.item_count)&&(this.customerId&&this._store.excludedCustomersIdsAutoOptIn&&(null==(i=this._store.excludedCustomersIdsAutoOptIn)?void 0:i.length)&&this._store.excludedCustomersIdsAutoOptIn.includes(`gid://shopify/Customer/${this.customerId}`)||sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0}))))}),500),void(this.disablePolling||(setInterval((async()=>{const t=this._cartLastUpdated;t&&(new Date).getTime()-t.getTime()<this.pollingInterval||await this.updateCart()}),this.pollingInterval),(null==(i=this._store)?void 0:i.widgetPollProtection)&&!this.intervalId&&(this.intervalId=setInterval((async()=>{await this.attemptAddProtection()}),400),localStorage.setItem(`polling-shipaid-protection_${this.intervalId}`,`${this.intervalId}`)),(null==(n=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:n.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(ye("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{await this.updateProtection()}),[this._store,this._cart]),Tt(this,(async()=>{dt(this.renderPopups(),document.body)}),[this._popup]),H`
|
|
1439
1442
|
<style>
|
|
1440
1443
|
:host {
|
|
1441
1444
|
--shipaid-primary: #002bd6;
|
|
@@ -1710,4 +1713,4 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1710
1713
|
${qt(this._hasFinishedSetup,(()=>{var t,e,i,o,r;const n=null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.checkoutButtonSelector,a=sessionStorage.getItem("shipaidWidgetTheme");!a&&n&&sessionStorage.setItem("shipaidWidgetTheme",n),!this.useShipAidCheckout&&n||sessionStorage.removeItem("shipaidWidgetTheme");return this._shouldShowWidget&&this.planActive&&(null==(r=this._store)?void 0:r.widgetShowCart)?a?this.contactlessCheckoutButtonTemplate():this.promptTemplate():Z}),(()=>sessionStorage.getItem("shipaidWidgetTheme")?this.contactlessCheckoutButtonTemplate():this.promptTemplate()))}
|
|
1711
1714
|
</div>
|
|
1712
1715
|
|
|
1713
|
-
`}};Ae.styles=ue;let Pe=Ae;fe([n({type:String,attribute:!0})],Pe.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Pe.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Pe.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Pe.prototype,"lang"),fe([n({type:String,attribute:!0})],Pe.prototype,"currency"),fe([n({type:String,attribute:!0})],Pe.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Pe.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Pe.prototype,"useShipAidCheckout"),fe([a()],Pe.prototype,"_storeDomain"),fe([a()],Pe.prototype,"_store"),fe([a()],Pe.prototype,"_cart"),fe([a()],Pe.prototype,"_protectionProduct"),fe([a()],Pe.prototype,"_cartLastUpdated"),fe([a()],Pe.prototype,"_hasFinishedSetup"),fe([a()],Pe.prototype,"_shouldShowWidget"),fe([a()],Pe.prototype,"_hasProtectionInCart"),fe([a()],Pe.prototype,"_protectionCartItem"),fe([a()],Pe.prototype,"_protectionVariant"),fe([a()],Pe.prototype,"hasLoadedStrings"),fe([a()],Pe.prototype,"fetchInterceptorCleanup"),fe([a()],Pe.prototype,"intervalId"),fe([a()],Pe.prototype,"_state"),fe([a()],Pe.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Pe);const Le="Laden des ShipAid-Widgets...",ze="Liefergarantie",Ee="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Ie={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},Te={loading:Le,title:ze,description:Ee,footer:Me,actions:Ie,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},qe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ie,default:Te,description:Ee,footer:Me,loading:Le,title:ze},Symbol.toStringTag,{value:"Module"})),je="Cargando el widget ShipAid...",Ne="Garantía de entrega",Oe="en caso de Pérdida, Daño o Robo",Ve={button:"Energizado por"},Re={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},Ue={loading:je,title:Ne,description:Oe,footer:Ve,actions:Re,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Re,default:Ue,description:Oe,footer:Ve,loading:je,title:Ne},Symbol.toStringTag,{value:"Module"})),De="Chargement du widget ShipAid...",Fe="Garantie de livraison",He="en cas de Perte, Dommages ou Vol",We={button:"Propulsé par"},Ze={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ge={loading:De,title:Fe,description:He,footer:We,actions:Ze,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Ke=Object.freeze(Object.defineProperty({__proto__:null,actions:Ze,default:Ge,description:He,footer:We,loading:De,title:Fe},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Je="in caso di Perdita, Danno o Furto",Xe={button:"Offerto da"},ti={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ei={loading:Qe,title:Ye,description:Je,footer:Xe,actions:ti,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},ii=Object.freeze(Object.defineProperty({__proto__:null,actions:ti,default:ei,description:Je,footer:Xe,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),oi="Laad ShipAid Widget...",ri="Bezorggarantie",ni="in geval van verlies, schade of diefstal",ai={button:"Aangedreven door"},si={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},di={loading:oi,title:ri,description:ni,footer:ai,actions:si,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},pi=Object.freeze(Object.defineProperty({__proto__:null,actions:si,default:di,description:ni,footer:ai,loading:oi,title:ri},Symbol.toStringTag,{value:"Module"})),li="Carregando o widget ShipAid...",ci="Garantia de entrega",hi="em caso de Perda, Danos ou Roubo",ui={button:"Distribuído por"},mi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},gi={loading:li,title:ci,description:hi,footer:ui,actions:mi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},fi=Object.freeze(Object.defineProperty({__proto__:null,actions:mi,default:gi,description:hi,footer:ui,loading:li,title:ci},Symbol.toStringTag,{value:"Module"}));return t.ShipAidWidget=Pe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
|
1716
|
+
`}};Ae.styles=ue;let Pe=Ae;fe([n({type:String,attribute:!0})],Pe.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Pe.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Pe.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Pe.prototype,"lang"),fe([n({type:String,attribute:!0})],Pe.prototype,"currency"),fe([n({type:String,attribute:!0})],Pe.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Pe.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Pe.prototype,"useShipAidCheckout"),fe([a()],Pe.prototype,"_storeDomain"),fe([a()],Pe.prototype,"_store"),fe([a()],Pe.prototype,"_cart"),fe([a()],Pe.prototype,"_protectionProduct"),fe([a()],Pe.prototype,"_cartLastUpdated"),fe([a()],Pe.prototype,"_hasFinishedSetup"),fe([a()],Pe.prototype,"_shouldShowWidget"),fe([a()],Pe.prototype,"_hasProtectionInCart"),fe([a()],Pe.prototype,"_protectionCartItem"),fe([a()],Pe.prototype,"_protectionVariant"),fe([a()],Pe.prototype,"hasLoadedStrings"),fe([a()],Pe.prototype,"fetchInterceptorCleanup"),fe([a()],Pe.prototype,"intervalId"),fe([a()],Pe.prototype,"_state"),fe([a()],Pe.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Pe);const Le="Laden des ShipAid-Widgets...",ze="Liefergarantie",Ee="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Ie={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},Te={loading:Le,title:ze,description:Ee,footer:Me,actions:Ie,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},qe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ie,default:Te,description:Ee,footer:Me,loading:Le,title:ze},Symbol.toStringTag,{value:"Module"})),je="Cargando el widget ShipAid...",Ne="Garantía de entrega",Oe="en caso de Pérdida, Daño o Robo",Ve={button:"Energizado por"},Re={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},Ue={loading:je,title:Ne,description:Oe,footer:Ve,actions:Re,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Re,default:Ue,description:Oe,footer:Ve,loading:je,title:Ne},Symbol.toStringTag,{value:"Module"})),De="Chargement du widget ShipAid...",Fe="Garantie de livraison",He="en cas de Perte, Dommages ou Vol",We={button:"Propulsé par"},Ze={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ge={loading:De,title:Fe,description:He,footer:We,actions:Ze,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Ke=Object.freeze(Object.defineProperty({__proto__:null,actions:Ze,default:Ge,description:He,footer:We,loading:De,title:Fe},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Je="in caso di Perdita, Danno o Furto",Xe={button:"Offerto da"},ti={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ei={loading:Qe,title:Ye,description:Je,footer:Xe,actions:ti,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},ii=Object.freeze(Object.defineProperty({__proto__:null,actions:ti,default:ei,description:Je,footer:Xe,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),oi="Laad ShipAid Widget...",ri="Bezorggarantie",ni="in geval van verlies, schade of diefstal",ai={button:"Aangedreven door"},si={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},pi={loading:oi,title:ri,description:ni,footer:ai,actions:si,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},di=Object.freeze(Object.defineProperty({__proto__:null,actions:si,default:pi,description:ni,footer:ai,loading:oi,title:ri},Symbol.toStringTag,{value:"Module"})),li="Carregando o widget ShipAid...",ci="Garantia de entrega",hi="em caso de Perda, Danos ou Roubo",ui={button:"Distribuído por"},mi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},gi={loading:li,title:ci,description:hi,footer:ui,actions:mi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},fi=Object.freeze(Object.defineProperty({__proto__:null,actions:mi,default:gi,description:hi,footer:ui,loading:li,title:ci},Symbol.toStringTag,{value:"Module"}));return t.ShipAidWidget=Pe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
package/dist/widget.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShipAidWidget={})}(this,(function(t){"use strict";function e(t){var e;return(null==(e=null==t?void 0:t.match(/\d+/))?void 0:e[0])??null}const i={calculateProtectionTotal:function(t,e,i){var o,r;if(!t)throw new Error("Missing store settings.");if(!e)throw new Error("Missing protectionProduct.");if(!i)throw new Error("Missing Shopify cart.");const n=null==t?void 0:t.protectionSettings;if(!n)throw new Error("Tried to find protection variant, but protection settings for this store are missing.");const
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShipAidWidget={})}(this,(function(t){"use strict";function e(t){var e;return(null==(e=null==t?void 0:t.match(/\d+/))?void 0:e[0])??null}const i={calculateProtectionTotal:function(t,e,i){var o,r;if(!t)throw new Error("Missing store settings.");if(!e)throw new Error("Missing protectionProduct.");if(!i)throw new Error("Missing Shopify cart.");const n=null==t?void 0:t.protectionSettings;if(!n)throw new Error("Tried to find protection variant, but protection settings for this store are missing.");const a=Array.isArray(null==t?void 0:t.excludedProductSkus)?t.excludedProductSkus.map((t=>t.trim())):[],s=Array.isArray(null==t?void 0:t.excludedProductsVariantsId)?t.excludedProductsVariantsId.map((t=>{var e;return parseInt((null==(e=t.match(/\d+/))?void 0:e[0])??"",10)})):[],p=(i.items??[]).reduce(((t,e)=>(t=>!(!t.sku||!a.includes(t.sku.trim()))||!(!t.variant_id||!s.includes(t.variant_id)))(e)?t-e.final_line_price:t),i.total_price||0)-((null==(o=i.items)?void 0:o.filter((t=>{var i;return null==(i=null==e?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})))??[]).reduce(((t,e)=>t+e.final_line_price),0);if(0===p)return p;if("FIXED"===n.protectionType){if("number"!=typeof n.defaultFee)throw new Error("Missing default fee amount.");if(!(null==(r=n.rules)?void 0:r.length))return n.defaultFee;const t=p/100,e=n.rules.sort(((t,e)=>t.rangeLower&&e.rangeLower?t.rangeLower-e.rangeLower:0)).find((e=>{const i=Boolean(e.rangeLower&&e.rangeLower<t);return e.rangeUpper?i&&e.rangeUpper>=t:i}));return"number"==typeof(null==e?void 0:e.fee)?e.fee:n.defaultFee}if("PERCENTAGE"===n.protectionType){const t=p*n.percentage/100;return t>=n.minimumFee?t:n.minimumFee}throw new Error("No protection type handler found for this store.")},findProtectionVariant:function(t,e,i){var o;if(!(null==t?void 0:t.protectionSettings)||!(null==(o=null==e?void 0:e.variants)?void 0:o.length))throw new Error("Missing product and variants from protection settings.");const r=null==e?void 0:e.variants.flatMap((t=>{if(!(null==t?void 0:t.price))return[];const e=Number(t.price);return[{...t,formattedPrice:e}]})).sort(((t,e)=>t.formattedPrice-e.formattedPrice)),n=r.find((t=>t.formattedPrice>=i));return n||r[r.length-1]}},o=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}},r=(t,e,i)=>{e.constructor.createProperty(i,t)};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
@@ -8,34 +8,34 @@
|
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/function
|
|
11
|
+
*/function a(t){return n({...t,state:!0})}
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2021 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/var
|
|
16
|
+
*/var s;null===(s=window.HTMLSlotElement)||void 0===s||s.prototype.assignedElements;
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2019 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const p=window,d=p.ShadowRoot&&(void 0===p.ShadyCSS||p.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,l=Symbol(),c=new WeakMap;let h=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(d&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=c.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&c.set(e,t))}return t}toString(){return this.cssText}};const u=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new h(i,t,l)},m=d?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,l))(e)})(t):t
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/;var g;const f=window,v=f.trustedTypes,b=v?v.emptyScript:"",y=f.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},w=(t,e)=>e!==t&&(e==e||t==t),C={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:w},x="finalized";let $=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||C}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(m(t))}else void 0!==t&&e.push(m(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{
|
|
27
|
+
*/;var g;const f=window,v=f.trustedTypes,b=v?v.emptyScript:"",y=f.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},w=(t,e)=>e!==t&&(e==e||t==t),C={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:w},x="finalized";let $=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||C}static finalize(){if(this.hasOwnProperty(x))return!1;this[x]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(m(t))}else void 0!==t&&e.push(m(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{d?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=p.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=C){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:_).toAttribute(e,i.type);this._$El=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(t,e){var i;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:_;this._$El=r,this[r]=n.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||w)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(o){throw e=!1,this._$Ek(),o}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};
|
|
28
28
|
/**
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
32
|
*/
|
|
33
|
-
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,M=`<${E}>`,I=document,T=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,R=/>/g,U=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,D=/"/g,F=/^(?:script|style|textarea|title)$/i,H=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),W=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),G=new WeakMap,K=I.createTreeWalker(I,129,null,!1);var Q;function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const
|
|
33
|
+
var k;$[x]=!0,$.elementProperties=new Map,$.elementStyles=[],$.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:$}),(null!==(g=f.reactiveElementVersions)&&void 0!==g?g:f.reactiveElementVersions=[]).push("1.6.3");const S=window,A=S.trustedTypes,P=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",z=`lit$${(Math.random()+"").slice(9)}$`,E="?"+z,M=`<${E}>`,I=document,T=()=>I.createComment(""),q=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,R=/>/g,U=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,D=/"/g,F=/^(?:script|style|textarea|title)$/i,H=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),W=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),G=new WeakMap,K=I.createTreeWalker(I,129,null,!1);var Q;function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const a=t.length-1,s=this.parts,[p,d]=((t,e)=>{const i=t.length-1,o=[];let r,n=2===e?"<svg>":"",a=O;for(let s=0;s<i;s++){const e=t[s];let i,p,d=-1,l=0;for(;l<e.length&&(a.lastIndex=l,p=a.exec(e),null!==p);)l=a.lastIndex,a===O?"!--"===p[1]?a=V:void 0!==p[1]?a=R:void 0!==p[2]?(F.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=U):void 0!==p[3]&&(a=U):a===U?">"===p[0]?(a=null!=r?r:O,d=-1):void 0===p[1]?d=-2:(d=a.lastIndex-p[2].length,i=p[1],a=void 0===p[3]?U:'"'===p[3]?D:B):a===D||a===B?a=U:a===V||a===R?a=O:(a=U,r=void 0);const c=a===U&&t[s+1].startsWith("/>")?" ":"";n+=a===O?e+M:d>=0?(o.push(i),e.slice(0,d)+L+e.slice(d)+z+c):e+z+(-2===d?(o.push(void 0),s):c)}return[Y(t,n+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=J.createElement(p,i),K.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=K.nextNode())&&s.length<a;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(L)||e.startsWith(z)){const i=d[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+L).split(z),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?ot:"?"===e[1]?nt:"@"===e[1]?at:it})}else s.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(F.test(o.tagName)){const t=o.textContent.split(z),e=t.length-1;if(e>0){o.textContent=A?A.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),K.nextNode(),s.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===E)s.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(z,t+1));)s.push({type:7,index:r}),t+=z.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,o){var r,n,a,s;if(e===W)return e;let p=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const d=q(e)?void 0:e._$litDirective$;return(null==p?void 0:p.constructor)!==d&&(null===(n=null==p?void 0:p._$AO)||void 0===n||n.call(p,!1),void 0===d?p=void 0:(p=new d(t),p._$AT(t,i,o)),void 0!==o?(null!==(a=(s=i)._$Co)&&void 0!==a?a:s._$Co=[])[o]=p:i._$Cl=p),void 0!==p&&(e=X(t,p._$AS(t,e.values),p,o)),e}class tt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:I).importNode(i,!0);K.currentNode=r;let n=K.nextNode(),a=0,s=0,p=o[0];for(;void 0!==p;){if(a===p.index){let e;2===p.type?e=new et(n,n.nextSibling,this,t):1===p.type?e=new p.ctor(n,p.name,p.strings,this,t):6===p.type&&(e=new st(n,this,t)),this._$AV.push(e),p=o[++s]}a!==(null==p?void 0:p.index)&&(n=K.nextNode(),a++)}return K.currentNode=I,r}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,o){var r;this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=null===(r=null==o?void 0:o.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),q(t)?t===Z||null==t||""===t?(this._$AH!==Z&&this._$AR(),this._$AH=Z):t!==this._$AH&&t!==W&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==Z&&q(this._$AH)?this._$AA.nextSibling.data=t:this.$(I.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=J.createElement(Y(o.h,o.h[0]),this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.v(i);else{const t=new tt(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new J(t)),e}T(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new et(this.k(T()),this.k(T()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,o,r){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let n=!1;if(void 0===r)t=X(this,t,e,0),n=!q(t)||t!==this._$AH&&t!==W,n&&(this._$AH=t);else{const o=t;let a,s;for(t=r[0],a=0;a<r.length-1;a++)s=X(this,o[i+a],e,a),s===W&&(s=this._$AH[a]),n||(n=!q(s)||s!==this._$AH[a]),s===Z?t=Z:t!==Z&&(t+=(null!=s?s:"")+r[a+1]),this._$AH[a]=s}n&&!o&&this.j(t)}j(t){t===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ot extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Z?void 0:t}}const rt=A?A.emptyScript:"";class nt extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Z?this.element.setAttribute(this.name,rt):this.element.removeAttribute(this.name)}}class at extends it{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=X(this,t,e,0))&&void 0!==i?i:Z)===W)return;const o=this._$AH,r=t===Z&&o!==Z||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==Z&&(o===Z||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const pt=S.litHtmlPolyfillSupport;null==pt||pt(J,et),(null!==(k=S.litHtmlVersions)&&void 0!==k?k:S.litHtmlVersions=[]).push("2.8.0");const dt=(t,e,i)=>{var o,r;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let a=n._$litPart$;if(void 0===a){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;n._$litPart$=a=new et(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return a._$AI(t),a};
|
|
34
34
|
/**
|
|
35
35
|
* @license
|
|
36
36
|
* Copyright 2017 Google LLC
|
|
37
37
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
-
*/var lt,ct;let ht=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=
|
|
38
|
+
*/var lt,ct;let ht=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return W}};ht.finalized=!0,ht._$litElement$=!0,null===(lt=globalThis.litElementHydrateSupport)||void 0===lt||lt.call(globalThis,{LitElement:ht});const ut=globalThis.litElementPolyfillSupport;null==ut||ut({LitElement:ht}),(null!==(ct=globalThis.litElementVersions)&&void 0!==ct?ct:globalThis.litElementVersions=[]).push("3.3.3");const mt="langChanged";function gt(t,e,i){return Object.entries(vt(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[ ]*${e}[ ]*}}`,"gm"),String(vt(i)))),t)}function ft(t,e){const i=t.split(".");let o=e.strings;for(;null!=o&&i.length>0;)o=o[i.shift()];return null!=o?o.toString():null}function vt(t){return"function"==typeof t?t():t}let bt={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:ft,interpolate:gt,translationCache:{}};function yt(t,e,i=bt){var o;o={previousStrings:i.strings,previousLang:i.lang,lang:i.lang=t,strings:i.strings=e},window.dispatchEvent(new CustomEvent(mt,{detail:o}))}
|
|
39
39
|
/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
@@ -652,7 +652,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
652
652
|
</div>
|
|
653
653
|
</div>
|
|
654
654
|
<div class="blocker" @click=${this.handleClosePopup}></div>
|
|
655
|
-
`}};Zt.styles=jt;let Gt=Zt;((t,e,i,o)=>{for(var r,n=void 0,
|
|
655
|
+
`}};Zt.styles=jt;let Gt=Zt;((t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);n&&Wt(e,i,n)})([n({type:Boolean,attribute:!0})],Gt.prototype,"active"),customElements.get("shipaid-popup-learn-more")||customElements.define("shipaid-popup-learn-more",Gt);const Kt=u`
|
|
656
656
|
:host {
|
|
657
657
|
--shipaid-primary: #0056d6;
|
|
658
658
|
--shipaid-secondary: #0076ff;
|
|
@@ -823,7 +823,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
823
823
|
</div>
|
|
824
824
|
</div>
|
|
825
825
|
<div class="blocker" @click=${this.handleClosePopup}></div>
|
|
826
|
-
`}};Yt.styles=Kt;let Jt=Yt;((t,e,i,o)=>{for(var r,n=void 0,
|
|
826
|
+
`}};Yt.styles=Kt;let Jt=Yt;((t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);n&&Qt(e,i,n)})([n({type:Boolean,attribute:!0})],Jt.prototype,"active"),customElements.get("shipaid-popup-confirmation")||customElements.define("shipaid-popup-confirmation",Jt);var Xt=Object.defineProperty,te=(t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);return n&&Xt(e,i,n),n};const ee=class extends ht{constructor(){super(...arguments),this.open=!1,this.product=null,this.imageUrl=null,this.priceOfVariant=null,this.quantity=1,this.dontShowAgain="yes"===sessionStorage.getItem("shipaid-confirmation-dontshow")}handleDismiss(){this.dispatchEvent(new Event("dismiss-shipaid-cart"))}handleDontShowAgain(t){t.target.checked?sessionStorage.setItem("shipaid-confirmation-dontshow","yes"):sessionStorage.removeItem("shipaid-confirmation-dontshow")}handleConfirm(){this.dispatchEvent(new Event("confirm-shipaid-cart"))}render(){return H`
|
|
827
827
|
<div class=${"shipaid-cart-popup "+(this.open?"open":"")}>
|
|
828
828
|
<div class="popup-heading">
|
|
829
829
|
<slot name="shipaid-cart-popup-heading">Protect Your Order Instantly</slot>
|
|
@@ -986,7 +986,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
986
986
|
fill: var(--shipaid-svg-fill);
|
|
987
987
|
stroke: var(--shipaid-svg-stroke);
|
|
988
988
|
}
|
|
989
|
-
`;let ie=ee;te([n({type:Boolean,attribute:!0})],ie.prototype,"open"),te([n({type:String,attribute:!0})],ie.prototype,"product"),te([n({type:String,attribute:!0})],ie.prototype,"imageUrl"),te([n({type:String,attribute:!0})],ie.prototype,"priceOfVariant"),te([n({type:String,attribute:!0})],ie.prototype,"quantity"),te([n({type:Boolean})],ie.prototype,"dontShowAgain"),customElements.get("shipaid-cart-confirmation")||customElements.define("shipaid-cart-confirmation",ie);var oe=Object.defineProperty,re=(t,e,i,o)=>{for(var r,n=void 0,
|
|
989
|
+
`;let ie=ee;te([n({type:Boolean,attribute:!0})],ie.prototype,"open"),te([n({type:String,attribute:!0})],ie.prototype,"product"),te([n({type:String,attribute:!0})],ie.prototype,"imageUrl"),te([n({type:String,attribute:!0})],ie.prototype,"priceOfVariant"),te([n({type:String,attribute:!0})],ie.prototype,"quantity"),te([n({type:Boolean})],ie.prototype,"dontShowAgain"),customElements.get("shipaid-cart-confirmation")||customElements.define("shipaid-cart-confirmation",ie);var oe=Object.defineProperty,re=(t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);return n&&oe(e,i,n),n};class ne extends ht{constructor(){super(...arguments),this.protectionPrice=0,this.checkoutTotal=0,this.shipaidVariant=null,this.logo="",this.originalClasses=""}createRenderRoot(){return this}handleAbout(){this.dispatchEvent(new Event("shipaid-about"))}handleCheckoutWithoutProtection(){this.dispatchEvent(new Event("shipaid-remove-protection"))}render(){return H`
|
|
990
990
|
<div class="shipaid-container">
|
|
991
991
|
<div class="protection-info">
|
|
992
992
|
<div class="protection-text">
|
|
@@ -1004,15 +1004,15 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1004
1004
|
</div>
|
|
1005
1005
|
</div>
|
|
1006
1006
|
|
|
1007
|
-
<
|
|
1007
|
+
<a id="shipaid-checkout-button" class="${this.originalClasses}" href="/checkout${this.shipaidVariant?`?attributes[_shipaid-internal]=1&updates[${this.shipaidVariant}]=1`:""}">
|
|
1008
1008
|
CHECKOUT+ ${this.checkoutTotal}
|
|
1009
|
-
</
|
|
1009
|
+
</a>
|
|
1010
1010
|
|
|
1011
|
-
<a href="#" class="continue-link" @click=${this.handleCheckoutWithoutProtection}>
|
|
1011
|
+
<a id="shipaid-continue-button" href="#" class="continue-link" @click=${this.handleCheckoutWithoutProtection}>
|
|
1012
1012
|
Continue without delivery guarantee
|
|
1013
1013
|
</a>
|
|
1014
1014
|
</div>
|
|
1015
|
-
`}}re([n()],ne.prototype,"protectionPrice"),re([n()],ne.prototype,"checkoutTotal"),re([n()],ne.prototype,"logo"),re([n({type:String})],ne.prototype,"originalClasses"),customElements.get("checkout-package-protection")||customElements.define("checkout-package-protection",ne);const
|
|
1015
|
+
`}}re([n()],ne.prototype,"protectionPrice"),re([n()],ne.prototype,"checkoutTotal"),re([n()],ne.prototype,"shipaidVariant"),re([n()],ne.prototype,"logo"),re([n({type:String})],ne.prototype,"originalClasses"),customElements.get("checkout-package-protection")||customElements.define("checkout-package-protection",ne);const ae="Loading ShipAid Widget...",se="Delivery Guarantee",pe="in case of Loss, Damage or Theft",de={button:"Powered by"},le={add:"Add",remove:"Remove",loading:"Loading..."},ce={loading:ae,title:se,description:pe,footer:de,actions:le,"learn-more-popup":{close:"Close",title:"Delivery Guarantee",disclaimer:{"subtitle-enable":"We enable your favorite brands to provide a delivery guarantee because we know that every order is precious, and things happen!","subtitle-monitor":"We continuously monitor your package and offer a convenient portal for you to track your order's progress at any moment!","subtitle-notify":"You'll be notified throughout the entire shipping process, ensuring you stay up to date every step of the way.","subtitle-resolution":"In case of any issues during transit, we offer a quick and easy method to report the problem directly to the brand, for a swift resolution.",text:"By purchasing this delivery guarantee, you agree to our Terms Of Service and Privacy Policy. You are not obligated to purchase this guarantee. This guarantee is NOT insurance and does not provide indemnification against loss, damage, or liability arising from a contingent or unknown event, but rather, through ShipAid brands provide a delivery guarantee whereby if the product you ordered is not delivered in satisfactory condition, the brand from which you ordered the product may replace the product free of charge. ShipAid does not provide any products or services directly to consumers, but instead provides a service that allow brands to facilitate product replacement to their customers. Purchasing this guarantee does not mean that you will automatically be reimbursed for any product or shipping costs because the resolution process and decision for compensation is strictly decided by the brand you a purchasing from. The brand will require proof of damage or undelivered product."},links:{terms:"Terms of Service",privacy:"Privacy Policy"}}},he=Object.freeze(Object.defineProperty({__proto__:null,actions:le,default:ce,description:pe,footer:de,loading:ae,title:se},Symbol.toStringTag,{value:"Module"})),ue=u`
|
|
1016
1016
|
:host {
|
|
1017
1017
|
--shipaid-primary: #002bd6;
|
|
1018
1018
|
--shipaid-secondary: #0076ff;
|
|
@@ -1168,7 +1168,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1168
1168
|
.shipaid-prompt .prompt-footer .prompt-footer-badge svg {
|
|
1169
1169
|
height:var(--shipaid-footer-badge-logo-height, 9px);
|
|
1170
1170
|
}
|
|
1171
|
-
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-protection",$e="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n useCustomApp\n }\n}",ke=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>qe)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>ii)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>pi)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>fi)).then((t=>t.default))});var Se;Se={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(ke,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Se);const Ae=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,s;const a=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(s=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:s.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",a)}return new Intl.NumberFormat(void 0,{currency:a,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request($e,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:$e,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(s){throw console.error(s),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,s,a,d,p,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(s=o.data)?void 0:s.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(p=g[0])?void 0:p.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,s,a;try{let d;if(this.useCustomStoreFront){const p=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:xe});if(null==p?void 0:p.product){const l=p.product;d={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(a=null==(s=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:s.node)?void 0:a.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else d=(await this._fetch.get(`/products/${xe}.json`)).product;return d}catch(d){throw _e(d.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,s;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);s=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:s}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:s};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn))return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const s=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(r=this._cart)?void 0:r.items[s];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1171
|
+
`;var me=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(me||{});var ge=Object.defineProperty,fe=(t,e,i,o)=>{for(var r,n=void 0,a=t.length-1;a>=0;a--)(r=t[a])&&(n=r(e,i,n)||n);return n&&ge(e,i,n),n};const ve=t=>({items:t.lines.edges.map((({node:t})=>({id:t.id,key:t.id,variant_id:t.merchandise.id,sku:t.merchandise.sku,final_line_price:parseFloat(t.cost.totalAmount.amount),quantity:t.quantity}))),total_price:parseFloat(t.cost.totalAmount.amount),item_count:t.lines.edges.length}),be=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}},ye=t=>console.warn(`[ShipAid] ${t}`),_e=t=>console.error(`[ShipAid] ${t}`),we="shipaid-protection",Ce="shipaid-protection-popup-show",xe="shipaid-protection",$e="query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetPollProtection\n widgetShowCart\n excludedProductSkus\n excludedCustomersIdsAutoOptIn\n protectionSettings\n widgetConfigurations\n useCustomApp\n }\n}",ke=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>qe)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>he)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Be)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>ii)).then((t=>t.default)),"./lang/nl.json":()=>Promise.resolve().then((()=>di)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>fi)).then((t=>t.default))});var Se;Se={loader:async t=>{if("en"===t)return ce;const e=Reflect.get(ke,`./lang/${t}.json`);return e?await e():ce}},bt=Object.assign(Object.assign({},bt),Se);const Ae=class extends ht{constructor(){var t,e,i;super(...arguments),this.env="prod",this.useCustomStoreFront=!1,this.storeDomain="",this.storeAccessToken="",this.cartId="",this.disablePolling=!1,this.disableActions=!1,this.pollingInterval=2500,this.disableRefresh=!1,this.refreshCart=!1,this.persistPopup=!1,this.defaultToggleButton=!1,this.lang="en",this.currency=void 0,this.customerId=void 0,this.supportSubscriptions=!1,this.dataSelector="",this.useShipAidCheckout=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),this._hasFinishedSetup=!1,this._shouldShowWidget=!1,this._hasProtectionInCart=!1,this.hasLoadedStrings=!1,this.fetchInterceptorCleanup=()=>{},this.intervalId=null,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>be(t),post:(t,e)=>be(t,{method:"POST",headers:{"Content-Type":"application/json","X-ShipAid":"1"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${Ce}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${Ce}`,"true")}get nhost(){const t=`https://${"prod"===this.env?"gjiyysyzjwuculcymsvb":"staging"===this.env?"xfnjpunvafvudwuzwjlm":"local"}.graphql.us-east-1.nhost.run/v1`;return{request:async(e,i)=>{try{const o=await fetch(t,{method:"post",body:JSON.stringify({query:e,variables:i})});return await o.json()}catch(o){console.log(`Nhost Error: ${o}`)}}}}async runStoreFrontQuery(t,e){try{const i=new Headers;i.append("Content-Type","application/json"),i.append("X-Shopify-Storefront-Access-Token",this.storeAccessToken);const o={method:"POST",headers:i,body:JSON.stringify({query:t,variables:e})},r=await fetch(`https://${this.storeDomain}/api/2021-07/graphql.json`,o);if(!r.ok)throw new Error(`GraphQL request failed: ${r.statusText}`);const n=await r.json();if(n.errors)throw new Error(n.errors[0].message);return n.data}catch(i){throw console.error("GraphQL query error:",i),new Error("Failed to execute GraphQL query")}}get shouldRefreshOnUpdate(){return!this.disablePolling&&!this.disableRefresh}get planActive(){var t,e;const{searchParams:i}=new URL(window.location.href);return(null==(t=window.Shopify)?void 0:t.designMode)||i.has("shipaid-test")?(ye("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,n,a;const s=this.currency||(null==(i=null==(e=window.Shopify)?void 0:e.currency)?void 0:i.active)||(null==(o=this._store)?void 0:o.currency)||"USD";if(null==(a=null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.widget)?void 0:a.currencyFormat){return this._store.widgetConfigurations.widget.currencyFormat.replace("_value_",Number(t)).replace("_currency_",s)}return new Intl.NumberFormat(void 0,{currency:s,style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_handleRefreshCart(){if(this.refreshCart)return window.location.reload()}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(me.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.calculateProtectionTotal(this._store,this._protectionProduct,t)}_findProtectionVariant(t){if(!this._store)throw new Error("Missing ShipAid store");if(!this._protectionProduct)throw new Error("Missing Shopify protection product");return i.findProtectionVariant(this._store,this._protectionProduct,t)}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}_handleConfirmationPopup(){"confirmation"!==this._popup&&(this._popup="confirmation")}_updateProtection(){var t,e,i;const o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.removeWithConfirmation;if(this._hasProtectionInCart)return o?this._handleConfirmationPopup():this.removeProtection();this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;let n;if(n=this.storeDomain?this.storeDomain:(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost),!n)throw new Error("No shop found in Shopify object.");try{let t,e;if(this.useCustomStoreFront)e=await this.nhost.request($e,{store:n});else{t=new URL(window.location.href),t.pathname=this._apiEndpoint;const i={query:$e,variables:{store:n}};e=await this._fetch.post(t.toString(),i)}if(!e)throw new Error("Missing response for store query.");if(null==(o=e.errors)?void 0:o.length)throw new Error(e.errors[0].message);if(!(null==(r=e.data)?void 0:r.store))throw new Error("Missing store from store query response.");return e.data.store}catch(a){throw console.error(a),new Error(`Could not find a store for ${this._storeDomain}`)}}_findSellingPlanByName(t,e){for(const i of t){const t=i.node;for(const i of t.sellingPlans.edges){const t=i.node;if(e===t.name)return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,n,a,s,p,d,l,c,h,u;const m=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!m)throw new Error("No shop found in Shopify object.");try{const e=new URL(window.location.href);e.pathname=this._apiEndpoint;const i={query:"query SellingPlanFromVariant($store: String!, $variantId: String!){\n sellingPlanFromVariant(input: {store: $store, variantId: $variantId })\n}",variables:{store:m,variantId:`gid://shopify/ProductVariant/${null==(r=this._protectionVariant)?void 0:r.id}`}},o=await this._fetch.post(e.toString(),i);if(!o)throw new Error("Missing response for selling plan query.");if(null==(n=o.errors)?void 0:n.length)throw new Error(o.errors[0].message);if(!(null==(a=o.data)?void 0:a.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const g=(null==(p=null==(s=o.data.sellingPlanFromVariant)?void 0:s.sellingPlanGroups)?void 0:p.edges)||[],f=(null==(u=null==(h=null==(c=null==(l=null==(d=g[0])?void 0:d.node)?void 0:l.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(g,t.name)||f}catch(g){console.error("Error during the query ====>",g)}}async _fetchCart(){try{if(this.useCustomStoreFront&&this.cartId){const t=await this.runStoreFrontQuery("query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",{cartId:this.cartId});return ve(t.cart)}return await this._fetch.get("/cart.js")}catch(t){throw _e(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){var t,e,i,o,r,n,a,s;try{let p;if(this.useCustomStoreFront){const d=await this.runStoreFrontQuery("query product($handle: String!) { product(handle: $handle) { id title images(first: 1) {edges { node { id url altText } } } handle variants(first: 100) { edges { node { id title price { amount } } } } } }",{handle:xe});if(null==d?void 0:d.product){const l=d.product;p={id:l.id,title:l.title,image:{id:null==(o=null==(i=null==(e=null==(t=null==l?void 0:l.images)?void 0:t.edges)?void 0:e[0])?void 0:i.node)?void 0:o.id,src:null==(s=null==(a=null==(n=null==(r=null==l?void 0:l.images)?void 0:r.edges)?void 0:n[0])?void 0:a.node)?void 0:s.url},variants:l.variants.edges.map((t=>({id:t.node.id,price:t.node.price.amount})))}}}else p=(await this._fetch.get(`/products/${xe}.json`)).product;return p}catch(p){throw _e(p.message),new Error("Could not fetch protection product for current domain.")}}hasProtection(){return this._hasProtectionInCart}async updateCart(t){t||(t=await this._fetchCart()),this._cart=t}async addCartProtectionVariant(){var t,i,o,r;let n,a;if(this.supportSubscriptions){const o=null==(i=null==(t=this._cart)?void 0:t.items)?void 0:i.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));if(o){const t=await this._fetchSellingPlanFromVariant(o.selling_plan_allocation.selling_plan);a=t?e(t.id):null}}if(this.useCustomStoreFront){const t=await this.runStoreFrontQuery("mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{merchandiseId:String(null==(o=this._protectionVariant)?void 0:o.id),quantity:1,sellingPlanId:a}]});n=ve(t.cartLinesAdd.cart)}else{const t={quantity:1,id:String(null==(r=this._protectionVariant)?void 0:r.id),selling_plan:a};n=await this._fetch.post("/cart/add.js",t)}return n}async updateCartProtectionVariant(t,e=null,i=null){var o,r;let n;if(this.useCustomStoreFront){const r=await this.runStoreFrontQuery("mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",{cartId:this.cartId,lines:[{id:String(e?e.key:null==(o=this._protectionCartItem)?void 0:o.key),quantity:t,sellingPlanId:i}]});n=ve(r.cartLinesUpdate.cart)}else{const o={quantity:t,id:String(e?e.key:null==(r=this._protectionCartItem)?void 0:r.key),selling_plan:i};n=await this._fetch.post("/cart/change.js",o)}return n}async addProtection(){var t,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i=await this.addCartProtectionVariant();await this._handleRefresh(i),this._setState("success")}catch(i){_e(i.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async removeProtection(){try{if(!this._store)throw new Error("Store has not been loaded.");if(!this._protectionCartItem)throw new Error("Protection product not found.");this._setState("loading");const t=await this.updateCartProtectionVariant(0,this._protectionCartItem);await this._handleRefresh(t),this._cart=t,this._setState("success")}catch(t){_e(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,n;if(!(null==(t=this._store)?void 0:t.widgetAutoOptIn))return;if(!(null==(e=this._cart)?void 0:e.items)||!(null==(i=this._cart)?void 0:i.item_count))return;const a=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),s=null==(r=this._cart)?void 0:r.items[a];if(this._hasProtectionInCart=!!s,1===this._cart.item_count&&s)return;!!sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(n=this._cart)?void 0:n.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0})))}async handleMultipleProtectionVariants(){var t,e,i,o,r;if(!(null==(t=this._cart)?void 0:t.items)||!(null==(e=this._cart)?void 0:e.item_count))return;let n=0;if(null==(i=this._cart.items)||i.forEach((t=>{var e,i;(null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id)))&&n++})),n>1){const t=null==(o=this._cart.items)?void 0:o.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),e=null==(r=this._cart)?void 0:r.items[t],i=await this.updateCartProtectionVariant(0,e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return H`
|
|
1172
1172
|
<shipaid-popup-learn-more
|
|
1173
1173
|
?active=${"learn-more"===this._popup}
|
|
1174
1174
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
@@ -1179,24 +1179,27 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1179
1179
|
@close=${()=>{this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1180
1180
|
@remove-protection=${()=>{this.removeProtection(),this.persistPopup&&localStorage.removeItem(`${Ce}`),this._popup=null}}
|
|
1181
1181
|
></shipaid-popup-confirmation>
|
|
1182
|
-
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r){const t=document.createElement("style");t.id="shipaid-styles",t.textContent=`\n checkout-package-protection {\n ${r}\n
|
|
1182
|
+
`}contactlessCheckoutButtonTemplate(){var t,e,i,o;const r=(null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.styles)||"";if(!document.getElementById("shipaid-styles")&&r){const t=document.createElement("style");t.id="shipaid-styles",t.textContent=`\n checkout-package-protection {\n width: 100%;\n justify-content: center;\n display: flex;\n ${r}\n }\n\n `,document.head.appendChild(t)}const n=document.querySelectorAll(`${sessionStorage.getItem("shipaidWidgetTheme")}:not(#shipaid-checkout-button)`);if(n.length)return n.forEach(((t,e)=>{var i,o,r;const n=`shipaid-checkout-container-${e}`;t.style.display="none";const a=t.className;let s=document.getElementById(n);s||(s=document.createElement("div"),s.id=n,s.style.width="100%",s.style.display="flex",s.style.justifyContent="center",t.insertAdjacentElement("afterend",s));const p=Number(null==(i=this._protectionVariant)?void 0:i.price)||0,d=(Number(null==(o=this._cart)?void 0:o.total_price)||0)/100,l=this._hasProtectionInCart?d:p+d,c=H`
|
|
1183
1183
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1184
1184
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
1185
1185
|
<path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
|
|
1186
1186
|
<animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite"/>
|
|
1187
1187
|
</path>
|
|
1188
1188
|
</svg>
|
|
1189
|
-
`;
|
|
1189
|
+
`;dt(H`
|
|
1190
1190
|
<style>
|
|
1191
1191
|
.shipaid-container {
|
|
1192
|
+
width: var(--shipaid-checkout-width, 100%);
|
|
1192
1193
|
margin: var(--shipaid-checkout-margin, 0);
|
|
1193
1194
|
padding: var(--shipaid-checkout-padding, 0);
|
|
1194
1195
|
}
|
|
1195
|
-
.shipaid-container button {
|
|
1196
|
+
.shipaid-container a#shipaid-checkout-button {
|
|
1196
1197
|
width: 100%;
|
|
1198
|
+
margin: 0px;
|
|
1197
1199
|
}
|
|
1198
|
-
.shipaid-container a {
|
|
1200
|
+
.shipaid-container a#shipaid-continue-button {
|
|
1199
1201
|
display: block;
|
|
1202
|
+
margin: 1rem 0px 0px;
|
|
1200
1203
|
}
|
|
1201
1204
|
.shipaid-loader {
|
|
1202
1205
|
margin-left: 0.5rem;
|
|
@@ -1257,15 +1260,15 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1257
1260
|
</style>
|
|
1258
1261
|
|
|
1259
1262
|
<checkout-package-protection
|
|
1260
|
-
.
|
|
1261
|
-
.
|
|
1263
|
+
.shipaidVariant=${null==(r=this._protectionVariant)?void 0:r.id}
|
|
1264
|
+
.protectionPrice=${p?this._currencyFormat(p):c}
|
|
1265
|
+
.checkoutTotal=${l?this._currencyFormat(l):c}
|
|
1262
1266
|
.logo=${Vt}
|
|
1263
|
-
.originalClasses=${
|
|
1267
|
+
.originalClasses=${a}
|
|
1264
1268
|
@shipaid-about=${()=>{this._popup="learn-more",this.persistPopup&&this.setPopupKey()}}
|
|
1265
|
-
|
|
1266
|
-
@shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
|
|
1269
|
+
@shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
|
|
1267
1270
|
></checkout-package-protection>
|
|
1268
|
-
`,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return;const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,
|
|
1271
|
+
`,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return;const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,a=this._hasProtectionInCart?n:r+n,s=H`
|
|
1269
1272
|
<svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
|
|
1270
1273
|
<circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
|
|
1271
1274
|
<path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
|
|
@@ -1359,7 +1362,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1359
1362
|
<strong>Checkout+</strong>
|
|
1360
1363
|
<div class="protection-value">
|
|
1361
1364
|
<slot name="title">ShipAid Delivery Guarantee</slot>
|
|
1362
|
-
- ${r?this._currencyFormat(r):
|
|
1365
|
+
- ${r?this._currencyFormat(r):s}
|
|
1363
1366
|
</div>
|
|
1364
1367
|
</div>
|
|
1365
1368
|
<div class="help-icon" @click=${()=>{this._popup="learn-more",this.persistPopup&&this.setPopupKey()}}>
|
|
@@ -1371,7 +1374,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1371
1374
|
</div>
|
|
1372
1375
|
|
|
1373
1376
|
<button id="shipaid-checkout-button" class="${o}" @click=${()=>{var t,e;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(t=this._protectionVariant)?void 0:t.id)),window.location.href=`/checkout?attributes[_shipaid-internal]=1&updates[${null==(e=this._protectionVariant)?void 0:e.id}]=1`}}>
|
|
1374
|
-
<slot name="checkout-button-text">CHECKOUT+</slot> ${
|
|
1377
|
+
<slot name="checkout-button-text">CHECKOUT+</slot> ${a?this._currencyFormat(a):s}
|
|
1375
1378
|
</button>
|
|
1376
1379
|
|
|
1377
1380
|
<a href="#" class="continue-link" @click=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}>
|
|
@@ -1435,7 +1438,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1435
1438
|
</a>
|
|
1436
1439
|
</div>
|
|
1437
1440
|
</div>
|
|
1438
|
-
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(
|
|
1441
|
+
`}async connectedCallback(){super.connectedCallback(),await async function(t,e=bt){const i=await e.loader(t,e);e.translationCache={},yt(t,i,e)}(this.lang),this.hasLoadedStrings=!0,this.fetchInterceptorCleanup=function(t){const e=window.fetch;let i=!0;const o=async(o,r)=>{const n=e(o,r);if(i)try{await t([o,r],n)}catch(a){console.warn(a)}return await n};return window.fetch=o,()=>{window.fetch===o?window.fetch=e:i=!1}}((async(t,e)=>{var i,o,r,n;if(null==(o=null==(i=t[1])?void 0:i.headers)?void 0:o["X-ShipAid"])return;if(!t[0].startsWith("/cart/change")&&!t[0].startsWith("/cart/update"))return;const a=(null==(n=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:n.checkoutButtonSelector)||'button[type="submit"][name="checkout"][form="cart"]',s=document.querySelector(a);if(console.log("q",s),s){s.setAttribute("disabled","true"),console.debug("button","t");try{await e,await this.updateCart(),await this.updateProtection()}finally{s.removeAttribute("disabled"),console.debug("button","f")}}}))}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.fetchInterceptorCleanup)||t.call(this)}async updateProtection(){var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const n=null==(i=this._cart.items)?void 0:i.findIndex((t=>{var e,i;return null==(i=null==(e=this._protectionProduct)?void 0:e.variants)?void 0:i.some((e=>e.id===t.variant_id))})),a=null==(o=this._cart)?void 0:o.items[n];if(this._hasProtectionInCart=!!a,!this._store)return;const s=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&a&&(this._cart.total_price===(null==a?void 0:a.final_line_price)||!s)){const t=await this.updateCartProtectionVariant(0,a);return sessionStorage.removeItem(we),await this._handleRefresh(t)}const p=this._findProtectionVariant(s);if(s?(this._protectionVariant=p,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==p?void 0:p.id))return this._shouldShowWidget=!1,void _e("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!a)return;if(this.supportSubscriptions){const t=this._cart.items.find((t=>{var e;return t.id!==(null==(e=this._protectionVariant)?void 0:e.id)&&!!(null==t?void 0:t.selling_plan_allocation)}));let i=null;if(!t&&(null==a?void 0:a.selling_plan_allocation))i={id:a.key,quantity:1,selling_plan:null};else if(t&&!(null==a?void 0:a.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:a.key,quantity:1,selling_plan:r}}if(i){const t=await this.updateCartProtectionVariant(i.quantity,a,i.selling_plan);await this._handleRefresh(t)}}if(p.id===a.variant_id){if(this._protectionCartItem={...a,index:n,position:n+1},1===a.quantity)return;const t=await this.updateCartProtectionVariant(1,a);return this._handleRefreshCart(),await this._handleRefresh(t)}const d={updates:{[a.variant_id]:0,[p.id]:1}},l=await this._fetch.post("/cart/update.js",d);await this._handleRefresh(l)}render(){return Tt(this,(async()=>{var t,e,i,o,r,n;const a=document.createElement("link");a.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),a.setAttribute("rel","stylesheet"),document.head.appendChild(a);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(s){return _e(s.message),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)}return this.planActive?(null==(e=null==(t=this._store)?void 0:t.protectionSettings)?void 0:e.protectionType)?this._protectionProduct?(this._hasFinishedSetup=!0,this._dispatchEvent(me.LOADED,this._store),setTimeout((async()=>{var t,e,i,o;(null==(t=this._store)?void 0:t.widgetAutoOptIn)&&(null==(e=this._cart)?void 0:e.item_count)&&(this.customerId&&this._store.excludedCustomersIdsAutoOptIn&&(null==(i=this._store.excludedCustomersIdsAutoOptIn)?void 0:i.length)&&this._store.excludedCustomersIdsAutoOptIn.includes(`gid://shopify/Customer/${this.customerId}`)||sessionStorage.getItem(we)||!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&(await this.addProtection(),sessionStorage.setItem(we,JSON.stringify({loaded:!0}))))}),500),void(this.disablePolling||(setInterval((async()=>{const t=this._cartLastUpdated;t&&(new Date).getTime()-t.getTime()<this.pollingInterval||await this.updateCart()}),this.pollingInterval),(null==(i=this._store)?void 0:i.widgetPollProtection)&&!this.intervalId&&(this.intervalId=setInterval((async()=>{await this.attemptAddProtection()}),400),localStorage.setItem(`polling-shipaid-protection_${this.intervalId}`,`${this.intervalId}`)),(null==(n=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:n.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(ye("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(ye("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{await this.updateProtection()}),[this._store,this._cart]),Tt(this,(async()=>{dt(this.renderPopups(),document.body)}),[this._popup]),H`
|
|
1439
1442
|
<style>
|
|
1440
1443
|
:host {
|
|
1441
1444
|
--shipaid-primary: #002bd6;
|
|
@@ -1707,7 +1710,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
|
|
|
1707
1710
|
}
|
|
1708
1711
|
</style>
|
|
1709
1712
|
<div class="shipaid">
|
|
1710
|
-
${qt(this._hasFinishedSetup,(()=>{var t,e,i,o,r;const n=null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.checkoutButtonSelector,
|
|
1713
|
+
${qt(this._hasFinishedSetup,(()=>{var t,e,i,o,r;const n=null==(o=null==(i=null==(e=null==(t=this._store)?void 0:t.widgetConfigurations)?void 0:e.widget)?void 0:i.theme_checkout)?void 0:o.checkoutButtonSelector,a=sessionStorage.getItem("shipaidWidgetTheme");!a&&n&&sessionStorage.setItem("shipaidWidgetTheme",n),!this.useShipAidCheckout&&n||sessionStorage.removeItem("shipaidWidgetTheme");return this._shouldShowWidget&&this.planActive&&(null==(r=this._store)?void 0:r.widgetShowCart)?a?this.contactlessCheckoutButtonTemplate():this.promptTemplate():Z}),(()=>sessionStorage.getItem("shipaidWidgetTheme")?this.contactlessCheckoutButtonTemplate():this.promptTemplate()))}
|
|
1711
1714
|
</div>
|
|
1712
1715
|
|
|
1713
|
-
`}};Ae.styles=ue;let Pe=Ae;fe([n({type:String,attribute:!0})],Pe.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Pe.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Pe.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Pe.prototype,"lang"),fe([n({type:String,attribute:!0})],Pe.prototype,"currency"),fe([n({type:String,attribute:!0})],Pe.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Pe.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Pe.prototype,"useShipAidCheckout"),fe([s()],Pe.prototype,"_storeDomain"),fe([s()],Pe.prototype,"_store"),fe([s()],Pe.prototype,"_cart"),fe([s()],Pe.prototype,"_protectionProduct"),fe([s()],Pe.prototype,"_cartLastUpdated"),fe([s()],Pe.prototype,"_hasFinishedSetup"),fe([s()],Pe.prototype,"_shouldShowWidget"),fe([s()],Pe.prototype,"_hasProtectionInCart"),fe([s()],Pe.prototype,"_protectionCartItem"),fe([s()],Pe.prototype,"_protectionVariant"),fe([s()],Pe.prototype,"hasLoadedStrings"),fe([s()],Pe.prototype,"fetchInterceptorCleanup"),fe([s()],Pe.prototype,"intervalId"),fe([s()],Pe.prototype,"_state"),fe([s()],Pe.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Pe);const Le="Laden des ShipAid-Widgets...",ze="Liefergarantie",Ee="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Ie={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},Te={loading:Le,title:ze,description:Ee,footer:Me,actions:Ie,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},qe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ie,default:Te,description:Ee,footer:Me,loading:Le,title:ze},Symbol.toStringTag,{value:"Module"})),je="Cargando el widget ShipAid...",Ne="Garantía de entrega",Oe="en caso de Pérdida, Daño o Robo",Ve={button:"Energizado por"},Re={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},Ue={loading:je,title:Ne,description:Oe,footer:Ve,actions:Re,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Re,default:Ue,description:Oe,footer:Ve,loading:je,title:Ne},Symbol.toStringTag,{value:"Module"})),De="Chargement du widget ShipAid...",Fe="Garantie de livraison",He="en cas de Perte, Dommages ou Vol",We={button:"Propulsé par"},Ze={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ge={loading:De,title:Fe,description:He,footer:We,actions:Ze,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Ke=Object.freeze(Object.defineProperty({__proto__:null,actions:Ze,default:Ge,description:He,footer:We,loading:De,title:Fe},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Je="in caso di Perdita, Danno o Furto",Xe={button:"Offerto da"},ti={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ei={loading:Qe,title:Ye,description:Je,footer:Xe,actions:ti,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},ii=Object.freeze(Object.defineProperty({__proto__:null,actions:ti,default:ei,description:Je,footer:Xe,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),oi="Laad ShipAid Widget...",ri="Bezorggarantie",ni="in geval van verlies, schade of diefstal",si={button:"Aangedreven door"},ai={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},di={loading:oi,title:ri,description:ni,footer:si,actions:ai,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},pi=Object.freeze(Object.defineProperty({__proto__:null,actions:ai,default:di,description:ni,footer:si,loading:oi,title:ri},Symbol.toStringTag,{value:"Module"})),li="Carregando o widget ShipAid...",ci="Garantia de entrega",hi="em caso de Perda, Danos ou Roubo",ui={button:"Distribuído por"},mi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},gi={loading:li,title:ci,description:hi,footer:ui,actions:mi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},fi=Object.freeze(Object.defineProperty({__proto__:null,actions:mi,default:gi,description:hi,footer:ui,loading:li,title:ci},Symbol.toStringTag,{value:"Module"}));t.ShipAidWidget=Pe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
1716
|
+
`}};Ae.styles=ue;let Pe=Ae;fe([n({type:String,attribute:!0})],Pe.prototype,"env"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"useCustomStoreFront"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeDomain"),fe([n({type:String,attribute:!0})],Pe.prototype,"storeAccessToken"),fe([n({type:String,attribute:!0})],Pe.prototype,"cartId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disablePolling"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableActions"),fe([n({type:Number,attribute:!0})],Pe.prototype,"pollingInterval"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"disableRefresh"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"refreshCart"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"persistPopup"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"defaultToggleButton"),fe([n({type:String,attribute:!0})],Pe.prototype,"lang"),fe([n({type:String,attribute:!0})],Pe.prototype,"currency"),fe([n({type:String,attribute:!0})],Pe.prototype,"customerId"),fe([n({type:Boolean,attribute:!0})],Pe.prototype,"supportSubscriptions"),fe([n({type:String,attribute:"data-selector"})],Pe.prototype,"dataSelector"),fe([n({type:Boolean,attribute:"use-shipaid-checkout"})],Pe.prototype,"useShipAidCheckout"),fe([a()],Pe.prototype,"_storeDomain"),fe([a()],Pe.prototype,"_store"),fe([a()],Pe.prototype,"_cart"),fe([a()],Pe.prototype,"_protectionProduct"),fe([a()],Pe.prototype,"_cartLastUpdated"),fe([a()],Pe.prototype,"_hasFinishedSetup"),fe([a()],Pe.prototype,"_shouldShowWidget"),fe([a()],Pe.prototype,"_hasProtectionInCart"),fe([a()],Pe.prototype,"_protectionCartItem"),fe([a()],Pe.prototype,"_protectionVariant"),fe([a()],Pe.prototype,"hasLoadedStrings"),fe([a()],Pe.prototype,"fetchInterceptorCleanup"),fe([a()],Pe.prototype,"intervalId"),fe([a()],Pe.prototype,"_state"),fe([a()],Pe.prototype,"_popup"),customElements.get("shipaid-widget")||customElements.define("shipaid-widget",Pe);const Le="Laden des ShipAid-Widgets...",ze="Liefergarantie",Ee="im Falle von Verlust, Beschädigung oder Diebstahl",Me={button:"Bereitgestellt von"},Ie={add:"Hinzufügen",remove:"Entfernen",loading:"Lädt..."},Te={loading:Le,title:ze,description:Ee,footer:Me,actions:Ie,"learn-more-popup":{close:"Schließen",title:"Liefergarantie",subtitle:"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie anzubieten, weil jede Bestellung wertvoll ist!",disclaimer:{"subtitle-enable":"Wir ermöglichen es Ihren Lieblingsmarken, eine Liefergarantie zu bieten, denn wir wissen, dass jede Bestellung wertvoll ist und Dinge passieren können!","subtitle-monitor":"Wir überwachen Ihr Paket kontinuierlich und bieten ein praktisches Portal, damit Sie den Fortschritt Ihrer Bestellung jederzeit verfolgen können!","subtitle-notify":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.","subtitle-resolution":"Sie werden während des gesamten Versandprozesses benachrichtigt, um sicherzustellen, dass Sie auf dem Laufenden bleiben.",text:"Durch den Erwerb dieser Liefergarantie stimmen Sie unseren Servicebedingungen und Datenschutzrichtlinien zu. Diese Garantie ist nicht verpflichtend, IST KEINE Versicherung und bietet keine Entschädigung für Verluste, Schäden oder Haftungen, die aus einem zufälligen oder unbekannten Ereignis resultieren. Sollte das Produkt nicht in zufriedenstellendem Zustand geliefert werden, kann die Marke, bei der Sie gekauft haben, dieses kostenlos ersetzen. ShipAid liefert keine Produkte oder Dienstleistungen direkt an Verbraucher, sondern bietet einen Dienst an, der Marken ermöglicht, den Produktersatz für ihre Kunden zu erleichtern. Der Erwerb dieser Garantie bedeutet nicht, dass Sie automatisch eine Rückerstattung für irgendwelche Produkte oder Versandkosten erhalten, da der Lösungsprozess und die Entscheidung über eine Kompensation strikt von der Marke, bei der Sie kaufen, entschieden werden. Die Marke wird einen Nachweis für Beschädigungen oder die Nichtlieferung des Produkts verlangen."},links:{terms:"Servicebedingungen",privacy:"Datenschutzrichtlinie"}}},qe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ie,default:Te,description:Ee,footer:Me,loading:Le,title:ze},Symbol.toStringTag,{value:"Module"})),je="Cargando el widget ShipAid...",Ne="Garantía de entrega",Oe="en caso de Pérdida, Daño o Robo",Ve={button:"Energizado por"},Re={add:"Agregar",remove:"Eliminar",loading:"Cargando..."},Ue={loading:je,title:Ne,description:Oe,footer:Ve,actions:Re,"learn-more-popup":{close:"Cerca",title:"Garantía de entrega",disclaimer:{"subtitle-enable":"Permitimos que sus marcas favoritas brinden una garantía de entrega porque sabemos que cada pedido es valioso y las cosas suceden!","subtitle-monitor":"Supervisamos continuamente su paquete y le ofrecemos un portal conveniente para que pueda realizar un seguimiento del progreso de su pedido en cualquier momento.","subtitle-notify":"Se le notificará durante todo el proceso de envío, asegurándose de que esté actualizado en cada paso del camino.","subtitle-resolution":"En caso de cualquier problema durante el tránsito, ofrecemos un método rápido y fácil para informar el problema directamente a la marca, para una resolución rápida.",text:"Al comprar esta garantía de entrega, acepta nuestros Términos de servicio y Política de privacidad. Usted no está obligado a comprar esta garantía. Esta garantía NO es un seguro y no brinda indemnización por pérdida, daño o responsabilidad que surja de un evento contingente o desconocido, sino que, a través de las marcas de ShipAid, brinda una garantía de entrega mediante la cual, si el producto que ordenó no se entrega en condiciones satisfactorias, la marca desde el que ordenó el producto puede reemplazar el producto sin cargo. ShipAid no proporciona ningún producto o servicio directamente a los consumidores, sino que proporciona un servicio que permite a las marcas facilitar el reemplazo de productos a sus clientes. La compra de esta garantía no significa que se le reembolsará automáticamente cualquier producto o costo de envío porque el proceso de resolución y la decisión de compensación lo decide estrictamente la marca a la que le compra. La marca requerirá prueba de daño o producto no entregado."},links:{terms:"Términos de servicio",privacy:"Política de Privacidad"}}},Be=Object.freeze(Object.defineProperty({__proto__:null,actions:Re,default:Ue,description:Oe,footer:Ve,loading:je,title:Ne},Symbol.toStringTag,{value:"Module"})),De="Chargement du widget ShipAid...",Fe="Garantie de livraison",He="en cas de Perte, Dommages ou Vol",We={button:"Propulsé par"},Ze={add:"Ajouter",remove:"Retirer",loading:"Chargement..."},Ge={loading:De,title:Fe,description:He,footer:We,actions:Ze,"learn-more-popup":{close:"Fermer",title:"Garantie de livraison",subtitle:"Nous permettons à vos marques préférées d'offrir une garantie de livraison car chaque commande est précieuse !",disclaimer:{"subtitle-enable":"Nous permettons à vos marques préférées de fournir une garantie de livraison car nous savons que chaque commande est précieuse et que des incidents peuvent survenir !","subtitle-monitor":"Nous surveillons continuellement votre colis et offrons un portail pratique pour vous permettre de suivre l'avancement de votre commande à tout moment !","subtitle-notify":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.","subtitle-resolution":"Vous serez notifié tout au long du processus d'expédition, vous assurant que vous restez informé à chaque étape du parcours.",text:"En acquérant cette garantie de livraison, vous acceptez nos Conditions de Service et notre Politique de Confidentialité. Cette garantie n'est pas obligatoire, N'EST PAS une assurance et ne fournit pas d'indemnisation pour les pertes, dommages ou responsabilités résultant d'un événement contingent ou inconnu. Si le produit n'est pas livré dans des conditions satisfaisantes, la marque auprès de laquelle vous avez acheté peut le remplacer gratuitement. ShipAid ne fournit aucun produit ou service directement aux consommateurs, mais offre un service permettant aux marques de faciliter le remplacement du produit pour leurs clients. L'achat de cette garantie ne signifie pas que vous serez automatiquement remboursé pour tout produit ou frais de port, car le processus de résolution et la décision de compensation sont strictement décidés par la marque que vous achetez. La marque exigera une preuve de dommage ou de produit non livré."},links:{terms:"Conditions de service",privacy:"Politique de Confidentialité"}}},Ke=Object.freeze(Object.defineProperty({__proto__:null,actions:Ze,default:Ge,description:He,footer:We,loading:De,title:Fe},Symbol.toStringTag,{value:"Module"})),Qe="Caricamento del widget ShipAid...",Ye="Garanzia di consegna",Je="in caso di Perdita, Danno o Furto",Xe={button:"Offerto da"},ti={add:"Aggiungere",remove:"Rimuovere",loading:"Caricamento ..."},ei={loading:Qe,title:Ye,description:Je,footer:Xe,actions:ti,"learn-more-popup":{close:"Vicina",title:"Garanzia di consegna",subtitle:"Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",disclaimer:{"subtitle-enable":"Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!","subtitle-monitor":"Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!","subtitle-notify":"Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."},links:{terms:"Termini di servizio",privacy:"Politica sulla riservatezza"}}},ii=Object.freeze(Object.defineProperty({__proto__:null,actions:ti,default:ei,description:Je,footer:Xe,loading:Qe,title:Ye},Symbol.toStringTag,{value:"Module"})),oi="Laad ShipAid Widget...",ri="Bezorggarantie",ni="in geval van verlies, schade of diefstal",ai={button:"Aangedreven door"},si={add:"Toevoegen",remove:"Verwijderen",loading:"Bezig met laden..."},pi={loading:oi,title:ri,description:ni,footer:ai,actions:si,"learn-more-popup":{close:"Sluiten",title:"Bezorggarantie",disclaimer:{"subtitle-enable":"We stellen je favoriete merken in staat om een bezorggarantie te bieden omdat we weten dat elke bestelling belangrijk is en dingen kunnen gebeuren!","subtitle-monitor":"We monitoren je pakket continu en bieden een handig portaal om de voortgang van je bestelling op elk moment te volgen!","subtitle-notify":"Je wordt gedurende het gehele verzendproces op de hoogte gehouden, zodat je altijd op de hoogte bent van elke stap.","subtitle-resolution":"In geval van problemen tijdens het transport bieden we een snelle en gemakkelijke manier om het probleem direct bij het merk te melden, voor een snelle oplossing.",text:"Door deze bezorggarantie aan te schaffen, ga je akkoord met onze Servicevoorwaarden en Privacybeleid. Je bent niet verplicht om deze garantie aan te schaffen. Deze garantie is GEEN verzekering en biedt geen schadevergoeding voor verlies, schade of aansprakelijkheid als gevolg van een onvoorziene of onbekende gebeurtenis, maar biedt via ShipAid een bezorggarantie waarbij, als het product dat je hebt besteld niet in bevredigende staat wordt geleverd, het merk van wie je het product hebt besteld, het product gratis kan vervangen. ShipAid levert geen producten of diensten direct aan consumenten, maar biedt een dienst die merken in staat stelt om productvervanging aan hun klanten te faciliteren. Het kopen van deze garantie betekent niet automatisch dat je wordt vergoed voor product- of verzendkosten, aangezien het oplossingproces en de beslissing voor compensatie strikt wordt bepaald door het merk van wie je koopt. Het merk zal bewijs van schade of niet-geleverde producten vereisen."},links:{terms:"Servicevoorwaarden",privacy:"Privacybeleid"}}},di=Object.freeze(Object.defineProperty({__proto__:null,actions:si,default:pi,description:ni,footer:ai,loading:oi,title:ri},Symbol.toStringTag,{value:"Module"})),li="Carregando o widget ShipAid...",ci="Garantia de entrega",hi="em caso de Perda, Danos ou Roubo",ui={button:"Distribuído por"},mi={add:"Adicionar",remove:"Remover",loading:"Carregando..."},gi={loading:li,title:ci,description:hi,footer:ui,actions:mi,"learn-more-popup":{close:"Fechar",title:"Garantia de entrega",subtitle:"Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",disclaimer:{"subtitle-enable":"Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!","subtitle-monitor":"Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!","subtitle-notify":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.","subtitle-resolution":"Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",text:"Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."},links:{terms:"Termos de serviço",privacy:"Política de Privacidade"}}},fi=Object.freeze(Object.defineProperty({__proto__:null,actions:mi,default:gi,description:hi,footer:ui,loading:li,title:ci},Symbol.toStringTag,{value:"Module"}));t.ShipAidWidget=Pe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -3,10 +3,10 @@ declare class CheckoutPackageProtection extends LitElement {
|
|
|
3
3
|
createRenderRoot(): this;
|
|
4
4
|
protectionPrice: number;
|
|
5
5
|
checkoutTotal: number;
|
|
6
|
+
shipaidVariant: null;
|
|
6
7
|
logo: string;
|
|
7
8
|
originalClasses: string;
|
|
8
9
|
handleAbout(): void;
|
|
9
|
-
handleCheckoutWithProtection(): void;
|
|
10
10
|
handleCheckoutWithoutProtection(): void;
|
|
11
11
|
render(): import("lit").TemplateResult<1>;
|
|
12
12
|
}
|