(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".sb__typography{margin:0;font-size:20px;line-height:1.5;letter-spacing:.00938em;text-align:center;font-family:Roboto,Helvetica,Arial,sans-serif;font-weight:200;color:#2e5eab}.sb__dialog hr{margin:0;flex-shrink:0;border-width:0;border-style:solid;border-color:#0000001f;border-bottom-width:thin}.sb__dialog{position:fixed;z-index:1300;right:0;bottom:0;top:0;left:0;z-index:2147483647;transition:opacity 2.25s cubic-bezier(0,0,.2,1) 0ms}.sb__dialog-backdrop{opacity:1;transition:opacity 225ms cubic-bezier(.4,0,.2,1) 0ms;position:fixed;display:flex;align-items:center;justify-content:center;right:0;bottom:0;top:0;left:0;background-color:#00000080;z-index:-1}.sb__dialog-container{transform:none;transition:opacity 2.25s cubic-bezier(0,0,.2,1) 0ms;height:100%;outline:0;display:flex;justify-content:center;align-items:center}.sb__dialog-wrapper{background-color:#fff;color:#000000de;transition:box-shadow .3s cubic-bezier(.4,0,.2,1) 10s;border-radius:4px;box-shadow:0 11px 15px -7px #0003,0 24px 38px 3px #00000024,0 9px 46px 8px #0000001f;margin:32px;position:relative;overflow-y:auto;display:flex;flex-direction:column;max-height:calc(100% - 64px);max-width:600px}.sb__dialog-close{display:inline-flex;align-items:center;justify-content:center;position:relative;box-sizing:border-box;background-color:transparent;outline:0;border:0;margin:0;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle;text-decoration:none;color:inherit;text-align:center;flex:0 0 auto;font-size:1.5rem;padding:8px;border-radius:50%;overflow:visible;color:#0000008a;transition:background-color .15s cubic-bezier(.4,0,.2,1) 0ms;position:absolute;z-index:2147483647;top:4px;right:4px}.sb__dialog-content{flex:1 1 auto;overflow-y:auto;padding:32px 32px 16px;background-size:cover}.sb__dialog-footer{display:flex;flex-direction:row;padding:8px 16px}.sb__dialog-link{margin:0 24px 0 0;font:inherit;color:#595959;text-decoration:none;font-family:Roboto,Helvetica,Arial,sans-serif;font-weight:400;font-size:.75rem;line-height:1.66;letter-spacing:.03333em;font-size:12px}.sb__dialog-carbon-card{background-color:#fff;color:#000000de;transition:box-shadow .3s cubic-bezier(.4,0,.2,1) 0ms;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f;overflow:hidden;background-color:#76cb75;color:#fff;border-radius:32px;padding:24px}.sb__dialog-container .sb__stack{width:auto}.sb__typography.sb__primary{font-size:32px;color:#fff;white-space:break-spaces;letter-spacing:.1rem;line-height:1}.sb__point .sb__typography.sb__secondary{margin-left:8px;letter-spacing:.1rem;font-size:24px;line-height:1;color:#fff;white-space:break-spaces;text-align:left}.sb__dialog-image-container{margin-left:0;width:auto;padding:0}.sb__dialog-points-container,.sb__dialog-points-container *{justify-content:center;width:auto;padding-left:0;padding-right:0}.sb__dialog-image-connector{color:#fff;font-size:40px;font-weight:600}@media screen and (max-width:550px){.sb__dialog-container .sb__typography.sb__secondary{padding:0!important;font-size:18px!important}}@media screen and (max-width:500px){.sb__dialog-content .sb__typography.sb__primary{font-size:26px}.sb__dialog-content .sb__point-image{height:20px;width:20px}.sb__dialog-link{margin-right:0;text-align:center}.sb__dialog-footer{justify-content:space-evenly}.sb__dialog-container .sb__typography.sb__secondary{padding:0!important;font-size:14px!important}.sb__dialog-content .sb__stack.column .sb__stack.row .sb__stack.column{margin-left:16px}.sb__dialog-image-connector{margin:0 16px!important}.sb__dialog-image-container{height:70px;width:70px}}@media screen and (max-width:430px){.sb__dialog-points-container{margin-right:0!important}}@media screen and (max-width:410px){.sb__dialog-link{font-size:11px}.sb__dialog-container .sb__typography.sb__secondary{padding:0!important;font-size:12px!important}.sb__checkbox-label{margin-left:8px}}@media screen and (max-width:375px){.sb__dialog-content .sb__stack.column :nth-child(4){margin-left:25%;justify-content:flex-start}}@media screen and (max-width:347px){.sb__dialog-content .sb__stack.column .sb__stack.row .sb__stack.column{margin-left:0}}.sb__dialog-content p.sb__typography.sb__secondary{margin-left:0!important}.sb__stack{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.sb__stack.row{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;align-items:center;padding:0}.sb__stack>:not(style):not(style){margin:0}.sb__stack.column>:not(style)~:not(style){margin-top:32px}.sb__stack.row>:not(style)~:not(style){margin-left:32px}.sb__stack>.spacing-0{margin-left:0;margin-top:0}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
(function(B){typeof define=="function"&&define.amd?define(B):B()})(function(){"use strict";var Tn=Object.defineProperty;var $n=(B,h,j)=>h in B?Tn(B,h,{enumerable:!0,configurable:!0,writable:!0,value:j}):B[h]=j;var Te=(B,h,j)=>$n(B,typeof h!="symbol"?h+"":h,j);var B,h,j,q,$e,Ie,Ae,De,_e,de,ue,Oe,G={},Re=[],Ct=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Z=Array.isArray;function H(e,t){for(var n in t)e[n]=t[n];return e}function fe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Q(e,t,n){var o,r,i,s={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?B.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]==null&&(s[i]=e.defaultProps[i]);return oe(e,s,o,r,null)}function oe(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++j,__i:-1,__u:0};return r==null&&h.vnode!=null&&h.vnode(i),i}function O(e){return e.children}function U(e,t){this.props=e,this.context=t}function J(e,t){if(t==null)return e.__?J(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?J(e):null}function Le(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Le(e)}}function pe(e){(!e.__d&&(e.__d=!0)&&q.push(e)&&!re.__r++||$e!=h.debounceRendering)&&(($e=h.debounceRendering)||Ie)(re)}function re(){for(var e,t,n,o,r,i,s,a=1;q.length;)q.length>a&&q.sort(Ae),e=q.shift(),a=q.length,e.__d&&(n=void 0,r=(o=(t=e).__v).__e,i=[],s=[],t.__P&&((n=H({},o)).__v=o.__v+1,h.vnode&&h.vnode(n),he(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[r]:null,i,r??J(o),!!(32&o.__u),s),n.__v=o.__v,n.__.__k[n.__i]=n,ze(i,n,s),n.__e!=r&&Le(n)));re.__r=0}function He(e,t,n,o,r,i,s,a,d,l,u){var c,p,f,y,S,k,v=o&&o.__k||Re,g=t.length;for(d=Nt(n,t,v,d,g),c=0;c<g;c++)(f=n.__k[c])!=null&&(p=f.__i==-1?G:v[f.__i]||G,f.__i=c,k=he(e,f,p,r,i,s,a,d,l,u),y=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&ve(p.ref,null,f),u.push(f.ref,f.__c||y,f)),S==null&&y!=null&&(S=y),4&f.__u||p.__k===f.__k?d=Ue(f,d,e):typeof f.type=="function"&&k!==void 0?d=k:y&&(d=y.nextSibling),f.__u&=-7);return n.__e=S,d}function Nt(e,t,n,o,r){var i,s,a,d,l,u=n.length,c=u,p=0;for(e.__k=new Array(r),i=0;i<r;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(d=i+p,(s=e.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?oe(null,s,null,null,null):Z(s)?oe(O,{children:s},null,null,null):s.constructor==null&&s.__b>0?oe(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,(l=s.__i=Et(s,n,d,c))!=-1&&(c--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>u?p--:r<u&&p++),typeof s.type!="function"&&(s.__u|=4)):l!=d&&(l==d-1?p--:l==d+1?p++:(l>d?p--:p++,s.__u|=4))):e.__k[i]=null;if(c)for(i=0;i<u;i++)(a=n[i])!=null&&!(2&a.__u)&&(a.__e==o&&(o=J(a)),qe(a,a));return o}function Ue(e,t,n){var o,r;if(typeof e.type=="function"){for(o=e.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=e,t=Ue(o[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=J(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ie(e,t){return t=t||[],e==null||typeof e=="boolean"||(Z(e)?e.some(function(n){ie(n,t)}):t.push(e)),t}function Et(e,t,n,o){var r,i,s=e.key,a=e.type,d=t[n];if(d===null&&e.key==null||d&&s==d.key&&a==d.type&&!(2&d.__u))return n;if(o>(d!=null&&!(2&d.__u)?1:0))for(r=n-1,i=n+1;r>=0||i<t.length;){if(r>=0){if((d=t[r])&&!(2&d.__u)&&s==d.key&&a==d.type)return r;r--}if(i<t.length){if((d=t[i])&&!(2&d.__u)&&s==d.key&&a==d.type)return i;i++}}return-1}function Me(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ct.test(t)?n:n+"px"}function se(e,t,n,o,r){var i,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Me(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Me(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(De,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=_e,e.addEventListener(t,i?ue:de,i)):e.removeEventListener(t,i?ue:de,i);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Fe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=_e++;else if(t.t<n.u)return;return n(h.event?h.event(t):t)}}}function he(e,t,n,o,r,i,s,a,d,l){var u,c,p,f,y,S,k,v,g,Y,m,x,N,L,E,$,D,C=t.type;if(t.constructor!=null)return null;128&n.__u&&(d=!!(32&n.__u),i=[a=t.__e=n.__e]),(u=h.__b)&&u(t);e:if(typeof C=="function")try{if(v=t.props,g="prototype"in C&&C.prototype.render,Y=(u=C.contextType)&&o[u.__c],m=u?Y?Y.props.value:u.__:o,n.__c?k=(c=t.__c=n.__c).__=c.__E:(g?t.__c=c=new C(v,m):(t.__c=c=new U(v,m),c.constructor=C,c.render=Pt),Y&&Y.sub(c),c.props=v,c.state||(c.state={}),c.context=m,c.__n=o,p=c.__d=!0,c.__h=[],c._sb=[]),g&&c.__s==null&&(c.__s=c.state),g&&C.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=H({},c.__s)),H(c.__s,C.getDerivedStateFromProps(v,c.__s))),f=c.props,y=c.state,c.__v=t,p)g&&C.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),g&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(g&&C.getDerivedStateFromProps==null&&v!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(v,m),!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(v,c.__s,m)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(c.props=v,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(P){P&&(P.__=t)}),x=0;x<c._sb.length;x++)c.__h.push(c._sb[x]);c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(v,c.__s,m),g&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,y,S)})}if(c.context=m,c.props=v,c.__P=e,c.__e=!1,N=h.__r,L=0,g){for(c.state=c.__s,c.__d=!1,N&&N(t),u=c.render(c.props,c.state,c.context),E=0;E<c._sb.length;E++)c.__h.push(c._sb[E]);c._sb=[]}else do c.__d=!1,N&&N(t),u=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++L<25);c.state=c.__s,c.getChildContext!=null&&(o=H(H({},o),c.getChildContext())),g&&!p&&c.getSnapshotBeforeUpdate!=null&&(S=c.getSnapshotBeforeUpdate(f,y)),$=u,u!=null&&u.type===O&&u.key==null&&($=je(u.props.children)),a=He(e,Z($)?$:[$],t,n,o,r,i,s,a,d,l),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),k&&(c.__E=c.__=null)}catch(P){if(t.__v=null,d||i!=null)if(P.then){for(t.__u|=d?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else for(D=i.length;D--;)fe(i[D]);else t.__e=n.__e,t.__k=n.__k;h.__e(P,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Bt(n.__e,t,n,o,r,i,s,d,l);return(u=h.diffed)&&u(t),128&t.__u?void 0:a}function ze(e,t,n){for(var o=0;o<n.length;o++)ve(n[o],n[++o],n[++o]);h.__c&&h.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){h.__e(i,r.__v)}})}function je(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Z(e)?e.map(je):H({},e)}function Bt(e,t,n,o,r,i,s,a,d){var l,u,c,p,f,y,S,k=n.props,v=t.props,g=t.type;if(g=="svg"?r="http://www.w3.org/2000/svg":g=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(l=0;l<i.length;l++)if((f=i[l])&&"setAttribute"in f==!!g&&(g?f.localName==g:f.nodeType==3)){e=f,i[l]=null;break}}if(e==null){if(g==null)return document.createTextNode(v);e=document.createElementNS(r,g,v.is&&v),a&&(h.__m&&h.__m(t,i),a=!1),i=null}if(g==null)k===v||a&&e.data==v||(e.data=v);else{if(i=i&&B.call(e.childNodes),k=n.props||G,!a&&i!=null)for(k={},l=0;l<e.attributes.length;l++)k[(f=e.attributes[l]).name]=f.value;for(l in k)if(f=k[l],l!="children"){if(l=="dangerouslySetInnerHTML")c=f;else if(!(l in v)){if(l=="value"&&"defaultValue"in v||l=="checked"&&"defaultChecked"in v)continue;se(e,l,null,f,r)}}for(l in v)f=v[l],l=="children"?p=f:l=="dangerouslySetInnerHTML"?u=f:l=="value"?y=f:l=="checked"?S=f:a&&typeof f!="function"||k[l]===f||se(e,l,f,k[l],r);if(u)a||c&&(u.__html==c.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(c&&(e.innerHTML=""),He(t.type=="template"?e.content:e,Z(p)?p:[p],t,n,o,g=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,s,i?i[0]:n.__k&&J(n,0),a,d),i!=null)for(l=i.length;l--;)fe(i[l]);a||(l="value",g=="progress"&&y==null?e.removeAttribute("value"):y!=null&&(y!==e[l]||g=="progress"&&!y||g=="option"&&y!=k[l])&&se(e,l,y,k[l],r),l="checked",S!=null&&S!=e[l]&&se(e,l,S,k[l],r))}return e}function ve(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){h.__e(r,n)}}function qe(e,t,n){var o,r;if(h.unmount&&h.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||ve(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){h.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&qe(o[r],t,n||typeof e.type!="function");n||fe(e.__e),e.__c=e.__=e.__e=void 0}function Pt(e,t,n){return this.constructor(e,n)}function me(e,t,n){var o,r,i,s;t==document&&(t=document.documentElement),h.__&&h.__(e,t),r=(o=!1)?null:t.__k,i=[],s=[],he(t,e=t.__k=Q(O,null,[e]),r||G,G,t.namespaceURI,r?null:t.firstChild?B.call(t.childNodes):null,i,r?r.__e:t.firstChild,o,s),ze(i,e,s)}function Ve(e){function t(n){var o,r;return this.getChildContext||(o=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&o.forEach(function(s){s.__e=!0,pe(s)})},this.sub=function(i){o.add(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){o&&o.delete(i),s&&s.call(i)}}),n.children}return t.__c="__cC"+Oe++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,o){return n.children(o)}).contextType=t,t}B=Re.slice,h={__e:function(e,t,n,o){for(var r,i,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),s=r.__d),s)return r.__E=r}catch(a){e=a}throw e}},j=0,U.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=H({},this.state),typeof e=="function"&&(e=e(H({},n),this.props)),e&&H(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),pe(this))},U.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),pe(this))},U.prototype.render=O,q=[],Ie=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ae=function(e,t){return e.__v.__b-t.__v.__b},re.__r=0,De=/(PointerCapture)$|Capture$/i,_e=0,de=Fe(!1),ue=Fe(!0),Oe=0;var Tt=0;function _(e,t,n,o,r,i){t||(t={});var s,a,d=t;if("ref"in d)for(a in d={},t)a=="ref"?s=t[a]:d[a]=t[a];var l={type:e,props:d,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Tt,__i:-1,__u:0,__source:r,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)d[a]===void 0&&(d[a]=s[a]);return h.vnode&&h.vnode(l),l}console.group("%cSavedBy Package Protection","font-size:21px;background: linear-gradient(45deg, #4db6ff, #68e928); color: white; padding: 2px; border-radius: 4px;");let M="v1.0.5-rc.0";M+=`

`,M+=`✅ Lost
`,M+=`✅ Stolen
`,M+=`✅ Damaged

`,M+=`Learn more: https://savedby.io
`,M+=`Dev Email:  dev@savedby.io
`,M+=`Docs: https://help.savedby.io/docs/installation-implementation/shopify/hlw
`,console.log(`%c${M}`,"font-size: 14px;"),console.groupEnd();const $t="[savedby-hidden]:not(savedby-checkout-plus [savedby-hidden]){display:none!important}[savedby-disabled]{pointer-events:none!important;cursor:not-allowed!important;opacity:.5!important}savedby-checkout-plus{width:100%;justify-self:end;margin-left:auto}@media (max-width: 768px){savedby-checkout-plus{width:100%;max-width:100%;justify-self:center;margin:auto}}savedby-checkout-plus>*{width:100%}[slot=savedby-checkout-button]{width:100%;margin:0}",It=":root{all:initial;color:var(--color, #000000b3);font-family:var(--fontFamily)}.sb__parent{margin:var(--container-margin);max-width:var(--container-maxWidth)}.hs-site-cart-popup-layout savedby-widget .sb__container,#slidecarthq .sb__container,#rebuy-cart .sb__container,#rebuy-cart .sb__checkout-container{max-width:100%}",At='.sb__info-wrapper{display:flex;width:100%;line-height:0;margin:16px 0;font-family:var(--info-fontFamily, var(--fontFamily))}.sb__info-wrapper:has(+slot){margin-bottom:0}.sb__info-container{border-radius:var(--info-borderRadius);display:flex;padding:4px 8px;justify-content:center;min-height:16px;background-color:var(--info-backgroundColor);color:var(--info-color, var(--color));width:100%;align-items:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.sb__info-logo-container{height:20px}.sb__info-logo-container>img{height:100%;aspect-ratio:1;padding-right:8px}.sb__info-text-wrapper{flex:1;display:flex;margin:4px 0}.sb__info-text-container{row-gap:16px;column-gap:4px;display:flex;flex-wrap:wrap;font-size:var(--info-fontSize)}.sb__info-text-container [name=title]{font-size:var(--info-title-fontSize);font-weight:300;color:var(--info-title-color, var(--info-color, var(--color)))}.sb__info-text-container [name=description]{font-weight:100;white-space:nowrap;font-size:var(--info-description-fontSize);color:var(--info-description-color,var(--info-color, var(--color)));opacity:.7}.sb__info-text-container [name=fee]:before{content:" • "}.sb__info-text-container [name=fee]{font-weight:100;color:var(--info-fee-color,var(--info-color, var(--color)));font-size:var(--info-fee-fontSize);opacity:.7}.sb__info-help-button{padding-left:4px;height:18px;width:22px;max-height:24px;max-width:24px;cursor:pointer;opacity:.7}.sb__info-help-button>svg{fill:var(--info-popupIcon-color, var(--info-color, var(--color)))}@media (max-width: 330px){.sb__info-container{background-color:unset}.sb__info-text-container{font-size:12px}}',Dt=".sb__checkout-wrapper{justify-content:center;width:100%}.sb__checkout-container{display:flex;flex-direction:var(--btn-direction, column);align-items:center;width:100%;gap:16px}.sb__button-wrapper{display:flex;flex-direction:row;align-items:center;gap:16px;width:100%;flex-wrap:wrap}.sb__button{display:flex;border-radius:var(--btn-border-radius, 6px);height:var(--btn-height, 54px);justify-content:center;align-items:center;font-weight:700;cursor:pointer;font-size:16px;width:100%;border-width:0;font-family:League Spartan,Roboto,Helvetica,Arial,sans-serif;white-space:nowrap}.sb__checkout-button{background-color:var(--btn-checkout-bg-color, #000);color:var(--btn-checkout-text-color, #ffffff)}.sb__checkout-button>svg{fill:var(--btn-checkout-text-color, #ffffff)}.sb__button:hover{filter:brightness(.9)}slot[name=checkoutButton][disabled]{filter:grayscale(.9);cursor:not-allowed;opacity:.3}.sb__cart-button{background-color:var(--btn-cart-bg-color, #000);color:var(--btn-cart-text-color, #ffffff)}.sb__loading-icon,.sb__loading-icon div.dot{box-sizing:border-box;position:absolute}.sb__loading-icon div.dot{position:absolute;width:16px;height:16px;border-radius:50%;background:#fff;animation-timing-function:cubic-bezier(0,1,1,0)}.sb__loading-icon div.dot:nth-child(1){left:8px;animation:sb__loading-icon1 .6s infinite}.sb__loading-icon div.dot:nth-child(2){left:8px;animation:sb__loading-icon2 .6s infinite}.sb__loading-icon div.dot:nth-child(3){left:32px;animation:sb__loading-icon2 .6s infinite}.sb__loading-icon div.dot:nth-child(4){left:56px;animation:sb__loading-icon3 .6s infinite}@keyframes sb__loading-icon1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes sb__loading-icon3{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes sb__loading-icon2{0%{transform:translate(0)}to{transform:translate(24px)}}",Ot=".sb__continue-container{display:flex;justify-content:center;font-family:var(--continue-fontFamily, var(--fontFamily));align-items:center;width:100%}.sb__non-covered-link{color:var(--continue-color, var(--color));font-size:var(--continue-fontSize);text-decoration:var(--continue-textDecoration);text-align:center;cursor:pointer;width:auto;opacity:.7;font-weight:300}div:has(>.sb__non-covered-link[disabled]){cursor:not-allowed}.sb__non-covered-link[disabled]{pointer-events:none;filter:grayscale(.9)}",Rt=".sb__disclaimer{color:var(--disclaimer-color, var(--color));font-size:var(--disclaimer-fontSize);font-family:var(--disclaimer-fontFamily, var(--fontFamily));text-decoration:var(--disclaimer-textDecoration);font-style:var(--disclaimer-textStyle);font-weight:var(--disclaimer-fontWeight);line-height:1.2;white-space:break-spaces}";function We(e,t="--"){return Object.entries(e).reduce((n,[o,r])=>{let i=t+o;return typeof r=="object"?n.push(...We(r,i+"-")):typeof r=="string"?n.push(`${i}: ${r}`):Lt.includes(o)&&typeof r=="number"&&n.push(`${i}: ${r}px`),n},[])}const Lt=["borderRadius","fontSize","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","width","height","maxWidth","maxHeight","minWidth","minHeight"];class Ht extends HTMLElement{constructor(){super();Te(this,"_target");Te(this,"_disconnectHooks",[]);this.attachShadow({mode:"open"});const n=new CSSStyleSheet,o=We(window.SavedBy.style);n.replaceSync(`:host {
${o.join(`; 
`)}
}`+It+At+Dt+Ot+Rt),this.shadowRoot.adoptedStyleSheets=[n]}attach(n){return this.isConnected?this.shadowRoot:(this._target=n,n.after(this),this.shadowRoot)}connectedCallback(){this._target.toggleAttribute("savedby-hidden",!0),this.root=this.getRootNode(),this._rootCSS=new CSSStyleSheet,this._rootCSS.replaceSync($t),this.root.adoptedStyleSheets.push(this._rootCSS)}onDisconnect(n){this._disconnectHooks.push(n)}disconnectedCallback(){if(this._rootCSS&&(this.root.adoptedStyleSheets=this.root.adoptedStyleSheets.filter(n=>n!==this._rootCSS)),!this._target.isConnected)for(const n of this._disconnectHooks)n(this._target)}}customElements.get("savedby-checkout-plus")||customElements.define("savedby-checkout-plus",Ht);function Ut(e,t){const n=r=>r!==null&&(typeof r=="object"||typeof r=="string"||typeof r=="number");function o(r,i){const s={};for(const a in r){const d=r[a],l=i==null?void 0:i[a];typeof d=="object"&&d!==null?n(l)?s[a]=o(d,l):s[a]=d:l===void 0||!["string","number","object"].includes(typeof l)||l===null?s[a]=d:s[a]=l}return s}return o(e,t)}const Mt={color:"black",fontFamily:"montserrat, sans-serif",container:{maxWidth:"100%",margin:"0 0 4px"},info:{backgroundColor:"whitesmoke",borderRadius:4,color:void 0,fontFamily:void 0,fontSize:"0.8em",title:{fontSize:16,color:void 0},description:{fontSize:"1.1em",color:void 0},fee:{color:void 0,fontSize:"1.1em"},popupIcon:{color:void 0},border:"1px solid #ccc",padding:10},continue:{color:"black",fontFamily:void 0,fontSize:15,textDecoration:"underline"},disclaimer:{color:"gray",fontSize:14,fontFamily:void 0,textDecoration:"none",fontStyle:"italic",fontWeight:300,lineHeight:1.2,whiteSpace:"break-spaces"}};window.SavedBy={getCartId:()=>{var e;return(e=decodeURIComponent(document.cookie.match("cart=(.*?);")[1]).match(/[a-zA-Z0-9]+\?key=.*/))==null?void 0:e[0]},merchant:null,ready:!1,root:document.createElement("div"),customSelectors:[],style:Mt,slots:[],myshopifyDomain:null,storefrontAccessToken:null};const ye=document.currentScript;if(ye){const e=JSON.parse(ye.innerHTML);Object.assign(window.SavedBy,e,{style:Ut(window.SavedBy.style,e.style)})}const Ye=localStorage.getItem("SavedBy-override"),Je=document.querySelector("script[src='https://headless-widget.savedby.io']");if(Ye)try{const e=JSON.parse(Ye);Object.assign(window.SavedBy,e),console.debug("[SAVEDBY] Loaded overrides from localStorage",e)}catch(e){console.error("[SAVEDBY] Failed to parse overrides",e)}else if(!ye&&Je)try{const e=JSON.parse(Je.textContent);Object.assign(window.SavedBy,e)}catch(e){console.error("[SAVEDBY] Failed to parse script for config",e)}Ft();function Ft(){if(!window.SavedBy.storefrontAccessToken)return console.error("[SAVEDBY] storefrontAccessToken is required");if(!window.SavedBy.myshopifyDomain)return console.error("[SAVEDBY] myshopifyDomain is required");Promise.resolve().then(()=>Bn).then(({default:e})=>{me(_(e,{}),window.SavedBy.root)})}var V,b,ge,Xe,ee=0,Ke=[],w=h,Ge=w.__b,Ze=w.__r,Qe=w.diffed,et=w.__c,tt=w.unmount,nt=w.__;function te(e,t){w.__h&&w.__h(b,e,ee||t),ee=0;var n=b.__H||(b.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function T(e){return ee=1,zt(it,e)}function zt(e,t,n){var o=te(V++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):it(void 0,t),function(a){var d=o.__N?o.__N[0]:o.__[0],l=o.t(d,a);d!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=b,!b.__f)){var r=function(a,d,l){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(p){return!!p.__c});if(u.every(function(p){return!p.__N}))return!i||i.call(this,a,d,l);var c=o.__c.props!==a;return u.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(c=!0)}}),i&&i.call(this,a,d,l)||c};b.__f=!0;var i=b.shouldComponentUpdate,s=b.componentWillUpdate;b.componentWillUpdate=function(a,d,l){if(this.__e){var u=i;i=void 0,r(a,d,l),i=u}s&&s.call(this,a,d,l)},b.shouldComponentUpdate=r}return o.__N||o.__}function I(e,t){var n=te(V++,3);!w.__s&&Se(n.__H,t)&&(n.__=e,n.u=t,b.__H.__h.push(n))}function W(e,t){var n=te(V++,4);!w.__s&&Se(n.__H,t)&&(n.__=e,n.u=t,b.__h.push(n))}function be(e){return ee=5,ke(function(){return{current:e}},[])}function ke(e,t){var n=te(V++,7);return Se(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function jt(e,t){return ee=8,ke(function(){return e},t)}function ot(e){var t=b.context[e.__c],n=te(V++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(b)),t.props.value):e.__}function qt(){for(var e;e=Ke.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ae),e.__H.__h.forEach(we),e.__H.__h=[]}catch(t){e.__H.__h=[],w.__e(t,e.__v)}}w.__b=function(e){b=null,Ge&&Ge(e)},w.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),nt&&nt(e,t)},w.__r=function(e){Ze&&Ze(e),V=0;var t=(b=e.__c).__H;t&&(ge===b?(t.__h=[],b.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(ae),t.__h.forEach(we),t.__h=[],V=0)),ge=b},w.diffed=function(e){Qe&&Qe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ke.push(t)!==1&&Xe===w.requestAnimationFrame||((Xe=w.requestAnimationFrame)||Vt)(qt)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),ge=b=null},w.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ae),n.__h=n.__h.filter(function(o){return!o.__||we(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],w.__e(o,n.__v)}}),et&&et(e,t)},w.unmount=function(e){tt&&tt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{ae(o)}catch(r){t=r}}),n.__H=void 0,t&&w.__e(t,n.__v))};var rt=typeof requestAnimationFrame=="function";function Vt(e){var t,n=function(){clearTimeout(o),rt&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);rt&&(t=requestAnimationFrame(n))}function ae(e){var t=b,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),b=t}function we(e){var t=b;e.__c=e.__(),b=t}function Se(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function it(e,t){return typeof t=="function"?t(e):t}function Wt({onClose:e,isCarbon:t}){return _("div",{className:"sb__dialog-wrapper",style:{padding:0},children:[_("button",{className:"sb__dialog-close",onClick:e,"aria-label":"close savedby popup",children:_("img",{src:"https://cdn.savedby.io/icons/close-icon.svg",alt:"close icon"})}),_("div",{className:"sb__dialog-content",style:{backgroundImage:t?'url("https://cdn.savedby.io/city-map.png"),linear-gradient(180deg, #049ED8, #b0f18854)':'url("https://cdn.savedby.io/city-map.png"),linear-gradient(180deg, #049ED8, #ffffff7a)'},children:_("div",{className:"sb__stack column",children:[_("img",{src:"https://cdn.savedby.io/logos/savedby/savedby-stacked.png",alt:"savedby hero logo",style:{objectFit:"contain",width:"50%",margin:"auto"}}),_("p",{className:"sb__typography sb__primary",children:t?`PROTECT YOUR PACKAGE
 & GO CARBON NEUTRAL`:`PROTECT YOUR
PACKAGE FROM`}),t?_(O,{children:[_("div",{className:"sb__stack row",style:{height:"100%"},children:[_("div",{className:"sb__dialog-image-container",children:_("img",{src:"https://cdn.savedby.io/icons/protection-icon.svg",alt:"savedby protection icon"})}),_("p",{className:"sb__dialog-image-connector",style:{margin:"0px 32px"},children:"+"}),_("div",{className:"sb__dialog-image-container",style:"margin-left:0px;",children:_("img",{src:"https://cdn.savedby.io/icons/carbon-icon.svg"})})]}),_("div",{className:"sb__stack row",style:{height:"100%"},children:[_("div",{className:"sb__dialog-points-container",style:"margin-right:32px;",children:[_(F,{text:"loss"}),_(F,{text:"theft"}),_(F,{text:"damage"})]}),_("div",{className:"sb__dialog-points-container",style:"margin-left:0px;",children:[_(F,{text:`carbon
neutral`}),_(F,{text:`every order
plants a tree`})]})]})]}):_("div",{className:"sb__stack row",style:{height:"100%"},children:[_("div",{className:"sb__dialog-image-container",children:_("img",{className:"sb__icon",src:"https://cdn.savedby.io/icons/protection-icon.svg",alt:"savedby protection icon"})}),_("div",{className:"sb__dialog-points-container sb__stack column spacing-0",children:[_(F,{text:"loss"}),_(F,{text:"theft"}),_(F,{text:"damage"})]})]}),t?_("div",{className:"sb__dialog-carbon-card",children:_("div",{className:"sb__stack column",style:{alignItems:"center"},children:[_("img",{src:"https://cdn.savedby.io/icons/tree-icon.svg"}),_("p",{className:"sb__typography",style:{color:"white",marginTop:16},children:"YOUR ORDER IS CARBON NEUTRAL"}),_("p",{className:"sb__typography",style:{color:"white",lineHeight:1,fontSize:18,marginTop:16},children:"Help the environment by offsetting 100% of this order’s shipping impact on the world. SavedBy is proud to sponsor the Eden Reforestation Project and the positive work they’re doing for the environment!"})]})}):_(O,{children:[_("p",{className:"sb__typography sb__secondary",style:{fontWeight:600,padding:"0 32px"},children:"SavedBy weathers the storm of lost, stolen, and damaged packages."}),_("p",{className:"sb__typography sb__secondary",style:{fontWeight:200,padding:"0 32px"},children:"If your package has any issues, SavedBy will resolve your issue within 24hrs."}),_("p",{className:"sb__typography sb__secondary",style:{padding:"0 32px",fontSize:12,lineHeight:1,color:"#595959",fontStyle:"italic"},children:"Resolution methods may vary based on merchant discretion and product availability. Where reshipment is applicable, please allow sufficient time for processing and delivery."})]})]})}),_("hr",{}),_("div",{className:"sb__dialog-footer",children:[_("a",{className:"sb__dialog-link",href:"https://savedby.io/policies",target:"_blank",children:"Policies"}),_("a",{className:"sb__dialog-link",href:"https://savedby.io/tos",target:"_blank",children:"Terms of Service"}),_("a",{className:"sb__dialog-link",href:"https://savedby.io/file-a-claim",target:"_blank",children:"File a Claim"})]})]})}function F({text:e=""}){return _("div",{className:"sb__stack row sb__point",style:{justifyContent:"flex-start",margin:2,alignItems:"center"},children:[_("img",{src:"https://cdn.savedby.io/icons/check-icon.svg",className:"sb__point-image",alt:"savedby check icon"}),_("p",{className:"sb__typography sb__secondary",style:{},children:e.toUpperCase()})]})}function Yt({onClose:e,isCarbon:t,html:n}){return _("div",{className:"sb__dialog-wrapper",style:{padding:0},children:[_("button",{className:"sb__dialog-close",onClick:e,"aria-label":"close savedby popup",children:_("img",{src:"https://cdn.savedby.io/icons/close-icon.svg",alt:"close icon"})}),_("div",{className:"sb__dialog-content",style:{backgroundImage:t?'url("https://cdn.savedby.io/city-map.png"),linear-gradient(180deg, #049ED8, #b0f18854)':'url("https://cdn.savedby.io/city-map.png"),linear-gradient(180deg, #049ED8, #ffffff7a)'},children:_("div",{className:"sb__stack column",children:[_("img",{src:"https://cdn.savedby.io/logos/savedby/savedby-stacked.png",alt:"savedby hero logo",style:{objectFit:"contain",width:"50%",margin:"auto"}}),_("div",{className:"sb__custom-content",dangerouslySetInnerHTML:{__html:n}})]})}),_("hr",{}),_("div",{className:"sb__dialog-footer",children:[_("a",{className:"sb__dialog-link",href:"https://savedby.io/policies",target:"_blank",children:"Policies"}),_("a",{className:"sb__dialog-link",href:"https://savedby.io/tos",target:"_blank",children:"Terms of Service"}),_("a",{className:"sb__dialog-link",href:"https://savedby.io/file-a-claim",target:"_blank",children:"File a Claim"})]})]})}function Jt(e,t){for(var n in t)e[n]=t[n];return e}function st(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function at(e,t){this.props=e,this.context=t}(at.prototype=new U).isPureReactComponent=!0,at.prototype.shouldComponentUpdate=function(e,t){return st(this.props,e)||st(this.state,t)};var ct=h.__b;h.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ct&&ct(e)};var Xt=h.__e;h.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}Xt(e,t,n,o)};var lt=h.unmount;function _t(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=Jt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return _t(o,t,n)})),e}function dt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return dt(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function xe(){this.__u=0,this.o=null,this.__b=null}function ut(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ce(){this.i=null,this.l=null}h.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),lt&&lt(e)},(xe.prototype=new U).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=ut(o.__v),i=!1,s=function(){i||(i=!0,n.__R=null,r?r(a):a())};n.__R=s;var a=function(){if(!--o.__u){if(o.state.__a){var d=o.state.__a;o.__v.__k[0]=dt(d,d.__c.__P,d.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.o.pop();)l.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(s,s)},xe.prototype.componentWillUnmount=function(){this.o=[]},xe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=_t(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&Q(O,null,e.fallback);return r&&(r.__u&=-33),[Q(O,null,t.__a?null:e.children),r]};var ft=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Kt(e){return this.getChildContext=function(){return e.context},e.children}function Gt(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){me(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},insertBefore:function(r,i){this.childNodes.push(r),t.h.insertBefore(r,i)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.h.removeChild(r)}}}me(Q(Kt,{context:t.context},e.__v),t.v)}function pt(e,t){var n=Q(Gt,{__v:e,h:t});return n.containerInfo=t,n}(ce.prototype=new U).__a=function(e){var t=this,n=ut(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),ft(t,e,o)):r()};n?n(i):i()}},ce.prototype.render=function(e){this.i=null,this.l=new Map;var t=ie(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ce.prototype.componentDidUpdate=ce.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){ft(e,n,t)})};var Zt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Qt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,en=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,tn=/[A-Z0-9]/g,nn=typeof document<"u",on=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};U.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(U.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ht=h.event;function rn(){}function sn(){return this.cancelBubble}function an(){return this.defaultPrevented}h.event=function(e){return ht&&(e=ht(e)),e.persist=rn,e.isPropagationStopped=sn,e.isDefaultPrevented=an,e.nativeEvent=e};var cn={enumerable:!1,configurable:!0,get:function(){return this.class}},vt=h.vnode;h.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,o=t.type,r={},i=o.indexOf("-")===-1;for(var s in n){var a=n[s];if(!(s==="value"&&"defaultValue"in n&&a==null||nn&&s==="children"&&o==="noscript"||s==="class"||s==="className")){var d=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&a===!0?a="":d==="translate"&&a==="no"?a=!1:d[0]==="o"&&d[1]==="n"?d==="ondoubleclick"?s="ondblclick":d!=="onchange"||o!=="input"&&o!=="textarea"||on(n.type)?d==="onfocus"?s="onfocusin":d==="onblur"?s="onfocusout":en.test(s)&&(s=d):d=s="oninput":i&&Qt.test(s)?s=s.replace(tn,"-$&").toLowerCase():a===null&&(a=void 0),d==="oninput"&&r[s=d]&&(s="oninputCapture"),r[s]=a}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=ie(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=ie(n.children).forEach(function(l){l.props.selected=r.multiple?r.defaultValue.indexOf(l.props.value)!=-1:r.defaultValue==l.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",cn)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),t.props=r}(e),e.$$typeof=Zt,vt&&vt(e)};var mt=h.__r;h.__r=function(e){mt&&mt(e),e.__c};var yt=h.diffed;h.diffed=function(e){yt&&yt(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};function ln(){const{infoOpen:e,setInfoOpen:t,preferences:n}=z(),{popupOverride:o}=n,r="BASIC",i=s=>{t(!1)};return _(_n,{open:e,onClose:i,children:o?_(Yt,{onClose:i,isCarbon:r.includes("CARBON"),html:o}):_(Wt,{onClose:i,isCarbon:r.includes("CARBON")})})}function _n({children:e,open:t,onClose:n}){const[o,r]=T(),i=be();I(()=>{let a=document.getElementsByClassName("sb__dialog")[0];a||(a=document.createElement("div"),a.role="presentation",a.className="sb__dialog",a.style.display="none",document.body.append(a)),r(a)},[]),I(()=>{o&&(t?o.style.display="block":o.style.display="none")},[t,o]);const s=a=>{a.target.className==="sb__dialog-container"?(a.preventDefault(),a.stopPropagation(),n()):a.target.className!=="sb__dialog-link"&&a.stopPropagation()};return o?pt(_(O,{children:[_("div",{"aria-hidden":"true",className:"sb__dialog-backdrop",children:"<!-- -->"}),_("div",{ref:i,className:"sb__dialog-container",onClick:s,children:e})]}),o):null}class le{static async query(t,n,o){const r=await fetch(`https://${SavedBy.myshopifyDomain}/api/2025-04/graphql.json?savedby=${t}`,{method:"POST",headers:{"X-Shopify-Storefront-Access-Token":SavedBy.storefrontAccessToken,"Content-Type":"application/json"},body:JSON.stringify({query:n,variables:o})});if(!r.ok)throw new Error("Failed to fetch data");return r.json()}static getCart(){return this.query("cart",`query {
        cart(id: "gid://shopify/Cart/${SavedBy.getCartId()}") {
          id
          attributes {
            key
            value
          }
          items: lines (first: 10) {
            nodes {
              id
              cost {
                totalAmount {
                  amount
                  currencyCode
                }
              }
              merchandise {
                ... on ProductVariant {
                  id
                  title
                  requiresShipping
                  product {
                    id
                    vendor
                  }
                }
              }
              quantity
            }
          }
        }
      }`).then(({data:t,errors:n})=>{var r;const o=t.cart;return o.items=((r=o.items)==null?void 0:r.nodes)||[],o})}static addToCart(t){return this.query("addToCart",`mutation ($cartId: ID!, $lines: [CartLineInput!]!, $attributes: [AttributeInput!]!) {
        cartLinesAdd(cartId: $cartId, lines: $lines) {
          cart {
            id
            lines(first: 10) {
              nodes {
                id
                quantity
              }
            }
          }
          userErrors {
            code
            field
            message
          }
          warnings {
            code
            message
            target
          }
        }
        cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
          cart {
            id
            attributes {
              key
              value
            }
          }
          userErrors {
            code
            field
            message
          }
        }
      }`,{cartId:`gid://shopify/Cart/${SavedBy.getCartId()}`,lines:t,attributes:[{key:"_SavedBy-internal",value:"1"}]}).then(({data:n})=>{var r;const o=n.cartLinesAdd.cart;return o.items=((r=o.lines)==null?void 0:r.nodes)||[],o})}static async cartLinesRemove(t){return this.query("removeFromCart",`mutation ($cartId: ID!, $lineIds: [ID!]!, $attributes: [AttributeInput!]!) {
        cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
          cart {
            id
            lines(first: 10) {
              nodes {
                id
                quantity
              }
            }
          }
          userErrors {
            code
            field
            message
          }
          warnings {
            code
            message
            target
          }
        }

        cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
          cart {
            id
            attributes {
              key
              value
            }
          }
          userErrors {
            code
            field
            message
          }
        }
      }`,{cartId:`gid://shopify/Cart/${SavedBy.getCartId()}`,lineIds:t,attributes:[{key:"_SavedBy-internal",value:""}]}).then(n=>{console.log(174,n)})}static getMetafields(){return this.query("metafields",`query {
        shop {
          status: metafield(namespace: "SavedBy", key: "status") {
            id
            value
          }
          feeTiers: metafield(namespace: "SavedBy", key: "feeTiers") {
            id
            value
          }
          nonCoveredProducts: metafield(namespace: "SavedBy", key: "nonCoveredProducts") {
            id
            value
          }
          excludedProducts: metafield(namespace: "SavedBy", key: "excludedProducts") {
            id
            value
          }
          product: metafield(namespace: "SavedBy", key: "protectionProduct") {
            id
            value
            reference {
              ... on Product {
                id
                title
                variants(first: 100) {
                  nodes {
                    id
                    title
                    price {
                      amount
                      currencyCode
                    }
                  }
                }
              }
            }
          }
        }
      }`).then(({data:t})=>{var o,r,i,s,a,d,l;const n=t.shop;return n.status=((o=n.status)==null?void 0:o.value)||"",n.feeTiers=JSON.parse(((r=n.feeTiers)==null?void 0:r.value)||[]),n.nonCoveredProducts=JSON.parse(((i=n.nonCoveredProducts)==null?void 0:i.value)||"[]"),n.excludedProducts=JSON.parse(((s=n.excludedProducts)==null?void 0:s.value)||"[]"),n.product=((a=n.product)==null?void 0:a.reference)||null,n.product.variants=((l=(d=n.product)==null?void 0:d.variants)==null?void 0:l.nodes)||[],n})}}function dn(){const[e,t]=T(null),[n,o]=T(!1),r=jt(()=>{le.getCart().then(i=>t(i)).finally(()=>{})},[]);return I(()=>(window.addEventListener("SavedBy:ready",r),()=>{window.removeEventListener("SavedBy:ready",r)}),[]),I(()=>{const i=window.XMLHttpRequest;class s extends i{constructor(){super(),this.addEventListener("readystatechange",function(){this.readyState===4&&!this.responseURL.includes("savedby=")&&(this.responseURL.includes("/cart")||this.responseURL.includes("/graphql.json"))&&(console.log("Intercepted XHR:",this),r())})}}return window.XMLHttpRequest=s,()=>{window.XMLHttpRequest=i}},[]),I(()=>{const i=window.fetch;return window.fetch=async(...s)=>{const[a,d]=s;if(typeof a=="string"&&!a.includes("savedby=")&&(a.includes("/cart")||a.includes("/graphql.json")))try{const l=await i(...s),c=await l.clone().json().catch(()=>null);return console.log("Intercepted Fetch:",a,c,s),c&&c.cart&&r(),l}catch(l){console.error("Fetch interception error:",l)}return i(...s)},()=>{window.fetch=i}},[]),{cart:e,isLoading:n,setLoading:o}}const{Shopify:X}=window;function Ce(e){var r;const t=(X==null?void 0:X.locale)||"en",n=((r=X==null?void 0:X.currency)==null?void 0:r.active)||"USD";return Number(e).toLocaleString(t,{style:"currency",currency:n}).replaceAll(/[a-z]/gi,"")}const{SavedBy:gt}=window;function Ne({target:e}){const[t,n]=T(gt.slots.filter(o=>o.target===e));return W(()=>{const o=[...document.querySelectorAll(`[data-savedby-slot-target="${e}"]`)];//! TODO -- issue here
n(i=>[...i,...o.map(s=>({target:e,getElement:()=>s}))]);function r(i){n(gt.slots.filter(s=>s.target===e))}return window.addEventListener("SavedBy:slots",r),()=>{window.removeEventListener("SavedBy:slots",r)}},[]),t.map((o,r)=>_(un,{slot:o},e+"-"+r))}function un({slot:e}){const[t,n]=T(),{root:o}=Be(),{fee:r,cart:i}=z();return W(()=>{const s=e.getElement();if(!s)return;const a=s.cloneNode(!0);return a.slot=e.target,e.clone=a,n(a),s.style.display="none",o.append(a),()=>{a.remove(),e.clone=null,s.style.display=null}},[o,e]),W(()=>{if(!t)return;const s=document.createElement("style");return s.textContent=`
		  [data-savedby-slot-type="subtotal-with-fee"] { visibility: hidden; }
		  [data-savedby-slot-type="subtotal-with-fee"]::after {
		    visibility: visible;
		    content: "${Ce((r+i.total_price)/100)}";
		  }
		`,t.append(s),()=>{s.remove()}},[t,r,i.total_price]),t?_("slot",{name:e.target}):null}function Ee({location:e}){const{disclaimer:t,disclaimerLocation:n}=z().preferences;return!t||n!==e?null:_("div",{className:"sb__disclaimer",dangerouslySetInnerHTML:{__html:t}})}const{SavedBy:ne}=window;function bt(e,t){let n;if(ne[t])try{typeof ne[t]=="string"&&(n=ne[t]),typeof ne[t]=="function"&&(n=ne[t](e))}catch(o){console.error(`[SAVEDBY] Error in ${t}`,o)}return n??e}function fn(){const{checkoutButtonDisabled:e,checkout:t,continueRef:n,isLoading:o}=z(),{targetElement:r,root:i}=Be();let s="Continue without package protection";return s=bt(s,"optOutText"),_("slot",{name:"continue",className:"sb__continue-container",onClick:d=>{d.isTrusted&&(d.preventDefault(),t(!1,{root:i,targetElement:r,event:d}))},ref:n,children:_("a",{disabled:e||o,className:"sb__non-covered-link",children:s})})}function pn(){const{setInfoOpen:e}=z();return _("div",{className:"sb__info-help-button",onClick:()=>e(!0),children:_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"100%",focusable:"false","aria-hidden":"true",viewBox:"0 0 24 24",children:_("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"})})})}const{SavedBy:R}=window;function hn(){const{enabled:e,fee:t,preferences:n}=z();if(!e)return null;let o="Checkout+";if(R.infoTitle)try{typeof R.infoTitle=="string"&&(o=R.infoTitle),typeof R.infoTitle=="function"&&(o=R.infoTitle(o))}catch(i){console.error("[SAVEDBY] Error in SavedBy.infoTitle transform function",i)}let r="Package Protection";if(R.infoDescription)try{typeof R.infoDescription=="string"&&(r=R.infoDescription),typeof R.infoDescription=="function"&&(r=R.infoDescription(r))}catch(i){console.error("[SAVEDBY] Error in SavedBy.infoDescription transform function",i)}return _("div",{className:"sb__info-wrapper",children:_("div",{className:"sb__info-container",children:[_("div",{className:"sb__info-logo-container",children:n.infoIconUrl&&_("img",{alt:"Protection Logo",src:n.infoIconUrl})}),_("div",{className:"sb__info-text-wrapper",children:_("div",{className:"sb__info-text-container",children:[_("span",{name:"title",children:o}),_("span",{children:[_("span",{name:"description",children:r}),_("span",{name:"fee",children:Ce(t)})]})]})}),_(pn,{})]})})}function vn(e){let t=[];const n=document.evaluate("descendant::text()",e);let o;for(;o=n.iterateNext();)o.textContent.trim()&&t.push(o);return t}const mn={checkout:["a[href*='/checkout']","button[name='checkout']"]};function yn(){const{fee:e,cart:t,checkout:n,preferences:o}=z(),{showCartTotal:r}=o,{cta:i,root:s,targetElement:a}=Be();return W(()=>{const l=i==null?void 0:i.querySelector(mn.checkout.join(","));if(!l)return;let u="CHECKOUT+";r&&(u+=" • "+Ce((e+t.subtotal)/100));const c=vn(l);if(c.length){const[p,...f]=c;p.textContent=bt(u,"checkoutText"),f.forEach(y=>y.textContent="")}},[i,r,e,t.subtotal]),_("slot",{name:"savedby-cta",onClick:l=>{l.isTrusted&&(l.preventDefault(),n(!0,{root:s,targetElement:a,event:l}))}})}function gn(){return location.pathname.includes("/cart"),_("div",{className:"sb__parent",children:[_(Ee,{location:"top"}),_(Ne,{target:"info:above"}),_(hn,{}),_(Ne,{target:"info:below"}),_(Ne,{target:"checkout:above"}),_("div",{className:"sb__checkout-wrapper",children:_("div",{className:"sb__checkout-container",children:[_(Ee,{location:"middle"}),_("div",{className:"sb__button-wrapper",children:_(yn,{})}),_(fn,{}),_(Ee,{location:"bottom"})]})})]})}const{location:bn,SavedBy:kn}=window,kt=Ve({root:null,targetElement:null,cta:null});function wn({targetElement:e,remove:t}){const[n,o]=T(null),[r,i]=T(null);return W(()=>{const s=document.createElement("savedby-checkout-plus");s.onDisconnect(t),s.dataset.selector=kn.customSelectors.find(c=>e.matches(c)),s.dataset.path=bn.pathname,o(s);let a=wt(e,s);i(a);const d=document.getElementById("savedby-continue");let l;d&&(l=d.content.children[0].cloneNode(!0),l.slot="continue",s.append(l));const u=new MutationObserver(c=>{a.remove(),a=wt(e,s),l&&(l.remove(),l=d.content.children[0].cloneNode(!0),l.slot="continue",s.append(l)),i(a)});return u.observe(e,{childList:!0,subtree:!0,attributes:!0}),()=>{o(),a.remove(),l==null||l.remove(),s.remove(),u.disconnect()}},[e]),n?_(kt.Provider,{value:{cta:r,root:n,targetElement:e},children:pt(_(O,{children:_(gn,{})}),n.attach(e))}):null}function Be(){return ot(kt)}function wt(e,t){const n=e.cloneNode(!0);return n.slot="savedby-cta",t.append(n),n}function Sn(){const[e,t]=T(new Set),{enabled:n}=z(),o=be(0);W(()=>{const i=[],s=[document.body];for(const d of s){const l=new MutationObserver(a(d));l.observe(d,{childList:!0,subtree:!0}),i.push(l),a(d)([{addedNodes:[],removedNodes:[]}])}function a(d){return l=>{d&&t(u=>{const c=new Set,p=[];for(const y of l)if([...y.addedNodes].every(S=>S.nodeName!=="SAVEDBY-CHECKOUT-PLUS")){p.push(...[...y.removedNodes].filter(S=>u.has(S)));for(const S of SavedBy.customSelectors||[]){const k=[...d.querySelectorAll(`${S}`)].filter(v=>!v.closest("savedby-checkout-plus"));for(const v of k)c.add(v)}}if(o.current>1e3)return console.warn("[SAVEDBY] rerender exceeded")||u;const f=new Set([...u,...c].filter(y=>!p.includes(y)));return xn(u,f)?u:f})}}return()=>{for(const d of i)d.disconnect()}},[]),W(()=>{console.log("🔵 ELEMENTS",o.current++,e)},[e]);const r=i=>{t(s=>new Set([...s].filter(d=>d!==i)))};return n?[...e].map(i=>_(wn,{targetElement:i,remove:r},i)):null}function xn(e,t){if(e.size!==t.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function K(e,t){return console.debug("[SAVEDBY] EVENT:",e,t),window.dispatchEvent(new CustomEvent("SavedBy:"+e,{detail:t}))}function St(){let e=["[SAVEDBY] Unable to find checkout button"];e.push("Did you forget to add `data-savedby='checkout'` to your checkout button?"),e.push("https://help.savedby.io/docs/installation-implementation/shopify/hlw"),console.error(e.join(`
