var qs=Object.defineProperty;var zs=(te,w,de)=>w in te?qs(te,w,{enumerable:!0,configurable:!0,writable:!0,value:de}):te[w]=de;var k=(te,w,de)=>zs(te,typeof w!="symbol"?w+"":w,de);(function(){"use strict";var te,w,de,le,Dt,jt,ft,Ce={},Bt=[],Sr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,He=Array.isArray;function ae(t,e){for(var n in e)t[n]=e[n];return t}function $t(t){var e=t.parentNode;e&&e.removeChild(t)}function Re(t,e,n){var r,o,i,s={};for(i in e)i=="key"?r=e[i]:i=="ref"?o=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?te.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)s[i]===void 0&&(s[i]=t.defaultProps[i]);return Ue(t,s,r,o,null)}function Ue(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++de};return o==null&&w.vnode!=null&&w.vnode(i),i}function X(t){return t.children}function oe(t,e){this.props=t,this.context=e}function Ne(t,e){if(e==null)return t.__?Ne(t.__,t.__.__k.indexOf(t)+1):null;for(var n;ee&&le.sort(ft));We.__r=0}function Ut(t,e,n,r,o,i,s,a,c,u,f){var d,m,b,p,h,_,C,E,L,R=0,N=r&&r.__k||Bt,$=N.length,O=$,F=e.length;for(n.__k=[],d=0;d0?Ue(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)!=null?(p.__=n,p.__b=n.__b+1,(E=Er(p,N,C=d+R,O))===-1?b=Ce:(b=N[E]||Ce,N[E]=void 0,O--),gt(t,p,b,o,i,s,a,c,u,f),h=p.__e,(m=p.ref)&&b.ref!=m&&(b.ref&&ht(b.ref,null,p),f.push(m,p.__c||h,p)),h!=null&&(_==null&&(_=h),(L=b===Ce||b.__v===null)?E==-1&&R--:E!==C&&(E===C+1?R++:E>C?O>F-C?R+=E-C:R--:R=E(c!=null?1:0))for(;s>=0||a=0){if((c=e[s])&&o==c.key&&i===c.type)return s;s--}if(a=n.__.length&&n.__.push({__V:Ge}),n.__[t]}function H(t){return Ae=1,Pr(an,t)}function Pr(t,e,n){var r=yt(Pe++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):an(void 0,e),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=D,!D.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(m){return m.__c});if(f.every(function(m){return!m.__N}))return!i||i.call(this,a,c,u);var d=!1;return f.forEach(function(m){if(m.__N){var b=m.__[0];m.__=m.__N,m.__N=void 0,b!==m.__[0]&&(d=!0)}}),!(!d&&r.__c.props===a)&&(!i||i.call(this,a,c,u))};D.u=!0;var i=D.shouldComponentUpdate,s=D.componentWillUpdate;D.componentWillUpdate=function(a,c,u){if(this.__e){var f=i;i=void 0,o(a,c,u),i=f}s&&s.call(this,a,c,u)},D.shouldComponentUpdate=o}return r.__N||r.__}function ne(t,e){var n=yt(Pe++,3);!w.__s&&sn(n.__H,e)&&(n.__=t,n.i=e,D.__H.__h.push(n))}function rn(t){return Ae=5,Ie(function(){return{current:t}},[])}function Ie(t,e){var n=yt(Pe++,7);return sn(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Ar(t,e){return Ae=8,Ie(function(){return t},e)}function Ir(){for(var t;t=Qt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Je),t.__H.__h.forEach(bt),t.__H.__h=[]}catch(e){t.__H.__h=[],w.__e(e,t.__v)}}w.__b=function(t){D=null,Kt&&Kt(t)},w.__r=function(t){Yt&&Yt(t),Pe=0;var e=(D=t.__c).__H;e&&(mt===D?(e.__h=[],D.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Ge,n.__N=n.i=void 0})):(e.__h.forEach(Je),e.__h.forEach(bt),e.__h=[],Pe=0)),mt=D},w.diffed=function(t){en&&en(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Qt.push(e)!==1&&Xt===w.requestAnimationFrame||((Xt=w.requestAnimationFrame)||Or)(Ir)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Ge&&(n.__=n.__V),n.i=void 0,n.__V=Ge})),mt=D=null},w.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Je),n.__h=n.__h.filter(function(r){return!r.__||bt(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],w.__e(r,n.__v)}}),tn&&tn(t,e)},w.unmount=function(t){nn&&nn(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Je(r)}catch(o){e=o}}),n.__H=void 0,e&&w.__e(e,n.__v))};var on=typeof requestAnimationFrame=="function";function Or(t){var e,n=function(){clearTimeout(r),on&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);on&&(e=requestAnimationFrame(n))}function Je(t){var e=D,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),D=e}function bt(t){var e=D;t.__c=t.__(),D=e}function sn(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function an(t,e){return typeof e=="function"?e(t):e}function Fr(t,e){for(var n in e)t[n]=e[n];return t}function cn(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function dn(t){this.props=t}(dn.prototype=new oe).isPureReactComponent=!0,dn.prototype.shouldComponentUpdate=function(t,e){return cn(this.props,t)||cn(this.state,e)};var ln=w.__b;w.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),ln&&ln(t)};var Mr=w.__e;w.__e=function(t,e,n,r){if(t.then){for(var o,i=e;i=i.__;)if((o=i.__c)&&o.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e)}Mr(t,e,n,r)};var un=w.unmount;function pn(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=Fr({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return pn(r,e,n)})),t}function fn(t,e,n){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return fn(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=n)),t}function wt(){this.__u=0,this.t=null,this.__b=null}function gn(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Xe(){this.u=null,this.o=null}w.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&t.__h===!0&&(t.type=null),un&&un(t)},(wt.prototype=new oe).__c=function(t,e){var n=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=gn(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=fn(u,u.__c.__P,u.__c.__O)}var f;for(r.setState({__a:r.__b=null});f=r.t.pop();)f.forceUpdate()}},c=e.__h===!0;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(s,s)},wt.prototype.componentWillUnmount=function(){this.t=[]},wt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=pn(this.__b,n,r.__O=r.__P)}this.__b=null}var o=e.__a&&Re(X,null,t.fallback);return o&&(o.__h=null),[Re(X,null,e.__a?null:t.children),o]};var hn=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),e.i.removeChild(r)}}),Ze(Re(Dr,{context:e.context},t.__v),e.l)}function Br(t,e){var n=Re(jr,{__v:t,i:e});return n.containerInfo=e,n}(Xe.prototype=new oe).__a=function(t){var e=this,n=gn(e.__v),r=e.o.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),hn(e,t,r)):o()};n?n(i):i()}},Xe.prototype.render=function(t){this.u=null,this.o=new Map;var e=qe(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Xe.prototype.componentDidUpdate=Xe.prototype.componentDidMount=function(){var t=this;this.o.forEach(function(e,n){hn(t,n,e)})};var $r=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Vr=/^(?: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]/,Hr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ur=/[A-Z0-9]/g,Wr=typeof document<"u",qr=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function zr(t,e,n){return e.__k==null&&(e.textContent=""),Ze(t,e),typeof n=="function"&&n(),t?t.__c:null}oe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(oe.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var _n=w.event;function Zr(){}function Gr(){return this.cancelBubble}function Jr(){return this.defaultPrevented}w.event=function(t){return _n&&(t=_n(t)),t.persist=Zr,t.isPropagationStopped=Gr,t.isDefaultPrevented=Jr,t.nativeEvent=t};var Xr={enumerable:!1,configurable:!0,get:function(){return this.class}},mn=w.vnode;w.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,o={};for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||Wr&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var a=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":a==="ondoubleclick"?i="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||qr(n.type)?a==="onfocus"?i="onfocusin":a==="onblur"?i="onfocusout":Hr.test(i)?i=a:r.indexOf("-")===-1&&Vr.test(i)?i=i.replace(Ur,"-$&").toLowerCase():s===null&&(s=void 0):a=i="oninput",a==="oninput"&&o[i=a]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=qe(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=qe(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Xr)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),e.props=o}(t),t.$$typeof=$r,mn&&mn(t)};var yn=w.__r;w.__r=function(t){yn&&yn(t),t.__c};var bn=w.diffed;w.diffed=function(t){bn&&bn(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};var Qr=X;const wn=t=>t.reduce((e,n)=>({total:e.total+(n.final_line_price??n.final_price*n.quantity),quantity:e.quantity+n.quantity}),{total:0,quantity:0});function Cn(t,e){return function(){return t.apply(e,arguments)}}const{toString:Kr}=Object.prototype,{getPrototypeOf:Ct}=Object,{iterator:Qe,toStringTag:xn}=Symbol,Ke=(t=>e=>{const n=Kr.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Y=t=>(t=t.toLowerCase(),e=>Ke(e)===t),Ye=t=>e=>typeof e===t,{isArray:xe}=Array,ve=Ye("undefined");function Oe(t){return t!==null&&!ve(t)&&t.constructor!==null&&!ve(t.constructor)&&z(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const vn=Y("ArrayBuffer");function Yr(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&vn(t.buffer),e}const eo=Ye("string"),z=Ye("function"),Tn=Ye("number"),Fe=t=>t!==null&&typeof t=="object",to=t=>t===!0||t===!1,et=t=>{if(Ke(t)!=="object")return!1;const e=Ct(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(xn in t)&&!(Qe in t)},no=t=>{if(!Fe(t)||Oe(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ro=Y("Date"),oo=Y("File"),io=Y("Blob"),so=Y("FileList"),ao=t=>Fe(t)&&z(t.pipe),co=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||z(t.append)&&((e=Ke(t))==="formdata"||e==="object"&&z(t.toString)&&t.toString()==="[object FormData]"))},lo=Y("URLSearchParams"),[uo,po,fo,go]=["ReadableStream","Request","Response","Headers"].map(Y),ho=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Me(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),xe(t))for(r=0,o=t.length;r0;)if(o=n[r],e===o.toLowerCase())return o;return null}const ue=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,En=t=>!ve(t)&&t!==ue;function xt(){const{caseless:t,skipUndefined:e}=En(this)&&this||{},n={},r=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=t&&Sn(n,i)||i;et(n[s])&&et(o)?n[s]=xt(n[s],o):et(o)?n[s]=xt({},o):xe(o)?n[s]=o.slice():(!e||!ve(o))&&(n[s]=o)};for(let o=0,i=arguments.length;o(Me(e,(o,i)=>{n&&z(o)?Object.defineProperty(t,i,{value:Cn(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),mo=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yo=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},bo=(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Ct(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},wo=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Co=t=>{if(!t)return null;if(xe(t))return t;let e=t.length;if(!Tn(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},xo=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ct(Uint8Array)),vo=(t,e)=>{const r=(t&&t[Qe]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},To=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},So=Y("HTMLFormElement"),Eo=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Ln=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Lo=Y("RegExp"),kn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Me(n,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(r[i]=s||o)}),Object.defineProperties(t,r)},ko=t=>{kn(t,(e,n)=>{if(z(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(z(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ro=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return xe(t)?r(t):r(String(t).split(e)),n},No=()=>{},Po=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Ao(t){return!!(t&&z(t.append)&&t[xn]==="FormData"&&t[Qe])}const Io=t=>{const e=new Array(10),n=(r,o)=>{if(Fe(r)){if(e.indexOf(r)>=0)return;if(Oe(r))return r;if(!("toJSON"in r)){e[o]=r;const i=xe(r)?[]:{};return Me(r,(s,a)=>{const c=n(s,o+1);!ve(c)&&(i[a]=c)}),e[o]=void 0,i}}return r};return n(t,0)},Oo=Y("AsyncFunction"),Fo=t=>t&&(Fe(t)||z(t))&&z(t.then)&&z(t.catch),Rn=((t,e)=>t?setImmediate:e?((n,r)=>(ue.addEventListener("message",({source:o,data:i})=>{o===ue&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),ue.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",z(ue.postMessage)),Mo=typeof queueMicrotask<"u"?queueMicrotask.bind(ue):typeof process<"u"&&process.nextTick||Rn,g={isArray:xe,isArrayBuffer:vn,isBuffer:Oe,isFormData:co,isArrayBufferView:Yr,isString:eo,isNumber:Tn,isBoolean:to,isObject:Fe,isPlainObject:et,isEmptyObject:no,isReadableStream:uo,isRequest:po,isResponse:fo,isHeaders:go,isUndefined:ve,isDate:ro,isFile:oo,isBlob:io,isRegExp:Lo,isFunction:z,isStream:ao,isURLSearchParams:lo,isTypedArray:xo,isFileList:so,forEach:Me,merge:xt,extend:_o,trim:ho,stripBOM:mo,inherits:yo,toFlatObject:bo,kindOf:Ke,kindOfTest:Y,endsWith:wo,toArray:Co,forEachEntry:vo,matchAll:To,isHTMLForm:So,hasOwnProperty:Ln,hasOwnProp:Ln,reduceDescriptors:kn,freezeMethods:ko,toObjectSet:Ro,toCamelCase:Eo,noop:No,toFiniteNumber:Po,findKey:Sn,global:ue,isContextDefined:En,isSpecCompliantForm:Ao,toJSONObject:Io,isAsyncFn:Oo,isThenable:Fo,setImmediate:Rn,asap:Mo,isIterable:t=>t!=null&&z(t[Qe])};let S=class vr extends Error{static from(e,n,r,o,i,s){const a=new vr(e.message,n||e.code,r,o,i);return a.cause=e,a.name=e.name,s&&Object.assign(a,s),a}constructor(e,n,r,o,i){super(e),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:g.toJSONObject(this.config),code:this.code,status:this.status}}};S.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",S.ERR_BAD_OPTION="ERR_BAD_OPTION",S.ECONNABORTED="ECONNABORTED",S.ETIMEDOUT="ETIMEDOUT",S.ERR_NETWORK="ERR_NETWORK",S.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",S.ERR_DEPRECATED="ERR_DEPRECATED",S.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",S.ERR_BAD_REQUEST="ERR_BAD_REQUEST",S.ERR_CANCELED="ERR_CANCELED",S.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",S.ERR_INVALID_URL="ERR_INVALID_URL";const Do=null;function vt(t){return g.isPlainObject(t)||g.isArray(t)}function Nn(t){return g.endsWith(t,"[]")?t.slice(0,-2):t}function Pn(t,e,n){return t?t.concat(e).map(function(o,i){return o=Nn(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function jo(t){return g.isArray(t)&&!t.some(vt)}const Bo=g.toFlatObject(g,{},null,function(e){return/^is[A-Z]/.test(e)});function tt(t,e,n){if(!g.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=g.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,_){return!g.isUndefined(_[h])});const r=n.metaTokens,o=n.visitor||f,i=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(e);if(!g.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(g.isDate(p))return p.toISOString();if(g.isBoolean(p))return p.toString();if(!c&&g.isBlob(p))throw new S("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(p)||g.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,h,_){let C=p;if(p&&!_&&typeof p=="object"){if(g.endsWith(h,"{}"))h=r?h:h.slice(0,-2),p=JSON.stringify(p);else if(g.isArray(p)&&jo(p)||(g.isFileList(p)||g.endsWith(h,"[]"))&&(C=g.toArray(p)))return h=Nn(h),C.forEach(function(L,R){!(g.isUndefined(L)||L===null)&&e.append(s===!0?Pn([h],R,i):s===null?h:h+"[]",u(L))}),!1}return vt(p)?!0:(e.append(Pn(_,h,i),u(p)),!1)}const d=[],m=Object.assign(Bo,{defaultVisitor:f,convertValue:u,isVisitable:vt});function b(p,h){if(!g.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(p),g.forEach(p,function(C,E){(!(g.isUndefined(C)||C===null)&&o.call(e,C,g.isString(E)?E.trim():E,h,m))===!0&&b(C,h?h.concat(E):[E])}),d.pop()}}if(!g.isObject(t))throw new TypeError("data must be an object");return b(t),e}function An(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Tt(t,e){this._pairs=[],t&&tt(t,this,e)}const In=Tt.prototype;In.append=function(e,n){this._pairs.push([e,n])},In.toString=function(e){const n=e?function(r){return e.call(this,r,An)}:An;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function $o(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function On(t,e,n){if(!e)return t;const r=n&&n.encode||$o,o=g.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let s;if(i?s=i(e,o):s=g.isURLSearchParams(e)?e.toString():new Tt(e,o).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Fn{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){g.forEach(this.handlers,function(r){r!==null&&e(r)})}}const St={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Vo={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Tt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Et=typeof window<"u"&&typeof document<"u",Lt=typeof navigator=="object"&&navigator||void 0,Ho=Et&&(!Lt||["ReactNative","NativeScript","NS"].indexOf(Lt.product)<0),Uo=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wo=Et&&window.location.href||"http://localhost",U={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Et,hasStandardBrowserEnv:Ho,hasStandardBrowserWebWorkerEnv:Uo,navigator:Lt,origin:Wo},Symbol.toStringTag,{value:"Module"})),...Vo};function qo(t,e){return tt(t,new U.classes.URLSearchParams,{visitor:function(n,r,o,i){return U.isNode&&g.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function zo(t){return g.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Zo(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r=n.length;return s=!s&&g.isArray(o)?o.length:s,c?(g.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!g.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&g.isArray(o[s])&&(o[s]=Zo(o[s])),!a)}if(g.isFormData(t)&&g.isFunction(t.entries)){const n={};return g.forEachEntry(t,(r,o)=>{e(zo(r),o,n,0)}),n}return null}function Go(t,e,n){if(g.isString(t))try{return(e||JSON.parse)(t),g.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const De={transitional:St,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=g.isObject(e);if(i&&g.isHTMLForm(e)&&(e=new FormData(e)),g.isFormData(e))return o?JSON.stringify(Mn(e)):e;if(g.isArrayBuffer(e)||g.isBuffer(e)||g.isStream(e)||g.isFile(e)||g.isBlob(e)||g.isReadableStream(e))return e;if(g.isArrayBufferView(e))return e.buffer;if(g.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return qo(e,this.formSerializer).toString();if((a=g.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return tt(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),Go(e)):e}],transformResponse:[function(e){const n=this.transitional||De.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(g.isResponse(e)||g.isReadableStream(e))return e;if(e&&g.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?S.from(a,S.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch"],t=>{De.headers[t]={}});const Jo=g.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xo=t=>{const e={};let n,r,o;return t&&t.split(` `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&Jo[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Dn=Symbol("internals");function je(t){return t&&String(t).trim().toLowerCase()}function nt(t){return t===!1||t==null?t:g.isArray(t)?t.map(nt):String(t)}function Qo(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const Ko=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function kt(t,e,n,r,o){if(g.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!g.isString(e)){if(g.isString(r))return e.indexOf(r)!==-1;if(g.isRegExp(r))return r.test(e)}}function Yo(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function ei(t,e){const n=g.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,i,s){return this[r].call(this,e,o,i,s)},configurable:!0})})}let Z=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(a,c,u){const f=je(c);if(!f)throw new Error("header name must be a non-empty string");const d=g.findKey(o,f);(!d||o[d]===void 0||u===!0||u===void 0&&o[d]!==!1)&&(o[d||c]=nt(a))}const s=(a,c)=>g.forEach(a,(u,f)=>i(u,f,c));if(g.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(g.isString(e)&&(e=e.trim())&&!Ko(e))s(Xo(e),n);else if(g.isObject(e)&&g.isIterable(e)){let a={},c,u;for(const f of e){if(!g.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[u=f[0]]=(c=a[u])?g.isArray(c)?[...c,f[1]]:[c,f[1]]:f[1]}s(a,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=je(e),e){const r=g.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return Qo(o);if(g.isFunction(n))return n.call(this,o,r);if(g.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=je(e),e){const r=g.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||kt(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(s){if(s=je(s),s){const a=g.findKey(r,s);a&&(!n||kt(r,r[a],a,n))&&(delete r[a],o=!0)}}return g.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||kt(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return g.forEach(this,(o,i)=>{const s=g.findKey(r,i);if(s){n[s]=nt(o),delete n[i];return}const a=e?Yo(i):String(i).trim();a!==i&&delete n[i],n[a]=nt(o),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return g.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&g.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Dn]=this[Dn]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=je(s);r[a]||(ei(o,s),r[a]=!0)}return g.isArray(e)?e.forEach(i):i(e),this}};Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),g.reduceDescriptors(Z.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),g.freezeMethods(Z);function Rt(t,e){const n=this||De,r=e||n,o=Z.from(r.headers);let i=r.data;return g.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function jn(t){return!!(t&&t.__CANCEL__)}let Be=class extends S{constructor(e,n,r){super(e??"canceled",S.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Bn(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new S("Request failed with status code "+n.status,[S.ERR_BAD_REQUEST,S.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ti(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ni(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),f=r[i];s||(s=u),n[o]=c,r[o]=u;let d=i,m=0;for(;d!==o;)m+=n[d++],d=d%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),u-s{n=f,o=null,i&&(clearTimeout(i),i=null),t(...u)};return[(...u)=>{const f=Date.now(),d=f-n;d>=r?s(u,f):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},r-d)))},()=>o&&s(o)]}const rt=(t,e,n=3)=>{let r=0;const o=ni(50,250);return ri(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,c=s-r,u=o(c),f=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&f?(a-s)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},$n=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Vn=t=>(...e)=>g.asap(()=>t(...e)),oi=U.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,U.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,ii=U.hasStandardBrowserEnv?{write(t,e,n,r,o,i,s){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];g.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),g.isString(r)&&a.push(`path=${r}`),g.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),g.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function si(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function ai(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Hn(t,e,n){let r=!si(e);return t&&(r||n==!1)?ai(t,e):e}const Un=t=>t instanceof Z?{...t}:t;function pe(t,e){e=e||{};const n={};function r(u,f,d,m){return g.isPlainObject(u)&&g.isPlainObject(f)?g.merge.call({caseless:m},u,f):g.isPlainObject(f)?g.merge({},f):g.isArray(f)?f.slice():f}function o(u,f,d,m){if(g.isUndefined(f)){if(!g.isUndefined(u))return r(void 0,u,d,m)}else return r(u,f,d,m)}function i(u,f){if(!g.isUndefined(f))return r(void 0,f)}function s(u,f){if(g.isUndefined(f)){if(!g.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function a(u,f,d){if(d in e)return r(u,f);if(d in t)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,f,d)=>o(Un(u),Un(f),d,!0)};return g.forEach(Object.keys({...t,...e}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const d=g.hasOwnProp(c,f)?c[f]:o,m=d(t[f],e[f],f);g.isUndefined(m)&&d!==a||(n[f]=m)}),n}const Wn=t=>{const e=pe({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;if(e.headers=s=Z.from(s),e.url=On(Hn(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),g.isFormData(n)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(g.isFunction(n.getHeaders)){const c=n.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([f,d])=>{u.includes(f.toLowerCase())&&s.set(f,d)})}}if(U.hasStandardBrowserEnv&&(r&&g.isFunction(r)&&(r=r(e)),r||r!==!1&&oi(e.url))){const c=o&&i&&ii.read(i);c&&s.set(o,c)}return e},ci=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Wn(t);let i=o.data;const s=Z.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,f,d,m,b,p;function h(){b&&b(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function C(){if(!_)return;const L=Z.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),N={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:L,config:t,request:_};Bn(function(O){n(O),h()},function(O){r(O),h()},N),_=null}"onloadend"in _?_.onloadend=C:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(C)},_.onabort=function(){_&&(r(new S("Request aborted",S.ECONNABORTED,t,_)),_=null)},_.onerror=function(R){const N=R&&R.message?R.message:"Network Error",$=new S(N,S.ERR_NETWORK,t,_);$.event=R||null,r($),_=null},_.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const N=o.transitional||St;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),r(new S(R,N.clarifyTimeoutError?S.ETIMEDOUT:S.ECONNABORTED,t,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&g.forEach(s.toJSON(),function(R,N){_.setRequestHeader(N,R)}),g.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),u&&([m,p]=rt(u,!0),_.addEventListener("progress",m)),c&&_.upload&&([d,b]=rt(c),_.upload.addEventListener("progress",d),_.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(f=L=>{_&&(r(!L||L.type?new Be(null,t,_):L),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const E=ti(o.url);if(E&&U.protocols.indexOf(E)===-1){r(new S("Unsupported protocol "+E+":",S.ERR_BAD_REQUEST,t));return}_.send(i||null)})},di=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const i=function(u){if(!o){o=!0,a();const f=u instanceof Error?u:this.reason;r.abort(f instanceof S?f:new Be(f instanceof Error?f.message:f))}};let s=e&&setTimeout(()=>{s=null,i(new S(`timeout of ${e}ms exceeded`,S.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>g.asap(a),c}},li=function*(t,e){let n=t.byteLength;if(n{const o=ui(t,e);let i=0,s,a=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:f}=await o.next();if(u){a(),c.close();return}let d=f.byteLength;if(n){let m=i+=d;n(m)}c.enqueue(new Uint8Array(f))}catch(u){throw a(u),u}},cancel(c){return a(c),o.return()}},{highWaterMark:2})},zn=64*1024,{isFunction:ot}=g,fi=(({Request:t,Response:e})=>({Request:t,Response:e}))(g.global),{ReadableStream:Zn,TextEncoder:Gn}=g.global,Jn=(t,...e)=>{try{return!!t(...e)}catch{return!1}},gi=t=>{t=g.merge.call({skipUndefined:!0},fi,t);const{fetch:e,Request:n,Response:r}=t,o=e?ot(e):typeof fetch=="function",i=ot(n),s=ot(r);if(!o)return!1;const a=o&&ot(Zn),c=o&&(typeof Gn=="function"?(p=>h=>p.encode(h))(new Gn):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=i&&a&&Jn(()=>{let p=!1;const h=new n(U.origin,{body:new Zn,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!h}),f=s&&a&&Jn(()=>g.isReadableStream(new r("").body)),d={stream:f&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(h,_)=>{let C=h&&h[p];if(C)return C.call(h);throw new S(`Response type '${p}' is not supported`,S.ERR_NOT_SUPPORT,_)})});const m=async p=>{if(p==null)return 0;if(g.isBlob(p))return p.size;if(g.isSpecCompliantForm(p))return(await new n(U.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(g.isArrayBufferView(p)||g.isArrayBuffer(p))return p.byteLength;if(g.isURLSearchParams(p)&&(p=p+""),g.isString(p))return(await c(p)).byteLength},b=async(p,h)=>{const _=g.toFiniteNumber(p.getContentLength());return _??m(h)};return async p=>{let{url:h,method:_,data:C,signal:E,cancelToken:L,timeout:R,onDownloadProgress:N,onUploadProgress:$,responseType:O,headers:F,withCredentials:x="same-origin",fetchOptions:P}=Wn(p),B=e||fetch;O=O?(O+"").toLowerCase():"text";let q=di([E,L&&L.toAbortSignal()],R),A=null;const M=q&&q.unsubscribe&&(()=>{q.unsubscribe()});let K;try{if($&&u&&_!=="get"&&_!=="head"&&(K=await b(F,C))!==0){let J=new n(h,{method:"POST",body:C,duplex:"half"}),we;if(g.isFormData(C)&&(we=J.headers.get("content-type"))&&F.setContentType(we),J.body){const[ke,pt]=$n(K,rt(Vn($)));C=qn(J.body,zn,ke,pt)}}g.isString(x)||(x=x?"include":"omit");const V=i&&"credentials"in n.prototype,be={...P,signal:q,method:_.toUpperCase(),headers:F.normalize().toJSON(),body:C,duplex:"half",credentials:V?x:void 0};A=i&&new n(h,be);let G=await(i?B(A,P):B(h,be));const ut=f&&(O==="stream"||O==="response");if(f&&(N||ut&&M)){const J={};["status","statusText","headers"].forEach(xr=>{J[xr]=G[xr]});const we=g.toFiniteNumber(G.headers.get("content-length")),[ke,pt]=N&&$n(we,rt(Vn(N),!0))||[];G=new r(qn(G.body,zn,ke,()=>{pt&&pt(),M&&M()}),J)}O=O||"text";let Ve=await d[g.findKey(d,O)||"text"](G,p);return!ut&&M&&M(),await new Promise((J,we)=>{Bn(J,we,{data:Ve,headers:Z.from(G.headers),status:G.status,statusText:G.statusText,config:p,request:A})})}catch(V){throw M&&M(),V&&V.name==="TypeError"&&/Load failed|fetch/i.test(V.message)?Object.assign(new S("Network Error",S.ERR_NETWORK,p,A,V&&V.response),{cause:V.cause||V}):S.from(V,V&&V.code,p,A,V&&V.response)}}},hi=new Map,Xn=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:o}=e,i=[r,o,n];let s=i.length,a=s,c,u,f=hi;for(;a--;)c=i[a],u=f.get(c),u===void 0&&f.set(c,u=a?new Map:gi(e)),f=u;return u};Xn();const Nt={http:Do,xhr:ci,fetch:{get:Xn}};g.forEach(Nt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Qn=t=>`- ${t}`,_i=t=>g.isFunction(t)||t===null||t===!1;function mi(t,e){t=g.isArray(t)?t:[t];const{length:n}=t;let r,o;const i={};for(let s=0;s`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since : `+s.map(Qn).join(` `):" "+Qn(s[0]):"as no adapter specified";throw new S("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Kn={getAdapter:mi,adapters:Nt};function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Be(null,t)}function Yn(t){return Pt(t),t.headers=Z.from(t.headers),t.data=Rt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Kn.getAdapter(t.adapter||De.adapter,t)(t).then(function(r){return Pt(t),r.data=Rt.call(t,t.transformResponse,r),r.headers=Z.from(r.headers),r},function(r){return jn(r)||(Pt(t),r&&r.response&&(r.response.data=Rt.call(t,t.transformResponse,r.response),r.response.headers=Z.from(r.response.headers))),Promise.reject(r)})}const er="1.13.5",it={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{it[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tr={};it.transitional=function(e,n,r){function o(i,s){return"[Axios v"+er+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new S(o(s," has been removed"+(n?" in "+n:"")),S.ERR_DEPRECATED);return n&&!tr[s]&&(tr[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}},it.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function yi(t,e,n){if(typeof t!="object")throw new S("options must be an object",S.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],c=a===void 0||s(a,i,t);if(c!==!0)throw new S("option "+i+" must be "+c,S.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new S("Unknown option "+i,S.ERR_BAD_OPTION)}}const st={assertOptions:yi,validators:it},Q=st.validators;let fe=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fn,response:new Fn}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=pe(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&st.assertOptions(r,{silentJSONParsing:Q.transitional(Q.boolean),forcedJSONParsing:Q.transitional(Q.boolean),clarifyTimeoutError:Q.transitional(Q.boolean),legacyInterceptorReqResOrdering:Q.transitional(Q.boolean)},!1),o!=null&&(g.isFunction(o)?n.paramsSerializer={serialize:o}:st.assertOptions(o,{encode:Q.function,serialize:Q.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),st.assertOptions(n,{baseUrl:Q.spelling("baseURL"),withXsrfToken:Q.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&g.merge(i.common,i[n.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Z.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(n)===!1)return;c=c&&h.synchronous;const _=n.transitional||St;_&&_.legacyInterceptorReqResOrdering?a.unshift(h.fulfilled,h.rejected):a.push(h.fulfilled,h.rejected)});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let f,d=0,m;if(!c){const p=[Yn.bind(this),void 0];for(p.unshift(...a),p.push(...u),m=p.length,f=Promise.resolve(n);d{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new Be(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Tr(function(o){e=o}),cancel:e}}};function wi(t){return function(n){return t.apply(null,n)}}function Ci(t){return g.isObject(t)&&t.isAxiosError===!0}const At={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(At).forEach(([t,e])=>{At[e]=t});function nr(t){const e=new fe(t),n=Cn(fe.prototype.request,e);return g.extend(n,fe.prototype,e,{allOwnKeys:!0}),g.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return nr(pe(t,o))},n}const I=nr(De);I.Axios=fe,I.CanceledError=Be,I.CancelToken=bi,I.isCancel=jn,I.VERSION=er,I.toFormData=tt,I.AxiosError=S,I.Cancel=I.CanceledError,I.all=function(e){return Promise.all(e)},I.spread=wi,I.isAxiosError=Ci,I.mergeConfig=pe,I.AxiosHeaders=Z,I.formToJSON=t=>Mn(g.isHTMLForm(t)?new FormData(t):t),I.getAdapter=Kn.getAdapter,I.HttpStatusCode=At,I.default=I;const{Axios:Ys,AxiosError:ea,CanceledError:ta,isCancel:na,CancelToken:ra,VERSION:oa,all:ia,Cancel:sa,isAxiosError:aa,spread:ca,toFormData:da,AxiosHeaders:la,HttpStatusCode:ua,formToJSON:pa,getAdapter:fa,mergeConfig:ga}=I,Le=class Le{static get current(){return window.location.href}static get baseUrl(){const n=Le.current.match(/^((?:https?:\/\/)?[\w\.\-]+)\/?.*$/);return n?n[1]:null}static get isProductPage(){return window.$Discounty.isProductPage}static get isCartPage(){return Le.testUrlRegex(/.+\/cart/)}static get isHomePage(){return window.$Discounty.isHomePage}static get variantId(){return new URLSearchParams(window.location.search).get("variant")}static getLastSegment(e){var n;return e?((n=e.split("?")[0].split("/").pop())==null?void 0:n.split("#")[0])??"":""}};k(Le,"testUrlRegex",e=>{const n=Le.current;return!!(n&&e.test(n))});let j=Le;class xi{constructor(){k(this,"axios");this.axios=I.create(),this.axios.defaults.timeout=9e4,this.axios.defaults.baseURL=j.baseUrl??void 0,this.axios.defaults.headers["Content-Type"]="application/json"}async post(e,...n){return this.axios.post(e,...n).catch(r=>Promise.reject(r))}async addToCart(e){return this.post("/cart/add.js",{items:e})}}const vi=new xi;var v=(t=>(t.before="BEFORE",t.after="AFTER",t.start="START",t.end="END",t))(v||{});function Ti(t,e){e=Array.isArray(e)?e:[e];const n=e[e.length-1].nextSibling;function r(o,i){t.insertBefore(o,i||n)}return t.__k={nodeType:1,parentNode:t,firstChild:e[0],childNodes:e,insertBefore:r,appendChild:r,removeChild(o){t.removeChild(o)}}}const at=(t,e)=>{try{const n=document.createElement("div");e(t,n);const r=Ti(t,n);return t.removeChild(n),r}catch(n){return console.error("Error in createRootFragment",n),null}},Si=t=>{let e=t.nextSibling;for(;e;){if(e instanceof Element&&e.className!=="discounty-portal")return e;e=e.nextSibling}return null};function Ei(t){return{[v.before]:n=>at(n.parentElement??document.body,(r,o)=>r.insertBefore(o,n)),[v.after]:n=>{const r=Si(n);return at(n.parentElement??document.body,(o,i)=>r?o.insertBefore(i,r):o.appendChild(i))},[v.start]:n=>at(n,(r,o)=>r.prepend(o)),[v.end]:n=>at(n,(r,o)=>r.appendChild(o))}[t.injectionType](t.element)}class Li{constructor(){k(this,"axios");this.axios=I.create(),this.axios.defaults.timeout=9e4,this.axios.defaults.baseURL="https://api-discounty.hengam.io/graphql",this.axios.defaults.headers["Content-Type"]="application/json"}async post(...e){return this.axios.post("",...e).catch(n=>Promise.reject(n))}async getShopConfig(){const e=`query ShopConfig { appEmbed(shopifyDomain: "${T.domain}") { shopConfig { shopId cart { isActive styles content { totalText savingText } injectionInfo { selector injectionType } } globalConfig { appEnabled considerCurrencyExchangeRate customVariantListener { element isDatasetProperty property } developerModeVariantListener globalCss setTemplateCurrencyFormatAsDefault } volumeDiscount { content { buyColumnLabel discountText eachItemText getColumnLabel newPriceText title } injectionInfo { injectionType selector } isActive styles } miniVolumeDiscount { isActive injectionInfo { injectionType selector scopeSelector } } startCountDown { content { title daysLabel hoursLabel minutesLabel secondsLabel ctaText ctaLink } productPageInjectionInfo { injectionType selector } homepageInjectionInfo { injectionType selector } isActive styles } endCountDown { content { title daysLabel hoursLabel minutesLabel secondsLabel ctaText ctaLink } productPageInjectionInfo { injectionType selector } homepageInjectionInfo { injectionType selector } isActive styles } bxgyPopup { content { title subtitle btnAddLabel btnSelectLabel btnContinueLabel hideContinueBtn badgeShowFreeGift badgeType dismissType } injectionInfo { injectionType selector } isActive styles autoOpenDrawerEnabled } bxgyFab { content { isFabLeft hideCloseBtn } injectionInfo { injectionType selector } isActive styles } shipping { progressBarDiscount { discountType discountOperandType discountTiers countrySelectionType includedCountries excludedCountries } progressbar { activeOnCartPage activeOnProductPage content { thresholdInitialText thresholdProgressText thresholdReachedText } cartPageInjectionInfo { injectionType selector } cartDrawerInjectionInfo { injectionType selector } productPageInjectionInfo { injectionType selector } isActive styles } } } } }`;return this.post({operationName:"ShopConfig",query:e})}async getBxgyConfig(){const e=`query BxgyConfig { bxgyEmbed(shopifyDomain: "${T.domain}") { isActive } }`;return this.post({operationName:"BxgyConfig",query:e})}async getProductVariantsTimers(e){const n=`query ShopConfig { appEmbed(shopifyDomain: "${T.domain}") { productTimers(productId: ${e.toString()}){ variantId timerType value } } }`;return this.post({query:n})}async getBxgyRewards(e){const n=JSON.stringify(e).replace(/"/g,'\\"'),r=`query GetBxgyRewards { bxgyEmbed(shopifyDomain: "${T.domain}") { rewards(cartItems: "${n}"){ campaignId campaignName discount discountType rewardQuantity products { id image title variants { id price title } } } } }`;return this.post({query:r})}async getProductVolumeDiscounts(e){const n=`query GetVolumeDiscounts { appEmbed(shopifyDomain: "${T.domain}") { variantDiscounts(productIds: [${e.toString()}]){ productId variantId discount { discountTiers discountType operandType scopeType } } } }`;return this.post({query:n})}async getHomepageTimer(){const e=`query GetHomepageTimer { appEmbed(shopifyDomain: "${T.domain}") { homepageTimer { timerType value } } }`;return this.post({operationName:"GetHomepageTimer",query:e})}}const Te=new Li,It={hasEnded:!0,days:"00",hours:"00",minutes:"00",seconds:"00"},ki=[{selector:".product__title",injectionType:v.after},{selector:".product-details product-price",injectionType:v.end}],Ri=[{selector:".header-wrapper",injectionType:v.end},{selector:"sticky-header",injectionType:v.end},{selector:"header-component",injectionType:v.end},{selector:"header.header",injectionType:v.end},{selector:"header.header-section",injectionType:v.end}];function Ni(t){return[{selector:"body",injectionType:t==="bottom"?v.end:v.start}]}const ct=t=>String(Math.floor(t)).padStart(2,"0"),Pi=t=>{const e=new Date(t).getTime()-Date.now();return e<=0?It:{hasEnded:!1,days:ct(e/(1e3*60*60*24)),hours:ct(e/(1e3*60*60)%24),minutes:ct(e/1e3/60%60),seconds:ct(e/1e3%60)}},rr=t=>{const e=JSON.parse(t),n=`#${(e==null?void 0:e.backgroundColor)??"252237"}`,r=(e==null?void 0:e.backgroundType)??(e!=null&&e.backgroundColor?"single":"gradient"),o=`#${(e==null?void 0:e.gradientColor)??"4c4861"}`,i=(e==null?void 0:e.gradientAngle)??"50",s=`#${(e==null?void 0:e.textColor)??"ffffff"}`,a=`#${(e==null?void 0:e.numberColor)??"ff3e20"}`,c=`#${(e==null?void 0:e.numberBackgroundColor)??"ffffff"}`,u=`${(e==null?void 0:e.borderRadius)??"8"}px`,f=`#${(e==null?void 0:e.ctaBackgroundColor)??"ff3e20"}`,d=`#${(e==null?void 0:e.ctaTextColor)??"ffffff"}`,m=`#${(e==null?void 0:e.closeIconColor)??"dedede"}`,b=(e==null?void 0:e.position)??"top",p=(e==null?void 0:e.sticky)??!1,h=(e==null?void 0:e.showCta)??!0,_=(e==null?void 0:e.showCloseIcon)??!0,C=(e==null?void 0:e.clickableBanner)??!1,E=r==="gradient"?`linear-gradient(${i}deg, ${n}, ${o})`:`${n}`,L={backgroundColor:c,color:a,borderRadius:u},R={color:c},N={background:E,color:s},$={wrapper:{...N,borderRadius:u},timeBox:L,timeBoxLabel:R};return{banner:{...$,wrapper:{...N,...p?{position:"fixed",left:"0",right:"0",width:"80vw",opacity:"0.8",margin:"0.875em auto",borderRadius:u,cursor:C?"pointer":void 0,bottom:b==="bottom"?"0":void 0}:{}},cta:{backgroundColor:f,color:d,borderRadius:u},close:{color:m},showCta:h,showCloseIcon:_,clickableBanner:C,position:b,sticky:p,isStickyTop:p&&b==="top"},timer:$}};class Ai{constructor(){k(this,"data");k(this,"bxgy")}async initialize(){try{await Promise.all([this.fetchShopConfig(),this.fetchBxgyConfig()])}catch(e){y.error("[ShopInfo.initialize]: Error in fetching Shop config: ",e)}}async fetchShopConfig(){const e=this.getCachedShopConfig();if(e.isValid)this.data=e.data,y.info("[ShopInfo.fetchShopConfig]: Shop config found in window");else{const{data:n}=await Te.getShopConfig();this.data=n.data.appEmbed.shopConfig,y.info("[ShopInfo.fetchShopConfig]: Shop config fetched from API")}}getCachedShopConfig(){return window.$Discounty.shopData==null||new Date(window.$Discounty.shopData.expiresAt)<=new Date?{isValid:!1,data:null}:{isValid:!0,data:this.migrateShopConfig(window.$Discounty.shopData.shopConfig)}}migrateShopConfig(e){var n,r;if((n=e==null?void 0:e.startCountDown)!=null&&n.injectElement){const{injectionInfo:o,...i}=e.startCountDown;e.startCountDown={...i,productPageInjectionInfo:o||[]}}if((r=e==null?void 0:e.endCountDown)!=null&&r.injectElement){const{injectionInfo:o,...i}=e.endCountDown;e.endCountDown={...i,productPageInjectionInfo:o||[]}}return e}async fetchBxgyConfig(){const{data:e}=await Te.getBxgyConfig();this.bxgy=e.data.bxgyEmbed}get shopId(){return this.data.shopId}get domain(){var e;return(e=window.Shopify)!=null&&e.shop?window.Shopify.shop:window.$Discounty.shopDomain?window.$Discounty.shopDomain:window.location.host}get currency(){var e;return(e=window.Shopify)!=null&&e.currency?{active:window.Shopify.currency.active,rate:+window.Shopify.currency.rate}:{active:"USD",rate:1}}get country(){var e;return((e=window.Shopify)==null?void 0:e.country)||void 0}get locale(){if(this.currency.active==="EUR")return"de-DE";const{country:e,locale:n}=window.Shopify,r=(n??"").includes("-");return n&&!r&&e?`${n}-${e}`:n||void 0}get isAppEnabled(){return this.data.globalConfig.appEnabled}get considerCurrencyExchangeRate(){return this.data.globalConfig.considerCurrencyExchangeRate??!0}get hasDeveloperModeVariantListener(){return this.data.globalConfig.developerModeVariantListener}get customVariantListener(){return this.data.globalConfig.customVariantListener}get globalCss(){return this.data.globalConfig.globalCss}get setTemplateCurrencyFormatAsDefault(){return this.data.globalConfig.setTemplateCurrencyFormatAsDefault??!1}get volumeDiscountWidget(){const e=JSON.parse(this.data.volumeDiscount.styles),n={table:` background-color: #${e==null?void 0:e.tableBackgroundColor} !important; background: #${e==null?void 0:e.tableBackgroundColor} !important; border: 1px solid #${(e==null?void 0:e.borderColor)??(e==null?void 0:e.tableTextColor)??"000"} !important; border-radius: ${(e==null?void 0:e.borderRadius)??8}px !important; color: #${e==null?void 0:e.tableTextColor} !important; `,tableRow:`border: 1px solid #${(e==null?void 0:e.borderColor)??"000"};`,title:`color: #${e==null?void 0:e.titleColor} !important;`};return{...this.data.volumeDiscount,styles:n}}get miniVolumeDiscount(){return this.data.miniVolumeDiscount}get cartWidget(){const e=JSON.parse(this.data.cart.styles),n={savingRow:` color: #${(e==null?void 0:e.savingTextColor)??"007f5f"} !important; ${(e==null?void 0:e.showSavingBorder)==null||(e==null?void 0:e.showSavingBorder)===!0?`border: 1px solid #${(e==null?void 0:e.borderColor)??"007f5f"} !important; border-radius: ${(e==null?void 0:e.borderRadius)??8}px !important; padding: 0 8px`:""}`,totalRow:`color: #${e==null?void 0:e.totalTextColor} !important;`};return{...this.data.cart,styles:n}}get startCountdownWidget(){return{...this.data.startCountDown,styles:rr(this.data.startCountDown.styles)}}get endCountdownWidget(){return{...this.data.endCountDown,styles:rr(this.data.endCountDown.styles)}}get bxgyWidget(){return this.bxgy}get bxgyPopupWidget(){const e=JSON.parse(this.data.bxgyPopup.styles),n={disabledOpacity:.4,primaryBackgroundColor:{backgroundColor:`#${(e==null?void 0:e.primaryColor)??"000000"}`},primaryBorderColor:{borderColor:`#${(e==null?void 0:e.primaryColor)??"000000"}`},primaryTextColor:{color:`#${(e==null?void 0:e.primaryColor)??"000000"}`},secondaryBackgroundColor:{backgroundColor:`#${(e==null?void 0:e.secondaryColor)??"FFFFFF"}`},secondaryTextColor:{color:`#${(e==null?void 0:e.secondaryColor)??"FFFFFF"}`},borderColor:{borderColor:`#${(e==null?void 0:e.borderColor)??"C0C0C0"}`},borderBackgroundColor:{backgroundColor:`#${(e==null?void 0:e.borderColor)??"C0C0C0"}`},PopupBackgroundColor:{backgroundColor:`#${(e==null?void 0:e.backgroundColor)??"F4F4F4"}`},headerBackgroundColor:{backgroundColor:`#${(e==null?void 0:e.headerBackgroundColor)??"616161"}`},headerTextColor:{color:`#${(e==null?void 0:e.headerTextColor)??"FFFFFF"}`},badgeBackgroundColor:{backgroundColor:`#${(e==null?void 0:e.saleBadgeColor)??"3752B2"}`}};return{...this.data.bxgyPopup,styles:n}}get bxgyFabWidget(){const e=JSON.parse(this.data.bxgyFab.styles),{isFabLeft:n}=this.data.bxgyFab.content,r={container:{left:n?"12pt":"auto",right:n?"auto":"12pt"},button:{backgroundColor:`#${(e==null?void 0:e.backgroundColor)??"03A87C"}`,borderRadius:`${(e==null?void 0:e.radius)??20}px`},closeButton:{backgroundColor:`#${(e==null?void 0:e.closeColor)??"FFFFFF"}`},fabIconColor:{color:`#${(e==null?void 0:e.iconColor)??"FFFFFF"}`},closeIconColor:{color:`#${(e==null?void 0:e.closeIconColor)??"C0C0C0"}`}};return{...this.data.bxgyFab,styles:r}}get shipping(){return this.data.shipping}}const T=new Ai;class W{static getNumeric(e){var n,r;return Number(((r=(n=e.match(/\b\d[\d,.]*\b/g))==null?void 0:n[0])==null?void 0:r.replace(/[.,]/g,""))??"0")}static format(e,n=!1){if(typeof e=="string"&&T.currency.rate===1)return e;const r=typeof e=="string"?W.getNumeric(e):e;if(typeof r!="number"||isNaN(r))return y.error(`Invalid "money" input: ${e}, type: ${typeof e}`),"Invalid value";const i={currencyRate:!n&&T.considerCurrencyExchangeRate&&!isNaN(T.currency.rate)?T.currency.rate:1,locale:T.locale,currency:T.currency.active};try{const s=(r/100*i.currencyRate).toFixed(2);let c=new Intl.NumberFormat(i.locale,{style:T.setTemplateCurrencyFormatAsDefault?"decimal":"currency",currency:i.currency,...T.setTemplateCurrencyFormatAsDefault?{minimumFractionDigits:2,maximumFractionDigits:2}:{}}).format(parseFloat(s));return T.setTemplateCurrencyFormatAsDefault&&(c=window.$Discounty.currencyFormat.replace("{{money}}",c)),c}catch(s){return y.error(`Error in formatting money: ${e}, ${s instanceof Error?s.message:"Unknown error"}`),"Invalid value"}}}const Ii={1:"#0cd4a7",2:"#6464f4",3:"#ffc107",4:"#dc3545"};class Oi{constructor(){k(this,"appName");k(this,"isEnabled",!1)}enableLogs(){this.appName="Discounty",this.isEnabled=!0}debug(e,...n){this.log(1,e,n)}info(e,...n){this.log(2,e,n)}warn(e,...n){this.log(3,e,n)}error(e,...n){this.log(4,e,n)}log(e,n,r=[]){if(!this.isEnabled)return;const o=`color:${Ii[e]};font-weight:500;font-size:12px`;console.log(`%c[${this.appName}]`,o,n,...r)}}const y=new Oi;class Fi{constructor(){k(this,"loadedProducts",{});var e,n;(n=(e=window.$Discounty)==null?void 0:e.preloadedProducts)==null||n.forEach(r=>{r.handle&&(this.loadedProducts[encodeURI(r.handle)]=r)})}async fetchProducts(e){const n=e.filter(r=>!this.loadedProducts[r]&&!this.loadedProducts[encodeURI(r)]);if(n.length>0)try{(await Promise.all(n.map(o=>I.get(`${j.baseUrl}/products/${o}.js`).catch(()=>null)))).forEach(o=>{if(!o)return;const i=o.data;i.handle&&(this.loadedProducts[encodeURI(i.handle)]=i)})}catch(r){y.warn(`Error in fetching Shopify Products API: ${r}`)}return e.map(r=>this.loadedProducts[encodeURI(r)]??this.loadedProducts[r]).filter(Boolean)}}const Mi=new Fi;class or{static async updateCartDrawerUI(){if(!T.bxgyPopupWidget.autoOpenDrawerEnabled)return;const e=document.querySelector("cart-drawer");if(e)try{const r=await(await fetch(window.location.href)).text(),s=new DOMParser().parseFromString(r,"text/html").querySelector("cart-drawer");s&&(e.innerHTML=s.innerHTML,e.classList.remove("is-empty"),document.body.classList.add("overflow-hidden"),e.classList.add("active"))}catch(n){y.error("Failed to update cart drawer UI:",n)}}static dispatchCartUpdateEvent(e=1,n="product-form-component"){document.dispatchEvent(new CustomEvent("cart:update",{bubbles:!0,detail:{data:{itemCount:e,source:n}}}))}}function Di(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function ir(t,e={}){const n=e.scope??document.body;return t.filter(r=>!!r.selector).map(r=>{const o=n.querySelector(r.selector);return o?{element:o,injectionType:r.injectionType,uid:Di()}:null}).filter(r=>r!=null)}function ge(t,e,n){const r=ir(t,{scope:n});if(r.length>0)return r;const o=ir(e,{scope:n})[0];return o?[o]:[]}const ji=()=>typeof window>"u"?!1:window.innerWidth<=768,Bi=()=>{const t="discountyStatus",e=document.documentElement.dataset[t]==="loaded";return e?y.info("SDK has loaded"):document.documentElement.dataset[t]="loaded",e},$i=()=>"localStorage"in window&&"discounty-logs"in localStorage,Se=t=>{const e=document.body,n=document.createElement("div");e.appendChild(n),Ze(t,n)},Vi=t=>{const{element:e,injectionType:n,uid:r}=t;switch(n){case v.start:case v.end:return e.querySelector(`.discounty-portal[data-fragment-id="${r}"]`);case v.before:{let o=e.previousElementSibling;for(;o;){if(o.classList.contains("discounty-portal")&&o.getAttribute("data-fragment-id")===r)return o;o=o.previousElementSibling}return null}case v.after:{let o=e.nextElementSibling;for(;o;){if(o.classList.contains("discounty-portal")&&o.getAttribute("data-fragment-id")===r)return o;o=o.nextElementSibling}return null}default:return null}},Hi=(t,e)=>t.length!==e.length?!1:t.every(n=>{const r=Vi(n);return!r||!document.body.contains(r)?!1:e.some(o=>n.element===o.element&&n.injectionType===o.injectionType)}),Ui=t=>{const[e,n]=H(()=>t()),r=rn(e);return ne(()=>{const o=new MutationObserver(()=>{const i=t();Hi(r.current,i)||(y.info("updating containers",i.map(s=>s.element)),r.current=i,n(i))});return o.observe(document.body,{childList:!0,subtree:!0}),()=>o.disconnect()},[t]),{fragmentInfos:e}};function Ot({children:t,wrapper:e}){return Br(l(X,{children:t}),e)}function he({children:t,getFragmentInfos:e}){const{fragmentInfos:n}=Ui(e);return l(X,{children:n.map(r=>l(Ot,{wrapper:Ei(r),children:l("div",{className:"discounty-portal","data-fragment-id":r.uid,children:t})},r.uid))})}function Wi({onResponse:t}){const e=new WeakMap,n=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(o,i,s=!0,a,c){e.set(this,i.toString()),n.call(this,o,i,s,a,c)};const r=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(o){this.addEventListener("readystatechange",()=>{if(this.readyState===4&&this.status===200)try{const i=e.get(this);i&&t(i,JSON.parse(this.responseText))}catch{}}),r.call(this,o)}}class qi{constructor(){k(this,"cartItems");k(this,"listeners");k(this,"cartCurrency");k(this,"isStarted",!1);k(this,"isAddToCartUrl",e=>e.includes("cart")&&e.includes("add"));k(this,"isChangeCartUrl",e=>e.includes("cart")&&/change|update|clear/.test(e));k(this,"isCartUrl",e=>e.endsWith("cart.js")||e.endsWith("cart.json"));k(this,"isValidCartItem",e=>e&&(e==null?void 0:e.handle)&&(e==null?void 0:e.id)&&typeof(e==null?void 0:e.original_line_price)=="number"&&typeof(e==null?void 0:e.quantity)=="number"&&typeof(e==null?void 0:e.final_price)=="number"&&(e==null?void 0:e.product_id)&&(e==null?void 0:e.variant_id));k(this,"getValidCartItems",e=>(Array.isArray(e)?e:[]).filter(this.isValidCartItem));this.listeners=[],this.cartItems=window.$Discounty.initialCart}addListener(e){this.listeners.push(e),e(this.cartItems)}removeListener(e){this.listeners=this.listeners.filter(n=>n!==e)}notifyListeners(){this.listeners.forEach(e=>e(this.cartItems))}start(){this.isStarted||(y.info("Starting CartChangeDetector"),this.isStarted=!0,this.setupFetchInterception(),this.setupXMLHttpRequestInterception())}setupFetchInterception(){const e=this.processResponse.bind(this),n=window.fetch;window.fetch=async(...r)=>{const o=await n(...r);if(!o||!o.clone||!o.ok)return o;try{const i=await o.clone().json();e(r[0].toString(),i)}catch{}return o}}setupXMLHttpRequestInterception(){Wi({onResponse:this.processResponse.bind(this)})}getCart(){y.info('Re-call "cart.js" api due to calling "add.js"'),I.get(`${j.baseUrl}/cart.js`).catch(e=>y.error(`Error in fetching cart.js: ${JSON.stringify(e)}`))}processResponse(e,n){if(!(!n||!this.isAddToCartUrl(e)&&!this.isChangeCartUrl(e)&&!this.isCartUrl(e))){y.info(`Processing cart request: ${e}`);try{if(this.isChangeCartUrl(e)||this.isCartUrl(e)){if(!n.items){y.warn('Processing cart request: Invalid "data.items"',n);return}this.cartItems=this.getValidCartItems(n.items),this.cartCurrency=n==null?void 0:n.currency}else if(this.isAddToCartUrl(e)){const r=n.items?n.items[0]:n;this.cartItems=this.getValidCartItems([...this.cartItems.filter(o=>o.variant_id!==r.variant_id),r]),this.getCart()}y.info("Cart updated",this.cartItems),this.notifyListeners()}catch(r){y.error(`Error in processing cart request: ${r}`)}}}get isActiveCurrencySameAsCartCurrency(){var e,n;return this.cartCurrency===((n=(e=window.Shopify)==null?void 0:e.currency)==null?void 0:n.active)}}const re=new qi,zi=()=>{const[t,e]=H(0),[n,r]=H(0),o=async s=>{const a=s.map(c=>c.handle);return await Mi.fetchProducts(a)},i=async s=>{const a=await o(s);return s.reduce((c,u)=>{const f=a.find(m=>m.id===u.product_id),d=f==null?void 0:f.variants.find(m=>m.id===u.variant_id);return d!=null&&d.compare_at_price&&d.compare_at_price>0&&u.final_line_price===u.original_line_price?c+d.compare_at_price*u.quantity:c+u.original_line_price},0)};return ne(()=>{const s=async a=>{if(!a||a.length<=0)return;const c=await i(a),u=wn(a).total;r(c-u),e(c)};return re.addListener(s),()=>re.removeListener(s)},[]),{totalPrice:t,discount:n}},Zi=()=>{const{totalPrice:t,discount:e}=zi();if(e<=0)return y.info("[CartWidget]: Discount is 0, skip rendering"),null;const{content:n,styles:r}=T.cartWidget;return l("div",{class:"discounty-cart-widget__wrapper",children:l("div",{className:"discounty-cart-widget",children:[l("div",{className:"discounty-cart-widget__row discounty-cart-widget__total-row",style:r.totalRow,children:[l("span",{className:"discounty-cart-widget__total-label",children:n.totalText}),l("span",{className:"discounty-cart-widget__total-amount discounty-cart-widget__line-through",children:W.format(t,re.isActiveCurrencySameAsCartCurrency)})]}),l("div",{className:"discounty-cart-widget__row discounty-cart-widget__saving-row",style:r.savingRow,children:[l("span",{className:"discounty-cart-widget__saving-label",children:n.savingText}),l("span",{className:"discounty-cart-widget__saving-amount",children:W.format(e,re.isActiveCurrencySameAsCartCurrency)})]})]})})},Gi=[{selector:"#main-cart-footer > .page-width",injectionType:v.start},{selector:"#main-cart-footer",injectionType:v.start},{selector:".cart-out",injectionType:v.start},{selector:".checkout-subtotal-container",injectionType:v.start},{selector:".cart-totals",injectionType:v.start},{selector:".ajax-cart__final-details",injectionType:v.start},{selector:".cart__blocks",injectionType:v.start},{selector:".cart__footer",injectionType:v.start}],Ji=[{selector:".cart__footer__content",injectionType:v.start},{selector:".cart-drawer__footer",injectionType:v.start},{selector:".drawer__footer",injectionType:v.start},{selector:".rebuy-cart__flyout-subtotal",injectionType:v.before},{selector:".cart-drawer__summary-total",injectionType:v.before},{selector:".bottom-total",injectionType:v.before},{selector:"subtotal-price",injectionType:v.before},{selector:".cart-items-component .cart__total-container",injectionType:v.before}],Xi=[...Gi,...Ji];class Qi{static start(){if(!T.cartWidget.isActive){y.warn("[CartWidget]: Widget is disabled");return}y.info("[CartWidget]: Starting service"),this.injectCartWidgetElements(),re.start()}static injectCartWidgetElements(){y.info("[CartWidget]: Injecting widget"),Se(l(he,{getFragmentInfos:()=>ge(T.cartWidget.injectionInfo,Xi),children:l(Zi,{})}))}}var ie=(t=>(t[t.PERCENTAGE=1]="PERCENTAGE",t[t.FIXED_AMOUNT_ON_ORDER=2]="FIXED_AMOUNT_ON_ORDER",t[t.FIXED_AMOUNT_PER_ITEM=3]="FIXED_AMOUNT_PER_ITEM",t[t.NEW_PRICE=4]="NEW_PRICE",t))(ie||{}),sr=(t=>(t[t.COUNT_OF_ITEMS=1]="COUNT_OF_ITEMS",t[t.PRICE_OF_ITEMS=2]="PRICE_OF_ITEMS",t))(sr||{});const Ki=(t,e)=>{const{content:n}=T.volumeDiscountWidget;return{[ie.PERCENTAGE]:o=>n.discountText.replace(/{{discount}}/gi,`${o}%`),[ie.FIXED_AMOUNT_ON_ORDER]:o=>n.discountText.replace(/{{discount}}/gi,W.format(o)),[ie.FIXED_AMOUNT_PER_ITEM]:o=>`${n.discountText.replace(/{{discount}}/gi,W.format(o))} ${n.eachItemText}`,[ie.NEW_PRICE]:o=>n.newPriceText.replace(/{{new-price}}/gi,W.format(o))}[t](e)},Yi=(t,e)=>`${t===sr.COUNT_OF_ITEMS?e:W.format(e)}+`,ar=t=>t?{...t,tiers:t.tiers.map(e=>({discount:Ki(t.discount_type,e.discount),criteria:Yi(t.operand_type,e.criteria)}))}:null;class cr{constructor(e){k(this,"_product");this._product={id:e.id,handle:e.handle,variants:e.variants.map(n=>({...n,discounts:"discounts"in n?n.discounts:[]}))}}get product(){return this._product}get id(){return this.product.id}get handle(){return this.product.handle}get variants(){return this.product.variants}get firstVolumeDiscount(){var n,r;const e=(r=(n=this.variants.find(o=>{var i;return(i=o==null?void 0:o.discounts)==null?void 0:i.length}))==null?void 0:n.discounts)==null?void 0:r[0];return{data:e,formatted:e?ar(e):null}}get hasVolumeDiscount(){return!!this.firstVolumeDiscount.data}getVolumeDiscount(e){var r,o;const n=(o=(r=this.variants.find(i=>i.id===e))==null?void 0:r.discounts)==null?void 0:o[0];return n&&"meta_variant_id"in n&&n.meta_variant_id!==null&&n.meta_variant_id!==e.toString()?{data:null,formatted:null}:{data:n??null,formatted:n?ar(n):null}}setVolumeDiscount(e,n){const r=this.variants.find(i=>i.id===e);if(!r||!n)return;let o=[];try{o=JSON.parse(n.discountTiers),String(n.discountType)!=="PERCENTAGE"&&(o=o.map(i=>({...i,discount:typeof i.discount=="number"?i.discount*100:i.discount})))}catch{o=[]}r.discounts=[{id:String(r.id),meta_variant_id:"",operand_type:n.operandType,discount_type:n.discountType,tiers:o}]}}const _e=class _e{constructor(){k(this,"loadedProducts",new Map);k(this,"fetchPromises",new Map);this.prepareInitialProducts()}static getInstance(){return!_e.instance&&(_e.instance=new _e),_e.instance}prepareInitialProducts(){var n;(((n=window.$Discounty)==null?void 0:n.products)||[]).forEach(r=>{r.handle&&this.loadedProducts.set(decodeURI(r.handle),new cr(r))})}get singleProduct(){return j.isProductPage&&this.loadedProducts.values().next().value||null}async loadProducts(e){const n=e.map(o=>this.getProduct(decodeURI(o))),r=(await Promise.all(n)).filter(o=>!!o);return await this.fetchProductsVolumeDiscount(r)}async getProduct(e){return this.loadedProducts.has(e)?this.loadedProducts.get(e)??null:(this.fetchPromises.has(e)||this.fetchPromises.set(e,this.fetchAndCacheProduct(e)),this.fetchPromises.get(e)??null)}async fetchAndCacheProduct(e){try{const n=await I.get(`${j.baseUrl}/products/${e}.js`);return this.cacheProduct(n.data)}catch(n){return y.error(`Failed to fetch product ${e}: ${n}`),null}finally{this.fetchPromises.delete(e)}}cacheProduct(e){if(!e.handle)return null;const n=new cr(e);return this.loadedProducts.set(decodeURI(e.handle),n),n}async fetchProductsVolumeDiscount(e){const n=e.filter(r=>!r.hasVolumeDiscount).map(r=>r.id);return n.length?Te.getProductVolumeDiscounts(n).then(r=>{const o=r.data.data.appEmbed.variantDiscounts;return!o||!(o!=null&&o.length)||o.forEach(i=>{const s=e.find(a=>a.id===i.productId);s&&s.setVolumeDiscount(i.variantId,i.discount)}),e}).catch(r=>(y.error(`Error in fetching volume discounts of products: ${JSON.stringify(r)}`),e)):e}};k(_e,"instance");let Ft=_e;const Ee=Ft.getInstance(),ee=class ee{static async initialize(e){return this.productCardSelector=e,this.observer=new MutationObserver(this.loadCards),this.observer.observe(document.body,{childList:!0,subtree:!0}),this.loadCards()}static addListener(e){this.listeners.push(e),e(this.loadedCards)}static notifyListeners(){this.listeners.forEach(e=>e(this.loadedCards))}static get cardLinkElements(){const e=Array.from(document.querySelectorAll(`${this.productCardSelector} a[href*="/products/"]:not([data-discounty-processed])`));return this.deduplicateLinkElements(e)}static loadCards(){var e;if((e=this.cardLinkElements)!=null&&e.length)return this.cardLinkElements.forEach(n=>{const r=j.getLastSegment(n.href);!this.loadedCards[r]&&(this.loadedCards[r]=this.findCards(r)),n.setAttribute("data-discounty-processed","true")}),this.notifyListeners(),this.loadedCards}static deduplicateLinkElements(e){const n=[".jpg",".jpeg",".png",".gif",".svg",".webp"];return e.reduce((r,o)=>{const i=j.getLastSegment(o.href);return!i||r.some(s=>s.href.includes(i))||n.some(s=>i.includes(s))?r:[...r,o]},[])}};k(ee,"listeners",[]),k(ee,"loadedCards",{}),k(ee,"observer"),k(ee,"productCardSelector"),k(ee,"findCards",e=>{const n=encodeURI(e);return Array.from(document.querySelectorAll(`${ee.productCardSelector} a[href*="${n}"]:not([data-discounty-processed])`)).filter(o=>j.getLastSegment(o==null?void 0:o.href)===n?(o.setAttribute("data-discounty-processed","true"),!0):!1).map(o=>ee.getHighestSpecificParent(o,n)).filter((o,i,s)=>o!==null&&s.indexOf(o)===i)}),k(ee,"getHighestSpecificParent",(e,n)=>{if(!e.parentElement)return e.querySelectorAll(`a[href*="products/${n}"]`).length===0?null:e;const r=e.parentElement.querySelectorAll(`a[href*="products/${n}"]`),o=e.parentElement.querySelectorAll('a[href*="products/"]');return r.length{var r,o,i,s;if(!t)return null;const e=(o=(r=t.tiers)==null?void 0:r[0])==null?void 0:o.discount,n=(s=(i=t.tiers)==null?void 0:i[t.tiers.length-1])==null?void 0:s.discount;if(!e||!n)return null;switch(t.discount_type){case ie.PERCENTAGE:return`${e}% off`;case ie.FIXED_AMOUNT_ON_ORDER:case ie.FIXED_AMOUNT_PER_ITEM:return`${W.format(e)} off`;case ie.NEW_PRICE:return`${W.format(n)}`;default:return`${e}% off`}},ts=({discount:t})=>{const e=es({discount:t});return e?l("div",{className:"discounty-volume-badge-container",children:l("div",{className:"discounty-volume-badge",children:l("span",{className:"discounty-volume-badge__text",children:["From ",e]})})}):null};function ns(){const[t,e]=H({total:0,quantity:0});return ne(()=>{const n=r=>{e(wn(r))};return re.addListener(n),()=>re.removeListener(n)},[]),{cartTotal:t.total,cartQuantity:t.quantity}}class rs{constructor(e){k(this,"addUrlVariantChangeListener",()=>{let e,n;setInterval(()=>{n=j.variantId,n&&n!==e&&(e=n,this.onChange(n))},100)});this.onChange=e,this.addUrlVariantChangeListener()}getCurrentVariantId(e){const n=j.variantId;return n&&e.includes(n)?n:null}}const ce=class ce{constructor(e){k(this,"getInputValue",e=>{if(e instanceof HTMLInputElement&&e.type==="radio"){const n=document.querySelector(`input[name="${e.name}"]:checked`);return(n==null?void 0:n.value)??""}return e.value});k(this,"handleGlobalInput",e=>{const n=e.target;(n instanceof HTMLInputElement||n instanceof HTMLSelectElement)&&ce.POSSIBLE_NAMES.includes(n.name.toLowerCase())&&this.onChange(this.getInputValue(n))});this.onChange=e,this.setupGlobalListener()}getCurrentVariantId(e){const n=Array.from(document.querySelectorAll(ce.INPUT_SELECTOR)).find(r=>e.includes(r.value));return n?this.getInputValue(n):null}setupGlobalListener(){document.body.addEventListener("input",this.handleGlobalInput,{capture:!0}),document.body.addEventListener("change",this.handleGlobalInput,{capture:!0})}};k(ce,"POSSIBLE_NAMES",["id","id[]","variantId","variant","variant_id","variant-id"]),k(ce,"INPUT_SELECTOR",[...ce.POSSIBLE_NAMES.map(e=>`input[name="${e}"]`),...ce.POSSIBLE_NAMES.map(e=>`select[name="${e}"]`)].join(","));let Mt=ce;const os="discounty:updateVariant";class is{constructor(e){k(this,"lastVariantId",null);this.onChange=e,this.setupListener()}getCurrentVariantId(e){return this.lastVariantId&&e.includes(this.lastVariantId)?this.lastVariantId:null}setupListener(){window.addEventListener(os,e=>{const n=String(e.detail.selectedVariantId);n&&(this.lastVariantId=n,this.onChange(n))})}}class ss{constructor(){k(this,"map");k(this,"keyMapping");this.map=new Map,this.keyMapping=new Map}set(e,n){const r=Symbol("id");e.forEach(o=>this.keyMapping.set(o,r)),this.map.set(r,n)}get(e){const n=Array.isArray(e)?e[0]:e,r=this.keyMapping.get(n);return r?this.map.get(r):void 0}has(e){const n=Array.isArray(e)?e[0]:e;return this.keyMapping.has(n)}getAllKeys(e){const n=this.keyMapping.get(e);return n?Array.from(this.keyMapping.entries()).filter(([r,o])=>o===n).map(([r])=>r):[]}}const me=class me{constructor(){k(this,"subscribers",new ss);k(this,"urlVariantTracker");k(this,"inputVariantTracker");k(this,"eventVariantTracker");k(this,"variantsTrackedByUrl",new Set);this.urlVariantTracker=new rs(e=>{y.info(`Variant change detected by url: ${e}`),this.subscribers.getAllKeys(e).forEach(n=>this.variantsTrackedByUrl.add(n)),this.notifySubscribers(e)}),this.eventVariantTracker=new is(e=>{y.info(`Variant change detected by event: ${e}`),this.notifySubscribers(e)}),this.inputVariantTracker=new Mt(e=>{this.variantsTrackedByUrl.has(e)||(y.info(`Variant change detected by input: ${e}`),this.notifySubscribers(e))})}static getInstance(){return me.instance||(me.instance=new me),me.instance}subscribe(e,n){var r;this.subscribers.has(e)||this.subscribers.set(e,new Set),(r=this.subscribers.get(e))==null||r.add(n),this.emitInitialState(e,n)}unsubscribe(e,n){var r;(r=this.subscribers.get(e))==null||r.delete(n)}notifySubscribers(e){var n;e&&((n=this.subscribers.get(e))==null||n.forEach(r=>r(e)))}emitInitialState(e,n){const r=this.urlVariantTracker.getCurrentVariantId(e)||this.eventVariantTracker.getCurrentVariantId(e)||this.inputVariantTracker.getCurrentVariantId(e);r&&n(r)}};k(me,"instance");let lt=me;const dr=()=>{const[t,e]=H(()=>{var n,r;return j.isProductPage?(r=(n=window.$Discounty.initialSelectedVariant)==null?void 0:n.id)==null?void 0:r.toString():null});return ne(()=>{if(!Ee.singleProduct)return;const n=Ee.singleProduct.variants.map(r=>r.id.toString());return lt.getInstance().subscribe(n,e),()=>lt.getInstance().unsubscribe(n,e)},[]),t},as=()=>{var o;const t=dr(),e=t?(o=Ee.singleProduct)==null?void 0:o.getVolumeDiscount(Number(t)).formatted:null;if(!e)return null;const{content:n,styles:r}=T.volumeDiscountWidget;return l("div",{className:"discounty-volume-discount-widget",children:[l("p",{className:"discounty-volume-discount-widget__title",style:r.title,children:n.title}),l("div",{className:"discounty-volume-discount-widget__table-wrapper",style:r.table,children:l("table",{className:"discounty-volume-discount-widget__table",children:[l("thead",{children:l("tr",{style:r.tableRow,children:[l("th",{className:"discounty-volume-discount-widget__buy-label",children:n.buyColumnLabel}),l("th",{className:"discounty-volume-discount-widget__get-label",children:n.getColumnLabel})]})}),l("tbody",{children:e.tiers.map(i=>l("tr",{style:r.tableRow,children:[l("td",{className:"discounty-volume-discount-widget__criteria",children:i.criteria}),l("td",{className:"discounty-volume-discount-widget__discount",children:i.discount})]}))})]})})]})},cs=[{selector:".gp-integration-discounty-block",injectionType:v.start},{selector:".product-form__buttons",injectionType:v.start},{selector:".product-form-buttons",injectionType:v.before},{selector:".buy-buttons-block",injectionType:v.before},{selector:".product-form",injectionType:v.start}],ds=[{selector:".product-item > .product-item__info .product-item__price-list",injectionType:v.after},{selector:".product-card-wrapper .card__information .card-information",injectionType:v.after},{selector:".product-card .product-card__content .group-block",injectionType:v.after}];class ls{static start(){var e;if(!T.volumeDiscountWidget.isActive)return y.warn("[VolumeDiscountWidget]: Widget is disabled");if(j.isProductPage)this.renderWidget();else{if(!T.miniVolumeDiscount.isActive)return y.warn("[MiniVolumeDiscountWidget]: Widget is disabled");const n=(e=T.miniVolumeDiscount.injectionInfo[0])==null?void 0:e.scopeSelector;if(!n)return y.error("[MiniVolumeDiscountWidget]: Product card selector (scopeSelector) is required.");dt.initialize(n),dt.addListener(this.renderWidgets)}}static async renderWidgets(e){y.info("[MiniVolumeDiscountWidget]: Injecting widget");try{const n=Object.keys(e);(await Ee.loadProducts(n)).filter(o=>o.hasVolumeDiscount).forEach(o=>{const i=e[o.handle][0]??void 0;Se(l(he,{getFragmentInfos:()=>ge(T.miniVolumeDiscount.injectionInfo,ds,i),children:l(ts,{discount:o.firstVolumeDiscount.data})}))})}catch(n){y.error(`Error in injecting mini volume discount widgets: ${n}`)}}static renderWidget(){y.info("[VolumeDiscountWidget]: Injecting widget"),Se(l(he,{getFragmentInfos:()=>ge(T.volumeDiscountWidget.injectionInfo,cs),children:l(as,{})}))}}function lr({value:t,label:e,styles:n}){const r=[{amount:t.days,label:e.days},{amount:t.hours,label:e.hours},{amount:t.minutes,label:e.minutes},{amount:t.seconds,label:e.seconds}];return l("div",{className:"discounty-count-down-timer-widget__timer",children:r.map(({amount:o,label:i})=>l("div",{className:"discounty-count-down-timer-widget__time-box",children:[l("div",{className:"discounty-count-down-timer-widget__time-amount",style:n.box,children:o}),l("div",{className:"discounty-count-down-timer-widget__time-label",style:n.label,children:i})]},i))})}const ur=t=>{const[e,n]=H(It);return ne(()=>{let r=null;const o=()=>{r&&window.clearInterval(r)};if(!t){n(It),o();return}const i=()=>{const s=Pi(t);n(s),s.hasEnded&&o()};return i(),r=window.setInterval(i,1e3),o},[t]),e},us=({value:t,content:e,styles:n})=>{const[r,o]=H(!0),{hasEnded:i,...s}=ur(t==null?void 0:t.value);if(!t||i||!r)return null;const a=()=>{o(!1)},c=()=>{e.ctaLink&&(window.location.href=e.ctaLink)};return l("div",{className:"discounty-count-down-timer-widget discounty-countdown-banner-widget",style:n.wrapper,onClick:n.clickableBanner?c:void 0,children:[l("div",{className:"discounty-countdown-banner-widget__content",children:[l("span",{className:"discounty-count-down-timer-widget__title",children:e.title}),l(lr,{value:s,label:{days:e.daysLabel,hours:e.hoursLabel,minutes:e.minutesLabel,seconds:e.secondsLabel},styles:{box:n.timeBox,label:n.timeBoxLabel}}),n.showCta&&e.ctaText&&l("button",{className:"discounty-countdown-banner-widget__cta",style:n.cta,onClick:c,type:"button",children:e.ctaText})]}),n.showCloseIcon&&l("button",{className:`discounty-countdown-banner-widget__close ${n.position}`,type:"button",style:n.close,"aria-label":"Countdown banner close",onClick:a,children:"✕"})]})};class ps{static async start(){if(!j.isHomePage)return;if(!T.startCountdownWidget.isActive&&!T.endCountdownWidget.isActive)return y.warn("[CountdownBannerService]: Widget is disabled");const e=await this.fetchHomepageTimer();if(!e)return y.warn("[CountdownBannerService]: No homepage timer data available");const n=this.getConfigByTimerType(e.timerType);if(!n)return y.warn("[CountdownBannerService]: No config found for timer type");this.renderBanner(n,e)}static async fetchHomepageTimer(){try{const n=(await Te.getHomepageTimer()).data.data.appEmbed.homepageTimer;return n?{timerType:n.timerType,value:n.value}:null}catch(e){return y.error("[CountdownBannerService]: Failed to fetch homepage timer",e),null}}static getConfigByTimerType(e){return e==="START"&&T.startCountdownWidget.isActive?T.startCountdownWidget:e==="END"&&T.endCountdownWidget.isActive?T.endCountdownWidget:null}static renderBanner(e,n){y.info("[CountdownBannerWidget]: Injecting widget");const{content:r,styles:o,homepageInjectionInfo:i}=e,s=o.banner.isStickyTop?[i,Ri]:[Ni(o.banner.position),[],document];Se(l(he,{getFragmentInfos:()=>ge(...s),children:l(us,{value:n,content:r,styles:o.banner})}))}}const fs=(t,e,n)=>Math.max(0,n==="PERCENTAGE"?t*(1-e/100):t-e),gs=t=>{const{title:e}=T.bxgyPopupWidget.content,n=t[0],r=(n==null?void 0:n.campaignName)||"";return e?!r||!/\{\{\s*campaign\s*\}\}/i.test(e)?e:e.replace(/\{\{\s*campaign\s*\}\}/gi,r):""};var pr=(t=>(t.PERCENTAGE="PERCENTAGE",t.AMOUNT="AMOUNT",t))(pr||{}),$e=(t=>(t.TRIGGER="TRIGGER",t.TWO_MIN="TWO_MIN",t.ALWAYS="ALWAYS",t))($e||{});const ye=class ye{static setTwoMinTimestamp(){T.bxgyPopupWidget.content.dismissType===$e.TWO_MIN?localStorage.setItem("bxgyTwoMinTS",Date.now().toString()):localStorage.removeItem("bxgyTwoMinTS")}static isTwoMinPassed(){const e=parseInt(localStorage.getItem("bxgyTwoMinTS")||"",10);return Number.isNaN(e)?!0:Date.now()-e>=ye.TWO_MIN_MS}static setAddFlag(){localStorage.setItem("bxgyAF","true")}static isAddFlagSet(){const e=localStorage.getItem("bxgyAF")==="true";return e&&(y.info("BXGY add flag is set, skipping update"),localStorage.setItem("bxgyAF","false")),e}static setCartEmpty(){localStorage.setItem("bxgyCIds",JSON.stringify([]))}static hasRewardsChanged(e){const n=T.bxgyPopupWidget.content.dismissType;if(y.debug("BXGY hasRewardsChanged called",{dismissType:n,newRewardsCount:(e==null?void 0:e.length)||0}),this.isAddFlagSet())return!1;if(localStorage.getItem("bxgyTest")==="1")return y.debug("BXGY test mode: forcing rewards changed"),!0;if(n===$e.TRIGGER){const r=new Set(e.map(s=>s.campaignId)),o=new Set(JSON.parse(localStorage.getItem("bxgyCIds")||"[]")),i=!Array.from(r).every(s=>o.has(s));return i?y.debug("BXGY dismissType=TRIGGER → updating"):y.debug("BXGY dismissType=TRIGGER → skipping update"),localStorage.setItem("bxgyCIds",JSON.stringify(Array.from(r))),i}else localStorage.removeItem("bxgyCIds");return T.bxgyPopupWidget.content.dismissType===$e.TWO_MIN?ye.isTwoMinPassed()?(y.debug("BXGY dismissType=TWO_MIN → updating"),!0):(y.debug("BXGY dismissType=TWO_MIN → skipping update"),!1):n===$e.ALWAYS?(y.debug("BXGY dismissType=ALWAYS → updating"),!0):(y.debug("BXGY dismissType not matched, returning false"),!1)}static processBadge(e,n,r){const{content:o}=T.bxgyPopupWidget;return o.badgeShowFreeGift&&r===0?"Free Gift":o.badgeType===pr.PERCENTAGE?(y.debug("campaign.discountType",e.discountType),e.discountType==="PERCENTAGE"?`-${e.discount}%`:`-${((1-r/n)*100).toFixed(0)}%`):e.discountType==="PERCENTAGE"?`-${W.format((n-r)*100)}`:`-${W.format(parseFloat(e.discount)*100)}`}static processVariant(e,n){const r=parseFloat(e.price),o=parseFloat(n.discount),i=fs(r,o,n.discountType);return{...e,price:W.format(i*100),compareAtPrice:W.format(r*100),discountBadge:ye.processBadge(n,r,i)}}static processRewards(e){const n=new Map,r=new Map,o={};return e.forEach(i=>{r.set(i.campaignId,i.rewardQuantity),i.products.forEach(s=>{if(!n.has(s.id)){const a=new Map;s.variants.forEach(u=>{const f=ye.processVariant(u,i);a.set(String(f.id),f)}),n.set(s.id,{campaignId:i.campaignId,image:s.image,title:s.title,variants:a});const c=a.keys().next().value;c&&(o[s.id]=c)}})}),{rewardsMap:n,campaignQuantitiesMap:r,initialSelectedVariants:o}}static prepareCartItemsForAddition(e){const n=new Map;return Object.values(e).forEach(r=>{const o=n.get(r.variantId)||0;n.set(r.variantId,o+r.quantity)}),Array.from(n.entries()).map(([r,o])=>({id:r,quantity:o}))}};k(ye,"TWO_MIN_MS",2*60*1e3);let se=ye;const fr=()=>{const[t,e]=H(""),[n,r]=H(!1),[o,i]=H(!1),[s,a]=H(new Map),[c,u]=H({}),[f,d]=H({}),[m,b]=H(new Map),p=rn(null),h=Ie(()=>Object.values(c).reduce((x,P)=>x+P.quantity,0),[c]),_=Ie(()=>Array.from(m.values()).reduce((x,P)=>x+(P||0),0),[m]);return ne(()=>{const x=P=>{if(!P||P.length===0){se.setCartEmpty();return}const B=P.map(A=>`${A.variant_id}:${A.quantity}`).sort().join("|");if(B===p.current){y.debug("Cart items unchanged, skipping BXGY refresh");return}p.current=B;const q=P.map(A=>({variant_id:A.variant_id,quantity:A.quantity}));y.info("BXGY cart items:",q),Te.getBxgyRewards(q).then(A=>{const M=A.data.data.bxgyEmbed.rewards;if(!se.hasRewardsChanged(M))return;const{rewardsMap:K,campaignQuantitiesMap:V,initialSelectedVariants:be}=se.processRewards(M);e(gs(M)),d(be),u({}),a(K),b(V),i(!1),r(K.size>0)}).catch(A=>{y.error(`Error in fetching bxgy rewards: ${JSON.stringify(A)}`)})};return re.addListener(x),()=>re.removeListener(x)},[]),{title:t,isOpen:n,showFab:o,rewards:s,selectedRewards:c,selectedVariants:f,totalSelectedCount:h,availableRewardsCount:_,onFabClick:()=>{i(!1),r(!0)},onFabCloseClick:()=>{i(!1)},handleAddToCart:()=>{const x=se.prepareCartItemsForAddition(c);if(y.debug("cartItems",x),x.length===0){y.warn("No items selected for adding to cart");return}se.setAddFlag(),vi.addToCart(x).then(()=>{y.info("Items added to cart successfully:"),or.updateCartDrawerUI(),or.dispatchCartUpdateEvent()}).then(()=>{se.setTwoMinTimestamp(),r(!1),u({})}).catch(P=>{y.error("Failed to add items to cart:",P)})},getSelectedVariant:(x,P)=>{const B=f[x]??P.variants.keys().next().value;return B?P.variants.get(B):void 0},handleVariantChange:(x,P)=>{d(B=>({...B,[x]:P})),u(B=>{const{[x]:q,...A}=B;return A})},handleQuantityChange:(x,P,B)=>{const q=f[x]??P.variants.keys().next().value;u(A=>{const M=A[x],K=m.get(P.campaignId);if(B>0&&K){const be=Array.from(s.entries()).filter(([Ve,J])=>J.campaignId===P.campaignId).reduce((Ve,[J,we])=>{var ke;return J===x?Ve:Ve+(((ke=A[J])==null?void 0:ke.quantity)||0)},0),G=(M==null?void 0:M.variantId)===q?M.quantity:0,ut=G+(!M||M.variantId!==q?1:B);if(be-G+ut>K)return A}if(!M||M.variantId!==q)return B<0?A:{...A,[x]:{variantId:q,quantity:1}};const V=Math.max(0,M.quantity+B);if(V===0){const{[x]:be,...G}=A;return G}return{...A,[x]:{...M,quantity:V}}})},handleContinueShopping:()=>{se.setTwoMinTimestamp(),r(!1),i(!0)},isCampaignLimitReached:x=>{const P=m.get(x);if(!P)return!1;y.debug("selectedReward",c);const B=Array.from(s.entries()).filter(([q,A])=>A.campaignId===x).reduce((q,[A,M])=>{const K=c[A];return q+((K==null?void 0:K.quantity)||0)},0);return y.debug("selectedQuantityInCampaign",B),y.debug("campaignRewardQuantity",P),B>=P}}},gr="data:image/svg+xml,%3csvg%20width='241'%20height='238'%20viewBox='0%200%20241%20238'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='241'%20height='238'%20fill='%23F9F9F9'/%3e%3cpath%20d='M80.9818%20160.288L81.2996%20159.664L80.9818%20160.288ZM78.7156%20158.022L79.3393%20157.704L78.7156%20158.022ZM162.285%20158.022L161.661%20157.704L162.285%20158.022ZM160.019%20160.288L159.701%20159.664L160.019%20160.288ZM160.019%2076.7185L159.701%2077.3422L160.019%2076.7185ZM162.285%2078.9848L161.661%2079.3026L162.285%2078.9848ZM80.9818%2076.7185L81.2996%2077.3422L80.9818%2076.7185ZM78.7156%2078.9848L79.3393%2079.3026L78.7156%2078.9848ZM77.6525%20136.809C77.3808%20137.084%2077.3834%20137.528%2077.6583%20137.799C77.9333%20138.071%2078.3765%20138.069%2078.6482%20137.794L77.6525%20136.809ZM96.7371%20118.497L96.2393%20118.005V118.005L96.7371%20118.497ZM108.61%20118.57L109.114%20118.084L108.61%20118.57ZM125.915%20136.512L125.412%20136.998L125.915%20136.512ZM137.859%20136.512L137.356%20136.026L137.859%20136.512ZM142.661%20131.534L143.164%20132.02L142.661%20131.534ZM154.534%20131.461L154.036%20131.953L154.534%20131.461ZM162.353%20140.368C162.624%20140.643%20163.068%20140.645%20163.342%20140.373C163.617%20140.102%20163.62%20139.659%20163.348%20139.384L162.353%20140.368ZM146.949%20127.926L147.173%20128.59L146.949%20127.926ZM150.201%20127.906L149.986%20128.572L150.201%20127.906ZM130.249%20140.154L130.028%20140.818L130.249%20140.154ZM133.526%20140.154L133.304%20139.49L133.526%20140.154ZM101.07%20114.942L100.854%20114.276L101.07%20114.942ZM104.322%20114.962L104.098%20115.625L104.322%20114.962ZM140.583%2098.2525V97.5525C140.196%2097.5525%20139.883%2097.8659%20139.883%2098.2525H140.583ZM140.74%2098.2525H141.44C141.44%2097.8659%20141.127%2097.5525%20140.74%2097.5525V98.2525ZM140.74%2098.4206V99.1206C141.127%2099.1206%20141.44%2098.8072%20141.44%2098.4206H140.74ZM140.583%2098.4206H139.883C139.883%2098.8072%20140.196%2099.1206%20140.583%2099.1206V98.4206ZM86.4475%2076.1533V76.8533H154.553V76.1533V75.4533H86.4475V76.1533ZM162.85%2084.4505H162.15V152.556H162.85H163.55V84.4505H162.85ZM154.553%20160.853V160.153H86.4475V160.853V161.553H154.553V160.853ZM78.1504%20152.556H78.8504V84.4505H78.1504H77.4504V152.556H78.1504ZM86.4475%20160.853V160.153C84.9838%20160.153%2083.9282%20160.153%2083.0986%20160.085C82.2771%20160.018%2081.7391%20159.888%2081.2996%20159.664L80.9818%20160.288L80.664%20160.912C81.3338%20161.253%2082.0765%20161.406%2082.9846%20161.48C83.8844%20161.554%2085.0069%20161.553%2086.4475%20161.553V160.853ZM78.1504%20152.556H77.4504C77.4504%20153.997%2077.4498%20155.119%2077.5234%20156.019C77.5976%20156.927%2077.7506%20157.67%2078.0919%20158.34L78.7156%20158.022L79.3393%20157.704C79.1154%20157.265%2078.9858%20156.727%2078.9187%20155.905C78.8509%20155.076%2078.8504%20154.02%2078.8504%20152.556H78.1504ZM80.9818%20160.288L81.2996%20159.664C80.4556%20159.234%2079.7694%20158.548%2079.3393%20157.704L78.7156%20158.022L78.0919%20158.34C78.6562%20159.447%2079.5566%20160.348%2080.664%20160.912L80.9818%20160.288ZM162.85%20152.556H162.15C162.15%20154.02%20162.15%20155.076%20162.082%20155.905C162.015%20156.727%20161.885%20157.265%20161.661%20157.704L162.285%20158.022L162.909%20158.34C163.25%20157.67%20163.403%20156.927%20163.477%20156.019C163.551%20155.119%20163.55%20153.997%20163.55%20152.556H162.85ZM154.553%20160.853V161.553C155.994%20161.553%20157.116%20161.554%20158.016%20161.48C158.924%20161.406%20159.667%20161.253%20160.337%20160.912L160.019%20160.288L159.701%20159.664C159.262%20159.888%20158.724%20160.018%20157.902%20160.085C157.073%20160.153%20156.017%20160.153%20154.553%20160.153V160.853ZM162.285%20158.022L161.661%20157.704C161.231%20158.548%20160.545%20159.234%20159.701%20159.664L160.019%20160.288L160.337%20160.912C161.444%20160.348%20162.345%20159.447%20162.909%20158.34L162.285%20158.022ZM154.553%2076.1533V76.8533C156.017%2076.8533%20157.073%2076.8539%20157.902%2076.9216C158.724%2076.9888%20159.262%2077.1183%20159.701%2077.3422L160.019%2076.7185L160.337%2076.0948C159.667%2075.7536%20158.924%2075.6005%20158.016%2075.5263C157.116%2075.4528%20155.994%2075.4533%20154.553%2075.4533V76.1533ZM162.85%2084.4505H163.55C163.55%2083.0099%20163.551%2081.8873%20163.477%2080.9875C163.403%2080.0795%20163.25%2079.3367%20162.909%2078.667L162.285%2078.9848L161.661%2079.3026C161.885%2079.7421%20162.015%2080.2801%20162.082%2081.1015C162.15%2081.9311%20162.15%2082.9868%20162.15%2084.4505H162.85ZM160.019%2076.7185L159.701%2077.3422C160.545%2077.7723%20161.231%2078.4585%20161.661%2079.3026L162.285%2078.9848L162.909%2078.667C162.345%2077.5595%20161.444%2076.6591%20160.337%2076.0948L160.019%2076.7185ZM86.4475%2076.1533V75.4533C85.0069%2075.4533%2083.8844%2075.4528%2082.9846%2075.5263C82.0765%2075.6005%2081.3338%2075.7536%2080.664%2076.0948L80.9818%2076.7185L81.2996%2077.3422C81.7391%2077.1183%2082.2771%2076.9888%2083.0986%2076.9216C83.9282%2076.8539%2084.9838%2076.8533%2086.4475%2076.8533V76.1533ZM78.1504%2084.4505H78.8504C78.8504%2082.9868%2078.8509%2081.9311%2078.9187%2081.1015C78.9858%2080.2801%2079.1154%2079.7421%2079.3393%2079.3026L78.7156%2078.9848L78.0919%2078.667C77.7506%2079.3367%2077.5976%2080.0795%2077.5234%2080.9875C77.4498%2081.8873%2077.4504%2083.0099%2077.4504%2084.4505H78.1504ZM80.9818%2076.7185L80.664%2076.0948C79.5566%2076.6591%2078.6562%2077.5595%2078.0919%2078.667L78.7156%2078.9848L79.3393%2079.3026C79.7694%2078.4585%2080.4556%2077.7723%2081.2996%2077.3422L80.9818%2076.7185ZM78.1504%20137.302L78.6482%20137.794L97.235%20118.989L96.7371%20118.497L96.2393%20118.005L77.6525%20136.809L78.1504%20137.302ZM108.61%20118.57L108.106%20119.056L125.412%20136.998L125.915%20136.512L126.419%20136.026L109.114%20118.084L108.61%20118.57ZM137.859%20136.512L138.363%20136.998L143.164%20132.02L142.661%20131.534L142.157%20131.048L137.356%20136.026L137.859%20136.512ZM154.534%20131.461L154.036%20131.953L162.353%20140.368L162.85%20139.876L163.348%20139.384L155.031%20130.969L154.534%20131.461ZM142.661%20131.534L143.164%20132.02C144.203%20130.944%20144.952%20130.167%20145.59%20129.606C146.222%20129.051%20146.698%20128.749%20147.173%20128.59L146.949%20127.926L146.726%20127.263C146.002%20127.507%20145.363%20127.942%20144.666%20128.555C143.974%20129.163%20143.179%20129.988%20142.157%20131.048L142.661%20131.534ZM154.534%20131.461L155.031%20130.969C153.997%20129.922%20153.191%20129.106%20152.492%20128.507C151.787%20127.902%20151.143%20127.475%20150.417%20127.24L150.201%20127.906L149.986%20128.572C150.462%20128.726%20150.942%20129.022%20151.581%20129.57C152.225%20130.123%20152.984%20130.89%20154.036%20131.953L154.534%20131.461ZM146.949%20127.926L147.173%20128.59C148.084%20128.282%20149.07%20128.276%20149.986%20128.572L150.201%20127.906L150.417%20127.24C149.216%20126.852%20147.922%20126.86%20146.726%20127.263L146.949%20127.926ZM125.915%20136.512L125.412%20136.998C126.445%20138.069%20127.249%20138.904%20127.948%20139.517C128.653%20140.137%20129.297%20140.575%20130.028%20140.818L130.249%20140.154L130.471%20139.49C129.992%20139.33%20129.511%20139.027%20128.872%20138.466C128.227%20137.899%20127.469%20137.114%20126.419%20136.026L125.915%20136.512ZM137.859%20136.512L137.356%20136.026C136.306%20137.114%20135.548%20137.899%20134.903%20138.466C134.264%20139.027%20133.783%20139.33%20133.304%20139.49L133.526%20140.154L133.747%20140.818C134.478%20140.575%20135.122%20140.136%20135.827%20139.517C136.526%20138.904%20137.33%20138.069%20138.363%20136.998L137.859%20136.512ZM130.249%20140.154L130.028%20140.818C131.235%20141.22%20132.54%20141.22%20133.747%20140.818L133.526%20140.154L133.304%20139.49C132.385%20139.796%20131.39%20139.796%20130.471%20139.49L130.249%20140.154ZM96.7371%20118.497L97.235%20118.989C98.2863%20117.926%2099.0452%20117.158%2099.6901%20116.605C100.329%20116.057%20100.809%20115.762%20101.285%20115.608L101.07%20114.942L100.854%20114.276C100.127%20114.511%2099.4837%20114.938%2098.7787%20115.543C98.0798%20116.142%2097.2741%20116.958%2096.2393%20118.005L96.7371%20118.497ZM108.61%20118.57L109.114%20118.084C108.092%20117.024%20107.296%20116.198%20106.605%20115.591C105.907%20114.977%20105.269%20114.543%20104.545%20114.299L104.322%20114.962L104.098%20115.625C104.572%20115.785%20105.048%20116.086%20105.681%20116.642C106.319%20117.203%20107.068%20117.979%20108.106%20119.056L108.61%20118.57ZM101.07%20114.942L101.285%20115.608C102.2%20115.312%20103.186%20115.318%20104.098%20115.625L104.322%20114.962L104.545%20114.299C103.349%20113.895%20102.055%20113.888%20100.854%20114.276L101.07%20114.942ZM147.389%2098.3367H146.689C146.689%20101.663%20143.993%20104.359%20140.667%20104.359V105.059V105.759C144.766%20105.759%20148.089%20102.436%20148.089%2098.3367H147.389ZM140.667%20105.059V104.359C137.341%20104.359%20134.645%20101.663%20134.645%2098.3367H133.945H133.245C133.245%20102.436%20136.568%20105.759%20140.667%20105.759V105.059ZM133.945%2098.3367H134.645C134.645%2095.0107%20137.341%2092.3144%20140.667%2092.3144V91.6144V90.9144C136.568%2090.9144%20133.245%2094.2375%20133.245%2098.3367H133.945ZM140.667%2091.6144V92.3144C143.993%2092.3144%20146.689%2095.0107%20146.689%2098.3367H147.389H148.089C148.089%2094.2375%20144.766%2090.9144%20140.667%2090.9144V91.6144ZM140.583%2098.2525V98.9525H140.74V98.2525V97.5525H140.583V98.2525ZM140.74%2098.2525H140.04V98.4206H140.74H141.44V98.2525H140.74ZM140.74%2098.4206V97.7206H140.583V98.4206V99.1206H140.74V98.4206ZM140.583%2098.4206H141.283V98.2525H140.583H139.883V98.4206H140.583Z'%20fill='%23707070'/%3e%3c/svg%3e",hs="data:image/svg+xml,%3csvg%20width='10'%20height='17'%20viewBox='0%200%2010%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.28125%207.95312C0.09375%208.16146%200%208.40104%200%208.67188C0%208.94271%200.09375%209.18229%200.28125%209.39062L6.28125%2015.3906C6.48958%2015.5781%206.72917%2015.6719%207%2015.6719C7.27083%2015.6719%207.51042%2015.5781%207.71875%2015.3906C7.90625%2015.1823%208%2014.9427%208%2014.6719C8%2014.401%207.90625%2014.1615%207.71875%2013.9531L2.40625%208.67188L7.71875%203.39062C7.90625%203.18229%208%202.94271%208%202.67188C8%202.40104%207.90625%202.16146%207.71875%201.95312C7.51042%201.76562%207.27083%201.67188%207%201.67188C6.72917%201.67188%206.48958%201.76562%206.28125%201.95312L0.28125%207.95312Z'%20fill='%237C7C7C'%20/%3e%3c/svg%3e",_s="data:image/svg+xml,%3csvg%20width='10'%20height='17'%20viewBox='0%200%2010%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.71875%207.95312C7.90625%208.16146%208%208.40104%208%208.67188C8%208.94271%207.90625%209.18229%207.71875%209.39062L1.71875%2015.3906C1.51042%2015.5781%201.27083%2015.6719%201%2015.6719C0.729167%2015.6719%200.489583%2015.5781%200.28125%2015.3906C0.09375%2015.1823%200%2014.9427%200%2014.6719C0%2014.401%200.09375%2014.1615%200.28125%2013.9531L5.59375%208.67188L0.28125%203.39062C0.09375%203.18229%200%202.94271%200%202.67188C0%202.40104%200.09375%202.16146%200.28125%201.95312C0.489583%201.76562%200.729167%201.67188%201%201.67188C1.27083%201.67188%201.51042%201.76562%201.71875%201.95312L7.71875%207.95312Z'%20fill='%237C7C7C'%20/%3e%3c/svg%3e",hr="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%3e%3cpath%20fill='none'%20stroke='%23374151'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M3%204.5L6%207.5L9%204.5'/%3e%3c/svg%3e",ms=({reward:t,isDisabled:e,currentVariant:n,selectedReward:r,selectedVariant:o,handleVariantChange:i,handleQuantityChange:s})=>{const{content:a,styles:c}=T.bxgyPopupWidget;return n?l("div",{className:"discounty-bxgy-product-card",children:l("div",{className:"discounty-bxgy-product-card__inner",style:{...c.secondaryBackgroundColor,...c.borderColor},children:[l("div",{className:"discounty-bxgy-product-card__image-wrapper",children:[l("img",{src:t.image??gr,alt:t.title,className:"discounty-bxgy-product-card__image"}),l("div",{className:"discounty-bxgy-product-card__discount-badge",style:c.badgeBackgroundColor,children:n.discountBadge})]}),l("h3",{className:"discounty-bxgy-product-card__title",style:c.primaryTextColor,children:t.title}),l("div",{className:"discounty-bxgy-product-card__variant-selector-wrapper",children:l("select",{value:o,onChange:u=>i(u.target.value),disabled:e,className:`discounty-bxgy-product-card__variant-selector ${t.variants.size===1?"discounty-bxgy-product-card__variant-selector--hidden":""}`,style:{backgroundImage:`url(${hr})`},children:Array.from(t.variants.entries()).map(([u,f])=>l("option",{value:u,children:f.title},u))})}),l("div",{className:"discounty-bxgy-product-card__price-wrapper",children:[l("span",{className:"discounty-bxgy-product-card__price",style:c.primaryTextColor,children:n.price}),l("span",{className:"discounty-bxgy-product-card__compare-at-price",style:{...c.primaryTextColor,opacity:c.disabledOpacity},children:n.compareAtPrice})]}),r?l("div",{className:"discounty-bxgy-product-card__quantity-controls",style:c.primaryBorderColor,children:[l("button",{onClick:()=>s(-1),className:"discounty-bxgy-product-card__quantity-button",style:c.primaryTextColor,children:"−"}),l("span",{className:"discounty-bxgy-product-card__quantity-display",style:c.primaryTextColor,children:r.quantity}),l("button",{onClick:()=>s(1),disabled:e,className:"discounty-bxgy-product-card__quantity-button",style:c.primaryTextColor,children:"+"})]}):l("button",{onClick:()=>s(1),disabled:e,className:"discounty-bxgy-product-card__select-button",style:{...c.primaryBackgroundColor,...c.secondaryTextColor,opacity:e?c.disabledOpacity:1},children:a.btnSelectLabel})]})}):null},ys=({color:t})=>l("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l("g",{clipPath:"url(#clip0_3535_6979)",children:l("path",{d:"M9.45312 4.25L11.0469 7.01562H11H7.625C7.09375 7.01562 6.65625 6.82812 6.3125 6.45312C5.9375 6.10938 5.75 5.67188 5.75 5.14062C5.75 4.60938 5.9375 4.17188 6.3125 3.82812C6.65625 3.45312 7.09375 3.26562 7.625 3.26562H7.71875C8.46875 3.29688 9.04688 3.625 9.45312 4.25ZM3.5 5.14062C3.5 5.82812 3.65625 6.45312 3.96875 7.01562H2C1.5625 7.01562 1.20312 7.15625 0.921875 7.4375C0.640625 7.71875 0.5 8.07812 0.5 8.51562V11.5156C0.5 11.9531 0.640625 12.3125 0.921875 12.5938C1.20312 12.875 1.5625 13.0156 2 13.0156H23C23.4375 13.0156 23.7969 12.875 24.0781 12.5938C24.3594 12.3125 24.5 11.9531 24.5 11.5156V8.51562C24.5 8.07812 24.3594 7.71875 24.0781 7.4375C23.7969 7.15625 23.4375 7.01562 23 7.01562H21.0312C21.3438 6.45312 21.5 5.82812 21.5 5.14062C21.4688 3.98438 21.0625 3.01562 20.2812 2.23438C19.5 1.45312 18.5312 1.04688 17.375 1.01562H17.2812C15.6875 1.07812 14.4688 1.76562 13.625 3.07812L12.5 5.04688L11.375 3.125C10.5312 1.78125 9.3125 1.07812 7.71875 1.01562H7.625C6.46875 1.04688 5.5 1.45312 4.71875 2.23438C3.9375 3.01562 3.53125 3.98438 3.5 5.14062ZM19.25 5.14062C19.25 5.67188 19.0625 6.10938 18.6875 6.45312C18.3438 6.82812 17.9062 7.01562 17.375 7.01562H14H13.9531L15.5938 4.25C15.9688 3.625 16.5312 3.29688 17.2812 3.26562H17.375C17.9062 3.26562 18.3438 3.45312 18.6875 3.82812C19.0625 4.17188 19.25 4.60938 19.25 5.14062ZM2 14.5156V22.7656C2.03125 23.3906 2.25 23.9219 2.65625 24.3594C3.09375 24.7656 3.625 24.9844 4.25 25.0156H11V14.5156H2ZM14 25.0156H20.75C21.375 24.9844 21.9062 24.7656 22.3438 24.3594C22.75 23.9219 22.9688 23.3906 23 22.7656V14.5156H14V25.0156Z",fill:t})}),l("defs",{children:l("clipPath",{id:"clip0_3535_6979",children:l("rect",{width:"24",height:"24",fill:"white",transform:"translate(0.5 0.5)"})})})]}),bs=({color:t})=>l("svg",{width:"24",height:"24",viewBox:"0 0 16 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l("g",{clipPath:"url(#clip0_3535_6989)",children:l("path",{d:"M12.6484 6.82812C12.8828 6.56771 13 6.26823 13 5.92969C13 5.59115 12.8828 5.29167 12.6484 5.03125C12.388 4.79688 12.0885 4.67969 11.75 4.67969C11.4115 4.67969 11.112 4.79688 10.8516 5.03125L6.75 9.17188L2.64844 5.03125C2.38802 4.79688 2.08854 4.67969 1.75 4.67969C1.41146 4.67969 1.11198 4.79688 0.851562 5.03125C0.617188 5.29167 0.5 5.59115 0.5 5.92969C0.5 6.26823 0.617188 6.56771 0.851562 6.82812L4.99219 10.9297L0.851562 15.0312C0.617188 15.2917 0.5 15.5911 0.5 15.9297C0.5 16.2682 0.617188 16.5677 0.851562 16.8281C1.11198 17.0625 1.41146 17.1797 1.75 17.1797C2.08854 17.1797 2.38802 17.0625 2.64844 16.8281L6.75 12.6875L10.8516 16.8281C11.112 17.0625 11.4115 17.1797 11.75 17.1797C12.0885 17.1797 12.388 17.0625 12.6484 16.8281C12.8828 16.5677 13 16.2682 13 15.9297C13 15.5911 12.8828 15.2917 12.6484 15.0312L8.50781 10.9297L12.6484 6.82812Z",fill:t})}),l("defs",{children:l("clipPath",{id:"clip0_3535_6989",children:l("rect",{width:"15",height:"20",fill:"white",transform:"translate(0.5 0.5)"})})})]}),ws=({color:t})=>l("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.54205 11.2638H7.46513L7.45795 10.1869H8.54205V11.2638ZM7.45795 8.98574H8.53487V4.73621H7.45795V8.98574ZM8 1C4.14031 1 1 4.14031 1 8C1 11.8597 4.14031 15 8 15C11.8597 15 15 11.8597 15 8C15 4.14031 11.8597 1 8 1Z",fill:t})}),Cs=({color:t})=>l("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M13.3 1.71a1 1 0 0 0-1.42-1.42L7 5.17 2.12.29A1 1 0 0 0 .7 1.71L5.59 6.59.7 11.47a1 1 0 1 0 1.42 1.42L7 8l4.88 4.88a1 1 0 0 0 1.42-1.42L8.41 6.59 13.3 1.71Z",fill:t})}),xs=({color:t})=>l("svg",{width:"36",height:"36",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l("g",{clipPath:"url(#clip0_3535_6979)",children:l("path",{d:"M9.45312 4.25L11.0469 7.01562H11H7.625C7.09375 7.01562 6.65625 6.82812 6.3125 6.45312C5.9375 6.10938 5.75 5.67188 5.75 5.14062C5.75 4.60938 5.9375 4.17188 6.3125 3.82812C6.65625 3.45312 7.09375 3.26562 7.625 3.26562H7.71875C8.46875 3.29688 9.04688 3.625 9.45312 4.25ZM3.5 5.14062C3.5 5.82812 3.65625 6.45312 3.96875 7.01562H2C1.5625 7.01562 1.20312 7.15625 0.921875 7.4375C0.640625 7.71875 0.5 8.07812 0.5 8.51562V11.5156C0.5 11.9531 0.640625 12.3125 0.921875 12.5938C1.20312 12.875 1.5625 13.0156 2 13.0156H23C23.4375 13.0156 23.7969 12.875 24.0781 12.5938C24.3594 12.3125 24.5 11.9531 24.5 11.5156V8.51562C24.5 8.07812 24.3594 7.71875 24.0781 7.4375C23.7969 7.15625 23.4375 7.01562 23 7.01562H21.0312C21.3438 6.45312 21.5 5.82812 21.5 5.14062C21.4688 3.98438 21.0625 3.01562 20.2812 2.23438C19.5 1.45312 18.5312 1.04688 17.375 1.01562H17.2812C15.6875 1.07812 14.4688 1.76562 13.625 3.07812L12.5 5.04688L11.375 3.125C10.5312 1.78125 9.3125 1.07812 7.71875 1.01562H7.625C6.46875 1.04688 5.5 1.45312 4.71875 2.23438C3.9375 3.01562 3.53125 3.98438 3.5 5.14062ZM19.25 5.14062C19.25 5.67188 19.0625 6.10938 18.6875 6.45312C18.3438 6.82812 17.9062 7.01562 17.375 7.01562H14H13.9531L15.5938 4.25C15.9688 3.625 16.5312 3.29688 17.2812 3.26562H17.375C17.9062 3.26562 18.3438 3.45312 18.6875 3.82812C19.0625 4.17188 19.25 4.60938 19.25 5.14062ZM2 14.5156V22.7656C2.03125 23.3906 2.25 23.9219 2.65625 24.3594C3.09375 24.7656 3.625 24.9844 4.25 25.0156H11V14.5156H2ZM14 25.0156H20.75C21.375 24.9844 21.9062 24.7656 22.3438 24.3594C22.75 23.9219 22.9688 23.3906 23 22.7656V14.5156H14V25.0156Z",fill:t})}),l("defs",{children:l("clipPath",{id:"clip0_3535_6979",children:l("rect",{width:"24",height:"24",fill:"white",transform:"translate(0.5 0.5)"})})})]}),vs=({color:t})=>l("svg",{width:"20",height:"20",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M1.33464 11.8334L0.167969 10.6667L4.83464 6.00002L0.167969 1.33335L1.33464 0.166687L6.0013 4.83335L10.668 0.166687L11.8346 1.33335L7.16797 6.00002L11.8346 10.6667L10.668 11.8334L6.0013 7.16669L1.33464 11.8334Z",fill:t})}),_r=({showFab:t,onFabClick:e,onFabCloseClick:n})=>{const{content:r,styles:o,isActive:i}=T.bxgyFabWidget;return l("div",{className:"discounty-bxgy-fab",style:{...o.container,display:t&&i?"block":"none"},children:[l("button",{onClick:e,className:"discounty-bxgy-fab__button",style:o.button,children:l(xs,{color:o.fabIconColor.color})}),!r.hideCloseBtn&&l("button",{onClick:n,className:"discounty-bxgy-fab__close",style:o.closeButton,children:l(vs,{color:o.closeIconColor.color})})]})},Ts=()=>{const{content:t,styles:e}=T.bxgyPopupWidget,{title:n,isOpen:r,rewards:o,showFab:i,selectedRewards:s,selectedVariants:a,totalSelectedCount:c,availableRewardsCount:u,onFabClick:f,onFabCloseClick:d,handleAddToCart:m,getSelectedVariant:b,handleVariantChange:p,handleQuantityChange:h,handleContinueShopping:_,isCampaignLimitReached:C}=fr(),[E,L]=H(0),R=o.size,N=Math.ceil(R/3),$=()=>{L(F=>(F+1)%N)},O=()=>{L(F=>F===0?N-1:F-1)};return l("div",{children:[l("div",{className:"discounty-bxgy-desktop-widget",style:{display:r?"flex":"none"},children:l("div",{className:"discounty-bxgy-desktop-widget__container",children:[l("div",{className:"discounty-bxgy-desktop-widget__header",style:e.headerBackgroundColor,children:[l("div",{className:"discounty-bxgy-desktop-widget__header-content",children:[l(ys,{color:e.headerTextColor.color}),l("div",{children:[l("h2",{className:"discounty-bxgy-desktop-widget__title",style:e.headerTextColor,children:n}),l("p",{className:"discounty-bxgy-desktop-widget__subtitle",style:e.headerTextColor,children:t.subtitle})]})]}),l("button",{onClick:_,className:"discounty-bxgy-desktop-widget__close-button",children:l(bs,{color:e.headerTextColor.color})})]}),l("div",{className:"discounty-bxgy-desktop-widget__main-body",style:e.PopupBackgroundColor,children:[l("div",{className:"discounty-bxgy-desktop-widget__info-banner",style:e.secondaryBackgroundColor,children:[l(ws,{color:e.primaryTextColor.color}),l("span",{className:"discounty-bxgy-desktop-widget__info-text",style:e.primaryTextColor,children:["You can add ",u," product(s)"]})]}),l("div",{className:"discounty-bxgy-desktop-widget__product-grid-nav",children:[R>3&&l(X,{children:[l("button",{onClick:O,className:"discounty-bxgy-desktop-widget__nav-arrow discounty-bxgy-desktop-widget__nav-arrow--left",children:l("img",{src:hs,alt:"Arrow Left Icon"})}),l("button",{onClick:$,className:"discounty-bxgy-desktop-widget__nav-arrow discounty-bxgy-desktop-widget__nav-arrow--right",children:l("img",{src:_s,alt:"Arrow Right Icon"})})]}),l("div",{className:"discounty-bxgy-desktop-widget__product-grid-container",children:l("div",{className:"discounty-bxgy-desktop-widget__product-grid",style:{justifyContent:R>3?"start":"center",transform:`translateX(-${E*100}%)`},children:Array.from(o.entries()).map(([F,x])=>l(ms,{reward:x,selectedReward:s[F],selectedVariant:a[F]||Array.from(x.variants.keys())[0]||"",isDisabled:C(x.campaignId),currentVariant:b(F,x),handleVariantChange:P=>p(F,P),handleQuantityChange:P=>h(F,x,P)},F))})})]}),R>3&&l("div",{className:"discounty-bxgy-desktop-widget__nav-dots",children:Array.from({length:N},(F,x)=>l("button",{onClick:()=>L(x),className:"discounty-bxgy-desktop-widget__nav-dot",style:{...e.borderBackgroundColor,opacity:x===E?1:e.disabledOpacity}},x))}),l("div",{className:"discounty-bxgy-desktop-widget__border",style:e.borderColor}),l("div",{className:"discounty-bxgy-desktop-widget__actions",children:l("div",{className:"discounty-bxgy-desktop-widget__actions-container",children:[!t.hideContinueBtn&&l("button",{onClick:_,className:"discounty-bxgy-desktop-widget__button discounty-bxgy-desktop-widget__button--secondary",style:{...e.primaryTextColor,...e.secondaryBackgroundColor,...e.primaryBorderColor},children:t.btnContinueLabel}),l("button",{onClick:m,disabled:c===0,className:"discounty-bxgy-desktop-widget__button discounty-bxgy-desktop-widget__button--primary",style:{...e.primaryBackgroundColor,...e.secondaryTextColor,opacity:c===0?e.disabledOpacity:1},children:[t.btnAddLabel," (",c,"/",u,")"]})]})})]})]})}),l(_r,{showFab:i,onFabClick:f,onFabCloseClick:d})]})},Ss=({reward:t,isDisabled:e,currentVariant:n,selectedReward:r,selectedVariant:o,handleVariantChange:i,handleQuantityChange:s})=>{const{styles:a}=T.bxgyPopupWidget,c=(r==null?void 0:r.quantity)??0;return n?l("div",{className:"discounty-bxgy-mobile-product-row",style:a.borderColor,children:[l("div",{className:"discounty-bxgy-mobile-product-row__image-wrapper",children:[l("img",{src:t.image??gr,alt:t.title,className:"discounty-bxgy-mobile-product-row__image"}),l("div",{className:"discounty-bxgy-mobile-product-row__discount-badge",style:a.badgeBackgroundColor,children:n.discountBadge})]}),l("div",{className:"discounty-bxgy-mobile-product-row__details",children:[l("h3",{className:"discounty-bxgy-mobile-product-row__title",style:a.primaryTextColor,children:t.title}),l("div",{className:"discounty-bxgy-mobile-product-row__price-wrapper",children:[l("span",{className:"discounty-bxgy-mobile-product-row__price",style:a.primaryTextColor,children:n.price}),l("span",{className:"discounty-bxgy-mobile-product-row__compare-at-price",style:{...a.primaryTextColor,opacity:a.disabledOpacity},children:n.compareAtPrice})]}),l("div",{className:"discounty-bxgy-mobile-product-row__controls",children:[l("select",{value:o,onChange:u=>i(u.target.value),className:"discounty-bxgy-mobile-product-row__variant-selector",style:{backgroundImage:`url(${hr})`},children:Array.from(t.variants.entries()).map(([u,f])=>l("option",{value:u,children:f.title},u))}),l("div",{className:"discounty-bxgy-mobile-product-row__quantity-controls",children:[l("button",{onClick:()=>s(-1),disabled:c===0,className:"discounty-bxgy-mobile-product-row__quantity-button",style:{...a.primaryBorderColor,...a.primaryTextColor,...a.secondaryBackgroundColor},children:"−"}),l("span",{className:"discounty-bxgy-mobile-product-row__quantity-display",style:a.primaryTextColor,children:c}),l("button",{onClick:()=>s(1),disabled:e,className:"discounty-bxgy-mobile-product-row__quantity-button",style:{...a.primaryBorderColor,...a.primaryTextColor,...a.secondaryBackgroundColor},children:"+"})]})]})]})]}):null},Es=()=>{const{content:t,styles:e}=T.bxgyPopupWidget,{title:n,isOpen:r,rewards:o,showFab:i,selectedRewards:s,selectedVariants:a,totalSelectedCount:c,availableRewardsCount:u,onFabClick:f,onFabCloseClick:d,handleAddToCart:m,getSelectedVariant:b,handleVariantChange:p,handleQuantityChange:h,handleContinueShopping:_,isCampaignLimitReached:C}=fr();return l("div",{children:[l("div",{className:`discounty-bxgy-mobile-widget ${r?"discounty-bxgy-mobile-widget--is-open":""}`,onClick:_,children:l("div",{className:"discounty-bxgy-mobile-widget__container",style:e.secondaryBackgroundColor,onClick:E=>E.stopPropagation(),children:[l("div",{className:"discounty-bxgy-mobile-widget__header",style:e.headerBackgroundColor,children:[l("button",{onClick:_,className:"discounty-bxgy-mobile-widget__close-button",children:l(Cs,{color:e.headerTextColor.color})}),l("h2",{className:"discounty-bxgy-mobile-widget__title",style:e.headerTextColor,children:n}),l("p",{className:"discounty-bxgy-mobile-widget__subtitle",style:e.headerTextColor,children:["You can add ",u," products"]})]}),l("div",{className:"discounty-bxgy-mobile-widget__products-list",children:Array.from(o.entries()).map(([E,L])=>l(Ss,{reward:L,selectedReward:s[E],selectedVariant:a[E]||Array.from(L.variants.keys())[0]||"",isDisabled:C(L.campaignId),currentVariant:b(E,L),handleVariantChange:R=>p(E,R),handleQuantityChange:R=>h(E,L,R)},E))}),l("div",{className:"discounty-bxgy-mobile-widget__actions",style:e.borderColor,children:[l("button",{onClick:m,disabled:c===0,className:"discounty-bxgy-mobile-widget__button discounty-bxgy-mobile-widget__button--primary",children:[t.btnAddLabel," (",c,"/",u,")"]}),l("button",{onClick:_,className:"discounty-bxgy-mobile-widget__button discounty-bxgy-mobile-widget__button--secondary",children:t.btnContinueLabel})]})]})}),l(_r,{showFab:i,onFabClick:f,onFabCloseClick:d})]})};class Ls{static start(){if(!T.bxgyWidget.isActive||!T.bxgyPopupWidget.isActive)return y.warn("BXGY widget is disabled");this.injectBxgyWidgetElements(),re.start()}static injectBxgyWidgetElements(){const e=[{selector:"#discounty-bxgy-discount-widgets-container",injectionType:v.start}],n=ji()?Es:Ts;Se(l(he,{getFragmentInfos:()=>ge(T.bxgyPopupWidget.injectionInfo,e),children:l(n,{})}))}}function ks(t){const e=T.currency.rate,n=!isNaN(e)&&e!==1,r=t.discountType==="FIXED",o=t.discountOperandType==="PRICE",i=JSON.parse(t.discountTiers||"[]");if(!Array.isArray(i))return[];const s=a=>({...a,discount:r?a.discount*100*(n?e:1):a.discount,criteria:o?a.criteria*100*(n?e:1):a.criteria});return i.sort((a,c)=>a.criteria-c.criteria).map(s)}function Rs(t){const e=JSON.parse(t||"{}"),n=`${e.textSize||"12"}px`,r=`#${e.textColor||"000000"}`,o=`#${e.cardBackgroundColor||"ffffff"}`,i=`#${e.cardBorderColor||"000000"}`,s=`${e.cardRadius||"8"}px`,a=`#${e.progressBarBackgroundColor||"d9d9d9"}`,c=`#${e.progressBarForegroundColor||"1d7d20"}`,u=`${e.progressBarRadius||"4"}px`;return{card:{fontSize:n,color:r,backgroundColor:o,borderColor:i,borderRadius:s},progressBar:{backgroundColor:a,borderRadius:u},progressFill:{backgroundColor:c,borderRadius:u}}}function Ns(t){if(!t)return null;try{const e=ks(t),n=t.includedCountries?JSON.parse(t.includedCountries):null,r=t.excludedCountries?JSON.parse(t.excludedCountries):null;return{discountType:t.discountType,discountOperandType:t.discountOperandType,discountTiers:e,countrySelectionType:t.countrySelectionType,includedCountries:Array.isArray(n)?n:null,excludedCountries:Array.isArray(r)?r:null}}catch(e){return y.error("[prepareProgressBarDiscount]: Failed to parse progress bar discount:",e),null}}function Ps(t,e){if(!t)return!0;const{countrySelectionType:n,includedCountries:r,excludedCountries:o}=t;return n==="ALL"?!0:n==="INCLUDED"?r&&e?r.includes(e):!1:n==="EXCLUDED"?o&&e?!o.includes(e):!0:!1}function mr(t){const{progressbar:e,progressBarDiscount:n}=t,r=Rs(e.styles),o=Ns(n);return{...e,styles:r,progressBarDiscount:o}}function As(t,e){if(!(e!=null&&e.length))return{achieved:null,next:null};const n=e.findIndex(s=>t=0?{criteria:e[r].criteria,discount:e[r].discount}:null,i=n>=0&&n{const{next:c,achieved:u}=As(s,(r==null?void 0:r.discountTiers)??[]);if(!c||!r)return u?{shouldShow:!0,remainingAmount:0,progress:100,message:br(t.content.thresholdReachedText,0,u.discount,o,i),achievedDiscount:""}:{shouldShow:!1,remainingAmount:0,progress:0,message:"",achievedDiscount:""};const f=Math.max(0,c.criteria-s),d=Math.min(100,s/c.criteria*100),b=s>=c.criteria?"reached":s>0?"progress":"initial",p={reached:{template:t.content.thresholdReachedText,amount:f},progress:{template:t.content.thresholdProgressText,amount:f},initial:{template:t.content.thresholdInitialText,amount:c.criteria}},{template:h,amount:_}=p[b],C=br(h,_,c.discount,o,i),R=r.discountTiers.length>1&&u&&u.discount!==c.discount?yr(u.discount,i):null;return{shouldShow:a,remainingAmount:f,progress:d,message:C,achievedDiscount:R}},[e,n,s])}function Os({color:t}){return l("svg",{width:20,height:20,viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",children:[l("path",{fillRule:"evenodd",fill:t,d:"M4 5.25a.75.75 0 0 1 .75-.75h6.991a2.75 2.75 0 0 1 2.645 1.995l.427 1.494a.25.25 0 0 0 .18.173l1.681.421a1.75 1.75 0 0 1 1.326 1.698v1.219a1.75 1.75 0 0 1-1.032 1.597 2.5 2.5 0 1 1-4.955.153h-3.025a2.5 2.5 0 1 1-4.78-.75h-.458a.75.75 0 0 1 0-1.5h2.5c.03 0 .06.002.088.005a2.493 2.493 0 0 1 1.947.745h4.43a2.493 2.493 0 0 1 1.785-.75c.698 0 1.33.286 1.783.748a.25.25 0 0 0 .217-.248v-1.22a.25.25 0 0 0-.19-.242l-1.682-.42a1.75 1.75 0 0 1-1.258-1.217l-.427-1.494a1.25 1.25 0 0 0-1.202-.907h-6.991a.75.75 0 0 1-.75-.75Zm2.5 9.25a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm8 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),l("path",{fill:t,d:"M3.25 8a.75.75 0 0 0 0 1.5h5a.75.75 0 0 0 0-1.5h-5Z"})]})}function Fs({config:t}){const{shouldShow:e,message:n,progress:r,achievedDiscount:o}=Is(t);if(!e)return null;const{styles:i}=t;return l("div",{className:"discounty-shipping-progress-bar-widget",style:i.card,children:l("div",{className:"discounty-shipping-progress-bar-widget__content",children:[l("div",{className:"discounty-shipping-progress-bar-widget__title",children:n}),l("div",{className:"discounty-shipping-progress-bar-widget__progress-section",children:[l("div",{className:"discounty-shipping-progress-bar-widget__progress-container",style:i.progressBar,children:l("div",{className:"discounty-shipping-progress-bar-widget__progress-fill",style:{...i.progressFill,width:`${r}%`}})}),l("div",{className:"discounty-shipping-progress-bar-widget__icon",children:l(Os,{color:i.card.color})})]}),o&&l("div",{className:"discounty-shipping-progress-bar-widget__achieved",children:["You've unlocked ",o," off shipping!"]})]})})}const Ms=[{selector:".product-form",injectionType:v.after},{selector:".shopify-product-form",injectionType:v.after},{selector:".buy-buttons-block",injectionType:v.after}],Ds=[{selector:".cart-page .cart-page__summary .cart__summary-inner",injectionType:v.start},{selector:".page-width .cart__contents",injectionType:v.before}],js=[{selector:".cart-drawer .cart__contents",injectionType:v.before},{selector:".cart-drawer .cart__ctas",injectionType:v.after}];class wr{static start(){this.config=T.shipping,this.shouldInjectWidget()&&this.inject()}static shouldInjectWidget(){if(!this.config.progressbar.isActive)return y.warn("[ShippingProgressBarWidget]: Widget is disabled"),!1;const e=mr(this.config);if(!Ps(e.progressBarDiscount,T.country))return y.warn(`[ShippingProgressBarWidget]: Customer country '${T.country}' is not eligible for this discount`),!1;const n=j.isProductPage&&this.config.progressbar.activeOnProductPage,r=j.isCartPage&&this.config.progressbar.activeOnCartPage,o=this.config.progressbar.activeOnCartPage;return!n&&!r&&!o?(y.warn("[ShippingProgressBarWidget]: No valid injection target found"),!1):(y.info("[ShippingProgressBarWidget]: Starting service"),!0)}static injectWidget(e,n,r){y.info(`[ShippingProgressBarWidget]: Injecting on ${r}`),Se(l(he,{getFragmentInfos:()=>ge(e,n),children:l(Fs,{config:mr(this.config)})}))}static inject(){y.info("[ShippingProgressBarWidget]: Injecting widget"),j.isProductPage&&this.config.progressbar.activeOnProductPage&&this.injectWidget(this.config.progressbar.productPageInjectionInfo,Ms,"product page"),j.isCartPage&&this.config.progressbar.activeOnCartPage&&this.injectWidget(this.config.progressbar.cartPageInjectionInfo,Ds,"cart page"),this.config.progressbar.activeOnCartPage&&this.injectWidget(this.config.progressbar.cartDrawerInjectionInfo,js,"cart drawer")}}k(wr,"config");function Bs(t){if(y.info(`Starting app... Latest release: Fri, 27 Feb 2026 21:56:02 GMT`),!Bi()){if(!t.isAppEnabled)return y.error("App is disabled");ls.start(),ps.start(),Qi.start(),Ls.start(),wr.start()}}function Cr({state:t}){const e=dr(),n=t==null?void 0:t.variantsTimers.find(s=>{var a;return((a=s==null?void 0:s.variantId)==null?void 0:a.toString())===e}),{hasEnded:r,...o}=ur(n==null?void 0:n.value),i=Ar(()=>t==null?[]:ge(t.config.productPageInjectionInfo,ki),[t]);return t==null||r||!n?null:l(he,{getFragmentInfos:i,children:l("div",{className:"discounty-count-down-timer-widget",style:t.config.styles.timer.wrapper,children:[l("span",{className:"discounty-count-down-timer-widget__title",children:t.config.content.title}),l(lr,{value:o,label:{days:t.config.content.daysLabel,hours:t.config.content.hoursLabel,minutes:t.config.content.minutesLabel,seconds:t.config.content.secondsLabel},styles:{box:t.config.styles.timer.timeBox,label:t.config.styles.timer.timeBoxLabel}})]})})}function $s({startConfig:t,endConfig:e}){const[n,r]=H({start:null,end:null});return ne(()=>{async function o(){if(Ee.singleProduct)try{const i=await Te.getProductVariantsTimers(Ee.singleProduct.id),s=i.data.data.appEmbed.productTimers.filter(c=>c.timerType==="START"),a=i.data.data.appEmbed.productTimers.filter(c=>c.timerType==="END");r({start:s.length>0&&t.isActive?{config:t,variantsTimers:s}:null,end:a.length>0&&e.isActive?{config:e,variantsTimers:a}:null})}catch(i){y.error("[CountdownTimer]: Failed to fetch product variant timers",i),r({start:null,end:null})}}return o(),()=>r({start:null,end:null})},[t,e]),l(X,{children:[l(Cr,{state:n.start}),l(Cr,{state:n.end})]})}const Vs='.discounty-cart-widget__wrapper{display:flex;justify-content:end}.discounty-cart-widget__wrapper>.discounty-cart-widget{width:224px;font-size:14px}.discounty-cart-widget>.discounty-cart-widget__row{display:flex;align-items:center;justify-content:space-between}.discounty-cart-widget>.discounty-cart-widget__row.discounty-cart-widget__saving-row{font-weight:700}.discounty-cart-widget>.discounty-cart-widget__row>.discounty-cart-widget__line-through{text-decoration:line-through}.discounty-volume-discount-widget{font-size:12px;margin-bottom:24px}.discounty-volume-discount-widget>.discounty-volume-discount-widget__title{font-weight:700;margin-top:0;margin-bottom:2px}.discounty-volume-discount-widget>.discounty-volume-discount-widget__table-wrapper{width:100%;overflow:hidden}.discounty-volume-discount-widget__table-wrapper>.discounty-volume-discount-widget__table{width:100%;color:inherit;font-size:12px;text-align:left;border-collapse:collapse;border-style:hidden;box-shadow:none;margin-bottom:0}.discounty-volume-discount-widget__table td,.discounty-volume-discount-widget__table th{border-color:inherit;padding:8px 12px}.discounty-volume-discount-widget__table th{color:inherit;font-weight:700}.discounty-volume-discount-widget__table .discounty-volume-discount-widget__criteria{font-weight:700}.discounty-volume-badge-container{margin:8px 0;width:100%}.discounty-volume-badge{background:#0035660d;border:1px solid #003566;border-radius:4px;width:100%;padding:8px 16px}.discounty-volume-badge__text{color:#003566;font-size:14px;font-weight:700;line-height:1.2;text-align:center;display:block}@media (max-width: 768px){.discounty-volume-badge__text{font-size:13px}.discounty-volume-badge{padding:6px 12px}}.discounty-count-down-timer-widget{margin:1em 0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;text-align:center;padding:.5625em .6875em}.discounty-count-down-timer-widget__title{font-size:.875em;line-height:1.25em;font-weight:700}.discounty-count-down-timer-widget__timer{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:.625em}.discounty-count-down-timer-widget__time-box{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.25em}.discounty-count-down-timer-widget__time-amount{width:1.625em;height:1.75em;border-radius:.5em;font-size:1em;line-height:1.75em;font-weight:800}.discounty-count-down-timer-widget__time-label{font-size:.6875em;line-height:.75em;font-weight:500}.discounty-countdown-banner-widget{position:relative;font-size:16px;z-index:9999;padding:.75em 1em;margin:0}@media (max-width: 640px){.discounty-countdown-banner-widget{font-size:12px!important}}.discounty-countdown-banner-widget__content{flex-grow:1;display:flex;justify-content:center;align-items:center;gap:1.5em}.discounty-countdown-banner-widget__cta{font-size:1em;font-weight:700;border:none;white-space:nowrap;cursor:pointer;padding:.5em 1em}.discounty-countdown-banner-widget__close{background:transparent;font-size:.875em;border:none;cursor:pointer;padding:.5em}@media (max-width: 640px){.discounty-countdown-banner-widget__close{position:absolute;left:50%;width:2.25em;height:2.25em;background:#000;color:#fff!important;border-radius:100%;opacity:.8;transform:translate(-50%)}.discounty-countdown-banner-widget__close.top{bottom:-2.75em}.discounty-countdown-banner-widget__close.bottom{top:-2.75em}}.discounty-bxgy-product-card{width:33.333%;min-width:33.333%;padding:8px;box-sizing:border-box}.discounty-bxgy-product-card__inner{padding:12px;text-align:center;border:1px solid #e2e8f0;border-radius:12px;background-color:#fff}.discounty-bxgy-product-card__image-wrapper{position:relative;margin-bottom:8px}.discounty-bxgy-product-card__image{width:100%;height:180px;object-fit:cover;border-radius:8px}.discounty-bxgy-product-card__discount-badge{position:absolute;top:8px;right:8px;background-color:#3b82f6;color:#fff;padding:4px 8px;border-radius:4px;font-size:12px;font-weight:600}.discounty-bxgy-product-card__title{font-size:14px;font-weight:500;margin:0 0 10px;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.discounty-bxgy-product-card__variant-selector-wrapper{margin-bottom:10px}.discounty-bxgy-product-card__variant-selector{width:60%;max-width:200px;padding:8px 45px 8px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:12px;background-color:#fff;color:#374151;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 8px center;background-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.discounty-bxgy-product-card__variant-selector--hidden{visibility:hidden;opacity:0}.discounty-bxgy-product-card__price-wrapper{margin-bottom:10px}.discounty-bxgy-product-card__price{font-size:16px;font-weight:600;color:#000}.discounty-bxgy-product-card__compare-at-price{font-size:12px;color:#9ca3af;text-decoration:line-through;margin-left:8px}.discounty-bxgy-product-card__quantity-controls{display:flex;align-items:center;justify-content:center;gap:16px;border:1px solid #d1d5db;border-radius:6px;padding:4px}.discounty-bxgy-product-card__quantity-button{background:none;border:none;cursor:pointer;font-size:16px;color:#6b7280;padding:4px 8px}.discounty-bxgy-product-card__quantity-button:disabled{cursor:not-allowed;color:#d1d5db}.discounty-bxgy-product-card__quantity-display{font-size:14px;font-weight:500;min-width:20px;text-align:center}.discounty-bxgy-product-card__select-button{width:100%;padding:12px 16px;background-color:#000;color:#fff;border:none;border-radius:6px;cursor:pointer;font-size:12px;font-weight:500}.discounty-bxgy-product-card__select-button:disabled{background-color:#9ca3af;cursor:not-allowed}.discounty-bxgy-desktop-widget{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0009;align-items:center;justify-content:center;z-index:10000}.discounty-bxgy-desktop-widget__icon{width:auto;height:auto}.discounty-bxgy-desktop-widget__container{background-color:#616161;border-radius:16px;max-width:750px;width:90%;max-height:90vh;overflow:hidden;position:relative;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column}.discounty-bxgy-desktop-widget__header{background-color:#616161;padding:15px 24px;position:relative}.discounty-bxgy-desktop-widget__header-content{display:flex;align-items:center;gap:12px}.discounty-bxgy-desktop-widget__title{font-size:18px;font-weight:600;margin:0;color:#fff}.discounty-bxgy-desktop-widget__subtitle{font-size:14px;color:#fffc;margin:0}.discounty-bxgy-desktop-widget__close-button{position:absolute;top:20px;right:20px;background:none;border:none;cursor:pointer;padding:4px;color:#fff}.discounty-bxgy-desktop-widget__main-body{background-color:#f4f4f4;padding:12px 0;flex:1;overflow:auto}.discounty-bxgy-desktop-widget__info-banner{background-color:#f9f9f9;margin:0 20px;padding:6px 16px;display:flex;align-items:center;gap:16px;border-radius:8px}.discounty-bxgy-desktop-widget__info-text{font-size:14px;color:#000;font-weight:400}.discounty-bxgy-desktop-widget__product-grid-nav{position:relative;padding:8px 28px}.discounty-bxgy-desktop-widget__nav-arrow{position:absolute;top:50%;transform:translateY(-50%);width:32px;height:32px;background-color:#fff;border:1px solid rgb(255,255,255);border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1;box-shadow:0 2px 4px #0000001a}.discounty-bxgy-desktop-widget__nav-arrow--left{left:18px}.discounty-bxgy-desktop-widget__nav-arrow--right{right:18px}.discounty-bxgy-desktop-widget__product-grid-container{overflow:hidden}.discounty-bxgy-desktop-widget__product-grid{display:flex;transition:transform .3s ease}.discounty-bxgy-desktop-widget__nav-dots{display:flex;justify-content:center;gap:6px;margin-bottom:16px}.discounty-bxgy-desktop-widget__nav-dot{width:8px;height:8px;border-radius:50%;border:none;cursor:pointer;padding:0}.discounty-bxgy-desktop-widget__border{display:flex!important;border-top:1px solid;margin:0 40px}.discounty-bxgy-desktop-widget__actions{display:flex;justify-content:center}.discounty-bxgy-desktop-widget__actions-container{display:inline-flex;width:auto;gap:12px;justify-content:center;padding:14px 28px}.discounty-bxgy-desktop-widget__button{padding:12px 24px;min-width:180px;border-radius:6px;cursor:pointer;font-size:14px;font-weight:500}.discounty-bxgy-desktop-widget__button:disabled{background-color:#9ca3af;cursor:not-allowed}.discounty-bxgy-desktop-widget__button--secondary{color:#000;border:1px solid #d1d5db}.discounty-bxgy-desktop-widget__button--primary{background-color:#000;color:#fff;border:none}.discounty-bxgy-mobile-product-row{display:flex;gap:12px;margin-bottom:20px;padding-bottom:20px;align-items:flex-start;border-bottom:1px solid}.discounty-bxgy-mobile-product-row__image-wrapper{position:relative;flex-shrink:0}.discounty-bxgy-mobile-product-row__image{width:96px;height:96px;object-fit:cover;border-radius:8px}.discounty-bxgy-mobile-product-row__discount-badge{position:absolute;top:4px;left:4px;color:#fff;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:600}.discounty-bxgy-mobile-product-row__details{flex:1;min-width:0}.discounty-bxgy-mobile-product-row__title{font-size:16px;font-weight:500;margin:0 0 4px;color:#111827}.discounty-bxgy-mobile-product-row__price-wrapper{margin-bottom:8px}.discounty-bxgy-mobile-product-row__price{font-size:16px;font-weight:600;color:#111827}.discounty-bxgy-mobile-product-row__compare-at-price{font-size:14px;color:#9ca3af;text-decoration:line-through;margin-left:6px}.discounty-bxgy-mobile-product-row__controls{display:flex;gap:8px;align-items:center;width:100%;min-width:0}.discounty-bxgy-mobile-product-row__variant-selector{flex:1 1 0%;min-width:0;max-width:100%;padding:6px 32px 6px 12px;border:1px solid #e5e7eb;border-radius:6px;font-size:14px;background-color:#fff;color:#374151;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 8px center;background-size:12px;overflow:hidden;text-overflow:ellipsis}.discounty-bxgy-mobile-product-row__quantity-controls{display:flex;align-items:center;gap:4px;margin-left:auto;flex-shrink:0}@media (max-width: 360px){.discounty-bxgy-mobile-product-row__controls{gap:6px}.discounty-bxgy-mobile-product-row__variant-selector{padding:6px 28px 6px 10px;font-size:13px}.discounty-bxgy-mobile-product-row__quantity-button{width:26px;height:26px;font-size:16px}}.discounty-bxgy-mobile-product-row__quantity-button{background:#fff;border:1px solid #e5e7eb;border-radius:4px;font-size:18px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;padding:0;color:#6b7280;cursor:pointer}.discounty-bxgy-mobile-product-row__quantity-button:disabled{cursor:not-allowed;color:#d1d5db}.discounty-bxgy-mobile-product-row__quantity-display{font-size:14px;font-weight:500;min-width:24px;text-align:center;color:#374151}.discounty-bxgy-mobile-widget{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0000;display:flex;align-items:flex-end;justify-content:center;z-index:10000;transition:background-color .3s ease-in-out;pointer-events:none}.discounty-bxgy-mobile-widget.discounty-bxgy-mobile-widget--is-open{background-color:#00000080;pointer-events:auto}.discounty-bxgy-mobile-widget__container{background-color:#fff;border-radius:20px 20px 0 0;width:100%;max-height:90vh;overflow:hidden;position:relative;transform:translateY(100%);transition:transform .3s ease-in-out}.discounty-bxgy-mobile-widget--is-open .discounty-bxgy-mobile-widget__container{transform:translateY(0)}.discounty-bxgy-mobile-widget__header{padding:20px 16px 4px;position:relative;border-bottom:1px solid #f0f0f0}.discounty-bxgy-mobile-widget__close-button{position:absolute;top:20px;right:16px;background:none;border:none;cursor:pointer;padding:0;color:#6b7280}.discounty-bxgy-mobile-widget__title{font-size:14px;font-weight:600;margin:0;color:#111827;padding-right:40px}.discounty-bxgy-mobile-widget__subtitle{font-size:14px;color:#6b7280;margin:0}.discounty-bxgy-mobile-widget__products-list{height:calc(75vh - 200px);overflow-y:auto;padding:16px 16px 150px}.discounty-bxgy-mobile-widget__actions{position:absolute;bottom:0;left:0;right:0;background-color:#fff;border-top:1px solid #e5e7eb;padding:16px}.discounty-bxgy-mobile-widget__button{width:100%;padding:16px;border:none;border-radius:8px;cursor:pointer;font-size:16px;font-weight:600}.discounty-bxgy-mobile-widget__button:disabled{background-color:#e5e7eb;color:#9ca3af;cursor:not-allowed}.discounty-bxgy-mobile-widget__button--primary{background-color:#000;color:#fff;margin-bottom:12px}.discounty-bxgy-mobile-widget__button--secondary{background-color:#f3f4f6;color:#000;font-weight:500}.discounty-bxgy-fab{position:fixed;bottom:12pt;left:12pt;z-index:9999}.discounty-bxgy-fab__button{width:80px;height:80px;border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 4px 6px #0000001a;cursor:pointer;transition:all .2s}.discounty-bxgy-fab__close{position:absolute;top:-8px;right:-8px;width:24px;height:24px;border-radius:50%;border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 2px 4px #0000001a;cursor:pointer;font-size:14px;transition:background-color .2s}.discounty-shipping-progress-bar-widget{width:100%;box-sizing:border-box;font-family:inherit;border:1px solid;transition:all .3s ease;padding:16px;margin:16px auto}.discounty-shipping-progress-bar-widget__content{display:flex;flex-direction:column}.discounty-shipping-progress-bar-widget__title{font-weight:700;text-align:center;line-height:1.4;margin:0}.discounty-shipping-progress-bar-widget__progress-section{display:flex;align-items:center;gap:12px}.discounty-shipping-progress-bar-widget__progress-container{position:relative;flex:1;height:14px;overflow:hidden;transition:background-color .3s ease}.discounty-shipping-progress-bar-widget__progress-fill{display:block!important;height:100%;overflow:hidden;transition:all .5s ease}.discounty-shipping-progress-bar-widget__progress-fill:after{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#fff0,#fff6 30%,#fff9,#fff6 70%,#fff0);animation:discounty-shipping-shimmer 1.5s ease-in-out infinite}.discounty-shipping-progress-bar-widget__icon{flex-shrink:0;transition:all .3s ease}.discounty-shipping-progress-bar-widget__achieved{font-size:10px;text-align:center;opacity:.85}@keyframes discounty-shipping-shimmer{0%{left:-100%;opacity:0}50%{opacity:1}to{left:100%;opacity:0}}';function Hs({children:t,shopInfo:e}){return ne(()=>{$i()&&y.enableLogs()},[e]),l(X,{children:[l(Ot,{wrapper:document.head,children:l("style",{id:"discounty-global-styles",children:Vs})}),e.globalCss!=null&&l(Ot,{wrapper:document.head,children:l("style",{id:"discounty-shop-styles",children:e.globalCss})}),t]})}function Us(){const[t,e]=H(null);ne(()=>{async function r(){const o=T;await o.initialize(),e(o)}r()},[]),ne(()=>{t!=null&&Bs(t)},[t]);const n=t!=null&&(t.startCountdownWidget.isActive||t.endCountdownWidget.isActive)&&j.isProductPage;return t!=null?l(Hs,{shopInfo:t,children:n?l($s,{startConfig:t.startCountdownWidget,endConfig:t.endCountdownWidget}):null}):null}function Ws(...[t,e,...n]){const r=document.createElement("div");r.id="discounty-root",r.dataset.discountyMounted="true",e.appendChild(r),zr(t,r,...n)}Ws(l(Qr,{children:l(Us,{})}),document.body)})();