ui.shipaid.com 0.2.11 → 0.2.13-beta

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.
@@ -3,51 +3,50 @@
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const e=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};
6
+ */const e=t=>e=>{return"function"==typeof e?(i=t,o=e,customElements.define(i,o),o):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){customElements.define(t,e)}}})(t,e);
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */function i(t){return(i,o)=>{return void 0!==o?(r=t,s=o,void i.constructor.createProperty(s,r)):e(t,i);var r,s}}
11
+ */var i,o},i=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function o(t){return(e,o)=>{return void 0!==o?(r=t,s=o,void e.constructor.createProperty(s,r)):i(t,e);var r,s}}
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
- */function o(t){return i({...t,state:!0})}
16
+ */function r(t){return o({...t,state:!0})}
17
17
  /**
18
18
  * @license
19
19
  * Copyright 2021 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */var r;null===(r=window.HTMLSlotElement)||void 0===r||r.prototype.assignedElements;
21
+ */var s;null===(s=window.HTMLSlotElement)||void 0===s||s.prototype.assignedElements;
22
22
  /**
23
23
  * @license
24
24
  * Copyright 2019 Google LLC
25
25
  * SPDX-License-Identifier: BSD-3-Clause
26
26
  */
27
- const s=window,n=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),p=new WeakMap;class l{constructor(t,e,i){if(this._$cssResult$=!0,i!==a)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(n&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=p.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&p.set(e,t))}return t}toString(){return this.cssText}}const d=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new l("string"==typeof t?t:t+"",void 0,a))(e)})(t):t
27
+ const n=window,a=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,p=Symbol(),l=new WeakMap;class d{constructor(t,e,i){if(this._$cssResult$=!0,i!==p)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(a&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=l.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&l.set(e,t))}return t}toString(){return this.cssText}}const h=(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 d(i,t,p)},c=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new d("string"==typeof t?t:t+"",void 0,p))(e)})(t):t
28
28
  /**
29
29
  * @license
30
30
  * Copyright 2017 Google LLC
31
31
  * SPDX-License-Identifier: BSD-3-Clause
32
- */;var h;const c=window,u=c.trustedTypes,f=u?u.emptyScript:"",v=c.reactiveElementPolyfillSupport,m={toAttribute(t,e){switch(e){case Boolean:t=t?f: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}},g=(t,e)=>e!==t&&(e==e||t==t),_={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:g};class C extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),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=_){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)||_}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),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(d(t))}else void 0!==t&&e.push(d(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}u(){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)=>{n?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=s.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=_){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:m).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:m;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||g)(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 u;const f=window,v=f.trustedTypes,m=v?v.emptyScript:"",g=f.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?m: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}},C=(t,e)=>e!==t&&(e==e||t==t),y={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:C};class w extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),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=y){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)||y}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),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(c(t))}else void 0!==t&&e.push(c(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}u(){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)=>{a?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=n.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=y){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:_).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:_;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||C)(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 y;C.finalized=!0,C.elementProperties=new Map,C.elementStyles=[],C.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:C}),(null!==(h=c.reactiveElementVersions)&&void 0!==h?h:c.reactiveElementVersions=[]).push("1.4.1");const w=window,$=w.trustedTypes,L=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,A=`lit$${(Math.random()+"").slice(9)}$`,S="?"+A,b=`<${S}>`,x=document,E=(t="")=>x.createComment(t),P=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,U=/>/g,z=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,N=/"/g,R=/^(?:script|style|textarea|title)$/i,I=(B=1,(t,...e)=>({_$litType$:B,strings:t,values:e})),W=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),j=new WeakMap,D=x.createTreeWalker(x,129,null,!1);var B;class F{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[p,l]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=M;for(let p=0;p<i;p++){const e=t[p];let i,a,l=-1,d=0;for(;d<e.length&&(n.lastIndex=d,a=n.exec(e),null!==a);)d=n.lastIndex,n===M?"!--"===a[1]?n=T:void 0!==a[1]?n=U:void 0!==a[2]?(R.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=z):void 0!==a[3]&&(n=z):n===z?">"===a[0]?(n=null!=r?r:M,l=-1):void 0===a[1]?l=-2:(l=n.lastIndex-a[2].length,i=a[1],n=void 0===a[3]?z:'"'===a[3]?N:O):n===N||n===O?n=z:n===T||n===U?n=M:(n=z,r=void 0);const h=n===z&&t[p+1].startsWith("/>")?" ":"";s+=n===M?e+b:l>=0?(o.push(i),e.slice(0,l)+"$lit$"+e.slice(l)+A+h):e+A+(-2===l?(o.push(void 0),p):h)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==L?L.createHTML(a):a,o]})(t,e);if(this.el=F.createElement(p,i),D.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=D.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(A)){const i=l[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(A),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?K:"?"===e[1]?G:"@"===e[1]?X:J})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(R.test(o.tagName)){const t=o.textContent.split(A),e=t.length-1;if(e>0){o.textContent=$?$.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],E()),D.nextNode(),a.push({type:2,index:++r});o.append(t[e],E())}}}else if(8===o.nodeType)if(o.data===S)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(A,t+1));)a.push({type:7,index:r}),t+=A.length-1}r++}}static createElement(t,e){const i=x.createElement("template");return i.innerHTML=t,i}}function Z(t,e,i=t,o){var r,s,n,a;if(e===W)return e;let p=void 0!==o?null===(r=i._$Cl)||void 0===r?void 0:r[o]:i._$Cu;const l=P(e)?void 0:e._$litDirective$;return(null==p?void 0:p.constructor)!==l&&(null===(s=null==p?void 0:p._$AO)||void 0===s||s.call(p,!1),void 0===l?p=void 0:(p=new l(t),p._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Cl)&&void 0!==n?n:a._$Cl=[])[o]=p:i._$Cu=p),void 0!==p&&(e=Z(t,p._$AS(t,e.values),p,o)),e}class q{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:x).importNode(i,!0);D.currentNode=r;let s=D.nextNode(),n=0,a=0,p=o[0];for(;void 0!==p;){if(n===p.index){let e;2===p.type?e=new V(s,s.nextSibling,this,t):1===p.type?e=new p.ctor(s,p.name,p.strings,this,t):6===p.type&&(e=new Q(s,this,t)),this.v.push(e),p=o[++a]}n!==(null==p?void 0:p.index)&&(s=D.nextNode(),n++)}return r}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class V{constructor(t,e,i,o){var r;this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$C_=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._$C_}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),P(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==W&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>k(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.O(t):this.$(t)}S(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}$(t){this._$AH!==H&&P(this._$AH)?this._$AA.nextSibling.data=t:this.k(x.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=F.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.m(i);else{const t=new q(r,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=j.get(t.strings);return void 0===e&&j.set(t.strings,e=new F(t)),e}O(t){k(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 V(this.S(E()),this.S(E()),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._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class J{constructor(t,e,i,o,r){this.type=1,this._$AH=H,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=H}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=Z(this,t,e,0),s=!P(t)||t!==this._$AH&&t!==W,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=Z(this,o[i+n],e,n),a===W&&(a=this._$AH[n]),s||(s=!P(a)||a!==this._$AH[n]),a===H?t=H:t!==H&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.P(t)}P(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class K extends J{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===H?void 0:t}}const Y=$?$.emptyScript:"";class G extends J{constructor(){super(...arguments),this.type=4}P(t){t&&t!==H?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class X extends J{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=Z(this,t,e,0))&&void 0!==i?i:H)===W)return;const o=this._$AH,r=t===H&&o!==H||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==H&&(o===H||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 Q{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){Z(this,t)}}const tt=w.litHtmlPolyfillSupport;
38
+ var $;w.finalized=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:w}),(null!==(u=f.reactiveElementVersions)&&void 0!==u?u:f.reactiveElementVersions=[]).push("1.4.1");const L=window,b=L.trustedTypes,A=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,S=`lit$${(Math.random()+"").slice(9)}$`,x="?"+S,E=`<${x}>`,P=document,k=(t="")=>P.createComment(t),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,z=/>/g,N=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),R=/'/g,I=/"/g,W=/^(?:script|style|textarea|title)$/i,j=(Z=1,(t,...e)=>({_$litType$:Z,strings:t,values:e})),H=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),B=new WeakMap,F=P.createTreeWalker(P,129,null,!1);var Z;class q{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[p,l]=((t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":"",n=U;for(let p=0;p<i;p++){const e=t[p];let i,a,l=-1,d=0;for(;d<e.length&&(n.lastIndex=d,a=n.exec(e),null!==a);)d=n.lastIndex,n===U?"!--"===a[1]?n=O:void 0!==a[1]?n=z:void 0!==a[2]?(W.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=N):void 0!==a[3]&&(n=N):n===N?">"===a[0]?(n=null!=r?r:U,l=-1):void 0===a[1]?l=-2:(l=n.lastIndex-a[2].length,i=a[1],n=void 0===a[3]?N:'"'===a[3]?I:R):n===I||n===R?n=N:n===O||n===z?n=U:(n=N,r=void 0);const h=n===N&&t[p+1].startsWith("/>")?" ":"";s+=n===U?e+E:l>=0?(o.push(i),e.slice(0,l)+"$lit$"+e.slice(l)+S+h):e+S+(-2===l?(o.push(void 0),p):h)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==A?A.createHTML(a):a,o]})(t,e);if(this.el=q.createElement(p,i),F.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=F.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(S)){const i=l[s++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(S),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?G:"?"===e[1]?Q:"@"===e[1]?tt:Y})}else a.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(W.test(o.tagName)){const t=o.textContent.split(S),e=t.length-1;if(e>0){o.textContent=b?b.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],k()),F.nextNode(),a.push({type:2,index:++r});o.append(t[e],k())}}}else if(8===o.nodeType)if(o.data===x)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(S,t+1));)a.push({type:7,index:r}),t+=S.length-1}r++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function V(t,e,i=t,o){var r,s,n,a;if(e===H)return e;let p=void 0!==o?null===(r=i._$Co)||void 0===r?void 0:r[o]:i._$Cl;const l=M(e)?void 0:e._$litDirective$;return(null==p?void 0:p.constructor)!==l&&(null===(s=null==p?void 0:p._$AO)||void 0===s||s.call(p,!1),void 0===l?p=void 0:(p=new l(t),p._$AT(t,i,o)),void 0!==o?(null!==(n=(a=i)._$Co)&&void 0!==n?n:a._$Co=[])[o]=p:i._$Cl=p),void 0!==p&&(e=V(t,p._$AS(t,e.values),p,o)),e}class J{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:P).importNode(i,!0);F.currentNode=r;let s=F.nextNode(),n=0,a=0,p=o[0];for(;void 0!==p;){if(n===p.index){let e;2===p.type?e=new K(s,s.nextSibling,this,t):1===p.type?e=new p.ctor(s,p.name,p.strings,this,t):6===p.type&&(e=new et(s,this,t)),this.u.push(e),p=o[++a]}n!==(null==p?void 0:p.index)&&(s=F.nextNode(),n++)}return r}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class K{constructor(t,e,i,o){var r;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cm=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._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=V(this,t,e),M(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==H&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>T(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==D&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=q.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.p(i);else{const t=new J(r,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new q(t)),e}k(t){T(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 K(this.O(k()),this.O(k()),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._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Y{constructor(t,e,i,o,r){this.type=1,this._$AH=D,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=D}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=V(this,t,e,0),s=!M(t)||t!==this._$AH&&t!==H,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=V(this,o[i+n],e,n),a===H&&(a=this._$AH[n]),s||(s=!M(a)||a!==this._$AH[n]),a===D?t=D:t!==D&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class G extends Y{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const X=b?b.emptyScript:"";class Q extends Y{constructor(){super(...arguments),this.type=4}j(t){t&&t!==D?this.element.setAttribute(this.name,X):this.element.removeAttribute(this.name)}}class tt extends Y{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=V(this,t,e,0))&&void 0!==i?i:D)===H)return;const o=this._$AH,r=t===D&&o!==D||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==D&&(o===D||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 et{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){V(this,t)}}const it=L.litHtmlPolyfillSupport;null==it||it(q,K),(null!==($=L.litHtmlVersions)&&void 0!==$?$:L.litHtmlVersions=[]).push("2.4.0");const ot=(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 K(e.insertBefore(k(),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
- */
44
- var et,it;null==tt||tt(F,V),(null!==(y=w.litHtmlVersions)&&void 0!==y?y:w.litHtmlVersions=[]).push("2.3.1");class ot extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=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._$Dt=((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 V(e.insertBefore(E(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return W}}ot.finalized=!0,ot._$litElement$=!0,null===(et=globalThis.litElementHydrateSupport)||void 0===et||et.call(globalThis,{LitElement:ot});const rt=globalThis.litElementPolyfillSupport;null==rt||rt({LitElement:ot}),(null!==(it=globalThis.litElementVersions)&&void 0!==it?it:globalThis.litElementVersions=[]).push("3.2.0");const st="__registered_effects";function nt(t){const e=t;if(e[st])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),o=i.updated;return e[st]={index:0,count:0,effects:[]},i.updated=t=>(e[st].index=0,o(t)),e}function at(t,e,i){const o=function(t,e){const i=nt(t),{index:o,count:r}=i[st];return o===r?(i[st].index++,i[st].count++,i[st].effects.push(e),e):(i[st].index++,i[st].effects[o])}(t,{on:e,observe:["__initial__dirty"]});o.observe.some(((t,e)=>i[e]!==t))&&o.on(),o.observe=i}
43
+ */var rt,st;class nt extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=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._$Dt=ot(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return H}}nt.finalized=!0,nt._$litElement$=!0,null===(rt=globalThis.litElementHydrateSupport)||void 0===rt||rt.call(globalThis,{LitElement:nt});const at=globalThis.litElementPolyfillSupport;null==at||at({LitElement:nt}),(null!==(st=globalThis.litElementVersions)&&void 0!==st?st:globalThis.litElementVersions=[]).push("3.2.0");const pt="__registered_effects";function lt(t){const e=t;if(e[pt])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),o=i.updated;return e[pt]={index:0,count:0,effects:[]},i.updated=t=>(e[pt].index=0,o(t)),e}function dt(t,e,i){const o=function(t,e){const i=lt(t),{index:o,count:r}=i[pt];return o===r?(i[pt].index++,i[pt].count++,i[pt].effects.push(e),e):(i[pt].index++,i[pt].effects[o])}(t,{on:e,observe:["__initial__dirty"]});o.observe.some(((t,e)=>i[e]!==t))&&o.on(),o.observe=i}
45
44
  /**
46
45
  * @license
47
46
  * Copyright 2021 Google LLC
48
47
  * SPDX-License-Identifier: BSD-3-Clause
49
48
  */