`))}let{SavedBy:A,Shopify:Pe}=window;const xt=Ve({cart:void 0,checkout:(e,t)=>null,continueRef:{current:{_onClickOverride:null}},enabled:!1,fee:0,getCartId:()=>{var e;return(e=decodeURIComponent(document.cookie.match("cart=(.*?);")[1]).match(/[a-zA-Z0-9]+\?key=.*/))==null?void 0:e[0]},infoOpen:!1,isLoading:!1,preferences:{showCartTotal:!1},setInfoOpen:e=>null});function Cn(){const e=Nn();return I(()=>{A&&(A.context={get cart(){return e.cart},get checkout(){return e.checkout},get enabled(){return e.enabled},set enabled(t){e.setEnabledOverride(t)},get fee(){return e.fee},get infoOpen(){return e.infoOpen},set infoOpen(t){e.setInfoOpen(t)},get isLoading(){return e.isLoading},get preferences(){return e.preferences}},A.merchant={get excludedProducts(){return e.metafields.excludedProducts},get feeTiers(){return e.metafields.feeTiers},get nonCoveredProducts(){return e.metafields.nonCoveredProducts},get product(){return e.metafields.product},get status(){return e.metafields.status}},A.ready||(A.ready=!0,K("ready",A)))},[e]),_(xt.Provider,{value:e,children:[_(ln,{}),_(Sn,{})]})}function Nn(){const[e,t]=T(!1),[n,o]=T(!0),[r,i]=T({}),{cart:s,isLoading:a,setLoading:d}=dn(),l=be(),[u,c]=T(),p=v(),f=Y(),y=n&&g();I(()=>{le.getMetafields().then(c)},[]),I(()=>{if(!s)return;K("cart",s);const m=s.items.find(x=>x.merchandise.product.vendor==="SavedBy");m&&le.cartLinesRemove([m.id]).then(()=>{window.location.reload()})},[s]),I(()=>{p&&K("feeTier",p)},[p]),I(()=>{A.ready&&K("enabled",y)},[y]),I(()=>{A.ready&&K("popup",e)},[e]);const S=async(m,x)=>{var N;if(d(!0),K("checkout",{withProtection:m,context:x}),((N=x.event)==null?void 0:N.target)instanceof HTMLElement){const L=x.event.target;(L.dataset.savedby==="checkout"||m)&&await le.addToCart([{merchandiseId:f.id}]);const E=x.root.querySelector("[data-savedby='checkout']");m?E?E.click():(St(),x.targetElement.click()):x.root.querySelector("[slot='continue']")?L.click():E?E.click():(St(),x.targetElement.click())}},k=ke(()=>{var m;return(f==null?void 0:f.title)==="Default Title"?+(p==null?void 0:p.price):+((m=f==null?void 0:f.price)==null?void 0:m.amount)||0},[p,f]);return{cart:s,checkout:S,continueRef:l,enabled:y,fee:k,infoOpen:e,isLoading:a,preferences:r,metafields:u,setInfoOpen:t};function v(){var C;if(!u)return!1;const{excludedProducts:m,feeTiers:x,product:N}=u;if(!s||!N)return;const L=+((C=Pe==null?void 0:Pe.currency)==null?void 0:C.rate)||1,E=s.items.filter(P=>{if(m!=null&&m.includes("gid://shopify/Product/"+P.product_id))return!1;if(P.merchandise.requiresShipping&&P.merchandise.product.vendor!=="SavedBy")return!0});if(!E)return!1;const $=E.reduce((P,Pn)=>P+ +Pn.cost.totalAmount.amount,0);if(!$)return!1;let D=x.find(P=>$<=P.max*L);return D||!1}function g(){var E,$;if(!u)return!1;const{nonCoveredProducts:m,product:x}=u;if(!s||!x)return!1;const N=["status","feeTiers","nonCoveredProducts","excludedProducts","product"];if(!N.every(D=>u[D]))return console.error("[SAVEDBY] Missing required metafields:",N.filter(D=>!u[D])),!1;if(u.status!=="ACTIVE")return console.warn("[SAVEDBY] Merchant status is not active"),!1;if(!A.getCartId)return console.error("[SAVEDBY] getCartId function is undefined"),!1;const L=A.getCartId();return typeof L!="string"||!L.length?(console.error("[SAVEDBY] getCartId function returned an invalid cart ID"),!1):(E=A.customSelectors)!=null&&E.length?!(m&&(($=s.items)==null?void 0:$.map(C=>C.merchandise.product.id)).some(C=>m==null?void 0:m.includes(C))||!p||!f):(console.error("[SAVEDBY] No selectors set"),!1)}function Y(){if(!u)return!1;const{product:m}=u;if(!(!p||!m))return m.variants.length>1?m.variants.find(N=>N.id==="gid://shopify/ProductVariant/"+p.variantId||N.price.amount===p.price):m.variants[0]}}function z(){return ot(xt)}function En(){return _(Cn,{})}const Bn=Object.freeze(Object.defineProperty({__proto__:null,default:En},Symbol.toStringTag,{value:"Module"}))});
