@best-bundles/bundle-ui 0.0.32 → 0.0.34
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/api/fetchBundleConfig.d.ts +1 -0
- package/dist/api/fetchBundleConfig.d.ts.map +1 -1
- package/dist/context/BundleProvider.d.ts +1 -0
- package/dist/context/BundleProvider.d.ts.map +1 -1
- package/dist/index.js +746 -703
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.js +14 -14
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/liquid/iife.d.ts +8 -1
- package/dist/liquid/iife.d.ts.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._button_18rtl_1{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--bb-font-family, inherit);border:1px solid var(--bb-button-border, rgba(0, 0, 0, .12));background:var(--bb-button-bg, #111827);color:var(--bb-button-text, #ffffff);font:inherit;line-height:1;padding:10px 14px;border-radius:var(--bb-button-radius, 10px);cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease,opacity .12s ease}._button_18rtl_1:hover{background:var(--bb-button-bg-hover, #0b1220)}._button_18rtl_1:active{transform:translateY(1px)}._button_18rtl_1:disabled{opacity:.6;cursor:not-allowed}._button_18rtl_1:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._backdrop_jhu8z_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 2147483647);display:flex;justify-content:flex-end;background:var(--bb-backdrop-bg, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(var(--bb-backdrop-blur, 2px));backdrop-filter:blur(var(--bb-backdrop-blur, 2px));padding:var(--bb-backdrop-padding, 12px);opacity:0;transition:opacity var(--bb-drawer-transition-duration, .22s) ease}._celebrationOverlay_jhu8z_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_jhu8z_23{font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.03em;font-size:18px;line-height:1;padding:12px 16px;border-radius:999px;color:var(--bb-celebration-text, #0b1b44);background:linear-gradient(180deg,var(--bb-celebration-bg-top, #ffffff),var(--bb-celebration-bg-bottom, #bae6fd));border:2px solid var(--bb-celebration-border, rgba(37, 99, 235, .28));box-shadow:0 18px 55px #0006,0 10px 28px #2563eb33,inset 0 1px #ffffffbf;transform-origin:50% 60%;will-change:transform,opacity,filter;animation:_bbCelebrationPop_jhu8z_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_jhu8z_1{0%{opacity:0;transform:translateY(10px) scale(.6);filter:blur(1px) saturate(1.1)}12%{opacity:1;transform:translateY(0) scale(1.12);filter:blur(0px) saturate(1.1)}22%{opacity:1;transform:translateY(0) scale(1)}80%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-10px) scale(.98)}}._backdropOpen_jhu8z_74{opacity:1}._backdropClosed_jhu8z_78{opacity:0}._panel_jhu8z_82{width:440px;max-width:100%;height:100%;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);border-radius:var(--bb-panel-radius, 16px);box-shadow:0 20px 60px #00000059;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;outline:none;position:relative;top:unset;right:unset;bottom:unset;left:unset}._panelOpen_jhu8z_102{animation:_bbSlideInFromRight_jhu8z_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_jhu8z_106{animation:_bbSlideOutToRight_jhu8z_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_jhu8z_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_jhu8z_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_jhu8z_1{transition:none}._celebrationChip_jhu8z_23,._panelOpen_jhu8z_102,._panelClosed_jhu8z_106{animation:none}}._header_jhu8z_145{display:grid;grid-template-columns:36px 1fr 36px;align-items:center;column-gap:12px;padding:var(--bb-header-padding, 16px 16px 12px 16px);border-bottom:1px solid var(--bb-border-color, rgba(17, 24, 39, .08))}._headerCenter_jhu8z_154{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_jhu8z_162{font-size:24px;margin:0;line-height:1.2;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.02em;color:var(--bb-title-color, var(--bb-text-color, #111827))}._searchIconButton_jhu8z_171{width:36px;height:36px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}._searchIconButton_jhu8z_171:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_jhu8z_171:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_jhu8z_193{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_jhu8z_197{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;pointer-events:none;opacity:0;transform:translateY(-2px);transition:opacity .18s ease,transform .22s ease}._headerSearchOpen_jhu8z_209 ._headerTitleWrap_jhu8z_193{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_jhu8z_209 ._headerSearchWrap_jhu8z_197{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_jhu8z_221{width:min(320px,100%);height:36px;display:flex;align-items:center;gap:8px;background:var(--bb-surface-bg, #ffffff);border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));border-radius:10px;padding:0 8px}._searchInput_jhu8z_233{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_jhu8z_233::-webkit-search-cancel-button,._searchInput_jhu8z_233::-webkit-search-decoration,._searchInput_jhu8z_233::-webkit-search-results-button,._searchInput_jhu8z_233::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_jhu8z_254{border:none;background:transparent;color:var(--bb-text-color, #111827);font:inherit;font-size:13px;font-weight:700;cursor:pointer;padding:6px;border-radius:10px;line-height:1}._searchClearButton_jhu8z_254:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_jhu8z_254:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_jhu8z_276{border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);width:36px;height:36px;border-radius:10px;cursor:pointer;flex:0 0 auto}._closeButton_jhu8z_276:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_jhu8z_276:disabled{opacity:.6;cursor:not-allowed}._closeButton_jhu8z_276:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_jhu8z_193,._headerSearchWrap_jhu8z_197{transition:none}}._body_jhu8z_309{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_jhu8z_314{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_jhu8z_319{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_jhu8z_324{margin-top:4px}._variantList_jhu8z_328{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_jhu8z_336{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_jhu8z_344{opacity:.65}._variantLeft_jhu8z_348{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_jhu8z_355{height:100%;align-self:stretch;border-radius:12px;border:none;background:var(--bb-cta-bg, #91aae5);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:800;padding:0 16px;cursor:pointer;white-space:nowrap}._addToBundleButton_jhu8z_355:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_jhu8z_355:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_jhu8z_355:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_jhu8z_383{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._soldOut_jhu8z_383{align-self:center;text-align:center;color:var(--bb-muted-color, rgba(17, 24, 39));font-size:.9em;font-weight:600;pointer-events:none}._variantThumb_jhu8z_400{width:60px;height:60px;border-radius:12px;overflow:hidden;border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));flex:0 0 auto}._variantThumbImg_jhu8z_410{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_jhu8z_417{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_jhu8z_427{min-width:0}._variantName_jhu8z_431{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_jhu8z_440{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_jhu8z_448{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_jhu8z_455{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_jhu8z_448{font-size:13px;font-weight:800}._qtyControls_jhu8z_466{display:inline-flex;align-items:center;gap:6px}._qtyButton_jhu8z_472{width:34px;height:34px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);cursor:pointer;line-height:1;font-size:16px}._qtyButton_jhu8z_472:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_jhu8z_472:disabled{opacity:.6;cursor:not-allowed}._qtyButton_jhu8z_472:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_jhu8z_497{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_jhu8z_504{padding:var(--bb-footer-padding, 12px 16px 16px 16px);border-top:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);position:relative}._poweredBy_jhu8z_511{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_jhu8z_511 a{color:inherit;text-decoration:none}._boxSummaryWindow_jhu8z_523{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_jhu8z_523::-webkit-scrollbar{display:none}._boxSummaryRow_jhu8z_540{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_jhu8z_548{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_jhu8z_557{width:100%;aspect-ratio:1 / 1;border-radius:12px;position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;box-sizing:border-box}._boxItemClickable_jhu8z_569{cursor:pointer}._boxItemClickable_jhu8z_569:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_jhu8z_578{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_jhu8z_589{border:1px dashed var(--bb-border-strong-color, rgba(17, 24, 39, .18));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-color, rgba(17, 24, 39, .6))}._boxItemFilled_jhu8z_595{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_jhu8z_601{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:var(--bb-tier-bg, rgba(37, 99, 235, .08));color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemDiscountText_jhu8z_609{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_jhu8z_617{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_jhu8z_624{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_jhu8z_631{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .04));color:var(--bb-text-color, #111827);font-weight:800}._ctaButtonGroup_jhu8z_642{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_jhu8z_649{gap:0}._cta_jhu8z_642{width:100%;border:1px solid var(--bb-cta-border, rgba(0, 0, 0, .12));background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:700;padding:12px 14px;border-radius:12px;cursor:pointer}._ctaSecondary_jhu8z_665{width:100%;border:2px solid var(--bb-cta-bg, #2563eb);background:transparent;color:var(--bb-cta-bg, #2563eb);font:inherit;font-weight:700;padding:10px 14px;border-radius:12px;cursor:pointer}._ctaDualLeft_jhu8z_677{width:100%;border:2px solid var(--bb-cta-bg, #2563eb);background:transparent;color:var(--bb-cta-bg, #2563eb);font:inherit;font-weight:700;padding:10px 14px;border-radius:12px;cursor:pointer;transition:border-radius .3s cubic-bezier(.4,0,.2,1),background .3s cubic-bezier(.4,0,.2,1),color .3s cubic-bezier(.4,0,.2,1),border-right-width .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}._ctaDualLeftAnimating_jhu8z_695{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0;background:var(--bb-cta-bg, #2563eb);opacity:.6;color:var(--bb-cta-text, #ffffff)}._ctaDualLeftAnimating_jhu8z_695>span{opacity:0}._ctaDualRight_jhu8z_708{width:100%;border:1px solid var(--bb-cta-border, rgba(0, 0, 0, .12));background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:700;padding:12px 14px;border-radius:12px;cursor:pointer;transition:border-radius .3s cubic-bezier(.4,0,.2,1),border-left-width .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}._ctaDualRightAnimating_jhu8z_724{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_jhu8z_724>span{opacity:0}._ctaTotals_jhu8z_735{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_jhu8z_743{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:linear-gradient(180deg,#2563eb24,#2563eb0f);border:1px solid rgba(37,99,235,.3);color:#1d4ed8f2;white-space:nowrap}._ctaTotalsWrap_jhu8z_757{overflow:hidden;max-height:0;opacity:0;transform:translateY(4px);margin-bottom:0;transition:max-height .22s ease,opacity .16s ease,transform .22s ease,margin-bottom .22s ease}._ctaTotalsWrapVisible_jhu8z_770{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_jhu8z_777{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_jhu8z_784{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_jhu8z_757{transition:none}}._cta_jhu8z_642:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_jhu8z_642:disabled{opacity:.6;cursor:not-allowed}._cta_jhu8z_642:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_jhu8z_665:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_jhu8z_665:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_jhu8z_665:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_jhu8z_677:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_jhu8z_677:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_jhu8z_677:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_jhu8z_708:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_jhu8z_708:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_jhu8z_708:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_jhu8z_853{margin-top:8px;font-size:12px;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center}@media(max-width:767px){._backdrop_jhu8z_1{padding:0;justify-content:stretch}._panel_jhu8z_82{width:100%;height:100%;border-radius:0}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { jsx as f, jsxs as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import { jsx as f, jsxs as k, Fragment as xt } from "react/jsx-runtime";
|
|
3
|
+
import Le, { useState as A, useRef as W, useEffect as j, useCallback as fe, useMemo as P, createContext as Ct, useContext as It, forwardRef as bt, createElement as Ye } from "react";
|
|
4
|
+
const Me = {
|
|
5
5
|
bundleId: "_bundle_id",
|
|
6
6
|
bundleConfig: "_bundle_config",
|
|
7
7
|
bundleSource: "_bundle_source",
|
|
8
8
|
bundleTitle: "_bundle_title"
|
|
9
9
|
};
|
|
10
|
-
async function
|
|
11
|
-
const e = new URL("/api/public/bundle-config",
|
|
12
|
-
e.searchParams.set("shop",
|
|
13
|
-
const
|
|
10
|
+
async function St(o) {
|
|
11
|
+
const e = new URL("/api/public/bundle-config", o.apiBaseUrl);
|
|
12
|
+
e.searchParams.set("shop", o.shop), o.configHandle && e.searchParams.set("handle", o.configHandle);
|
|
13
|
+
const i = await (await fetch(e, {
|
|
14
14
|
method: "GET",
|
|
15
|
-
signal:
|
|
15
|
+
signal: o.signal,
|
|
16
16
|
headers: { "Content-Type": "application/json" }
|
|
17
17
|
})).json().catch(() => null);
|
|
18
|
-
return !
|
|
18
|
+
return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
20
|
+
const ct = "bb_anonymous_user_id";
|
|
21
|
+
function Te() {
|
|
22
22
|
if (typeof window > "u" || typeof localStorage > "u")
|
|
23
23
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
25
|
+
const o = localStorage.getItem(ct);
|
|
26
|
+
if (o && typeof o == "string" && o.length > 0)
|
|
27
|
+
return o;
|
|
28
28
|
let e;
|
|
29
29
|
try {
|
|
30
30
|
const t = globalThis.crypto;
|
|
@@ -35,17 +35,17 @@ function Ne() {
|
|
|
35
35
|
} catch {
|
|
36
36
|
e = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
37
37
|
}
|
|
38
|
-
return localStorage.setItem(
|
|
38
|
+
return localStorage.setItem(ct, e), e;
|
|
39
39
|
} catch {
|
|
40
40
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
async function
|
|
43
|
+
async function Ce(o, e, t) {
|
|
44
44
|
if (!(typeof window > "u"))
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const r = await fetch(
|
|
46
|
+
const i = new URL(o, window.location.origin);
|
|
47
|
+
i.searchParams.set("shop", e);
|
|
48
|
+
const r = await fetch(i, {
|
|
49
49
|
method: "POST",
|
|
50
50
|
headers: {
|
|
51
51
|
"Content-Type": "application/json"
|
|
@@ -58,11 +58,21 @@ async function xe(i, e, t) {
|
|
|
58
58
|
`[Bundle Analytics] Event tracking failed with status ${r.status}:`,
|
|
59
59
|
await r.text().catch(() => "Unable to read response")
|
|
60
60
|
);
|
|
61
|
-
} catch (
|
|
62
|
-
console.warn("[Bundle Analytics] Failed to track event:",
|
|
61
|
+
} catch (i) {
|
|
62
|
+
console.warn("[Bundle Analytics] Failed to track event:", i);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const _t = Ct(null),
|
|
65
|
+
const _t = Ct(null), De = "#best-bundles";
|
|
66
|
+
function Bt(o) {
|
|
67
|
+
const e = String(o ?? "").trim().toLowerCase();
|
|
68
|
+
if (!e.startsWith(De)) return null;
|
|
69
|
+
if (e === De) return "default";
|
|
70
|
+
const t = `${De}:`;
|
|
71
|
+
if (!e.startsWith(t)) return null;
|
|
72
|
+
const i = e.slice(t.length).trim();
|
|
73
|
+
return i && i.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
|
|
74
|
+
}
|
|
75
|
+
const Nt = {
|
|
66
76
|
primaryColor: "--bb-cta-bg",
|
|
67
77
|
primaryHoverColor: "--bb-cta-bg-hover",
|
|
68
78
|
primaryTextColor: "--bb-cta-text",
|
|
@@ -85,25 +95,25 @@ const _t = Ct(null), ct = "#best-bundles", Bt = {
|
|
|
85
95
|
fontFamilyBody: "--bb-font-family-body",
|
|
86
96
|
fontFamilyTitle: "--bb-font-family-title"
|
|
87
97
|
}, We = "bb-google-fonts";
|
|
88
|
-
function lt(
|
|
89
|
-
const e = (
|
|
98
|
+
function lt(o) {
|
|
99
|
+
const e = (o ?? "").trim().replace(/^["']|["']$/g, "");
|
|
90
100
|
return e ? encodeURIComponent(e).replace(/%20/g, "+") : "";
|
|
91
101
|
}
|
|
92
|
-
function Tt(
|
|
102
|
+
function Tt(o) {
|
|
93
103
|
var c;
|
|
94
104
|
if (typeof document > "u" || !document.head) return;
|
|
95
|
-
if (!
|
|
105
|
+
if (!o) {
|
|
96
106
|
(c = document.getElementById(We)) == null || c.remove();
|
|
97
107
|
return;
|
|
98
108
|
}
|
|
99
|
-
const e = (
|
|
100
|
-
e &&
|
|
109
|
+
const e = (o.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (o.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), i = [];
|
|
110
|
+
e && i.push("family=" + lt(e)), t && t !== e && i.push("family=" + lt(t));
|
|
101
111
|
const r = document.getElementById(We);
|
|
102
|
-
if (
|
|
112
|
+
if (i.length === 0) {
|
|
103
113
|
r == null || r.remove();
|
|
104
114
|
return;
|
|
105
115
|
}
|
|
106
|
-
const n = `https://fonts.googleapis.com/css2?${
|
|
116
|
+
const n = `https://fonts.googleapis.com/css2?${i.join("&")}&display=swap`;
|
|
107
117
|
if (r) {
|
|
108
118
|
r.getAttribute("href") !== n && r.setAttribute("href", n);
|
|
109
119
|
return;
|
|
@@ -111,524 +121,557 @@ function Tt(i) {
|
|
|
111
121
|
const u = document.createElement("link");
|
|
112
122
|
u.id = We, u.rel = "stylesheet", u.href = n, document.head.appendChild(u);
|
|
113
123
|
}
|
|
114
|
-
function ut(
|
|
115
|
-
if (!
|
|
116
|
-
Tt(
|
|
124
|
+
function ut(o) {
|
|
125
|
+
if (!o) return;
|
|
126
|
+
Tt(o);
|
|
117
127
|
const e = document.documentElement;
|
|
118
|
-
Object.entries(
|
|
119
|
-
let r =
|
|
120
|
-
r && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(r) && !/^["']/.test(r.trim()) && (r = `"${r.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(
|
|
128
|
+
Object.entries(Nt).forEach(([t, i]) => {
|
|
129
|
+
let r = o[t];
|
|
130
|
+
r && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(r) && !/^["']/.test(r.trim()) && (r = `"${r.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(i, r));
|
|
121
131
|
});
|
|
122
132
|
}
|
|
123
|
-
function dt(
|
|
124
|
-
if (typeof window > "u") return
|
|
133
|
+
function dt(o) {
|
|
134
|
+
if (typeof window > "u") return o;
|
|
125
135
|
const e = window.__BUNDLE_PREVIEW_STYLES__;
|
|
126
|
-
return e && typeof e == "object" ? e :
|
|
136
|
+
return e && typeof e == "object" ? e : o;
|
|
127
137
|
}
|
|
128
|
-
function
|
|
138
|
+
function Ot() {
|
|
129
139
|
try {
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
140
|
+
const o = globalThis.crypto;
|
|
141
|
+
if (o != null && o.randomUUID) return o.randomUUID();
|
|
132
142
|
} catch {
|
|
133
143
|
}
|
|
134
144
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
135
145
|
}
|
|
136
|
-
function ht(
|
|
137
|
-
return Number.isFinite(
|
|
146
|
+
function ht(o) {
|
|
147
|
+
return Number.isFinite(o) ? Math.max(0, Math.floor(o)) : 0;
|
|
138
148
|
}
|
|
139
|
-
function
|
|
149
|
+
function br(o) {
|
|
140
150
|
const {
|
|
141
151
|
apiBaseUrl: e,
|
|
142
152
|
shop: t,
|
|
143
|
-
cartAdapter:
|
|
153
|
+
cartAdapter: i,
|
|
144
154
|
configHandle: r = "default",
|
|
145
155
|
initialData: n,
|
|
146
156
|
configFetcher: u,
|
|
147
157
|
analyticsEndpoint: c,
|
|
148
|
-
allowDrawerWhenInactive:
|
|
149
|
-
children:
|
|
150
|
-
} =
|
|
158
|
+
allowDrawerWhenInactive: b = !1,
|
|
159
|
+
children: H
|
|
160
|
+
} = o, x = c ?? `${e}/api/public/bundle-analytics`, [M, B] = A(!1), [Z, L] = A(!n), [Q, J] = A(!1), [z, F] = A(null), [V, Ie] = A((n == null ? void 0 : n.currencyCode) ?? null), [m, pe] = A((n == null ? void 0 : n.config) ?? null), [ie, Y] = A(
|
|
151
161
|
(n == null ? void 0 : n.eligibleVariants) ?? []
|
|
152
|
-
), [
|
|
162
|
+
), [Pe, ze] = A(
|
|
153
163
|
() => ({ selections: {}, order: [] })
|
|
154
|
-
),
|
|
155
|
-
|
|
156
|
-
var
|
|
164
|
+
), ke = W(null);
|
|
165
|
+
j(() => {
|
|
166
|
+
var E;
|
|
157
167
|
if (n) return;
|
|
158
|
-
(
|
|
168
|
+
(E = ke.current) == null || E.abort();
|
|
159
169
|
const d = new AbortController();
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
if (!
|
|
164
|
-
|
|
170
|
+
ke.current = d;
|
|
171
|
+
const y = u ?? St;
|
|
172
|
+
return L(!0), F(null), y({ apiBaseUrl: e, shop: t, configHandle: r, signal: d.signal }).then((p) => {
|
|
173
|
+
if (!p.ok) {
|
|
174
|
+
F(p.error || "Failed to load bundle config."), pe(null), Y([]), Ie(null);
|
|
165
175
|
return;
|
|
166
176
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
177
|
+
Ie(p.currencyCode ?? null);
|
|
178
|
+
const R = typeof window < "u" ? window : null, T = R == null ? void 0 : R.__BUNDLE_PREVIEW_CONFIG__;
|
|
179
|
+
if (T) {
|
|
180
|
+
pe(T);
|
|
181
|
+
const q = R.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__;
|
|
182
|
+
if (q !== void 0)
|
|
183
|
+
Y(q);
|
|
184
|
+
else {
|
|
185
|
+
const I = new Set(T.eligibleVariantIds ?? []);
|
|
186
|
+
Y(
|
|
187
|
+
I.size === 0 ? p.eligibleVariants ?? [] : (p.eligibleVariants ?? []).filter((D) => I.has(D.id))
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
L(R.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0);
|
|
191
|
+
} else
|
|
192
|
+
pe(p.config), Y(p.eligibleVariants ?? []), L(!1);
|
|
193
|
+
}).catch((p) => {
|
|
194
|
+
const R = p instanceof Error ? p.message : "Failed to load bundle config.";
|
|
195
|
+
F(R), pe(null), Y([]), Ie(null);
|
|
196
|
+
}).finally(() => {
|
|
197
|
+
const p = typeof window < "u" ? window : null;
|
|
198
|
+
p != null && p.__BUNDLE_PREVIEW_CONFIG__ || L(!1);
|
|
199
|
+
}), () => d.abort();
|
|
200
|
+
}, [e, t, r, n, u]), j(() => {
|
|
173
201
|
const d = dt(m == null ? void 0 : m.styleSettings);
|
|
174
202
|
d && ut(d);
|
|
175
|
-
}, [m == null ? void 0 : m.styleSettings]),
|
|
203
|
+
}, [m == null ? void 0 : m.styleSettings]), j(() => {
|
|
176
204
|
if (typeof window > "u") return;
|
|
177
205
|
const d = () => {
|
|
178
|
-
const
|
|
179
|
-
|
|
206
|
+
const y = dt(void 0);
|
|
207
|
+
y && ut(y);
|
|
180
208
|
};
|
|
181
209
|
return window.addEventListener("bundle-preview-styles-updated", d), () => window.removeEventListener("bundle-preview-styles-updated", d);
|
|
210
|
+
}, []), j(() => {
|
|
211
|
+
if (typeof window > "u") return;
|
|
212
|
+
const d = window, y = () => {
|
|
213
|
+
const E = d.__BUNDLE_PREVIEW_CONFIG__;
|
|
214
|
+
if (!E) return;
|
|
215
|
+
const p = d.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0;
|
|
216
|
+
L(p), pe(E);
|
|
217
|
+
const R = d.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__;
|
|
218
|
+
R ? Y(R) : p || Y((T) => {
|
|
219
|
+
const q = new Set(E.eligibleVariantIds ?? []);
|
|
220
|
+
return q.size === 0 || T.length === 0 ? T : T.filter((I) => q.has(I.id));
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
return d.__BUNDLE_PREVIEW_CONFIG__ && y(), window.addEventListener("bundle-preview-config-updated", y), () => window.removeEventListener("bundle-preview-config-updated", y);
|
|
182
224
|
}, []);
|
|
183
|
-
const
|
|
184
|
-
if (!(!
|
|
225
|
+
const be = fe(() => {
|
|
226
|
+
if (!(!b && m != null && !m.isActive) && (B(!0), x))
|
|
185
227
|
try {
|
|
186
|
-
const d =
|
|
187
|
-
|
|
228
|
+
const d = Te();
|
|
229
|
+
Ce(x, t, {
|
|
188
230
|
eventType: "DRAWER_OPENED",
|
|
189
231
|
shop: t,
|
|
190
232
|
anonymousUserId: d,
|
|
191
233
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
192
234
|
mixpanelEvent: "bundle_opened"
|
|
193
|
-
}).catch((
|
|
194
|
-
console.warn("[Bundle Analytics] Failed to track drawer opened:",
|
|
235
|
+
}).catch((y) => {
|
|
236
|
+
console.warn("[Bundle Analytics] Failed to track drawer opened:", y);
|
|
195
237
|
});
|
|
196
238
|
} catch (d) {
|
|
197
239
|
console.warn("[Bundle Analytics] Error in open() callback:", d);
|
|
198
240
|
}
|
|
199
|
-
}, [
|
|
200
|
-
if (
|
|
241
|
+
}, [x, t, m, b]), te = fe(() => {
|
|
242
|
+
if (x)
|
|
201
243
|
try {
|
|
202
|
-
const d =
|
|
203
|
-
|
|
244
|
+
const d = Te();
|
|
245
|
+
Ce(x, t, {
|
|
204
246
|
eventType: "DRAWER_CLOSED",
|
|
205
247
|
shop: t,
|
|
206
248
|
anonymousUserId: d,
|
|
207
249
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
208
250
|
mixpanelEvent: "bundle_closed"
|
|
209
|
-
}).catch((
|
|
210
|
-
console.warn("[Bundle Analytics] Failed to track drawer closed:",
|
|
251
|
+
}).catch((y) => {
|
|
252
|
+
console.warn("[Bundle Analytics] Failed to track drawer closed:", y);
|
|
211
253
|
});
|
|
212
254
|
} catch (d) {
|
|
213
255
|
console.warn("[Bundle Analytics] Error in close() callback:", d);
|
|
214
256
|
}
|
|
215
|
-
|
|
216
|
-
}, [
|
|
217
|
-
|
|
257
|
+
B(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(De) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
|
|
258
|
+
}, [x, t]);
|
|
259
|
+
j(() => {
|
|
218
260
|
if (typeof window > "u") return;
|
|
219
261
|
const d = () => {
|
|
220
|
-
window.location.hash
|
|
262
|
+
const y = Bt(window.location.hash);
|
|
263
|
+
y && (y === "default" || y === r) && be();
|
|
221
264
|
};
|
|
222
265
|
return d(), window.addEventListener("hashchange", d), () => window.removeEventListener("hashchange", d);
|
|
223
|
-
}, [
|
|
224
|
-
const
|
|
225
|
-
!
|
|
266
|
+
}, [be, r]);
|
|
267
|
+
const Ae = fe(() => {
|
|
268
|
+
!b && !M && m != null && !m.isActive || B((d) => {
|
|
226
269
|
if (d)
|
|
227
|
-
|
|
228
|
-
else if (
|
|
270
|
+
te();
|
|
271
|
+
else if (x)
|
|
229
272
|
try {
|
|
230
|
-
const
|
|
231
|
-
|
|
273
|
+
const y = Te();
|
|
274
|
+
Ce(x, t, {
|
|
232
275
|
eventType: "DRAWER_OPENED",
|
|
233
276
|
shop: t,
|
|
234
|
-
anonymousUserId:
|
|
277
|
+
anonymousUserId: y,
|
|
235
278
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
236
279
|
mixpanelEvent: "bundle_opened"
|
|
237
|
-
}).catch((
|
|
238
|
-
console.warn("[Bundle Analytics] Failed to track drawer opened:",
|
|
280
|
+
}).catch((E) => {
|
|
281
|
+
console.warn("[Bundle Analytics] Failed to track drawer opened:", E);
|
|
239
282
|
});
|
|
240
|
-
} catch (
|
|
241
|
-
console.warn("[Bundle Analytics] Error in toggle() callback:",
|
|
283
|
+
} catch (y) {
|
|
284
|
+
console.warn("[Bundle Analytics] Error in toggle() callback:", y);
|
|
242
285
|
}
|
|
243
286
|
return !d;
|
|
244
287
|
});
|
|
245
|
-
}, [
|
|
246
|
-
|
|
247
|
-
!
|
|
248
|
-
}, [
|
|
249
|
-
const
|
|
250
|
-
const d = Number((m == null ? void 0 : m.maxBundleSize) ?? NaN),
|
|
251
|
-
return Math.max(2, Math.min(100,
|
|
252
|
-
}, [m == null ? void 0 : m.maxBundleSize]),
|
|
253
|
-
|
|
254
|
-
), [
|
|
255
|
-
const d = (m == null ? void 0 : m.rules) ?? [],
|
|
256
|
-
return Number.isFinite(
|
|
257
|
-
}, [m]), Be =
|
|
258
|
-
if (!
|
|
288
|
+
}, [x, t, te, m, M, b]);
|
|
289
|
+
j(() => {
|
|
290
|
+
!b && (m == null ? void 0 : m.isActive) === !1 && M && te();
|
|
291
|
+
}, [b, m == null ? void 0 : m.isActive, M, te]);
|
|
292
|
+
const Se = P(() => {
|
|
293
|
+
const d = Number((m == null ? void 0 : m.maxBundleSize) ?? NaN), y = Number.isFinite(d) ? Math.floor(d) : 100;
|
|
294
|
+
return Math.max(2, Math.min(100, y));
|
|
295
|
+
}, [m == null ? void 0 : m.maxBundleSize]), ee = P(() => new Set(
|
|
296
|
+
ie.filter((d) => d.availableForSale !== !1).map((d) => d.id)
|
|
297
|
+
), [ie]), ne = P(() => {
|
|
298
|
+
const d = (m == null ? void 0 : m.rules) ?? [], y = d.length ? Math.min(...d.map((E) => E.minBundleSize)) : 2;
|
|
299
|
+
return Number.isFinite(y) && y > 0 ? y : 2;
|
|
300
|
+
}, [m]), Be = fe((d, y) => {
|
|
301
|
+
if (!ee.has(d))
|
|
259
302
|
return;
|
|
260
|
-
const
|
|
261
|
-
ze((
|
|
262
|
-
const
|
|
263
|
-
let
|
|
264
|
-
if (
|
|
265
|
-
const { [d]:
|
|
266
|
-
|
|
267
|
-
} else
|
|
268
|
-
let
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
else if (
|
|
272
|
-
let
|
|
273
|
-
const
|
|
274
|
-
for (let
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
277
|
-
|
|
303
|
+
const E = ht(y);
|
|
304
|
+
ze((p) => {
|
|
305
|
+
const R = p.selections[d] ?? 0, T = E - R, q = Object.values(p.selections).reduce((U, v) => U + (v || 0), 0), I = T > 0 ? Math.min(T, Math.max(0, Se - q)) : T, D = R + I;
|
|
306
|
+
let K;
|
|
307
|
+
if (D <= 0) {
|
|
308
|
+
const { [d]: U, ...v } = p.selections;
|
|
309
|
+
K = v;
|
|
310
|
+
} else R === D ? K = p.selections : K = { ...p.selections, [d]: D };
|
|
311
|
+
let ue = p.order;
|
|
312
|
+
if (I > 0)
|
|
313
|
+
ue = [...p.order, ...Array.from({ length: I }, () => d)];
|
|
314
|
+
else if (I < 0) {
|
|
315
|
+
let U = -I;
|
|
316
|
+
const v = [];
|
|
317
|
+
for (let N = p.order.length - 1; N >= 0; N--) {
|
|
318
|
+
const g = p.order[N];
|
|
319
|
+
if (g === d && U > 0) {
|
|
320
|
+
U--;
|
|
278
321
|
continue;
|
|
279
322
|
}
|
|
280
|
-
|
|
323
|
+
v.push(g);
|
|
281
324
|
}
|
|
282
|
-
|
|
325
|
+
v.reverse(), ue = v;
|
|
283
326
|
}
|
|
284
|
-
if (
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
327
|
+
if (K === p.selections && ue === p.order) return p;
|
|
328
|
+
const ge = q, de = Object.values(K).reduce((U, v) => U + (v || 0), 0);
|
|
329
|
+
if (x)
|
|
287
330
|
try {
|
|
288
|
-
const
|
|
331
|
+
const U = Te(), v = {
|
|
289
332
|
eventType: "VARIANT_SELECTION_CHANGED",
|
|
290
333
|
shop: t,
|
|
291
|
-
anonymousUserId:
|
|
292
|
-
before: { ...
|
|
293
|
-
after: { ...
|
|
334
|
+
anonymousUserId: U,
|
|
335
|
+
before: { ...p.selections },
|
|
336
|
+
after: { ...K },
|
|
294
337
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
295
338
|
};
|
|
296
|
-
|
|
297
|
-
...
|
|
339
|
+
Ce(x, t, v), ge === 0 && de >= 1 && Ce(x, t, {
|
|
340
|
+
...v,
|
|
298
341
|
mixpanelEvent: "bundle_started"
|
|
299
|
-
}),
|
|
300
|
-
...
|
|
342
|
+
}), ge < ne && de >= ne && Ce(x, t, {
|
|
343
|
+
...v,
|
|
301
344
|
mixpanelEvent: "bundle_completed"
|
|
302
345
|
});
|
|
303
346
|
} catch {
|
|
304
347
|
}
|
|
305
|
-
return { selections:
|
|
348
|
+
return { selections: K, order: ue };
|
|
306
349
|
});
|
|
307
|
-
}, [
|
|
308
|
-
var
|
|
309
|
-
if (!
|
|
310
|
-
const
|
|
311
|
-
merchandiseId:
|
|
312
|
-
quantity:
|
|
350
|
+
}, [Se, ne, ee, x, t]), _e = fe(() => ze({ selections: {}, order: [] }), []), oe = Pe.selections, we = Pe.order, ce = P(() => Object.values(oe).reduce((d, y) => d + (y || 0), 0), [oe]), le = P(() => !(Z || Q || z || !(m != null && m.isActive) || ce < ne), [ce, m == null ? void 0 : m.isActive, z, Z, ne, Q]), ye = fe(async (d) => {
|
|
351
|
+
var v, N;
|
|
352
|
+
if (!le || !m) return;
|
|
353
|
+
const y = Ot(), E = (m.title ?? "").trim().slice(0, 255), p = Object.entries(oe).map(([g, $]) => ({ merchandiseId: g, quantity: ht($) })).filter((g) => g.quantity > 0).filter((g) => ee.has(g.merchandiseId)).map((g) => ({
|
|
354
|
+
merchandiseId: g.merchandiseId,
|
|
355
|
+
quantity: g.quantity,
|
|
313
356
|
attributes: [
|
|
314
|
-
{ key:
|
|
315
|
-
{ key:
|
|
316
|
-
{ key:
|
|
317
|
-
...
|
|
357
|
+
{ key: Me.bundleId, value: y },
|
|
358
|
+
{ key: Me.bundleConfig, value: r },
|
|
359
|
+
{ key: Me.bundleSource, value: "bundle_builder" },
|
|
360
|
+
...E ? [{ key: Me.bundleTitle, value: E }] : []
|
|
318
361
|
]
|
|
319
362
|
}));
|
|
320
|
-
if (!
|
|
321
|
-
const
|
|
322
|
-
let
|
|
323
|
-
for (const [
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
326
|
-
const
|
|
327
|
-
Number.isFinite(
|
|
363
|
+
if (!p.length) return;
|
|
364
|
+
const R = new Map(ie.map((g) => [g.id, g]));
|
|
365
|
+
let T = 0;
|
|
366
|
+
for (const [g, $] of Object.entries(oe)) {
|
|
367
|
+
const je = $ ?? 0;
|
|
368
|
+
if (je <= 0) continue;
|
|
369
|
+
const ve = R.get(g), he = Number(ve == null ? void 0 : ve.price);
|
|
370
|
+
Number.isFinite(he) && (T += he * je);
|
|
328
371
|
}
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
let
|
|
332
|
-
for (const
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
const
|
|
336
|
-
return Number.isFinite(
|
|
337
|
-
})() : null,
|
|
338
|
-
|
|
372
|
+
T = Math.round(T * 100) / 100;
|
|
373
|
+
const q = [...m.rules ?? []].sort((g, $) => g.minBundleSize - $.minBundleSize);
|
|
374
|
+
let I = null;
|
|
375
|
+
for (const g of q)
|
|
376
|
+
ce >= g.minBundleSize && (I = g);
|
|
377
|
+
const D = I ? (() => {
|
|
378
|
+
const g = Number.parseFloat(I.discountPercent);
|
|
379
|
+
return Number.isFinite(g) && g > 0 ? g : null;
|
|
380
|
+
})() : null, K = D ? Math.round(T * (1 - D / 100) * 100) / 100 : T, ue = T - K, ge = p.map((g) => g.merchandiseId), de = (I == null ? void 0 : I.handle) ?? "", U = ((v = I == null ? void 0 : I.label) == null ? void 0 : v.trim()) || "";
|
|
381
|
+
J(!0);
|
|
339
382
|
try {
|
|
340
|
-
if (d != null && d.checkout ? await
|
|
383
|
+
if (d != null && d.checkout ? await i.linesAddForCheckout(p) : await i.linesAdd(p), x)
|
|
341
384
|
try {
|
|
342
|
-
const
|
|
343
|
-
|
|
385
|
+
const g = Te(), $ = !!(d != null && d.checkout);
|
|
386
|
+
Ce(x, t, {
|
|
344
387
|
eventType: "BUNDLE_ADDED_TO_BASKET",
|
|
345
388
|
shop: t,
|
|
346
|
-
anonymousUserId:
|
|
347
|
-
bundleId:
|
|
348
|
-
productVariantIds:
|
|
349
|
-
grossPrice:
|
|
350
|
-
discountedPrice:
|
|
351
|
-
currency:
|
|
352
|
-
discountThresholdIdentifier:
|
|
353
|
-
discountLabel:
|
|
354
|
-
discountPercentage:
|
|
355
|
-
discountedAmount:
|
|
389
|
+
anonymousUserId: g,
|
|
390
|
+
bundleId: y,
|
|
391
|
+
productVariantIds: ge,
|
|
392
|
+
grossPrice: T,
|
|
393
|
+
discountedPrice: K,
|
|
394
|
+
currency: V ?? void 0,
|
|
395
|
+
discountThresholdIdentifier: de,
|
|
396
|
+
discountLabel: U,
|
|
397
|
+
discountPercentage: D,
|
|
398
|
+
discountedAmount: ue,
|
|
356
399
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
357
|
-
checkout:
|
|
358
|
-
mixpanelEvent:
|
|
400
|
+
checkout: $,
|
|
401
|
+
mixpanelEvent: $ ? "checkout_started_with_bundle" : "bundle_added_to_cart"
|
|
359
402
|
});
|
|
360
403
|
} catch {
|
|
361
404
|
}
|
|
362
|
-
|
|
405
|
+
_e(), te(), (N = d == null ? void 0 : d.onComplete) == null || N.call(d);
|
|
363
406
|
} finally {
|
|
364
|
-
|
|
407
|
+
J(!1);
|
|
365
408
|
}
|
|
366
409
|
}, [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
410
|
+
le,
|
|
411
|
+
i,
|
|
412
|
+
_e,
|
|
413
|
+
te,
|
|
371
414
|
m,
|
|
372
415
|
r,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
416
|
+
V,
|
|
417
|
+
oe,
|
|
418
|
+
ee,
|
|
419
|
+
ie,
|
|
420
|
+
ce,
|
|
421
|
+
x,
|
|
379
422
|
t
|
|
380
|
-
]),
|
|
381
|
-
await
|
|
423
|
+
]), ae = fe(async () => {
|
|
424
|
+
await ye(
|
|
382
425
|
{
|
|
383
426
|
onComplete: () => {
|
|
384
427
|
var d;
|
|
385
|
-
(d =
|
|
428
|
+
(d = i.openCartUI) == null || d.call(i);
|
|
386
429
|
}
|
|
387
430
|
}
|
|
388
431
|
);
|
|
389
|
-
}, [
|
|
390
|
-
await
|
|
432
|
+
}, [ye, i]), Ee = fe(async () => {
|
|
433
|
+
await ye(
|
|
391
434
|
{
|
|
392
435
|
checkout: !0,
|
|
393
436
|
onComplete: () => {
|
|
394
437
|
var d;
|
|
395
|
-
(d =
|
|
438
|
+
(d = i.navigateToCheckout) == null || d.call(i);
|
|
396
439
|
}
|
|
397
440
|
}
|
|
398
441
|
);
|
|
399
|
-
}, [
|
|
442
|
+
}, [ye, i]), Re = P(
|
|
400
443
|
() => ({
|
|
401
|
-
isOpen:
|
|
402
|
-
open:
|
|
403
|
-
close:
|
|
404
|
-
toggle:
|
|
405
|
-
loading:
|
|
406
|
-
submitting:
|
|
407
|
-
error:
|
|
408
|
-
currencyCode:
|
|
444
|
+
isOpen: M,
|
|
445
|
+
open: be,
|
|
446
|
+
close: te,
|
|
447
|
+
toggle: Ae,
|
|
448
|
+
loading: Z,
|
|
449
|
+
submitting: Q,
|
|
450
|
+
error: z,
|
|
451
|
+
currencyCode: V,
|
|
409
452
|
config: m,
|
|
410
|
-
eligibleVariants:
|
|
411
|
-
selections:
|
|
412
|
-
selectionOrder:
|
|
453
|
+
eligibleVariants: ie,
|
|
454
|
+
selections: oe,
|
|
455
|
+
selectionOrder: we,
|
|
413
456
|
setQuantity: Be,
|
|
414
|
-
clearSelections:
|
|
415
|
-
bundleSize:
|
|
416
|
-
minRequired:
|
|
417
|
-
canSubmit:
|
|
418
|
-
submit:
|
|
419
|
-
submitAndCheckout:
|
|
457
|
+
clearSelections: _e,
|
|
458
|
+
bundleSize: ce,
|
|
459
|
+
minRequired: ne,
|
|
460
|
+
canSubmit: le,
|
|
461
|
+
submit: ae,
|
|
462
|
+
submitAndCheckout: Ee
|
|
420
463
|
}),
|
|
421
464
|
[
|
|
422
|
-
|
|
423
|
-
|
|
465
|
+
M,
|
|
466
|
+
be,
|
|
467
|
+
te,
|
|
468
|
+
Ae,
|
|
424
469
|
Z,
|
|
425
|
-
|
|
426
|
-
|
|
470
|
+
Q,
|
|
471
|
+
z,
|
|
427
472
|
V,
|
|
428
|
-
k,
|
|
429
|
-
D,
|
|
430
473
|
m,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
474
|
+
ie,
|
|
475
|
+
oe,
|
|
476
|
+
we,
|
|
434
477
|
Be,
|
|
435
|
-
|
|
436
|
-
se,
|
|
437
|
-
J,
|
|
478
|
+
_e,
|
|
438
479
|
ce,
|
|
439
|
-
|
|
440
|
-
|
|
480
|
+
ne,
|
|
481
|
+
le,
|
|
482
|
+
ae,
|
|
483
|
+
Ee
|
|
441
484
|
]
|
|
442
485
|
);
|
|
443
|
-
return /* @__PURE__ */ f(_t.Provider, { value:
|
|
486
|
+
return /* @__PURE__ */ f(_t.Provider, { value: Re, children: H });
|
|
444
487
|
}
|
|
445
|
-
function
|
|
446
|
-
const
|
|
447
|
-
if (!
|
|
488
|
+
function Ke() {
|
|
489
|
+
const o = It(_t);
|
|
490
|
+
if (!o)
|
|
448
491
|
throw new Error("useBundleBuilder must be used within <BundleProvider />");
|
|
449
|
-
return
|
|
492
|
+
return o;
|
|
450
493
|
}
|
|
451
|
-
function
|
|
452
|
-
const { isOpen:
|
|
453
|
-
return { isOpen:
|
|
494
|
+
function _r() {
|
|
495
|
+
const { isOpen: o, open: e, close: t, toggle: i } = Ke();
|
|
496
|
+
return { isOpen: o, open: e, close: t, toggle: i };
|
|
454
497
|
}
|
|
455
|
-
const
|
|
456
|
-
button:
|
|
498
|
+
const Pt = "_button_18rtl_1", zt = {
|
|
499
|
+
button: Pt
|
|
457
500
|
};
|
|
458
|
-
function
|
|
459
|
-
const { toggle: e } =
|
|
501
|
+
function wr(o) {
|
|
502
|
+
const { toggle: e } = Ke();
|
|
460
503
|
return /* @__PURE__ */ f(
|
|
461
504
|
"button",
|
|
462
505
|
{
|
|
463
506
|
type: "button",
|
|
464
507
|
onClick: e,
|
|
465
|
-
className: [
|
|
466
|
-
children:
|
|
508
|
+
className: [zt.button, o.className].filter(Boolean).join(" "),
|
|
509
|
+
children: o.children ?? "Build a bundle"
|
|
467
510
|
}
|
|
468
511
|
);
|
|
469
512
|
}
|
|
470
|
-
var
|
|
471
|
-
function
|
|
472
|
-
if (ft) return
|
|
513
|
+
var Ge, ft;
|
|
514
|
+
function kt() {
|
|
515
|
+
if (ft) return Ge;
|
|
473
516
|
ft = 1;
|
|
474
|
-
var
|
|
475
|
-
linear: function(e, t,
|
|
476
|
-
var n =
|
|
517
|
+
var o = {
|
|
518
|
+
linear: function(e, t, i, r) {
|
|
519
|
+
var n = i - t;
|
|
477
520
|
return n * e / r + t;
|
|
478
521
|
},
|
|
479
|
-
easeInQuad: function(e, t,
|
|
480
|
-
var n =
|
|
522
|
+
easeInQuad: function(e, t, i, r) {
|
|
523
|
+
var n = i - t;
|
|
481
524
|
return n * (e /= r) * e + t;
|
|
482
525
|
},
|
|
483
|
-
easeOutQuad: function(e, t,
|
|
484
|
-
var n =
|
|
526
|
+
easeOutQuad: function(e, t, i, r) {
|
|
527
|
+
var n = i - t;
|
|
485
528
|
return -n * (e /= r) * (e - 2) + t;
|
|
486
529
|
},
|
|
487
|
-
easeInOutQuad: function(e, t,
|
|
488
|
-
var n =
|
|
530
|
+
easeInOutQuad: function(e, t, i, r) {
|
|
531
|
+
var n = i - t;
|
|
489
532
|
return (e /= r / 2) < 1 ? n / 2 * e * e + t : -n / 2 * (--e * (e - 2) - 1) + t;
|
|
490
533
|
},
|
|
491
|
-
easeInCubic: function(e, t,
|
|
492
|
-
var n =
|
|
534
|
+
easeInCubic: function(e, t, i, r) {
|
|
535
|
+
var n = i - t;
|
|
493
536
|
return n * (e /= r) * e * e + t;
|
|
494
537
|
},
|
|
495
|
-
easeOutCubic: function(e, t,
|
|
496
|
-
var n =
|
|
538
|
+
easeOutCubic: function(e, t, i, r) {
|
|
539
|
+
var n = i - t;
|
|
497
540
|
return n * ((e = e / r - 1) * e * e + 1) + t;
|
|
498
541
|
},
|
|
499
|
-
easeInOutCubic: function(e, t,
|
|
500
|
-
var n =
|
|
542
|
+
easeInOutCubic: function(e, t, i, r) {
|
|
543
|
+
var n = i - t;
|
|
501
544
|
return (e /= r / 2) < 1 ? n / 2 * e * e * e + t : n / 2 * ((e -= 2) * e * e + 2) + t;
|
|
502
545
|
},
|
|
503
|
-
easeInQuart: function(e, t,
|
|
504
|
-
var n =
|
|
546
|
+
easeInQuart: function(e, t, i, r) {
|
|
547
|
+
var n = i - t;
|
|
505
548
|
return n * (e /= r) * e * e * e + t;
|
|
506
549
|
},
|
|
507
|
-
easeOutQuart: function(e, t,
|
|
508
|
-
var n =
|
|
550
|
+
easeOutQuart: function(e, t, i, r) {
|
|
551
|
+
var n = i - t;
|
|
509
552
|
return -n * ((e = e / r - 1) * e * e * e - 1) + t;
|
|
510
553
|
},
|
|
511
|
-
easeInOutQuart: function(e, t,
|
|
512
|
-
var n =
|
|
554
|
+
easeInOutQuart: function(e, t, i, r) {
|
|
555
|
+
var n = i - t;
|
|
513
556
|
return (e /= r / 2) < 1 ? n / 2 * e * e * e * e + t : -n / 2 * ((e -= 2) * e * e * e - 2) + t;
|
|
514
557
|
},
|
|
515
|
-
easeInQuint: function(e, t,
|
|
516
|
-
var n =
|
|
558
|
+
easeInQuint: function(e, t, i, r) {
|
|
559
|
+
var n = i - t;
|
|
517
560
|
return n * (e /= r) * e * e * e * e + t;
|
|
518
561
|
},
|
|
519
|
-
easeOutQuint: function(e, t,
|
|
520
|
-
var n =
|
|
562
|
+
easeOutQuint: function(e, t, i, r) {
|
|
563
|
+
var n = i - t;
|
|
521
564
|
return n * ((e = e / r - 1) * e * e * e * e + 1) + t;
|
|
522
565
|
},
|
|
523
|
-
easeInOutQuint: function(e, t,
|
|
524
|
-
var n =
|
|
566
|
+
easeInOutQuint: function(e, t, i, r) {
|
|
567
|
+
var n = i - t;
|
|
525
568
|
return (e /= r / 2) < 1 ? n / 2 * e * e * e * e * e + t : n / 2 * ((e -= 2) * e * e * e * e + 2) + t;
|
|
526
569
|
},
|
|
527
|
-
easeInSine: function(e, t,
|
|
528
|
-
var n =
|
|
570
|
+
easeInSine: function(e, t, i, r) {
|
|
571
|
+
var n = i - t;
|
|
529
572
|
return -n * Math.cos(e / r * (Math.PI / 2)) + n + t;
|
|
530
573
|
},
|
|
531
|
-
easeOutSine: function(e, t,
|
|
532
|
-
var n =
|
|
574
|
+
easeOutSine: function(e, t, i, r) {
|
|
575
|
+
var n = i - t;
|
|
533
576
|
return n * Math.sin(e / r * (Math.PI / 2)) + t;
|
|
534
577
|
},
|
|
535
|
-
easeInOutSine: function(e, t,
|
|
536
|
-
var n =
|
|
578
|
+
easeInOutSine: function(e, t, i, r) {
|
|
579
|
+
var n = i - t;
|
|
537
580
|
return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t;
|
|
538
581
|
},
|
|
539
|
-
easeInExpo: function(e, t,
|
|
540
|
-
var n =
|
|
582
|
+
easeInExpo: function(e, t, i, r) {
|
|
583
|
+
var n = i - t;
|
|
541
584
|
return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t;
|
|
542
585
|
},
|
|
543
|
-
easeOutExpo: function(e, t,
|
|
544
|
-
var n =
|
|
586
|
+
easeOutExpo: function(e, t, i, r) {
|
|
587
|
+
var n = i - t;
|
|
545
588
|
return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t;
|
|
546
589
|
},
|
|
547
|
-
easeInOutExpo: function(e, t,
|
|
548
|
-
var n =
|
|
590
|
+
easeInOutExpo: function(e, t, i, r) {
|
|
591
|
+
var n = i - t;
|
|
549
592
|
return e === 0 ? t : e === r ? t + n : (e /= r / 2) < 1 ? n / 2 * Math.pow(2, 10 * (e - 1)) + t : n / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
|
|
550
593
|
},
|
|
551
|
-
easeInCirc: function(e, t,
|
|
552
|
-
var n =
|
|
594
|
+
easeInCirc: function(e, t, i, r) {
|
|
595
|
+
var n = i - t;
|
|
553
596
|
return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t;
|
|
554
597
|
},
|
|
555
|
-
easeOutCirc: function(e, t,
|
|
556
|
-
var n =
|
|
598
|
+
easeOutCirc: function(e, t, i, r) {
|
|
599
|
+
var n = i - t;
|
|
557
600
|
return n * Math.sqrt(1 - (e = e / r - 1) * e) + t;
|
|
558
601
|
},
|
|
559
|
-
easeInOutCirc: function(e, t,
|
|
560
|
-
var n =
|
|
602
|
+
easeInOutCirc: function(e, t, i, r) {
|
|
603
|
+
var n = i - t;
|
|
561
604
|
return (e /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + t : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
|
|
562
605
|
},
|
|
563
|
-
easeInElastic: function(e, t,
|
|
564
|
-
var n =
|
|
565
|
-
return
|
|
606
|
+
easeInElastic: function(e, t, i, r) {
|
|
607
|
+
var n = i - t, u, c, b;
|
|
608
|
+
return b = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), u < Math.abs(n) ? (u = n, b = c / 4) : b = c / (2 * Math.PI) * Math.asin(n / u), -(u * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - b) * (2 * Math.PI) / c)) + t);
|
|
566
609
|
},
|
|
567
|
-
easeOutElastic: function(e, t,
|
|
568
|
-
var n =
|
|
569
|
-
return
|
|
610
|
+
easeOutElastic: function(e, t, i, r) {
|
|
611
|
+
var n = i - t, u, c, b;
|
|
612
|
+
return b = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), u < Math.abs(n) ? (u = n, b = c / 4) : b = c / (2 * Math.PI) * Math.asin(n / u), u * Math.pow(2, -10 * e) * Math.sin((e * r - b) * (2 * Math.PI) / c) + n + t);
|
|
570
613
|
},
|
|
571
|
-
easeInOutElastic: function(e, t,
|
|
572
|
-
var n =
|
|
573
|
-
return
|
|
614
|
+
easeInOutElastic: function(e, t, i, r) {
|
|
615
|
+
var n = i - t, u, c, b;
|
|
616
|
+
return b = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r / 2) === 2 ? t + n : (c || (c = r * (0.3 * 1.5)), u < Math.abs(n) ? (u = n, b = c / 4) : b = c / (2 * Math.PI) * Math.asin(n / u), e < 1 ? -0.5 * (u * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - b) * (2 * Math.PI) / c)) + t : u * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - b) * (2 * Math.PI) / c) * 0.5 + n + t);
|
|
574
617
|
},
|
|
575
|
-
easeInBack: function(e, t,
|
|
576
|
-
var u =
|
|
618
|
+
easeInBack: function(e, t, i, r, n) {
|
|
619
|
+
var u = i - t;
|
|
577
620
|
return n === void 0 && (n = 1.70158), u * (e /= r) * e * ((n + 1) * e - n) + t;
|
|
578
621
|
},
|
|
579
|
-
easeOutBack: function(e, t,
|
|
580
|
-
var u =
|
|
622
|
+
easeOutBack: function(e, t, i, r, n) {
|
|
623
|
+
var u = i - t;
|
|
581
624
|
return n === void 0 && (n = 1.70158), u * ((e = e / r - 1) * e * ((n + 1) * e + n) + 1) + t;
|
|
582
625
|
},
|
|
583
|
-
easeInOutBack: function(e, t,
|
|
584
|
-
var u =
|
|
626
|
+
easeInOutBack: function(e, t, i, r, n) {
|
|
627
|
+
var u = i - t;
|
|
585
628
|
return n === void 0 && (n = 1.70158), (e /= r / 2) < 1 ? u / 2 * (e * e * (((n *= 1.525) + 1) * e - n)) + t : u / 2 * ((e -= 2) * e * (((n *= 1.525) + 1) * e + n) + 2) + t;
|
|
586
629
|
},
|
|
587
|
-
easeInBounce: function(e, t,
|
|
588
|
-
var n =
|
|
589
|
-
return u =
|
|
630
|
+
easeInBounce: function(e, t, i, r) {
|
|
631
|
+
var n = i - t, u;
|
|
632
|
+
return u = o.easeOutBounce(r - e, 0, n, r), n - u + t;
|
|
590
633
|
},
|
|
591
|
-
easeOutBounce: function(e, t,
|
|
592
|
-
var n =
|
|
634
|
+
easeOutBounce: function(e, t, i, r) {
|
|
635
|
+
var n = i - t;
|
|
593
636
|
return (e /= r) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
|
|
594
637
|
},
|
|
595
|
-
easeInOutBounce: function(e, t,
|
|
596
|
-
var n =
|
|
597
|
-
return e < r / 2 ? (u =
|
|
638
|
+
easeInOutBounce: function(e, t, i, r) {
|
|
639
|
+
var n = i - t, u;
|
|
640
|
+
return e < r / 2 ? (u = o.easeInBounce(e * 2, 0, n, r), u * 0.5 + t) : (u = o.easeOutBounce(e * 2 - r, 0, n, r), u * 0.5 + n * 0.5 + t);
|
|
598
641
|
}
|
|
599
642
|
};
|
|
600
|
-
return
|
|
643
|
+
return Ge = o, Ge;
|
|
601
644
|
}
|
|
602
|
-
var
|
|
603
|
-
function
|
|
604
|
-
return
|
|
645
|
+
var At = kt();
|
|
646
|
+
function Et(o) {
|
|
647
|
+
return o * Math.PI / 180;
|
|
605
648
|
}
|
|
606
|
-
function
|
|
607
|
-
return
|
|
649
|
+
function G(o, e) {
|
|
650
|
+
return o + Math.random() * (e - o);
|
|
608
651
|
}
|
|
609
|
-
function
|
|
610
|
-
return Math.floor(
|
|
652
|
+
function Rt(o, e) {
|
|
653
|
+
return Math.floor(o + Math.random() * (e - o + 1));
|
|
611
654
|
}
|
|
612
655
|
var Oe;
|
|
613
|
-
(function(
|
|
614
|
-
|
|
656
|
+
(function(o) {
|
|
657
|
+
o[o.Circle = 0] = "Circle", o[o.Square = 1] = "Square", o[o.Strip = 2] = "Strip";
|
|
615
658
|
})(Oe || (Oe = {}));
|
|
616
|
-
var
|
|
617
|
-
(function(
|
|
618
|
-
|
|
619
|
-
})(
|
|
620
|
-
const
|
|
621
|
-
class
|
|
622
|
-
constructor(e, t,
|
|
659
|
+
var me;
|
|
660
|
+
(function(o) {
|
|
661
|
+
o[o.Positive = 1] = "Positive", o[o.Negative = -1] = "Negative";
|
|
662
|
+
})(me || (me = {}));
|
|
663
|
+
const jt = 1e3 / 60;
|
|
664
|
+
class Mt {
|
|
665
|
+
constructor(e, t, i, r) {
|
|
623
666
|
this.getOptions = t;
|
|
624
667
|
const { colors: n, initialVelocityX: u, initialVelocityY: c } = this.getOptions();
|
|
625
|
-
this.context = e, this.x =
|
|
668
|
+
this.context = e, this.x = i, this.y = r, this.w = G(5, 20), this.h = G(5, 20), this.radius = G(5, 10), this.vx = typeof u == "number" ? G(-u, u) : G(u.min, u.max), this.vy = typeof c == "number" ? G(-c, 0) : G(c.min, c.max), this.shape = Rt(0, 2), this.angle = Et(G(0, 360)), this.angularSpin = G(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = G(0, 1), this.rotationDirection = G(0, 1) ? me.Positive : me.Negative;
|
|
626
669
|
}
|
|
627
670
|
update(e) {
|
|
628
|
-
const { gravity: t, wind:
|
|
629
|
-
this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx +=
|
|
630
|
-
const
|
|
631
|
-
if (this.rotateY +=
|
|
671
|
+
const { gravity: t, wind: i, friction: r, opacity: n, drawShape: u } = this.getOptions(), c = e / jt;
|
|
672
|
+
this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx += i * c, this.vx *= r ** c, this.vy *= r ** c, this.rotateY >= 1 && this.rotationDirection === me.Positive ? this.rotationDirection = me.Negative : this.rotateY <= -1 && this.rotationDirection === me.Negative && (this.rotationDirection = me.Positive);
|
|
673
|
+
const b = 0.1 * this.rotationDirection * c;
|
|
674
|
+
if (this.rotateY += b, this.angle += this.angularSpin, this.context.save(), this.context.translate(this.x, this.y), this.context.rotate(this.angle), this.context.scale(1, this.rotateY), this.context.rotate(this.angle), this.context.beginPath(), this.context.fillStyle = this.color, this.context.strokeStyle = this.color, this.context.globalAlpha = n, this.context.lineCap = "round", this.context.lineWidth = 2, u && typeof u == "function")
|
|
632
675
|
u.call(this, this.context);
|
|
633
676
|
else
|
|
634
677
|
switch (this.shape) {
|
|
@@ -648,39 +691,39 @@ class Ft {
|
|
|
648
691
|
this.context.closePath(), this.context.restore();
|
|
649
692
|
}
|
|
650
693
|
}
|
|
651
|
-
class
|
|
694
|
+
class Ft {
|
|
652
695
|
constructor(e, t) {
|
|
653
696
|
this.x = 0, this.y = 0, this.w = 0, this.h = 0, this.lastNumberOfPieces = 0, this.tweenProgress = 0, this.tweenFrom = 0, this.particles = [], this.particlesGenerated = 0, this.removeParticleAt = (r) => {
|
|
654
697
|
this.particles.splice(r, 1);
|
|
655
698
|
}, this.getParticle = () => {
|
|
656
|
-
const r =
|
|
657
|
-
return new
|
|
699
|
+
const r = G(this.x, this.w + this.x), n = G(this.y, this.h + this.y);
|
|
700
|
+
return new Mt(this.context, this.getOptions, r, n);
|
|
658
701
|
}, this.animate = (r) => {
|
|
659
|
-
const { canvas: n, context: u, particlesGenerated: c, lastNumberOfPieces:
|
|
660
|
-
if (!
|
|
702
|
+
const { canvas: n, context: u, particlesGenerated: c, lastNumberOfPieces: b } = this, { run: H, recycle: x, numberOfPieces: M, debug: B, tweenFunction: Z, tweenDuration: L } = this.getOptions();
|
|
703
|
+
if (!H)
|
|
661
704
|
return !1;
|
|
662
|
-
const
|
|
663
|
-
if (
|
|
664
|
-
|
|
665
|
-
const
|
|
666
|
-
for (let
|
|
705
|
+
const Q = this.particles.length, J = x ? Q : c;
|
|
706
|
+
if (J < M) {
|
|
707
|
+
b !== M && (this.tweenProgress = 0, this.tweenFrom = J, this.lastNumberOfPieces = M), this.tweenProgress = Math.min(L, Math.max(0, this.tweenProgress + r));
|
|
708
|
+
const z = Z(this.tweenProgress, this.tweenFrom, M, L), F = Math.round(z - J);
|
|
709
|
+
for (let V = 0; V < F; V++)
|
|
667
710
|
this.particles.push(this.getParticle());
|
|
668
|
-
this.particlesGenerated +=
|
|
711
|
+
this.particlesGenerated += F;
|
|
669
712
|
}
|
|
670
|
-
|
|
671
|
-
for (let
|
|
672
|
-
const
|
|
673
|
-
|
|
713
|
+
B && (u.font = "12px sans-serif", u.fillStyle = "#333", u.textAlign = "right", u.fillText(`Particles: ${Q}`, n.width - 10, n.height - 20));
|
|
714
|
+
for (let z = this.particles.length - 1; z >= 0; z--) {
|
|
715
|
+
const F = this.particles[z];
|
|
716
|
+
F.update(r), (F.y > n.height || F.y < -100 || F.x > n.width + 100 || F.x < -100) && (x && J <= M ? this.particles[z] = this.getParticle() : this.removeParticleAt(z));
|
|
674
717
|
}
|
|
675
|
-
return
|
|
718
|
+
return Q > 0 || J < M;
|
|
676
719
|
}, this.canvas = e;
|
|
677
|
-
const
|
|
678
|
-
if (!
|
|
720
|
+
const i = this.canvas.getContext("2d");
|
|
721
|
+
if (!i)
|
|
679
722
|
throw new Error("Could not get canvas context");
|
|
680
|
-
this.context =
|
|
723
|
+
this.context = i, this.getOptions = t;
|
|
681
724
|
}
|
|
682
725
|
}
|
|
683
|
-
const
|
|
726
|
+
const Xe = {
|
|
684
727
|
width: typeof window < "u" ? window.innerWidth : 300,
|
|
685
728
|
height: typeof window < "u" ? window.innerHeight : 200,
|
|
686
729
|
numberOfPieces: 200,
|
|
@@ -710,7 +753,7 @@ const Ke = {
|
|
|
710
753
|
],
|
|
711
754
|
opacity: 1,
|
|
712
755
|
debug: !1,
|
|
713
|
-
tweenFunction:
|
|
756
|
+
tweenFunction: At.easeInOutQuad,
|
|
714
757
|
tweenDuration: 5e3,
|
|
715
758
|
recycle: !0,
|
|
716
759
|
run: !0
|
|
@@ -728,55 +771,55 @@ class Dt {
|
|
|
728
771
|
};
|
|
729
772
|
this._options = {
|
|
730
773
|
...n,
|
|
731
|
-
...
|
|
774
|
+
...Xe,
|
|
732
775
|
...r
|
|
733
776
|
}, Object.assign(this, r.confettiSource);
|
|
734
777
|
}, this.update = (r = 0) => {
|
|
735
|
-
const { options: { run: n, onConfettiComplete: u, frameRate: c }, canvas:
|
|
736
|
-
if (c &&
|
|
778
|
+
const { options: { run: n, onConfettiComplete: u, frameRate: c }, canvas: b, context: H } = this, x = Math.min(r - this.lastFrameTime, 50);
|
|
779
|
+
if (c && x < 1e3 / c) {
|
|
737
780
|
this.rafId = requestAnimationFrame(this.update);
|
|
738
781
|
return;
|
|
739
782
|
}
|
|
740
|
-
this.lastFrameTime = r - (c ?
|
|
783
|
+
this.lastFrameTime = r - (c ? x % c : 0), n && (H.fillStyle = "white", H.clearRect(0, 0, b.width, b.height)), this.generator.animate(x) ? this.rafId = requestAnimationFrame(this.update) : (u && typeof u == "function" && this.generator.particlesGenerated > 0 && u.call(this, this), this._options.run = !1);
|
|
741
784
|
}, this.reset = () => {
|
|
742
785
|
this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
|
|
743
786
|
}, this.stop = () => {
|
|
744
787
|
this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
|
|
745
788
|
}, this.canvas = e;
|
|
746
|
-
const
|
|
747
|
-
if (!
|
|
789
|
+
const i = this.canvas.getContext("2d");
|
|
790
|
+
if (!i)
|
|
748
791
|
throw new Error("Could not get canvas context");
|
|
749
|
-
this.context =
|
|
792
|
+
this.context = i, this.generator = new Ft(this.canvas, () => this.options), this.options = t, this.update();
|
|
750
793
|
}
|
|
751
794
|
get options() {
|
|
752
795
|
return this._options;
|
|
753
796
|
}
|
|
754
797
|
set options(e) {
|
|
755
798
|
var r, n;
|
|
756
|
-
const t = (r = this._options) == null ? void 0 : r.run,
|
|
757
|
-
this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle &&
|
|
799
|
+
const t = (r = this._options) == null ? void 0 : r.run, i = (n = this._options) == null ? void 0 : n.recycle;
|
|
800
|
+
this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && i === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
|
|
758
801
|
}
|
|
759
802
|
}
|
|
760
|
-
const
|
|
761
|
-
class
|
|
803
|
+
const Lt = Le.createRef();
|
|
804
|
+
class Ze extends Le.Component {
|
|
762
805
|
constructor(e) {
|
|
763
|
-
super(e), this.canvas =
|
|
806
|
+
super(e), this.canvas = Le.createRef(), this.canvas = e.canvasRef || Lt;
|
|
764
807
|
}
|
|
765
808
|
componentDidMount() {
|
|
766
809
|
if (this.canvas.current) {
|
|
767
|
-
const e =
|
|
810
|
+
const e = He(this.props)[0];
|
|
768
811
|
this.confetti = new Dt(this.canvas.current, e);
|
|
769
812
|
}
|
|
770
813
|
}
|
|
771
814
|
componentDidUpdate() {
|
|
772
|
-
const e =
|
|
815
|
+
const e = He(this.props)[0];
|
|
773
816
|
this.confetti && (this.confetti.options = e);
|
|
774
817
|
}
|
|
775
818
|
componentWillUnmount() {
|
|
776
819
|
this.confetti && this.confetti.stop(), this.confetti = void 0;
|
|
777
820
|
}
|
|
778
821
|
render() {
|
|
779
|
-
const [e, t] =
|
|
822
|
+
const [e, t] = He(this.props), i = {
|
|
780
823
|
zIndex: 2,
|
|
781
824
|
position: "absolute",
|
|
782
825
|
pointerEvents: "none",
|
|
@@ -786,42 +829,42 @@ class Xe extends Ee.Component {
|
|
|
786
829
|
right: 0,
|
|
787
830
|
...t.style
|
|
788
831
|
};
|
|
789
|
-
return f("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style:
|
|
832
|
+
return f("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: i });
|
|
790
833
|
}
|
|
791
834
|
}
|
|
792
|
-
|
|
793
|
-
...
|
|
835
|
+
Ze.defaultProps = {
|
|
836
|
+
...Xe
|
|
794
837
|
};
|
|
795
|
-
|
|
796
|
-
function
|
|
797
|
-
const e = {}, t = {},
|
|
798
|
-
...Object.keys(
|
|
838
|
+
Ze.displayName = "ReactConfetti";
|
|
839
|
+
function He(o) {
|
|
840
|
+
const e = {}, t = {}, i = {}, r = [
|
|
841
|
+
...Object.keys(Xe),
|
|
799
842
|
"confettiSource",
|
|
800
843
|
"drawShape",
|
|
801
844
|
"onConfettiComplete",
|
|
802
845
|
"frameRate"
|
|
803
846
|
], n = ["canvasRef"];
|
|
804
|
-
for (const u in
|
|
805
|
-
const c =
|
|
806
|
-
r.includes(u) ? e[u] = c : n.includes(u) ? n[u] = c :
|
|
847
|
+
for (const u in o) {
|
|
848
|
+
const c = o[u];
|
|
849
|
+
r.includes(u) ? e[u] = c : n.includes(u) ? n[u] = c : i[u] = c;
|
|
807
850
|
}
|
|
808
|
-
return [e,
|
|
851
|
+
return [e, i, t];
|
|
809
852
|
}
|
|
810
|
-
const
|
|
853
|
+
const $t = Le.forwardRef((o, e) => f(Ze, { canvasRef: e, ...o }));
|
|
811
854
|
/**
|
|
812
855
|
* @license lucide-react v0.515.0 - ISC
|
|
813
856
|
*
|
|
814
857
|
* This source code is licensed under the ISC license.
|
|
815
858
|
* See the LICENSE file in the root directory of this source tree.
|
|
816
859
|
*/
|
|
817
|
-
const
|
|
860
|
+
const Vt = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qt = (o) => o.replace(
|
|
818
861
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
819
|
-
(e, t,
|
|
820
|
-
), mt = (
|
|
821
|
-
const e = qt(
|
|
862
|
+
(e, t, i) => i ? i.toUpperCase() : t.toLowerCase()
|
|
863
|
+
), mt = (o) => {
|
|
864
|
+
const e = qt(o);
|
|
822
865
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
823
|
-
},
|
|
824
|
-
for (const e in
|
|
866
|
+
}, wt = (...o) => o.filter((e, t, i) => !!e && e.trim() !== "" && i.indexOf(e) === t).join(" ").trim(), Ut = (o) => {
|
|
867
|
+
for (const e in o)
|
|
825
868
|
if (e.startsWith("aria-") || e === "role" || e === "title")
|
|
826
869
|
return !0;
|
|
827
870
|
};
|
|
@@ -848,31 +891,31 @@ var Wt = {
|
|
|
848
891
|
* This source code is licensed under the ISC license.
|
|
849
892
|
* See the LICENSE file in the root directory of this source tree.
|
|
850
893
|
*/
|
|
851
|
-
const
|
|
894
|
+
const Gt = bt(
|
|
852
895
|
({
|
|
853
|
-
color:
|
|
896
|
+
color: o = "currentColor",
|
|
854
897
|
size: e = 24,
|
|
855
898
|
strokeWidth: t = 2,
|
|
856
|
-
absoluteStrokeWidth:
|
|
899
|
+
absoluteStrokeWidth: i,
|
|
857
900
|
className: r = "",
|
|
858
901
|
children: n,
|
|
859
902
|
iconNode: u,
|
|
860
903
|
...c
|
|
861
|
-
},
|
|
904
|
+
}, b) => Ye(
|
|
862
905
|
"svg",
|
|
863
906
|
{
|
|
864
|
-
ref:
|
|
907
|
+
ref: b,
|
|
865
908
|
...Wt,
|
|
866
909
|
width: e,
|
|
867
910
|
height: e,
|
|
868
|
-
stroke:
|
|
869
|
-
strokeWidth:
|
|
870
|
-
className:
|
|
911
|
+
stroke: o,
|
|
912
|
+
strokeWidth: i ? Number(t) * 24 / Number(e) : t,
|
|
913
|
+
className: wt("lucide", r),
|
|
871
914
|
...!n && !Ut(c) && { "aria-hidden": "true" },
|
|
872
915
|
...c
|
|
873
916
|
},
|
|
874
917
|
[
|
|
875
|
-
...u.map(([
|
|
918
|
+
...u.map(([H, x]) => Ye(H, x)),
|
|
876
919
|
...Array.isArray(n) ? n : [n]
|
|
877
920
|
]
|
|
878
921
|
)
|
|
@@ -883,20 +926,20 @@ const Vt = bt(
|
|
|
883
926
|
* This source code is licensed under the ISC license.
|
|
884
927
|
* See the LICENSE file in the root directory of this source tree.
|
|
885
928
|
*/
|
|
886
|
-
const
|
|
929
|
+
const Ht = (o, e) => {
|
|
887
930
|
const t = bt(
|
|
888
|
-
({ className:
|
|
931
|
+
({ className: i, ...r }, n) => Ye(Gt, {
|
|
889
932
|
ref: n,
|
|
890
933
|
iconNode: e,
|
|
891
|
-
className:
|
|
892
|
-
`lucide-${
|
|
893
|
-
`lucide-${
|
|
894
|
-
|
|
934
|
+
className: wt(
|
|
935
|
+
`lucide-${Vt(mt(o))}`,
|
|
936
|
+
`lucide-${o}`,
|
|
937
|
+
i
|
|
895
938
|
),
|
|
896
939
|
...r
|
|
897
940
|
})
|
|
898
941
|
);
|
|
899
|
-
return t.displayName = mt(
|
|
942
|
+
return t.displayName = mt(o), t;
|
|
900
943
|
};
|
|
901
944
|
/**
|
|
902
945
|
* @license lucide-react v0.515.0 - ISC
|
|
@@ -907,127 +950,127 @@ const Gt = (i, e) => {
|
|
|
907
950
|
const Qt = [
|
|
908
951
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
909
952
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
910
|
-
], Yt =
|
|
911
|
-
backdrop:
|
|
912
|
-
celebrationOverlay:
|
|
913
|
-
celebrationChip:
|
|
914
|
-
backdropOpen:
|
|
915
|
-
backdropClosed:
|
|
916
|
-
panel:
|
|
917
|
-
panelOpen:
|
|
918
|
-
panelClosed:
|
|
919
|
-
header:
|
|
920
|
-
headerCenter:
|
|
921
|
-
title:
|
|
922
|
-
searchIconButton:
|
|
923
|
-
headerTitleWrap:
|
|
924
|
-
headerSearchWrap:
|
|
925
|
-
headerSearchOpen:
|
|
926
|
-
searchBar:
|
|
927
|
-
searchInput:
|
|
928
|
-
searchClearButton:
|
|
929
|
-
closeButton:
|
|
930
|
-
body:
|
|
931
|
-
muted:
|
|
932
|
-
error:
|
|
953
|
+
], Yt = Ht("search", Qt), Kt = "_backdrop_jhu8z_1", Xt = "_celebrationOverlay_jhu8z_14", Zt = "_celebrationChip_jhu8z_23", Jt = "_backdropOpen_jhu8z_74", en = "_backdropClosed_jhu8z_78", tn = "_panel_jhu8z_82", nn = "_panelOpen_jhu8z_102", rn = "_panelClosed_jhu8z_106", on = "_header_jhu8z_145", an = "_headerCenter_jhu8z_154", sn = "_title_jhu8z_162", cn = "_searchIconButton_jhu8z_171", ln = "_headerTitleWrap_jhu8z_193", un = "_headerSearchWrap_jhu8z_197", dn = "_headerSearchOpen_jhu8z_209", hn = "_searchBar_jhu8z_221", fn = "_searchInput_jhu8z_233", mn = "_searchClearButton_jhu8z_254", pn = "_closeButton_jhu8z_276", bn = "_body_jhu8z_309", _n = "_muted_jhu8z_314", wn = "_error_jhu8z_319", yn = "_variants_jhu8z_324", gn = "_variantList_jhu8z_328", vn = "_variantRow_jhu8z_336", xn = "_variantRowSoldOut_jhu8z_344", Cn = "_variantLeft_jhu8z_348", In = "_addToBundleButton_jhu8z_355", Sn = "_soldOutContainer_jhu8z_383", Bn = "_soldOut_jhu8z_383", Nn = "_variantThumb_jhu8z_400", Tn = "_variantThumbImg_jhu8z_410", On = "_variantThumbFallback_jhu8z_417", Pn = "_variantInfo_jhu8z_427", zn = "_variantName_jhu8z_431", kn = "_variantMeta_jhu8z_440", An = "_variantPriceRow_jhu8z_448", En = "_variantCompareAt_jhu8z_455", Rn = "_variantPrice_jhu8z_448", jn = "_qtyControls_jhu8z_466", Mn = "_qtyButton_jhu8z_472", Fn = "_qtyValue_jhu8z_497", Dn = "_footer_jhu8z_504", Ln = "_poweredBy_jhu8z_511", $n = "_boxSummaryWindow_jhu8z_523", Vn = "_boxSummaryRow_jhu8z_540", qn = "_boxSlot_jhu8z_548", Un = "_boxItem_jhu8z_557", Wn = "_boxItemClickable_jhu8z_569", Gn = "_boxThresholdLabel_jhu8z_578", Hn = "_boxItemPlaceholder_jhu8z_589", Qn = "_boxItemFilled_jhu8z_595", Yn = "_boxItemThreshold_jhu8z_601", Kn = "_boxItemDiscountText_jhu8z_609", Xn = "_boxItemPlus_jhu8z_617", Zn = "_boxItemImage_jhu8z_624", Jn = "_boxItemFallback_jhu8z_631", er = "_ctaButtonGroup_jhu8z_642", tr = "_ctaButtonGroupAnimating_jhu8z_649", nr = "_cta_jhu8z_642", rr = "_ctaDualLeft_jhu8z_677", ir = "_ctaDualLeftAnimating_jhu8z_695", or = "_ctaDualRight_jhu8z_708", ar = "_ctaDualRightAnimating_jhu8z_724", sr = "_ctaTotals_jhu8z_735", cr = "_ctaDiscountBadge_jhu8z_743", lr = "_ctaTotalsWrap_jhu8z_757", ur = "_ctaTotalsWrapVisible_jhu8z_770", dr = "_ctaTotalsStrike_jhu8z_777", hr = "_ctaTotalsPrice_jhu8z_784", l = {
|
|
954
|
+
backdrop: Kt,
|
|
955
|
+
celebrationOverlay: Xt,
|
|
956
|
+
celebrationChip: Zt,
|
|
957
|
+
backdropOpen: Jt,
|
|
958
|
+
backdropClosed: en,
|
|
959
|
+
panel: tn,
|
|
960
|
+
panelOpen: nn,
|
|
961
|
+
panelClosed: rn,
|
|
962
|
+
header: on,
|
|
963
|
+
headerCenter: an,
|
|
964
|
+
title: sn,
|
|
965
|
+
searchIconButton: cn,
|
|
966
|
+
headerTitleWrap: ln,
|
|
967
|
+
headerSearchWrap: un,
|
|
968
|
+
headerSearchOpen: dn,
|
|
969
|
+
searchBar: hn,
|
|
970
|
+
searchInput: fn,
|
|
971
|
+
searchClearButton: mn,
|
|
972
|
+
closeButton: pn,
|
|
973
|
+
body: bn,
|
|
974
|
+
muted: _n,
|
|
975
|
+
error: wn,
|
|
933
976
|
variants: yn,
|
|
934
|
-
variantList:
|
|
935
|
-
variantRow:
|
|
936
|
-
variantRowSoldOut:
|
|
937
|
-
variantLeft:
|
|
938
|
-
addToBundleButton:
|
|
977
|
+
variantList: gn,
|
|
978
|
+
variantRow: vn,
|
|
979
|
+
variantRowSoldOut: xn,
|
|
980
|
+
variantLeft: Cn,
|
|
981
|
+
addToBundleButton: In,
|
|
939
982
|
soldOutContainer: Sn,
|
|
940
|
-
soldOut:
|
|
941
|
-
variantThumb:
|
|
983
|
+
soldOut: Bn,
|
|
984
|
+
variantThumb: Nn,
|
|
942
985
|
variantThumbImg: Tn,
|
|
943
|
-
variantThumbFallback:
|
|
944
|
-
variantInfo:
|
|
945
|
-
variantName:
|
|
946
|
-
variantMeta:
|
|
947
|
-
variantPriceRow:
|
|
948
|
-
variantCompareAt:
|
|
949
|
-
variantPrice:
|
|
950
|
-
qtyControls:
|
|
951
|
-
qtyButton:
|
|
952
|
-
qtyValue:
|
|
986
|
+
variantThumbFallback: On,
|
|
987
|
+
variantInfo: Pn,
|
|
988
|
+
variantName: zn,
|
|
989
|
+
variantMeta: kn,
|
|
990
|
+
variantPriceRow: An,
|
|
991
|
+
variantCompareAt: En,
|
|
992
|
+
variantPrice: Rn,
|
|
993
|
+
qtyControls: jn,
|
|
994
|
+
qtyButton: Mn,
|
|
995
|
+
qtyValue: Fn,
|
|
953
996
|
footer: Dn,
|
|
954
|
-
poweredBy:
|
|
955
|
-
boxSummaryWindow:
|
|
956
|
-
boxSummaryRow:
|
|
997
|
+
poweredBy: Ln,
|
|
998
|
+
boxSummaryWindow: $n,
|
|
999
|
+
boxSummaryRow: Vn,
|
|
957
1000
|
boxSlot: qn,
|
|
958
1001
|
boxItem: Un,
|
|
959
1002
|
boxItemClickable: Wn,
|
|
960
|
-
boxThresholdLabel:
|
|
961
|
-
boxItemPlaceholder:
|
|
1003
|
+
boxThresholdLabel: Gn,
|
|
1004
|
+
boxItemPlaceholder: Hn,
|
|
962
1005
|
boxItemFilled: Qn,
|
|
963
1006
|
boxItemThreshold: Yn,
|
|
964
|
-
boxItemDiscountText:
|
|
965
|
-
boxItemPlus:
|
|
966
|
-
boxItemImage:
|
|
967
|
-
boxItemFallback:
|
|
968
|
-
ctaButtonGroup:
|
|
969
|
-
ctaButtonGroupAnimating:
|
|
970
|
-
cta:
|
|
971
|
-
ctaDualLeft:
|
|
972
|
-
ctaDualLeftAnimating:
|
|
1007
|
+
boxItemDiscountText: Kn,
|
|
1008
|
+
boxItemPlus: Xn,
|
|
1009
|
+
boxItemImage: Zn,
|
|
1010
|
+
boxItemFallback: Jn,
|
|
1011
|
+
ctaButtonGroup: er,
|
|
1012
|
+
ctaButtonGroupAnimating: tr,
|
|
1013
|
+
cta: nr,
|
|
1014
|
+
ctaDualLeft: rr,
|
|
1015
|
+
ctaDualLeftAnimating: ir,
|
|
973
1016
|
ctaDualRight: or,
|
|
974
|
-
ctaDualRightAnimating:
|
|
975
|
-
ctaTotals:
|
|
976
|
-
ctaDiscountBadge:
|
|
977
|
-
ctaTotalsWrap:
|
|
978
|
-
ctaTotalsWrapVisible:
|
|
979
|
-
ctaTotalsStrike:
|
|
980
|
-
ctaTotalsPrice:
|
|
1017
|
+
ctaDualRightAnimating: ar,
|
|
1018
|
+
ctaTotals: sr,
|
|
1019
|
+
ctaDiscountBadge: cr,
|
|
1020
|
+
ctaTotalsWrap: lr,
|
|
1021
|
+
ctaTotalsWrapVisible: ur,
|
|
1022
|
+
ctaTotalsStrike: dr,
|
|
1023
|
+
ctaTotalsPrice: hr
|
|
981
1024
|
};
|
|
982
|
-
function yr(
|
|
983
|
-
var
|
|
1025
|
+
function yr(o) {
|
|
1026
|
+
var at, st;
|
|
984
1027
|
const {
|
|
985
1028
|
isOpen: e,
|
|
986
1029
|
close: t,
|
|
987
|
-
loading:
|
|
1030
|
+
loading: i,
|
|
988
1031
|
submitting: r,
|
|
989
1032
|
error: n,
|
|
990
1033
|
currencyCode: u,
|
|
991
1034
|
config: c,
|
|
992
|
-
eligibleVariants:
|
|
993
|
-
selections:
|
|
994
|
-
selectionOrder:
|
|
995
|
-
setQuantity:
|
|
996
|
-
bundleSize:
|
|
997
|
-
minRequired:
|
|
998
|
-
canSubmit:
|
|
999
|
-
submit:
|
|
1000
|
-
submitAndCheckout:
|
|
1001
|
-
} =
|
|
1035
|
+
eligibleVariants: b,
|
|
1036
|
+
selections: H,
|
|
1037
|
+
selectionOrder: x,
|
|
1038
|
+
setQuantity: M,
|
|
1039
|
+
bundleSize: B,
|
|
1040
|
+
minRequired: Z,
|
|
1041
|
+
canSubmit: L,
|
|
1042
|
+
submit: Q,
|
|
1043
|
+
submitAndCheckout: J
|
|
1044
|
+
} = Ke(), [z, F] = A(!1), [V, Ie] = A(""), m = W(null), pe = W(null), ie = W(null), [Y, Pe] = A(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [ze, ke] = A(0), [be, te] = A(null), [Ae, Se] = A(!1), ee = W(null), ne = W(B), Be = 7e3, [_e, oe] = A(0), [we, ce] = A(null), [le, ye] = A(!1), ae = W(null), Ee = 2800, Re = [
|
|
1002
1045
|
"#2563eb",
|
|
1003
1046
|
"#3b82f6",
|
|
1004
1047
|
"#60a5fa",
|
|
1005
1048
|
"#93c5fd",
|
|
1006
1049
|
"#bae6fd",
|
|
1007
1050
|
"#e0f2fe"
|
|
1008
|
-
], d =
|
|
1051
|
+
], d = P(() => {
|
|
1009
1052
|
var s;
|
|
1010
1053
|
const a = (s = c == null ? void 0 : c.styleSettings) == null ? void 0 : s.confettiColors;
|
|
1011
1054
|
return Array.isArray(a) && a.length >= 6 ? a.slice(0, 6).map(
|
|
1012
|
-
(h,
|
|
1013
|
-
) : [...
|
|
1014
|
-
}, [(
|
|
1055
|
+
(h, w) => typeof h == "string" && h.trim() ? h : Re[w]
|
|
1056
|
+
) : [...Re];
|
|
1057
|
+
}, [(at = c == null ? void 0 : c.styleSettings) == null ? void 0 : at.confettiColors]), y = (a) => {
|
|
1015
1058
|
const s = Number.parseFloat(a);
|
|
1016
1059
|
return Number.isFinite(s) ? String(Math.round(s)) : a;
|
|
1017
|
-
},
|
|
1060
|
+
}, E = (a) => {
|
|
1018
1061
|
const s = (a ?? []).filter((h) => {
|
|
1019
|
-
var S,
|
|
1020
|
-
const
|
|
1021
|
-
return !(!
|
|
1062
|
+
var S, C;
|
|
1063
|
+
const w = (S = h == null ? void 0 : h.name) == null ? void 0 : S.trim(), _ = (C = h == null ? void 0 : h.value) == null ? void 0 : C.trim();
|
|
1064
|
+
return !(!w || !_ || w.toLowerCase() === "title");
|
|
1022
1065
|
});
|
|
1023
1066
|
return s.length ? s.map((h) => `${h.name}: ${h.value}`).join(" · ") : null;
|
|
1024
|
-
},
|
|
1067
|
+
}, p = (a) => {
|
|
1025
1068
|
var s;
|
|
1026
1069
|
return ((s = a.product) == null ? void 0 : s.title) ?? a.displayName ?? a.title;
|
|
1027
|
-
},
|
|
1028
|
-
const s =
|
|
1070
|
+
}, R = (a) => {
|
|
1071
|
+
const s = p(a), h = E(a.selectedOptions);
|
|
1029
1072
|
return [s, h].filter(Boolean).join(" — ");
|
|
1030
|
-
}, [
|
|
1073
|
+
}, [T, q] = A(e), I = W(null), D = (a) => {
|
|
1031
1074
|
const s = Number(a);
|
|
1032
1075
|
if (!Number.isFinite(s)) return a;
|
|
1033
1076
|
if (u)
|
|
@@ -1036,173 +1079,173 @@ function yr(i) {
|
|
|
1036
1079
|
} catch {
|
|
1037
1080
|
}
|
|
1038
1081
|
return `$${s.toFixed(2)}`;
|
|
1039
|
-
},
|
|
1082
|
+
}, K = ((st = c == null ? void 0 : c.title) == null ? void 0 : st.trim()) || "Build your bundle", ue = P(() => {
|
|
1040
1083
|
const a = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), s = Number.isFinite(a) ? Math.floor(a) : 100;
|
|
1041
1084
|
return Math.max(2, Math.min(100, s));
|
|
1042
|
-
}, [c == null ? void 0 : c.maxBundleSize]),
|
|
1043
|
-
const a =
|
|
1044
|
-
if (!a) return
|
|
1045
|
-
const s = a.split(/\s+/).filter(Boolean), h = (
|
|
1046
|
-
var
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1049
|
-
for (const
|
|
1050
|
-
|
|
1051
|
-
const S =
|
|
1052
|
-
return s.every((
|
|
1085
|
+
}, [c == null ? void 0 : c.maxBundleSize]), ge = B >= ue, de = P(() => [...b].sort((a, s) => a.displayName.localeCompare(s.displayName)), [b]), U = P(() => {
|
|
1086
|
+
const a = V.trim().toLowerCase();
|
|
1087
|
+
if (!a) return de;
|
|
1088
|
+
const s = a.split(/\s+/).filter(Boolean), h = (w) => {
|
|
1089
|
+
var C;
|
|
1090
|
+
const _ = [];
|
|
1091
|
+
_.push(w.displayName), (C = w.product) != null && C.title && _.push(w.product.title);
|
|
1092
|
+
for (const O of w.selectedOptions ?? [])
|
|
1093
|
+
_.push(O.name), _.push(O.value);
|
|
1094
|
+
const S = _.join(" ").toLowerCase();
|
|
1095
|
+
return s.every((O) => S.includes(O));
|
|
1053
1096
|
};
|
|
1054
|
-
return
|
|
1055
|
-
}, [
|
|
1097
|
+
return de.filter(h);
|
|
1098
|
+
}, [V, de]), v = P(() => [...(c == null ? void 0 : c.rules) ?? []].sort((a, s) => a.minBundleSize - s.minBundleSize), [c == null ? void 0 : c.rules]), N = P(() => Math.max(0, Z - B), [B, Z]), g = P(() => {
|
|
1056
1099
|
let a = null;
|
|
1057
|
-
for (const s of
|
|
1058
|
-
|
|
1100
|
+
for (const s of v)
|
|
1101
|
+
B >= s.minBundleSize && (a = s);
|
|
1059
1102
|
return a;
|
|
1060
|
-
}, [
|
|
1061
|
-
if (!
|
|
1062
|
-
const a = Number.parseFloat(
|
|
1103
|
+
}, [B, v]), $ = P(() => {
|
|
1104
|
+
if (!g) return null;
|
|
1105
|
+
const a = Number.parseFloat(g.discountPercent);
|
|
1063
1106
|
return !Number.isFinite(a) || a <= 0 ? null : a;
|
|
1064
|
-
}, [
|
|
1065
|
-
const a =
|
|
1107
|
+
}, [g]), je = P(() => {
|
|
1108
|
+
const a = v[0];
|
|
1066
1109
|
if (!a) return null;
|
|
1067
1110
|
const s = Number.parseFloat(a.discountPercent);
|
|
1068
1111
|
return !Number.isFinite(s) || s <= 0 ? null : s;
|
|
1069
|
-
}, [
|
|
1070
|
-
const a = new Map(
|
|
1112
|
+
}, [v]), ve = $ ?? je, he = P(() => {
|
|
1113
|
+
const a = new Map(b.map((h) => [h.id, h]));
|
|
1071
1114
|
let s = 0;
|
|
1072
|
-
for (const [h,
|
|
1073
|
-
const
|
|
1074
|
-
if (
|
|
1075
|
-
const S = a.get(h),
|
|
1076
|
-
Number.isFinite(
|
|
1115
|
+
for (const [h, w] of Object.entries(H)) {
|
|
1116
|
+
const _ = w ?? 0;
|
|
1117
|
+
if (_ <= 0) continue;
|
|
1118
|
+
const S = a.get(h), C = Number(S == null ? void 0 : S.price);
|
|
1119
|
+
Number.isFinite(C) && (s += C * _);
|
|
1077
1120
|
}
|
|
1078
1121
|
return Math.round(s * 100) / 100;
|
|
1079
|
-
}, [
|
|
1080
|
-
if (
|
|
1081
|
-
const a =
|
|
1122
|
+
}, [b, H]), yt = P(() => {
|
|
1123
|
+
if (!$) return he;
|
|
1124
|
+
const a = he * (1 - $ / 100);
|
|
1082
1125
|
return Math.round(a * 100) / 100;
|
|
1083
|
-
}, [
|
|
1084
|
-
const a = new Map(
|
|
1085
|
-
return
|
|
1086
|
-
}, [
|
|
1126
|
+
}, [$, he]), Je = P(() => v.length ? Math.max(...v.map((a) => a.minBundleSize)) : 0, [v]), $e = P(() => {
|
|
1127
|
+
const a = new Map(b.map((s) => [s.id, s]));
|
|
1128
|
+
return x.map((s) => a.get(s)).filter((s) => !!s);
|
|
1129
|
+
}, [b, x]), gt = P(() => {
|
|
1087
1130
|
var s;
|
|
1088
1131
|
const a = /* @__PURE__ */ new Map();
|
|
1089
|
-
for (const h of
|
|
1090
|
-
const
|
|
1091
|
-
a.set(
|
|
1132
|
+
for (const h of v) {
|
|
1133
|
+
const w = Math.max(0, h.minBundleSize - 1);
|
|
1134
|
+
a.set(w, {
|
|
1092
1135
|
discountPercent: h.discountPercent,
|
|
1093
1136
|
minBundleSize: h.minBundleSize,
|
|
1094
1137
|
label: ((s = h.label) == null ? void 0 : s.trim()) || `Buy ${h.minBundleSize}+`
|
|
1095
1138
|
});
|
|
1096
1139
|
}
|
|
1097
1140
|
return a;
|
|
1098
|
-
}, [
|
|
1099
|
-
|
|
1141
|
+
}, [v]), vt = P(() => Math.max(Je || Z, $e.length), [$e.length, Je, Z]), [Ve, et] = A(!0), tt = W(N);
|
|
1142
|
+
j(() => {
|
|
1100
1143
|
if (((c == null ? void 0 : c.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
|
|
1101
|
-
const s =
|
|
1102
|
-
|
|
1144
|
+
const s = tt.current > 0;
|
|
1145
|
+
et(!(s && N === 0));
|
|
1103
1146
|
}
|
|
1104
|
-
|
|
1105
|
-
}, [
|
|
1106
|
-
const qe =
|
|
1107
|
-
const s =
|
|
1147
|
+
tt.current = N;
|
|
1148
|
+
}, [N, c == null ? void 0 : c.ctaButtonMode]);
|
|
1149
|
+
const qe = W(null), nt = W(null), rt = W(null), it = W(B), ot = (a) => {
|
|
1150
|
+
const s = nt.current;
|
|
1108
1151
|
if (!s) return;
|
|
1109
1152
|
const h = s.querySelector(`[data-variant-row="${a}"]`);
|
|
1110
1153
|
if (!h) return;
|
|
1111
|
-
const
|
|
1112
|
-
if (
|
|
1113
|
-
const
|
|
1114
|
-
s.scrollTo({ top:
|
|
1154
|
+
const w = s.getBoundingClientRect(), _ = h.getBoundingClientRect(), S = 8;
|
|
1155
|
+
if (_.top >= w.top + S && _.bottom <= w.bottom - S) return;
|
|
1156
|
+
const O = Math.max(0, s.scrollHeight - s.clientHeight), X = _.top - w.top + _.height / 2, re = s.scrollTop + X - s.clientHeight / 2, se = Math.min(O, Math.max(0, re));
|
|
1157
|
+
s.scrollTo({ top: se, behavior: "smooth" });
|
|
1115
1158
|
};
|
|
1116
|
-
return
|
|
1159
|
+
return j(() => {
|
|
1117
1160
|
if (!e) return;
|
|
1118
1161
|
const a = (s) => {
|
|
1119
1162
|
s.key === "Escape" && t();
|
|
1120
1163
|
};
|
|
1121
1164
|
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
1122
|
-
}, [t, e]),
|
|
1165
|
+
}, [t, e]), j(() => {
|
|
1123
1166
|
if (typeof window > "u") return;
|
|
1124
|
-
const a = () =>
|
|
1167
|
+
const a = () => Pe({ width: window.innerWidth, height: window.innerHeight });
|
|
1125
1168
|
return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
|
|
1126
|
-
}, []),
|
|
1127
|
-
if (
|
|
1128
|
-
|
|
1169
|
+
}, []), j(() => {
|
|
1170
|
+
if (I.current != null && (window.clearTimeout(I.current), I.current = null), e) {
|
|
1171
|
+
q(!0);
|
|
1129
1172
|
return;
|
|
1130
1173
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1174
|
+
I.current = window.setTimeout(() => {
|
|
1175
|
+
q(!1), I.current = null;
|
|
1133
1176
|
}, 220);
|
|
1134
|
-
}, [e]),
|
|
1135
|
-
|
|
1136
|
-
}, []),
|
|
1137
|
-
|
|
1138
|
-
}, []),
|
|
1139
|
-
|
|
1140
|
-
}, []),
|
|
1141
|
-
if (!e || !
|
|
1177
|
+
}, [e]), j(() => () => {
|
|
1178
|
+
I.current != null && window.clearTimeout(I.current);
|
|
1179
|
+
}, []), j(() => () => {
|
|
1180
|
+
ee.current != null && window.clearTimeout(ee.current);
|
|
1181
|
+
}, []), j(() => () => {
|
|
1182
|
+
ae.current != null && window.clearTimeout(ae.current);
|
|
1183
|
+
}, []), j(() => {
|
|
1184
|
+
if (!e || !z) return;
|
|
1142
1185
|
const a = requestAnimationFrame(() => {
|
|
1143
1186
|
var s;
|
|
1144
1187
|
return (s = m.current) == null ? void 0 : s.focus();
|
|
1145
1188
|
});
|
|
1146
1189
|
return () => cancelAnimationFrame(a);
|
|
1147
|
-
}, [e,
|
|
1148
|
-
const a =
|
|
1149
|
-
if (
|
|
1150
|
-
const s =
|
|
1190
|
+
}, [e, z]), j(() => {
|
|
1191
|
+
const a = it.current;
|
|
1192
|
+
if (it.current = B, B <= a) return;
|
|
1193
|
+
const s = rt.current;
|
|
1151
1194
|
if (!s) return;
|
|
1152
|
-
const h =
|
|
1153
|
-
if (
|
|
1195
|
+
const h = v.some((C) => C.minBundleSize === B), w = v.find((C) => C.minBundleSize > B), _ = w && h ? w.minBundleSize - 1 : w ? null : B - 1;
|
|
1196
|
+
if (_ == null || _ < 0) return;
|
|
1154
1197
|
const S = requestAnimationFrame(() => {
|
|
1155
|
-
const
|
|
1156
|
-
if (!
|
|
1157
|
-
const
|
|
1158
|
-
if (
|
|
1159
|
-
const
|
|
1160
|
-
s.scrollTo({ left:
|
|
1198
|
+
const C = s.querySelector(`[data-box-slot="${_}"]`);
|
|
1199
|
+
if (!C) return;
|
|
1200
|
+
const O = s.getBoundingClientRect(), re = C.getBoundingClientRect().right - O.right;
|
|
1201
|
+
if (re <= 1) return;
|
|
1202
|
+
const se = Math.max(0, s.scrollWidth - s.clientWidth), xe = Math.min(se, Math.max(0, s.scrollLeft + re));
|
|
1203
|
+
s.scrollTo({ left: xe, behavior: "smooth" });
|
|
1161
1204
|
});
|
|
1162
1205
|
return () => cancelAnimationFrame(S);
|
|
1163
|
-
}, [
|
|
1206
|
+
}, [B, v]), j(() => {
|
|
1164
1207
|
if (!e) return;
|
|
1165
|
-
const a =
|
|
1166
|
-
if (
|
|
1167
|
-
const s =
|
|
1168
|
-
s && (
|
|
1169
|
-
|
|
1170
|
-
},
|
|
1171
|
-
}, [
|
|
1172
|
-
if (!e || !
|
|
1208
|
+
const a = ne.current;
|
|
1209
|
+
if (ne.current = B, B <= a) return;
|
|
1210
|
+
const s = v.find((h) => h.minBundleSize === B);
|
|
1211
|
+
s && (ce(`You received a ${y(s.discountPercent)}% discount!`), oe((h) => h + 1), ye(!0), ae.current != null && window.clearTimeout(ae.current), ae.current = window.setTimeout(() => {
|
|
1212
|
+
ye(!1), ae.current = null;
|
|
1213
|
+
}, Ee));
|
|
1214
|
+
}, [B, e, v]), j(() => {
|
|
1215
|
+
if (!e || !le || !we) return;
|
|
1173
1216
|
const a = requestAnimationFrame(() => {
|
|
1174
|
-
var
|
|
1175
|
-
const s =
|
|
1176
|
-
x:
|
|
1217
|
+
var O;
|
|
1218
|
+
const s = ie.current, h = s == null ? void 0 : s.getBoundingClientRect(), w = (O = qe.current) == null ? void 0 : O.getBoundingClientRect(), _ = h ? h.left + h.width / 2 : w ? w.left + w.width / 2 : window.innerWidth / 2, S = h ? h.top + h.height / 2 : w ? w.top + w.height / 2 : window.innerHeight / 2, C = {
|
|
1219
|
+
x: _ - 2,
|
|
1177
1220
|
y: S - 2,
|
|
1178
1221
|
w: 4,
|
|
1179
1222
|
h: 4
|
|
1180
1223
|
};
|
|
1181
|
-
|
|
1182
|
-
|
|
1224
|
+
te(C), ke((X) => X + 1), Se(!0), ee.current != null && window.clearTimeout(ee.current), ee.current = window.setTimeout(() => {
|
|
1225
|
+
Se(!1), ee.current = null;
|
|
1183
1226
|
}, Be);
|
|
1184
1227
|
});
|
|
1185
1228
|
return () => cancelAnimationFrame(a);
|
|
1186
|
-
}, [
|
|
1229
|
+
}, [_e, we, Be, le, e]), j(() => {
|
|
1187
1230
|
var a;
|
|
1188
1231
|
e && ((a = qe.current) == null || a.focus());
|
|
1189
|
-
}, [e]),
|
|
1232
|
+
}, [e]), T ? /* @__PURE__ */ k(
|
|
1190
1233
|
"div",
|
|
1191
1234
|
{
|
|
1192
1235
|
role: "dialog",
|
|
1193
1236
|
"aria-modal": "true",
|
|
1194
1237
|
"aria-label": "Bundle builder",
|
|
1195
|
-
className: [l.backdrop, e ? l.backdropOpen : l.backdropClosed,
|
|
1238
|
+
className: [l.backdrop, e ? l.backdropOpen : l.backdropClosed, o.className].filter(Boolean).join(" "),
|
|
1196
1239
|
onMouseDown: (a) => {
|
|
1197
1240
|
a.target === a.currentTarget && t();
|
|
1198
1241
|
},
|
|
1199
1242
|
children: [
|
|
1200
|
-
|
|
1201
|
-
|
|
1243
|
+
Ae && be && Y.width > 0 && Y.height > 0 ? /* @__PURE__ */ f(
|
|
1244
|
+
$t,
|
|
1202
1245
|
{
|
|
1203
|
-
width:
|
|
1204
|
-
height:
|
|
1205
|
-
confettiSource:
|
|
1246
|
+
width: Y.width,
|
|
1247
|
+
height: Y.height,
|
|
1248
|
+
confettiSource: be,
|
|
1206
1249
|
colors: d,
|
|
1207
1250
|
recycle: !1,
|
|
1208
1251
|
numberOfPieces: 70,
|
|
@@ -1214,40 +1257,40 @@ function yr(i) {
|
|
|
1214
1257
|
},
|
|
1215
1258
|
ze
|
|
1216
1259
|
) : null,
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
|
|
1219
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ k("aside", { ref: qe, className: [l.panel, e ? l.panelOpen : l.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
|
|
1261
|
+
le && we ? /* @__PURE__ */ f("div", { className: l.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ f("div", { ref: ie, className: l.celebrationChip, children: we }, _e) }) : null,
|
|
1262
|
+
/* @__PURE__ */ k("header", { className: [l.header, z ? l.headerSearchOpen : null].filter(Boolean).join(" "), children: [
|
|
1220
1263
|
/* @__PURE__ */ f(
|
|
1221
1264
|
"button",
|
|
1222
1265
|
{
|
|
1223
1266
|
type: "button",
|
|
1224
1267
|
className: l.searchIconButton,
|
|
1225
|
-
"aria-label":
|
|
1226
|
-
"aria-expanded":
|
|
1268
|
+
"aria-label": z ? "Search (expanded)" : "Search",
|
|
1269
|
+
"aria-expanded": z,
|
|
1227
1270
|
onClick: () => {
|
|
1228
|
-
|
|
1271
|
+
F(!0);
|
|
1229
1272
|
},
|
|
1230
1273
|
children: /* @__PURE__ */ f(Yt, { size: 18, "aria-hidden": "true" })
|
|
1231
1274
|
}
|
|
1232
1275
|
),
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */ f("div", { className: l.headerTitleWrap, "aria-hidden":
|
|
1235
|
-
/* @__PURE__ */ f("div", { className: l.headerSearchWrap, "aria-hidden": !
|
|
1276
|
+
/* @__PURE__ */ k("div", { className: l.headerCenter, children: [
|
|
1277
|
+
/* @__PURE__ */ f("div", { className: l.headerTitleWrap, "aria-hidden": z, children: /* @__PURE__ */ f("h2", { className: l.title, children: K }) }),
|
|
1278
|
+
/* @__PURE__ */ f("div", { className: l.headerSearchWrap, "aria-hidden": !z, children: /* @__PURE__ */ k("div", { className: l.searchBar, children: [
|
|
1236
1279
|
/* @__PURE__ */ f(
|
|
1237
1280
|
"input",
|
|
1238
1281
|
{
|
|
1239
1282
|
ref: m,
|
|
1240
1283
|
className: l.searchInput,
|
|
1241
1284
|
type: "search",
|
|
1242
|
-
value:
|
|
1285
|
+
value: V,
|
|
1243
1286
|
placeholder: "Search",
|
|
1244
|
-
onChange: (a) =>
|
|
1287
|
+
onChange: (a) => Ie(a.target.value),
|
|
1245
1288
|
onBlur: () => {
|
|
1246
|
-
|
|
1289
|
+
V.trim() === "" && F(!1);
|
|
1247
1290
|
}
|
|
1248
1291
|
}
|
|
1249
1292
|
),
|
|
1250
|
-
|
|
1293
|
+
V.trim() ? /* @__PURE__ */ f(
|
|
1251
1294
|
"button",
|
|
1252
1295
|
{
|
|
1253
1296
|
type: "button",
|
|
@@ -1257,7 +1300,7 @@ function yr(i) {
|
|
|
1257
1300
|
},
|
|
1258
1301
|
onClick: () => {
|
|
1259
1302
|
var a;
|
|
1260
|
-
|
|
1303
|
+
Ie(""), (a = m.current) == null || a.focus();
|
|
1261
1304
|
},
|
|
1262
1305
|
"aria-label": "Clear search",
|
|
1263
1306
|
children: "Clear"
|
|
@@ -1267,40 +1310,40 @@ function yr(i) {
|
|
|
1267
1310
|
] }),
|
|
1268
1311
|
/* @__PURE__ */ f("button", { type: "button", onClick: t, disabled: r, className: l.closeButton, "aria-label": "Close", children: "×" })
|
|
1269
1312
|
] }),
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
|
|
1313
|
+
/* @__PURE__ */ k("div", { className: l.body, ref: nt, children: [
|
|
1314
|
+
i ? /* @__PURE__ */ f("p", { className: l.muted, children: "Loading…" }) : null,
|
|
1272
1315
|
n ? /* @__PURE__ */ f("p", { className: l.error, children: n }) : null,
|
|
1273
|
-
/* @__PURE__ */ f("div", { className: l.variants, children: /* @__PURE__ */ f("ul", { className: l.variantList, children:
|
|
1274
|
-
var
|
|
1275
|
-
const s =
|
|
1276
|
-
return /* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ f("div", { className: l.variants, children: /* @__PURE__ */ f("ul", { className: l.variantList, children: U.map((a) => {
|
|
1317
|
+
var re, se, xe, Ne;
|
|
1318
|
+
const s = H[a.id] ?? 0, h = p(a), w = E(a.selectedOptions), _ = R(a), S = ve, C = Number(a.price), O = S != null && Number.isFinite(S) && S > 0 && Number.isFinite(C), X = O ? Math.round(C * (1 - S / 100) * 100) / 100 : null;
|
|
1319
|
+
return /* @__PURE__ */ k(
|
|
1277
1320
|
"li",
|
|
1278
1321
|
{
|
|
1279
1322
|
className: [l.variantRow, a.availableForSale === !1 && l.variantRowSoldOut].filter(Boolean).join(" "),
|
|
1280
1323
|
"data-variant-row": a.id,
|
|
1281
1324
|
children: [
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
/* @__PURE__ */ f("div", { className: l.variantThumb, "aria-hidden": "true", children: (
|
|
1325
|
+
/* @__PURE__ */ k("div", { className: l.variantLeft, children: [
|
|
1326
|
+
/* @__PURE__ */ f("div", { className: l.variantThumb, "aria-hidden": "true", children: (re = a.image) != null && re.url ? /* @__PURE__ */ f(
|
|
1284
1327
|
"img",
|
|
1285
1328
|
{
|
|
1286
1329
|
className: l.variantThumbImg,
|
|
1287
1330
|
src: a.image.url,
|
|
1288
|
-
alt: a.image.altText ??
|
|
1331
|
+
alt: a.image.altText ?? _,
|
|
1289
1332
|
loading: "lazy"
|
|
1290
1333
|
}
|
|
1291
|
-
) : /* @__PURE__ */ f("div", { className: l.variantThumbFallback, children: ((
|
|
1292
|
-
/* @__PURE__ */
|
|
1334
|
+
) : /* @__PURE__ */ f("div", { className: l.variantThumbFallback, children: ((Ne = (xe = (se = a.product) == null ? void 0 : se.title) == null ? void 0 : xe.slice(0, 1)) == null ? void 0 : Ne.toUpperCase()) ?? "•" }) }),
|
|
1335
|
+
/* @__PURE__ */ k("div", { className: l.variantInfo, children: [
|
|
1293
1336
|
/* @__PURE__ */ f("div", { className: l.variantName, children: h }),
|
|
1294
|
-
|
|
1295
|
-
/* @__PURE__ */
|
|
1296
|
-
|
|
1297
|
-
/* @__PURE__ */ f("span", { className: l.variantPrice, children:
|
|
1298
|
-
|
|
1337
|
+
w ? /* @__PURE__ */ f("div", { className: l.variantMeta, children: w }) : null,
|
|
1338
|
+
/* @__PURE__ */ k("div", { className: l.variantPriceRow, children: [
|
|
1339
|
+
O ? /* @__PURE__ */ f("span", { className: l.variantCompareAt, children: D(Number.isFinite(C) ? C.toFixed(2) : a.price) }) : null,
|
|
1340
|
+
/* @__PURE__ */ f("span", { className: l.variantPrice, children: D(
|
|
1341
|
+
X != null ? X.toFixed(2) : Number.isFinite(C) ? C.toFixed(2) : a.price
|
|
1299
1342
|
) })
|
|
1300
1343
|
] })
|
|
1301
1344
|
] })
|
|
1302
1345
|
] }),
|
|
1303
|
-
a.availableForSale === !1 ? /* @__PURE__ */ f("div", { className: l.soldOutContainer, children: /* @__PURE__ */
|
|
1346
|
+
a.availableForSale === !1 ? /* @__PURE__ */ f("div", { className: l.soldOutContainer, children: /* @__PURE__ */ k("span", { className: l.soldOut, "aria-label": `${_} is sold out`, children: [
|
|
1304
1347
|
"Sold",
|
|
1305
1348
|
/* @__PURE__ */ f("br", {}),
|
|
1306
1349
|
"Out"
|
|
@@ -1308,21 +1351,21 @@ function yr(i) {
|
|
|
1308
1351
|
"button",
|
|
1309
1352
|
{
|
|
1310
1353
|
type: "button",
|
|
1311
|
-
onClick: () =>
|
|
1312
|
-
disabled: r ||
|
|
1354
|
+
onClick: () => M(a.id, 1),
|
|
1355
|
+
disabled: r || ge,
|
|
1313
1356
|
className: l.addToBundleButton,
|
|
1314
|
-
"aria-label": `Add ${
|
|
1357
|
+
"aria-label": `Add ${_} to bundle`,
|
|
1315
1358
|
children: "Add"
|
|
1316
1359
|
}
|
|
1317
|
-
) : /* @__PURE__ */
|
|
1360
|
+
) : /* @__PURE__ */ k("div", { className: l.qtyControls, children: [
|
|
1318
1361
|
/* @__PURE__ */ f(
|
|
1319
1362
|
"button",
|
|
1320
1363
|
{
|
|
1321
1364
|
type: "button",
|
|
1322
|
-
onClick: () =>
|
|
1365
|
+
onClick: () => M(a.id, s - 1),
|
|
1323
1366
|
disabled: r || s <= 0,
|
|
1324
1367
|
className: l.qtyButton,
|
|
1325
|
-
"aria-label": `Decrease ${
|
|
1368
|
+
"aria-label": `Decrease ${_}`,
|
|
1326
1369
|
children: "−"
|
|
1327
1370
|
}
|
|
1328
1371
|
),
|
|
@@ -1331,10 +1374,10 @@ function yr(i) {
|
|
|
1331
1374
|
"button",
|
|
1332
1375
|
{
|
|
1333
1376
|
type: "button",
|
|
1334
|
-
onClick: () =>
|
|
1335
|
-
disabled: r ||
|
|
1377
|
+
onClick: () => M(a.id, s + 1),
|
|
1378
|
+
disabled: r || ge,
|
|
1336
1379
|
className: l.qtyButton,
|
|
1337
|
-
"aria-label": `Increase ${
|
|
1380
|
+
"aria-label": `Increase ${_}`,
|
|
1338
1381
|
children: "+"
|
|
1339
1382
|
}
|
|
1340
1383
|
)
|
|
@@ -1345,29 +1388,29 @@ function yr(i) {
|
|
|
1345
1388
|
);
|
|
1346
1389
|
}) }) })
|
|
1347
1390
|
] }),
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */ f("div", { className: l.boxSummaryWindow, ref:
|
|
1350
|
-
var
|
|
1351
|
-
const h =
|
|
1352
|
-
return /* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ k("footer", { className: l.footer, ref: pe, children: [
|
|
1392
|
+
/* @__PURE__ */ f("div", { className: l.boxSummaryWindow, ref: rt, children: /* @__PURE__ */ f("div", { className: l.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: vt }).map((a, s) => {
|
|
1393
|
+
var re, se, xe, Ne;
|
|
1394
|
+
const h = $e[s], w = gt.get(s), _ = !!h, S = !!w, C = S && !_, O = w ? `${w.discountPercent}% off` : null, X = _ ? h.displayName : `Slot ${s + 1}`;
|
|
1395
|
+
return /* @__PURE__ */ k("div", { "data-box-slot": s, className: l.boxSlot, children: [
|
|
1353
1396
|
/* @__PURE__ */ f(
|
|
1354
1397
|
"div",
|
|
1355
1398
|
{
|
|
1356
1399
|
className: [
|
|
1357
1400
|
l.boxItem,
|
|
1358
|
-
|
|
1401
|
+
_ ? l.boxItemFilled : l.boxItemPlaceholder,
|
|
1359
1402
|
S ? l.boxItemThreshold : null,
|
|
1360
|
-
|
|
1403
|
+
_ ? l.boxItemClickable : null
|
|
1361
1404
|
].filter(Boolean).join(" "),
|
|
1362
|
-
role:
|
|
1363
|
-
tabIndex:
|
|
1364
|
-
onClick:
|
|
1365
|
-
onKeyDown:
|
|
1405
|
+
role: _ ? "button" : void 0,
|
|
1406
|
+
tabIndex: _ ? 0 : void 0,
|
|
1407
|
+
onClick: _ ? () => ot(h.id) : void 0,
|
|
1408
|
+
onKeyDown: _ ? (Ue) => {
|
|
1366
1409
|
(Ue.key === "Enter" || Ue.key === " ") && (Ue.preventDefault(), ot(h.id));
|
|
1367
1410
|
} : void 0,
|
|
1368
|
-
"aria-label":
|
|
1369
|
-
title:
|
|
1370
|
-
children:
|
|
1411
|
+
"aria-label": C && O ? `${X}. Unlocks ${O}.` : X,
|
|
1412
|
+
title: C && O ? `${X} • Unlocks ${O}` : X,
|
|
1413
|
+
children: _ ? (re = h.image) != null && re.url ? /* @__PURE__ */ f(
|
|
1371
1414
|
"img",
|
|
1372
1415
|
{
|
|
1373
1416
|
className: l.boxItemImage,
|
|
@@ -1375,40 +1418,40 @@ function yr(i) {
|
|
|
1375
1418
|
alt: h.image.altText ?? h.displayName,
|
|
1376
1419
|
loading: "lazy"
|
|
1377
1420
|
}
|
|
1378
|
-
) : /* @__PURE__ */ f("div", { className: l.boxItemFallback, "aria-hidden": "true", children: ((
|
|
1421
|
+
) : /* @__PURE__ */ f("div", { className: l.boxItemFallback, "aria-hidden": "true", children: ((Ne = (xe = (se = h.product) == null ? void 0 : se.title) == null ? void 0 : xe.slice(0, 1)) == null ? void 0 : Ne.toUpperCase()) ?? "•" }) : C && O ? /* @__PURE__ */ f("div", { className: l.boxItemDiscountText, children: O }) : /* @__PURE__ */ f("div", { className: l.boxItemPlus, "aria-hidden": "true", children: "+" })
|
|
1379
1422
|
}
|
|
1380
1423
|
),
|
|
1381
|
-
S ? /* @__PURE__ */ f("div", { className: l.boxThresholdLabel, children:
|
|
1424
|
+
S ? /* @__PURE__ */ f("div", { className: l.boxThresholdLabel, children: w.label }) : null
|
|
1382
1425
|
] }, s);
|
|
1383
1426
|
}) }) }),
|
|
1384
1427
|
/* @__PURE__ */ f(
|
|
1385
1428
|
"div",
|
|
1386
1429
|
{
|
|
1387
|
-
className: [l.ctaTotalsWrap,
|
|
1388
|
-
"aria-hidden":
|
|
1389
|
-
children: /* @__PURE__ */
|
|
1390
|
-
|
|
1391
|
-
|
|
1430
|
+
className: [l.ctaTotalsWrap, N <= 0 ? l.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
|
|
1431
|
+
"aria-hidden": N > 0,
|
|
1432
|
+
children: /* @__PURE__ */ k("div", { className: l.ctaTotals, "aria-label": "Totals", children: [
|
|
1433
|
+
ve ? /* @__PURE__ */ k("span", { className: l.ctaDiscountBadge, children: [
|
|
1434
|
+
ve,
|
|
1392
1435
|
"% Discount"
|
|
1393
1436
|
] }) : /* @__PURE__ */ f("span", {}),
|
|
1394
|
-
/* @__PURE__ */ f("span", { children:
|
|
1395
|
-
/* @__PURE__ */ f("span", { className: l.ctaTotalsStrike, children:
|
|
1437
|
+
/* @__PURE__ */ f("span", { children: $ ? /* @__PURE__ */ k(xt, { children: [
|
|
1438
|
+
/* @__PURE__ */ f("span", { className: l.ctaTotalsStrike, children: D(he.toFixed(2)) }),
|
|
1396
1439
|
" ",
|
|
1397
|
-
/* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children:
|
|
1398
|
-
] }) : /* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children:
|
|
1440
|
+
/* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children: D(yt.toFixed(2)) })
|
|
1441
|
+
] }) : /* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children: D(he.toFixed(2)) }) })
|
|
1399
1442
|
] })
|
|
1400
1443
|
}
|
|
1401
1444
|
),
|
|
1402
1445
|
(() => {
|
|
1403
1446
|
const a = (c == null ? void 0 : c.ctaButtonMode) || "add_to_cart";
|
|
1404
|
-
return a === "add_to_cart_checkout" ?
|
|
1447
|
+
return a === "add_to_cart_checkout" ? N > 0 ? /* @__PURE__ */ f("button", { type: "button", onClick: Q, disabled: !L, className: l.cta, children: r ? "Adding…" : `Add ${N} more product${N === 1 ? "" : "s"}` }) : /* @__PURE__ */ k("div", { className: `${l.ctaButtonGroup} ${Ve ? l.ctaButtonGroupAnimating : ""}`, children: [
|
|
1405
1448
|
/* @__PURE__ */ f(
|
|
1406
1449
|
"button",
|
|
1407
1450
|
{
|
|
1408
1451
|
type: "button",
|
|
1409
|
-
onClick:
|
|
1410
|
-
disabled: !
|
|
1411
|
-
className: `${l.ctaDualLeft} ${
|
|
1452
|
+
onClick: Q,
|
|
1453
|
+
disabled: !L,
|
|
1454
|
+
className: `${l.ctaDualLeft} ${Ve ? l.ctaDualLeftAnimating : ""}`,
|
|
1412
1455
|
children: /* @__PURE__ */ f("span", { children: r ? "Adding…" : "Add to Basket" })
|
|
1413
1456
|
}
|
|
1414
1457
|
),
|
|
@@ -1416,15 +1459,15 @@ function yr(i) {
|
|
|
1416
1459
|
"button",
|
|
1417
1460
|
{
|
|
1418
1461
|
type: "button",
|
|
1419
|
-
onClick:
|
|
1420
|
-
disabled: !
|
|
1421
|
-
className: `${l.ctaDualRight} ${
|
|
1462
|
+
onClick: J,
|
|
1463
|
+
disabled: !L,
|
|
1464
|
+
className: `${l.ctaDualRight} ${Ve ? l.ctaDualRightAnimating : ""}`,
|
|
1422
1465
|
children: /* @__PURE__ */ f("span", { children: r ? "Processing…" : "Checkout" })
|
|
1423
1466
|
}
|
|
1424
1467
|
)
|
|
1425
|
-
] }) : a === "checkout" ? /* @__PURE__ */ f("button", { type: "button", onClick:
|
|
1468
|
+
] }) : a === "checkout" ? /* @__PURE__ */ f("button", { type: "button", onClick: J, disabled: !L, className: l.cta, children: r ? "Processing…" : N > 0 ? `Add ${N} more product${N === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ f("button", { type: "button", onClick: Q, disabled: !L, className: l.cta, children: r ? "Adding…" : N > 0 ? `Add ${N} more product${N === 1 ? "" : "s"}` : "Add to Basket" });
|
|
1426
1469
|
})(),
|
|
1427
|
-
/* @__PURE__ */
|
|
1470
|
+
/* @__PURE__ */ k("div", { className: l.poweredBy, children: [
|
|
1428
1471
|
"powered by ",
|
|
1429
1472
|
/* @__PURE__ */ f("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
|
|
1430
1473
|
] })
|
|
@@ -1434,19 +1477,19 @@ function yr(i) {
|
|
|
1434
1477
|
}
|
|
1435
1478
|
) : null;
|
|
1436
1479
|
}
|
|
1437
|
-
function Qe(
|
|
1438
|
-
if (
|
|
1439
|
-
return
|
|
1480
|
+
function Qe(o) {
|
|
1481
|
+
if (o != null && o.length)
|
|
1482
|
+
return o.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
|
|
1440
1483
|
}
|
|
1441
|
-
function pt(
|
|
1442
|
-
const e = /\/(\d+)$/.exec(
|
|
1443
|
-
return e ? e[1] :
|
|
1484
|
+
function pt(o) {
|
|
1485
|
+
const e = /\/(\d+)$/.exec(o);
|
|
1486
|
+
return e ? e[1] : o;
|
|
1444
1487
|
}
|
|
1445
|
-
function
|
|
1488
|
+
function fr() {
|
|
1446
1489
|
window.location.reload();
|
|
1447
1490
|
}
|
|
1448
|
-
async function
|
|
1449
|
-
const t = await fetch(
|
|
1491
|
+
async function Fe(o, e) {
|
|
1492
|
+
const t = await fetch(o, {
|
|
1450
1493
|
method: "POST",
|
|
1451
1494
|
headers: {
|
|
1452
1495
|
Accept: "application/json",
|
|
@@ -1455,43 +1498,43 @@ async function De(i, e) {
|
|
|
1455
1498
|
body: JSON.stringify(e)
|
|
1456
1499
|
});
|
|
1457
1500
|
if (!t.ok) {
|
|
1458
|
-
const
|
|
1459
|
-
throw new Error(
|
|
1501
|
+
const i = await t.text().catch(() => "");
|
|
1502
|
+
throw new Error(i || `Cart request failed: ${t.status}`);
|
|
1460
1503
|
}
|
|
1461
1504
|
return t.json().catch(() => null);
|
|
1462
1505
|
}
|
|
1463
|
-
function
|
|
1506
|
+
function gr() {
|
|
1464
1507
|
return {
|
|
1465
|
-
async linesAdd(
|
|
1466
|
-
const e =
|
|
1508
|
+
async linesAdd(o) {
|
|
1509
|
+
const e = o.map((t) => ({
|
|
1467
1510
|
id: pt(t.merchandiseId),
|
|
1468
1511
|
quantity: t.quantity,
|
|
1469
1512
|
properties: Qe(t.attributes)
|
|
1470
1513
|
}));
|
|
1471
|
-
await
|
|
1514
|
+
await Fe("/cart/add.js", { items: e });
|
|
1472
1515
|
},
|
|
1473
|
-
async linesAddForCheckout(
|
|
1474
|
-
const e =
|
|
1516
|
+
async linesAddForCheckout(o) {
|
|
1517
|
+
const e = o.map((t) => ({
|
|
1475
1518
|
id: pt(t.merchandiseId),
|
|
1476
1519
|
quantity: t.quantity,
|
|
1477
1520
|
properties: Qe(t.attributes)
|
|
1478
1521
|
}));
|
|
1479
|
-
await
|
|
1522
|
+
await Fe("/cart/add.js", { items: e });
|
|
1480
1523
|
},
|
|
1481
|
-
async linesUpdate(
|
|
1482
|
-
for (const e of
|
|
1483
|
-
await
|
|
1524
|
+
async linesUpdate(o) {
|
|
1525
|
+
for (const e of o)
|
|
1526
|
+
await Fe("/cart/change.js", {
|
|
1484
1527
|
id: e.id,
|
|
1485
1528
|
quantity: e.quantity,
|
|
1486
1529
|
properties: Qe(e.attributes)
|
|
1487
1530
|
});
|
|
1488
1531
|
},
|
|
1489
|
-
async linesRemove(
|
|
1490
|
-
for (const e of
|
|
1491
|
-
await
|
|
1532
|
+
async linesRemove(o) {
|
|
1533
|
+
for (const e of o)
|
|
1534
|
+
await Fe("/cart/change.js", { id: e, quantity: 0 });
|
|
1492
1535
|
},
|
|
1493
1536
|
openCartUI() {
|
|
1494
|
-
window.setTimeout(() =>
|
|
1537
|
+
window.setTimeout(() => fr(), 0);
|
|
1495
1538
|
},
|
|
1496
1539
|
navigateToCheckout() {
|
|
1497
1540
|
window.location.href = "/checkout";
|
|
@@ -1500,11 +1543,11 @@ function wr() {
|
|
|
1500
1543
|
}
|
|
1501
1544
|
export {
|
|
1502
1545
|
yr as BundleBuilderDrawer,
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1546
|
+
wr as BundleButton,
|
|
1547
|
+
Me as BundleLineAttributeKeys,
|
|
1548
|
+
br as BundleProvider,
|
|
1549
|
+
gr as createLiquidCartAdapter,
|
|
1550
|
+
Ke as useBundleBuilder,
|
|
1551
|
+
_r as useBundleBuilderDrawer
|
|
1509
1552
|
};
|
|
1510
1553
|
//# sourceMappingURL=index.js.map
|