50
- function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((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 l(i,t,a)})`
49
+ function ht(t,e,i){return t?e():null==i?void 0:i()}const ct=h`
51
50
  :host {
52
51
  --shipaid-primary: #002bd6;
53
52
  --shipaid-secondary: #0076ff;
@@ -65,17 +64,13 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
65
64
  --shipaid-font-heavy: 700;
66
65
  }
67
66
 
68
- * {
67
+ p, a {
69
68
  font-family: var(--shipaid-font);
69
+ font-weight: var(--shipaid-font-regular);
70
+ font-size: var(--shipaid-font-base);
71
+ color: var(--shipaid-text);
70
72
  }
71
73
 
72
- .error {
73
- color: var(--shipaid-danger);
74
- font-size: var(--shipaid-font-sm);
75
- }
76
-
77
- /* Popups */
78
-
79
74
  .shipaid-popup {
80
75
  position: fixed;
81
76
  top: 0;
@@ -84,15 +79,20 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
84
79
  right: 0;
85
80
  margin: auto;
86
81
  max-width: 500px;
87
- max-height: 100vh;
82
+ max-height: 80vh;
88
83
  height: fit-content;
89
- border: var(--shipaid-light-grey) 1px solid;
90
- background-color: #fff;
84
+ border: var(--shipaid-popup-border, var(--shipaid-light-grey)) 1px solid;
85
+ background-color:var(--shipaid-popup-background, #fff);
91
86
  z-index: 10000;
92
87
  overflow: auto;
93
88
  visibility: hidden;
94
89
  opacity: 0;
95
90
  transition: all 250ms ease-in-out;
91
+
92
+ display: inline-flex;
93
+ flex-direction: column;
94
+ gap: 1rem;
95
+ padding: 5rem;
96
96
  }
97
97
 
98
98
  .shipaid-popup.active {
@@ -104,24 +104,11 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
104
104
  .shipaid-popup {
105
105
  width: 100vw;
106
106
  height: 100vh;
107
- }
108
- }
109
-
110
- .shipaid-popup .popup {
111
- display: inline-flex;
112
- flex-direction: column;
113
- gap: 1rem;
114
- padding: 5rem;
115
- height: fit-content;
116
- }
117
-
118
- @media (max-width: 600px) {
119
- .shipaid-popup .popup {
120
107
  padding: 3rem;
121
108
  }
122
109
  }
123
110
 
124
- .popup .popup-close {
111
+ .shipaid-popup .popup-close {
125
112
  width: fit-content;
126
113
  margin-left: auto;
127
114
  background-color: transparent;
@@ -132,26 +119,30 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
132
119
  text-transform: uppercase;
133
120
  }
134
121
 
135
- .popup .popup-title {
122
+ .shipaid-popup .popup-title {
136
123
  font-size: clamp(1rem, 2vw + 1rem, 2.2rem);
124
+ font-weight: var(--shipaid-font-regular);
137
125
  letter-spacing: 1px;
138
126
  }
139
127
 
140
- .popup .popup-top-image {
128
+ .shipaid-popup .popup-top-image {
141
129
  margin: 0 auto;
130
+ width: 90%;
131
+ height: auto;
132
+ object-fit: contain;
142
133
  }
143
134
 
144
- .popup p {
135
+ .shipaid-popup p {
145
136
  font-size: clamp(1rem, 1vw + 1rem, 1.4rem);
146
137
  margin: 0;
147
138
  }
148
139
 
149
- .popup .popup-disclaimer {
140
+ .shipaid-popup .popup-disclaimer {
150
141
  font-size: 10px;
151
142
  color: var(--shipaid-text-muted);
152
143
  }
153
144
 
154
- .popup .popup-footer {
145
+ .shipaid-popup .popup-footer {
155
146
  display: flex;
156
147
  flex-direction: row;
157
148
  justify-content: space-between;
@@ -160,38 +151,122 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
160
151
  }
161
152
 
162
153
  @media (max-width: 600px) {
163
- .popup .popup-footer {
154
+ .shipaid-popup .popup-footer {
164
155
  flex-direction: column;
165
156
  }
166
157
  }
167
158
 
168
- .popup .popup-footer .footer-links {
159
+ .shipaid-popup .popup-footer .footer-links {
169
160
  display: flex;
170
161
  flex-direction: row;
171
162
  gap: 2rem;
172
163
  }
173
164
 
174
- .popup .popup-footer .footer-links a {
165
+ .shipaid-popup .popup-footer .footer-links a {
175
166
  font-family: var(--shipaid-font);
176
167
  font-size: var(--shipaid-font-sm);
177
168
  color: var(--shipaid-text-muted);
178
169
  }
179
170
 
180
- .popup .popup-footer .footer-date p {
171
+ .shipaid-popup .popup-footer .footer-date p {
181
172
  font-family: var(--shipaid-font);
182
173
  font-weight: var(--shipaid-font-heavy);
183
174
  font-size: var(--shipaid-font-sm);
184
175
  color: var(--shipaid-text);
185
176
  }
177
+ `;var ut=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,vt=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?ft(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&&ut(e,i,s),s};let mt=class extends nt{constructor(){super(...arguments),this.active=!1}handleClosePopup(){const t=new Event("close");this.dispatchEvent(t)}render(){return j`
178
+ <div class=${`shipaid-popup ${this.active&&"active"}`}>
179
+ <button
180
+ type="button"
181
+ class="popup-close"
182
+ @click=${this.handleClosePopup}
183
+ >
184
+ Close
185
+ </button>
186
+ <p class="popup-title">Instant Package Protection</p>
187
+ <p>
188
+ We empower your favorite brands to protect their packages, because
189
+ every order is precious!
190
+ </p>
191
+ <img
192
+ src="https://res.cloudinary.com/dxyz34kfj/image/upload/v1660782754/shipaid-image_hoz6k8.jpg"
193
+ alt="shipaid protected parcel"
194
+ class="popup-top-image"
195
+ />
196
+ <p class="popup-title">Shop Worry-Free</p>
197
+ <p>
198
+ Brands and shipment carriers cannot always guarantee your order will
199
+ arrive at your doorstep safely. Things happen! We allow the brand
200
+ you are purchasing from to protect your order in the chance of an
201
+ issue in transit. If you encounter an issue, simply reach out to the
202
+ brand and they will handle your claim as soon as possible
203
+ </p>
204
+ <p class="popup-disclaimer">
205
+ By purchasing this protection, you are agreeing to our Terms Of
206
+ Service and Privacy Policy. You are not obligated to purchase this
207
+ protection. This protection is NOT insurance. The claim process and
208
+ decision for compensation are strictly decided by the brand you are
209
+ purchasing from in this transaction. Each claim will be reviewed by
210
+ their customer service team, and you'll get a response accepting
211
+ or denying the claim within 2-3 business days.
212
+ </p>
213
+ <div class="popup-footer">
214
+ <div class="footer-links">
215
+ <a
216
+ href="https://www.shipaid.com/terms-of-service"
217
+ target="_blank"
218
+ rel="noreferrer"
219
+ >Terms of Service</a
220
+ >
221
+ <a
222
+ href="https://www.shipaid.com/privacy-policy"
223
+ target="_blank"
224
+ rel="noreferrer"
225
+ >Privacy Policy</a
226
+ >
227
+ </div>
228
+ <div class="footer-date">
229
+ <p>ShipAid &copy; ${(new Date).getFullYear()}</p>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ `}};mt.styles=ct,vt([o({type:Boolean,attribute:!0})],mt.prototype,"active",2),mt=vt([e("shipaid-popup-learn-more")],mt);const gt=h`
234
+ :host {
235
+ --shipaid-primary: #002bd6;
236
+ --shipaid-secondary: #0076ff;
237
+ --shipaid-danger: #f44336;
238
+ --shipaid-text: #000000;
239
+ --shipaid-text-muted: #cccccc;
240
+ --shipaid-text-grey: #aaaaaa;
241
+ --shipaid-light-grey: #ebecf0;
242
+ --shipaid-font: "Lato", sans-serif;
243
+ --shipaid-font-xs: 12px;
244
+ --shipaid-font-sm: 14px;
245
+ --shipaid-font-base: 16px;
246
+ --shipaid-font-lg: 18px;
247
+ --shipaid-font-regular: 400;
248
+ --shipaid-font-heavy: 700;
249
+ }
250
+
251
+ * {
252
+ font-family: var(--shipaid-font);
253
+ }
254
+
255
+ p, a {
256
+ font-weight: var(--shipaid-font-regular);
257
+ font-size: var(--shipaid-font-base);
258
+ color: var(--shipaid-text);
259
+ }
186
260
 
187
- /* Widget */
261
+ .error {
262
+ color: var(--shipaid-danger);
263
+ font-size: var(--shipaid-font-sm);
264
+ }
188
265
 
266
+ /* Widget */
189
267
  .shipaid-prompt {
190
268
  width: 400px;
191
269
  max-width: 100%;
192
- font-family: var(--shipaid-font);
193
- font-size: var(--shipaid-font-base);
194
- color: var(--shipaid-text);
195
270
  display: flex;
196
271
  flex-direction: column;
197
272
  gap: 1rem;
@@ -254,7 +329,7 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
254
329
  .prompt-product
255
330
  .prompt-product-actions
256
331
  .prompt-product-actions-price {
257
- color: var(--shipaid-text-muted);
332
+ color: var(--prompt-actions-price-color, var(--shipaid-text-muted));
258
333
  font-size: var(--shipaid-font-base);
259
334
  }
260
335
  .shipaid-prompt
@@ -263,7 +338,7 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
263
338
  .prompt-product-actions-button {
264
339
  background-color: transparent;
265
340
  border: none;
266
- color: var(--shipaid-primary);
341
+ color: var(--prompt-actions-button-color, var(--shipaid-primary));
267
342
  text-transform: uppercase;
268
343
  font-weight: var(--shipaid-font-heavy);
269
344
  cursor: pointer;
@@ -287,8 +362,8 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
287
362
  margin-left: 0.5rem;
288
363
  }
289
364
  .shipaid-prompt .prompt-footer .prompt-footer-badge {
290
- background-color: var(--shipaid-light-grey);
291
- color: var(--shipaid-text);
365
+ background-color: var(--shipaid-prompt-badge-background, var(--shipaid-light-grey));
366
+ color: var(--shipaid-prompt-badge-text, var(--shipaid-text));
292
367
  padding: 0.5rem 1.5rem;
293
368
  border-radius: 30px;
294
369
  cursor: pointer;
@@ -301,24 +376,14 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
301
376
  .shipaid-prompt .prompt-footer .prompt-footer-badge svg {
302
377
  height: 9px;
303
378
  }
304
- .shipaid-prompt .prompt-footer .prompt-footer-badge .ship {
305
- text-transform: uppercase;
306
- color: var(--shipaid-secondary);
307
- font-weight: var(--shipaid-font-heavy);
308
- }
309
- .shipaid-prompt .prompt-footer .prompt-footer-badge .aid {
310
- text-transform: uppercase;
311
- color: var(--shipaid-text-grey);
312
- font-weight: var(--shipaid-font-heavy);
313
- }
314
- `,dt=I`
379
+ `,_t=j`
315
380
  <svg viewBox="0 0 453 511" version="1.1" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
316
381
  <g transform="matrix(1,0,0,1,-29.4375,-0.984384)">
317
382
  <path d="M468.297,67.385L262.417,2C258.177,0.646 253.63,0.646 249.391,2L43.51,67.385C35.188,69.708 29.438,77.318 29.438,85.979C32.302,157.156 52.266,370.036 52.266,370.036C52.906,378.188 57.297,385.568 64.167,390.01L248.807,509.156C253.12,511.943 258.688,511.943 263.005,509.156L447.641,390.01C454.51,385.568 458.901,378.188 459.542,370.036C459.542,370.036 479.51,157.156 482.37,85.979C482.37,77.318 476.625,69.708 468.297,67.385" style="fill:rgb(47,52,61);fill-rule:nonzero;"/>
318
383
  <path d="M256.01,120.969C286.193,120.969 314.057,130.87 336.536,147.604L309.406,174.656C294.073,164.573 275.729,158.708 256.01,158.708C229.141,158.708 204.823,169.604 187.214,187.198C169.615,204.797 158.719,229.125 158.719,255.995C158.719,282.865 169.615,307.182 187.214,324.792C204.813,342.406 229.141,353.286 256.01,353.286C282.88,353.286 307.208,342.406 324.807,324.792C342.406,307.193 353.297,282.865 353.297,255.995C353.297,251.818 353.036,247.719 352.526,243.688L383.859,212.458C388.51,226.115 391.036,240.766 391.036,255.995C391.036,293.286 375.927,327.047 351.49,351.479C327.057,375.911 293.302,391.021 256.01,391.021C218.729,391.021 184.964,375.911 160.526,351.479C136.094,327.047 120.984,293.286 120.984,255.995C120.984,218.719 136.094,184.948 160.526,160.516C184.964,136.083 218.719,120.969 256.01,120.969ZM218.141,220.906L253.615,259.729L354.844,158.813L381.375,185.484L252.396,314.068L190.422,246.255L218.13,220.906L218.141,220.906Z" style="fill:white;fill-rule:nonzero;"/>
319
384
  </g>
320
385
  </svg>
321
- `,ht=I`
386
+ `,Ct=j`
322
387
  <svg
323
388
  viewBox="0 0 384 383.999986"
324
389
  preserveAspectRatio="xMidYMid meet"
@@ -360,7 +425,7 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
360
425
  />
361
426
  </g>
362
427
  </svg>
363
- `,ct=I`
428
+ `,yt=j`
364
429
  <svg
365
430
  viewBox="0 0 423 62"
366
431
  version="1.1"
@@ -442,69 +507,13 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
442
507
  />
443
508
  </g>
444
509
  </svg>
445
- `;var ut=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(ut||{}),ft=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,mt=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?vt(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&&ft(e,i,s),s};const gt=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.")}},_t=t=>console.warn(`[ShipAid] ${t}`),Ct=t=>console.error(`[ShipAid] ${t}`),yt="shipaid-protection";var wt;t.ShipAidWidget=class extends ot{constructor(){var t;super(...arguments),this.disablePolling=!1,this.pollingInterval=2500,this.disableRefresh=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=null==(t=window.Shopify)?void 0:t.shop,this._hasFinishedSetup=!1,this._shouldShowWidget=!0,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>gt(t),post:(t,e)=>gt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}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")?(_t("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,s;return new Intl.NumberFormat(null!=(i=null==(e=window.Shopify)?void 0:e.locale)?i:void 0,{currency:(null==(o=this._store)?void 0:o.currency)||(null==(s=null==(r=window.Shopify)?void 0:r.currency)?void 0:s.active)||"USD",style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(ut.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){var e,i,o,r,s;if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing store settings.");const n=null==(e=this._store)?void 0:e.protectionSettings;if(!n||!this._protectionProduct)throw new Error("Tried to find protection variant, but protection settings for this store are missing.");const a=((null==(i=this._store)?void 0:i.excludedProductSkus)&&t.items?t.items.reduce(((t,e)=>{if(!e.sku)return t;return this._store.excludedProductSkus.find((t=>t===e.sku))?t-e.final_price:t}),t.total_price):t.total_price)-(null!=(r=null==(o=t.items)?void 0:o.filter((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))})))?r:[]).reduce(((t,e)=>t+=e.final_line_price),0);if("FIXED"===n.protectionType){if(!n.defaultFee)throw new Error("Missing default fee amount.");if(!(null==(s=n.rules)?void 0:s.length))return n.defaultFee;const t=a/100,e=n.rules.sort(((t,e)=>t.rangeLower&&e.rangeLower?t.rangeLower-e.rangeLower:0)).find((e=>{const i=Boolean(e.rangeLower&&e.rangeLower<t);return e.rangeUpper?i&&e.rangeUpper>=t:i}));return"number"==typeof(null==e?void 0:e.fee)?e.fee:n.defaultFee}if("PERCENTAGE"===n.protectionType){const t=a*n.percentage/100;return t>=n.minimumFee?t:n.minimumFee}throw new Error("No protection type handler found for this store.")}_findProtectionVariant(t){var e,i,o,r;if(!(null==(e=this._store)?void 0:e.protectionSettings)||!(null==(o=null==(i=this._protectionProduct)?void 0:i.variants)?void 0:o.length))throw new Error("Missing product and variants from protection settings.");const s=null==(r=this._protectionProduct)?void 0:r.variants.flatMap((t=>{if(!t||!t.price)return[];const e=Number(t.price);return[{...t,formattedPrice:e}]})).sort(((t,e)=>t.formattedPrice-e.formattedPrice)),n=s.find((e=>e.formattedPrice>=t));return n||s[s.length-1]}_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;const o=null==(t=window.Shopify)?void 0:t.shop;if(!o)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const r={query:"query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetShowCart\n excludedProductSkus\n protectionSettings\n }\n}",variables:{store:o}},s=await this._fetch.post(t.toString(),r);if(!s)throw new Error("Missing response for store query.");if(null==(e=s.errors)?void 0:e.length)throw new Error(s.errors[0].message);if(!(null==(i=s.data)?void 0:i.store))throw new Error("Missing store from store query response.");return s.data.store}catch(r){throw console.error(r),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw Ct(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 Ct(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,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i={quantity:1,id:this._protectionVariant.id},o=await this._fetch.post("/cart/add.js",i);await this._handleRefresh(o),this._lastAction="added",this._setState("success")}catch(i){Ct(i.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}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._lastAction="removed",this._cart=e,this._setState("success")}catch(t){Ct(t.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}render(){var t;at(this,(async()=>{var t,e;const i=document.createElement("link");i.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),i.setAttribute("rel","stylesheet"),document.head.appendChild(i);try{const t=sessionStorage.getItem(yt),{lastAction:e}=t?JSON.parse(t):{};e&&(this._lastAction=e)}catch(o){_t("Failed to parse local storage.")}try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(o){return 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._shouldShowWidget=!0,this._dispatchEvent(ut.LOADED,this._store),setTimeout((async()=>{var t,e;const i=sessionStorage.getItem(yt),{lastAction:o}=i?JSON.parse(i):{};"removed"!==o&&!this._hasProtectionInCart&&(null==(t=this._cart)?void 0:t.item_count)&&(null==(e=this._store)?void 0:e.widgetAutoOptIn)&&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))):(_t("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(_t("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(_t("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),at(this,(()=>{const t={hasProtection:this._hasProtectionInCart,lastAction:this._lastAction};sessionStorage.setItem(yt,JSON.stringify(t))}),[this._lastAction]),at(this,(async()=>{var t,e,i;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const o=null==(e=this._cart.items)?void 0:e.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))})),r=null==(i=this._cart)?void 0:i.items[o];if(this._hasProtectionInCart=!!r,1===this._cart.item_count&&r){const t={id:r.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return await this._handleRefresh(e)}const s=await this.calculateProtectionTotal(this._cart),n=this._findProtectionVariant(s);if(this._protectionVariant=n,!(null==n?void 0:n.id))return this._shouldShowWidget=!1,void Ct("No matching protection variant found.");if(!r)return;if(n.id===r.id){if(this._protectionCartItem={...r,index:o,position:o+1},1===r.quantity)return;const t={id:r.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return await this._handleRefresh(e)}const a={id:r.key,quantity:0};await this._fetch.post("/cart/change.js",a);const p={quantity:1,id:n.id},l=await this._fetch.post("/cart/add.js",p);await this._handleRefresh(l)}),[this._store,this._cart]);const e=I`
446
- <div class=${`shipaid-popup ${"learn-more"===this._popup&&"active"}`}>
447
- <div class="popup">
448
- <button
449
- class="popup-close"
450
- @click=${()=>{this._popup=null}}
451
- >
452
- Close
453
- </button>
454
- <p class="popup-title">Instant Package Protection</p>
455
- <p>
456
- We empower your favorite brands to protect their packages, because
457
- every order is precious!
458
- </p>
459
- <img
460
- src="https://res.cloudinary.com/dxyz34kfj/image/upload/v1660782754/shipaid-image_hoz6k8.jpg"
461
- alt="shipaid protected parcel"
462
- height="auto"
463
- width="90%"
464
- class="popup-top-image"
465
- />
466
- <p class="popup-title">Shop Worry-Free</p>
467
- <p>
468
- Brands and shipment carriers cannot always guarantee your order will
469
- arrive at your doorstep safely. Things happen! We allow the brand
470
- you are purchasing from to protect your order in the chance of an
471
- issue in transit. If you encounter an issue, simply reach out to the
472
- brand and they will handle your claim as soon as possible
473
- </p>
474
- <p class="popup-disclaimer">
475
- By purchasing this protection, you are agreeing to our Terms Of
476
- Service and Privacy Policy. You are not obligated to purchase this
477
- protection. This protection is NOT insurance. Purchasing this
478
- protection does not guarantee you will be reimbursed for any product
479
- or shipping costs. The claim process and decision for compensation
480
- is strictly decided by the brand you a purchasing from.
481
- </p>
482
- <div class="popup-footer">
483
- <div class="footer-links">
484
- <a
485
- href="https://www.shipaid.com/terms-of-service"
486
- target="_blank"
487
- rel="noreferrer"
488
- >Terms of Service</a
489
- >
490
- <a
491
- href="https://www.shipaid.com/privacy-policy"
492
- target="_blank"
493
- rel="noreferrer"
494
- >Privacy Policy</a
495
- >
496
- </div>
497
- <div class="footer-date">
498
- <p>ShipAid &copy; ${(new Date).getFullYear()}</p>
499
- </div>
500
- </div>
501
- </div>
502
- </div>
503
- `,i=I`
510
+ `;var wt=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(wt||{}),$t=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,bt=(t,e,i,o)=>{for(var r,s=o>1?void 0:o?Lt(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&&$t(e,i,s),s};const At=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.")}},St=t=>console.warn(`[ShipAid] ${t}`),xt=t=>console.error(`[ShipAid] ${t}`),Et="shipaid-protection";t.ShipAidWidget=class extends nt{constructor(){var t;super(...arguments),this.disablePolling=!1,this.pollingInterval=2500,this.disableRefresh=!1,this._apiEndpoint="/apps/shipaid",this._storeDomain=null==(t=window.Shopify)?void 0:t.shop,this._hasFinishedSetup=!1,this._shouldShowWidget=!0,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._popup=null,this._fetch={get:t=>At(t),post:(t,e)=>At(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}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")?(St("Currently in preview mode."),!0):!!(null==(e=this._store)?void 0:e.planActive)}_currencyFormat(t){var e,i,o,r,s;return new Intl.NumberFormat(null!=(i=null==(e=window.Shopify)?void 0:e.locale)?i:void 0,{currency:(null==(o=this._store)?void 0:o.currency)||(null==(s=null==(r=window.Shopify)?void 0:r.currency)?void 0:s.active)||"USD",style:"currency"}).format(Number(t))}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}async _handleRefresh(t){const e=Reflect.has(t,"items");if(this.shouldRefreshOnUpdate)return window.location.reload();e||await this.updateCart(),this._dispatchEvent(wt.STATUS_UPDATE,{protection:this._hasProtectionInCart,cart:e?t:this._cart,lineItem:e?this._protectionCartItem:t})}async calculateProtectionTotal(t){var e,i,o,r,s;if(t||(t=await this._fetchCart()),!t)throw new Error("Could not fetch cart.");if(!this._store)throw new Error("Missing store settings.");const n=null==(e=this._store)?void 0:e.protectionSettings;if(!n||!this._protectionProduct)throw new Error("Tried to find protection variant, but protection settings for this store are missing.");const a=((null==(i=this._store)?void 0:i.excludedProductSkus)&&t.items?t.items.reduce(((t,e)=>{if(!e.sku)return t;return this._store.excludedProductSkus.find((t=>t===e.sku))?t-e.final_price:t}),t.total_price):t.total_price)-(null!=(r=null==(o=t.items)?void 0:o.filter((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))})))?r:[]).reduce(((t,e)=>t+=e.final_line_price),0);if("FIXED"===n.protectionType){if(!n.defaultFee)throw new Error("Missing default fee amount.");if(!(null==(s=n.rules)?void 0:s.length))return n.defaultFee;const t=a/100,e=n.rules.sort(((t,e)=>t.rangeLower&&e.rangeLower?t.rangeLower-e.rangeLower:0)).find((e=>{const i=Boolean(e.rangeLower&&e.rangeLower<t);return e.rangeUpper?i&&e.rangeUpper>=t:i}));return"number"==typeof(null==e?void 0:e.fee)?e.fee:n.defaultFee}if("PERCENTAGE"===n.protectionType){const t=a*n.percentage/100;return t>=n.minimumFee?t:n.minimumFee}throw new Error("No protection type handler found for this store.")}_findProtectionVariant(t){var e,i,o,r;if(!(null==(e=this._store)?void 0:e.protectionSettings)||!(null==(o=null==(i=this._protectionProduct)?void 0:i.variants)?void 0:o.length))throw new Error("Missing product and variants from protection settings.");const s=null==(r=this._protectionProduct)?void 0:r.variants.flatMap((t=>{if(!t||!t.price)return[];const e=Number(t.price);return[{...t,formattedPrice:e}]})).sort(((t,e)=>t.formattedPrice-e.formattedPrice)),n=s.find((e=>e.formattedPrice>=t));return n||s[s.length-1]}_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;const o=null==(t=window.Shopify)?void 0:t.shop;if(!o)throw new Error("No shop found in Shopify object.");try{const t=new URL(window.location.href);t.pathname=this._apiEndpoint;const r={query:"query StoreByDomain ($store: String!) {\n store: storeByDomain (input: {store: $store}) {\n currency\n planActive\n store\n widgetAutoOptIn\n widgetShowCart\n excludedProductSkus\n protectionSettings\n }\n}",variables:{store:o}},s=await this._fetch.post(t.toString(),r);if(!s)throw new Error("Missing response for store query.");if(null==(e=s.errors)?void 0:e.length)throw new Error(s.errors[0].message);if(!(null==(i=s.data)?void 0:i.store))throw new Error("Missing store from store query response.");return s.data.store}catch(r){throw console.error(r),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(t){throw xt(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 xt(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,e;try{if(!this._store)throw new Error("Store has not been loaded.");if(!(null==(t=this._cart)?void 0:t.items))throw new Error("Cart has not been loaded.");if(!(null==(e=this._protectionVariant)?void 0:e.id))throw new Error("No protection variant found.");this._setState("loading");const i={quantity:1,id:this._protectionVariant.id},o=await this._fetch.post("/cart/add.js",i);await this._handleRefresh(o),this._lastAction="added",this._setState("success")}catch(i){xt(i.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}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._lastAction="removed",this._cart=e,this._setState("success")}catch(t){xt(t.message),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}learnMorePopupTemplate(){return j`
511
+ <shipaid-popup-learn-more ?active=${"learn-more"===this._popup} @close=${()=>{this._popup=null}}></shipaid-popup-learn-more>
512
+ `}promptTemplate(){var t;return j`
504
513
  <div class="shipaid-prompt">
505
514
  <div class="prompt-product">
506
515
  <div class="prompt-product-image">
507
- ${pt(this._hasProtectionInCart,(()=>dt),(()=>ht))}
516
+ ${ht(this._hasProtectionInCart,(()=>_t),(()=>Ct))}
508
517
  </div>
509
518
  <div class="prompt-product-details">
510
519
  <p class="prompt-product-details-title">
@@ -527,14 +536,14 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
527
536
  </button>
528
537
  </div>
529
538
  </div>
530
- ${pt(this._state.error,(()=>I`<p class="error">${this._state.error}</p>`))}
539
+ ${ht(this._state.error,(()=>j`<p class="error">${this._state.error}</p>`))}
531
540
  <div class="prompt-footer">
532
541
  <a
533
542
  class="prompt-footer-badge"
534
543
  @click=${()=>{this._popup="learn-more"}}
535
544
  >
536
545
  <span>Powered by</span>
537
- ${ct}
546
+ ${yt}
538
547
  </a>
539
548
  <button
540
549
  class="prompt-footer-about"
@@ -544,8 +553,8 @@ function pt(t,e,i){return t?e():null==i?void 0:i()}const lt=((t,...e)=>{const i=
544
553
  </button>
545
554
  </div>
546
555
  </div>
547
- `;return I`
556
+ `}render(){return dt(this,(async()=>{var t,e;const i=document.createElement("link");i.setAttribute("href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),i.setAttribute("rel","stylesheet"),document.head.appendChild(i);try{const t=sessionStorage.getItem(Et),{lastAction:e}=t?JSON.parse(t):{};e&&(this._lastAction=e)}catch(o){St("Failed to parse local storage.")}try{const[t,e,i]=await Promise.all([this._fetchShipAidData(),this._fetchCart(),this._fetchProduct()]);this._store=t,this._cart=e,this._protectionProduct=i}catch(o){return 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._shouldShowWidget=!0,this._dispatchEvent(wt.LOADED,this._store),setTimeout((async()=>{var t,e;const i=sessionStorage.getItem(Et),{lastAction:o}=i?JSON.parse(i):{};"removed"!==o&&!this._hasProtectionInCart&&(null==(t=this._cart)?void 0:t.item_count)&&(null==(e=this._store)?void 0:e.widgetAutoOptIn)&&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))):(St("No protection settings product for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(St("No protection settings for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1)):(St("No plan is active for this store - skipping setup."),this._hasFinishedSetup=!0,void(this._shouldShowWidget=!1))}),[]),dt(this,(()=>{const t={hasProtection:this._hasProtectionInCart,lastAction:this._lastAction};sessionStorage.setItem(Et,JSON.stringify(t))}),[this._lastAction]),dt(this,(async()=>{var t,e,i;if(this._cartLastUpdated=new Date,!(null==(t=this._cart)?void 0:t.items))return;const o=null==(e=this._cart.items)?void 0:e.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))})),r=null==(i=this._cart)?void 0:i.items[o];if(this._hasProtectionInCart=!!r,1===this._cart.item_count&&r){const t={id:r.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);return await this._handleRefresh(e)}const s=await this.calculateProtectionTotal(this._cart),n=this._findProtectionVariant(s);if(this._protectionVariant=n,!(null==n?void 0:n.id))return this._shouldShowWidget=!1,void xt("No matching protection variant found.");if(!r)return;if(n.id===r.id){if(this._protectionCartItem={...r,index:o,position:o+1},1===r.quantity)return;const t={id:r.key,quantity:1},e=await this._fetch.post("/cart/change.js",t);return await this._handleRefresh(e)}const a={id:r.key,quantity:0};await this._fetch.post("/cart/change.js",a);const p={quantity:1,id:n.id},l=await this._fetch.post("/cart/add.js",p);await this._handleRefresh(l)}),[this._store,this._cart]),ot(this.learnMorePopupTemplate(),document.body),j`
548
557
  <div class="shipaid">
549
- ${pt(this._hasFinishedSetup,(()=>{var t;return pt(this._shouldShowWidget&&this.planActive&&(null==(t=this._store)?void 0:t.widgetShowCart),(()=>[e,i]),(()=>I``))}),(()=>I`<p><slot name="loading" default>Loading ShipAid Widget...</slot></p>`))}
558
+ ${ht(this._hasFinishedSetup,(()=>{var t;return ht(this._shouldShowWidget&&this.planActive&&(null==(t=this._store)?void 0:t.widgetShowCart),(()=>this.promptTemplate()),(()=>D))}),(()=>j`<p><slot name="loading" default>Loading ShipAid Widget...</slot></p>`))}
550
559
  </div>
551
- `}},t.ShipAidWidget.styles=lt,mt([i({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disablePolling",2),mt([i({type:Number,attribute:!0})],t.ShipAidWidget.prototype,"pollingInterval",2),mt([i({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disableRefresh",2),mt([o()],t.ShipAidWidget.prototype,"_storeDomain",2),mt([o()],t.ShipAidWidget.prototype,"_store",2),mt([o()],t.ShipAidWidget.prototype,"_cart",2),mt([o()],t.ShipAidWidget.prototype,"_protectionProduct",2),mt([o()],t.ShipAidWidget.prototype,"_cartLastUpdated",2),mt([o()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),mt([o()],t.ShipAidWidget.prototype,"_shouldShowWidget",2),mt([o()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),mt([o()],t.ShipAidWidget.prototype,"_lastAction",2),mt([o()],t.ShipAidWidget.prototype,"_protectionCartItem",2),mt([o()],t.ShipAidWidget.prototype,"_protectionVariant",2),mt([o()],t.ShipAidWidget.prototype,"_state",2),mt([o()],t.ShipAidWidget.prototype,"_popup",2),t.ShipAidWidget=mt([(wt="shipaid-widget",t=>{return"function"==typeof t?(e=wt,i=t,customElements.define(e,i),i):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){customElements.define(t,e)}}})(wt,t);var e,i})],t.ShipAidWidget),Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
560
+ `}},t.ShipAidWidget.styles=gt,bt([o({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disablePolling",2),bt([o({type:Number,attribute:!0})],t.ShipAidWidget.prototype,"pollingInterval",2),bt([o({type:Boolean,attribute:!0})],t.ShipAidWidget.prototype,"disableRefresh",2),bt([r()],t.ShipAidWidget.prototype,"_storeDomain",2),bt([r()],t.ShipAidWidget.prototype,"_store",2),bt([r()],t.ShipAidWidget.prototype,"_cart",2),bt([r()],t.ShipAidWidget.prototype,"_protectionProduct",2),bt([r()],t.ShipAidWidget.prototype,"_cartLastUpdated",2),bt([r()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),bt([r()],t.ShipAidWidget.prototype,"_shouldShowWidget",2),bt([r()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),bt([r()],t.ShipAidWidget.prototype,"_lastAction",2),bt([r()],t.ShipAidWidget.prototype,"_protectionCartItem",2),bt([r()],t.ShipAidWidget.prototype,"_protectionVariant",2),bt([r()],t.ShipAidWidget.prototype,"_state",2),bt([r()],t.ShipAidWidget.prototype,"_popup",2),t.ShipAidWidget=bt([e("shipaid-widget")],t.ShipAidWidget),Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit';
2
+ declare class LearnMorePopup extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ active: boolean;
5
+ handleClosePopup(): void;
6
+ render(): import("lit").TemplateResult<1>;
7
+ }
8
+ export default LearnMorePopup;
@@ -0,0 +1,2 @@
1
+ declare const styles: import("lit").CSSResult;
2
+ export default styles;
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import './components/learn-more-popup';
2
3
  import type { ShopifyCart } from '../types/shopify';
3
4
  /**
4
5
  * ShipAid Widget.
@@ -80,6 +81,9 @@ export declare class ShipAidWidget extends LitElement {
80
81
  addProtection(): Promise<void>;
81
82
  /** Remove ShipAid shipping protection. */
82
83
  removeProtection(): Promise<void>;
84
+ /** Templates */
85
+ learnMorePopupTemplate(): import("lit").TemplateResult<1>;
86
+ promptTemplate(): import("lit").TemplateResult<1>;
83
87
  render(): import("lit").TemplateResult<1>;
84
88
  }
85
89
  declare global {