yt-uikit 0.7.375 → 0.7.377
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +5 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -381,7 +381,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
381
381
|
width: 50px;
|
|
382
382
|
height: 50px;
|
|
383
383
|
}
|
|
384
|
-
`,Xe=({buttonColor:e,children:n,onClick:r})=>t.createElement(Ye,{onClick:r,buttonColor:e},n),Je=({segments:e,setWinningSegment:n,brandGameDefaultThemeColor:r,brandThemeColor:o,ctaButtonText:a,wheelSectionColor1:i,wheelSectionColor2:l,wheelCenterLogo:s,isStatic:d})=>{const[p,u]=c(!1),[m,f]=c(0),[g,h]=c(!1),[x,y]=c(!1);return t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"15px",height:"100%",overflow:"hidden"}},t.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{borderRadius:"full",transform:"rotate(180deg)"}}),t.createElement(Ze,null),t.createElement(qe,null,t.createElement(Ke,{$isDisabled:g,$brandThemeColor:o,$brandGameDefaultThemeColor:r},t.createElement("img",{src:s??"https://i.imgur.com/nZIyqNu.png",style:{height:"45px",width:"55px"},alt:"YourToken LOGO"})))),t.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"}},!d&&t.createElement(Xe,{buttonColor:o??r??"black",onClick:()=>!(d&&!0===d)&&(()=>{if(!g&&!x){y(!0),u(!p),h(!0);let t=0,n=[];if(e.forEach((e=>{e?.probability&&e.probability>0&&(t+=e.probability)})),0===t)n=Array.from({length:e.length},(()=>0));else{let r=0;e.forEach((e=>{e?.probability&&e.probability>0?(r+=e.probability/t*100,n.push(r)):n.push(r)}))}const r=100*Math.random();let o;for(let e=0;e<n.length;e++)if(r<=n[e]){o=e;break}const a=360/e.length;if(void 0===o){let t=0,n=0;e.forEach(((e,r)=>{e?.probability&&e.probability>n&&(n=e.probability,t=r)})),o=t}const i=(o+.5)*a,l=360*Math.floor(5*Math.random()+5);f(l-i)}})()},a??"Spin Now!")))};function et(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function tt(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"},child:[]}]})(e)}function nt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},child:[]}]})(e)}function rt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(e)}function ot(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(e)}function at(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"},child:[]}]})(e)}function it(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 448c0 17.7 14.3 32 32 32h160V320H32v128zm256 32h160c17.7 0 32-14.3 32-32V320H288v160zm192-320h-42.1c6.2-12.1 10.1-25.5 10.1-40 0-48.5-39.5-88-88-88-41.6 0-68.5 21.3-103 68.3-34.5-47-61.4-68.3-103-68.3-48.5 0-88 39.5-88 88 0 14.5 3.8 27.9 10.1 40H32c-17.7 0-32 14.3-32 32v80c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-80c0-17.7-14.3-32-32-32zm-326.1 0c-22.1 0-40-17.9-40-40s17.9-40 40-40c19.9 0 34.6 3.3 86.1 80h-86.1zm206.1 0h-86.1c51.4-76.5 65.7-80 86.1-80 22.1 0 40 17.9 40 40s-17.9 40-40 40z"},child:[]}]})(e)}function lt(e){return _({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function ct(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"},child:[]}]})(e)}function st(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:"currentColor"},child:[]}]})(e)}function dt(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:"currentColor"},child:[]}]})(e)}function pt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"},child:[]}]})(e)}function ut(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z"},child:[]}]})(e)}function mt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"},child:[]}]})(e)}const ft=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,gt=e=>"init"in e,ht=e=>!!e.write,xt=e=>"v"in e||"e"in e,yt=e=>{if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},bt=new WeakMap,vt=e=>{var t;return Ct(e)&&!!(null==(t=bt.get(e))?void 0:t[0])},wt=(e,t)=>{let n=bt.get(e);if(!n){n=[!0,new Set],bt.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)},Ct=e=>"function"==typeof(null==e?void 0:e.then),kt=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then((()=>{n.p.delete(e)}),(()=>{n.p.delete(e)})))},Et=(e,t,n)=>{const r=n(e),o="v"in r,a=r.v;if(Ct(t))for(const o of r.d.keys())kt(e,t,n(o));r.v=t,delete r.e,o&&Object.is(a,r.v)||(++r.n,Ct(a)&&(e=>{const t=bt.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach((e=>e())))})(a))},Tt=(e,t,n)=>{var r;const o=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])n.has(t)&&o.add(t);for(const e of t.p)o.add(e);return o},St=()=>{const e={},t=new WeakMap,n=n=>{var r,o;null==(r=t.get(e))||r.forEach((e=>e(n))),null==(o=t.get(n))||o.forEach((e=>e()))};return n.add=(n,r)=>{const o=n||e,a=(t.has(o)?t:t.set(o,new Set)).get(o);return a.add(r),()=>{null==a||a.delete(r),a.size||t.delete(o)}},n},$t=Symbol(),Bt=(e=new WeakMap,t=new WeakMap,n=new WeakMap,r=new Set,o=new Set,a=new Set,i={},l=(e,...t)=>e.read(...t),c=(e,...t)=>e.write(...t),s=(e,t)=>{var n;return null==(n=e.unstable_onInit)?void 0:n.call(e,t)},d=(e,t)=>{var n;return null==(n=e.onMount)?void 0:n.call(e,t)},...p)=>{const u=p[0]||(t=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let n=e.get(t);return n||(n={d:new Map,p:new Set,n:0},e.set(t,n),null==s||s(t,C)),n}),m=p[1]||(()=>{const e=[],n=t=>{try{t()}catch(t){e.push(t)}};do{i.f&&n(i.f);const e=new Set,l=e.add.bind(e);r.forEach((e=>{var n;return null==(n=t.get(e))?void 0:n.l.forEach(l)})),r.clear(),a.forEach(l),a.clear(),o.forEach(l),o.clear(),e.forEach(n),r.size&&f()}while(r.size||a.size||o.size);if(e.length)throw new AggregateError(e)}),f=p[2]||(()=>{const e=[],o=new WeakSet,a=new WeakSet,i=Array.from(r);for(;i.length;){const r=i[i.length-1],l=u(r);if(a.has(r))i.pop();else if(o.has(r)){if(n.get(r)===l.n)e.push([r,l]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&n.has(r))throw new Error("[Bug] invalidated atom exists");a.add(r),i.pop()}else{o.add(r);for(const e of Tt(r,l,t))o.has(e)||i.push(e)}}for(let t=e.length-1;t>=0;--t){const[o,a]=e[t];let i=!1;for(const e of a.d.keys())if(e!==o&&r.has(e)){i=!0;break}i&&(g(o),y(o)),n.delete(o)}}),g=p[3]||(e=>{var o;const a=u(e);if(xt(a)){if(t.has(e)&&n.get(e)!==a.n)return a;if(Array.from(a.d).every((([e,t])=>g(e).n===t)))return a}a.d.clear();let c=!0;const s=()=>{t.has(e)&&(y(e),f(),m())},d=n=>{var r;if(ft(e,n)){const e=u(n);if(!xt(e)){if(!gt(n))throw new Error("no atom init");Et(n,n.init,u)}return yt(e)}const o=g(n);try{return yt(o)}finally{a.d.set(n,o.n),vt(a.v)&&kt(e,a.v,o),null==(r=t.get(n))||r.t.add(e),c||s()}};let p,h;const b={get signal(){return p||(p=new AbortController),p.signal},get setSelf(){return"production"===(import.meta.env?import.meta.env.MODE:void 0)||ht(e)||console.warn("setSelf function cannot be used with read-only atom"),!h&&ht(e)&&(h=(...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&c&&console.warn("setSelf function cannot be called in sync"),!c)try{return x(e,...t)}finally{f(),m()}}),h}},v=a.n;try{const t=l(e,d,b);return Et(e,t,u),Ct(t)&&(wt(t,(()=>null==p?void 0:p.abort())),t.then(s,s)),a}catch(e){return delete a.v,a.e=e,++a.n,a}finally{c=!1,v!==a.n&&n.get(e)===v&&(n.set(e,a.n),r.add(e),null==(o=i.c)||o.call(i,e))}}),h=p[4]||(e=>{const r=[e];for(;r.length;){const e=r.pop(),o=u(e);for(const a of Tt(e,o,t)){const e=u(a);n.set(a,e.n),r.push(a)}}}),x=p[5]||((e,...t)=>{let n=!0;const o=e=>yt(g(e)),a=(t,...o)=>{var a;const l=u(t);try{if(ft(e,t)){if(!gt(t))throw new Error("atom not writable");const e=l.n,n=o[0];return Et(t,n,u),y(t),void(e!==l.n&&(r.add(t),null==(a=i.c)||a.call(i,t),h(t)))}return x(t,...o)}finally{n||(f(),m())}};try{return c(e,o,a,...t)}finally{n=!1}}),y=p[6]||(e=>{var n;const o=u(e),a=t.get(e);if(a&&!vt(o.v)){for(const[t,l]of o.d)if(!a.d.has(t)){const o=u(t);b(t).t.add(e),a.d.add(t),l!==o.n&&(r.add(t),null==(n=i.c)||n.call(i,t),h(t))}for(const t of a.d||[])if(!o.d.has(t)){a.d.delete(t);const n=v(t);null==n||n.t.delete(e)}}}),b=p[7]||(e=>{var n;const r=u(e);let a=t.get(e);if(!a){g(e);for(const t of r.d.keys()){b(t).t.add(e)}if(a={l:new Set,d:new Set(r.d.keys()),t:new Set},t.set(e,a),null==(n=i.m)||n.call(i,e),ht(e)){const t=()=>{let t=!0;const n=(...n)=>{try{return x(e,...n)}finally{t||(f(),m())}};try{const r=d(e,n);r&&(a.u=()=>{t=!0;try{r()}finally{t=!1}})}finally{t=!1}};o.add(t)}}return a}),v=p[8]||(e=>{var n;const r=u(e);let o=t.get(e);if(!o||o.l.size||Array.from(o.t).some((n=>{var r;return null==(r=t.get(n))?void 0:r.d.has(e)})))return o;o.u&&a.add(o.u),o=void 0,t.delete(e),null==(n=i.u)||n.call(i,e);for(const t of r.d.keys()){const n=v(t);null==n||n.t.delete(e)}}),w=[e,t,n,r,o,a,i,l,c,s,d,u,m,f,g,h,x,y,b,v],C={get:e=>yt(g(e)),set:(e,...t)=>{try{return x(e,...t)}finally{f(),m()}},sub:(e,t)=>{const n=b(e).l;return n.add(t),m(),()=>{n.delete(t),v(e),m()}}};return Object.defineProperty(C,$t,{value:w}),C},zt=e=>(e.c||(e.c=St()),e.m||(e.m=St()),e.u||(e.u=St()),e.f||(e.f=(()=>{const e=new Set,t=()=>{e.forEach((e=>e()))};return t.add=t=>(e.add(t),()=>{e.delete(t)}),t})()),e),Dt=wt;let It=0;function _t(e,t){const n="atom"+ ++It,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=Ot,r.write=Pt),t&&(r.write=t),r}function Ot(e){return e(this)}function Pt(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function At(){if("production"!==(import.meta.env?import.meta.env.MODE:void 0))return(()=>{let e=0;const t=zt({}),n=new WeakMap,r=new WeakMap,o=Bt(n,r,void 0,void 0,void 0,void 0,t,void 0,((t,n,r,...o)=>e?r(t,...o):t.write(n,r,...o))),a=new Set;t.m.add(void 0,(e=>{a.add(e),n.get(e).m=r.get(e)})),t.u.add(void 0,(e=>{a.delete(e),delete n.get(e).m}));const i={dev4_get_internal_weak_map:()=>n,dev4_get_mounted_atoms:()=>a,dev4_restore_atoms:t=>{const n={read:()=>null,write:(n,r)=>{++e;try{for(const[e,n]of t)"init"in e&&r(e,n)}finally{--e}}};o.set(n)}};return Object.assign(o,i)})();return Bt()}let Nt;const Ft=s(void 0);function Mt(e){const t=u(Ft);return(null==e?void 0:e.store)||t||(Nt||(Nt=At(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Nt),globalThis.__JOTAI_DEFAULT_STORE__!==Nt&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Nt)}const Rt=e=>"function"==typeof(null==e?void 0:e.then),Lt=e=>{e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t}))},jt=t.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(Lt(e),e)}),Vt=new WeakMap,Ht=(e,t)=>{let n=Vt.get(e);return n||(n=new Promise(((r,o)=>{let a=e;const i=e=>t=>{a===e&&r(t)},l=e=>t=>{a===e&&o(t)},c=()=>{try{const e=t();Rt(e)?(Vt.set(e,n),a=e,e.then(i(e),l(e)),Dt(e,c)):r(e)}catch(e){o(e)}};e.then(i(e),l(e)),Dt(e,c)})),Vt.set(e,n)),n};function Wt(e,t){const n=Mt(t),[[r,o,a],i]=d((t=>{const r=n.get(e);return Object.is(t[0],r)&&t[1]===n&&t[2]===e?t:[r,n,e]}),void 0,(()=>[n.get(e),n,e]));let c=r;o===n&&a===e||(i(),c=n.get(e));const s=null==t?void 0:t.delay;if(l((()=>{const t=n.sub(e,(()=>{if("number"==typeof s){const t=n.get(e);return Rt(t)&&Lt(Ht(t,(()=>n.get(e)))),void setTimeout(i,s)}i()}));return i(),t}),[n,e,s]),p(c),Rt(c)){const t=Ht(c,(()=>n.get(e)));return jt(t)}return c}function Ut(e,t){const n=Mt(t);return a(((...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...t)}),[n,e])}function Qt(e,t){return[Wt(e,t),Ut(e,t)]}const Gt=_t(void 0),Yt=Symbol("production"!==(import.meta.env?import.meta.env.MODE:void 0)?"RESET":"");const qt=function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,o;const a={getItem:(n,a)=>{var i,l;const c=e=>{if(r!==(e=e||"")){try{o=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return a}r=e}return o},s=null!=(l=null==(i=e())?void 0:i.getItem(n))?l:null;return"function"==typeof(null==(d=s)?void 0:d.then)?s.then(c):c(s);var d},setItem:(n,r)=>{var o;return null==(o=e())?void 0:o.setItem(n,JSON.stringify(r,null==t?void 0:t.replacer))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let i;try{i=null==(n=e())?void 0:n.subscribe}catch(e){}var l;return!i&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(i=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),i&&(a.subscribe=(l=i,(e,t,n)=>l(e,(e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)})))),a}();function Zt(e,t,n=qt,r){const o=_t((null==r?void 0:r.getOnInit)?n.getItem(e,t):t);"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(o.debugPrivate=!0),o.onMount=r=>{let o;return r(n.getItem(e,t)),n.subscribe&&(o=n.subscribe(e,r,t)),o};return _t((e=>e(o)),((r,a,i)=>{const l="function"==typeof i?i(r(o)):i;return l===Yt?(a(o,t),n.removeItem(e)):l instanceof Promise?l.then((t=>(a(o,t),n.setItem(e,t)))):(a(o,l),n.setItem(e,l))}))}const Kt=Zt("deliveryOptionStateValidity",{isPostalCodeValid:!1,isDateValid:!1}),Xt=_t((e=>{const t=e(Kt);return t.isPostalCodeValid&&t.isDateValid})),Jt=Zt("deliveryType","standard"),en=Zt("deliverySlotDate",null),tn=_t({cartLoading:!1,showLoader:!1,showSkeletonLoader:!1,showLoyaltyCtaLoading:!1});function nn(){const[e,t]=Qt(tn);return{cartLoading:e,setLoading:(e,n,r,o)=>{t({cartLoading:e,showLoader:n,showSkeletonLoader:void 0!==r&&r,showLoyaltyCtaLoading:void 0!==o&&o})}}}const rn=_t({open:!1,variantId:void 0,quantity:void 0,handle:void 0,freebieSelection:!1,lineItemKey:void 0,productId:void 0,allowedVariantIds:void 0,productRec:!1}),on=_t(!1);var an="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ln={exports:{}};const cn={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};ln.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(cn,t)?cn[t]:void 0},ln.exports.currencySymbolMap=cn;var sn=ln.exports;const dn=(e,t)=>"INR"===t||"₹"===t||"Rs"===t||"Rs."===t||"rs"===t||"rs."===t||"RS."===t?Number((e/100).toFixed(2)):e,pn={79:"Rs. "},un=(e,t)=>{const n=t??e?.currency??"INR";return"undefined"!=typeof window&&window.ytapp?.brandId?pn[window.ytapp.brandId]??sn(n)??"₹":sn(n)??"₹"};function mn(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48C336 50.1 285.9 0 224 0S112 50.1 112 112l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"},child:[]}]})(e)}function fn(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"},child:[]}]})(e)}const gn=(e,t=15)=>e.length>t?e.substring(0,t)+"...":e,hn=(e,t,n,r="",o="16px")=>{const a=document.createElement("canvas").getContext("2d"),i=e.replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&");if(a){const e=r?`${o} ${r}`:o;a.font=e;const l=t/100*n;if(a.measureText(i).width>l){let e=i;for(let t=e.length-1;t>=0;t--){const n=e.slice(0,t)+"...";if(a.measureText(n).width<l)return n}return"..."}}return i};function xn(e,t){t=Math.max(0,Math.min(1,t));let n=Math.round(255*t).toString(16);return 1===n.length&&(n="0"+n),e+n}function yn(e,t){e=e.replace(/^#/,"");return`rgba(${parseInt(e.substring(0,2),16)}, ${parseInt(e.substring(2,4),16)}, ${parseInt(e.substring(4,6),16)}, ${t})`}const bn=e=>e?.split("/")?.pop();const vn=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function wn(e,t="#FFFFFF",n="#000000",r=.5){if(!e)return;const o=window.getComputedStyle(e).backgroundColor;let a=0,i=0,l=0;if("transparent"===o||"rgba(0, 0, 0, 0)"===o)return void(e.style.color=n);const c=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(c)a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10);else{const t=document.createElement("div");t.style.color=o,document.body.appendChild(t);const r=window.getComputedStyle(t).color;document.body.removeChild(t);const c=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(!c)return console.warn("setContrastTextColor: Could not parse background color:",o,"Resolved to:",r),void(e.style.color=n);a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10)}const s=[a/255,i/255,l/255].map((e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))),d=.2126*s[0]+.7152*s[1]+.0722*s[2];e.style.color=d>r?n:t}const Cn=e=>{if(null==e)return"";const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},kn=()=>{const e=window.ytapp?.storeDomain;return!!e&&["veeba-sauces.myshopify.com"].includes(e)},En=(e,t=150,n=85,r="webp")=>{if(!e||"string"!=typeof e)return"/placeholder.svg";if(""===e.trim()||"/placeholder.svg"===e)return"/placeholder.svg";try{if(!(e.includes("cdn.shopify.com")||e.includes("shopify.com")||e.includes(".myshopify.com")))return e;let o=e.split("?")[0];const a=o.lastIndexOf(".");if(-1===a)return e;const i=o.substring(a),l=o.substring(0,a).replace(/_\d+x\d*$|_x\d+$|_\d+x$/,""),c=`${l}${`_${t}x${t}`}${i}`,s=new URLSearchParams;"auto"!==r&&s.append("format",r),85!==n&&s.append("quality",n.toString());const d=s.toString();return d?`${c}?${d}`:c}catch(t){return console.warn("Failed to optimize Shopify image URL:",t),e}},Tn=e=>{if(!e||"string"!=typeof e)return e;const t=e.match(/^bundle-[^-]+-(.+)-([A-Za-z0-9]{5,8})$/);if(t&&t[1])return t[1].trim();const n=e.match(/^vol-(.+?)-([A-Za-z0-9\s-]{3,})$/i);return n&&n[1]?n[1].trim():e};function Sn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 6a1 1 0 0 1 .117 1.993l-.117 .007h-.081l-.919 11a3 3 0 0 1 -2.824 2.995l-.176 .005h-8c-1.598 0 -2.904 -1.249 -2.992 -2.75l-.005 -.167l-.923 -11.083h-.08a1 1 0 0 1 -.117 -1.993l.117 -.007h16zm-9.489 5.14a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z"},child:[]},{tag:"path",attr:{d:"M14 2a2 2 0 0 1 2 2a1 1 0 0 1 -1.993 .117l-.007 -.117h-4l-.007 .117a1 1 0 0 1 -1.993 -.117a2 2 0 0 1 1.85 -1.995l.15 -.005h4z"},child:[]}]})(e)}function $n(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M11 21h-2.426a3 3 0 0 1 -2.965 -2.544l-1.255 -8.152a2 2 0 0 1 1.977 -2.304h11.339a2 2 0 0 1 1.977 2.304l-.109 .707"},child:[]},{tag:"path",attr:{d:"M9 11v-5a3 3 0 0 1 6 0v5"},child:[]},{tag:"path",attr:{d:"M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39z"},child:[]}]})(e)}function Bn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7h16"},child:[]},{tag:"path",attr:{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"},child:[]},{tag:"path",attr:{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"},child:[]},{tag:"path",attr:{d:"M10 12l4 4m0 -4l-4 4"},child:[]}]})(e)}const zn=x.div`
|
|
384
|
+
`,Xe=({buttonColor:e,children:n,onClick:r})=>t.createElement(Ye,{onClick:r,buttonColor:e},n),Je=({segments:e,setWinningSegment:n,brandGameDefaultThemeColor:r,brandThemeColor:o,ctaButtonText:a,wheelSectionColor1:i,wheelSectionColor2:l,wheelCenterLogo:s,isStatic:d})=>{const[p,u]=c(!1),[m,f]=c(0),[g,h]=c(!1),[x,y]=c(!1);return t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"15px",height:"100%",overflow:"hidden"}},t.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{borderRadius:"full",transform:"rotate(180deg)"}}),t.createElement(Ze,null),t.createElement(qe,null,t.createElement(Ke,{$isDisabled:g,$brandThemeColor:o,$brandGameDefaultThemeColor:r},t.createElement("img",{src:s??"https://i.imgur.com/nZIyqNu.png",style:{height:"45px",width:"55px"},alt:"YourToken LOGO"})))),t.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"}},!d&&t.createElement(Xe,{buttonColor:o??r??"black",onClick:()=>!(d&&!0===d)&&(()=>{if(!g&&!x){y(!0),u(!p),h(!0);let t=0,n=[];if(e.forEach((e=>{e?.probability&&e.probability>0&&(t+=e.probability)})),0===t)n=Array.from({length:e.length},(()=>0));else{let r=0;e.forEach((e=>{e?.probability&&e.probability>0?(r+=e.probability/t*100,n.push(r)):n.push(r)}))}const r=100*Math.random();let o;for(let e=0;e<n.length;e++)if(r<=n[e]){o=e;break}const a=360/e.length;if(void 0===o){let t=0,n=0;e.forEach(((e,r)=>{e?.probability&&e.probability>n&&(n=e.probability,t=r)})),o=t}const i=(o+.5)*a,l=360*Math.floor(5*Math.random()+5);f(l-i)}})()},a??"Spin Now!")))};function et(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function tt(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"},child:[]}]})(e)}function nt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},child:[]}]})(e)}function rt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(e)}function ot(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(e)}function at(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"},child:[]}]})(e)}function it(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 448c0 17.7 14.3 32 32 32h160V320H32v128zm256 32h160c17.7 0 32-14.3 32-32V320H288v160zm192-320h-42.1c6.2-12.1 10.1-25.5 10.1-40 0-48.5-39.5-88-88-88-41.6 0-68.5 21.3-103 68.3-34.5-47-61.4-68.3-103-68.3-48.5 0-88 39.5-88 88 0 14.5 3.8 27.9 10.1 40H32c-17.7 0-32 14.3-32 32v80c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-80c0-17.7-14.3-32-32-32zm-326.1 0c-22.1 0-40-17.9-40-40s17.9-40 40-40c19.9 0 34.6 3.3 86.1 80h-86.1zm206.1 0h-86.1c51.4-76.5 65.7-80 86.1-80 22.1 0 40 17.9 40 40s-17.9 40-40 40z"},child:[]}]})(e)}function lt(e){return _({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function ct(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"},child:[]}]})(e)}function st(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:"currentColor"},child:[]}]})(e)}function dt(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:"currentColor"},child:[]}]})(e)}function pt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"},child:[]}]})(e)}function ut(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z"},child:[]}]})(e)}function mt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"},child:[]}]})(e)}const ft=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,gt=e=>"init"in e,ht=e=>!!e.write,xt=e=>"v"in e||"e"in e,yt=e=>{if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},bt=new WeakMap,vt=e=>{var t;return Ct(e)&&!!(null==(t=bt.get(e))?void 0:t[0])},wt=(e,t)=>{let n=bt.get(e);if(!n){n=[!0,new Set],bt.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)},Ct=e=>"function"==typeof(null==e?void 0:e.then),kt=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then((()=>{n.p.delete(e)}),(()=>{n.p.delete(e)})))},Et=(e,t,n)=>{const r=n(e),o="v"in r,a=r.v;if(Ct(t))for(const o of r.d.keys())kt(e,t,n(o));r.v=t,delete r.e,o&&Object.is(a,r.v)||(++r.n,Ct(a)&&(e=>{const t=bt.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach((e=>e())))})(a))},Tt=(e,t,n)=>{var r;const o=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])n.has(t)&&o.add(t);for(const e of t.p)o.add(e);return o},St=()=>{const e={},t=new WeakMap,n=n=>{var r,o;null==(r=t.get(e))||r.forEach((e=>e(n))),null==(o=t.get(n))||o.forEach((e=>e()))};return n.add=(n,r)=>{const o=n||e,a=(t.has(o)?t:t.set(o,new Set)).get(o);return a.add(r),()=>{null==a||a.delete(r),a.size||t.delete(o)}},n},$t=Symbol(),Bt=(e=new WeakMap,t=new WeakMap,n=new WeakMap,r=new Set,o=new Set,a=new Set,i={},l=(e,...t)=>e.read(...t),c=(e,...t)=>e.write(...t),s=(e,t)=>{var n;return null==(n=e.unstable_onInit)?void 0:n.call(e,t)},d=(e,t)=>{var n;return null==(n=e.onMount)?void 0:n.call(e,t)},...p)=>{const u=p[0]||(t=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let n=e.get(t);return n||(n={d:new Map,p:new Set,n:0},e.set(t,n),null==s||s(t,C)),n}),m=p[1]||(()=>{const e=[],n=t=>{try{t()}catch(t){e.push(t)}};do{i.f&&n(i.f);const e=new Set,l=e.add.bind(e);r.forEach((e=>{var n;return null==(n=t.get(e))?void 0:n.l.forEach(l)})),r.clear(),a.forEach(l),a.clear(),o.forEach(l),o.clear(),e.forEach(n),r.size&&f()}while(r.size||a.size||o.size);if(e.length)throw new AggregateError(e)}),f=p[2]||(()=>{const e=[],o=new WeakSet,a=new WeakSet,i=Array.from(r);for(;i.length;){const r=i[i.length-1],l=u(r);if(a.has(r))i.pop();else if(o.has(r)){if(n.get(r)===l.n)e.push([r,l]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&n.has(r))throw new Error("[Bug] invalidated atom exists");a.add(r),i.pop()}else{o.add(r);for(const e of Tt(r,l,t))o.has(e)||i.push(e)}}for(let t=e.length-1;t>=0;--t){const[o,a]=e[t];let i=!1;for(const e of a.d.keys())if(e!==o&&r.has(e)){i=!0;break}i&&(g(o),y(o)),n.delete(o)}}),g=p[3]||(e=>{var o;const a=u(e);if(xt(a)){if(t.has(e)&&n.get(e)!==a.n)return a;if(Array.from(a.d).every((([e,t])=>g(e).n===t)))return a}a.d.clear();let c=!0;const s=()=>{t.has(e)&&(y(e),f(),m())},d=n=>{var r;if(ft(e,n)){const e=u(n);if(!xt(e)){if(!gt(n))throw new Error("no atom init");Et(n,n.init,u)}return yt(e)}const o=g(n);try{return yt(o)}finally{a.d.set(n,o.n),vt(a.v)&&kt(e,a.v,o),null==(r=t.get(n))||r.t.add(e),c||s()}};let p,h;const b={get signal(){return p||(p=new AbortController),p.signal},get setSelf(){return"production"===(import.meta.env?import.meta.env.MODE:void 0)||ht(e)||console.warn("setSelf function cannot be used with read-only atom"),!h&&ht(e)&&(h=(...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&c&&console.warn("setSelf function cannot be called in sync"),!c)try{return x(e,...t)}finally{f(),m()}}),h}},v=a.n;try{const t=l(e,d,b);return Et(e,t,u),Ct(t)&&(wt(t,(()=>null==p?void 0:p.abort())),t.then(s,s)),a}catch(e){return delete a.v,a.e=e,++a.n,a}finally{c=!1,v!==a.n&&n.get(e)===v&&(n.set(e,a.n),r.add(e),null==(o=i.c)||o.call(i,e))}}),h=p[4]||(e=>{const r=[e];for(;r.length;){const e=r.pop(),o=u(e);for(const a of Tt(e,o,t)){const e=u(a);n.set(a,e.n),r.push(a)}}}),x=p[5]||((e,...t)=>{let n=!0;const o=e=>yt(g(e)),a=(t,...o)=>{var a;const l=u(t);try{if(ft(e,t)){if(!gt(t))throw new Error("atom not writable");const e=l.n,n=o[0];return Et(t,n,u),y(t),void(e!==l.n&&(r.add(t),null==(a=i.c)||a.call(i,t),h(t)))}return x(t,...o)}finally{n||(f(),m())}};try{return c(e,o,a,...t)}finally{n=!1}}),y=p[6]||(e=>{var n;const o=u(e),a=t.get(e);if(a&&!vt(o.v)){for(const[t,l]of o.d)if(!a.d.has(t)){const o=u(t);b(t).t.add(e),a.d.add(t),l!==o.n&&(r.add(t),null==(n=i.c)||n.call(i,t),h(t))}for(const t of a.d||[])if(!o.d.has(t)){a.d.delete(t);const n=v(t);null==n||n.t.delete(e)}}}),b=p[7]||(e=>{var n;const r=u(e);let a=t.get(e);if(!a){g(e);for(const t of r.d.keys()){b(t).t.add(e)}if(a={l:new Set,d:new Set(r.d.keys()),t:new Set},t.set(e,a),null==(n=i.m)||n.call(i,e),ht(e)){const t=()=>{let t=!0;const n=(...n)=>{try{return x(e,...n)}finally{t||(f(),m())}};try{const r=d(e,n);r&&(a.u=()=>{t=!0;try{r()}finally{t=!1}})}finally{t=!1}};o.add(t)}}return a}),v=p[8]||(e=>{var n;const r=u(e);let o=t.get(e);if(!o||o.l.size||Array.from(o.t).some((n=>{var r;return null==(r=t.get(n))?void 0:r.d.has(e)})))return o;o.u&&a.add(o.u),o=void 0,t.delete(e),null==(n=i.u)||n.call(i,e);for(const t of r.d.keys()){const n=v(t);null==n||n.t.delete(e)}}),w=[e,t,n,r,o,a,i,l,c,s,d,u,m,f,g,h,x,y,b,v],C={get:e=>yt(g(e)),set:(e,...t)=>{try{return x(e,...t)}finally{f(),m()}},sub:(e,t)=>{const n=b(e).l;return n.add(t),m(),()=>{n.delete(t),v(e),m()}}};return Object.defineProperty(C,$t,{value:w}),C},zt=e=>(e.c||(e.c=St()),e.m||(e.m=St()),e.u||(e.u=St()),e.f||(e.f=(()=>{const e=new Set,t=()=>{e.forEach((e=>e()))};return t.add=t=>(e.add(t),()=>{e.delete(t)}),t})()),e),Dt=wt;let It=0;function _t(e,t){const n="atom"+ ++It,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=Ot,r.write=Pt),t&&(r.write=t),r}function Ot(e){return e(this)}function Pt(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function At(){if("production"!==(import.meta.env?import.meta.env.MODE:void 0))return(()=>{let e=0;const t=zt({}),n=new WeakMap,r=new WeakMap,o=Bt(n,r,void 0,void 0,void 0,void 0,t,void 0,((t,n,r,...o)=>e?r(t,...o):t.write(n,r,...o))),a=new Set;t.m.add(void 0,(e=>{a.add(e),n.get(e).m=r.get(e)})),t.u.add(void 0,(e=>{a.delete(e),delete n.get(e).m}));const i={dev4_get_internal_weak_map:()=>n,dev4_get_mounted_atoms:()=>a,dev4_restore_atoms:t=>{const n={read:()=>null,write:(n,r)=>{++e;try{for(const[e,n]of t)"init"in e&&r(e,n)}finally{--e}}};o.set(n)}};return Object.assign(o,i)})();return Bt()}let Nt;const Ft=s(void 0);function Mt(e){const t=u(Ft);return(null==e?void 0:e.store)||t||(Nt||(Nt=At(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Nt),globalThis.__JOTAI_DEFAULT_STORE__!==Nt&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Nt)}const Rt=e=>"function"==typeof(null==e?void 0:e.then),Lt=e=>{e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t}))},jt=t.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(Lt(e),e)}),Vt=new WeakMap,Ht=(e,t)=>{let n=Vt.get(e);return n||(n=new Promise(((r,o)=>{let a=e;const i=e=>t=>{a===e&&r(t)},l=e=>t=>{a===e&&o(t)},c=()=>{try{const e=t();Rt(e)?(Vt.set(e,n),a=e,e.then(i(e),l(e)),Dt(e,c)):r(e)}catch(e){o(e)}};e.then(i(e),l(e)),Dt(e,c)})),Vt.set(e,n)),n};function Wt(e,t){const n=Mt(t),[[r,o,a],i]=d((t=>{const r=n.get(e);return Object.is(t[0],r)&&t[1]===n&&t[2]===e?t:[r,n,e]}),void 0,(()=>[n.get(e),n,e]));let c=r;o===n&&a===e||(i(),c=n.get(e));const s=null==t?void 0:t.delay;if(l((()=>{const t=n.sub(e,(()=>{if("number"==typeof s){const t=n.get(e);return Rt(t)&&Lt(Ht(t,(()=>n.get(e)))),void setTimeout(i,s)}i()}));return i(),t}),[n,e,s]),p(c),Rt(c)){const t=Ht(c,(()=>n.get(e)));return jt(t)}return c}function Ut(e,t){const n=Mt(t);return a(((...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...t)}),[n,e])}function Qt(e,t){return[Wt(e,t),Ut(e,t)]}const Gt=_t(void 0),Yt=Symbol("production"!==(import.meta.env?import.meta.env.MODE:void 0)?"RESET":"");const qt=function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,o;const a={getItem:(n,a)=>{var i,l;const c=e=>{if(r!==(e=e||"")){try{o=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return a}r=e}return o},s=null!=(l=null==(i=e())?void 0:i.getItem(n))?l:null;return"function"==typeof(null==(d=s)?void 0:d.then)?s.then(c):c(s);var d},setItem:(n,r)=>{var o;return null==(o=e())?void 0:o.setItem(n,JSON.stringify(r,null==t?void 0:t.replacer))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let i;try{i=null==(n=e())?void 0:n.subscribe}catch(e){}var l;return!i&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(i=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),i&&(a.subscribe=(l=i,(e,t,n)=>l(e,(e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)})))),a}();function Zt(e,t,n=qt,r){const o=_t((null==r?void 0:r.getOnInit)?n.getItem(e,t):t);"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(o.debugPrivate=!0),o.onMount=r=>{let o;return r(n.getItem(e,t)),n.subscribe&&(o=n.subscribe(e,r,t)),o};return _t((e=>e(o)),((r,a,i)=>{const l="function"==typeof i?i(r(o)):i;return l===Yt?(a(o,t),n.removeItem(e)):l instanceof Promise?l.then((t=>(a(o,t),n.setItem(e,t)))):(a(o,l),n.setItem(e,l))}))}const Kt=Zt("deliveryOptionStateValidity",{isPostalCodeValid:!1,isDateValid:!1}),Xt=_t((e=>{const t=e(Kt);return t.isPostalCodeValid&&t.isDateValid})),Jt=Zt("deliveryType","standard"),en=Zt("deliverySlotDate",null),tn=_t({cartLoading:!1,showLoader:!1,showSkeletonLoader:!1,showLoyaltyCtaLoading:!1});function nn(){const[e,t]=Qt(tn);return{cartLoading:e,setLoading:(e,n,r,o)=>{t({cartLoading:e,showLoader:n,showSkeletonLoader:void 0!==r&&r,showLoyaltyCtaLoading:void 0!==o&&o})}}}const rn=_t({open:!1,variantId:void 0,quantity:void 0,handle:void 0,freebieSelection:!1,lineItemKey:void 0,productId:void 0,allowedVariantIds:void 0,productRec:!1}),on=_t(!1);var an="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ln={exports:{}};const cn={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};ln.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(cn,t)?cn[t]:void 0},ln.exports.currencySymbolMap=cn;var sn=ln.exports;const dn=(e,t)=>"INR"===t||"₹"===t||"Rs"===t||"Rs."===t||"rs"===t||"rs."===t||"RS."===t?Number((e/100).toFixed(2)):e,pn={79:"Rs. "},un=(e,t)=>{const n=t??e?.currency??"INR";return"undefined"!=typeof window&&window.ytapp?.brandId?pn[window.ytapp.brandId]??sn(n)??"₹":sn(n)??"₹"};function mn(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48C336 50.1 285.9 0 224 0S112 50.1 112 112l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"},child:[]}]})(e)}function fn(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"},child:[]}]})(e)}const gn=(e,t=15)=>e.length>t?e.substring(0,t)+"...":e,hn=(e,t,n,r="",o="16px")=>{const a=document.createElement("canvas").getContext("2d"),i=e.replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&");if(a){const e=r?`${o} ${r}`:o;a.font=e;const l=t/100*n;if(a.measureText(i).width>l){let e=i;for(let t=e.length-1;t>=0;t--){const n=e.slice(0,t)+"...";if(a.measureText(n).width<l)return n}return"..."}}return i};function xn(e,t){t=Math.max(0,Math.min(1,t));let n=Math.round(255*t).toString(16);return 1===n.length&&(n="0"+n),e+n}function yn(e,t){e=e.replace(/^#/,"");return`rgba(${parseInt(e.substring(0,2),16)}, ${parseInt(e.substring(2,4),16)}, ${parseInt(e.substring(4,6),16)}, ${t})`}const bn=e=>e?.split("/")?.pop();const vn=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function wn(e,t="#FFFFFF",n="#000000",r=.5){if(!e)return;const o=window.getComputedStyle(e).backgroundColor;let a=0,i=0,l=0;if("transparent"===o||"rgba(0, 0, 0, 0)"===o)return void(e.style.color=n);const c=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(c)a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10);else{const t=document.createElement("div");t.style.color=o,document.body.appendChild(t);const r=window.getComputedStyle(t).color;document.body.removeChild(t);const c=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(!c)return console.warn("setContrastTextColor: Could not parse background color:",o,"Resolved to:",r),void(e.style.color=n);a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10)}const s=[a/255,i/255,l/255].map((e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))),d=.2126*s[0]+.7152*s[1]+.0722*s[2];e.style.color=d>r?n:t}const Cn=e=>{if(null==e)return"";const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},kn=()=>{const e=window.ytapp?.storeDomain;return!!e&&["veeba-sauces.myshopify.com"].includes(e)},En=(e,t=150,n=85,r="webp")=>{if(!e||"string"!=typeof e)return"/placeholder.svg";if(""===e.trim()||"/placeholder.svg"===e)return"/placeholder.svg";try{if(!(e.includes("cdn.shopify.com")||e.includes("shopify.com")||e.includes(".myshopify.com")))return e;let o=e.split("?")[0];const a=o.lastIndexOf(".");if(-1===a)return e;const i=o.substring(a),l=o.substring(0,a).replace(/_\d+x\d*$|_x\d+$|_\d+x$/,""),c=`${l}${`_${t}x${t}`}${i}`,s=new URLSearchParams;"auto"!==r&&s.append("format",r),85!==n&&s.append("quality",n.toString());const d=s.toString();return d?`${c}?${d}`:c}catch(t){return console.warn("Failed to optimize Shopify image URL:",t),e}},Tn=e=>{if(!e||"string"!=typeof e)return e;const t=e.match(/^bundle-[^-]+-(.+)-([A-Za-z0-9]{5,8})$/);if(t&&t[1])return t[1].trim();const n=e.match(/^vol-(.+?)-([A-Za-z0-9\s-]{3,})$/i);if(n&&n[1])return n[1].trim();const r=e.match(/^(YTA-|YTP-|YT-)(.+)$/);return r&&r[2]?r[2].trim():e};function Sn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 6a1 1 0 0 1 .117 1.993l-.117 .007h-.081l-.919 11a3 3 0 0 1 -2.824 2.995l-.176 .005h-8c-1.598 0 -2.904 -1.249 -2.992 -2.75l-.005 -.167l-.923 -11.083h-.08a1 1 0 0 1 -.117 -1.993l.117 -.007h16zm-9.489 5.14a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z"},child:[]},{tag:"path",attr:{d:"M14 2a2 2 0 0 1 2 2a1 1 0 0 1 -1.993 .117l-.007 -.117h-4l-.007 .117a1 1 0 0 1 -1.993 -.117a2 2 0 0 1 1.85 -1.995l.15 -.005h4z"},child:[]}]})(e)}function $n(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M11 21h-2.426a3 3 0 0 1 -2.965 -2.544l-1.255 -8.152a2 2 0 0 1 1.977 -2.304h11.339a2 2 0 0 1 1.977 2.304l-.109 .707"},child:[]},{tag:"path",attr:{d:"M9 11v-5a3 3 0 0 1 6 0v5"},child:[]},{tag:"path",attr:{d:"M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39z"},child:[]}]})(e)}function Bn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7h16"},child:[]},{tag:"path",attr:{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"},child:[]},{tag:"path",attr:{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"},child:[]},{tag:"path",attr:{d:"M10 12l4 4m0 -4l-4 4"},child:[]}]})(e)}const zn=x.div`
|
|
385
385
|
min-width: 145px !important;
|
|
386
386
|
padding: ${e=>"vertical"===e.$variant?"3px":"10px 30px"};
|
|
387
387
|
background-color: ${e=>e.$backgroundColor};
|
|
@@ -4845,9 +4845,12 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
4845
4845
|
padding: 10px;
|
|
4846
4846
|
`,ch=x.img`
|
|
4847
4847
|
width: 70px;
|
|
4848
|
+
min-width: 70px;
|
|
4848
4849
|
height: 70px;
|
|
4850
|
+
max-width: 70px;
|
|
4849
4851
|
border-radius: 8px;
|
|
4850
4852
|
object-fit: cover;
|
|
4853
|
+
object-position: top;
|
|
4851
4854
|
`,sh=x.div`
|
|
4852
4855
|
display: flex;
|
|
4853
4856
|
flex-direction: column;
|
|
@@ -4929,4 +4932,4 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
4929
4932
|
}
|
|
4930
4933
|
`,xh=x.span`
|
|
4931
4934
|
font-size: 12px;
|
|
4932
|
-
`,yh=({products:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:i,handleAddToCart:s,primaryProductId:d,variantId:p})=>{const[u,m]=c((()=>{const t={};return e.forEach((({productId:e,productDetails:n})=>{let r=n.options.map((e=>e.values[0]??""));if(e===d&&p){const e=n.variants.edges.find((e=>e.node.id.includes(p)))?.node;e&&(r=e.title.split(" / "))}t[e]=r})),t}));l((()=>{if(!d||!p)return;const t=e.find((e=>e.productId===d));if(!t)return;const n=t.productDetails.variants.edges.find((e=>e.node.id.includes(p)))?.node;if(n){const e=n.title.split(" / ");m((t=>({...t,[d]:e}))),g((e=>({...e,[d]:{node:n}}))),i(d,n.id)}}),[p,d]);const[f,g]=c({}),h=(t,n,r)=>{const o={...u};o[t][r]=n,m(o);const a=e.find((e=>e.productId===t));if(!a?.productDetails)return;const l=a.productDetails.variants.edges.find((e=>e.node.title===o[t].join(" / ")))?.node;l&&(i(t,l.id),g((e=>({...e,[t]:{node:l}}))))};if(!n)return null;const x=t.createElement(rh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(oh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(ah,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(((n,r)=>t.createElement(t.Fragment,null,t.createElement(lh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(ch,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n.productId]?.node?.image.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(sh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(dh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(uh,{className:"yt-fixedBundle-variant-modal_selected-value"},u[n.productId].join(" / "))),n.productDetails.options.map(((e,r)=>{const o=a&&a?.options?.find((t=>t.name===e.name));return e.values.length<=1?t.createElement(t.Fragment,null):o&&"color"===o?.type?t.createElement(mh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(fh,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:o.values.find((t=>t.name===e))?.value||e,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},t.createElement("span",null)):t.createElement(gh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):o&&"image"===o?.type?t.createElement(mh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(hh,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)},src:o.values.find((t=>t.name===e))?.value},t.createElement("span",null)):t.createElement(gh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):t.createElement(mh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,o)=>t.createElement(gh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:o,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))})))),r<e.length-1&&t.createElement(ph,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(ih,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:s},"Add bundle to cart")));return v.createPortal(x,document.body)},bh=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l((()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const p=e=>"color"===a?t.createElement(Yg,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(qg,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(jg,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(Vg,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(Hg,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(Wg,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(Ug,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(Qg,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(Gg,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},vh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l((()=>{if(a&&e.variants.edges.some((e=>e.node.id.includes(a)))){const t=e.variants.edges.find((e=>e.node.id.includes(a)))?.node;if(t){const e=t.title.split(" / ");p(e)}}}),[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find((t=>t.name===e));return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map((e=>({name:e,value:e})));const r=n.options.find((t=>t.name===e.name));return e.values.map((e=>{const t=r?.values?.find((t=>t.name===e));return{name:e,value:t?.value||e}}))},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find((e=>e.name===n))||null};return t.createElement(Zg,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(Kg,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(bh,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find((n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t])))?.node.id;o(a||"")})(r,t)},type:u(n.name)})))))},wh=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:i,onCheckChange:s,isMobile:d,isHorizontal:p,index:u,variantOptions:m,productsLength:f,handleOpenModal:g,storeCurrencyCode:h,primaryProductId:x,variantId:y})=>{const[b,v]=c(e.variants.edges.find((e=>e.node.id===n))?.node),[w]=c(e.options?.map((e=>e.values[0]))||[]),C=e.id===x;l((()=>{if(y&&e.id===x){const t=e.variants.edges.find((e=>e.node.id.includes(y)))?.node;t&&(v(t),i(t.id))}else{const t=e.variants.edges.find((e=>e.node.id===n))?.node;v(t)}}),[e,x,n,y]);const k="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,E=b?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,p?t.createElement("div",{className:""+(e.id===x?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(th,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(Jg,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,null))),t.createElement(mg,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(fg,{className:"yt-fixedBundle-product-card-horizontal_image",src:E,alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(gg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(hg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(xg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(yg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Th(a.general.currencySymbol,h)," ",Eh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(bg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Th(a.general.currencySymbol,h),Eh(b?.compareAtPrice))),t.createElement(vh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(Bg,{className:""+(e.id===x?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...k&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(nh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:k},t.createElement(Jg,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(zg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Dg,{className:"yt-fixedBundle-product-card_image--vertical",src:E,style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(Ig,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(_g,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Og,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(Pg,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(Ag,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Ng,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Mg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Fg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Th(a.general.currencySymbol,h),Eh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(bg,{className:"yt-fixedBundle-product-card-vertical_price--old"},Th(a.general.currencySymbol,h),Eh(b?.compareAtPrice))))),(f<=3||!d)&&u<f-1&&t.createElement(Rg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(Lg,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},Ch=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786),[d,p]=c(null),u="undefined"!=typeof window?window.location.href:null,m=e?.products?.find((e=>e.productDetails?.handle===u?.split("/").pop()?.split("?")[0])),f=m?.productId,[g,h]=c(Object.fromEntries(e?.products?.map((e=>[e.productId,e.productDetails?.variants?.edges?.find((e=>e.node.inventoryQuantity>0))?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id])))),[x,y]=c(!1),b="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),v=e?.showIndividualProductSelector||!0,[w,C]=c(new Set(e.products.filter((e=>!b||(e.productId===f||v))).map((e=>e.productId))));l((()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");p(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}}),[]),l((()=>{if(d&&f){const t=e?.products?.find((e=>e.productId===f));if(t){const e=t.productDetails?.variants?.edges?.some((e=>e.node.id.includes(d)));e&&h((e=>({...e,[f]:d})))}}}),[d,f,e?.products]),l((()=>{const e=()=>{s(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const k=(e,t)=>{h((n=>({...n,[e]:t})))},E=(e,t)=>{b&&v&&t===f||C((n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r}))},T=e.disableInventoryTracking||e.products.every((e=>e.productDetails.variants.edges.some((e=>e.node.inventoryQuantity>0)))),S=i((()=>e.products.some((e=>w.has(e.productId)&&e.productDetails.variants.edges.length>1))),[e.products,w]),{originalPrice:$,dealPrice:B,offerValue:z}=i((()=>{const{price:t,compareAtPrice:n}=e.products.reduce(((e,t)=>{if(!w.has(t.productId))return e;const n=t.productDetails.variants.edges?.find((e=>e.node.id===g[t.productId]))?.node,r=parseFloat(n?.price??"0"),o=parseFloat(n?.compareAtPrice||r.toString());return e.price+=r,e.compareAtPrice+=o,e}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);w.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[e.products,g,w,e.percentageOff,e.dealAmount,e.amountOff]),D=async e=>{e.preventDefault(),e.stopPropagation(),o(!0),y(!1);try{const e=Object.entries(g).filter((([e])=>w.has(e))).map((([e,t])=>t));n&&await n(Number($),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)};if(!n)return t.createElement(t.Fragment,null);if(e?.customizations.general?.trackInventory&&!T)return t.createElement(t.Fragment,null);const I=e.customizations,_=I.fixedBundle?.cardLayoutStyle||"auto",O="horizontal"===_||"auto"===_&&a,P=()=>{y(!0)},A="bundles"==e.appName?e.pageHeader?.title:e?.title,N="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(sg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:I.fixedBundle.sectionBackgroundColor,..."transparent"!==I.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(dg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:I.fixedBundle?.titleBackgroundColor||"none",color:I.fixedBundle?.titleTextColor||"black",textAlign:I.fixedBundle.infoAlignment??"center",fontSize:I.fixedBundle?.titleFontSize,..."transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),N&&t.createElement(pg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:I.fixedBundle?.subtitleFontSize,textAlign:I.fixedBundle.infoAlignment??"center",..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},N),O?t.createElement(ug,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map(((n,r)=>t.createElement(t.Fragment,{key:n.productId},t.createElement(wh,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>{E(e,n.productId)},isMobile:a,index:r,isHorizontal:O,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))))):t.createElement(Sg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement($g,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(wh,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>E(e,n.productId),isMobile:a,index:r,isHorizontal:O,productsLength:e.products.length,handleOpenModal:P,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))),S&&t.createElement(yh,{products:e.products.filter((e=>w.has(e.productId))),isOpen:x,onClose:()=>y(!1),variantOptions:e.variantOptions,cta:{textColor:I.general.ctaTextColor,backgroundColor:I.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:D,primaryProductId:f,variantId:d||void 0}))),t.createElement(vg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},Number($)>0&&Number(z)>0&&I.fixedBundle.compareAtPriceVisibility&&t.createElement(wg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(kg,{className:"yt-fixedBundle-summary_price"},Th(I.general.currencySymbol,e?.storeCurrencyCode),Eh($))),0!==w.size&&t.createElement(Cg,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(kg,{className:"yt-fixedBundle-summary_price"},Th(I.general.currencySymbol,e?.storeCurrencyCode),Eh(B))," ",Number(z)>0&&t.createElement(Eg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Th(I.general.currencySymbol,e?.storeCurrencyCode),Eh(z)))),t.createElement(Tg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),O||!S?D(e):y(!0)},disabled:w.size<1||r,style:{backgroundColor:I.general?.ctaBackgroundColor||"#121212",color:I.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${I.general?.ctaBackgroundColor||"#121212"}`,boxShadow:I.general.ctaShadowType,paddingTop:I.general?.ctaPadding,paddingBottom:I.general?.ctaPadding,borderRadius:I.general.ctaBorderRadius,width:I.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=I.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=I.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Uo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,I.fixedBundle?.ctaTitle??"Add Bundle to cart")))},kh=window?.Shopify?.currency||{rate:1,active:"INR"},Eh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*kh.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Th=(e,t)=>t==kh.active?e:sn(kh.active)||kh.active,Sh=(e,t,n,r,o)=>{const a=r.findIndex((t=>t.variantId===e));o(0===n?e=>e.filter(((e,t)=>t!==a)):-1===a?r=>[...r,{product:t,variantId:e,quantity:n}]:e=>e.map(((e,t)=>t===a?{...e,quantity:e.quantity+n}:e)))},$h=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(qm,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(Km,{bundle:e,addToCartFunction:r}):"mixnmatch"===e.type?t.createElement(cg,{bundle:e,addToCartFunction:r}):t.createElement(zf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(Ch,{addToCartFunction:r,bundle:e});L(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Bh=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},"")))));export{$h as Bundle,Bh as BundleLoader,nu as Cart,ra as CouponFrame,Qe as Nudge,Je as SpinnerWheel};
|
|
4935
|
+
`,yh=({products:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:i,handleAddToCart:s,primaryProductId:d,variantId:p})=>{const[u,m]=c((()=>{const t={};return e.forEach((({productId:e,productDetails:n})=>{let r=n.options.map((e=>e.values[0]??""));if(e===d&&p){const e=n.variants.edges.find((e=>e.node.id.includes(p)))?.node;e&&(r=e.title.split(" / "))}t[e]=r})),t}));l((()=>{if(!d||!p)return;const t=e.find((e=>e.productId===d));if(!t)return;const n=t.productDetails.variants.edges.find((e=>e.node.id.includes(p)))?.node;if(n){const e=n.title.split(" / ");m((t=>({...t,[d]:e}))),g((e=>({...e,[d]:{node:n}}))),i(d,n.id)}}),[p,d]);const[f,g]=c({}),h=(t,n,r)=>{const o={...u};o[t][r]=n,m(o);const a=e.find((e=>e.productId===t));if(!a?.productDetails)return;const l=a.productDetails.variants.edges.find((e=>e.node.title===o[t].join(" / ")))?.node;l&&(i(t,l.id),g((e=>({...e,[t]:{node:l}}))))};if(!n)return null;const x=t.createElement(rh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(oh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(ah,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(((n,r)=>t.createElement(t.Fragment,null,t.createElement(lh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(ch,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n.productId]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(sh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(dh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(uh,{className:"yt-fixedBundle-variant-modal_selected-value"},u[n.productId].join(" / "))),n.productDetails.options.map(((e,r)=>{const o=a&&a?.options?.find((t=>t.name===e.name));return e.values.length<=1?t.createElement(t.Fragment,null):o&&"color"===o?.type?t.createElement(mh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(fh,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:o.values.find((t=>t.name===e))?.value||e,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},t.createElement("span",null)):t.createElement(gh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):o&&"image"===o?.type?t.createElement(mh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o?.values.find((t=>t.name===e))?.value?t.createElement(hh,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)},src:o.values.find((t=>t.name===e))?.value},t.createElement("span",null)):t.createElement(gh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):t.createElement(mh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,o)=>t.createElement(gh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:o,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))})))),r<e.length-1&&t.createElement(ph,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(ih,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:s},"Add bundle to cart")));return v.createPortal(x,document.body)},bh=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l((()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const p=e=>"color"===a?t.createElement(Yg,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(qg,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(jg,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(Vg,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(Hg,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(Wg,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(Ug,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(Qg,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(Gg,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},vh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l((()=>{if(a&&e.variants.edges.some((e=>e.node.id.includes(a)))){const t=e.variants.edges.find((e=>e.node.id.includes(a)))?.node;if(t){const e=t.title.split(" / ");p(e)}}}),[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find((t=>t.name===e));return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map((e=>({name:e,value:e})));const r=n.options.find((t=>t.name===e.name));return e.values.map((e=>{const t=r?.values?.find((t=>t.name===e));return{name:e,value:t?.value||e}}))},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find((e=>e.name===n))||null};return t.createElement(Zg,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(Kg,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(bh,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find((n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t])))?.node.id;o(a||"")})(r,t)},type:u(n.name)})))))},wh=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:i,onCheckChange:s,isMobile:d,isHorizontal:p,index:u,variantOptions:m,productsLength:f,handleOpenModal:g,storeCurrencyCode:h,primaryProductId:x,variantId:y})=>{const[b,v]=c(e.variants.edges.find((e=>e.node.id===n))?.node),[w]=c(e.options?.map((e=>e.values[0]))||[]),C=e.id===x;l((()=>{if(y&&e.id===x){const t=e.variants.edges.find((e=>e.node.id.includes(y)))?.node;t&&(v(t),i(t.id))}else{const t=e.variants.edges.find((e=>e.node.id===n))?.node;v(t)}}),[e,x,n,y]);const k="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,E=b?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,p?t.createElement("div",{className:""+(e.id===x?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(th,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(Jg,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,null))),t.createElement(mg,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(fg,{className:"yt-fixedBundle-product-card-horizontal_image",src:E,alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(gg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(hg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(xg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(yg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Th(a.general.currencySymbol,h)," ",Eh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(bg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Th(a.general.currencySymbol,h),Eh(b?.compareAtPrice))),t.createElement(vh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(Bg,{className:""+(e.id===x?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...k&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(nh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:k},t.createElement(Jg,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(zg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Dg,{className:"yt-fixedBundle-product-card_image--vertical",src:E,style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(Ig,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(_g,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Og,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(Pg,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(Ag,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Ng,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Mg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Fg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Th(a.general.currencySymbol,h),Eh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(bg,{className:"yt-fixedBundle-product-card-vertical_price--old"},Th(a.general.currencySymbol,h),Eh(b?.compareAtPrice))))),(f<=3||!d)&&u<f-1&&t.createElement(Rg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(Lg,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},Ch=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786),[d,p]=c(null),u="undefined"!=typeof window?window.location.href:null,m=e?.products?.find((e=>e.productDetails?.handle===u?.split("/").pop()?.split("?")[0])),f=m?.productId,[g,h]=c(Object.fromEntries(e?.products?.map((e=>[e.productId,e.productDetails?.variants?.edges?.find((e=>e.node.inventoryQuantity>0))?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id])))),[x,y]=c(!1),b="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),v=e?.showIndividualProductSelector||!0,[w,C]=c(new Set(e.products.filter((e=>!b||(e.productId===f||v))).map((e=>e.productId))));l((()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");p(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}}),[]),l((()=>{if(d&&f){const t=e?.products?.find((e=>e.productId===f));if(t){const e=t.productDetails?.variants?.edges?.some((e=>e.node.id.includes(d)));e&&h((e=>({...e,[f]:d})))}}}),[d,f,e?.products]),l((()=>{const e=()=>{s(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const k=(e,t)=>{h((n=>({...n,[e]:t})))},E=(e,t)=>{b&&v&&t===f||C((n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r}))},T=e.disableInventoryTracking||e.products.every((e=>e.productDetails.variants.edges.some((e=>e.node.inventoryQuantity>0)))),S=i((()=>e.products.some((e=>w.has(e.productId)&&e.productDetails.variants.edges.length>1))),[e.products,w]),{originalPrice:$,dealPrice:B,offerValue:z}=i((()=>{const{price:t,compareAtPrice:n}=e.products.reduce(((e,t)=>{if(!w.has(t.productId))return e;const n=t.productDetails.variants.edges?.find((e=>e.node.id===g[t.productId]))?.node,r=parseFloat(n?.price??"0"),o=parseFloat(n?.compareAtPrice||r.toString());return e.price+=r,e.compareAtPrice+=o,e}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);w.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[e.products,g,w,e.percentageOff,e.dealAmount,e.amountOff]),D=async e=>{e.preventDefault(),e.stopPropagation(),o(!0),y(!1);try{const e=Object.entries(g).filter((([e])=>w.has(e))).map((([e,t])=>t));n&&await n(Number($),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)};if(!n)return t.createElement(t.Fragment,null);if(e?.customizations.general?.trackInventory&&!T)return t.createElement(t.Fragment,null);const I=e.customizations,_=I.fixedBundle?.cardLayoutStyle||"auto",O="horizontal"===_||"auto"===_&&a,P=()=>{y(!0)},A="bundles"==e.appName?e.pageHeader?.title:e?.title,N="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(sg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:I.fixedBundle.sectionBackgroundColor,..."transparent"!==I.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(dg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:I.fixedBundle?.titleBackgroundColor||"none",color:I.fixedBundle?.titleTextColor||"black",textAlign:I.fixedBundle.infoAlignment??"center",fontSize:I.fixedBundle?.titleFontSize,..."transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),N&&t.createElement(pg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:I.fixedBundle?.subtitleFontSize,textAlign:I.fixedBundle.infoAlignment??"center",..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},N),O?t.createElement(ug,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map(((n,r)=>t.createElement(t.Fragment,{key:n.productId},t.createElement(wh,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>{E(e,n.productId)},isMobile:a,index:r,isHorizontal:O,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))))):t.createElement(Sg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement($g,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(wh,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>E(e,n.productId),isMobile:a,index:r,isHorizontal:O,productsLength:e.products.length,handleOpenModal:P,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))),S&&t.createElement(yh,{products:e.products.filter((e=>w.has(e.productId))),isOpen:x,onClose:()=>y(!1),variantOptions:e.variantOptions,cta:{textColor:I.general.ctaTextColor,backgroundColor:I.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:D,primaryProductId:f,variantId:d||void 0}))),t.createElement(vg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},Number($)>0&&Number(z)>0&&I.fixedBundle.compareAtPriceVisibility&&t.createElement(wg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(kg,{className:"yt-fixedBundle-summary_price"},Th(I.general.currencySymbol,e?.storeCurrencyCode),Eh($))),0!==w.size&&t.createElement(Cg,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(kg,{className:"yt-fixedBundle-summary_price"},Th(I.general.currencySymbol,e?.storeCurrencyCode),Eh(B))," ",Number(z)>0&&t.createElement(Eg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Th(I.general.currencySymbol,e?.storeCurrencyCode),Eh(z)))),t.createElement(Tg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),O||!S?D(e):y(!0)},disabled:w.size<1||r,style:{backgroundColor:I.general?.ctaBackgroundColor||"#121212",color:I.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${I.general?.ctaBackgroundColor||"#121212"}`,boxShadow:I.general.ctaShadowType,paddingTop:I.general?.ctaPadding,paddingBottom:I.general?.ctaPadding,borderRadius:I.general.ctaBorderRadius,width:I.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=I.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=I.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Uo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,I.fixedBundle?.ctaTitle??"Add Bundle to cart")))},kh=window?.Shopify?.currency||{rate:1,active:"INR"},Eh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*kh.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Th=(e,t)=>t==kh.active?e:sn(kh.active)||kh.active,Sh=(e,t,n,r,o)=>{const a=r.findIndex((t=>t.variantId===e));o(0===n?e=>e.filter(((e,t)=>t!==a)):-1===a?r=>[...r,{product:t,variantId:e,quantity:n}]:e=>e.map(((e,t)=>t===a?{...e,quantity:e.quantity+n}:e)))},$h=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(qm,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(Km,{bundle:e,addToCartFunction:r}):"mixnmatch"===e.type?t.createElement(cg,{bundle:e,addToCartFunction:r}):t.createElement(zf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(Ch,{addToCartFunction:r,bundle:e});L(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Bh=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},"")))));export{$h as Bundle,Bh as BundleLoader,nu as Cart,ra as CouponFrame,Qe as Nudge,Je as SpinnerWheel};
|