ui.shipaid.com 0.3.34 → 0.3.36

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
@@ -2039,7 +2039,7 @@ let ShipAidWidget = class extends s$1 {
2039
2039
  const sellingPlanGroup = groupEdge.node;
2040
2040
  for (const planEdge of sellingPlanGroup.sellingPlans.edges) {
2041
2041
  const sellingPlan = planEdge.node;
2042
- if (sellingPlanName.includes(sellingPlan.name)) {
2042
+ if (sellingPlanName === sellingPlan.name) {
2043
2043
  return sellingPlan;
2044
2044
  }
2045
2045
  }
@@ -2762,10 +2762,15 @@ let ShipAidWidget = class extends s$1 {
2762
2762
  width: 3px;
2763
2763
  height: 8px;
2764
2764
  border: solid white;
2765
- border-width: 0 3px 3px 0;
2765
+ border-width: 0 2.5px 2.5px 0;
2766
2766
  transform: rotate(45deg)
2767
2767
  }
2768
2768
 
2769
+ .shipaid-checkbox .shipaid-checkMark.left:after {
2770
+ left: 6px;
2771
+ top: 3px;
2772
+ }
2773
+
2769
2774
  .shipaid-checkMark.left {
2770
2775
  display: block;
2771
2776
  position: static;
@@ -24,23 +24,23 @@ var ShipAidWidget=function(t){"use strict";function e(t){var e;return(null==(e=n
24
24
  * Copyright 2019 Google LLC
25
25
  * SPDX-License-Identifier: BSD-3-Clause
26
26
  */
27
- const l=window,p=l.ShadowRoot&&(void 0===l.ShadyCSS||l.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,c=Symbol(),h=new WeakMap;let u=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==c)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(p&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&h.set(e,t))}return t}toString(){return this.cssText}};const g=(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 u(i,t,c)},f=p?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new u("string"==typeof t?t:t+"",void 0,c))(e)})(t):t
27
+ const p=window,l=p.ShadowRoot&&(void 0===p.ShadyCSS||p.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,c=Symbol(),h=new WeakMap;let u=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==c)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(l&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&h.set(e,t))}return t}toString(){return this.cssText}};const g=(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 u(i,t,c)},f=l?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new u("string"==typeof t?t:t+"",void 0,c))(e)})(t):t
28
28
  /**
29
29
  * @license
30
30
  * Copyright 2017 Google LLC
31
31
  * SPDX-License-Identifier: BSD-3-Clause
32
- */;var m;const v=window,_=v.trustedTypes,b=_?_.emptyScript:"",y=v.reactiveElementPolyfillSupport,C={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),x={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:w},$="finalized";let S=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=x){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)||x}static finalize(){if(this.hasOwnProperty($))return!1;this[$]=!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(f(t))}else void 0!==t&&e.push(f(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)=>{p?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=l.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=x){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:C).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),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),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:C;this._$El=r,this[r]=s.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){}};
32
+ */;var m;const v=window,_=v.trustedTypes,b=_?_.emptyScript:"",y=v.reactiveElementPolyfillSupport,C={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),x={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:w},$="finalized";let S=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=x){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)||x}static finalize(){if(this.hasOwnProperty($))return!1;this[$]=!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(f(t))}else void 0!==t&&e.push(f(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)=>{l?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=x){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:C).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),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),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:C;this._$El=r,this[r]=s.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){}};
33
33
  /**
34
34
  * @license
35
35
  * Copyright 2017 Google LLC
36
36
  * SPDX-License-Identifier: BSD-3-Clause
37
37
  */
38
- var A;S[$]=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:S}),(null!==(m=v.reactiveElementVersions)&&void 0!==m?m:v.reactiveElementVersions=[]).push("1.6.3");const L=window,P=L.trustedTypes,k=P?P.createPolicy("lit-html",{createHTML:t=>t}):void 0,z="$lit$",E=`lit$${(Math.random()+"").slice(9)}$`,M="?"+E,q=`<${M}>`,I=document,T=()=>I.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,j="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,V=/>/g,W=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,F=(J=1,(t,...e)=>({_$litType$:J,strings:t,values:e})),Z=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),K=new WeakMap,Y=I.createTreeWalker(I,129,null,!1);var J;function Q(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}class X{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[d,l]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=R;for(let a=0;a<i;a++){const e=t[a];let i,d,l=-1,p=0;for(;p<e.length&&(n.lastIndex=p,d=n.exec(e),null!==d);)p=n.lastIndex,n===R?"!--"===d[1]?n=U:void 0!==d[1]?n=V:void 0!==d[2]?(B.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=W):void 0!==d[3]&&(n=W):n===W?">"===d[0]?(n=null!=r?r:R,l=-1):void 0===d[1]?l=-2:(l=n.lastIndex-d[2].length,i=d[1],n=void 0===d[3]?W:'"'===d[3]?H:D):n===H||n===D?n=W:n===U||n===V?n=R:(n=W,r=void 0);const c=n===W&&t[a+1].startsWith("/>")?" ":"";s+=n===R?e+q:l>=0?(o.push(i),e.slice(0,l)+z+e.slice(l)+E+c):e+E+(-2===l?(o.push(void 0),a):c)}return[Q(t,s+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=X.createElement(d,i),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(z)||e.startsWith(E)){const i=l[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+z).split(E),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?rt:"?"===e[1]?nt:"@"===e[1]?at:ot})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(B.test(o.tagName)){const t=o.textContent.split(E),e=t.length-1;if(e>0){o.textContent=P?P.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),Y.nextNode(),a.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===M)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(E,t+1));)a.push({type:7,index:r}),t+=E.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function tt(t,e,i=t,o){var r,s,n,a;if(e===Z)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const l=O(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==l&&(null===(s=null==d?void 0:d._$AO)||void 0===s||s.call(d,!1),void 0===l?d=void 0:(d=new l(t),d._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Co)&&void 0!==n?n:a._$Co=[])[o]=d:i._$Cl=d),void 0!==d&&(e=tt(t,d._$AS(t,e.values),d,o)),e}class et{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);Y.currentNode=r;let s=Y.nextNode(),n=0,a=0,d=o[0];for(;void 0!==d;){if(n===d.index){let e;2===d.type?e=new it(s,s.nextSibling,this,t):1===d.type?e=new d.ctor(s,d.name,d.strings,this,t):6===d.type&&(e=new dt(s,this,t)),this._$AV.push(e),d=o[++a]}n!==(null==d?void 0:d.index)&&(s=Y.nextNode(),n++)}return Y.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 it{constructor(t,e,i,o){var r;this.type=2,this._$AH=G,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=tt(this,t,e),O(t)?t===G||null==t||""===t?(this._$AH!==G&&this._$AR(),this._$AH=G):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>N(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!==G&&O(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=X.createElement(Q(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 et(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=K.get(t.strings);return void 0===e&&K.set(t.strings,e=new X(t)),e}T(t){N(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 it(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 ot{constructor(t,e,i,o,r){this.type=1,this._$AH=G,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=G}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(void 0===r)t=tt(this,t,e,0),s=!O(t)||t!==this._$AH&&t!==Z,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=tt(this,o[i+n],e,n),a===Z&&(a=this._$AH[n]),s||(s=!O(a)||a!==this._$AH[n]),a===G?t=G:t!==G&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class rt extends ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===G?void 0:t}}const st=P?P.emptyScript:"";class nt extends ot{constructor(){super(...arguments),this.type=4}j(t){t&&t!==G?this.element.setAttribute(this.name,st):this.element.removeAttribute(this.name)}}class at extends ot{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=tt(this,t,e,0))&&void 0!==i?i:G)===Z)return;const o=this._$AH,r=t===G&&o!==G||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==G&&(o===G||r);r&&this.element.removeEventListener(this.name,this,o),s&&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 dt{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){tt(this,t)}}const lt=L.litHtmlPolyfillSupport;null==lt||lt(X,it),(null!==(A=L.litHtmlVersions)&&void 0!==A?A:L.litHtmlVersions=[]).push("2.8.0");const pt=(t,e,i)=>{var o,r;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let n=s._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=n=new it(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n};
38
+ var A;S[$]=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:S}),(null!==(m=v.reactiveElementVersions)&&void 0!==m?m:v.reactiveElementVersions=[]).push("1.6.3");const L=window,P=L.trustedTypes,k=P?P.createPolicy("lit-html",{createHTML:t=>t}):void 0,z="$lit$",E=`lit$${(Math.random()+"").slice(9)}$`,M="?"+E,q=`<${M}>`,I=document,T=()=>I.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,j="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,V=/>/g,W=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,F=(J=1,(t,...e)=>({_$litType$:J,strings:t,values:e})),Z=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),K=new WeakMap,Y=I.createTreeWalker(I,129,null,!1);var J;function Q(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}class X{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[d,p]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=R;for(let a=0;a<i;a++){const e=t[a];let i,d,p=-1,l=0;for(;l<e.length&&(n.lastIndex=l,d=n.exec(e),null!==d);)l=n.lastIndex,n===R?"!--"===d[1]?n=U:void 0!==d[1]?n=V:void 0!==d[2]?(B.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=W):void 0!==d[3]&&(n=W):n===W?">"===d[0]?(n=null!=r?r:R,p=-1):void 0===d[1]?p=-2:(p=n.lastIndex-d[2].length,i=d[1],n=void 0===d[3]?W:'"'===d[3]?H:D):n===H||n===D?n=W:n===U||n===V?n=R:(n=W,r=void 0);const c=n===W&&t[a+1].startsWith("/>")?" ":"";s+=n===R?e+q:p>=0?(o.push(i),e.slice(0,p)+z+e.slice(p)+E+c):e+E+(-2===p?(o.push(void 0),a):c)}return[Q(t,s+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=X.createElement(d,i),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(z)||e.startsWith(E)){const i=p[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+z).split(E),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?rt:"?"===e[1]?nt:"@"===e[1]?at:ot})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(B.test(o.tagName)){const t=o.textContent.split(E),e=t.length-1;if(e>0){o.textContent=P?P.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),Y.nextNode(),a.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===M)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(E,t+1));)a.push({type:7,index:r}),t+=E.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function tt(t,e,i=t,o){var r,s,n,a;if(e===Z)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const p=O(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==p&&(null===(s=null==d?void 0:d._$AO)||void 0===s||s.call(d,!1),void 0===p?d=void 0:(d=new p(t),d._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Co)&&void 0!==n?n:a._$Co=[])[o]=d:i._$Cl=d),void 0!==d&&(e=tt(t,d._$AS(t,e.values),d,o)),e}class et{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);Y.currentNode=r;let s=Y.nextNode(),n=0,a=0,d=o[0];for(;void 0!==d;){if(n===d.index){let e;2===d.type?e=new it(s,s.nextSibling,this,t):1===d.type?e=new d.ctor(s,d.name,d.strings,this,t):6===d.type&&(e=new dt(s,this,t)),this._$AV.push(e),d=o[++a]}n!==(null==d?void 0:d.index)&&(s=Y.nextNode(),n++)}return Y.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 it{constructor(t,e,i,o){var r;this.type=2,this._$AH=G,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=tt(this,t,e),O(t)?t===G||null==t||""===t?(this._$AH!==G&&this._$AR(),this._$AH=G):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>N(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!==G&&O(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=X.createElement(Q(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 et(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=K.get(t.strings);return void 0===e&&K.set(t.strings,e=new X(t)),e}T(t){N(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 it(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 ot{constructor(t,e,i,o,r){this.type=1,this._$AH=G,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=G}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(void 0===r)t=tt(this,t,e,0),s=!O(t)||t!==this._$AH&&t!==Z,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=tt(this,o[i+n],e,n),a===Z&&(a=this._$AH[n]),s||(s=!O(a)||a!==this._$AH[n]),a===G?t=G:t!==G&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class rt extends ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===G?void 0:t}}const st=P?P.emptyScript:"";class nt extends ot{constructor(){super(...arguments),this.type=4}j(t){t&&t!==G?this.element.setAttribute(this.name,st):this.element.removeAttribute(this.name)}}class at extends ot{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=tt(this,t,e,0))&&void 0!==i?i:G)===Z)return;const o=this._$AH,r=t===G&&o!==G||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==G&&(o===G||r);r&&this.element.removeEventListener(this.name,this,o),s&&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 dt{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){tt(this,t)}}const pt=L.litHtmlPolyfillSupport;null==pt||pt(X,it),(null!==(A=L.litHtmlVersions)&&void 0!==A?A:L.litHtmlVersions=[]).push("2.8.0");const lt=(t,e,i)=>{var o,r;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let n=s._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=n=new it(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n};
39
39
  /**
40
40
  * @license
41
41
  * Copyright 2017 Google LLC
42
42
  * SPDX-License-Identifier: BSD-3-Clause
43
- */var ct,ht;let ut=class extends S{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=pt(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 Z}};ut.finalized=!0,ut._$litElement$=!0,null===(ct=globalThis.litElementHydrateSupport)||void 0===ct||ct.call(globalThis,{LitElement:ut});const gt=globalThis.litElementPolyfillSupport;null==gt||gt({LitElement:ut}),(null!==(ht=globalThis.litElementVersions)&&void 0!==ht?ht:globalThis.litElementVersions=[]).push("3.3.3");const ft="langChanged";function mt(t,e,i){return Object.entries(_t(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[  ]*${e}[  ]*}}`,"gm"),String(_t(i)))),t)}function vt(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 _t(t){return"function"==typeof t?t():t}let bt={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:vt,interpolate:mt,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(ft,{detail:o}))}
43
+ */var ct,ht;let ut=class extends S{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=lt(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 Z}};ut.finalized=!0,ut._$litElement$=!0,null===(ct=globalThis.litElementHydrateSupport)||void 0===ct||ct.call(globalThis,{LitElement:ut});const gt=globalThis.litElementPolyfillSupport;null==gt||gt({LitElement:ut}),(null!==(ht=globalThis.litElementVersions)&&void 0!==ht?ht:globalThis.litElementVersions=[]).push("3.3.3");const ft="langChanged";function mt(t,e,i){return Object.entries(_t(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[  ]*${e}[  ]*}}`,"gm"),String(_t(i)))),t)}function vt(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 _t(t){return"function"==typeof t?t():t}let bt={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:vt,interpolate:mt,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(ft,{detail:o}))}
44
44
  /**
45
45
  * @license
46
46
  * Copyright 2017 Google LLC
@@ -792,7 +792,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=g`
792
792
  .shipaid-prompt .prompt-footer .prompt-footer-badge svg {
793
793
  height:var(--shipaid-footer-badge-logo-height, 9px);
794
794
  }
795
- `;var re=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(re||{}),se=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ae=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?ne(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&se(e,i,s),s};const de=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.")}},le=t=>console.warn(`[ShipAid] ${t}`),pe=t=>console.error(`[ShipAid] ${t}`),ce="shipaid-protection",he="shipaid-protection-popup-show",ue=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>Ce)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>ie)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Pe)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Te)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>We)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default))});var ge;ge={loader:async t=>{if("en"===t)return ee;const e=Reflect.get(ue,`./lang/${t}.json`);return e?await e():ee}},bt=Object.assign(Object.assign({},bt),ge),t.ShipAidWidget=class extends ut{constructor(){var t,e,i;super(...arguments),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._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.intervalId=0,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>de(t),post:(t,e)=>de(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${he}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${he}`,"true")}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")?(le("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,s,n;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==(n=null==(s=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:s.widget)?void 0:n.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(re.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)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;const s=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost);if(!s)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const e={query:"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 }\n}",variables:{store:s}},i=await this._fetch.post(t.toString(),e);if(!i)throw new Error("Missing response for store query.");if(null==(o=i.errors)?void 0:o.length)throw new Error(i.errors[0].message);if(!(null==(r=i.data)?void 0:r.store))throw new Error("Missing store from store query response.");return i.data.store}catch(n){throw console.error(n),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.includes(t.name))return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,s,n,a,d,l,p,c,h,u;const g=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!g)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:g,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==(s=o.errors)?void 0:s.length)throw new Error(o.errors[0].message);if(!(null==(n=o.data)?void 0:n.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const f=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],m=(null==(u=null==(h=null==(c=null==(p=null==(l=f[0])?void 0:l.node)?void 0:p.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(f,t.name)||m}catch(f){console.error("Error during the query ====>",f)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw pe(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){try{const{product:t}=await this._fetch.get("/products/shipaid-protection.json");return t}catch(t){throw pe(t.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 addProtection(){var t,i;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==(i=this._protectionVariant)?void 0:i.id))throw new Error("No protection variant found.");this._setState("loading");const o={quantity:1,id:this._protectionVariant.id};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)}));if(t){const i=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=i?e(i.id):null;o.selling_plan=r}}const r=await this._fetch.post("/cart/add.js",o);await this._handleRefresh(r),this._setState("success")}catch(o){pe(o.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={quantity:0,id:this._protectionCartItem.key},e=await this._fetch.post("/cart/change.js",t);await this._handleRefresh(e),this._cart=e,this._setState("success")}catch(t){pe(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,s;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 n=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[n];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(s=this._cart)?void 0:s.item_count)&&this._store.widgetShowCart&&await this.addProtection())}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 s=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)))&&s++})),s>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={id:(null==(r=this._cart)?void 0:r.items[t]).key,quantity:0},i=await this._fetch.post("/cart/change.js",e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return this.persistPopup&&(this._popup=this.shouldPersistPopup()),F`
795
+ `;var re=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(re||{}),se=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ae=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?ne(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&se(e,i,s),s};const de=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.")}},pe=t=>console.warn(`[ShipAid] ${t}`),le=t=>console.error(`[ShipAid] ${t}`),ce="shipaid-protection",he="shipaid-protection-popup-show",ue=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>Ce)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>ie)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Pe)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Te)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>We)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default))});var ge;ge={loader:async t=>{if("en"===t)return ee;const e=Reflect.get(ue,`./lang/${t}.json`);return e?await e():ee}},bt=Object.assign(Object.assign({},bt),ge),t.ShipAidWidget=class extends ut{constructor(){var t,e,i;super(...arguments),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._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.intervalId=0,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>de(t),post:(t,e)=>de(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${he}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${he}`,"true")}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")?(pe("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,s,n;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==(n=null==(s=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:s.widget)?void 0:n.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(re.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)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;const s=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost);if(!s)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const e={query:"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 }\n}",variables:{store:s}},i=await this._fetch.post(t.toString(),e);if(!i)throw new Error("Missing response for store query.");if(null==(o=i.errors)?void 0:o.length)throw new Error(i.errors[0].message);if(!(null==(r=i.data)?void 0:r.store))throw new Error("Missing store from store query response.");return i.data.store}catch(n){throw console.error(n),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,s,n,a,d,p,l,c,h,u;const g=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!g)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:g,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==(s=o.errors)?void 0:s.length)throw new Error(o.errors[0].message);if(!(null==(n=o.data)?void 0:n.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const f=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],m=(null==(u=null==(h=null==(c=null==(l=null==(p=f[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(f,t.name)||m}catch(f){console.error("Error during the query ====>",f)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw le(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){try{const{product:t}=await this._fetch.get("/products/shipaid-protection.json");return t}catch(t){throw le(t.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 addProtection(){var t,i;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==(i=this._protectionVariant)?void 0:i.id))throw new Error("No protection variant found.");this._setState("loading");const o={quantity:1,id:this._protectionVariant.id};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)}));if(t){const i=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=i?e(i.id):null;o.selling_plan=r}}const r=await this._fetch.post("/cart/add.js",o);await this._handleRefresh(r),this._setState("success")}catch(o){le(o.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={quantity:0,id:this._protectionCartItem.key},e=await this._fetch.post("/cart/change.js",t);await this._handleRefresh(e),this._cart=e,this._setState("success")}catch(t){le(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,s;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 n=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[n];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(s=this._cart)?void 0:s.item_count)&&this._store.widgetShowCart&&await this.addProtection())}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 s=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)))&&s++})),s>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={id:(null==(r=this._cart)?void 0:r.items[t]).key,quantity:0},i=await this._fetch.post("/cart/change.js",e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return this.persistPopup&&(this._popup=this.shouldPersistPopup()),F`
796
796
  <shipaid-popup-learn-more
797
797
  ?active=${"learn-more"===this._popup}
798
798
  @close=${()=>{this.persistPopup&&localStorage.removeItem(`${he}`),this._popup=null}}
@@ -854,7 +854,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=g`
854
854
  </a>
855
855
  </div>
856
856
  </div>
857
- `}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}render(){return Tt(this,(async()=>{var t,e,i,o,r,s;const n=document.createElement("link");n.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),n.setAttribute("rel","stylesheet"),document.head.appendChild(n);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(a){return pe(a.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(re.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(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&await this.addProtection()))}),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==(s=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:s.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(le("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(le("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(le("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const s=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))})),n=null==(o=this._cart)?void 0:o.items[s];if(this._hasProtectionInCart=!!n,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&n&&(this._cart.total_price===n.final_line_price||!a)){const t={id:n.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return sessionStorage.removeItem(ce),await this._handleRefresh(e)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void pe("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!n)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==n?void 0:n.selling_plan_allocation))i={id:n.key,quantity:1,selling_plan:null};else if(t&&!(null==n?void 0:n.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:n.key,quantity:1,selling_plan:r}}if(i){const t=await this._fetch.post("/cart/change.js",i);await this._handleRefresh(t)}}if(d.id===n.variant_id){if(this._protectionCartItem={...n,index:s,position:s+1},1===n.quantity)return;const t={id:n.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return this._handleRefreshCart(),await this._handleRefresh(e)}const l={updates:{[n.variant_id]:0,[d.id]:1}},p=await this._fetch.post("/cart/update.js",l);await this._handleRefresh(p)}),[this._store,this._cart]),pt(this.learnMorePopupTemplate(),document.body),F`
857
+ `}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}render(){return Tt(this,(async()=>{var t,e,i,o,r,s;const n=document.createElement("link");n.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),n.setAttribute("rel","stylesheet"),document.head.appendChild(n);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(a){return le(a.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(re.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(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&await this.addProtection()))}),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==(s=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:s.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(pe("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(pe("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(pe("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const s=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))})),n=null==(o=this._cart)?void 0:o.items[s];if(this._hasProtectionInCart=!!n,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&n&&(this._cart.total_price===n.final_line_price||!a)){const t={id:n.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return sessionStorage.removeItem(ce),await this._handleRefresh(e)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void le("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!n)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==n?void 0:n.selling_plan_allocation))i={id:n.key,quantity:1,selling_plan:null};else if(t&&!(null==n?void 0:n.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:n.key,quantity:1,selling_plan:r}}if(i){const t=await this._fetch.post("/cart/change.js",i);await this._handleRefresh(t)}}if(d.id===n.variant_id){if(this._protectionCartItem={...n,index:s,position:s+1},1===n.quantity)return;const t={id:n.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return this._handleRefreshCart(),await this._handleRefresh(e)}const p={updates:{[n.variant_id]:0,[d.id]:1}},l=await this._fetch.post("/cart/update.js",p);await this._handleRefresh(l)}),[this._store,this._cart]),lt(this.learnMorePopupTemplate(),document.body),F`
858
858
  <style>
859
859
  :host {
860
860
  --shipaid-primary: #002bd6;
@@ -1060,10 +1060,15 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=g`
1060
1060
  width: 3px;
1061
1061
  height: 8px;
1062
1062
  border: solid white;
1063
- border-width: 0 3px 3px 0;
1063
+ border-width: 0 2.5px 2.5px 0;
1064
1064
  transform: rotate(45deg)
1065
1065
  }
1066
1066
 
1067
+ .shipaid-checkbox .shipaid-checkMark.left:after {
1068
+ left: 6px;
1069
+ top: 3px;
1070
+ }
1071
+
1067
1072
  .shipaid-checkMark.left {
1068
1073
  display: block;
1069
1074
  position: static;
@@ -24,23 +24,23 @@
24
24
  * Copyright 2019 Google LLC
25
25
  * SPDX-License-Identifier: BSD-3-Clause
26
26
  */
27
- const l=window,p=l.ShadowRoot&&(void 0===l.ShadyCSS||l.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,c=Symbol(),h=new WeakMap;let u=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==c)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(p&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&h.set(e,t))}return t}toString(){return this.cssText}};const g=(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 u(i,t,c)},f=p?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new u("string"==typeof t?t:t+"",void 0,c))(e)})(t):t
27
+ const p=window,l=p.ShadowRoot&&(void 0===p.ShadyCSS||p.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,c=Symbol(),h=new WeakMap;let u=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==c)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(l&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&h.set(e,t))}return t}toString(){return this.cssText}};const g=(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 u(i,t,c)},f=l?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new u("string"==typeof t?t:t+"",void 0,c))(e)})(t):t
28
28
  /**
29
29
  * @license
30
30
  * Copyright 2017 Google LLC
31
31
  * SPDX-License-Identifier: BSD-3-Clause
32
- */;var m;const v=window,_=v.trustedTypes,b=_?_.emptyScript:"",y=v.reactiveElementPolyfillSupport,C={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),x={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:w},$="finalized";let S=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=x){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)||x}static finalize(){if(this.hasOwnProperty($))return!1;this[$]=!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(f(t))}else void 0!==t&&e.push(f(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)=>{p?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=l.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=x){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:C).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),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),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:C;this._$El=r,this[r]=s.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){}};
32
+ */;var m;const v=window,_=v.trustedTypes,b=_?_.emptyScript:"",y=v.reactiveElementPolyfillSupport,C={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),x={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:w},$="finalized";let S=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=x){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)||x}static finalize(){if(this.hasOwnProperty($))return!1;this[$]=!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(f(t))}else void 0!==t&&e.push(f(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)=>{l?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=x){var o;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:C).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),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),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:C;this._$El=r,this[r]=s.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){}};
33
33
  /**
34
34
  * @license
35
35
  * Copyright 2017 Google LLC
36
36
  * SPDX-License-Identifier: BSD-3-Clause
37
37
  */
38
- var A;S[$]=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:S}),(null!==(m=v.reactiveElementVersions)&&void 0!==m?m:v.reactiveElementVersions=[]).push("1.6.3");const L=window,P=L.trustedTypes,k=P?P.createPolicy("lit-html",{createHTML:t=>t}):void 0,z="$lit$",E=`lit$${(Math.random()+"").slice(9)}$`,M="?"+E,q=`<${M}>`,I=document,T=()=>I.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,j="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,V=/>/g,W=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,F=(J=1,(t,...e)=>({_$litType$:J,strings:t,values:e})),Z=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),K=new WeakMap,Y=I.createTreeWalker(I,129,null,!1);var J;function Q(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}class X{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[d,l]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=R;for(let a=0;a<i;a++){const e=t[a];let i,d,l=-1,p=0;for(;p<e.length&&(n.lastIndex=p,d=n.exec(e),null!==d);)p=n.lastIndex,n===R?"!--"===d[1]?n=U:void 0!==d[1]?n=V:void 0!==d[2]?(B.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=W):void 0!==d[3]&&(n=W):n===W?">"===d[0]?(n=null!=r?r:R,l=-1):void 0===d[1]?l=-2:(l=n.lastIndex-d[2].length,i=d[1],n=void 0===d[3]?W:'"'===d[3]?H:D):n===H||n===D?n=W:n===U||n===V?n=R:(n=W,r=void 0);const c=n===W&&t[a+1].startsWith("/>")?" ":"";s+=n===R?e+q:l>=0?(o.push(i),e.slice(0,l)+z+e.slice(l)+E+c):e+E+(-2===l?(o.push(void 0),a):c)}return[Q(t,s+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=X.createElement(d,i),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(z)||e.startsWith(E)){const i=l[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+z).split(E),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?rt:"?"===e[1]?nt:"@"===e[1]?at:ot})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(B.test(o.tagName)){const t=o.textContent.split(E),e=t.length-1;if(e>0){o.textContent=P?P.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),Y.nextNode(),a.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===M)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(E,t+1));)a.push({type:7,index:r}),t+=E.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function tt(t,e,i=t,o){var r,s,n,a;if(e===Z)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const l=O(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==l&&(null===(s=null==d?void 0:d._$AO)||void 0===s||s.call(d,!1),void 0===l?d=void 0:(d=new l(t),d._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Co)&&void 0!==n?n:a._$Co=[])[o]=d:i._$Cl=d),void 0!==d&&(e=tt(t,d._$AS(t,e.values),d,o)),e}class et{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);Y.currentNode=r;let s=Y.nextNode(),n=0,a=0,d=o[0];for(;void 0!==d;){if(n===d.index){let e;2===d.type?e=new it(s,s.nextSibling,this,t):1===d.type?e=new d.ctor(s,d.name,d.strings,this,t):6===d.type&&(e=new dt(s,this,t)),this._$AV.push(e),d=o[++a]}n!==(null==d?void 0:d.index)&&(s=Y.nextNode(),n++)}return Y.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 it{constructor(t,e,i,o){var r;this.type=2,this._$AH=G,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=tt(this,t,e),O(t)?t===G||null==t||""===t?(this._$AH!==G&&this._$AR(),this._$AH=G):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>N(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!==G&&O(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=X.createElement(Q(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 et(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=K.get(t.strings);return void 0===e&&K.set(t.strings,e=new X(t)),e}T(t){N(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 it(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 ot{constructor(t,e,i,o,r){this.type=1,this._$AH=G,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=G}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(void 0===r)t=tt(this,t,e,0),s=!O(t)||t!==this._$AH&&t!==Z,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=tt(this,o[i+n],e,n),a===Z&&(a=this._$AH[n]),s||(s=!O(a)||a!==this._$AH[n]),a===G?t=G:t!==G&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class rt extends ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===G?void 0:t}}const st=P?P.emptyScript:"";class nt extends ot{constructor(){super(...arguments),this.type=4}j(t){t&&t!==G?this.element.setAttribute(this.name,st):this.element.removeAttribute(this.name)}}class at extends ot{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=tt(this,t,e,0))&&void 0!==i?i:G)===Z)return;const o=this._$AH,r=t===G&&o!==G||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==G&&(o===G||r);r&&this.element.removeEventListener(this.name,this,o),s&&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 dt{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){tt(this,t)}}const lt=L.litHtmlPolyfillSupport;null==lt||lt(X,it),(null!==(A=L.litHtmlVersions)&&void 0!==A?A:L.litHtmlVersions=[]).push("2.8.0");const pt=(t,e,i)=>{var o,r;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let n=s._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=n=new it(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n};
38
+ var A;S[$]=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null==y||y({ReactiveElement:S}),(null!==(m=v.reactiveElementVersions)&&void 0!==m?m:v.reactiveElementVersions=[]).push("1.6.3");const L=window,P=L.trustedTypes,k=P?P.createPolicy("lit-html",{createHTML:t=>t}):void 0,z="$lit$",E=`lit$${(Math.random()+"").slice(9)}$`,M="?"+E,q=`<${M}>`,I=document,T=()=>I.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,j="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,V=/>/g,W=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,H=/"/g,B=/^(?:script|style|textarea|title)$/i,F=(J=1,(t,...e)=>({_$litType$:J,strings:t,values:e})),Z=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),K=new WeakMap,Y=I.createTreeWalker(I,129,null,!1);var J;function Q(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}class X{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[d,p]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=R;for(let a=0;a<i;a++){const e=t[a];let i,d,p=-1,l=0;for(;l<e.length&&(n.lastIndex=l,d=n.exec(e),null!==d);)l=n.lastIndex,n===R?"!--"===d[1]?n=U:void 0!==d[1]?n=V:void 0!==d[2]?(B.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=W):void 0!==d[3]&&(n=W):n===W?">"===d[0]?(n=null!=r?r:R,p=-1):void 0===d[1]?p=-2:(p=n.lastIndex-d[2].length,i=d[1],n=void 0===d[3]?W:'"'===d[3]?H:D):n===H||n===D?n=W:n===U||n===V?n=R:(n=W,r=void 0);const c=n===W&&t[a+1].startsWith("/>")?" ":"";s+=n===R?e+q:p>=0?(o.push(i),e.slice(0,p)+z+e.slice(p)+E+c):e+E+(-2===p?(o.push(void 0),a):c)}return[Q(t,s+(t[i]||"<?>")+(2===e?"</svg>":"")),o]})(t,e);if(this.el=X.createElement(d,i),Y.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Y.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(z)||e.startsWith(E)){const i=p[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+z).split(E),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?rt:"?"===e[1]?nt:"@"===e[1]?at:ot})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(B.test(o.tagName)){const t=o.textContent.split(E),e=t.length-1;if(e>0){o.textContent=P?P.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),Y.nextNode(),a.push({type:2,index:++r});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===M)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(E,t+1));)a.push({type:7,index:r}),t+=E.length-1}r++}}static createElement(t,e){const i=I.createElement("template");return i.innerHTML=t,i}}function tt(t,e,i=t,o){var r,s,n,a;if(e===Z)return e;let d=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const p=O(e)?void 0:e._$litDirective$;return(null==d?void 0:d.constructor)!==p&&(null===(s=null==d?void 0:d._$AO)||void 0===s||s.call(d,!1),void 0===p?d=void 0:(d=new p(t),d._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Co)&&void 0!==n?n:a._$Co=[])[o]=d:i._$Cl=d),void 0!==d&&(e=tt(t,d._$AS(t,e.values),d,o)),e}class et{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);Y.currentNode=r;let s=Y.nextNode(),n=0,a=0,d=o[0];for(;void 0!==d;){if(n===d.index){let e;2===d.type?e=new it(s,s.nextSibling,this,t):1===d.type?e=new d.ctor(s,d.name,d.strings,this,t):6===d.type&&(e=new dt(s,this,t)),this._$AV.push(e),d=o[++a]}n!==(null==d?void 0:d.index)&&(s=Y.nextNode(),n++)}return Y.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 it{constructor(t,e,i,o){var r;this.type=2,this._$AH=G,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=tt(this,t,e),O(t)?t===G||null==t||""===t?(this._$AH!==G&&this._$AR(),this._$AH=G):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>N(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!==G&&O(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=X.createElement(Q(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 et(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=K.get(t.strings);return void 0===e&&K.set(t.strings,e=new X(t)),e}T(t){N(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 it(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 ot{constructor(t,e,i,o,r){this.type=1,this._$AH=G,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=G}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(void 0===r)t=tt(this,t,e,0),s=!O(t)||t!==this._$AH&&t!==Z,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=tt(this,o[i+n],e,n),a===Z&&(a=this._$AH[n]),s||(s=!O(a)||a!==this._$AH[n]),a===G?t=G:t!==G&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class rt extends ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===G?void 0:t}}const st=P?P.emptyScript:"";class nt extends ot{constructor(){super(...arguments),this.type=4}j(t){t&&t!==G?this.element.setAttribute(this.name,st):this.element.removeAttribute(this.name)}}class at extends ot{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=tt(this,t,e,0))&&void 0!==i?i:G)===Z)return;const o=this._$AH,r=t===G&&o!==G||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==G&&(o===G||r);r&&this.element.removeEventListener(this.name,this,o),s&&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 dt{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){tt(this,t)}}const pt=L.litHtmlPolyfillSupport;null==pt||pt(X,it),(null!==(A=L.litHtmlVersions)&&void 0!==A?A:L.litHtmlVersions=[]).push("2.8.0");const lt=(t,e,i)=>{var o,r;const s=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let n=s._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=n=new it(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n};
39
39
  /**
40
40
  * @license
41
41
  * Copyright 2017 Google LLC
42
42
  * SPDX-License-Identifier: BSD-3-Clause
43
- */var ct,ht;let ut=class extends S{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=pt(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 Z}};ut.finalized=!0,ut._$litElement$=!0,null===(ct=globalThis.litElementHydrateSupport)||void 0===ct||ct.call(globalThis,{LitElement:ut});const gt=globalThis.litElementPolyfillSupport;null==gt||gt({LitElement:ut}),(null!==(ht=globalThis.litElementVersions)&&void 0!==ht?ht:globalThis.litElementVersions=[]).push("3.3.3");const ft="langChanged";function mt(t,e,i){return Object.entries(_t(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[  ]*${e}[  ]*}}`,"gm"),String(_t(i)))),t)}function vt(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 _t(t){return"function"==typeof t?t():t}let bt={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:vt,interpolate:mt,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(ft,{detail:o}))}
43
+ */var ct,ht;let ut=class extends S{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=lt(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 Z}};ut.finalized=!0,ut._$litElement$=!0,null===(ct=globalThis.litElementHydrateSupport)||void 0===ct||ct.call(globalThis,{LitElement:ut});const gt=globalThis.litElementPolyfillSupport;null==gt||gt({LitElement:ut}),(null!==(ht=globalThis.litElementVersions)&&void 0!==ht?ht:globalThis.litElementVersions=[]).push("3.3.3");const ft="langChanged";function mt(t,e,i){return Object.entries(_t(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[  ]*${e}[  ]*}}`,"gm"),String(_t(i)))),t)}function vt(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 _t(t){return"function"==typeof t?t():t}let bt={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:vt,interpolate:mt,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(ft,{detail:o}))}
44
44
  /**
45
45
  * @license
46
46
  * Copyright 2017 Google LLC
@@ -792,7 +792,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=g`
792
792
  .shipaid-prompt .prompt-footer .prompt-footer-badge svg {
793
793
  height:var(--shipaid-footer-badge-logo-height, 9px);
794
794
  }
795
- `;var re=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(re||{}),se=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ae=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?ne(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&se(e,i,s),s};const de=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.")}},le=t=>console.warn(`[ShipAid] ${t}`),pe=t=>console.error(`[ShipAid] ${t}`),ce="shipaid-protection",he="shipaid-protection-popup-show",ue=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>Ce)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>ie)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Pe)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Te)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>We)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default))});var ge;ge={loader:async t=>{if("en"===t)return ee;const e=Reflect.get(ue,`./lang/${t}.json`);return e?await e():ee}},bt=Object.assign(Object.assign({},bt),ge),t.ShipAidWidget=class extends ut{constructor(){var t,e,i;super(...arguments),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._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.intervalId=0,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>de(t),post:(t,e)=>de(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${he}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${he}`,"true")}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")?(le("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,s,n;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==(n=null==(s=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:s.widget)?void 0:n.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(re.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)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;const s=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost);if(!s)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const e={query:"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 }\n}",variables:{store:s}},i=await this._fetch.post(t.toString(),e);if(!i)throw new Error("Missing response for store query.");if(null==(o=i.errors)?void 0:o.length)throw new Error(i.errors[0].message);if(!(null==(r=i.data)?void 0:r.store))throw new Error("Missing store from store query response.");return i.data.store}catch(n){throw console.error(n),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.includes(t.name))return t}}return null}async _fetchSellingPlanFromVariant(t){var e,i,o,r,s,n,a,d,l,p,c,h,u;const g=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!g)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:g,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==(s=o.errors)?void 0:s.length)throw new Error(o.errors[0].message);if(!(null==(n=o.data)?void 0:n.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const f=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],m=(null==(u=null==(h=null==(c=null==(p=null==(l=f[0])?void 0:l.node)?void 0:p.sellingPlans)?void 0:c.edges)?void 0:h[0])?void 0:u.node)||null;return this._findSellingPlanByName(f,t.name)||m}catch(f){console.error("Error during the query ====>",f)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw pe(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){try{const{product:t}=await this._fetch.get("/products/shipaid-protection.json");return t}catch(t){throw pe(t.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 addProtection(){var t,i;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==(i=this._protectionVariant)?void 0:i.id))throw new Error("No protection variant found.");this._setState("loading");const o={quantity:1,id:this._protectionVariant.id};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)}));if(t){const i=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=i?e(i.id):null;o.selling_plan=r}}const r=await this._fetch.post("/cart/add.js",o);await this._handleRefresh(r),this._setState("success")}catch(o){pe(o.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={quantity:0,id:this._protectionCartItem.key},e=await this._fetch.post("/cart/change.js",t);await this._handleRefresh(e),this._cart=e,this._setState("success")}catch(t){pe(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,s;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 n=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[n];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(s=this._cart)?void 0:s.item_count)&&this._store.widgetShowCart&&await this.addProtection())}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 s=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)))&&s++})),s>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={id:(null==(r=this._cart)?void 0:r.items[t]).key,quantity:0},i=await this._fetch.post("/cart/change.js",e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return this.persistPopup&&(this._popup=this.shouldPersistPopup()),F`
795
+ `;var re=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(re||{}),se=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ae=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?ne(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&se(e,i,s),s};const de=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.")}},pe=t=>console.warn(`[ShipAid] ${t}`),le=t=>console.error(`[ShipAid] ${t}`),ce="shipaid-protection",he="shipaid-protection-popup-show",ue=Object.assign({"./lang/de.json":()=>Promise.resolve().then((()=>Ce)).then((t=>t.default)),"./lang/en.json":()=>Promise.resolve().then((()=>ie)).then((t=>t.default)),"./lang/es.json":()=>Promise.resolve().then((()=>Pe)).then((t=>t.default)),"./lang/fr.json":()=>Promise.resolve().then((()=>Te)).then((t=>t.default)),"./lang/it.json":()=>Promise.resolve().then((()=>We)).then((t=>t.default)),"./lang/pt.json":()=>Promise.resolve().then((()=>Ke)).then((t=>t.default))});var ge;ge={loader:async t=>{if("en"===t)return ee;const e=Reflect.get(ue,`./lang/${t}.json`);return e?await e():ee}},bt=Object.assign(Object.assign({},bt),ge),t.ShipAidWidget=class extends ut{constructor(){var t,e,i;super(...arguments),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._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.intervalId=0,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>de(t),post:(t,e)=>de(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}shouldPersistPopup(){return"true"===localStorage.getItem(`${he}`)?"learn-more":null}setPopupKey(){this.persistPopup&&localStorage.setItem(`${he}`,"true")}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")?(pe("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,s,n;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==(n=null==(s=null==(r=this._store)?void 0:r.widgetConfigurations)?void 0:s.widget)?void 0:n.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(re.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)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){var t,e,i,o,r;const s=(null==(t=window.Shopify)?void 0:t.shop)??(null==(i=null==(e=window.Shopify)?void 0:e.Checkout)?void 0:i.apiHost);if(!s)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const e={query:"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 }\n}",variables:{store:s}},i=await this._fetch.post(t.toString(),e);if(!i)throw new Error("Missing response for store query.");if(null==(o=i.errors)?void 0:o.length)throw new Error(i.errors[0].message);if(!(null==(r=i.data)?void 0:r.store))throw new Error("Missing store from store query response.");return i.data.store}catch(n){throw console.error(n),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,s,n,a,d,p,l,c,h,u;const g=(null==(e=window.Shopify)?void 0:e.shop)??(null==(o=null==(i=window.Shopify)?void 0:i.Checkout)?void 0:o.apiHost);if(!g)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:g,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==(s=o.errors)?void 0:s.length)throw new Error(o.errors[0].message);if(!(null==(n=o.data)?void 0:n.sellingPlanFromVariant))throw new Error("Missing variant from selling plan query response.");const f=(null==(d=null==(a=o.data.sellingPlanFromVariant)?void 0:a.sellingPlanGroups)?void 0:d.edges)||[],m=(null==(u=null==(h=null==(c=null==(l=null==(p=f[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(f,t.name)||m}catch(f){console.error("Error during the query ====>",f)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw le(t.message),new Error("Could not fetch cart for current domain.")}}async _fetchProduct(){try{const{product:t}=await this._fetch.get("/products/shipaid-protection.json");return t}catch(t){throw le(t.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 addProtection(){var t,i;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==(i=this._protectionVariant)?void 0:i.id))throw new Error("No protection variant found.");this._setState("loading");const o={quantity:1,id:this._protectionVariant.id};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)}));if(t){const i=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=i?e(i.id):null;o.selling_plan=r}}const r=await this._fetch.post("/cart/add.js",o);await this._handleRefresh(r),this._setState("success")}catch(o){le(o.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={quantity:0,id:this._protectionCartItem.key},e=await this._fetch.post("/cart/change.js",t);await this._handleRefresh(e),this._cart=e,this._setState("success")}catch(t){le(t.message)}finally{this._cart=await this._fetchCart(),this._setState("success")}}async attemptAddProtection(){var t,e,i,o,r,s;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 n=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[n];if(this._hasProtectionInCart=!!a,1===this._cart.item_count&&a)return;!!sessionStorage.getItem(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(s=this._cart)?void 0:s.item_count)&&this._store.widgetShowCart&&await this.addProtection())}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 s=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)))&&s++})),s>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={id:(null==(r=this._cart)?void 0:r.items[t]).key,quantity:0},i=await this._fetch.post("/cart/change.js",e);return await this._handleRefresh(i)}}learnMorePopupTemplate(){return this.persistPopup&&(this._popup=this.shouldPersistPopup()),F`
796
796
  <shipaid-popup-learn-more
797
797
  ?active=${"learn-more"===this._popup}
798
798
  @close=${()=>{this.persistPopup&&localStorage.removeItem(`${he}`),this._popup=null}}
@@ -854,7 +854,7 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=g`
854
854
  </a>
855
855
  </div>
856
856
  </div>
857
- `}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}render(){return Tt(this,(async()=>{var t,e,i,o,r,s;const n=document.createElement("link");n.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),n.setAttribute("rel","stylesheet"),document.head.appendChild(n);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(a){return pe(a.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(re.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(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&await this.addProtection()))}),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==(s=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:s.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(le("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(le("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(le("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const s=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))})),n=null==(o=this._cart)?void 0:o.items[s];if(this._hasProtectionInCart=!!n,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&n&&(this._cart.total_price===n.final_line_price||!a)){const t={id:n.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return sessionStorage.removeItem(ce),await this._handleRefresh(e)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void pe("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!n)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==n?void 0:n.selling_plan_allocation))i={id:n.key,quantity:1,selling_plan:null};else if(t&&!(null==n?void 0:n.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:n.key,quantity:1,selling_plan:r}}if(i){const t=await this._fetch.post("/cart/change.js",i);await this._handleRefresh(t)}}if(d.id===n.variant_id){if(this._protectionCartItem={...n,index:s,position:s+1},1===n.quantity)return;const t={id:n.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return this._handleRefreshCart(),await this._handleRefresh(e)}const l={updates:{[n.variant_id]:0,[d.id]:1}},p=await this._fetch.post("/cart/update.js",l);await this._handleRefresh(p)}),[this._store,this._cart]),pt(this.learnMorePopupTemplate(),document.body),F`
857
+ `}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}render(){return Tt(this,(async()=>{var t,e,i,o,r,s;const n=document.createElement("link");n.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),n.setAttribute("rel","stylesheet"),document.head.appendChild(n);try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(a){return le(a.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(re.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(ce)||(sessionStorage.setItem(ce,JSON.stringify({loaded:!0})),!this._hasProtectionInCart&&(null==(o=this._cart)?void 0:o.item_count)&&this._store.widgetShowCart&&await this.addProtection()))}),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==(s=null==(r=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:r.widget)?void 0:s.pollVariantsCheck)&&setInterval((async()=>{await this.handleMultipleProtectionVariants()}),400)))):(pe("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(pe("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(pe("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),Tt(this,(async()=>{var t,i,o,r;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const s=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))})),n=null==(o=this._cart)?void 0:o.items[s];if(this._hasProtectionInCart=!!n,!this._store)return;const a=await this.calculateProtectionTotal(this._cart);if(this._cart.item_count>0&&n&&(this._cart.total_price===n.final_line_price||!a)){const t={id:n.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return sessionStorage.removeItem(ce),await this._handleRefresh(e)}const d=this._findProtectionVariant(a);if(a?(this._protectionVariant=d,this._shouldShowWidget=!0):this._protectionVariant={id:0,price:"0"},!(null==d?void 0:d.id))return this._shouldShowWidget=!1,void le("No matching protection variant found.");if(!(null==(r=this._protectionVariant)?void 0:r.id))return void(this._shouldShowWidget=!1);if(!n)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==n?void 0:n.selling_plan_allocation))i={id:n.key,quantity:1,selling_plan:null};else if(t&&!(null==n?void 0:n.selling_plan_allocation)){const o=await this._fetchSellingPlanFromVariant(t.selling_plan_allocation.selling_plan),r=o?e(o.id):null;i={id:n.key,quantity:1,selling_plan:r}}if(i){const t=await this._fetch.post("/cart/change.js",i);await this._handleRefresh(t)}}if(d.id===n.variant_id){if(this._protectionCartItem={...n,index:s,position:s+1},1===n.quantity)return;const t={id:n.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return this._handleRefreshCart(),await this._handleRefresh(e)}const p={updates:{[n.variant_id]:0,[d.id]:1}},l=await this._fetch.post("/cart/update.js",p);await this._handleRefresh(l)}),[this._store,this._cart]),lt(this.learnMorePopupTemplate(),document.body),F`
858
858
  <style>
859
859
  :host {
860
860
  --shipaid-primary: #002bd6;
@@ -1060,10 +1060,15 @@ function Ot(t,e,i){return t?e():null==i?void 0:i()}const Nt=g`
1060
1060
  width: 3px;
1061
1061
  height: 8px;
1062
1062
  border: solid white;
1063
- border-width: 0 3px 3px 0;
1063
+ border-width: 0 2.5px 2.5px 0;
1064
1064
  transform: rotate(45deg)
1065
1065
  }
1066
1066
 
1067
+ .shipaid-checkbox .shipaid-checkMark.left:after {
1068
+ left: 6px;
1069
+ top: 3px;
1070
+ }
1071
+
1067
1072
  .shipaid-checkMark.left {
1068
1073
  display: block;
1069
1074
  position: static;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.3.34",
4
+ "version": "0.3.36",
5
5
  "type": "module",
6
6
  "main": "dist/widget.umd.js",
7
7
  "unpkg": "dist/widget.iife.js",