@best-bundles/bundle-ui 0.0.46 → 0.0.49

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/index.js CHANGED
@@ -1,56 +1,59 @@
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_9u5ly_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_9u5ly_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_9u5ly_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_9u5ly_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_9u5ly_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_9u5ly_74{opacity:1}._backdropClosed_9u5ly_78{opacity:0}._panel_9u5ly_82{width:440px;max-width:100%;min-width:0;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_9u5ly_103{animation:_bbSlideInFromRight_9u5ly_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_9u5ly_107{animation:_bbSlideOutToRight_9u5ly_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_9u5ly_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_9u5ly_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_9u5ly_1{transition:none}._celebrationChip_9u5ly_23,._panelOpen_9u5ly_103,._panelClosed_9u5ly_107{animation:none}}._header_9u5ly_146{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_9u5ly_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_9u5ly_163{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_9u5ly_172{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;padding:0}._searchIconButton_9u5ly_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_9u5ly_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_9u5ly_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_9u5ly_199{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_9u5ly_211 ._headerTitleWrap_9u5ly_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_9u5ly_211 ._headerSearchWrap_9u5ly_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_9u5ly_223{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_9u5ly_235{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_9u5ly_235::-webkit-search-cancel-button,._searchInput_9u5ly_235::-webkit-search-decoration,._searchInput_9u5ly_235::-webkit-search-results-button,._searchInput_9u5ly_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_9u5ly_256{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_9u5ly_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_9u5ly_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_9u5ly_278{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;padding:0}._closeButton_9u5ly_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_9u5ly_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_9u5ly_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_9u5ly_195,._headerSearchWrap_9u5ly_199{transition:none}}._body_9u5ly_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_9u5ly_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_9u5ly_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_9u5ly_327{margin-top:4px}._variantList_9u5ly_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._emptyState_9u5ly_339{margin:0;padding:20px 16px;border-radius:var(--bb-border-radius, 12px);border:1px dashed var(--bb-border-color, rgba(17, 24, 39, .12));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));font-size:13px;line-height:1.5;text-align:center}._variantRow_9u5ly_351{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_9u5ly_359{opacity:.65}._variantLeft_9u5ly_363{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_9u5ly_370{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_9u5ly_370:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_9u5ly_370:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_9u5ly_370:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_9u5ly_398{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._stockLimitContainer_9u5ly_406{display:flex;align-items:center;justify-content:center;height:100%;max-width:120px;padding:0 12px}._soldOut_9u5ly_398{align-self:center;text-align:center;color:var(--bb-muted-color, rgba(17, 24, 39));font-size:.9em;font-weight:600;pointer-events:none}._stockLimitNotice_9u5ly_424{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;text-align:center}._variantThumb_9u5ly_433{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_9u5ly_443{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_9u5ly_450{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_9u5ly_460{min-width:0}._variantName_9u5ly_464{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_9u5ly_473{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_9u5ly_481{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_9u5ly_488{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_9u5ly_481{font-size:13px;font-weight:800}._qtyControls_9u5ly_499{display:inline-flex;align-items:center;gap:6px}._qtyControlsWrap_9u5ly_505{display:grid;justify-items:center;gap:4px}._qtyButton_9u5ly_511{padding:0;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_9u5ly_511:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_9u5ly_511:disabled{opacity:.6;cursor:not-allowed}._qtyButton_9u5ly_511:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_9u5ly_537{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_9u5ly_544{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;min-width:0}._poweredBy_9u5ly_552{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_9u5ly_552 a{color:inherit;text-decoration:none}._boxSummaryWindow_9u5ly_564{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;min-width:0;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_9u5ly_564::-webkit-scrollbar{display:none}._boxSummaryRow_9u5ly_582{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_9u5ly_590{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_9u5ly_599{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_9u5ly_611{cursor:pointer}._boxItemClickable_9u5ly_611:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_9u5ly_620{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_9u5ly_631{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_9u5ly_637{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_9u5ly_643{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_9u5ly_651{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_9u5ly_659{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_9u5ly_666{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_9u5ly_673{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_9u5ly_684{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_9u5ly_691{gap:0}._cta_9u5ly_684{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_9u5ly_707{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_9u5ly_719{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_9u5ly_737{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_9u5ly_737>span{opacity:0}._ctaDualRight_9u5ly_750{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_9u5ly_766{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_9u5ly_766>span{opacity:0}._ctaTotals_9u5ly_777{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_9u5ly_785{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));color:var(--bb-tier-text, rgba(29, 78, 216, .95));white-space:nowrap}._ctaTotalsWrap_9u5ly_799{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_9u5ly_812{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_9u5ly_819{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_9u5ly_826{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_9u5ly_799{transition:none}}._cta_9u5ly_684:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_9u5ly_684:disabled{opacity:.6;cursor:not-allowed}._cta_9u5ly_684:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_9u5ly_707:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_9u5ly_707:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_9u5ly_707:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_9u5ly_719:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_9u5ly_719:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_9u5ly_719:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_9u5ly_750:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_9u5ly_750:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_9u5ly_750:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_9u5ly_895{margin-top:8px;font-size:12px;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center}._productGroup_9u5ly_904{display:flex;flex-direction:column;border-radius:12px;border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._productGroupHeader_9u5ly_913{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:10px;align-items:center;padding:8px 10px 8px 8px}._productGroupThumbWrap_9u5ly_921{width:52px;height:52px;flex-shrink:0;border-radius:10px;overflow:hidden;border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08))}._productGroupThumb_9u5ly_921{width:100%;height:100%;object-fit:cover;display:block}._productGroupThumbFallback_9u5ly_937{width:100%;height:100%;background:linear-gradient(135deg,#94a3b84d,#94a3b80d);display:grid;place-items:center;color:#94a3b8cc;font-size:16px;font-weight:700;text-transform:uppercase}._productGroupInfo_9u5ly_949{display:flex;flex-direction:column;gap:5px;min-width:0}._productGroupTitle_9u5ly_956{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._productGroupActions_9u5ly_965{display:grid;align-items:center;justify-items:end;flex-shrink:0}._variantSelect_9u5ly_972{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;width:100%;padding:4px 6px;border-radius:6px;border:1px solid var(--bb-border-strong-color, rgba(15, 23, 42, .15));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-size:12px;font-family:inherit;cursor:pointer;outline:none}._variantSelect_9u5ly_972:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:1px}._variantSelectUnavailable_9u5ly_991{opacity:.6}._qtyActions_9u5ly_995{display:inline-flex;align-items:center;gap:6px}._qtyActionsWrap_9u5ly_1001{display:grid;justify-items:end;gap:4px}._qtyChip_9u5ly_1007{min-width:44px;height:30px;padding:0 2px;border-radius:12px;background:#0f172a14;color:#0f172a;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:3px}._qtyChipInteractive_9u5ly_1022{cursor:pointer}._qtyChipValue_9u5ly_1026{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_9u5ly_1032{margin-bottom:-3px;font-weight:500}._qtyChipClear_9u5ly_1037{width:22px;height:22px;border-radius:999px;border:1px solid rgba(15,23,42,.12);background:#fff;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0;transition:background .16s ease,color .16s ease}._qtyChip_9u5ly_1007:hover ._qtyChipClear_9u5ly_1037{background:#0f172a;color:#fff}._qtyChipClear_9u5ly_1037:disabled{cursor:not-allowed;opacity:.45}._qtyTrash_9u5ly_1061{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._drawerProductGroup_9u5ly_1075{display:flex;flex-direction:column}._selectButton_9u5ly_1081{display:inline-flex!important;align-items:center;gap:5px}._selectButtonChevron_9u5ly_1087{flex-shrink:0;transition:transform .2s ease}._selectButtonChevronOpen_9u5ly_1092{transform:rotate(180deg)}._variantPicker_9u5ly_1097{display:flex;flex-direction:column;background:#f8fafce6;border-top:1px solid var(--bb-border-color, rgba(15, 23, 42, .07))}._variantPickerRow_9u5ly_1104{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px;border:none;border-bottom:1px solid var(--bb-border-color, rgba(15, 23, 42, .06));background:none;color:var(--bb-text-color, #111827);font:inherit;font-size:13px;text-align:left;cursor:pointer;transition:background .12s ease}._variantPickerRow_9u5ly_1104:last-child{border-bottom:none}._variantPickerRow_9u5ly_1104:hover:not(:disabled){background:var( --bb-cta-bg-hover-subtle, color-mix(in srgb, var(--bb-cta-bg-hover, var(--bb-cta-bg, #2563eb)) 8%, transparent) )}._variantPickerRow_9u5ly_1104:disabled{opacity:.4;cursor:not-allowed}._variantPickerRowSelected_9u5ly_1137{background:var( --bb-cta-bg-selected-subtle, color-mix(in srgb, var(--bb-cta-bg-hover, var(--bb-cta-bg, #2563eb)) 6%, transparent) )}._variantPickerLabel_9u5ly_1144{font-weight:600;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPickerPriceGroup_9u5ly_1153{display:flex;align-items:baseline;gap:5px;flex-shrink:0}._variantPickerPrice_9u5ly_1153{font-weight:700;color:var(--bb-text-color, #111827)}._variantPickerCompareAt_9u5ly_1165{font-size:11px;text-decoration:line-through;color:var(--bb-muted-color, rgba(15, 23, 42, .45))}._variantPickerSoldOut_9u5ly_1171{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .45))}._variantPickerCheck_9u5ly_1176{font-size:12px;font-weight:800;color:var(--bb-cta-bg, #2563eb);flex-shrink:0}._drawerSelectedList_9u5ly_1184{display:flex;flex-direction:column;border-top:1px solid var(--bb-border-color, rgba(15, 23, 42, .07))}._drawerSubRow_9u5ly_1190{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px 8px 60px;border-bottom:1px solid var(--bb-border-color, rgba(15, 23, 42, .05))}._drawerSubRow_9u5ly_1190:last-child{border-bottom:none}._drawerSubRowInfo_9u5ly_1203{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}._drawerSubRowName_9u5ly_1211{font-size:13px;font-weight:600;color:var(--bb-text-color, #111827);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width:767px){._backdrop_9u5ly_1{padding:0;justify-content:stretch}._panel_9u5ly_82{width:100%;height:100%;border-radius:0}}._panel_o9snd_2 button,._panel_o9snd_2 input,._panel_o9snd_2 [role=button]{box-sizing:border-box;margin:0}._panel_o9snd_2{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:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));border-radius:var(--bb-panel-radius, 16px);padding:20px;display:grid;gap:14px}._header_o9snd_20{text-align:start}._title_o9snd_24{font-size:22px;margin:0;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))}._status_o9snd_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_o9snd_37{font-size:13px;color:#b91c1c;font-weight:600}._section_o9snd_43{display:grid;gap:6px}._sectionTitle_o9snd_48{text-align:left;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._rules_o9snd_57{display:flex;justify-content:center;gap:6px}._rulesList_o9snd_63{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_o9snd_74{display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 10px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .25));background:var(--bb-tier-bg, rgba(37, 99, 235, .06));color:var(--bb-tier-text, #1f2937)}._ruleMin_o9snd_86{font-weight:600;font-size:13px}._ruleDiscount_o9snd_91{font-weight:700;font-size:13px}._ruleLabel_o9snd_96{font-size:12px;opacity:.7}._rulesVisual_o9snd_101{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_o9snd_108,._rulesLinesRow_o9snd_115{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_o9snd_122{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_o9snd_122:empty{display:flex!important}._rulesLineLabel_o9snd_122{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_o9snd_139{height:1em}._rulesLine_o9snd_115{display:block;width:100%;height:4px;border-radius:999px;background-color:var(--bb-tier-background, rgba(148, 163, 184, .22));transition:background-color .2s ease}._rulesLine_o9snd_115:empty{display:block!important}._rulesLineEmpty_o9snd_156{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_o9snd_160{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_o9snd_164{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_o9snd_172{list-style:none;padding:0;margin:0;display:grid;gap:10px}._emptyState_o9snd_180{margin:0;padding:20px 16px;border-radius:var(--bb-border-radius, 12px);border:1px dashed var(--bb-border-color, rgba(15, 23, 42, .12));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));font-size:13px;line-height:1.5;text-align:center}._variantRow_o9snd_192{display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;align-items:start;padding:8px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-border-color, rgba(15, 23, 42, .08));background:#fff;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease}._variantRowInteractive_o9snd_204{cursor:pointer}._variantRowSelected_o9snd_208{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_o9snd_213{opacity:.65}._variantMedia_o9snd_217{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_o9snd_225{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_o9snd_233{display:flex;flex-direction:column;gap:4px}._variantTitle_o9snd_239{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_o9snd_245{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_o9snd_253{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_o9snd_261{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);background:linear-gradient(135deg,#94a3b84d,#94a3b80d);display:grid;place-items:center;color:#94a3b8cc;font-size:10px;text-transform:uppercase;letter-spacing:.08em}._variantMeta_o9snd_274{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_o9snd_279{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_o9snd_285{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_o9snd_292{display:grid;align-items:end;justify-items:end}._qtyActions_o9snd_298{display:inline-flex;align-items:center;gap:6px}._qtyActionsWrap_o9snd_304{display:grid;justify-items:end;gap:4px}._variantUnavailable_o9snd_310{display:none}._qtyControls_o9snd_314{display:inline-flex;align-items:center;gap:6px;padding:4px;border-radius:999px;border:1px solid var(--bb-border-strong-color, rgba(15, 23, 42, .12));background:#0f172a0a}._qtyButton_o9snd_324{width:30px;height:30px;padding:0;border-radius:999px;border:0;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-size:16px;cursor:pointer;display:grid;place-items:center}._qtyButton_o9snd_324:disabled{cursor:not-allowed;opacity:.4}._qtyButton_o9snd_324:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_o9snd_348{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_o9snd_355{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._stockLimitNotice_o9snd_363{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;text-align:end}._qtyChip_o9snd_372{min-width:44px;height:30px;padding:0 2px;border-radius:var(--bb-border-radius, 12px);background:#0f172a14;color:#0f172a;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:3px}._qtyChipInteractive_o9snd_387{cursor:pointer}._qtyChipValue_o9snd_391{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_o9snd_397{margin-bottom:-3px;font-weight:500}._qtyChipClear_o9snd_402{width:22px;height:22px;border-radius:999px;border:1px solid rgba(15,23,42,.12);background:#fff;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0;transition:background .16s ease,color .16s ease}._qtyChip_o9snd_372:hover ._qtyChipClear_o9snd_402{background:#0f172a;color:#fff}._qtyChipClear_o9snd_402:disabled{cursor:not-allowed;opacity:.45}._qtyChip_o9snd_372:hover ._qtyChipClear_o9snd_402:disabled{background:#fff;color:#0f172a}._qtyTrash_o9snd_431{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_o9snd_443{display:grid;padding-top:6px}._boxSummaryWindow_o9snd_448{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_o9snd_448::-webkit-scrollbar{display:none}._boxSummaryRow_o9snd_462{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_o9snd_470{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_o9snd_479{width:100%;border-radius:var(--bb-border-radius, 12px);position:relative;display:block;-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden}._boxItem_o9snd_479:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_o9snd_496{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_o9snd_502{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))}._boxItemThreshold_o9snd_508{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))}._boxItemClickable_o9snd_516{cursor:pointer}._boxItemClickable_o9snd_516:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_o9snd_525{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;display:block}._boxItemFallback_o9snd_536{position:absolute;top:0;right:0;bottom:0;left:0;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}._boxItemPlus_o9snd_549{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemDiscountText_o9snd_561{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxThresholdLabel_o9snd_574{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}._totalsReveal_o9snd_585{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_o9snd_593{max-height:80px;opacity:1}._ctaTotalsWrap_o9snd_598{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_o9snd_603{opacity:1}._ctaTotals_o9snd_598{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_o9snd_618{padding:4px 8px;border-radius:999px;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));color:var(--bb-tier-text, rgba(30, 64, 175, .9));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));font-size:11px;text-transform:uppercase;letter-spacing:.08em}._ctaTotalsStrike_o9snd_629{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_o9snd_635{font-weight:700;color:#0f172a}._cta_o9snd_598{border:0;border-radius:var(--bb-border-radius, 12px);padding:14px 18px;min-height:44px;font-weight:700;font-size:14px;background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff);cursor:pointer;letter-spacing:.02em;transition:transform .14s ease,box-shadow .14s ease,background .14s ease;box-shadow:0 10px 24px #0f172a40}._cta_o9snd_598:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_o9snd_598:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_o9snd_667{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_o9snd_673,._ctaDualRight_o9snd_674{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_o9snd_673{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_o9snd_674{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_o9snd_673:disabled,._ctaDualRight_o9snd_674:disabled{cursor:not-allowed;opacity:.6}._poweredBy_o9snd_701{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_o9snd_701 a{color:inherit;text-decoration:none;font-weight:700}._productGroup_o9snd_716{display:flex;flex-direction:column;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-border-color, rgba(15, 23, 42, .08));background:#fff;overflow:hidden}._productGroupHeader_o9snd_725{display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:10px;align-items:center;padding:8px 10px 8px 8px}._productGroupThumbWrap_o9snd_733{width:56px;height:56px;flex-shrink:0;border-radius:calc(var(--bb-border-radius, 12px) - 2px);overflow:hidden}._productGroupThumb_o9snd_733{width:100%;height:100%;object-fit:cover;display:block}._productGroupThumbFallback_o9snd_748{width:100%;height:100%;background:linear-gradient(135deg,#94a3b84d,#94a3b80d);display:grid;place-items:center;color:#94a3b8cc;font-size:16px;font-weight:700;text-transform:uppercase}._productGroupInfo_o9snd_760{display:flex;flex-direction:column;gap:5px;min-width:0}._productGroupTitle_o9snd_767{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._productGroupActions_o9snd_776{display:grid;align-items:center;justify-items:end;flex-shrink:0}._selectButton_o9snd_783{display:inline-flex;align-items:center;gap:5px;padding:7px 10px 7px 13px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-border-strong-color, rgba(15, 23, 42, .18));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font:inherit;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap;transition:background .14s ease,border-color .14s ease}._selectButton_o9snd_783:hover{background:#0f172a0a}._selectButtonOpen_o9snd_804{border-color:var(--bb-focus-ring, #2563eb);color:var(--bb-cta-bg, #2563eb)}._selectButtonChevron_o9snd_809{flex-shrink:0;transition:transform .2s ease}._selectButtonOpen_o9snd_804 ._selectButtonChevron_o9snd_809{transform:rotate(180deg)}._variantPicker_o9snd_818{border-top:1px solid var(--bb-border-color, rgba(15, 23, 42, .08));display:flex;flex-direction:column}._variantPickerRow_o9snd_824{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:none;border-bottom:1px solid var(--bb-border-color, rgba(15, 23, 42, .06));background:#f8fafccc;color:var(--bb-text-color, #111827);font:inherit;font-size:13px;text-align:left;cursor:pointer;transition:background .12s ease}._variantPickerRow_o9snd_824:last-child{border-bottom:none}._variantPickerRow_o9snd_824:hover:not(:disabled){background:#2563eb0d}._variantPickerRow_o9snd_824:disabled{opacity:.45;cursor:not-allowed}._variantPickerRowSelected_o9snd_854{background:#2563eb0a}._variantPickerLabel_o9snd_858{font-weight:600;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPickerPrice_o9snd_867{font-weight:700;flex-shrink:0;color:var(--bb-text-color, #111827)}._variantPickerCheck_o9snd_873{font-size:12px;font-weight:800;color:var(--bb-cta-bg, #2563eb);flex-shrink:0}._selectedVariantsList_o9snd_880{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;border-top:1px solid var(--bb-border-color, rgba(15, 23, 42, .08))}._selectedVariantRow_o9snd_889{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid var(--bb-border-color, rgba(15, 23, 42, .06))}._selectedVariantRow_o9snd_889:last-child{border-bottom:none}._selectedVariantInfo_o9snd_902{display:flex;flex-direction:column;gap:2px;min-width:0}._selectedVariantName_o9snd_909{font-size:13px;font-weight:600;color:var(--bb-text-color, #111827);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._selectedVariantPrice_o9snd_918{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .55));font-weight:500}@media(max-width:640px){._panel_o9snd_2{padding:16px}._variantRow_o9snd_192{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_o9snd_314{justify-self:start}._variantDetailsRow_o9snd_245{grid-template-columns:1fr}._productGroupHeader_o9snd_725{grid-template-columns:48px minmax(0,1fr) auto}._productGroupThumbWrap_o9snd_733{width:48px;height:48px}}._panel_mo8go_1{background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, sans-serif);border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));border-radius:var(--bb-panel-radius, 16px);padding:20px;display:grid;gap:14px}._title_mo8go_12{margin:0;font-size:22px;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, sans-serif);color:var(--bb-title-color, var(--bb-text-color, #111827))}._status_mo8go_19{font-size:13px;color:var(--bb-muted-color, rgba(17, 24, 39, .65))}._error_mo8go_24{font-size:13px;font-weight:600;color:#b91c1c}._rules_mo8go_30{display:grid;gap:10px}._rule_mo8go_30{width:100%;border:1px solid var(--bb-border-color, rgba(17, 24, 39, .12));border-radius:14px;background:#fff;padding:0;overflow:hidden}._ruleInput_mo8go_44{position:absolute;opacity:0;pointer-events:none}._ruleLabel_mo8go_50{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:4px!important;padding:14px 16px!important;cursor:pointer!important}._ruleLabelContent_mo8go_59{display:flex;flex-direction:column;justify-content:flex-start;gap:4px}._ruleSelected_mo8go_66{border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:var(--bb-tier-bg, rgba(37, 99, 235, .08))}._ruleTitle_mo8go_71{font-size:16px;font-weight:700;color:var(--bb-title-color, var(--bb-text-color, #111827))}._ruleSubtitle_mo8go_77{font-size:13px;color:var(--bb-tier-text, rgba(29, 78, 216, .95));font-weight:600}._priceRow_mo8go_83{display:inline-flex;align-items:baseline;gap:8px;flex-wrap:wrap}._oldPrice_mo8go_90{font-size:13px;color:var(--bb-muted-color, rgba(17, 24, 39, .65));text-decoration:line-through}._newPrice_mo8go_96{font-size:16px;font-weight:700;color:var(--bb-title-color, var(--bb-text-color, #111827))}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import { jsx as n, jsxs as I, Fragment as ct } from "react/jsx-runtime";
3
- import It, { useCallback as _e, useState as ne, useRef as ie, useEffect as U, useMemo as $, createContext as en, useContext as tn, forwardRef as Yt, createElement as At } from "react";
4
- const Nt = {
2
+ import { jsx as a, jsxs as N, Fragment as bt } from "react/jsx-runtime";
3
+ import Ot, { useCallback as me, useState as X, useRef as re, useEffect as j, useMemo as E, createContext as bn, useContext as fn, forwardRef as ln, createElement as Gt } from "react";
4
+ const Ft = {
5
5
  bundleId: "_bundle_id",
6
6
  bundleConfig: "_bundle_config",
7
7
  bundleSource: "_bundle_source",
8
8
  bundleTitle: "_bundle_title"
9
+ }, pn = {
10
+ pendingActions: "best_bundles_pending_actions",
11
+ redirectedBundleState: "best_bundles_redirected_bundle_state"
9
12
  };
10
- async function nn(a) {
11
- const e = new URL("/api/public/bundle-configs-active", a.apiBaseUrl);
12
- e.searchParams.set("shop", a.shop);
13
+ async function _n(r) {
14
+ const e = new URL("/api/public/bundle-configs-active", r.apiBaseUrl);
15
+ e.searchParams.set("shop", r.shop);
13
16
  const l = await (await fetch(e, {
14
17
  method: "GET",
15
- signal: a.signal,
18
+ signal: r.signal,
16
19
  headers: { "Content-Type": "application/json" }
17
20
  })).json().catch(() => null);
18
21
  return !l || typeof l != "object" ? { ok: !1, error: "Invalid response." } : l;
19
22
  }
20
- async function an(a) {
21
- const e = new URL("/api/public/bundle-config", a.apiBaseUrl);
22
- e.searchParams.set("shop", a.shop), a.configHandle && e.searchParams.set("handle", a.configHandle), a.fresh && e.searchParams.set("fresh", "1");
23
+ async function yn(r) {
24
+ const e = new URL("/api/public/bundle-config", r.apiBaseUrl);
25
+ e.searchParams.set("shop", r.shop), r.configHandle && e.searchParams.set("handle", r.configHandle), r.fresh && e.searchParams.set("fresh", "1");
23
26
  const l = await (await fetch(e, {
24
27
  method: "GET",
25
- signal: a.signal,
28
+ signal: r.signal,
26
29
  headers: { "Content-Type": "application/json" }
27
30
  })).json().catch(() => null);
28
31
  return !l || typeof l != "object" ? { ok: !1, error: "Invalid response." } : l;
29
32
  }
30
- async function rn(a) {
31
- const e = new URL("/api/public/bundle-config-status", a.apiBaseUrl);
32
- e.searchParams.set("shop", a.shop), a.configHandle && e.searchParams.set("handle", a.configHandle);
33
+ async function vn(r) {
34
+ const e = new URL("/api/public/bundle-config-status", r.apiBaseUrl);
35
+ e.searchParams.set("shop", r.shop), r.configHandle && e.searchParams.set("handle", r.configHandle);
33
36
  const l = await (await fetch(e, {
34
37
  method: "GET",
35
- signal: a.signal,
38
+ signal: r.signal,
36
39
  headers: { "Content-Type": "application/json" }
37
40
  })).json().catch(() => null);
38
41
  return !l || typeof l != "object" ? { ok: !1, error: "Invalid response." } : l;
39
42
  }
40
- function Bt(a) {
41
- if (!a || a.availableForSale === !1) return 0;
42
- if (a.inventoryPolicy === "CONTINUE" || a.sellableOnlineQuantity == null) return Number.POSITIVE_INFINITY;
43
- const e = Number(a.sellableOnlineQuantity);
44
- return !Number.isFinite(e) || e <= 0 && a.availableForSale === !0 ? Number.POSITIVE_INFINITY : Math.max(0, Math.floor(e));
43
+ function gt(r) {
44
+ if (!r || r.availableForSale === !1) return 0;
45
+ if (r.inventoryPolicy === "CONTINUE" || r.sellableOnlineQuantity == null) return Number.POSITIVE_INFINITY;
46
+ const e = Number(r.sellableOnlineQuantity);
47
+ return !Number.isFinite(e) || e <= 0 && r.availableForSale === !0 ? Number.POSITIVE_INFINITY : Math.max(0, Math.floor(e));
45
48
  }
46
- const Dt = "bb_anonymous_user_id";
47
- function kt() {
49
+ const Kt = "bb_anonymous_user_id";
50
+ function Mt() {
48
51
  if (typeof window > "u" || typeof localStorage > "u")
49
52
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
50
53
  try {
51
- const a = localStorage.getItem(Dt);
52
- if (a && typeof a == "string" && a.length > 0)
53
- return a;
54
+ const r = localStorage.getItem(Kt);
55
+ if (r && typeof r == "string" && r.length > 0)
56
+ return r;
54
57
  let e;
55
58
  try {
56
59
  const t = globalThis.crypto;
@@ -61,17 +64,17 @@ function kt() {
61
64
  } catch {
62
65
  e = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
63
66
  }
64
- return localStorage.setItem(Dt, e), e;
67
+ return localStorage.setItem(Kt, e), e;
65
68
  } catch {
66
69
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
67
70
  }
68
71
  }
69
- async function st(a, e, t) {
72
+ async function ht(r, e, t) {
70
73
  if (!(typeof window > "u"))
71
74
  try {
72
- const l = new URL(a, window.location.origin);
75
+ const l = new URL(r, window.location.origin);
73
76
  l.searchParams.set("shop", e);
74
- const o = await fetch(l, {
77
+ const s = await fetch(l, {
75
78
  method: "POST",
76
79
  headers: {
77
80
  "Content-Type": "application/json"
@@ -80,15 +83,15 @@ async function st(a, e, t) {
80
83
  // Don't wait for response - fire and forget
81
84
  keepalive: !0
82
85
  });
83
- o.ok || console.warn(
84
- `[Bundle Analytics] Event tracking failed with status ${o.status}:`,
85
- await o.text().catch(() => "Unable to read response")
86
+ s.ok || console.warn(
87
+ `[Bundle Analytics] Event tracking failed with status ${s.status}:`,
88
+ await s.text().catch(() => "Unable to read response")
86
89
  );
87
90
  } catch (l) {
88
91
  console.warn("[Bundle Analytics] Failed to track event:", l);
89
92
  }
90
93
  }
91
- const _t = {
94
+ const Ct = {
92
95
  "bundle.title.default": "Build your bundle",
93
96
  "bundle.loading": "Loading...",
94
97
  "bundle.empty": "Your selected eligible products for bundling will show here",
@@ -134,8 +137,8 @@ const _t = {
134
137
  "bundle.a11y.decrease": "Decrease {{name}}",
135
138
  "bundle.select.variant": "Select",
136
139
  "bundle.stock.sold_out_suffix": "— Sold Out"
137
- }, on = {
138
- ..._t,
140
+ }, wn = {
141
+ ...Ct,
139
142
  "bundle.title.default": "Creez votre bundle",
140
143
  "bundle.loading": "Chargement...",
141
144
  "bundle.empty": "Vos produits eligibles selectionnes pour le bundle apparaitront ici",
@@ -171,8 +174,8 @@ const _t = {
171
174
  "bundle.a11y.decrease": "Diminuer {{name}}",
172
175
  "bundle.select.variant": "Sélectionner",
173
176
  "bundle.stock.sold_out_suffix": "— Rupture de stock"
174
- }, ln = {
175
- ..._t,
177
+ }, gn = {
178
+ ...Ct,
176
179
  "bundle.title.default": "Bundle erstellen",
177
180
  "bundle.loading": "Wird geladen...",
178
181
  "bundle.empty": "Ihre ausgewahlten bundelbaren Produkte werden hier angezeigt",
@@ -208,8 +211,8 @@ const _t = {
208
211
  "bundle.a11y.decrease": "{{name}} verringern",
209
212
  "bundle.select.variant": "Auswählen",
210
213
  "bundle.stock.sold_out_suffix": "— Ausverkauft"
211
- }, sn = {
212
- ..._t,
214
+ }, Nn = {
215
+ ...Ct,
213
216
  "bundle.title.default": "Crea tu bundle",
214
217
  "bundle.loading": "Cargando...",
215
218
  "bundle.empty": "Tus productos elegibles seleccionados para el bundle se mostraran aqui",
@@ -245,26 +248,26 @@ const _t = {
245
248
  "bundle.a11y.decrease": "Disminuir {{name}}",
246
249
  "bundle.select.variant": "Seleccionar",
247
250
  "bundle.stock.sold_out_suffix": "— Agotado"
248
- }, cn = {
249
- en: _t,
250
- fr: on,
251
- de: ln,
252
- es: sn
251
+ }, In = {
252
+ en: Ct,
253
+ fr: wn,
254
+ de: gn,
255
+ es: Nn
253
256
  };
254
- function un(a) {
255
- const e = String(a ?? "").trim().toLowerCase();
257
+ function kn(r) {
258
+ const e = String(r ?? "").trim().toLowerCase();
256
259
  if (!e) return "en";
257
260
  const t = e.split("-")[0] ?? "en";
258
261
  return t === "fr" || t === "de" || t === "en" || t === "es" ? t : "en";
259
262
  }
260
- function dn(a, e, t, l) {
261
- var r;
262
- const o = (l == null ? void 0 : l[e]) ?? ((r = cn[a]) == null ? void 0 : r[e]) ?? _t[e] ?? e;
263
- return t ? Object.entries(t).reduce((p, [b, F]) => p.replaceAll(`{{${b}}}`, String(F)), o) : o;
263
+ function Sn(r, e, t, l) {
264
+ var o;
265
+ const s = (l == null ? void 0 : l[e]) ?? ((o = In[r]) == null ? void 0 : o[e]) ?? Ct[e] ?? e;
266
+ return t ? Object.entries(t).reduce((v, [b, A]) => v.replaceAll(`{{${b}}}`, String(A)), s) : s;
264
267
  }
265
- function ft(a, e, t) {
266
- const l = Number(a);
267
- if (!Number.isFinite(l)) return String(a);
268
+ function It(r, e, t) {
269
+ const l = Number(r);
270
+ if (!Number.isFinite(l)) return String(r);
268
271
  if (e)
269
272
  try {
270
273
  return new Intl.NumberFormat(t || void 0, { style: "currency", currency: e }).format(l);
@@ -272,23 +275,23 @@ function ft(a, e, t) {
272
275
  }
273
276
  return `$${l.toFixed(2)}`;
274
277
  }
275
- function ut(a, e) {
278
+ function ft(r, e) {
276
279
  const t = e === 1 ? "one" : "many";
277
- return a === "fr" ? t === "one" ? "produit" : "produits" : a === "de" ? t === "one" ? "Produkt" : "Produkte" : a === "es" ? t === "one" ? "producto" : "productos" : t === "one" ? "product" : "products";
280
+ return r === "fr" ? t === "one" ? "produit" : "produits" : r === "de" ? t === "one" ? "Produkt" : "Produkte" : r === "es" ? t === "one" ? "producto" : "productos" : t === "one" ? "product" : "products";
278
281
  }
279
- const Kt = en(null), dt = "#best-bundles", mn = [];
280
- function Je(a) {
281
- const e = String(a ?? "").trim().toLowerCase();
282
+ const cn = bn(null), kt = "#best-bundles", Cn = [];
283
+ function Ze(r) {
284
+ const e = String(r ?? "").trim().toLowerCase();
282
285
  return e && e.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
283
286
  }
284
- function $t(a) {
285
- const e = String(a ?? "").trim().toLowerCase();
286
- if (!e.startsWith(dt)) return null;
287
- if (e === dt) return "default";
288
- const t = `${dt}:`;
289
- return e.startsWith(t) ? Je(e.slice(t.length)) : null;
287
+ function Jt(r) {
288
+ const e = String(r ?? "").trim().toLowerCase();
289
+ if (!e.startsWith(kt)) return null;
290
+ if (e === kt) return "default";
291
+ const t = `${kt}:`;
292
+ return e.startsWith(t) ? Ze(e.slice(t.length)) : null;
290
293
  }
291
- const hn = {
294
+ const xn = {
292
295
  primaryColor: "--bb-cta-bg",
293
296
  primaryHoverColor: "--bb-cta-bg-hover",
294
297
  primaryTextColor: "--bb-cta-text",
@@ -310,764 +313,878 @@ const hn = {
310
313
  celebrationBorderColor: "--bb-celebration-border",
311
314
  fontFamilyBody: "--bb-font-family-body",
312
315
  fontFamilyTitle: "--bb-font-family-title"
313
- }, Tt = "bb-google-fonts";
314
- function zt(a) {
315
- const e = (a ?? "").trim().replace(/^["']|["']$/g, "");
316
+ }, Et = "bb-google-fonts";
317
+ function Xt(r) {
318
+ const e = (r ?? "").trim().replace(/^["']|["']$/g, "");
316
319
  return e ? encodeURIComponent(e).replace(/%20/g, "+") : "";
317
320
  }
318
- function bn(a) {
321
+ function Pn(r) {
319
322
  var b;
320
323
  if (typeof document > "u" || !document.head) return;
321
- if (!a) {
322
- (b = document.getElementById(Tt)) == null || b.remove();
324
+ if (!r) {
325
+ (b = document.getElementById(Et)) == null || b.remove();
323
326
  return;
324
327
  }
325
- const e = (a.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (a.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), l = [];
326
- e && l.push("family=" + zt(e)), t && t !== e && l.push("family=" + zt(t));
327
- const o = document.getElementById(Tt);
328
+ const e = (r.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (r.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), l = [];
329
+ e && l.push("family=" + Xt(e)), t && t !== e && l.push("family=" + Xt(t));
330
+ const s = document.getElementById(Et);
328
331
  if (l.length === 0) {
329
- o == null || o.remove();
332
+ s == null || s.remove();
330
333
  return;
331
334
  }
332
- const r = `https://fonts.googleapis.com/css2?${l.join("&")}&display=swap`;
333
- if (o) {
334
- o.getAttribute("href") !== r && o.setAttribute("href", r);
335
+ const o = `https://fonts.googleapis.com/css2?${l.join("&")}&display=swap`;
336
+ if (s) {
337
+ s.getAttribute("href") !== o && s.setAttribute("href", o);
335
338
  return;
336
339
  }
337
- const p = document.createElement("link");
338
- p.id = Tt, p.rel = "stylesheet", p.href = r, document.head.appendChild(p);
340
+ const v = document.createElement("link");
341
+ v.id = Et, v.rel = "stylesheet", v.href = o, document.head.appendChild(v);
339
342
  }
340
- function Wt(a) {
341
- if (!a) return;
342
- bn(a);
343
+ function Zt(r) {
344
+ if (!r) return;
345
+ Pn(r);
343
346
  const e = document.documentElement;
344
- Object.entries(hn).forEach(([t, l]) => {
345
- let o = a[t];
346
- o && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(o) && !/^["']/.test(o.trim()) && (o = `"${o.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(l, o));
347
+ Object.entries(xn).forEach(([t, l]) => {
348
+ let s = r[t];
349
+ s && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(s) && !/^["']/.test(s.trim()) && (s = `"${s.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(l, s));
347
350
  });
348
351
  }
349
- function jt(a) {
350
- if (typeof window > "u") return a;
352
+ function en(r) {
353
+ if (typeof window > "u") return r;
351
354
  const e = window.__BUNDLE_PREVIEW_STYLES__;
352
- return e && typeof e == "object" ? e : a;
355
+ return e && typeof e == "object" ? e : r;
353
356
  }
354
- function fn() {
357
+ function jt() {
355
358
  try {
356
- const a = globalThis.crypto;
357
- if (a != null && a.randomUUID) return a.randomUUID();
359
+ const r = globalThis.crypto;
360
+ if (r != null && r.randomUUID) return r.randomUUID();
358
361
  } catch {
359
362
  }
360
363
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
361
364
  }
362
- function xt(a) {
363
- return Number.isFinite(a) ? Math.max(0, Math.floor(a)) : 0;
365
+ function nt(r) {
366
+ return Number.isFinite(r) ? Math.max(0, Math.floor(r)) : 0;
364
367
  }
365
- function Lt(a, e) {
366
- const t = xt(a);
368
+ function Bn(r, e) {
369
+ const t = nt(r);
367
370
  return Number.isFinite(e) ? Math.min(t, Math.max(0, Math.floor(e))) : t;
368
371
  }
369
- function pn(a, e) {
370
- return !a && !e;
372
+ function xt(r) {
373
+ if (!Array.isArray(r) || !r.length) return;
374
+ const e = r.map((t) => {
375
+ const l = String((t == null ? void 0 : t.key) ?? "").trim();
376
+ return l ? {
377
+ key: l,
378
+ value: String((t == null ? void 0 : t.value) ?? "")
379
+ } : null;
380
+ }).filter(Boolean);
381
+ return e.length ? e : void 0;
382
+ }
383
+ function Tn(r) {
384
+ const e = xt(r);
385
+ return e != null && e.length ? JSON.stringify(
386
+ [...e].sort((t, l) => t.key.localeCompare(l.key) || t.value.localeCompare(l.value))
387
+ ) : "";
388
+ }
389
+ function tn(r, e) {
390
+ return {
391
+ id: jt(),
392
+ merchandiseId: r,
393
+ quantity: 1,
394
+ attributes: xt(e)
395
+ };
396
+ }
397
+ function Ln(r) {
398
+ return {
399
+ lines: r.map((e) => {
400
+ var t;
401
+ return {
402
+ id: e.id,
403
+ merchandiseId: e.merchandiseId,
404
+ quantity: nt(e.quantity || 1) || 1,
405
+ ...(t = e.attributes) != null && t.length ? { attributes: xt(e.attributes) } : {}
406
+ };
407
+ })
408
+ };
409
+ }
410
+ function nn(r) {
411
+ return !r || !Array.isArray(r.lines) ? [] : r.lines.map((e) => {
412
+ const t = String((e == null ? void 0 : e.merchandiseId) ?? "").trim();
413
+ return t ? {
414
+ id: String((e == null ? void 0 : e.id) ?? "").trim() || jt(),
415
+ merchandiseId: t,
416
+ quantity: nt((e == null ? void 0 : e.quantity) || 1) || 1,
417
+ attributes: xt(e == null ? void 0 : e.attributes)
418
+ } : null;
419
+ }).filter(Boolean);
420
+ }
421
+ function Rn(r, e) {
422
+ return !r && !e;
371
423
  }
372
- function Fo(a) {
424
+ function Yo(r) {
373
425
  const {
374
426
  apiBaseUrl: e,
375
427
  shop: t,
376
428
  cartAdapter: l,
377
- configHandle: o = "default",
378
- initialData: r,
379
- configFetcher: p,
429
+ configHandle: s = "default",
430
+ initialData: o,
431
+ configFetcher: v,
380
432
  activeConfigsFetcher: b,
381
- configStatusFetcher: F,
382
- analyticsEndpoint: se,
383
- allowDrawerWhenInactive: q = !1,
384
- locale: Y,
385
- messages: de,
386
- children: W
387
- } = a, ye = un(Y), H = _e((h, w) => dn(ye, h, w, de), [ye, de]), ue = Je(o), v = se ?? `${e}/api/public/bundle-analytics`, ae = pn(q, r), [k, ge] = ne(!1), [z, E] = ne(!1), [me, ce] = ne(null), [xe, Se] = ne(!1), [be, Ve] = ne({}), [Ne, Fe] = ne(ue), [Me, Oe] = ne(() => r ? { [ue]: r } : {}), [he, ke] = ne(ae), [Pe, Ie] = ne(
388
- !ae && !r ? ue : null
389
- ), [tt, Ee] = ne(null), [Le, je] = ne(null), [Ge, Re] = ne(
390
- () => ({ selections: {}, order: [] })
391
- ), nt = ie(null), Ae = ie(null), it = ie(null), Ke = ie(0), ve = ie(Ne), De = ie(Me), $e = ie(he), qe = ie(null), ze = p ?? an, Ue = b ?? nn, m = F ?? rn, f = _e(async () => {
433
+ configStatusFetcher: A,
434
+ analyticsEndpoint: le,
435
+ allowDrawerWhenInactive: K = !1,
436
+ locale: ke,
437
+ messages: ie,
438
+ children: Pe
439
+ } = r, G = kn(ke), U = me((m, n) => Sn(G, m, n, ie), [G, ie]), he = Ze(s), z = le ?? `${e}/api/public/bundle-analytics`, g = Rn(K, o), [Se, I] = X(!1), [q, Q] = X(!1), [Z, ce] = X(null), [Ne, qe] = X(!1), [Be, xe] = X({}), [ee, Ve] = X(he), [Ge, Re] = X(() => o ? { [he]: o } : {}), [Ee, we] = X(g), [ge, Te] = X(
440
+ !g && !o ? he : null
441
+ ), [De, Ke] = X(null), [$e, je] = X(null), [be, Fe] = X(() => []), Ue = re(null), at = re(null), ze = re(null), rt = re(0), ye = re(ee), pe = re(Ge), it = re(Ee), Le = re(null), He = re(!1), We = re(null), Je = v ?? yn, Xe = b ?? _n, ot = A ?? vn, h = me(async () => {
392
442
  if (typeof l.getLineQuantitiesByMerchandiseId != "function") return null;
393
- const h = await l.getLineQuantitiesByMerchandiseId();
394
- return Object.entries(h ?? {}).reduce((w, [S, i]) => {
395
- const s = xt(i);
396
- return s > 0 && (w[S] = s), w;
443
+ const m = await l.getLineQuantitiesByMerchandiseId();
444
+ return Object.entries(m ?? {}).reduce((n, [i, d]) => {
445
+ const p = nt(d);
446
+ return p > 0 && (n[i] = p), n;
397
447
  }, {});
398
- }, [l]), g = _e(async () => {
399
- const h = ++Ke.current;
400
- Se(!0);
448
+ }, [l]), f = me(async () => {
449
+ const m = ++rt.current;
450
+ qe(!0);
401
451
  try {
402
- const w = await f();
403
- return w && h === Ke.current && Ve(w), w;
452
+ const n = await h();
453
+ return n && m === rt.current && xe(n), n;
404
454
  } catch {
405
455
  return null;
406
456
  } finally {
407
- h === Ke.current && Se(!1);
457
+ m === rt.current && qe(!1);
408
458
  }
459
+ }, [h]);
460
+ j(() => {
461
+ ye.current = ee;
462
+ }, [ee]), j(() => {
463
+ pe.current = Ge;
464
+ }, [Ge]), j(() => {
465
+ it.current = Ee;
466
+ }, [Ee]), j(() => {
467
+ f();
409
468
  }, [f]);
410
- U(() => {
411
- ve.current = Ne;
412
- }, [Ne]), U(() => {
413
- De.current = Me;
414
- }, [Me]), U(() => {
415
- $e.current = he;
416
- }, [he]), U(() => {
417
- g();
418
- }, [g]);
419
- const B = _e((h) => {
420
- Fe(Je(h));
421
- }, []), T = _e(() => {
422
- if (v)
469
+ const w = me((m) => {
470
+ Ve(Ze(m));
471
+ }, []), P = me(() => {
472
+ if (z)
423
473
  try {
424
- const h = kt();
425
- st(v, t, {
474
+ const m = Mt();
475
+ ht(z, t, {
426
476
  eventType: "DRAWER_CLOSED",
427
477
  shop: t,
428
- anonymousUserId: h,
478
+ anonymousUserId: m,
429
479
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
430
480
  mixpanelEvent: "bundle_closed"
431
- }).catch((w) => {
432
- console.warn("[Bundle Analytics] Failed to track drawer closed:", w);
481
+ }).catch((n) => {
482
+ console.warn("[Bundle Analytics] Failed to track drawer closed:", n);
433
483
  });
434
- } catch (h) {
435
- console.warn("[Bundle Analytics] Error in close() callback:", h);
484
+ } catch (m) {
485
+ console.warn("[Bundle Analytics] Error in close() callback:", m);
436
486
  }
437
- ge(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(dt) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
438
- }, [v, t]), j = _e(() => {
439
- ge((h) => {
440
- if (h) return h;
441
- if (v)
487
+ I(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(kt) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
488
+ }, [z, t]), R = me(() => {
489
+ I((m) => {
490
+ if (m) return m;
491
+ if (z)
442
492
  try {
443
- const w = kt();
444
- st(v, t, {
493
+ const n = Mt();
494
+ ht(z, t, {
445
495
  eventType: "DRAWER_OPENED",
446
496
  shop: t,
447
- anonymousUserId: w,
497
+ anonymousUserId: n,
448
498
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
449
499
  mixpanelEvent: "bundle_opened"
450
- }).catch((S) => {
451
- console.warn("[Bundle Analytics] Failed to track drawer opened:", S);
500
+ }).catch((i) => {
501
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", i);
452
502
  });
453
- } catch (w) {
454
- console.warn("[Bundle Analytics] Error in open() callback:", w);
503
+ } catch (n) {
504
+ console.warn("[Bundle Analytics] Error in open() callback:", n);
455
505
  }
456
506
  return !0;
457
507
  });
458
- }, [v, t]), K = _e((h, w) => w.ok ? w.config.isActive === !1 && !q ? (Oe((S) => {
459
- if (!S[h]) return S;
460
- const i = { ...S };
461
- return delete i[h], i;
462
- }), ve.current === h && (ce(H("bundle.provider.inactive_error")), ge(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(dt) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (Oe((S) => ({
463
- ...S,
464
- [h]: {
465
- currencyCode: w.currencyCode ?? null,
466
- config: w.config,
467
- eligibleVariants: w.eligibleVariants ?? []
508
+ }, [z, t]), V = me((m, n) => n.ok ? n.config.isActive === !1 && !K ? (Re((i) => {
509
+ if (!i[m]) return i;
510
+ const d = { ...i };
511
+ return delete d[m], d;
512
+ }), ye.current === m && (ce(U("bundle.provider.inactive_error")), I(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(kt) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (Re((i) => ({
513
+ ...i,
514
+ [m]: {
515
+ currencyCode: n.currencyCode ?? null,
516
+ config: n.config,
517
+ eligibleVariants: n.eligibleVariants ?? []
468
518
  }
469
- })), ve.current === h && ce(null), !0) : (Oe((S) => {
470
- if (!S[h]) return S;
471
- const i = { ...S };
472
- return delete i[h], i;
473
- }), !q && ve.current === h && (ce(w.ok ? H("bundle.provider.inactive_error") : w.error || H("bundle.provider.load_error")), ge(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(dt) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1), [q, H]), N = _e((h, w) => {
474
- var s;
475
- const S = Je(h);
476
- (s = Ae.current) == null || s.abort();
477
- const i = new AbortController();
478
- Ae.current = i, w != null && w.blocking && Ie(S), ce(null), ze({
519
+ })), ye.current === m && ce(null), !0) : (Re((i) => {
520
+ if (!i[m]) return i;
521
+ const d = { ...i };
522
+ return delete d[m], d;
523
+ }), !K && ye.current === m && (ce(n.error || U("bundle.provider.load_error")), I(!1)), !1), [K, U]), T = me((m, n) => {
524
+ var p;
525
+ const i = Ze(m);
526
+ (p = at.current) == null || p.abort();
527
+ const d = new AbortController();
528
+ at.current = d, n != null && n.blocking && Te(i), ce(null), Je({
479
529
  apiBaseUrl: e,
480
530
  shop: t,
481
- configHandle: S,
482
- fresh: (w == null ? void 0 : w.blocking) === !0 && !De.current[S],
483
- signal: i.signal
484
- }).then((d) => {
485
- i.signal.aborted || K(S, d);
486
- }).catch((d) => {
487
- if (i.signal.aborted) return;
488
- const y = d instanceof Error ? d.message : H("bundle.provider.load_error");
489
- ve.current === S && ce(y);
531
+ configHandle: i,
532
+ fresh: (n == null ? void 0 : n.blocking) === !0 && !pe.current[i],
533
+ signal: d.signal
534
+ }).then((y) => {
535
+ d.signal.aborted || V(i, y);
536
+ }).catch((y) => {
537
+ if (d.signal.aborted) return;
538
+ const x = y instanceof Error ? y.message : U("bundle.provider.load_error");
539
+ ye.current === i && ce(x);
490
540
  }).finally(() => {
491
- i.signal.aborted || Ie((d) => d === S ? null : d);
541
+ d.signal.aborted || Te((y) => y === i ? null : y);
492
542
  });
493
- }, [e, K, ze, t, H]), A = _e((h) => {
494
- const w = Je(h), S = De.current[w];
495
- Fe(w), ce(null), N(w, { blocking: !S });
496
- }, [N]), V = _e((h, w = "api") => {
497
- var d, y;
498
- const S = Je(h), i = De.current[S];
499
- if (ae && $e.current && !i) {
500
- je({ handle: S, source: w });
543
+ }, [e, V, Je, t, U]), k = me((m) => {
544
+ const n = Ze(m), i = pe.current[n];
545
+ Ve(n), ce(null), T(n, { blocking: !i });
546
+ }, [T]), L = me((m, n = "api") => {
547
+ var y, x;
548
+ const i = Ze(m), d = pe.current[i];
549
+ if (g && it.current && !d) {
550
+ je({ handle: i, source: n });
501
551
  return;
502
552
  }
503
- if (Fe(S), q) {
504
- j(), N(S, { blocking: !i });
553
+ if (Ve(i), K) {
554
+ R(), T(i, { blocking: !d });
505
555
  return;
506
556
  }
507
- if ((d = i == null ? void 0 : i.config) != null && d.isActive) {
508
- ce(null), j(), N(S, { blocking: !1 });
557
+ if ((y = d == null ? void 0 : d.config) != null && y.isActive) {
558
+ ce(null), R(), T(i, { blocking: !1 });
509
559
  return;
510
560
  }
511
- Ee(S), (y = it.current) == null || y.abort();
512
- const s = new AbortController();
513
- it.current = s, m({
561
+ Ke(i), (x = ze.current) == null || x.abort();
562
+ const p = new AbortController();
563
+ ze.current = p, ot({
514
564
  apiBaseUrl: e,
515
565
  shop: t,
516
- configHandle: S,
517
- signal: s.signal
518
- }).then((C) => {
519
- if (!s.signal.aborted) {
520
- if (Ee((M) => M === S ? null : M), !C.ok || C.isActive !== !0) {
521
- w === "hash" && typeof window < "u" && $t(window.location.hash) === S && window.history.replaceState(null, "", window.location.pathname + window.location.search);
566
+ configHandle: i,
567
+ signal: p.signal
568
+ }).then((S) => {
569
+ if (!p.signal.aborted) {
570
+ if (Ke((_) => _ === i ? null : _), S.ok && S.isActive !== !0) {
571
+ n === "hash" && typeof window < "u" && Jt(window.location.hash) === i && window.history.replaceState(null, "", window.location.pathname + window.location.search);
522
572
  return;
523
573
  }
524
- ce(null), Fe(S), j(), N(S, { blocking: !0 });
574
+ S.ok && (ce(null), Ve(i), R(), T(i, { blocking: !0 }));
525
575
  }
526
576
  }).catch(() => {
527
- s.signal.aborted || Ee((C) => C === S ? null : C);
577
+ p.signal.aborted || Ke((S) => S === i ? null : S);
528
578
  });
529
579
  }, [
530
- q,
580
+ K,
531
581
  e,
532
- j,
533
- N,
582
+ R,
583
+ T,
534
584
  t,
535
- m,
536
- ae
537
- ]), oe = _e(() => {
538
- g(), V(ve.current, "api");
539
- }, [V, g]);
540
- U(() => {
541
- qe.current = V;
542
- }, [V]);
543
- const re = _e(() => {
544
- if (k) {
545
- T();
585
+ ot,
586
+ g
587
+ ]), W = me(() => {
588
+ f(), L(ye.current, "api");
589
+ }, [L, f]);
590
+ j(() => {
591
+ Le.current = L;
592
+ }, [L]);
593
+ const te = me(() => {
594
+ if (Se) {
595
+ P();
546
596
  return;
547
597
  }
548
- g(), V(ve.current, "api");
549
- }, [T, k, V, g]);
550
- U(() => {
551
- Fe(Je(o));
552
- }, [o]), U(() => {
553
- var w;
554
- if (!ae) {
555
- ke(!1), r || N(ue, { blocking: !0 });
598
+ f(), L(ye.current, "api");
599
+ }, [P, Se, L, f]);
600
+ j(() => {
601
+ Ve(Ze(s));
602
+ }, [s]), j(() => {
603
+ var n;
604
+ if (!g) {
605
+ we(!1), o || T(he, { blocking: !0 });
556
606
  return;
557
607
  }
558
- (w = nt.current) == null || w.abort();
559
- const h = new AbortController();
560
- return nt.current = h, ke(!0), Ue({ apiBaseUrl: e, shop: t, signal: h.signal }).then((S) => {
561
- h.signal.aborted || S.ok && Oe((i) => {
562
- const s = { ...i };
563
- for (const [d, y] of Object.entries(S.configs ?? {}))
564
- s[Je(d)] = {
565
- currencyCode: y.currencyCode ?? null,
566
- config: y.config,
567
- eligibleVariants: y.eligibleVariants ?? []
608
+ (n = Ue.current) == null || n.abort();
609
+ const m = new AbortController();
610
+ return Ue.current = m, we(!0), Xe({ apiBaseUrl: e, shop: t, signal: m.signal }).then((i) => {
611
+ m.signal.aborted || i.ok && Re((d) => {
612
+ const p = { ...d };
613
+ for (const [y, x] of Object.entries(i.configs ?? {}))
614
+ p[Ze(y)] = {
615
+ currencyCode: x.currencyCode ?? null,
616
+ config: x.config,
617
+ eligibleVariants: x.eligibleVariants ?? []
568
618
  };
569
- return s;
619
+ return p;
570
620
  });
571
621
  }).catch(() => {
572
622
  }).finally(() => {
573
- h.signal.aborted || ke(!1);
574
- }), () => h.abort();
575
- }, [Ue, e, r, ue, N, t, ae]), U(() => {
576
- he || !Le || (V(Le.handle, Le.source), je(null));
577
- }, [he, V, Le]), U(() => {
623
+ m.signal.aborted || we(!1);
624
+ }), () => m.abort();
625
+ }, [Xe, e, o, he, T, t, g]), j(() => {
626
+ Ee || !$e || (L($e.handle, $e.source), je(null));
627
+ }, [Ee, L, $e]), j(() => {
578
628
  if (typeof window > "u") return;
579
- const h = () => {
580
- var S;
581
- const w = $t(window.location.hash);
582
- w && ((S = qe.current) == null || S.call(qe, w, "hash"));
629
+ const m = () => {
630
+ var i;
631
+ const n = Jt(window.location.hash);
632
+ n && ((i = Le.current) == null || i.call(Le, n, "hash"));
583
633
  };
584
- return h(), window.addEventListener("hashchange", h), () => window.removeEventListener("hashchange", h);
634
+ return m(), window.addEventListener("hashchange", m), () => window.removeEventListener("hashchange", m);
585
635
  }, []);
586
- const G = Me[Ne] ?? null, x = (G == null ? void 0 : G.config) ?? null, D = (G == null ? void 0 : G.eligibleVariants) ?? mn, ee = (G == null ? void 0 : G.currencyCode) ?? null, Ce = !x && (Pe === Ne || tt === Ne) || q && !x && Pe != null;
587
- U(() => {
588
- const h = jt(x == null ? void 0 : x.styleSettings);
589
- h && Wt(h);
590
- }, [x == null ? void 0 : x.styleSettings]), U(() => {
636
+ const D = Ge[ee] ?? null, C = (D == null ? void 0 : D.config) ?? null, O = (D == null ? void 0 : D.eligibleVariants) ?? Cn, ue = (D == null ? void 0 : D.currencyCode) ?? null, oe = !C && (ge === ee || De === ee) || K && !C && ge != null;
637
+ j(() => {
638
+ const m = en(C == null ? void 0 : C.styleSettings);
639
+ m && Zt(m);
640
+ }, [C == null ? void 0 : C.styleSettings]), j(() => {
591
641
  if (typeof window > "u") return;
592
- const h = () => {
593
- const w = jt(void 0);
594
- w && Wt(w);
642
+ const m = () => {
643
+ const n = en(void 0);
644
+ n && Zt(n);
595
645
  };
596
- return window.addEventListener("bundle-preview-styles-updated", h), () => window.removeEventListener("bundle-preview-styles-updated", h);
597
- }, []), U(() => {
646
+ return window.addEventListener("bundle-preview-styles-updated", m), () => window.removeEventListener("bundle-preview-styles-updated", m);
647
+ }, []), j(() => {
598
648
  if (typeof window > "u") return;
599
- const h = window, w = () => {
600
- const S = h.__BUNDLE_PREVIEW_CONFIG__;
601
- if (!S) return;
602
- const i = Array.isArray(h.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__) ? h.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ : [], s = h.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0;
603
- Oe((d) => {
604
- var y;
649
+ const m = window, n = () => {
650
+ const i = m.__BUNDLE_PREVIEW_CONFIG__;
651
+ if (!i) return;
652
+ const d = Array.isArray(m.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__) ? m.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ : [], p = m.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0;
653
+ Re((y) => {
654
+ var x;
605
655
  return {
606
- ...d,
607
- [ve.current]: {
608
- currencyCode: ee ?? null,
609
- config: S,
610
- eligibleVariants: s ? ((y = d[ve.current]) == null ? void 0 : y.eligibleVariants) ?? [] : i
656
+ ...y,
657
+ [ye.current]: {
658
+ currencyCode: ue ?? null,
659
+ config: i,
660
+ eligibleVariants: p ? ((x = y[ye.current]) == null ? void 0 : x.eligibleVariants) ?? [] : d
611
661
  }
612
662
  };
613
- }), Ie(s ? ve.current : (d) => d === ve.current ? null : d);
663
+ }), Te(p ? ye.current : (y) => y === ye.current ? null : y);
614
664
  };
615
- return h.__BUNDLE_PREVIEW_CONFIG__ && w(), window.addEventListener("bundle-preview-config-updated", w), () => window.removeEventListener("bundle-preview-config-updated", w);
616
- }, [ee]);
617
- const X = $(() => {
618
- const h = Number((x == null ? void 0 : x.maxBundleSize) ?? Number.NaN), w = Number.isFinite(h) ? Math.floor(h) : 100;
619
- return Math.max(2, Math.min(100, w));
620
- }, [x == null ? void 0 : x.maxBundleSize]), He = $(() => new Map(
621
- D.map((h) => {
622
- const w = Bt(h);
623
- if (!Number.isFinite(w)) return [h.id, w];
624
- const S = xt(be[h.id] ?? 0);
625
- return [h.id, Math.max(0, Math.floor(w) - S)];
665
+ return m.__BUNDLE_PREVIEW_CONFIG__ && n(), window.addEventListener("bundle-preview-config-updated", n), () => window.removeEventListener("bundle-preview-config-updated", n);
666
+ }, [ue]);
667
+ const de = E(() => {
668
+ const m = Number((C == null ? void 0 : C.maxBundleSize) ?? Number.NaN), n = Number.isFinite(m) ? Math.floor(m) : 100;
669
+ return Math.max(2, Math.min(100, n));
670
+ }, [C == null ? void 0 : C.maxBundleSize]), J = E(() => new Map(
671
+ O.map((m) => {
672
+ const n = gt(m);
673
+ if (!Number.isFinite(n)) return [m.id, n];
674
+ const i = nt(Be[m.id] ?? 0);
675
+ return [m.id, Math.max(0, Math.floor(n) - i)];
626
676
  })
627
- ), [D, be]), Qe = $(() => new Set(
628
- D.filter((h) => Bt(h) > 0).map((h) => h.id)
629
- ), [D]), Be = $(() => {
630
- const h = (x == null ? void 0 : x.rules) ?? [], w = h.length ? Math.min(...h.map((d) => d.minBundleSize)) : 2, S = Number.isFinite(w) && w > 0 ? w : 2, i = Number((x == null ? void 0 : x.minBundleSize) ?? Number.NaN), s = Number.isFinite(i) && Number.isInteger(i) ? Math.max(2, Math.min(100, i)) : null;
631
- return s == null ? S : Math.min(S, s);
632
- }, [x == null ? void 0 : x.minBundleSize, x == null ? void 0 : x.rules]), vt = _e((h, w) => {
633
- if (xe || !Qe.has(h) && !Ce)
677
+ ), [O, Be]), Ae = E(() => new Set(
678
+ O.filter((m) => gt(m) > 0).map((m) => m.id)
679
+ ), [O]), ne = E(() => {
680
+ const m = (C == null ? void 0 : C.rules) ?? [], n = m.length ? Math.min(...m.map((y) => y.minBundleSize)) : 2, i = Number.isFinite(n) && n > 0 ? n : 2, d = Number((C == null ? void 0 : C.minBundleSize) ?? Number.NaN), p = Number.isFinite(d) && Number.isInteger(d) ? Math.max(2, Math.min(100, d)) : null;
681
+ return p == null ? i : Math.min(i, p);
682
+ }, [C == null ? void 0 : C.minBundleSize, C == null ? void 0 : C.rules]), Qe = me((m) => m.reduce((n, i) => {
683
+ const d = nt(i.quantity || 1) || 1;
684
+ return n[i.merchandiseId] = (n[i.merchandiseId] ?? 0) + d, n;
685
+ }, {}), []), pt = me((m, n) => {
686
+ if (Ne || !Ae.has(m) && !oe)
634
687
  return;
635
- const S = He.get(h) ?? (Ce ? Number.POSITIVE_INFINITY : 0), i = Lt(w, S);
636
- Re((s) => {
637
- const d = s.selections[h] ?? 0, y = i - d, C = Object.values(s.selections).reduce((te, J) => te + (J || 0), 0), M = Number.isFinite(S) ? Math.max(0, Math.floor(S) - d) : y, P = y > 0 ? Math.min(
638
- y,
639
- Math.max(0, X - C),
640
- M
641
- ) : y, _ = d + P;
642
- let R;
643
- if (_ <= 0) {
644
- const te = { ...s.selections };
645
- delete te[h], R = te;
646
- } else d === _ ? R = s.selections : R = { ...s.selections, [h]: _ };
647
- let O = s.order;
648
- if (P > 0)
649
- O = [...s.order, ...Array.from({ length: P }, () => h)];
650
- else if (P < 0) {
651
- let te = -P;
652
- const J = [];
653
- for (let fe = s.order.length - 1; fe >= 0; fe--) {
654
- const L = s.order[fe];
655
- if (L === h && te > 0) {
656
- te--;
688
+ const i = J.get(m) ?? (oe ? Number.POSITIVE_INFINITY : 0), d = Bn(n, i);
689
+ Fe((p) => {
690
+ const y = Qe(p), x = y[m] ?? 0, S = d - x, _ = p.length, F = Number.isFinite(i) ? Math.max(0, Math.floor(i) - x) : S, B = S > 0 ? Math.min(
691
+ S,
692
+ Math.max(0, de - _),
693
+ F
694
+ ) : S;
695
+ if (B === 0) return p;
696
+ let $ = p;
697
+ if (B > 0)
698
+ $ = [...p, ...Array.from({ length: B }, () => tn(m))];
699
+ else {
700
+ let ae = -B;
701
+ const Y = [];
702
+ for (let fe = p.length - 1; fe >= 0; fe--) {
703
+ const Ce = p[fe];
704
+ if (Ce.merchandiseId === m && ae > 0) {
705
+ ae--;
657
706
  continue;
658
707
  }
659
- J.push(L);
708
+ Y.push(Ce);
660
709
  }
661
- J.reverse(), O = J;
710
+ Y.reverse(), $ = Y;
662
711
  }
663
- if (R === s.selections && O === s.order) return s;
664
- const Z = C, le = Object.values(R).reduce((te, J) => te + (J || 0), 0);
665
- if (v)
712
+ const se = Qe($), _e = _, H = $.length;
713
+ if (z)
666
714
  try {
667
- const te = kt(), J = {
715
+ const ae = Mt(), Y = {
668
716
  eventType: "VARIANT_SELECTION_CHANGED",
669
717
  shop: t,
670
- anonymousUserId: te,
671
- before: { ...s.selections },
672
- after: { ...R },
718
+ anonymousUserId: ae,
719
+ before: { ...y },
720
+ after: { ...se },
673
721
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
674
722
  };
675
- st(v, t, J), Z === 0 && le >= 1 && st(v, t, {
676
- ...J,
723
+ ht(z, t, Y), _e === 0 && H >= 1 && ht(z, t, {
724
+ ...Y,
677
725
  mixpanelEvent: "bundle_started"
678
- }), Z < Be && le >= Be && st(v, t, {
679
- ...J,
726
+ }), _e < ne && H >= ne && ht(z, t, {
727
+ ...Y,
680
728
  mixpanelEvent: "bundle_completed"
681
729
  });
682
730
  } catch {
683
731
  }
684
- return { selections: R, order: O };
732
+ return $;
685
733
  });
686
- }, [v, xe, Qe, Ce, X, Be, t, He]);
687
- U(() => {
688
- Ce || Re((h) => {
689
- const w = Object.entries(h.selections).map(([d, y]) => {
690
- if (!Qe.has(d)) return null;
691
- const C = He.get(d) ?? 0, M = Lt(y, C);
692
- return M <= 0 ? null : [d, M];
693
- }).filter(Boolean), S = Object.fromEntries(w), i = new Map(w), s = h.order.filter((d) => {
694
- const y = i.get(d) ?? 0;
695
- return y <= 0 ? !1 : (i.set(d, y - 1), !0);
734
+ }, [z, Ne, Ae, Qe, oe, de, ne, t, J]), et = me((m) => {
735
+ const n = String(m.merchandiseId ?? "").trim();
736
+ if (!n) return !1;
737
+ const i = Ze(m.configHandle ?? ye.current), d = i !== ye.current, p = d ? pe.current[i] : D, y = p ? new Set(
738
+ p.eligibleVariants.filter((H) => gt(H) > 0).map((H) => H.id)
739
+ ) : null;
740
+ if ((!d || y) && !(y ?? Ae).has(n) && !oe)
741
+ return !1;
742
+ const x = m.restoreSnapshot ? nn(m.restoreSnapshot) : null, _ = Qe(x ?? be)[n] ?? 0, F = (() => {
743
+ var Y;
744
+ const H = Number(((Y = p == null ? void 0 : p.config) == null ? void 0 : Y.maxBundleSize) ?? de ?? Number.NaN), ae = Number.isFinite(H) ? Math.floor(H) : 100;
745
+ return Math.max(2, Math.min(100, ae));
746
+ })(), B = (() => {
747
+ if (p) {
748
+ const H = p.eligibleVariants.find((ae) => ae.id === n);
749
+ if (H) {
750
+ const ae = gt(H);
751
+ if (!Number.isFinite(ae)) return Number.POSITIVE_INFINITY;
752
+ const Y = nt(Be[n] ?? 0);
753
+ return Math.max(0, Math.floor(ae) - Y);
754
+ }
755
+ }
756
+ return d || oe ? Number.POSITIVE_INFINITY : 0;
757
+ })();
758
+ if (!((x ?? be).length < F && (!Number.isFinite(B) || _ < Math.max(0, Math.floor(B))))) return !1;
759
+ const _e = [...x ?? be, tn(n, m.attributes)];
760
+ return d && (He.current = !0, We.current = i, Ve(i), ce(null), T(i, { blocking: !pe.current[i] })), Fe(_e), ce(null), R(), !0;
761
+ }, [Be, D, Ae, Qe, oe, de, R, T, be]);
762
+ j(() => {
763
+ const m = We.current === ee && (!D || ge === ee);
764
+ oe || m || Fe((n) => {
765
+ const i = n.filter((d) => {
766
+ if (!Ae.has(d.merchandiseId)) return !1;
767
+ const p = J.get(d.merchandiseId) ?? 0;
768
+ return !Number.isFinite(p) || p > 0;
696
769
  });
697
- return s.length === h.order.length && w.length === Object.keys(h.selections).length && w.every(([d, y]) => h.selections[d] === y) ? h : { selections: S, order: s };
770
+ return i.length <= de ? i.length === n.length ? n : i : i.slice(0, de);
698
771
  });
699
- }, [Qe, Ce, He]), U(() => {
700
- Re({ selections: {}, order: [] });
701
- }, [Ne]);
702
- const at = _e(() => Re({ selections: {}, order: [] }), []), ot = _e(async () => {
703
- await g();
704
- }, [g]), wt = _e((h) => {
705
- const w = He.get(h);
706
- return w == null || !Number.isFinite(w) ? null : Math.max(0, Math.floor(w));
707
- }, [He]), Xe = Ge.selections, lt = Ge.order, Ye = $(() => Object.values(Xe).reduce((h, w) => h + (w || 0), 0), [Xe]), rt = $(() => !(Ce || xe || z || me || !(x != null && x.isActive) || Ye < Be), [Ye, xe, x == null ? void 0 : x.isActive, me, Ce, Be, z]), Ze = _e(async (h) => {
708
- var J, fe;
709
- if (!rt || !x) return;
710
- const w = fn(), S = (x.title ?? "").trim().slice(0, 255), i = await g(), s = new Map(
711
- D.map((L) => {
712
- const Q = Bt(L);
713
- if (!Number.isFinite(Q)) return [L.id, Q];
714
- const pe = xt((i ?? be)[L.id] ?? 0);
715
- return [L.id, Math.max(0, Math.floor(Q) - pe)];
772
+ }, [ge, D, ee, Ae, oe, de, J]), j(() => {
773
+ We.current === ee && D && ge !== ee && (We.current = null);
774
+ }, [ge, D, ee]), j(() => {
775
+ if (He.current) {
776
+ He.current = !1;
777
+ return;
778
+ }
779
+ Fe([]);
780
+ }, [ee]);
781
+ const ut = me(() => Fe([]), []), _t = me(async () => {
782
+ await f();
783
+ }, [f]), dt = me((m) => {
784
+ const n = J.get(m);
785
+ return n == null || !Number.isFinite(n) ? null : Math.max(0, Math.floor(n));
786
+ }, [J]), Bt = E(() => Qe(be), [Qe, be]), Tt = E(() => be.map((m) => m.merchandiseId), [be]), Ye = be.length, st = E(() => !(oe || Ne || q || Z || !(C != null && C.isActive) || Ye < ne), [Ye, Ne, C == null ? void 0 : C.isActive, Z, oe, ne, q]), lt = me(() => Ln(be), [be]), mt = me((m) => {
787
+ Fe(nn(m));
788
+ }, []), yt = me((m) => {
789
+ var y, x, S;
790
+ if (typeof window > "u") return;
791
+ const n = (x = (y = m.product) == null ? void 0 : y.handle) == null ? void 0 : x.trim();
792
+ if (!n) return;
793
+ const i = new URLSearchParams(), d = (S = m.id.match(/\/(\d+)$/)) == null ? void 0 : S[1];
794
+ d && i.set("variant", d), i.set("best_bundles_source", "bundle_builder"), i.set("best_bundles_handle", ee);
795
+ try {
796
+ window.sessionStorage.setItem(
797
+ pn.redirectedBundleState,
798
+ JSON.stringify({
799
+ bundleHandle: ee,
800
+ returnUrl: window.location.href,
801
+ snapshot: lt()
802
+ })
803
+ );
804
+ } catch {
805
+ }
806
+ const p = i.toString();
807
+ window.location.href = `/products/${n}${p ? `?${p}` : ""}`;
808
+ }, [ee, lt]), ct = me(async (m) => {
809
+ var fe, Ce;
810
+ if (!st || !C) return;
811
+ const n = jt(), i = (C.title ?? "").trim().slice(0, 255), d = await f(), p = new Map(
812
+ O.map((M) => {
813
+ const ve = gt(M);
814
+ if (!Number.isFinite(ve)) return [M.id, ve];
815
+ const Oe = nt((d ?? Be)[M.id] ?? 0);
816
+ return [M.id, Math.max(0, Math.floor(ve) - Oe)];
716
817
  })
717
- ), d = Object.entries(Xe).map(([L, Q]) => ({
718
- merchandiseId: L,
719
- quantity: Lt(Q, s.get(L) ?? 0)
720
- })).filter((L) => L.quantity > 0).filter((L) => Qe.has(L.merchandiseId)).map((L) => ({
721
- merchandiseId: L.merchandiseId,
722
- quantity: L.quantity,
723
- attributes: [
724
- { key: Nt.bundleId, value: w },
725
- { key: Nt.bundleConfig, value: Ne },
726
- { key: Nt.bundleSource, value: "bundle_builder" },
727
- ...S ? [{ key: Nt.bundleTitle, value: S }] : []
728
- ]
729
- }));
730
- if (!d.length) return;
731
- const y = new Map(D.map((L) => [L.id, L]));
732
- let C = 0;
733
- for (const L of d) {
734
- const Q = L.quantity ?? 0;
735
- if (Q <= 0) continue;
736
- const pe = y.get(L.merchandiseId), We = Number(pe == null ? void 0 : pe.price);
737
- Number.isFinite(We) && (C += We * Q);
818
+ ), y = /* @__PURE__ */ new Map();
819
+ for (const M of be) {
820
+ if (!Ae.has(M.merchandiseId)) continue;
821
+ const ve = p.get(M.merchandiseId) ?? 0, Oe = Array.from(y.values()).filter((Vt) => Vt.merchandiseId === M.merchandiseId).reduce((Vt, hn) => Vt + hn.quantity, 0);
822
+ if (Number.isFinite(ve) && Oe >= ve) continue;
823
+ const Rt = [
824
+ { key: Ft.bundleId, value: n },
825
+ { key: Ft.bundleConfig, value: ee },
826
+ { key: Ft.bundleSource, value: "bundle_builder" },
827
+ ...i ? [{ key: Ft.bundleTitle, value: i }] : [],
828
+ ...xt(M.attributes) ?? []
829
+ ], Qt = `${M.merchandiseId}:${Tn(M.attributes)}`, Yt = y.get(Qt);
830
+ Yt ? Yt.quantity += 1 : y.set(Qt, {
831
+ merchandiseId: M.merchandiseId,
832
+ quantity: 1,
833
+ attributes: Rt
834
+ });
738
835
  }
739
- C = Math.round(C * 100) / 100;
740
- const M = [...x.rules ?? []].sort((L, Q) => L.minBundleSize - Q.minBundleSize);
741
- let P = null;
742
- for (const L of M)
743
- Ye >= L.minBundleSize && (P = L);
744
- const _ = P ? (() => {
745
- const L = Number.parseFloat(P.discountPercent);
746
- return Number.isFinite(L) && L > 0 ? L : null;
747
- })() : null, R = _ ? Math.round(C * (1 - _ / 100) * 100) / 100 : C, O = C - R, Z = d.map((L) => L.merchandiseId), le = (P == null ? void 0 : P.handle) ?? "", te = ((J = P == null ? void 0 : P.label) == null ? void 0 : J.trim()) || "";
748
- E(!0);
836
+ const x = Array.from(y.values());
837
+ if (!x.length) return;
838
+ const S = new Map(O.map((M) => [M.id, M]));
839
+ let _ = 0;
840
+ for (const M of x) {
841
+ const ve = M.quantity ?? 0;
842
+ if (ve <= 0) continue;
843
+ const Oe = S.get(M.merchandiseId), Rt = Number(Oe == null ? void 0 : Oe.price);
844
+ Number.isFinite(Rt) && (_ += Rt * ve);
845
+ }
846
+ _ = Math.round(_ * 100) / 100;
847
+ const F = [...C.rules ?? []].sort((M, ve) => M.minBundleSize - ve.minBundleSize);
848
+ let B = null;
849
+ for (const M of F)
850
+ Ye >= M.minBundleSize && (B = M);
851
+ const $ = B ? (() => {
852
+ const M = Number.parseFloat(B.discountPercent);
853
+ return Number.isFinite(M) && M > 0 ? M : null;
854
+ })() : null, se = $ ? Math.round(_ * (1 - $ / 100) * 100) / 100 : _, _e = _ - se, H = x.map((M) => M.merchandiseId), ae = (B == null ? void 0 : B.handle) ?? "", Y = ((fe = B == null ? void 0 : B.label) == null ? void 0 : fe.trim()) || "";
855
+ Q(!0);
749
856
  try {
750
- if (h != null && h.checkout ? await l.linesAddForCheckout(d) : await l.linesAdd(d), v)
857
+ if (m != null && m.checkout ? await l.linesAddForCheckout(x) : await l.linesAdd(x), z)
751
858
  try {
752
- const L = kt(), Q = !!(h != null && h.checkout);
753
- st(v, t, {
859
+ const M = Mt(), ve = !!(m != null && m.checkout);
860
+ ht(z, t, {
754
861
  eventType: "BUNDLE_ADDED_TO_BASKET",
755
862
  shop: t,
756
- anonymousUserId: L,
757
- bundleId: w,
758
- productVariantIds: Z,
759
- grossPrice: C,
760
- discountedPrice: R,
761
- currency: ee ?? void 0,
762
- discountThresholdIdentifier: le,
763
- discountLabel: te,
764
- discountPercentage: _,
765
- discountedAmount: O,
863
+ anonymousUserId: M,
864
+ bundleId: n,
865
+ productVariantIds: H,
866
+ grossPrice: _,
867
+ discountedPrice: se,
868
+ currency: ue ?? void 0,
869
+ discountThresholdIdentifier: ae,
870
+ discountLabel: Y,
871
+ discountPercentage: $,
872
+ discountedAmount: _e,
766
873
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
767
- checkout: Q,
768
- mixpanelEvent: Q ? "checkout_started_with_bundle" : "bundle_added_to_cart"
874
+ checkout: ve,
875
+ mixpanelEvent: ve ? "checkout_started_with_bundle" : "bundle_added_to_cart"
769
876
  });
770
877
  } catch {
771
878
  }
772
- at(), T(), g(), (fe = h == null ? void 0 : h.onComplete) == null || fe.call(h), ce(null);
773
- } catch (L) {
774
- const Q = L instanceof Error ? L.message : "", pe = /stock|sold out|inventory|insufficient|available|422/i.test(Q);
879
+ ut(), P(), f(), (Ce = m == null ? void 0 : m.onComplete) == null || Ce.call(m), ce(null);
880
+ } catch (M) {
881
+ const ve = M instanceof Error ? M.message : "", Oe = /stock|sold out|inventory|insufficient|available|422/i.test(ve);
775
882
  ce(
776
- H(pe ? "bundle.provider.stock_error" : "bundle.provider.add_error")
777
- ), g();
883
+ U(Oe ? "bundle.provider.stock_error" : "bundle.provider.add_error")
884
+ ), f();
778
885
  } finally {
779
- E(!1);
886
+ Q(!1);
780
887
  }
781
888
  }, [
782
- v,
889
+ z,
783
890
  Ye,
784
- rt,
891
+ st,
785
892
  l,
786
- at,
787
- T,
788
- x,
893
+ ut,
894
+ P,
895
+ C,
896
+ ue,
897
+ Be,
789
898
  ee,
899
+ Ae,
900
+ O,
901
+ f,
790
902
  be,
791
- Ne,
792
- Qe,
793
- D,
794
- g,
795
- Xe,
796
903
  t,
797
- H
798
- ]), mt = _e(async () => {
799
- await Ze({
904
+ U
905
+ ]), vt = me(async () => {
906
+ await ct({
800
907
  onComplete: () => {
801
- var h;
802
- (h = l.openCartUI) == null || h.call(l);
908
+ var m;
909
+ (m = l.openCartUI) == null || m.call(l);
803
910
  }
804
911
  });
805
- }, [l, Ze]), ht = _e(async () => {
806
- await Ze({
912
+ }, [l, ct]), wt = me(async () => {
913
+ await ct({
807
914
  checkout: !0,
808
915
  onComplete: () => {
809
- var h;
810
- (h = l.navigateToCheckout) == null || h.call(l);
916
+ var m;
917
+ (m = l.navigateToCheckout) == null || m.call(l);
811
918
  }
812
919
  });
813
- }, [l, Ze]), gt = $(() => ({
814
- isOpen: k,
815
- open: oe,
816
- openForHandle: V,
817
- close: T,
818
- toggle: re,
819
- currentHandle: Ne,
820
- setConfigHandle: B,
821
- loadHandle: A,
822
- syncCartQuantities: ot,
823
- loading: Ce,
824
- submitting: z,
825
- error: me,
826
- currencyCode: ee,
827
- config: x,
828
- eligibleVariants: D,
829
- selections: Xe,
830
- selectionOrder: lt,
831
- getVariantMaxSelectableQuantity: wt,
832
- setQuantity: vt,
833
- clearSelections: at,
920
+ }, [l, ct]), Lt = E(() => ({
921
+ isOpen: Se,
922
+ open: W,
923
+ openForHandle: L,
924
+ close: P,
925
+ toggle: te,
926
+ currentHandle: ee,
927
+ setConfigHandle: w,
928
+ loadHandle: k,
929
+ syncCartQuantities: _t,
930
+ loading: oe,
931
+ submitting: q,
932
+ error: Z,
933
+ currencyCode: ue,
934
+ config: C,
935
+ eligibleVariants: O,
936
+ selections: Bt,
937
+ selectionOrder: Tt,
938
+ selectedLines: be,
939
+ getVariantMaxSelectableQuantity: dt,
940
+ setQuantity: pt,
941
+ addConfiguredVariant: et,
942
+ getSelectionSnapshot: lt,
943
+ restoreSelectionSnapshot: mt,
944
+ redirectVariantToProductPage: yt,
945
+ clearSelections: ut,
834
946
  bundleSize: Ye,
835
- minRequired: Be,
836
- canSubmit: rt,
837
- submit: mt,
838
- submitAndCheckout: ht,
839
- locale: ye,
840
- t: H
947
+ minRequired: ne,
948
+ canSubmit: st,
949
+ submit: vt,
950
+ submitAndCheckout: wt,
951
+ locale: G,
952
+ t: U
841
953
  }), [
842
954
  Ye,
843
- rt,
844
- at,
845
- T,
846
- x,
955
+ st,
956
+ ut,
957
+ P,
958
+ C,
959
+ ue,
847
960
  ee,
848
- Ne,
849
- D,
850
- me,
851
- k,
852
- Ce,
853
- Be,
961
+ O,
962
+ Z,
963
+ Se,
854
964
  oe,
855
- V,
965
+ ne,
966
+ W,
967
+ L,
968
+ be,
969
+ Tt,
970
+ Bt,
971
+ w,
972
+ k,
973
+ _t,
974
+ dt,
975
+ pt,
976
+ et,
856
977
  lt,
857
- Xe,
858
- B,
859
- A,
860
- ot,
861
- wt,
862
- vt,
863
978
  mt,
864
- ht,
865
- z,
866
- re,
867
- ye,
868
- H
979
+ yt,
980
+ vt,
981
+ wt,
982
+ q,
983
+ te,
984
+ G,
985
+ U
869
986
  ]);
870
- return /* @__PURE__ */ n(Kt.Provider, { value: gt, children: W });
987
+ return /* @__PURE__ */ a(cn.Provider, { value: Lt, children: Pe });
871
988
  }
872
- function yt() {
873
- const a = tn(Kt);
874
- if (!a)
989
+ function Pt() {
990
+ const r = fn(cn);
991
+ if (!r)
875
992
  throw new Error("useBundleBuilder must be used within <BundleProvider />");
876
- return a;
993
+ return r;
877
994
  }
878
- function Mo() {
879
- const { isOpen: a, open: e, close: t, toggle: l } = yt();
880
- return { isOpen: a, open: e, close: t, toggle: l };
995
+ function Ko() {
996
+ const { isOpen: r, open: e, close: t, toggle: l } = Pt();
997
+ return { isOpen: r, open: e, close: t, toggle: l };
881
998
  }
882
- const _n = "_button_18rtl_1", yn = {
883
- button: _n
999
+ const Fn = "_button_18rtl_1", Mn = {
1000
+ button: Fn
884
1001
  };
885
- function Oo(a) {
886
- const { toggle: e, t } = yt();
887
- return /* @__PURE__ */ n(
1002
+ function Jo(r) {
1003
+ const { toggle: e, t } = Pt();
1004
+ return /* @__PURE__ */ a(
888
1005
  "button",
889
1006
  {
890
1007
  type: "button",
891
1008
  onClick: e,
892
- className: [yn.button, a.className].filter(Boolean).join(" "),
893
- children: a.children ?? t("bundle.button.default")
1009
+ className: [Mn.button, r.className].filter(Boolean).join(" "),
1010
+ children: r.children ?? t("bundle.button.default")
894
1011
  }
895
1012
  );
896
1013
  }
897
- var Rt, Gt;
898
- function vn() {
899
- if (Gt) return Rt;
900
- Gt = 1;
901
- var a = {
902
- linear: function(e, t, l, o) {
903
- var r = l - t;
904
- return r * e / o + t;
1014
+ var Dt, an;
1015
+ function An() {
1016
+ if (an) return Dt;
1017
+ an = 1;
1018
+ var r = {
1019
+ linear: function(e, t, l, s) {
1020
+ var o = l - t;
1021
+ return o * e / s + t;
905
1022
  },
906
- easeInQuad: function(e, t, l, o) {
907
- var r = l - t;
908
- return r * (e /= o) * e + t;
1023
+ easeInQuad: function(e, t, l, s) {
1024
+ var o = l - t;
1025
+ return o * (e /= s) * e + t;
909
1026
  },
910
- easeOutQuad: function(e, t, l, o) {
911
- var r = l - t;
912
- return -r * (e /= o) * (e - 2) + t;
1027
+ easeOutQuad: function(e, t, l, s) {
1028
+ var o = l - t;
1029
+ return -o * (e /= s) * (e - 2) + t;
913
1030
  },
914
- easeInOutQuad: function(e, t, l, o) {
915
- var r = l - t;
916
- return (e /= o / 2) < 1 ? r / 2 * e * e + t : -r / 2 * (--e * (e - 2) - 1) + t;
1031
+ easeInOutQuad: function(e, t, l, s) {
1032
+ var o = l - t;
1033
+ return (e /= s / 2) < 1 ? o / 2 * e * e + t : -o / 2 * (--e * (e - 2) - 1) + t;
917
1034
  },
918
- easeInCubic: function(e, t, l, o) {
919
- var r = l - t;
920
- return r * (e /= o) * e * e + t;
1035
+ easeInCubic: function(e, t, l, s) {
1036
+ var o = l - t;
1037
+ return o * (e /= s) * e * e + t;
921
1038
  },
922
- easeOutCubic: function(e, t, l, o) {
923
- var r = l - t;
924
- return r * ((e = e / o - 1) * e * e + 1) + t;
1039
+ easeOutCubic: function(e, t, l, s) {
1040
+ var o = l - t;
1041
+ return o * ((e = e / s - 1) * e * e + 1) + t;
925
1042
  },
926
- easeInOutCubic: function(e, t, l, o) {
927
- var r = l - t;
928
- return (e /= o / 2) < 1 ? r / 2 * e * e * e + t : r / 2 * ((e -= 2) * e * e + 2) + t;
1043
+ easeInOutCubic: function(e, t, l, s) {
1044
+ var o = l - t;
1045
+ return (e /= s / 2) < 1 ? o / 2 * e * e * e + t : o / 2 * ((e -= 2) * e * e + 2) + t;
929
1046
  },
930
- easeInQuart: function(e, t, l, o) {
931
- var r = l - t;
932
- return r * (e /= o) * e * e * e + t;
1047
+ easeInQuart: function(e, t, l, s) {
1048
+ var o = l - t;
1049
+ return o * (e /= s) * e * e * e + t;
933
1050
  },
934
- easeOutQuart: function(e, t, l, o) {
935
- var r = l - t;
936
- return -r * ((e = e / o - 1) * e * e * e - 1) + t;
1051
+ easeOutQuart: function(e, t, l, s) {
1052
+ var o = l - t;
1053
+ return -o * ((e = e / s - 1) * e * e * e - 1) + t;
937
1054
  },
938
- easeInOutQuart: function(e, t, l, o) {
939
- var r = l - t;
940
- return (e /= o / 2) < 1 ? r / 2 * e * e * e * e + t : -r / 2 * ((e -= 2) * e * e * e - 2) + t;
1055
+ easeInOutQuart: function(e, t, l, s) {
1056
+ var o = l - t;
1057
+ return (e /= s / 2) < 1 ? o / 2 * e * e * e * e + t : -o / 2 * ((e -= 2) * e * e * e - 2) + t;
941
1058
  },
942
- easeInQuint: function(e, t, l, o) {
943
- var r = l - t;
944
- return r * (e /= o) * e * e * e * e + t;
1059
+ easeInQuint: function(e, t, l, s) {
1060
+ var o = l - t;
1061
+ return o * (e /= s) * e * e * e * e + t;
945
1062
  },
946
- easeOutQuint: function(e, t, l, o) {
947
- var r = l - t;
948
- return r * ((e = e / o - 1) * e * e * e * e + 1) + t;
1063
+ easeOutQuint: function(e, t, l, s) {
1064
+ var o = l - t;
1065
+ return o * ((e = e / s - 1) * e * e * e * e + 1) + t;
949
1066
  },
950
- easeInOutQuint: function(e, t, l, o) {
951
- var r = l - t;
952
- return (e /= o / 2) < 1 ? r / 2 * e * e * e * e * e + t : r / 2 * ((e -= 2) * e * e * e * e + 2) + t;
1067
+ easeInOutQuint: function(e, t, l, s) {
1068
+ var o = l - t;
1069
+ return (e /= s / 2) < 1 ? o / 2 * e * e * e * e * e + t : o / 2 * ((e -= 2) * e * e * e * e + 2) + t;
953
1070
  },
954
- easeInSine: function(e, t, l, o) {
955
- var r = l - t;
956
- return -r * Math.cos(e / o * (Math.PI / 2)) + r + t;
1071
+ easeInSine: function(e, t, l, s) {
1072
+ var o = l - t;
1073
+ return -o * Math.cos(e / s * (Math.PI / 2)) + o + t;
957
1074
  },
958
- easeOutSine: function(e, t, l, o) {
959
- var r = l - t;
960
- return r * Math.sin(e / o * (Math.PI / 2)) + t;
1075
+ easeOutSine: function(e, t, l, s) {
1076
+ var o = l - t;
1077
+ return o * Math.sin(e / s * (Math.PI / 2)) + t;
961
1078
  },
962
- easeInOutSine: function(e, t, l, o) {
963
- var r = l - t;
964
- return -r / 2 * (Math.cos(Math.PI * e / o) - 1) + t;
1079
+ easeInOutSine: function(e, t, l, s) {
1080
+ var o = l - t;
1081
+ return -o / 2 * (Math.cos(Math.PI * e / s) - 1) + t;
965
1082
  },
966
- easeInExpo: function(e, t, l, o) {
967
- var r = l - t;
968
- return e == 0 ? t : r * Math.pow(2, 10 * (e / o - 1)) + t;
1083
+ easeInExpo: function(e, t, l, s) {
1084
+ var o = l - t;
1085
+ return e == 0 ? t : o * Math.pow(2, 10 * (e / s - 1)) + t;
969
1086
  },
970
- easeOutExpo: function(e, t, l, o) {
971
- var r = l - t;
972
- return e == o ? t + r : r * (-Math.pow(2, -10 * e / o) + 1) + t;
1087
+ easeOutExpo: function(e, t, l, s) {
1088
+ var o = l - t;
1089
+ return e == s ? t + o : o * (-Math.pow(2, -10 * e / s) + 1) + t;
973
1090
  },
974
- easeInOutExpo: function(e, t, l, o) {
975
- var r = l - t;
976
- return e === 0 ? t : e === o ? t + r : (e /= o / 2) < 1 ? r / 2 * Math.pow(2, 10 * (e - 1)) + t : r / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
1091
+ easeInOutExpo: function(e, t, l, s) {
1092
+ var o = l - t;
1093
+ return e === 0 ? t : e === s ? t + o : (e /= s / 2) < 1 ? o / 2 * Math.pow(2, 10 * (e - 1)) + t : o / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
977
1094
  },
978
- easeInCirc: function(e, t, l, o) {
979
- var r = l - t;
980
- return -r * (Math.sqrt(1 - (e /= o) * e) - 1) + t;
1095
+ easeInCirc: function(e, t, l, s) {
1096
+ var o = l - t;
1097
+ return -o * (Math.sqrt(1 - (e /= s) * e) - 1) + t;
981
1098
  },
982
- easeOutCirc: function(e, t, l, o) {
983
- var r = l - t;
984
- return r * Math.sqrt(1 - (e = e / o - 1) * e) + t;
1099
+ easeOutCirc: function(e, t, l, s) {
1100
+ var o = l - t;
1101
+ return o * Math.sqrt(1 - (e = e / s - 1) * e) + t;
985
1102
  },
986
- easeInOutCirc: function(e, t, l, o) {
987
- var r = l - t;
988
- return (e /= o / 2) < 1 ? -r / 2 * (Math.sqrt(1 - e * e) - 1) + t : r / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
1103
+ easeInOutCirc: function(e, t, l, s) {
1104
+ var o = l - t;
1105
+ return (e /= s / 2) < 1 ? -o / 2 * (Math.sqrt(1 - e * e) - 1) + t : o / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
989
1106
  },
990
- easeInElastic: function(e, t, l, o) {
991
- var r = l - t, p, b, F;
992
- return F = 1.70158, b = 0, p = r, e === 0 ? t : (e /= o) === 1 ? t + r : (b || (b = o * 0.3), p < Math.abs(r) ? (p = r, F = b / 4) : F = b / (2 * Math.PI) * Math.asin(r / p), -(p * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * o - F) * (2 * Math.PI) / b)) + t);
1107
+ easeInElastic: function(e, t, l, s) {
1108
+ var o = l - t, v, b, A;
1109
+ return A = 1.70158, b = 0, v = o, e === 0 ? t : (e /= s) === 1 ? t + o : (b || (b = s * 0.3), v < Math.abs(o) ? (v = o, A = b / 4) : A = b / (2 * Math.PI) * Math.asin(o / v), -(v * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * s - A) * (2 * Math.PI) / b)) + t);
993
1110
  },
994
- easeOutElastic: function(e, t, l, o) {
995
- var r = l - t, p, b, F;
996
- return F = 1.70158, b = 0, p = r, e === 0 ? t : (e /= o) === 1 ? t + r : (b || (b = o * 0.3), p < Math.abs(r) ? (p = r, F = b / 4) : F = b / (2 * Math.PI) * Math.asin(r / p), p * Math.pow(2, -10 * e) * Math.sin((e * o - F) * (2 * Math.PI) / b) + r + t);
1111
+ easeOutElastic: function(e, t, l, s) {
1112
+ var o = l - t, v, b, A;
1113
+ return A = 1.70158, b = 0, v = o, e === 0 ? t : (e /= s) === 1 ? t + o : (b || (b = s * 0.3), v < Math.abs(o) ? (v = o, A = b / 4) : A = b / (2 * Math.PI) * Math.asin(o / v), v * Math.pow(2, -10 * e) * Math.sin((e * s - A) * (2 * Math.PI) / b) + o + t);
997
1114
  },
998
- easeInOutElastic: function(e, t, l, o) {
999
- var r = l - t, p, b, F;
1000
- return F = 1.70158, b = 0, p = r, e === 0 ? t : (e /= o / 2) === 2 ? t + r : (b || (b = o * (0.3 * 1.5)), p < Math.abs(r) ? (p = r, F = b / 4) : F = b / (2 * Math.PI) * Math.asin(r / p), e < 1 ? -0.5 * (p * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * o - F) * (2 * Math.PI) / b)) + t : p * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * o - F) * (2 * Math.PI) / b) * 0.5 + r + t);
1115
+ easeInOutElastic: function(e, t, l, s) {
1116
+ var o = l - t, v, b, A;
1117
+ return A = 1.70158, b = 0, v = o, e === 0 ? t : (e /= s / 2) === 2 ? t + o : (b || (b = s * (0.3 * 1.5)), v < Math.abs(o) ? (v = o, A = b / 4) : A = b / (2 * Math.PI) * Math.asin(o / v), e < 1 ? -0.5 * (v * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * s - A) * (2 * Math.PI) / b)) + t : v * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * s - A) * (2 * Math.PI) / b) * 0.5 + o + t);
1001
1118
  },
1002
- easeInBack: function(e, t, l, o, r) {
1003
- var p = l - t;
1004
- return r === void 0 && (r = 1.70158), p * (e /= o) * e * ((r + 1) * e - r) + t;
1119
+ easeInBack: function(e, t, l, s, o) {
1120
+ var v = l - t;
1121
+ return o === void 0 && (o = 1.70158), v * (e /= s) * e * ((o + 1) * e - o) + t;
1005
1122
  },
1006
- easeOutBack: function(e, t, l, o, r) {
1007
- var p = l - t;
1008
- return r === void 0 && (r = 1.70158), p * ((e = e / o - 1) * e * ((r + 1) * e + r) + 1) + t;
1123
+ easeOutBack: function(e, t, l, s, o) {
1124
+ var v = l - t;
1125
+ return o === void 0 && (o = 1.70158), v * ((e = e / s - 1) * e * ((o + 1) * e + o) + 1) + t;
1009
1126
  },
1010
- easeInOutBack: function(e, t, l, o, r) {
1011
- var p = l - t;
1012
- return r === void 0 && (r = 1.70158), (e /= o / 2) < 1 ? p / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : p / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t;
1127
+ easeInOutBack: function(e, t, l, s, o) {
1128
+ var v = l - t;
1129
+ return o === void 0 && (o = 1.70158), (e /= s / 2) < 1 ? v / 2 * (e * e * (((o *= 1.525) + 1) * e - o)) + t : v / 2 * ((e -= 2) * e * (((o *= 1.525) + 1) * e + o) + 2) + t;
1013
1130
  },
1014
- easeInBounce: function(e, t, l, o) {
1015
- var r = l - t, p;
1016
- return p = a.easeOutBounce(o - e, 0, r, o), r - p + t;
1131
+ easeInBounce: function(e, t, l, s) {
1132
+ var o = l - t, v;
1133
+ return v = r.easeOutBounce(s - e, 0, o, s), o - v + t;
1017
1134
  },
1018
- easeOutBounce: function(e, t, l, o) {
1019
- var r = l - t;
1020
- return (e /= o) < 1 / 2.75 ? r * (7.5625 * e * e) + t : e < 2 / 2.75 ? r * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? r * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : r * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
1135
+ easeOutBounce: function(e, t, l, s) {
1136
+ var o = l - t;
1137
+ return (e /= s) < 1 / 2.75 ? o * (7.5625 * e * e) + t : e < 2 / 2.75 ? o * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? o * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : o * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
1021
1138
  },
1022
- easeInOutBounce: function(e, t, l, o) {
1023
- var r = l - t, p;
1024
- return e < o / 2 ? (p = a.easeInBounce(e * 2, 0, r, o), p * 0.5 + t) : (p = a.easeOutBounce(e * 2 - o, 0, r, o), p * 0.5 + r * 0.5 + t);
1139
+ easeInOutBounce: function(e, t, l, s) {
1140
+ var o = l - t, v;
1141
+ return e < s / 2 ? (v = r.easeInBounce(e * 2, 0, o, s), v * 0.5 + t) : (v = r.easeOutBounce(e * 2 - s, 0, o, s), v * 0.5 + o * 0.5 + t);
1025
1142
  }
1026
1143
  };
1027
- return Rt = a, Rt;
1144
+ return Dt = r, Dt;
1028
1145
  }
1029
- var wn = vn();
1030
- function gn(a) {
1031
- return a * Math.PI / 180;
1146
+ var On = An();
1147
+ function qn(r) {
1148
+ return r * Math.PI / 180;
1032
1149
  }
1033
- function Te(a, e) {
1034
- return a + Math.random() * (e - a);
1150
+ function Me(r, e) {
1151
+ return r + Math.random() * (e - r);
1035
1152
  }
1036
- function Nn(a, e) {
1037
- return Math.floor(a + Math.random() * (e - a + 1));
1153
+ function Vn(r, e) {
1154
+ return Math.floor(r + Math.random() * (e - r + 1));
1038
1155
  }
1039
- var pt;
1040
- (function(a) {
1041
- a[a.Circle = 0] = "Circle", a[a.Square = 1] = "Square", a[a.Strip = 2] = "Strip";
1042
- })(pt || (pt = {}));
1043
- var et;
1044
- (function(a) {
1045
- a[a.Positive = 1] = "Positive", a[a.Negative = -1] = "Negative";
1046
- })(et || (et = {}));
1047
- const kn = 1e3 / 60;
1048
- class Cn {
1049
- constructor(e, t, l, o) {
1156
+ var St;
1157
+ (function(r) {
1158
+ r[r.Circle = 0] = "Circle", r[r.Square = 1] = "Square", r[r.Strip = 2] = "Strip";
1159
+ })(St || (St = {}));
1160
+ var tt;
1161
+ (function(r) {
1162
+ r[r.Positive = 1] = "Positive", r[r.Negative = -1] = "Negative";
1163
+ })(tt || (tt = {}));
1164
+ const En = 1e3 / 60;
1165
+ class Dn {
1166
+ constructor(e, t, l, s) {
1050
1167
  this.getOptions = t;
1051
- const { colors: r, initialVelocityX: p, initialVelocityY: b } = this.getOptions();
1052
- this.context = e, this.x = l, this.y = o, this.w = Te(5, 20), this.h = Te(5, 20), this.radius = Te(5, 10), this.vx = typeof p == "number" ? Te(-p, p) : Te(p.min, p.max), this.vy = typeof b == "number" ? Te(-b, 0) : Te(b.min, b.max), this.shape = Nn(0, 2), this.angle = gn(Te(0, 360)), this.angularSpin = Te(-0.2, 0.2), this.color = r[Math.floor(Math.random() * r.length)], this.rotateY = Te(0, 1), this.rotationDirection = Te(0, 1) ? et.Positive : et.Negative;
1168
+ const { colors: o, initialVelocityX: v, initialVelocityY: b } = this.getOptions();
1169
+ this.context = e, this.x = l, this.y = s, this.w = Me(5, 20), this.h = Me(5, 20), this.radius = Me(5, 10), this.vx = typeof v == "number" ? Me(-v, v) : Me(v.min, v.max), this.vy = typeof b == "number" ? Me(-b, 0) : Me(b.min, b.max), this.shape = Vn(0, 2), this.angle = qn(Me(0, 360)), this.angularSpin = Me(-0.2, 0.2), this.color = o[Math.floor(Math.random() * o.length)], this.rotateY = Me(0, 1), this.rotationDirection = Me(0, 1) ? tt.Positive : tt.Negative;
1053
1170
  }
1054
1171
  update(e) {
1055
- const { gravity: t, wind: l, friction: o, opacity: r, drawShape: p } = this.getOptions(), b = e / kn;
1056
- this.x += this.vx * b, this.y += this.vy * b, this.vy += t * b, this.vx += l * b, this.vx *= o ** b, this.vy *= o ** b, this.rotateY >= 1 && this.rotationDirection === et.Positive ? this.rotationDirection = et.Negative : this.rotateY <= -1 && this.rotationDirection === et.Negative && (this.rotationDirection = et.Positive);
1057
- const F = 0.1 * this.rotationDirection * b;
1058
- if (this.rotateY += F, 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 = r, this.context.lineCap = "round", this.context.lineWidth = 2, p && typeof p == "function")
1059
- p.call(this, this.context);
1172
+ const { gravity: t, wind: l, friction: s, opacity: o, drawShape: v } = this.getOptions(), b = e / En;
1173
+ this.x += this.vx * b, this.y += this.vy * b, this.vy += t * b, this.vx += l * b, this.vx *= s ** b, this.vy *= s ** b, this.rotateY >= 1 && this.rotationDirection === tt.Positive ? this.rotationDirection = tt.Negative : this.rotateY <= -1 && this.rotationDirection === tt.Negative && (this.rotationDirection = tt.Positive);
1174
+ const A = 0.1 * this.rotationDirection * b;
1175
+ if (this.rotateY += A, 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 = o, this.context.lineCap = "round", this.context.lineWidth = 2, v && typeof v == "function")
1176
+ v.call(this, this.context);
1060
1177
  else
1061
1178
  switch (this.shape) {
1062
- case pt.Circle: {
1179
+ case St.Circle: {
1063
1180
  this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
1064
1181
  break;
1065
1182
  }
1066
- case pt.Square: {
1183
+ case St.Square: {
1067
1184
  this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
1068
1185
  break;
1069
1186
  }
1070
- case pt.Strip: {
1187
+ case St.Strip: {
1071
1188
  this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
1072
1189
  break;
1073
1190
  }
@@ -1075,31 +1192,31 @@ class Cn {
1075
1192
  this.context.closePath(), this.context.restore();
1076
1193
  }
1077
1194
  }
1078
- class xn {
1195
+ class $n {
1079
1196
  constructor(e, t) {
1080
- 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 = (o) => {
1081
- this.particles.splice(o, 1);
1197
+ 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 = (s) => {
1198
+ this.particles.splice(s, 1);
1082
1199
  }, this.getParticle = () => {
1083
- const o = Te(this.x, this.w + this.x), r = Te(this.y, this.h + this.y);
1084
- return new Cn(this.context, this.getOptions, o, r);
1085
- }, this.animate = (o) => {
1086
- const { canvas: r, context: p, particlesGenerated: b, lastNumberOfPieces: F } = this, { run: se, recycle: q, numberOfPieces: Y, debug: de, tweenFunction: W, tweenDuration: ye } = this.getOptions();
1087
- if (!se)
1200
+ const s = Me(this.x, this.w + this.x), o = Me(this.y, this.h + this.y);
1201
+ return new Dn(this.context, this.getOptions, s, o);
1202
+ }, this.animate = (s) => {
1203
+ const { canvas: o, context: v, particlesGenerated: b, lastNumberOfPieces: A } = this, { run: le, recycle: K, numberOfPieces: ke, debug: ie, tweenFunction: Pe, tweenDuration: G } = this.getOptions();
1204
+ if (!le)
1088
1205
  return !1;
1089
- const H = this.particles.length, ue = q ? H : b;
1090
- if (ue < Y) {
1091
- F !== Y && (this.tweenProgress = 0, this.tweenFrom = ue, this.lastNumberOfPieces = Y), this.tweenProgress = Math.min(ye, Math.max(0, this.tweenProgress + o));
1092
- const v = W(this.tweenProgress, this.tweenFrom, Y, ye), ae = Math.round(v - ue);
1093
- for (let k = 0; k < ae; k++)
1206
+ const U = this.particles.length, he = K ? U : b;
1207
+ if (he < ke) {
1208
+ A !== ke && (this.tweenProgress = 0, this.tweenFrom = he, this.lastNumberOfPieces = ke), this.tweenProgress = Math.min(G, Math.max(0, this.tweenProgress + s));
1209
+ const z = Pe(this.tweenProgress, this.tweenFrom, ke, G), g = Math.round(z - he);
1210
+ for (let Se = 0; Se < g; Se++)
1094
1211
  this.particles.push(this.getParticle());
1095
- this.particlesGenerated += ae;
1212
+ this.particlesGenerated += g;
1096
1213
  }
1097
- de && (p.font = "12px sans-serif", p.fillStyle = "#333", p.textAlign = "right", p.fillText(`Particles: ${H}`, r.width - 10, r.height - 20));
1098
- for (let v = this.particles.length - 1; v >= 0; v--) {
1099
- const ae = this.particles[v];
1100
- ae.update(o), (ae.y > r.height || ae.y < -100 || ae.x > r.width + 100 || ae.x < -100) && (q && ue <= Y ? this.particles[v] = this.getParticle() : this.removeParticleAt(v));
1214
+ ie && (v.font = "12px sans-serif", v.fillStyle = "#333", v.textAlign = "right", v.fillText(`Particles: ${U}`, o.width - 10, o.height - 20));
1215
+ for (let z = this.particles.length - 1; z >= 0; z--) {
1216
+ const g = this.particles[z];
1217
+ g.update(s), (g.y > o.height || g.y < -100 || g.x > o.width + 100 || g.x < -100) && (K && he <= ke ? this.particles[z] = this.getParticle() : this.removeParticleAt(z));
1101
1218
  }
1102
- return H > 0 || ue < Y;
1219
+ return U > 0 || he < ke;
1103
1220
  }, this.canvas = e;
1104
1221
  const l = this.canvas.getContext("2d");
1105
1222
  if (!l)
@@ -1107,7 +1224,7 @@ class xn {
1107
1224
  this.context = l, this.getOptions = t;
1108
1225
  }
1109
1226
  }
1110
- const qt = {
1227
+ const Ut = {
1111
1228
  width: typeof window < "u" ? window.innerWidth : 300,
1112
1229
  height: typeof window < "u" ? window.innerHeight : 200,
1113
1230
  numberOfPieces: 200,
@@ -1137,15 +1254,15 @@ const qt = {
1137
1254
  ],
1138
1255
  opacity: 1,
1139
1256
  debug: !1,
1140
- tweenFunction: wn.easeInOutQuad,
1257
+ tweenFunction: On.easeInOutQuad,
1141
1258
  tweenDuration: 5e3,
1142
1259
  recycle: !0,
1143
1260
  run: !0
1144
1261
  };
1145
- class In {
1262
+ class zn {
1146
1263
  constructor(e, t) {
1147
- this.lastFrameTime = 0, this.setOptionsWithDefaults = (o) => {
1148
- const r = {
1264
+ this.lastFrameTime = 0, this.setOptionsWithDefaults = (s) => {
1265
+ const o = {
1149
1266
  confettiSource: {
1150
1267
  x: 0,
1151
1268
  y: 0,
@@ -1154,17 +1271,17 @@ class In {
1154
1271
  }
1155
1272
  };
1156
1273
  this._options = {
1157
- ...r,
1158
- ...qt,
1159
- ...o
1160
- }, Object.assign(this, o.confettiSource);
1161
- }, this.update = (o = 0) => {
1162
- const { options: { run: r, onConfettiComplete: p, frameRate: b }, canvas: F, context: se } = this, q = Math.min(o - this.lastFrameTime, 50);
1163
- if (b && q < 1e3 / b) {
1274
+ ...o,
1275
+ ...Ut,
1276
+ ...s
1277
+ }, Object.assign(this, s.confettiSource);
1278
+ }, this.update = (s = 0) => {
1279
+ const { options: { run: o, onConfettiComplete: v, frameRate: b }, canvas: A, context: le } = this, K = Math.min(s - this.lastFrameTime, 50);
1280
+ if (b && K < 1e3 / b) {
1164
1281
  this.rafId = requestAnimationFrame(this.update);
1165
1282
  return;
1166
1283
  }
1167
- this.lastFrameTime = o - (b ? q % b : 0), r && (se.fillStyle = "white", se.clearRect(0, 0, F.width, F.height)), this.generator.animate(q) ? this.rafId = requestAnimationFrame(this.update) : (p && typeof p == "function" && this.generator.particlesGenerated > 0 && p.call(this, this), this._options.run = !1);
1284
+ this.lastFrameTime = s - (b ? K % b : 0), o && (le.fillStyle = "white", le.clearRect(0, 0, A.width, A.height)), this.generator.animate(K) ? this.rafId = requestAnimationFrame(this.update) : (v && typeof v == "function" && this.generator.particlesGenerated > 0 && v.call(this, this), this._options.run = !1);
1168
1285
  }, this.reset = () => {
1169
1286
  this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
1170
1287
  }, this.stop = () => {
@@ -1173,37 +1290,37 @@ class In {
1173
1290
  const l = this.canvas.getContext("2d");
1174
1291
  if (!l)
1175
1292
  throw new Error("Could not get canvas context");
1176
- this.context = l, this.generator = new xn(this.canvas, () => this.options), this.options = t, this.update();
1293
+ this.context = l, this.generator = new $n(this.canvas, () => this.options), this.options = t, this.update();
1177
1294
  }
1178
1295
  get options() {
1179
1296
  return this._options;
1180
1297
  }
1181
1298
  set options(e) {
1182
- var o, r;
1183
- const t = (o = this._options) == null ? void 0 : o.run, l = (r = this._options) == null ? void 0 : r.recycle;
1299
+ var s, o;
1300
+ const t = (s = this._options) == null ? void 0 : s.run, l = (o = this._options) == null ? void 0 : o.recycle;
1184
1301
  this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && l === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
1185
1302
  }
1186
1303
  }
1187
- const Sn = It.createRef();
1188
- class Vt extends It.Component {
1304
+ const Wn = Ot.createRef();
1305
+ class Ht extends Ot.Component {
1189
1306
  constructor(e) {
1190
- super(e), this.canvas = It.createRef(), this.canvas = e.canvasRef || Sn;
1307
+ super(e), this.canvas = Ot.createRef(), this.canvas = e.canvasRef || Wn;
1191
1308
  }
1192
1309
  componentDidMount() {
1193
1310
  if (this.canvas.current) {
1194
- const e = Ft(this.props)[0];
1195
- this.confetti = new In(this.canvas.current, e);
1311
+ const e = $t(this.props)[0];
1312
+ this.confetti = new zn(this.canvas.current, e);
1196
1313
  }
1197
1314
  }
1198
1315
  componentDidUpdate() {
1199
- const e = Ft(this.props)[0];
1316
+ const e = $t(this.props)[0];
1200
1317
  this.confetti && (this.confetti.options = e);
1201
1318
  }
1202
1319
  componentWillUnmount() {
1203
1320
  this.confetti && this.confetti.stop(), this.confetti = void 0;
1204
1321
  }
1205
1322
  render() {
1206
- const [e, t] = Ft(this.props), l = {
1323
+ const [e, t] = $t(this.props), l = {
1207
1324
  zIndex: 2,
1208
1325
  position: "absolute",
1209
1326
  pointerEvents: "none",
@@ -1213,42 +1330,42 @@ class Vt extends It.Component {
1213
1330
  right: 0,
1214
1331
  ...t.style
1215
1332
  };
1216
- return n("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: l });
1333
+ return a("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: l });
1217
1334
  }
1218
1335
  }
1219
- Vt.defaultProps = {
1220
- ...qt
1336
+ Ht.defaultProps = {
1337
+ ...Ut
1221
1338
  };
1222
- Vt.displayName = "ReactConfetti";
1223
- function Ft(a) {
1224
- const e = {}, t = {}, l = {}, o = [
1225
- ...Object.keys(qt),
1339
+ Ht.displayName = "ReactConfetti";
1340
+ function $t(r) {
1341
+ const e = {}, t = {}, l = {}, s = [
1342
+ ...Object.keys(Ut),
1226
1343
  "confettiSource",
1227
1344
  "drawShape",
1228
1345
  "onConfettiComplete",
1229
1346
  "frameRate"
1230
- ], r = ["canvasRef"];
1231
- for (const p in a) {
1232
- const b = a[p];
1233
- o.includes(p) ? e[p] = b : r.includes(p) ? r[p] = b : l[p] = b;
1347
+ ], o = ["canvasRef"];
1348
+ for (const v in r) {
1349
+ const b = r[v];
1350
+ s.includes(v) ? e[v] = b : o.includes(v) ? o[v] = b : l[v] = b;
1234
1351
  }
1235
1352
  return [e, l, t];
1236
1353
  }
1237
- const Pn = It.forwardRef((a, e) => n(Vt, { canvasRef: e, ...a }));
1354
+ const Gn = Ot.forwardRef((r, e) => a(Ht, { canvasRef: e, ...r }));
1238
1355
  /**
1239
1356
  * @license lucide-react v0.515.0 - ISC
1240
1357
  *
1241
1358
  * This source code is licensed under the ISC license.
1242
1359
  * See the LICENSE file in the root directory of this source tree.
1243
1360
  */
1244
- const Bn = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Tn = (a) => a.replace(
1361
+ const jn = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Un = (r) => r.replace(
1245
1362
  /^([A-Z])|[\s-_]+(\w)/g,
1246
1363
  (e, t, l) => l ? l.toUpperCase() : t.toLowerCase()
1247
- ), Ut = (a) => {
1248
- const e = Tn(a);
1364
+ ), rn = (r) => {
1365
+ const e = Un(r);
1249
1366
  return e.charAt(0).toUpperCase() + e.slice(1);
1250
- }, Xt = (...a) => a.filter((e, t, l) => !!e && e.trim() !== "" && l.indexOf(e) === t).join(" ").trim(), Ln = (a) => {
1251
- for (const e in a)
1367
+ }, un = (...r) => r.filter((e, t, l) => !!e && e.trim() !== "" && l.indexOf(e) === t).join(" ").trim(), Hn = (r) => {
1368
+ for (const e in r)
1252
1369
  if (e.startsWith("aria-") || e === "role" || e === "title")
1253
1370
  return !0;
1254
1371
  };
@@ -1258,7 +1375,7 @@ const Bn = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Tn = (
1258
1375
  * This source code is licensed under the ISC license.
1259
1376
  * See the LICENSE file in the root directory of this source tree.
1260
1377
  */
1261
- var Rn = {
1378
+ var Qn = {
1262
1379
  xmlns: "http://www.w3.org/2000/svg",
1263
1380
  width: 24,
1264
1381
  height: 24,
@@ -1275,32 +1392,32 @@ var Rn = {
1275
1392
  * This source code is licensed under the ISC license.
1276
1393
  * See the LICENSE file in the root directory of this source tree.
1277
1394
  */
1278
- const Fn = Yt(
1395
+ const Yn = ln(
1279
1396
  ({
1280
- color: a = "currentColor",
1397
+ color: r = "currentColor",
1281
1398
  size: e = 24,
1282
1399
  strokeWidth: t = 2,
1283
1400
  absoluteStrokeWidth: l,
1284
- className: o = "",
1285
- children: r,
1286
- iconNode: p,
1401
+ className: s = "",
1402
+ children: o,
1403
+ iconNode: v,
1287
1404
  ...b
1288
- }, F) => At(
1405
+ }, A) => Gt(
1289
1406
  "svg",
1290
1407
  {
1291
- ref: F,
1292
- ...Rn,
1408
+ ref: A,
1409
+ ...Qn,
1293
1410
  width: e,
1294
1411
  height: e,
1295
- stroke: a,
1412
+ stroke: r,
1296
1413
  strokeWidth: l ? Number(t) * 24 / Number(e) : t,
1297
- className: Xt("lucide", o),
1298
- ...!r && !Ln(b) && { "aria-hidden": "true" },
1414
+ className: un("lucide", s),
1415
+ ...!o && !Hn(b) && { "aria-hidden": "true" },
1299
1416
  ...b
1300
1417
  },
1301
1418
  [
1302
- ...p.map(([se, q]) => At(se, q)),
1303
- ...Array.isArray(r) ? r : [r]
1419
+ ...v.map(([le, K]) => Gt(le, K)),
1420
+ ...Array.isArray(o) ? o : [o]
1304
1421
  ]
1305
1422
  )
1306
1423
  );
@@ -1310,20 +1427,20 @@ const Fn = Yt(
1310
1427
  * This source code is licensed under the ISC license.
1311
1428
  * See the LICENSE file in the root directory of this source tree.
1312
1429
  */
1313
- const St = (a, e) => {
1314
- const t = Yt(
1315
- ({ className: l, ...o }, r) => At(Fn, {
1316
- ref: r,
1430
+ const qt = (r, e) => {
1431
+ const t = ln(
1432
+ ({ className: l, ...s }, o) => Gt(Yn, {
1433
+ ref: o,
1317
1434
  iconNode: e,
1318
- className: Xt(
1319
- `lucide-${Bn(Ut(a))}`,
1320
- `lucide-${a}`,
1435
+ className: un(
1436
+ `lucide-${jn(rn(r))}`,
1437
+ `lucide-${r}`,
1321
1438
  l
1322
1439
  ),
1323
- ...o
1440
+ ...s
1324
1441
  })
1325
1442
  );
1326
- return t.displayName = Ut(a), t;
1443
+ return t.displayName = rn(r), t;
1327
1444
  };
1328
1445
  /**
1329
1446
  * @license lucide-react v0.515.0 - ISC
@@ -1331,392 +1448,400 @@ const St = (a, e) => {
1331
1448
  * This source code is licensed under the ISC license.
1332
1449
  * See the LICENSE file in the root directory of this source tree.
1333
1450
  */
1334
- const Mn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Zt = St("chevron-down", Mn);
1451
+ const Kn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], dn = qt("chevron-down", Kn);
1335
1452
  /**
1336
1453
  * @license lucide-react v0.515.0 - ISC
1337
1454
  *
1338
1455
  * This source code is licensed under the ISC license.
1339
1456
  * See the LICENSE file in the root directory of this source tree.
1340
1457
  */
1341
- const On = [
1458
+ const Jn = [
1342
1459
  ["path", { d: "M5 12h14", key: "1ays0h" }],
1343
1460
  ["path", { d: "M12 5v14", key: "s699le" }]
1344
- ], bt = St("plus", On);
1461
+ ], Nt = qt("plus", Jn);
1345
1462
  /**
1346
1463
  * @license lucide-react v0.515.0 - ISC
1347
1464
  *
1348
1465
  * This source code is licensed under the ISC license.
1349
1466
  * See the LICENSE file in the root directory of this source tree.
1350
1467
  */
1351
- const An = [
1468
+ const Xn = [
1352
1469
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
1353
1470
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
1354
- ], qn = St("search", An);
1471
+ ], Zn = qt("search", Xn);
1355
1472
  /**
1356
1473
  * @license lucide-react v0.515.0 - ISC
1357
1474
  *
1358
1475
  * This source code is licensed under the ISC license.
1359
1476
  * See the LICENSE file in the root directory of this source tree.
1360
1477
  */
1361
- const Vn = [
1478
+ const ea = [
1362
1479
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
1363
1480
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
1364
1481
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
1365
1482
  ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
1366
1483
  ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
1367
- ], Mt = St("trash-2", Vn), En = "_backdrop_9u5ly_1", Dn = "_celebrationOverlay_9u5ly_14", $n = "_celebrationChip_9u5ly_23", zn = "_backdropOpen_9u5ly_74", Wn = "_backdropClosed_9u5ly_78", jn = "_panel_9u5ly_82", Gn = "_panelOpen_9u5ly_103", Un = "_panelClosed_9u5ly_107", Hn = "_header_9u5ly_146", Qn = "_headerCenter_9u5ly_155", Yn = "_title_9u5ly_163", Kn = "_searchIconButton_9u5ly_172", Xn = "_headerTitleWrap_9u5ly_195", Zn = "_headerSearchWrap_9u5ly_199", Jn = "_headerSearchOpen_9u5ly_211", ea = "_searchBar_9u5ly_223", ta = "_searchInput_9u5ly_235", na = "_searchClearButton_9u5ly_256", aa = "_closeButton_9u5ly_278", ra = "_body_9u5ly_312", ia = "_muted_9u5ly_317", oa = "_error_9u5ly_322", la = "_variants_9u5ly_327", sa = "_variantList_9u5ly_331", ca = "_emptyState_9u5ly_339", ua = "_variantRow_9u5ly_351", da = "_variantRowSoldOut_9u5ly_359", ma = "_variantLeft_9u5ly_363", ha = "_addToBundleButton_9u5ly_370", ba = "_soldOutContainer_9u5ly_398", fa = "_stockLimitContainer_9u5ly_406", pa = "_soldOut_9u5ly_398", _a = "_stockLimitNotice_9u5ly_424", ya = "_variantThumb_9u5ly_433", va = "_variantThumbImg_9u5ly_443", wa = "_variantThumbFallback_9u5ly_450", ga = "_variantInfo_9u5ly_460", Na = "_variantName_9u5ly_464", ka = "_variantMeta_9u5ly_473", Ca = "_variantPriceRow_9u5ly_481", xa = "_variantCompareAt_9u5ly_488", Ia = "_variantPrice_9u5ly_481", Sa = "_qtyControls_9u5ly_499", Pa = "_qtyControlsWrap_9u5ly_505", Ba = "_qtyButton_9u5ly_511", Ta = "_qtyValue_9u5ly_537", La = "_footer_9u5ly_544", Ra = "_poweredBy_9u5ly_552", Fa = "_boxSummaryWindow_9u5ly_564", Ma = "_boxSummaryRow_9u5ly_582", Oa = "_boxSlot_9u5ly_590", Aa = "_boxItem_9u5ly_599", qa = "_boxItemClickable_9u5ly_611", Va = "_boxThresholdLabel_9u5ly_620", Ea = "_boxItemPlaceholder_9u5ly_631", Da = "_boxItemFilled_9u5ly_637", $a = "_boxItemThreshold_9u5ly_643", za = "_boxItemDiscountText_9u5ly_651", Wa = "_boxItemPlus_9u5ly_659", ja = "_boxItemImage_9u5ly_666", Ga = "_boxItemFallback_9u5ly_673", Ua = "_ctaButtonGroup_9u5ly_684", Ha = "_ctaButtonGroupAnimating_9u5ly_691", Qa = "_cta_9u5ly_684", Ya = "_ctaDualLeft_9u5ly_719", Ka = "_ctaDualLeftAnimating_9u5ly_737", Xa = "_ctaDualRight_9u5ly_750", Za = "_ctaDualRightAnimating_9u5ly_766", Ja = "_ctaTotals_9u5ly_777", er = "_ctaDiscountBadge_9u5ly_785", tr = "_ctaTotalsWrap_9u5ly_799", nr = "_ctaTotalsWrapVisible_9u5ly_812", ar = "_ctaTotalsStrike_9u5ly_819", rr = "_ctaTotalsPrice_9u5ly_826", ir = "_drawerProductGroup_9u5ly_1075", or = "_selectButton_9u5ly_1081", lr = "_selectButtonChevron_9u5ly_1087", sr = "_selectButtonChevronOpen_9u5ly_1092", cr = "_variantPicker_9u5ly_1097", ur = "_variantPickerRow_9u5ly_1104", dr = "_variantPickerRowSelected_9u5ly_1137", mr = "_variantPickerLabel_9u5ly_1144", hr = "_variantPickerPriceGroup_9u5ly_1153", br = "_variantPickerPrice_9u5ly_1153", fr = "_variantPickerCompareAt_9u5ly_1165", pr = "_variantPickerSoldOut_9u5ly_1171", _r = "_variantPickerCheck_9u5ly_1176", yr = "_drawerSelectedList_9u5ly_1184", vr = "_drawerSubRow_9u5ly_1190", wr = "_drawerSubRowInfo_9u5ly_1203", gr = "_drawerSubRowName_9u5ly_1211", c = {
1368
- backdrop: En,
1369
- celebrationOverlay: Dn,
1370
- celebrationChip: $n,
1371
- backdropOpen: zn,
1372
- backdropClosed: Wn,
1373
- panel: jn,
1374
- panelOpen: Gn,
1375
- panelClosed: Un,
1376
- header: Hn,
1377
- headerCenter: Qn,
1378
- title: Yn,
1379
- searchIconButton: Kn,
1380
- headerTitleWrap: Xn,
1381
- headerSearchWrap: Zn,
1382
- headerSearchOpen: Jn,
1383
- searchBar: ea,
1384
- searchInput: ta,
1385
- searchClearButton: na,
1386
- closeButton: aa,
1387
- body: ra,
1388
- muted: ia,
1389
- error: oa,
1390
- variants: la,
1391
- variantList: sa,
1392
- emptyState: ca,
1393
- variantRow: ua,
1394
- variantRowSoldOut: da,
1395
- variantLeft: ma,
1396
- addToBundleButton: ha,
1397
- soldOutContainer: ba,
1398
- stockLimitContainer: fa,
1399
- soldOut: pa,
1400
- stockLimitNotice: _a,
1401
- variantThumb: ya,
1402
- variantThumbImg: va,
1403
- variantThumbFallback: wa,
1404
- variantInfo: ga,
1405
- variantName: Na,
1406
- variantMeta: ka,
1407
- variantPriceRow: Ca,
1408
- variantCompareAt: xa,
1409
- variantPrice: Ia,
1410
- qtyControls: Sa,
1411
- qtyControlsWrap: Pa,
1412
- qtyButton: Ba,
1413
- qtyValue: Ta,
1414
- footer: La,
1415
- poweredBy: Ra,
1416
- boxSummaryWindow: Fa,
1417
- boxSummaryRow: Ma,
1418
- boxSlot: Oa,
1419
- boxItem: Aa,
1420
- boxItemClickable: qa,
1421
- boxThresholdLabel: Va,
1422
- boxItemPlaceholder: Ea,
1423
- boxItemFilled: Da,
1424
- boxItemThreshold: $a,
1425
- boxItemDiscountText: za,
1426
- boxItemPlus: Wa,
1427
- boxItemImage: ja,
1428
- boxItemFallback: Ga,
1429
- ctaButtonGroup: Ua,
1430
- ctaButtonGroupAnimating: Ha,
1431
- cta: Qa,
1432
- ctaDualLeft: Ya,
1433
- ctaDualLeftAnimating: Ka,
1434
- ctaDualRight: Xa,
1435
- ctaDualRightAnimating: Za,
1436
- ctaTotals: Ja,
1437
- ctaDiscountBadge: er,
1438
- ctaTotalsWrap: tr,
1439
- ctaTotalsWrapVisible: nr,
1440
- ctaTotalsStrike: ar,
1441
- ctaTotalsPrice: rr,
1442
- drawerProductGroup: ir,
1443
- selectButton: or,
1444
- selectButtonChevron: lr,
1445
- selectButtonChevronOpen: sr,
1446
- variantPicker: cr,
1447
- variantPickerRow: ur,
1448
- variantPickerRowSelected: dr,
1449
- variantPickerLabel: mr,
1450
- variantPickerPriceGroup: hr,
1451
- variantPickerPrice: br,
1452
- variantPickerCompareAt: fr,
1453
- variantPickerSoldOut: pr,
1454
- variantPickerCheck: _r,
1455
- drawerSelectedList: yr,
1456
- drawerSubRow: vr,
1457
- drawerSubRowInfo: wr,
1458
- drawerSubRowName: gr
1484
+ ], zt = qt("trash-2", ea), ta = "_backdrop_9u5ly_1", na = "_celebrationOverlay_9u5ly_14", aa = "_celebrationChip_9u5ly_23", ra = "_backdropOpen_9u5ly_74", ia = "_backdropClosed_9u5ly_78", oa = "_panel_9u5ly_82", sa = "_panelOpen_9u5ly_103", la = "_panelClosed_9u5ly_107", ca = "_header_9u5ly_146", ua = "_headerCenter_9u5ly_155", da = "_title_9u5ly_163", ma = "_searchIconButton_9u5ly_172", ha = "_headerTitleWrap_9u5ly_195", ba = "_headerSearchWrap_9u5ly_199", fa = "_headerSearchOpen_9u5ly_211", pa = "_searchBar_9u5ly_223", _a = "_searchInput_9u5ly_235", ya = "_searchClearButton_9u5ly_256", va = "_closeButton_9u5ly_278", wa = "_body_9u5ly_312", ga = "_muted_9u5ly_317", Na = "_error_9u5ly_322", Ia = "_variants_9u5ly_327", ka = "_variantList_9u5ly_331", Sa = "_emptyState_9u5ly_339", Ca = "_variantRow_9u5ly_351", xa = "_variantRowSoldOut_9u5ly_359", Pa = "_variantLeft_9u5ly_363", Ba = "_addToBundleButton_9u5ly_370", Ta = "_soldOutContainer_9u5ly_398", La = "_stockLimitContainer_9u5ly_406", Ra = "_soldOut_9u5ly_398", Fa = "_stockLimitNotice_9u5ly_424", Ma = "_variantThumb_9u5ly_433", Aa = "_variantThumbImg_9u5ly_443", Oa = "_variantThumbFallback_9u5ly_450", qa = "_variantInfo_9u5ly_460", Va = "_variantName_9u5ly_464", Ea = "_variantMeta_9u5ly_473", Da = "_variantPriceRow_9u5ly_481", $a = "_variantCompareAt_9u5ly_488", za = "_variantPrice_9u5ly_481", Wa = "_qtyControls_9u5ly_499", Ga = "_qtyControlsWrap_9u5ly_505", ja = "_qtyButton_9u5ly_511", Ua = "_qtyValue_9u5ly_537", Ha = "_footer_9u5ly_544", Qa = "_poweredBy_9u5ly_552", Ya = "_boxSummaryWindow_9u5ly_564", Ka = "_boxSummaryRow_9u5ly_582", Ja = "_boxSlot_9u5ly_590", Xa = "_boxItem_9u5ly_599", Za = "_boxItemClickable_9u5ly_611", er = "_boxThresholdLabel_9u5ly_620", tr = "_boxItemPlaceholder_9u5ly_631", nr = "_boxItemFilled_9u5ly_637", ar = "_boxItemThreshold_9u5ly_643", rr = "_boxItemDiscountText_9u5ly_651", ir = "_boxItemPlus_9u5ly_659", or = "_boxItemImage_9u5ly_666", sr = "_boxItemFallback_9u5ly_673", lr = "_ctaButtonGroup_9u5ly_684", cr = "_ctaButtonGroupAnimating_9u5ly_691", ur = "_cta_9u5ly_684", dr = "_ctaDualLeft_9u5ly_719", mr = "_ctaDualLeftAnimating_9u5ly_737", hr = "_ctaDualRight_9u5ly_750", br = "_ctaDualRightAnimating_9u5ly_766", fr = "_ctaTotals_9u5ly_777", pr = "_ctaDiscountBadge_9u5ly_785", _r = "_ctaTotalsWrap_9u5ly_799", yr = "_ctaTotalsWrapVisible_9u5ly_812", vr = "_ctaTotalsStrike_9u5ly_819", wr = "_ctaTotalsPrice_9u5ly_826", gr = "_drawerProductGroup_9u5ly_1075", Nr = "_selectButton_9u5ly_1081", Ir = "_selectButtonChevron_9u5ly_1087", kr = "_selectButtonChevronOpen_9u5ly_1092", Sr = "_variantPicker_9u5ly_1097", Cr = "_variantPickerRow_9u5ly_1104", xr = "_variantPickerRowSelected_9u5ly_1137", Pr = "_variantPickerLabel_9u5ly_1144", Br = "_variantPickerPriceGroup_9u5ly_1153", Tr = "_variantPickerPrice_9u5ly_1153", Lr = "_variantPickerCompareAt_9u5ly_1165", Rr = "_variantPickerSoldOut_9u5ly_1171", Fr = "_variantPickerCheck_9u5ly_1176", Mr = "_drawerSelectedList_9u5ly_1184", Ar = "_drawerSubRow_9u5ly_1190", Or = "_drawerSubRowInfo_9u5ly_1203", qr = "_drawerSubRowName_9u5ly_1211", c = {
1485
+ backdrop: ta,
1486
+ celebrationOverlay: na,
1487
+ celebrationChip: aa,
1488
+ backdropOpen: ra,
1489
+ backdropClosed: ia,
1490
+ panel: oa,
1491
+ panelOpen: sa,
1492
+ panelClosed: la,
1493
+ header: ca,
1494
+ headerCenter: ua,
1495
+ title: da,
1496
+ searchIconButton: ma,
1497
+ headerTitleWrap: ha,
1498
+ headerSearchWrap: ba,
1499
+ headerSearchOpen: fa,
1500
+ searchBar: pa,
1501
+ searchInput: _a,
1502
+ searchClearButton: ya,
1503
+ closeButton: va,
1504
+ body: wa,
1505
+ muted: ga,
1506
+ error: Na,
1507
+ variants: Ia,
1508
+ variantList: ka,
1509
+ emptyState: Sa,
1510
+ variantRow: Ca,
1511
+ variantRowSoldOut: xa,
1512
+ variantLeft: Pa,
1513
+ addToBundleButton: Ba,
1514
+ soldOutContainer: Ta,
1515
+ stockLimitContainer: La,
1516
+ soldOut: Ra,
1517
+ stockLimitNotice: Fa,
1518
+ variantThumb: Ma,
1519
+ variantThumbImg: Aa,
1520
+ variantThumbFallback: Oa,
1521
+ variantInfo: qa,
1522
+ variantName: Va,
1523
+ variantMeta: Ea,
1524
+ variantPriceRow: Da,
1525
+ variantCompareAt: $a,
1526
+ variantPrice: za,
1527
+ qtyControls: Wa,
1528
+ qtyControlsWrap: Ga,
1529
+ qtyButton: ja,
1530
+ qtyValue: Ua,
1531
+ footer: Ha,
1532
+ poweredBy: Qa,
1533
+ boxSummaryWindow: Ya,
1534
+ boxSummaryRow: Ka,
1535
+ boxSlot: Ja,
1536
+ boxItem: Xa,
1537
+ boxItemClickable: Za,
1538
+ boxThresholdLabel: er,
1539
+ boxItemPlaceholder: tr,
1540
+ boxItemFilled: nr,
1541
+ boxItemThreshold: ar,
1542
+ boxItemDiscountText: rr,
1543
+ boxItemPlus: ir,
1544
+ boxItemImage: or,
1545
+ boxItemFallback: sr,
1546
+ ctaButtonGroup: lr,
1547
+ ctaButtonGroupAnimating: cr,
1548
+ cta: ur,
1549
+ ctaDualLeft: dr,
1550
+ ctaDualLeftAnimating: mr,
1551
+ ctaDualRight: hr,
1552
+ ctaDualRightAnimating: br,
1553
+ ctaTotals: fr,
1554
+ ctaDiscountBadge: pr,
1555
+ ctaTotalsWrap: _r,
1556
+ ctaTotalsWrapVisible: yr,
1557
+ ctaTotalsStrike: vr,
1558
+ ctaTotalsPrice: wr,
1559
+ drawerProductGroup: gr,
1560
+ selectButton: Nr,
1561
+ selectButtonChevron: Ir,
1562
+ selectButtonChevronOpen: kr,
1563
+ variantPicker: Sr,
1564
+ variantPickerRow: Cr,
1565
+ variantPickerRowSelected: xr,
1566
+ variantPickerLabel: Pr,
1567
+ variantPickerPriceGroup: Br,
1568
+ variantPickerPrice: Tr,
1569
+ variantPickerCompareAt: Lr,
1570
+ variantPickerSoldOut: Rr,
1571
+ variantPickerCheck: Fr,
1572
+ drawerSelectedList: Mr,
1573
+ drawerSubRow: Ar,
1574
+ drawerSubRowInfo: Or,
1575
+ drawerSubRowName: qr
1459
1576
  };
1460
- function Ao(a) {
1461
- var w, S;
1577
+ function Xo(r) {
1578
+ var Lt, m;
1462
1579
  const {
1463
1580
  isOpen: e,
1464
1581
  close: t,
1465
1582
  loading: l,
1466
- submitting: o,
1467
- error: r,
1468
- currencyCode: p,
1583
+ submitting: s,
1584
+ error: o,
1585
+ currencyCode: v,
1469
1586
  config: b,
1470
- eligibleVariants: F,
1471
- selections: se,
1472
- selectionOrder: q,
1473
- getVariantMaxSelectableQuantity: Y,
1474
- setQuantity: de,
1475
- bundleSize: W,
1476
- minRequired: ye,
1477
- canSubmit: H,
1478
- submit: ue,
1479
- submitAndCheckout: v,
1480
- locale: ae,
1481
- t: k
1482
- } = yt(), [ge, z] = ne(!1), [E, me] = ne(""), ce = ie(null), xe = ie(null), Se = ie(null), [be, Ve] = ne(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Ne, Fe] = ne(0), [Me, Oe] = ne(null), [he, ke] = ne(!1), Pe = ie(null), Ie = ie(W), tt = 7e3, [Ee, Le] = ne(0), [je, Ge] = ne(null), [Re, nt] = ne(!1), Ae = ie(null), it = 2800, Ke = [
1587
+ eligibleVariants: A,
1588
+ selections: le,
1589
+ selectionOrder: K,
1590
+ getVariantMaxSelectableQuantity: ke,
1591
+ setQuantity: ie,
1592
+ redirectVariantToProductPage: Pe,
1593
+ bundleSize: G,
1594
+ minRequired: U,
1595
+ canSubmit: he,
1596
+ submit: z,
1597
+ submitAndCheckout: g,
1598
+ locale: Se,
1599
+ t: I
1600
+ } = Pt(), [q, Q] = X(!1), [Z, ce] = X(""), Ne = re(null), qe = re(null), Be = re(null), [xe, ee] = X(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Ve, Ge] = X(0), [Re, Ee] = X(null), [we, ge] = X(!1), Te = re(null), De = re(G), Ke = 7e3, [$e, je] = X(0), [be, Fe] = X(null), [Ue, at] = X(!1), ze = re(null), rt = 2800, ye = [
1483
1601
  "#2563eb",
1484
1602
  "#3b82f6",
1485
1603
  "#60a5fa",
1486
1604
  "#93c5fd",
1487
1605
  "#bae6fd",
1488
1606
  "#e0f2fe"
1489
- ], ve = $(() => {
1490
- var s;
1491
- const i = (s = b == null ? void 0 : b.styleSettings) == null ? void 0 : s.confettiColors;
1492
- return Array.isArray(i) && i.length >= 6 ? i.slice(0, 6).map(
1493
- (d, y) => typeof d == "string" && d.trim() ? d : Ke[y]
1494
- ) : [...Ke];
1495
- }, [(w = b == null ? void 0 : b.styleSettings) == null ? void 0 : w.confettiColors]), De = (i) => {
1496
- const s = Number.parseFloat(i);
1497
- return Number.isFinite(s) ? String(Math.round(s)) : i;
1498
- }, $e = (i) => {
1499
- const s = (i ?? []).filter((d) => {
1500
- var M, P;
1501
- const y = (M = d == null ? void 0 : d.name) == null ? void 0 : M.trim(), C = (P = d == null ? void 0 : d.value) == null ? void 0 : P.trim();
1502
- return !(!y || !C || y.toLowerCase() === "title" || C.toLowerCase() === "default title");
1607
+ ], pe = E(() => {
1608
+ var i;
1609
+ const n = (i = b == null ? void 0 : b.styleSettings) == null ? void 0 : i.confettiColors;
1610
+ return Array.isArray(n) && n.length >= 6 ? n.slice(0, 6).map(
1611
+ (d, p) => typeof d == "string" && d.trim() ? d : ye[p]
1612
+ ) : [...ye];
1613
+ }, [(Lt = b == null ? void 0 : b.styleSettings) == null ? void 0 : Lt.confettiColors]), it = (n) => {
1614
+ const i = Number.parseFloat(n);
1615
+ return Number.isFinite(i) ? String(Math.round(i)) : n;
1616
+ }, Le = (n) => {
1617
+ const i = (n ?? []).filter((d) => {
1618
+ var x, S;
1619
+ const p = (x = d == null ? void 0 : d.name) == null ? void 0 : x.trim(), y = (S = d == null ? void 0 : d.value) == null ? void 0 : S.trim();
1620
+ return !(!p || !y || p.toLowerCase() === "title" || y.toLowerCase() === "default title");
1503
1621
  });
1504
- return s.length ? s.map((d) => `${d.name}: ${d.value}`).join(" · ") : null;
1505
- }, qe = (i) => (i == null ? void 0 : i.trim().toLowerCase()) === "default title", ze = (i) => {
1506
- var C, M, P, _;
1507
- const s = (C = i.displayName) == null ? void 0 : C.trim();
1508
- if (s && !qe(s)) return s;
1509
- const d = (P = (M = i.product) == null ? void 0 : M.title) == null ? void 0 : P.trim();
1622
+ return i.length ? i.map((d) => `${d.name}: ${d.value}`).join(" · ") : null;
1623
+ }, He = (n) => (n == null ? void 0 : n.trim().toLowerCase()) === "default title", We = (n) => {
1624
+ var y, x, S, _;
1625
+ const i = (y = n.displayName) == null ? void 0 : y.trim();
1626
+ if (i && !He(i)) return i;
1627
+ const d = (S = (x = n.product) == null ? void 0 : x.title) == null ? void 0 : S.trim();
1510
1628
  if (d) return d;
1511
- const y = (_ = i.title) == null ? void 0 : _.trim();
1512
- return y && !qe(y) ? y : s || y || d || "";
1513
- }, Ue = (i) => {
1514
- const s = ze(i), d = $e(i.selectedOptions);
1515
- return [s, d].filter(Boolean).join(" — ");
1516
- }, m = (i) => {
1517
- var y;
1518
- const s = $e(i.selectedOptions);
1519
- if (s) return s;
1520
- const d = (y = i.title) == null ? void 0 : y.trim();
1521
- return d && !qe(d) ? d : ze(i);
1522
- }, [f, g] = ne(e), B = ie(null), T = (i) => {
1523
- const s = Number(i);
1524
- return Number.isFinite(s) ? ft(s, p, ae) : i;
1525
- }, j = ((S = b == null ? void 0 : b.title) == null ? void 0 : S.trim()) || k("bundle.title.default"), K = $(() => {
1526
- const i = Number((b == null ? void 0 : b.maxBundleSize) ?? NaN), s = Number.isFinite(i) ? Math.floor(i) : 100;
1527
- return Math.max(2, Math.min(100, s));
1528
- }, [b == null ? void 0 : b.maxBundleSize]), N = W >= K, A = $(() => [...F], [F]), V = $(() => {
1529
- const i = E.trim().toLowerCase();
1530
- if (!i) return A;
1531
- const s = i.split(/\s+/).filter(Boolean), d = (y) => {
1532
- var P;
1533
- const C = [];
1534
- C.push(y.displayName), (P = y.product) != null && P.title && C.push(y.product.title);
1535
- for (const _ of y.selectedOptions ?? [])
1536
- C.push(_.name), C.push(_.value);
1537
- const M = C.join(" ").toLowerCase();
1538
- return s.every((_) => M.includes(_));
1629
+ const p = (_ = n.title) == null ? void 0 : _.trim();
1630
+ return p && !He(p) ? p : i || p || d || "";
1631
+ }, Je = (n) => {
1632
+ const i = We(n), d = Le(n.selectedOptions);
1633
+ return [i, d].filter(Boolean).join(" — ");
1634
+ }, Xe = (n) => {
1635
+ var p;
1636
+ const i = Le(n.selectedOptions);
1637
+ if (i) return i;
1638
+ const d = (p = n.title) == null ? void 0 : p.trim();
1639
+ return d && !He(d) ? d : We(n);
1640
+ }, ot = ((m = b == null ? void 0 : b.title) == null ? void 0 : m.trim()) || I("bundle.title.default"), h = !!(b != null && b.redirectEligibleProductsToProductPage), w = e && !!b, [P, R] = X(w), V = re(null), T = (n) => {
1641
+ const i = Number(n);
1642
+ return Number.isFinite(i) ? It(i, v, Se) : n;
1643
+ }, k = E(() => {
1644
+ const n = Number((b == null ? void 0 : b.maxBundleSize) ?? NaN), i = Number.isFinite(n) ? Math.floor(n) : 100;
1645
+ return Math.max(2, Math.min(100, i));
1646
+ }, [b == null ? void 0 : b.maxBundleSize]), L = G >= k, W = (n, i) => {
1647
+ const d = le[n.id] ?? 0;
1648
+ if (h && i > d) {
1649
+ Pe(n);
1650
+ return;
1651
+ }
1652
+ ie(n.id, i);
1653
+ }, te = E(() => [...A], [A]), D = E(() => {
1654
+ const n = Z.trim().toLowerCase();
1655
+ if (!n) return te;
1656
+ const i = n.split(/\s+/).filter(Boolean), d = (p) => {
1657
+ var S;
1658
+ const y = [];
1659
+ y.push(p.displayName), (S = p.product) != null && S.title && y.push(p.product.title);
1660
+ for (const _ of p.selectedOptions ?? [])
1661
+ y.push(_.name), y.push(_.value);
1662
+ const x = y.join(" ").toLowerCase();
1663
+ return i.every((_) => x.includes(_));
1539
1664
  };
1540
- return A.filter(d);
1541
- }, [E, A]), oe = $(() => {
1542
- var C, M;
1665
+ return te.filter(d);
1666
+ }, [Z, te]), C = E(() => {
1667
+ var y, x;
1543
1668
  if (!(b != null && b.groupVariantsByProduct)) return null;
1544
- const i = E.trim().toLowerCase(), s = i ? i.split(/\s+/).filter(Boolean) : [], d = (P) => {
1545
- var O;
1546
- if (!s.length) return !0;
1547
- const _ = [P.displayName];
1548
- (O = P.product) != null && O.title && _.push(P.product.title);
1549
- for (const Z of P.selectedOptions ?? [])
1550
- _.push(Z.name), _.push(Z.value);
1551
- const R = _.join(" ").toLowerCase();
1552
- return s.every((Z) => R.includes(Z));
1553
- }, y = /* @__PURE__ */ new Map();
1554
- for (const P of A) {
1555
- const _ = ((C = P.product) == null ? void 0 : C.id) ?? "unknown";
1556
- y.has(_) || y.set(_, { productId: _, productTitle: ((M = P.product) == null ? void 0 : M.title) ?? "", variants: [], filteredVariants: [] });
1557
- const R = y.get(_);
1558
- R.variants.push(P), d(P) && R.filteredVariants.push(P);
1669
+ const n = Z.trim().toLowerCase(), i = n ? n.split(/\s+/).filter(Boolean) : [], d = (S) => {
1670
+ var B;
1671
+ if (!i.length) return !0;
1672
+ const _ = [S.displayName];
1673
+ (B = S.product) != null && B.title && _.push(S.product.title);
1674
+ for (const $ of S.selectedOptions ?? [])
1675
+ _.push($.name), _.push($.value);
1676
+ const F = _.join(" ").toLowerCase();
1677
+ return i.every(($) => F.includes($));
1678
+ }, p = /* @__PURE__ */ new Map();
1679
+ for (const S of te) {
1680
+ const _ = ((y = S.product) == null ? void 0 : y.id) ?? "unknown";
1681
+ p.has(_) || p.set(_, { productId: _, productTitle: ((x = S.product) == null ? void 0 : x.title) ?? "", variants: [], filteredVariants: [] });
1682
+ const F = p.get(_);
1683
+ F.variants.push(S), d(S) && F.filteredVariants.push(S);
1559
1684
  }
1560
- return Array.from(y.values()).filter((P) => P.filteredVariants.length > 0);
1561
- }, [b == null ? void 0 : b.groupVariantsByProduct, A, E]), [re, G] = ne(null), x = ie(null);
1562
- U(() => {
1563
- if (!re) return;
1564
- const i = (s) => {
1565
- x.current && !x.current.contains(s.target) && G(null);
1685
+ return Array.from(p.values()).filter((S) => S.filteredVariants.length > 0);
1686
+ }, [b == null ? void 0 : b.groupVariantsByProduct, te, Z]), [O, ue] = X(null), oe = re(null);
1687
+ j(() => {
1688
+ if (!O) return;
1689
+ const n = (i) => {
1690
+ oe.current && !oe.current.contains(i.target) && ue(null);
1566
1691
  };
1567
- return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
1568
- }, [re]);
1569
- const D = $(() => [...(b == null ? void 0 : b.rules) ?? []].sort((i, s) => i.minBundleSize - s.minBundleSize), [b == null ? void 0 : b.rules]), ee = $(() => Math.max(0, ye - W), [W, ye]), Ce = $(() => {
1570
- let i = null;
1571
- for (const s of D)
1572
- W >= s.minBundleSize && (i = s);
1573
- return i;
1574
- }, [W, D]), X = $(() => {
1575
- if (!Ce) return null;
1576
- const i = Number.parseFloat(Ce.discountPercent);
1577
- return !Number.isFinite(i) || i <= 0 ? null : i;
1578
- }, [Ce]), He = D[0], Qe = !!(He && W >= He.minBundleSize), Be = $(() => {
1579
- const i = new Map(F.map((d) => [d.id, d]));
1580
- let s = 0;
1581
- for (const [d, y] of Object.entries(se)) {
1582
- const C = y ?? 0;
1583
- if (C <= 0) continue;
1584
- const M = i.get(d), P = Number(M == null ? void 0 : M.price);
1585
- Number.isFinite(P) && (s += P * C);
1692
+ return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
1693
+ }, [O]);
1694
+ const de = E(() => [...(b == null ? void 0 : b.rules) ?? []].sort((n, i) => n.minBundleSize - i.minBundleSize), [b == null ? void 0 : b.rules]), J = E(() => Math.max(0, U - G), [G, U]), Ae = E(() => {
1695
+ let n = null;
1696
+ for (const i of de)
1697
+ G >= i.minBundleSize && (n = i);
1698
+ return n;
1699
+ }, [G, de]), ne = E(() => {
1700
+ if (!Ae) return null;
1701
+ const n = Number.parseFloat(Ae.discountPercent);
1702
+ return !Number.isFinite(n) || n <= 0 ? null : n;
1703
+ }, [Ae]), Qe = de[0], pt = !!(Qe && G >= Qe.minBundleSize), et = E(() => {
1704
+ const n = new Map(A.map((d) => [d.id, d]));
1705
+ let i = 0;
1706
+ for (const [d, p] of Object.entries(le)) {
1707
+ const y = p ?? 0;
1708
+ if (y <= 0) continue;
1709
+ const x = n.get(d), S = Number(x == null ? void 0 : x.price);
1710
+ Number.isFinite(S) && (i += S * y);
1586
1711
  }
1587
- return Math.round(s * 100) / 100;
1588
- }, [F, se]), vt = $(() => {
1589
- if (!X) return Be;
1590
- const i = Be * (1 - X / 100);
1591
1712
  return Math.round(i * 100) / 100;
1592
- }, [X, Be]), at = $(() => D.length ? Math.max(...D.map((i) => i.minBundleSize)) : 0, [D]), ot = $(() => {
1593
- const i = new Map(F.map((s) => [s.id, s]));
1594
- return q.map((s) => i.get(s)).filter((s) => !!s);
1595
- }, [F, q]), wt = $(() => {
1596
- var s;
1597
- const i = /* @__PURE__ */ new Map();
1598
- for (const d of D) {
1599
- const y = Math.max(0, d.minBundleSize - 1);
1600
- i.set(y, {
1713
+ }, [A, le]), ut = E(() => {
1714
+ if (!ne) return et;
1715
+ const n = et * (1 - ne / 100);
1716
+ return Math.round(n * 100) / 100;
1717
+ }, [ne, et]), _t = E(() => de.length ? Math.max(...de.map((n) => n.minBundleSize)) : 0, [de]), dt = E(() => {
1718
+ const n = new Map(A.map((i) => [i.id, i]));
1719
+ return K.map((i) => n.get(i)).filter((i) => !!i);
1720
+ }, [A, K]), Bt = E(() => {
1721
+ var i;
1722
+ const n = /* @__PURE__ */ new Map();
1723
+ for (const d of de) {
1724
+ const p = Math.max(0, d.minBundleSize - 1);
1725
+ n.set(p, {
1601
1726
  discountPercent: d.discountPercent,
1602
1727
  minBundleSize: d.minBundleSize,
1603
- label: ((s = d.label) == null ? void 0 : s.trim()) || `Buy ${d.minBundleSize}+`
1728
+ label: ((i = d.label) == null ? void 0 : i.trim()) || `Buy ${d.minBundleSize}+`
1604
1729
  });
1605
1730
  }
1606
- return i;
1607
- }, [D]), Xe = $(() => Math.max(at || ye, ot.length), [ot.length, at, ye]), [lt, Ye] = ne(!0), rt = ie(ee);
1608
- U(() => {
1731
+ return n;
1732
+ }, [de]), Tt = E(() => Math.max(_t || U, dt.length), [dt.length, _t, U]), [Ye, st] = X(!0), lt = re(J);
1733
+ j(() => {
1609
1734
  if (((b == null ? void 0 : b.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1610
- const s = rt.current > 0;
1611
- Ye(!(s && ee === 0));
1735
+ const i = lt.current > 0;
1736
+ st(!(i && J === 0));
1612
1737
  }
1613
- rt.current = ee;
1614
- }, [ee, b == null ? void 0 : b.ctaButtonMode]);
1615
- const Ze = ie(null), mt = ie(null), ht = ie(null), gt = ie(W), h = (i) => {
1616
- const s = mt.current;
1617
- if (!s) return;
1618
- const d = s.querySelector(`[data-variant-row="${i}"]`);
1738
+ lt.current = J;
1739
+ }, [J, b == null ? void 0 : b.ctaButtonMode]);
1740
+ const mt = re(null), yt = re(null), ct = re(null), vt = re(G), wt = (n) => {
1741
+ const i = yt.current;
1742
+ if (!i) return;
1743
+ const d = i.querySelector(`[data-variant-row="${n}"]`);
1619
1744
  if (!d) return;
1620
- const y = s.getBoundingClientRect(), C = d.getBoundingClientRect(), M = 8;
1621
- if (C.top >= y.top + M && C.bottom <= y.bottom - M) return;
1622
- const _ = Math.max(0, s.scrollHeight - s.clientHeight), R = C.top - y.top + C.height / 2, O = s.scrollTop + R - s.clientHeight / 2, Z = Math.min(_, Math.max(0, O));
1623
- s.scrollTo({ top: Z, behavior: "smooth" });
1745
+ const p = i.getBoundingClientRect(), y = d.getBoundingClientRect(), x = 8;
1746
+ if (y.top >= p.top + x && y.bottom <= p.bottom - x) return;
1747
+ const _ = Math.max(0, i.scrollHeight - i.clientHeight), F = y.top - p.top + y.height / 2, B = i.scrollTop + F - i.clientHeight / 2, $ = Math.min(_, Math.max(0, B));
1748
+ i.scrollTo({ top: $, behavior: "smooth" });
1624
1749
  };
1625
- return U(() => {
1626
- if (!e) return;
1627
- const i = (s) => {
1628
- s.key === "Escape" && t();
1750
+ return j(() => {
1751
+ if (!w) return;
1752
+ const n = (i) => {
1753
+ i.key === "Escape" && t();
1629
1754
  };
1630
- return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
1631
- }, [t, e]), U(() => {
1755
+ return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
1756
+ }, [t, w]), j(() => {
1632
1757
  if (typeof window > "u") return;
1633
- const i = () => Ve({ width: window.innerWidth, height: window.innerHeight });
1634
- return i(), window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
1635
- }, []), U(() => {
1636
- if (B.current != null && (window.clearTimeout(B.current), B.current = null), e) {
1637
- g(!0);
1758
+ const n = () => ee({ width: window.innerWidth, height: window.innerHeight });
1759
+ return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
1760
+ }, []), j(() => {
1761
+ if (V.current != null && (window.clearTimeout(V.current), V.current = null), w) {
1762
+ R(!0);
1638
1763
  return;
1639
1764
  }
1640
- B.current = window.setTimeout(() => {
1641
- g(!1), B.current = null;
1765
+ V.current = window.setTimeout(() => {
1766
+ R(!1), V.current = null;
1642
1767
  }, 220);
1643
- }, [e]), U(() => () => {
1644
- B.current != null && window.clearTimeout(B.current);
1645
- }, []), U(() => () => {
1646
- Pe.current != null && window.clearTimeout(Pe.current);
1647
- }, []), U(() => () => {
1648
- Ae.current != null && window.clearTimeout(Ae.current);
1649
- }, []), U(() => {
1650
- if (!e || !ge) return;
1651
- const i = requestAnimationFrame(() => {
1652
- var s;
1653
- return (s = ce.current) == null ? void 0 : s.focus();
1768
+ }, [w]), j(() => () => {
1769
+ V.current != null && window.clearTimeout(V.current);
1770
+ }, []), j(() => () => {
1771
+ Te.current != null && window.clearTimeout(Te.current);
1772
+ }, []), j(() => () => {
1773
+ ze.current != null && window.clearTimeout(ze.current);
1774
+ }, []), j(() => {
1775
+ if (!w || !q) return;
1776
+ const n = requestAnimationFrame(() => {
1777
+ var i;
1778
+ return (i = Ne.current) == null ? void 0 : i.focus();
1654
1779
  });
1655
- return () => cancelAnimationFrame(i);
1656
- }, [e, ge]), U(() => {
1657
- const i = gt.current;
1658
- if (gt.current = W, W <= i) return;
1659
- const s = ht.current;
1660
- if (!s) return;
1661
- const d = D.some((P) => P.minBundleSize === W), y = D.find((P) => P.minBundleSize > W), C = y && d ? y.minBundleSize - 1 : y ? null : W - 1;
1662
- if (C == null || C < 0) return;
1663
- const M = requestAnimationFrame(() => {
1664
- const P = s.querySelector(`[data-box-slot="${C}"]`);
1665
- if (!P) return;
1666
- const _ = s.getBoundingClientRect(), O = P.getBoundingClientRect().right - _.right;
1667
- if (O <= 1) return;
1668
- const Z = Math.max(0, s.scrollWidth - s.clientWidth), le = Math.min(Z, Math.max(0, s.scrollLeft + O));
1669
- s.scrollTo({ left: le, behavior: "smooth" });
1780
+ return () => cancelAnimationFrame(n);
1781
+ }, [w, q]), j(() => {
1782
+ const n = vt.current;
1783
+ if (vt.current = G, G <= n) return;
1784
+ const i = ct.current;
1785
+ if (!i) return;
1786
+ const d = de.some((S) => S.minBundleSize === G), p = de.find((S) => S.minBundleSize > G), y = p && d ? p.minBundleSize - 1 : p ? null : G - 1;
1787
+ if (y == null || y < 0) return;
1788
+ const x = requestAnimationFrame(() => {
1789
+ const S = i.querySelector(`[data-box-slot="${y}"]`);
1790
+ if (!S) return;
1791
+ const _ = i.getBoundingClientRect(), B = S.getBoundingClientRect().right - _.right;
1792
+ if (B <= 1) return;
1793
+ const $ = Math.max(0, i.scrollWidth - i.clientWidth), se = Math.min($, Math.max(0, i.scrollLeft + B));
1794
+ i.scrollTo({ left: se, behavior: "smooth" });
1670
1795
  });
1671
- return () => cancelAnimationFrame(M);
1672
- }, [W, D]), U(() => {
1673
- if (!e) return;
1674
- const i = Ie.current;
1675
- if (Ie.current = W, W <= i) return;
1676
- const s = D.find((d) => d.minBundleSize === W);
1677
- s && (Ge(
1678
- k("bundle.celebration.received_discount", {
1679
- discount: De(s.discountPercent)
1796
+ return () => cancelAnimationFrame(x);
1797
+ }, [G, de]), j(() => {
1798
+ if (!w) return;
1799
+ const n = De.current;
1800
+ if (De.current = G, G <= n) return;
1801
+ const i = de.find((d) => d.minBundleSize === G);
1802
+ i && (Fe(
1803
+ I("bundle.celebration.received_discount", {
1804
+ discount: it(i.discountPercent)
1680
1805
  })
1681
- ), Le((d) => d + 1), nt(!0), Ae.current != null && window.clearTimeout(Ae.current), Ae.current = window.setTimeout(() => {
1682
- nt(!1), Ae.current = null;
1683
- }, it));
1684
- }, [W, e, D]), U(() => {
1685
- if (!e || !Re || !je) return;
1686
- const i = requestAnimationFrame(() => {
1806
+ ), je((d) => d + 1), at(!0), ze.current != null && window.clearTimeout(ze.current), ze.current = window.setTimeout(() => {
1807
+ at(!1), ze.current = null;
1808
+ }, rt));
1809
+ }, [G, w, de]), j(() => {
1810
+ if (!w || !Ue || !be) return;
1811
+ const n = requestAnimationFrame(() => {
1687
1812
  var _;
1688
- const s = Se.current, d = s == null ? void 0 : s.getBoundingClientRect(), y = (_ = Ze.current) == null ? void 0 : _.getBoundingClientRect(), C = d ? d.left + d.width / 2 : y ? y.left + y.width / 2 : window.innerWidth / 2, M = d ? d.top + d.height / 2 : y ? y.top + y.height / 2 : window.innerHeight / 2, P = {
1689
- x: C - 2,
1690
- y: M - 2,
1813
+ const i = Be.current, d = i == null ? void 0 : i.getBoundingClientRect(), p = (_ = mt.current) == null ? void 0 : _.getBoundingClientRect(), y = d ? d.left + d.width / 2 : p ? p.left + p.width / 2 : window.innerWidth / 2, x = d ? d.top + d.height / 2 : p ? p.top + p.height / 2 : window.innerHeight / 2, S = {
1814
+ x: y - 2,
1815
+ y: x - 2,
1691
1816
  w: 4,
1692
1817
  h: 4
1693
1818
  };
1694
- Oe(P), Fe((R) => R + 1), ke(!0), Pe.current != null && window.clearTimeout(Pe.current), Pe.current = window.setTimeout(() => {
1695
- ke(!1), Pe.current = null;
1696
- }, tt);
1819
+ Ee(S), Ge((F) => F + 1), ge(!0), Te.current != null && window.clearTimeout(Te.current), Te.current = window.setTimeout(() => {
1820
+ ge(!1), Te.current = null;
1821
+ }, Ke);
1697
1822
  });
1698
- return () => cancelAnimationFrame(i);
1699
- }, [Ee, je, tt, Re, e]), U(() => {
1700
- var i;
1701
- e && ((i = Ze.current) == null || i.focus());
1702
- }, [e]), f ? /* @__PURE__ */ I(
1823
+ return () => cancelAnimationFrame(n);
1824
+ }, [$e, be, Ke, Ue, w]), j(() => {
1825
+ var n;
1826
+ w && ((n = mt.current) == null || n.focus());
1827
+ }, [w]), P ? /* @__PURE__ */ N(
1703
1828
  "div",
1704
1829
  {
1705
1830
  role: "dialog",
1706
1831
  "aria-modal": "true",
1707
- "aria-label": k("bundle.drawer.aria"),
1708
- className: [c.backdrop, e ? c.backdropOpen : c.backdropClosed, a.className].filter(Boolean).join(" "),
1709
- onMouseDown: (i) => {
1710
- i.target === i.currentTarget && t();
1832
+ "aria-label": I("bundle.drawer.aria"),
1833
+ className: [c.backdrop, w ? c.backdropOpen : c.backdropClosed, r.className].filter(Boolean).join(" "),
1834
+ onMouseDown: (n) => {
1835
+ n.target === n.currentTarget && t();
1711
1836
  },
1712
1837
  children: [
1713
- he && Me && be.width > 0 && be.height > 0 ? /* @__PURE__ */ n(
1714
- Pn,
1838
+ we && Re && xe.width > 0 && xe.height > 0 ? /* @__PURE__ */ a(
1839
+ Gn,
1715
1840
  {
1716
- width: be.width,
1717
- height: be.height,
1718
- confettiSource: Me,
1719
- colors: ve,
1841
+ width: xe.width,
1842
+ height: xe.height,
1843
+ confettiSource: Re,
1844
+ colors: pe,
1720
1845
  recycle: !1,
1721
1846
  numberOfPieces: 70,
1722
1847
  tweenDuration: 100,
@@ -1725,259 +1850,266 @@ function Ao(a) {
1725
1850
  initialVelocityX: { min: -6, max: 6 },
1726
1851
  style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
1727
1852
  },
1728
- Ne
1853
+ Ve
1729
1854
  ) : null,
1730
- /* @__PURE__ */ I("aside", { ref: Ze, className: [c.panel, e ? c.panelOpen : c.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1731
- Re && je ? /* @__PURE__ */ n("div", { className: c.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ n("div", { ref: Se, className: c.celebrationChip, children: je }, Ee) }) : null,
1732
- /* @__PURE__ */ I("header", { className: [c.header, ge ? c.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1733
- /* @__PURE__ */ n(
1855
+ /* @__PURE__ */ N("aside", { ref: mt, className: [c.panel, w ? c.panelOpen : c.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1856
+ Ue && be ? /* @__PURE__ */ a("div", { className: c.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ a("div", { ref: Be, className: c.celebrationChip, children: be }, $e) }) : null,
1857
+ /* @__PURE__ */ N("header", { className: [c.header, q ? c.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1858
+ /* @__PURE__ */ a(
1734
1859
  "button",
1735
1860
  {
1736
1861
  type: "button",
1737
1862
  className: c.searchIconButton,
1738
- "aria-label": k(ge ? "bundle.search.expanded" : "bundle.search"),
1739
- "aria-expanded": ge,
1863
+ "aria-label": I(q ? "bundle.search.expanded" : "bundle.search"),
1864
+ "aria-expanded": q,
1740
1865
  onClick: () => {
1741
- z(!0);
1866
+ Q(!0);
1742
1867
  },
1743
- children: /* @__PURE__ */ n(qn, { size: 18, "aria-hidden": "true" })
1868
+ children: /* @__PURE__ */ a(Zn, { size: 18, "aria-hidden": "true" })
1744
1869
  }
1745
1870
  ),
1746
- /* @__PURE__ */ I("div", { className: c.headerCenter, children: [
1747
- /* @__PURE__ */ n("div", { className: c.headerTitleWrap, "aria-hidden": ge, children: /* @__PURE__ */ n("h2", { className: c.title, children: j }) }),
1748
- /* @__PURE__ */ n("div", { className: c.headerSearchWrap, "aria-hidden": !ge, children: /* @__PURE__ */ I("div", { className: c.searchBar, children: [
1749
- /* @__PURE__ */ n(
1871
+ /* @__PURE__ */ N("div", { className: c.headerCenter, children: [
1872
+ /* @__PURE__ */ a("div", { className: c.headerTitleWrap, "aria-hidden": q, children: /* @__PURE__ */ a("h2", { className: c.title, children: ot }) }),
1873
+ /* @__PURE__ */ a("div", { className: c.headerSearchWrap, "aria-hidden": !q, children: /* @__PURE__ */ N("div", { className: c.searchBar, children: [
1874
+ /* @__PURE__ */ a(
1750
1875
  "input",
1751
1876
  {
1752
- ref: ce,
1877
+ ref: Ne,
1753
1878
  className: c.searchInput,
1754
1879
  type: "search",
1755
- value: E,
1756
- placeholder: k("bundle.search.placeholder"),
1757
- onChange: (i) => me(i.target.value),
1880
+ value: Z,
1881
+ placeholder: I("bundle.search.placeholder"),
1882
+ onChange: (n) => ce(n.target.value),
1758
1883
  onBlur: () => {
1759
- E.trim() === "" && z(!1);
1884
+ Z.trim() === "" && Q(!1);
1760
1885
  }
1761
1886
  }
1762
1887
  ),
1763
- E.trim() ? /* @__PURE__ */ n(
1888
+ Z.trim() ? /* @__PURE__ */ a(
1764
1889
  "button",
1765
1890
  {
1766
1891
  type: "button",
1767
1892
  className: c.searchClearButton,
1768
- onMouseDown: (i) => {
1769
- i.preventDefault();
1893
+ onMouseDown: (n) => {
1894
+ n.preventDefault();
1770
1895
  },
1771
1896
  onClick: () => {
1772
- var i;
1773
- me(""), (i = ce.current) == null || i.focus();
1897
+ var n;
1898
+ ce(""), (n = Ne.current) == null || n.focus();
1774
1899
  },
1775
- "aria-label": k("bundle.search.clear"),
1776
- children: k("bundle.search.clear")
1900
+ "aria-label": I("bundle.search.clear"),
1901
+ children: I("bundle.search.clear")
1777
1902
  }
1778
1903
  ) : null
1779
1904
  ] }) })
1780
1905
  ] }),
1781
- /* @__PURE__ */ n("button", { type: "button", onClick: t, disabled: o, className: c.closeButton, "aria-label": k("bundle.close"), children: "×" })
1906
+ /* @__PURE__ */ a("button", { type: "button", onClick: t, disabled: s, className: c.closeButton, "aria-label": I("bundle.close"), children: "×" })
1782
1907
  ] }),
1783
- /* @__PURE__ */ I("div", { className: c.body, ref: mt, children: [
1784
- l ? /* @__PURE__ */ n("p", { className: c.muted, children: k("bundle.loading") }) : null,
1785
- r ? /* @__PURE__ */ n("p", { className: c.error, children: r }) : null,
1786
- /* @__PURE__ */ n("div", { className: c.variants, children: !l && !r && F.length === 0 ? /* @__PURE__ */ n("p", { className: c.emptyState, children: k("bundle.empty") }) : oe ? /* @__PURE__ */ n("ul", { className: c.variantList, children: oe.map((i) => {
1787
- var M, P;
1788
- const s = ((M = i.variants.find((_) => {
1789
- var R;
1790
- return (R = _.image) == null ? void 0 : R.url;
1791
- })) == null ? void 0 : M.image) ?? null, d = i.variants.length > 1, y = re === i.productId, C = i.variants.filter((_) => (se[_.id] ?? 0) > 0);
1908
+ /* @__PURE__ */ N("div", { className: c.body, ref: yt, children: [
1909
+ l ? /* @__PURE__ */ a("p", { className: c.muted, children: I("bundle.loading") }) : null,
1910
+ o ? /* @__PURE__ */ a("p", { className: c.error, children: o }) : null,
1911
+ /* @__PURE__ */ a("div", { className: c.variants, children: !l && !o && A.length === 0 ? /* @__PURE__ */ a("p", { className: c.emptyState, children: I("bundle.empty") }) : C ? /* @__PURE__ */ a("ul", { className: c.variantList, children: C.map((n) => {
1912
+ var x, S;
1913
+ const i = ((x = n.variants.find((_) => {
1914
+ var F;
1915
+ return (F = _.image) == null ? void 0 : F.url;
1916
+ })) == null ? void 0 : x.image) ?? null, d = n.variants.length > 1, p = O === n.productId, y = n.variants.filter((_) => (le[_.id] ?? 0) > 0);
1792
1917
  if (!d) {
1793
- const _ = i.variants[0];
1918
+ const _ = n.variants[0];
1794
1919
  if (!_) return null;
1795
- const R = se[_.id] ?? 0, O = Ue(_), Z = Y(_.id), le = Z ?? Number.POSITIVE_INFINITY, te = R >= le, J = _.availableForSale === !1, fe = !J && !N && !te, L = !J && te ? k("bundle.stock.max_reached") : null, Q = Number(_.price), pe = X != null && Number.isFinite(X) && X > 0 && Number.isFinite(Q), We = pe ? Math.round(Q * (1 - X / 100) * 100) / 100 : null, Pt = (P = _.title) == null ? void 0 : P.trim(), Et = $e(_.selectedOptions) ?? (Pt && Pt.toLowerCase() !== "default title" ? Pt : null);
1796
- return /* @__PURE__ */ I("li", { className: [c.variantRow, J ? c.variantRowSoldOut : null].filter(Boolean).join(" "), "data-variant-row": _.id, children: [
1797
- /* @__PURE__ */ I("div", { className: c.variantLeft, children: [
1798
- /* @__PURE__ */ n("div", { className: c.variantThumb, "aria-hidden": "true", children: s != null && s.url ? /* @__PURE__ */ n("img", { className: c.variantThumbImg, src: s.url, alt: s.altText ?? i.productTitle, loading: "lazy" }) : /* @__PURE__ */ n("div", { className: c.variantThumbFallback, children: i.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
1799
- /* @__PURE__ */ I("div", { className: c.variantInfo, children: [
1800
- /* @__PURE__ */ n("div", { className: c.variantName, children: i.productTitle }),
1801
- Et ? /* @__PURE__ */ n("div", { className: c.variantMeta, children: Et }) : null,
1802
- /* @__PURE__ */ I("div", { className: c.variantPriceRow, children: [
1803
- pe ? /* @__PURE__ */ n("span", { className: c.variantCompareAt, children: T(Q.toFixed(2)) }) : null,
1804
- /* @__PURE__ */ n("span", { className: c.variantPrice, children: T(We != null ? We.toFixed(2) : Q.toFixed(2)) })
1920
+ const F = le[_.id] ?? 0, B = Je(_), $ = ke(_.id), se = $ ?? Number.POSITIVE_INFINITY, _e = F >= se, H = _.availableForSale === !1, ae = !H && !L && !_e, Y = !H && _e ? I("bundle.stock.max_reached") : null, fe = Number(_.price), Ce = ne != null && Number.isFinite(ne) && ne > 0 && Number.isFinite(fe), M = Ce ? Math.round(fe * (1 - ne / 100) * 100) / 100 : null, ve = (S = _.title) == null ? void 0 : S.trim(), Oe = Le(_.selectedOptions) ?? (ve && ve.toLowerCase() !== "default title" ? ve : null);
1921
+ return /* @__PURE__ */ N("li", { className: [c.variantRow, H ? c.variantRowSoldOut : null].filter(Boolean).join(" "), "data-variant-row": _.id, children: [
1922
+ /* @__PURE__ */ N("div", { className: c.variantLeft, children: [
1923
+ /* @__PURE__ */ a("div", { className: c.variantThumb, "aria-hidden": "true", children: i != null && i.url ? /* @__PURE__ */ a("img", { className: c.variantThumbImg, src: i.url, alt: i.altText ?? n.productTitle, loading: "lazy" }) : /* @__PURE__ */ a("div", { className: c.variantThumbFallback, children: n.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
1924
+ /* @__PURE__ */ N("div", { className: c.variantInfo, children: [
1925
+ /* @__PURE__ */ a("div", { className: c.variantName, children: n.productTitle }),
1926
+ Oe ? /* @__PURE__ */ a("div", { className: c.variantMeta, children: Oe }) : null,
1927
+ /* @__PURE__ */ N("div", { className: c.variantPriceRow, children: [
1928
+ Ce ? /* @__PURE__ */ a("span", { className: c.variantCompareAt, children: T(fe.toFixed(2)) }) : null,
1929
+ /* @__PURE__ */ a("span", { className: c.variantPrice, children: T(M != null ? M.toFixed(2) : fe.toFixed(2)) })
1805
1930
  ] })
1806
1931
  ] })
1807
1932
  ] }),
1808
- J ? /* @__PURE__ */ n("div", { className: c.soldOutContainer, children: /* @__PURE__ */ n("span", { className: c.soldOut, "aria-label": k("bundle.a11y.sold_out", { name: O }), children: k("bundle.stock.sold_out") }) }) : R <= 0 && le <= 0 ? /* @__PURE__ */ n("div", { className: c.stockLimitContainer, children: /* @__PURE__ */ n("span", { className: c.stockLimitNotice, children: k("bundle.stock.max_added") }) }) : R <= 0 ? /* @__PURE__ */ n("button", { type: "button", onClick: () => de(_.id, 1), disabled: o || !fe, className: c.addToBundleButton, "aria-label": k("bundle.a11y.add_to_bundle", { name: O }), children: k("bundle.cta.add_to_bundle") }) : /* @__PURE__ */ I("div", { className: c.qtyControlsWrap, children: [
1809
- /* @__PURE__ */ I("div", { className: c.qtyControls, children: [
1810
- /* @__PURE__ */ n("button", { type: "button", onClick: () => de(_.id, R - 1), disabled: o || R <= 0, className: c.qtyButton, "aria-label": k("bundle.a11y.decrease", { name: O }), children: "−" }),
1811
- /* @__PURE__ */ n("span", { className: c.qtyValue, "aria-label": k("bundle.a11y.quantity", { name: O, qty: R }), children: R }),
1812
- /* @__PURE__ */ n("button", { type: "button", onClick: () => de(_.id, R + 1), disabled: o || !fe, className: c.qtyButton, "aria-label": L ? `${O} ${L.toLowerCase()}` : k("bundle.a11y.increase", { name: O }), children: "+" })
1933
+ H ? /* @__PURE__ */ a("div", { className: c.soldOutContainer, children: /* @__PURE__ */ a("span", { className: c.soldOut, "aria-label": I("bundle.a11y.sold_out", { name: B }), children: I("bundle.stock.sold_out") }) }) : F <= 0 && se <= 0 ? /* @__PURE__ */ a("div", { className: c.stockLimitContainer, children: /* @__PURE__ */ a("span", { className: c.stockLimitNotice, children: I("bundle.stock.max_added") }) }) : F <= 0 ? /* @__PURE__ */ a("button", { type: "button", onClick: () => W(_, 1), disabled: s || !ae, className: c.addToBundleButton, "aria-label": I("bundle.a11y.add_to_bundle", { name: B }), children: I("bundle.cta.add_to_bundle") }) : /* @__PURE__ */ N("div", { className: c.qtyControlsWrap, children: [
1934
+ /* @__PURE__ */ N("div", { className: c.qtyControls, children: [
1935
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => ie(_.id, F - 1), disabled: s || F <= 0, className: c.qtyButton, "aria-label": I("bundle.a11y.decrease", { name: B }), children: "−" }),
1936
+ /* @__PURE__ */ a("span", { className: c.qtyValue, "aria-label": I("bundle.a11y.quantity", { name: B, qty: F }), children: F }),
1937
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => W(_, F + 1), disabled: s || !ae, className: c.qtyButton, "aria-label": Y ? `${B} ${Y.toLowerCase()}` : I("bundle.a11y.increase", { name: B }), children: "+" })
1813
1938
  ] }),
1814
- L ? /* @__PURE__ */ n("div", { className: c.stockLimitNotice, children: L }) : null
1939
+ Y ? /* @__PURE__ */ a("div", { className: c.stockLimitNotice, children: Y }) : null
1815
1940
  ] })
1816
- ] }, i.productId);
1941
+ ] }, n.productId);
1817
1942
  }
1818
- return /* @__PURE__ */ I("li", { ref: y ? x : null, className: c.drawerProductGroup, children: [
1819
- /* @__PURE__ */ I("div", { className: c.variantRow, "data-variant-row": i.productId, children: [
1820
- /* @__PURE__ */ I("div", { className: c.variantLeft, children: [
1821
- /* @__PURE__ */ n("div", { className: c.variantThumb, "aria-hidden": "true", children: s != null && s.url ? /* @__PURE__ */ n("img", { className: c.variantThumbImg, src: s.url, alt: s.altText ?? i.productTitle, loading: "lazy" }) : /* @__PURE__ */ n("div", { className: c.variantThumbFallback, children: i.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
1822
- /* @__PURE__ */ n("div", { className: c.variantInfo, children: /* @__PURE__ */ n("div", { className: c.variantName, children: i.productTitle }) })
1943
+ return /* @__PURE__ */ N("li", { ref: p ? oe : null, className: c.drawerProductGroup, children: [
1944
+ /* @__PURE__ */ N("div", { className: c.variantRow, "data-variant-row": n.productId, children: [
1945
+ /* @__PURE__ */ N("div", { className: c.variantLeft, children: [
1946
+ /* @__PURE__ */ a("div", { className: c.variantThumb, "aria-hidden": "true", children: i != null && i.url ? /* @__PURE__ */ a("img", { className: c.variantThumbImg, src: i.url, alt: i.altText ?? n.productTitle, loading: "lazy" }) : /* @__PURE__ */ a("div", { className: c.variantThumbFallback, children: n.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
1947
+ /* @__PURE__ */ a("div", { className: c.variantInfo, children: /* @__PURE__ */ a("div", { className: c.variantName, children: n.productTitle }) })
1823
1948
  ] }),
1824
- /* @__PURE__ */ I(
1949
+ /* @__PURE__ */ N(
1825
1950
  "button",
1826
1951
  {
1827
1952
  type: "button",
1828
1953
  className: [c.addToBundleButton, c.selectButton].filter(Boolean).join(" "),
1829
- "aria-expanded": y,
1830
- disabled: o,
1954
+ "aria-expanded": p,
1955
+ disabled: s,
1831
1956
  onMouseDown: (_) => _.stopPropagation(),
1832
- onClick: () => G((_) => _ === i.productId ? null : i.productId),
1957
+ onClick: () => ue((_) => _ === n.productId ? null : n.productId),
1833
1958
  children: [
1834
- k("bundle.select.variant"),
1835
- /* @__PURE__ */ n(Zt, { size: 13, strokeWidth: 2.5, className: [c.selectButtonChevron, y ? c.selectButtonChevronOpen : null].filter(Boolean).join(" ") })
1959
+ I("bundle.select.variant"),
1960
+ /* @__PURE__ */ a(dn, { size: 13, strokeWidth: 2.5, className: [c.selectButtonChevron, p ? c.selectButtonChevronOpen : null].filter(Boolean).join(" ") })
1836
1961
  ]
1837
1962
  }
1838
1963
  )
1839
1964
  ] }),
1840
- y && /* @__PURE__ */ n("div", { className: c.variantPicker, children: i.filteredVariants.map((_) => {
1841
- const R = Y(_.id), O = (se[_.id] ?? 0) > 0, Z = _.availableForSale === !1, le = R != null && R <= 0, te = !O && N, J = o || Z || le || te, fe = Z ? k("bundle.stock.sold_out") : le ? k("bundle.stock.max_added") : te ? k("bundle.stock.max_reached") : null, L = m(_), Q = Number(_.price), pe = X != null && Number.isFinite(X) && X > 0 && Number.isFinite(Q), We = pe ? Math.round(Q * (1 - X / 100) * 100) / 100 : null;
1842
- return /* @__PURE__ */ I(
1965
+ p && /* @__PURE__ */ a("div", { className: c.variantPicker, children: n.filteredVariants.map((_) => {
1966
+ const F = ke(_.id), B = (le[_.id] ?? 0) > 0, $ = _.availableForSale === !1, se = F != null && F <= 0, _e = !B && L, H = s || $ || se || _e, ae = $ ? I("bundle.stock.sold_out") : se ? I("bundle.stock.max_added") : _e ? I("bundle.stock.max_reached") : null, Y = Xe(_), fe = Number(_.price), Ce = ne != null && Number.isFinite(ne) && ne > 0 && Number.isFinite(fe), M = Ce ? Math.round(fe * (1 - ne / 100) * 100) / 100 : null;
1967
+ return /* @__PURE__ */ N(
1843
1968
  "button",
1844
1969
  {
1845
1970
  type: "button",
1846
- disabled: J,
1847
- className: [c.variantPickerRow, O ? c.variantPickerRowSelected : null].filter(Boolean).join(" "),
1971
+ disabled: H,
1972
+ className: [c.variantPickerRow, B ? c.variantPickerRowSelected : null].filter(Boolean).join(" "),
1848
1973
  onClick: () => {
1849
- O || de(_.id, 1), G(null);
1974
+ if (!B) {
1975
+ if (h) {
1976
+ W(_, 1), ue(null);
1977
+ return;
1978
+ }
1979
+ W(_, 1);
1980
+ }
1981
+ ue(null);
1850
1982
  },
1851
1983
  children: [
1852
- /* @__PURE__ */ n("span", { className: c.variantPickerLabel, children: L }),
1853
- /* @__PURE__ */ n("span", { className: c.variantPickerPriceGroup, children: fe ? /* @__PURE__ */ n("span", { className: c.variantPickerSoldOut, children: fe }) : /* @__PURE__ */ I(ct, { children: [
1854
- pe ? /* @__PURE__ */ n("span", { className: c.variantPickerCompareAt, children: T(Q.toFixed(2)) }) : null,
1855
- /* @__PURE__ */ n("span", { className: c.variantPickerPrice, children: T(We != null ? We.toFixed(2) : Q.toFixed(2)) })
1984
+ /* @__PURE__ */ a("span", { className: c.variantPickerLabel, children: Y }),
1985
+ /* @__PURE__ */ a("span", { className: c.variantPickerPriceGroup, children: ae ? /* @__PURE__ */ a("span", { className: c.variantPickerSoldOut, children: ae }) : /* @__PURE__ */ N(bt, { children: [
1986
+ Ce ? /* @__PURE__ */ a("span", { className: c.variantPickerCompareAt, children: T(fe.toFixed(2)) }) : null,
1987
+ /* @__PURE__ */ a("span", { className: c.variantPickerPrice, children: T(M != null ? M.toFixed(2) : fe.toFixed(2)) })
1856
1988
  ] }) }),
1857
- O ? /* @__PURE__ */ n("span", { className: c.variantPickerCheck, "aria-hidden": "true", children: "✓" }) : null
1989
+ B ? /* @__PURE__ */ a("span", { className: c.variantPickerCheck, "aria-hidden": "true", children: "✓" }) : null
1858
1990
  ]
1859
1991
  },
1860
1992
  _.id
1861
1993
  );
1862
1994
  }) }),
1863
- C.length > 0 && /* @__PURE__ */ n("div", { className: c.drawerSelectedList, children: C.map((_) => {
1864
- const R = se[_.id] ?? 0, O = Ue(_), Z = Y(_.id), le = Z ?? Number.POSITIVE_INFINITY, te = R >= le, J = _.availableForSale !== !1 && !N && !te, fe = _.availableForSale !== !1 && te ? k("bundle.stock.max_reached") : null, L = Number(_.price), Q = X != null && Number.isFinite(X) && X > 0 && Number.isFinite(L), pe = Q ? Math.round(L * (1 - X / 100) * 100) / 100 : null, We = m(_);
1865
- return /* @__PURE__ */ I("div", { className: c.drawerSubRow, "data-variant-row": _.id, children: [
1866
- /* @__PURE__ */ I("div", { className: c.drawerSubRowInfo, children: [
1867
- /* @__PURE__ */ n("span", { className: c.drawerSubRowName, children: We }),
1868
- /* @__PURE__ */ I("div", { className: c.variantPriceRow, children: [
1869
- Q ? /* @__PURE__ */ n("span", { className: c.variantCompareAt, children: T(L.toFixed(2)) }) : null,
1870
- /* @__PURE__ */ n("span", { className: c.variantPrice, children: T(pe != null ? pe.toFixed(2) : L.toFixed(2)) })
1995
+ y.length > 0 && /* @__PURE__ */ a("div", { className: c.drawerSelectedList, children: y.map((_) => {
1996
+ const F = le[_.id] ?? 0, B = Je(_), $ = ke(_.id), se = $ ?? Number.POSITIVE_INFINITY, _e = F >= se, H = _.availableForSale !== !1 && !L && !_e, ae = _.availableForSale !== !1 && _e ? I("bundle.stock.max_reached") : null, Y = Number(_.price), fe = ne != null && Number.isFinite(ne) && ne > 0 && Number.isFinite(Y), Ce = fe ? Math.round(Y * (1 - ne / 100) * 100) / 100 : null, M = Xe(_);
1997
+ return /* @__PURE__ */ N("div", { className: c.drawerSubRow, "data-variant-row": _.id, children: [
1998
+ /* @__PURE__ */ N("div", { className: c.drawerSubRowInfo, children: [
1999
+ /* @__PURE__ */ a("span", { className: c.drawerSubRowName, children: M }),
2000
+ /* @__PURE__ */ N("div", { className: c.variantPriceRow, children: [
2001
+ fe ? /* @__PURE__ */ a("span", { className: c.variantCompareAt, children: T(Y.toFixed(2)) }) : null,
2002
+ /* @__PURE__ */ a("span", { className: c.variantPrice, children: T(Ce != null ? Ce.toFixed(2) : Y.toFixed(2)) })
1871
2003
  ] })
1872
2004
  ] }),
1873
- /* @__PURE__ */ I("div", { className: c.qtyControlsWrap, children: [
1874
- /* @__PURE__ */ I("div", { className: c.qtyControls, children: [
1875
- /* @__PURE__ */ n("button", { type: "button", onClick: () => de(_.id, R - 1), disabled: o || R <= 0, className: c.qtyButton, "aria-label": k("bundle.a11y.decrease", { name: O }), children: "−" }),
1876
- /* @__PURE__ */ n("span", { className: c.qtyValue, "aria-label": k("bundle.a11y.quantity", { name: O, qty: R }), children: R }),
1877
- /* @__PURE__ */ n("button", { type: "button", onClick: () => de(_.id, R + 1), disabled: o || !J, className: c.qtyButton, "aria-label": fe ? `${O} ${fe.toLowerCase()}` : k("bundle.a11y.increase", { name: O }), children: "+" })
2005
+ /* @__PURE__ */ N("div", { className: c.qtyControlsWrap, children: [
2006
+ /* @__PURE__ */ N("div", { className: c.qtyControls, children: [
2007
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => ie(_.id, F - 1), disabled: s || F <= 0, className: c.qtyButton, "aria-label": I("bundle.a11y.decrease", { name: B }), children: "−" }),
2008
+ /* @__PURE__ */ a("span", { className: c.qtyValue, "aria-label": I("bundle.a11y.quantity", { name: B, qty: F }), children: F }),
2009
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => W(_, F + 1), disabled: s || !H, className: c.qtyButton, "aria-label": ae ? `${B} ${ae.toLowerCase()}` : I("bundle.a11y.increase", { name: B }), children: "+" })
1878
2010
  ] }),
1879
- fe ? /* @__PURE__ */ n("div", { className: c.stockLimitNotice, children: fe }) : null
2011
+ ae ? /* @__PURE__ */ a("div", { className: c.stockLimitNotice, children: ae }) : null
1880
2012
  ] })
1881
2013
  ] }, _.id);
1882
2014
  }) })
1883
- ] }, i.productId);
1884
- }) }) : /* @__PURE__ */ n("ul", { className: c.variantList, children: V.map((i) => {
1885
- var fe, L, Q, pe;
1886
- const s = se[i.id] ?? 0, d = ze(i), y = $e(i.selectedOptions), C = Ue(i), M = Y(i.id), P = M ?? Number.POSITIVE_INFINITY, _ = s >= P, R = i.availableForSale !== !1 && !N && !_, O = i.availableForSale === !1 ? null : _ ? k("bundle.stock.max_reached") : null, Z = X, le = Number(i.price), te = Z != null && Number.isFinite(Z) && Z > 0 && Number.isFinite(le), J = te ? Math.round(le * (1 - Z / 100) * 100) / 100 : null;
1887
- return /* @__PURE__ */ I(
2015
+ ] }, n.productId);
2016
+ }) }) : /* @__PURE__ */ a("ul", { className: c.variantList, children: D.map((n) => {
2017
+ var ae, Y, fe, Ce;
2018
+ const i = le[n.id] ?? 0, d = We(n), p = Le(n.selectedOptions), y = Je(n), x = ke(n.id), S = x ?? Number.POSITIVE_INFINITY, _ = i >= S, F = n.availableForSale !== !1 && !L && !_, B = n.availableForSale === !1 ? null : _ ? I("bundle.stock.max_reached") : null, $ = ne, se = Number(n.price), _e = $ != null && Number.isFinite($) && $ > 0 && Number.isFinite(se), H = _e ? Math.round(se * (1 - $ / 100) * 100) / 100 : null;
2019
+ return /* @__PURE__ */ N(
1888
2020
  "li",
1889
2021
  {
1890
- className: [c.variantRow, i.availableForSale === !1 && c.variantRowSoldOut].filter(Boolean).join(" "),
1891
- "data-variant-row": i.id,
2022
+ className: [c.variantRow, n.availableForSale === !1 && c.variantRowSoldOut].filter(Boolean).join(" "),
2023
+ "data-variant-row": n.id,
1892
2024
  children: [
1893
- /* @__PURE__ */ I("div", { className: c.variantLeft, children: [
1894
- /* @__PURE__ */ n("div", { className: c.variantThumb, "aria-hidden": "true", children: (fe = i.image) != null && fe.url ? /* @__PURE__ */ n(
2025
+ /* @__PURE__ */ N("div", { className: c.variantLeft, children: [
2026
+ /* @__PURE__ */ a("div", { className: c.variantThumb, "aria-hidden": "true", children: (ae = n.image) != null && ae.url ? /* @__PURE__ */ a(
1895
2027
  "img",
1896
2028
  {
1897
2029
  className: c.variantThumbImg,
1898
- src: i.image.url,
1899
- alt: i.image.altText ?? C,
2030
+ src: n.image.url,
2031
+ alt: n.image.altText ?? y,
1900
2032
  loading: "lazy"
1901
2033
  }
1902
- ) : /* @__PURE__ */ n("div", { className: c.variantThumbFallback, children: ((pe = (Q = (L = i.product) == null ? void 0 : L.title) == null ? void 0 : Q.slice(0, 1)) == null ? void 0 : pe.toUpperCase()) ?? "•" }) }),
1903
- /* @__PURE__ */ I("div", { className: c.variantInfo, children: [
1904
- /* @__PURE__ */ n("div", { className: c.variantName, children: d }),
1905
- y ? /* @__PURE__ */ n("div", { className: c.variantMeta, children: y }) : null,
1906
- /* @__PURE__ */ I("div", { className: c.variantPriceRow, children: [
1907
- te ? /* @__PURE__ */ n("span", { className: c.variantCompareAt, children: T(Number.isFinite(le) ? le.toFixed(2) : i.price) }) : null,
1908
- /* @__PURE__ */ n("span", { className: c.variantPrice, children: T(
1909
- J != null ? J.toFixed(2) : Number.isFinite(le) ? le.toFixed(2) : i.price
2034
+ ) : /* @__PURE__ */ a("div", { className: c.variantThumbFallback, children: ((Ce = (fe = (Y = n.product) == null ? void 0 : Y.title) == null ? void 0 : fe.slice(0, 1)) == null ? void 0 : Ce.toUpperCase()) ?? "•" }) }),
2035
+ /* @__PURE__ */ N("div", { className: c.variantInfo, children: [
2036
+ /* @__PURE__ */ a("div", { className: c.variantName, children: d }),
2037
+ p ? /* @__PURE__ */ a("div", { className: c.variantMeta, children: p }) : null,
2038
+ /* @__PURE__ */ N("div", { className: c.variantPriceRow, children: [
2039
+ _e ? /* @__PURE__ */ a("span", { className: c.variantCompareAt, children: T(Number.isFinite(se) ? se.toFixed(2) : n.price) }) : null,
2040
+ /* @__PURE__ */ a("span", { className: c.variantPrice, children: T(
2041
+ H != null ? H.toFixed(2) : Number.isFinite(se) ? se.toFixed(2) : n.price
1910
2042
  ) })
1911
2043
  ] })
1912
2044
  ] })
1913
2045
  ] }),
1914
- i.availableForSale === !1 ? /* @__PURE__ */ n("div", { className: c.soldOutContainer, children: /* @__PURE__ */ n("span", { className: c.soldOut, "aria-label": k("bundle.a11y.sold_out", { name: C }), children: k("bundle.stock.sold_out") }) }) : s <= 0 && P <= 0 ? /* @__PURE__ */ n("div", { className: c.stockLimitContainer, children: /* @__PURE__ */ n("span", { className: c.stockLimitNotice, "aria-label": k("bundle.a11y.max_available_selected", { name: C }), children: k("bundle.stock.max_added") }) }) : s <= 0 ? /* @__PURE__ */ n(
2046
+ n.availableForSale === !1 ? /* @__PURE__ */ a("div", { className: c.soldOutContainer, children: /* @__PURE__ */ a("span", { className: c.soldOut, "aria-label": I("bundle.a11y.sold_out", { name: y }), children: I("bundle.stock.sold_out") }) }) : i <= 0 && S <= 0 ? /* @__PURE__ */ a("div", { className: c.stockLimitContainer, children: /* @__PURE__ */ a("span", { className: c.stockLimitNotice, "aria-label": I("bundle.a11y.max_available_selected", { name: y }), children: I("bundle.stock.max_added") }) }) : i <= 0 ? /* @__PURE__ */ a(
1915
2047
  "button",
1916
2048
  {
1917
2049
  type: "button",
1918
- onClick: () => de(i.id, 1),
1919
- disabled: o || !R,
2050
+ onClick: () => W(n, 1),
2051
+ disabled: s || !F,
1920
2052
  className: c.addToBundleButton,
1921
- "aria-label": O ? `${C} ${O.toLowerCase()}` : k("bundle.a11y.add_to_bundle", { name: C }),
1922
- children: k("bundle.cta.add_to_bundle")
2053
+ "aria-label": B ? `${y} ${B.toLowerCase()}` : I("bundle.a11y.add_to_bundle", { name: y }),
2054
+ children: I("bundle.cta.add_to_bundle")
1923
2055
  }
1924
- ) : /* @__PURE__ */ I("div", { className: c.qtyControlsWrap, children: [
1925
- /* @__PURE__ */ I("div", { className: c.qtyControls, children: [
1926
- /* @__PURE__ */ n(
2056
+ ) : /* @__PURE__ */ N("div", { className: c.qtyControlsWrap, children: [
2057
+ /* @__PURE__ */ N("div", { className: c.qtyControls, children: [
2058
+ /* @__PURE__ */ a(
1927
2059
  "button",
1928
2060
  {
1929
2061
  type: "button",
1930
- onClick: () => de(i.id, s - 1),
1931
- disabled: o || s <= 0,
2062
+ onClick: () => ie(n.id, i - 1),
2063
+ disabled: s || i <= 0,
1932
2064
  className: c.qtyButton,
1933
- "aria-label": k("bundle.a11y.decrease", { name: C }),
2065
+ "aria-label": I("bundle.a11y.decrease", { name: y }),
1934
2066
  children: "−"
1935
2067
  }
1936
2068
  ),
1937
- /* @__PURE__ */ n("span", { className: c.qtyValue, "aria-label": k("bundle.a11y.quantity", { name: C, qty: s }), children: s }),
1938
- /* @__PURE__ */ n(
2069
+ /* @__PURE__ */ a("span", { className: c.qtyValue, "aria-label": I("bundle.a11y.quantity", { name: y, qty: i }), children: i }),
2070
+ /* @__PURE__ */ a(
1939
2071
  "button",
1940
2072
  {
1941
2073
  type: "button",
1942
- onClick: () => de(i.id, s + 1),
1943
- disabled: o || !R,
2074
+ onClick: () => W(n, i + 1),
2075
+ disabled: s || !F,
1944
2076
  className: c.qtyButton,
1945
- "aria-label": O ? `${C} ${O.toLowerCase()}` : k("bundle.a11y.increase", { name: C }),
2077
+ "aria-label": B ? `${y} ${B.toLowerCase()}` : I("bundle.a11y.increase", { name: y }),
1946
2078
  children: "+"
1947
2079
  }
1948
2080
  )
1949
2081
  ] }),
1950
- O ? /* @__PURE__ */ n("div", { className: c.stockLimitNotice, children: O }) : null
2082
+ B ? /* @__PURE__ */ a("div", { className: c.stockLimitNotice, children: B }) : null
1951
2083
  ] })
1952
2084
  ]
1953
2085
  },
1954
- i.id
2086
+ n.id
1955
2087
  );
1956
2088
  }) }) })
1957
2089
  ] }),
1958
- /* @__PURE__ */ I("footer", { className: c.footer, ref: xe, children: [
1959
- /* @__PURE__ */ n("div", { className: c.boxSummaryWindow, ref: ht, children: /* @__PURE__ */ n("div", { className: c.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Xe }).map((i, s) => {
1960
- var O, Z, le, te;
1961
- const d = ot[s], y = wt.get(s), C = !!d, M = !!y, P = M && !C, _ = y ? k("bundle.discount.off_label", { discount: De(y.discountPercent) }) : null, R = C ? d.displayName : k("bundle.slot", { slot: s + 1 });
1962
- return /* @__PURE__ */ I("div", { "data-box-slot": s, className: c.boxSlot, children: [
1963
- /* @__PURE__ */ n(
2090
+ /* @__PURE__ */ N("footer", { className: c.footer, ref: qe, children: [
2091
+ /* @__PURE__ */ a("div", { className: c.boxSummaryWindow, ref: ct, children: /* @__PURE__ */ a("div", { className: c.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Tt }).map((n, i) => {
2092
+ var B, $, se, _e;
2093
+ const d = dt[i], p = Bt.get(i), y = !!d, x = !!p, S = x && !y, _ = p ? I("bundle.discount.off_label", { discount: it(p.discountPercent) }) : null, F = y ? d.displayName : I("bundle.slot", { slot: i + 1 });
2094
+ return /* @__PURE__ */ N("div", { "data-box-slot": i, className: c.boxSlot, children: [
2095
+ /* @__PURE__ */ a(
1964
2096
  "div",
1965
2097
  {
1966
2098
  className: [
1967
2099
  c.boxItem,
1968
- C ? c.boxItemFilled : c.boxItemPlaceholder,
1969
- M ? c.boxItemThreshold : null,
1970
- C ? c.boxItemClickable : null
2100
+ y ? c.boxItemFilled : c.boxItemPlaceholder,
2101
+ x ? c.boxItemThreshold : null,
2102
+ y ? c.boxItemClickable : null
1971
2103
  ].filter(Boolean).join(" "),
1972
- role: C ? "button" : void 0,
1973
- tabIndex: C ? 0 : void 0,
1974
- onClick: C ? () => h(d.id) : void 0,
1975
- onKeyDown: C ? (J) => {
1976
- (J.key === "Enter" || J.key === " ") && (J.preventDefault(), h(d.id));
2104
+ role: y ? "button" : void 0,
2105
+ tabIndex: y ? 0 : void 0,
2106
+ onClick: y ? () => wt(d.id) : void 0,
2107
+ onKeyDown: y ? (H) => {
2108
+ (H.key === "Enter" || H.key === " ") && (H.preventDefault(), wt(d.id));
1977
2109
  } : void 0,
1978
- "aria-label": P && _ ? `${R}. ${k("bundle.unlocks", { discount: _ })}.` : R,
1979
- title: P && _ ? `${R} • ${k("bundle.unlocks", { discount: _ })}` : R,
1980
- children: C ? (O = d.image) != null && O.url ? /* @__PURE__ */ n(
2110
+ "aria-label": S && _ ? `${F}. ${I("bundle.unlocks", { discount: _ })}.` : F,
2111
+ title: S && _ ? `${F} • ${I("bundle.unlocks", { discount: _ })}` : F,
2112
+ children: y ? (B = d.image) != null && B.url ? /* @__PURE__ */ a(
1981
2113
  "img",
1982
2114
  {
1983
2115
  className: c.boxItemImage,
@@ -1985,56 +2117,56 @@ function Ao(a) {
1985
2117
  alt: d.image.altText ?? d.displayName,
1986
2118
  loading: "lazy"
1987
2119
  }
1988
- ) : /* @__PURE__ */ n("div", { className: c.boxItemFallback, "aria-hidden": "true", children: ((te = (le = (Z = d.product) == null ? void 0 : Z.title) == null ? void 0 : le.slice(0, 1)) == null ? void 0 : te.toUpperCase()) ?? "•" }) : P && _ ? /* @__PURE__ */ n("div", { className: c.boxItemDiscountText, children: _ }) : /* @__PURE__ */ n("div", { className: c.boxItemPlus, "aria-hidden": "true", children: "+" })
2120
+ ) : /* @__PURE__ */ a("div", { className: c.boxItemFallback, "aria-hidden": "true", children: ((_e = (se = ($ = d.product) == null ? void 0 : $.title) == null ? void 0 : se.slice(0, 1)) == null ? void 0 : _e.toUpperCase()) ?? "•" }) : S && _ ? /* @__PURE__ */ a("div", { className: c.boxItemDiscountText, children: _ }) : /* @__PURE__ */ a("div", { className: c.boxItemPlus, "aria-hidden": "true", children: "+" })
1989
2121
  }
1990
2122
  ),
1991
- M ? /* @__PURE__ */ n("div", { className: c.boxThresholdLabel, children: y.label }) : null
1992
- ] }, s);
2123
+ x ? /* @__PURE__ */ a("div", { className: c.boxThresholdLabel, children: p.label }) : null
2124
+ ] }, i);
1993
2125
  }) }) }),
1994
- /* @__PURE__ */ n(
2126
+ /* @__PURE__ */ a(
1995
2127
  "div",
1996
2128
  {
1997
- className: [c.ctaTotalsWrap, Qe ? c.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1998
- "aria-hidden": !Qe,
1999
- children: /* @__PURE__ */ I("div", { className: c.ctaTotals, "aria-label": k("bundle.totals"), children: [
2000
- X ? /* @__PURE__ */ n("span", { className: c.ctaDiscountBadge, children: k("bundle.discount.badge", { discount: X }) }) : /* @__PURE__ */ n("span", {}),
2001
- /* @__PURE__ */ n("span", { children: X ? /* @__PURE__ */ I(ct, { children: [
2002
- /* @__PURE__ */ n("span", { className: c.ctaTotalsStrike, children: T(Be.toFixed(2)) }),
2129
+ className: [c.ctaTotalsWrap, pt ? c.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
2130
+ "aria-hidden": !pt,
2131
+ children: /* @__PURE__ */ N("div", { className: c.ctaTotals, "aria-label": I("bundle.totals"), children: [
2132
+ ne ? /* @__PURE__ */ a("span", { className: c.ctaDiscountBadge, children: I("bundle.discount.badge", { discount: ne }) }) : /* @__PURE__ */ a("span", {}),
2133
+ /* @__PURE__ */ a("span", { children: ne ? /* @__PURE__ */ N(bt, { children: [
2134
+ /* @__PURE__ */ a("span", { className: c.ctaTotalsStrike, children: T(et.toFixed(2)) }),
2003
2135
  " ",
2004
- /* @__PURE__ */ n("span", { className: c.ctaTotalsPrice, children: T(vt.toFixed(2)) })
2005
- ] }) : /* @__PURE__ */ n("span", { className: c.ctaTotalsPrice, children: T(Be.toFixed(2)) }) })
2136
+ /* @__PURE__ */ a("span", { className: c.ctaTotalsPrice, children: T(ut.toFixed(2)) })
2137
+ ] }) : /* @__PURE__ */ a("span", { className: c.ctaTotalsPrice, children: T(et.toFixed(2)) }) })
2006
2138
  ] })
2007
2139
  }
2008
2140
  ),
2009
2141
  (() => {
2010
- const i = (b == null ? void 0 : b.ctaButtonMode) || "add_to_cart";
2011
- return i === "add_to_cart_checkout" ? ee > 0 ? /* @__PURE__ */ n("button", { type: "button", onClick: ue, disabled: !H, className: c.cta, children: o ? k("bundle.cta.adding") : k("bundle.cta.add_more", { count: ee, productWord: ut(ae, ee) }) }) : /* @__PURE__ */ I("div", { className: `${c.ctaButtonGroup} ${lt ? c.ctaButtonGroupAnimating : ""}`, children: [
2012
- /* @__PURE__ */ n(
2142
+ const n = (b == null ? void 0 : b.ctaButtonMode) || "add_to_cart";
2143
+ return n === "add_to_cart_checkout" ? J > 0 ? /* @__PURE__ */ a("button", { type: "button", onClick: z, disabled: !he, className: c.cta, children: s ? I("bundle.cta.adding") : I("bundle.cta.add_more", { count: J, productWord: ft(Se, J) }) }) : /* @__PURE__ */ N("div", { className: `${c.ctaButtonGroup} ${Ye ? c.ctaButtonGroupAnimating : ""}`, children: [
2144
+ /* @__PURE__ */ a(
2013
2145
  "button",
2014
2146
  {
2015
2147
  type: "button",
2016
- onClick: ue,
2017
- disabled: !H,
2018
- className: `${c.ctaDualLeft} ${lt ? c.ctaDualLeftAnimating : ""}`,
2019
- children: /* @__PURE__ */ n("span", { children: k(o ? "bundle.cta.adding" : "bundle.cta.add_to_basket") })
2148
+ onClick: z,
2149
+ disabled: !he,
2150
+ className: `${c.ctaDualLeft} ${Ye ? c.ctaDualLeftAnimating : ""}`,
2151
+ children: /* @__PURE__ */ a("span", { children: I(s ? "bundle.cta.adding" : "bundle.cta.add_to_basket") })
2020
2152
  }
2021
2153
  ),
2022
- /* @__PURE__ */ n(
2154
+ /* @__PURE__ */ a(
2023
2155
  "button",
2024
2156
  {
2025
2157
  type: "button",
2026
- onClick: v,
2027
- disabled: !H,
2028
- className: `${c.ctaDualRight} ${lt ? c.ctaDualRightAnimating : ""}`,
2029
- children: /* @__PURE__ */ n("span", { children: k(o ? "bundle.cta.processing" : "bundle.cta.checkout") })
2158
+ onClick: g,
2159
+ disabled: !he,
2160
+ className: `${c.ctaDualRight} ${Ye ? c.ctaDualRightAnimating : ""}`,
2161
+ children: /* @__PURE__ */ a("span", { children: I(s ? "bundle.cta.processing" : "bundle.cta.checkout") })
2030
2162
  }
2031
2163
  )
2032
- ] }) : i === "checkout" ? /* @__PURE__ */ n("button", { type: "button", onClick: v, disabled: !H, className: c.cta, children: o ? k("bundle.cta.processing") : ee > 0 ? k("bundle.cta.add_more", { count: ee, productWord: ut(ae, ee) }) : k("bundle.cta.checkout") }) : /* @__PURE__ */ n("button", { type: "button", onClick: ue, disabled: !H, className: c.cta, children: o ? k("bundle.cta.adding") : ee > 0 ? k("bundle.cta.add_more", { count: ee, productWord: ut(ae, ee) }) : k("bundle.cta.add_to_basket") });
2164
+ ] }) : n === "checkout" ? /* @__PURE__ */ a("button", { type: "button", onClick: g, disabled: !he, className: c.cta, children: s ? I("bundle.cta.processing") : J > 0 ? I("bundle.cta.add_more", { count: J, productWord: ft(Se, J) }) : I("bundle.cta.checkout") }) : /* @__PURE__ */ a("button", { type: "button", onClick: z, disabled: !he, className: c.cta, children: s ? I("bundle.cta.adding") : J > 0 ? I("bundle.cta.add_more", { count: J, productWord: ft(Se, J) }) : I("bundle.cta.add_to_basket") });
2033
2165
  })(),
2034
- /* @__PURE__ */ I("div", { className: c.poweredBy, children: [
2035
- k("bundle.powered_by"),
2166
+ /* @__PURE__ */ N("div", { className: c.poweredBy, children: [
2167
+ I("bundle.powered_by"),
2036
2168
  " ",
2037
- /* @__PURE__ */ n("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
2169
+ /* @__PURE__ */ a("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
2038
2170
  ] })
2039
2171
  ] })
2040
2172
  ] })
@@ -2042,714 +2174,729 @@ function Ao(a) {
2042
2174
  }
2043
2175
  ) : null;
2044
2176
  }
2045
- const Nr = "_panel_o9snd_2", kr = "_header_o9snd_20", Cr = "_title_o9snd_24", xr = "_status_o9snd_32", Ir = "_error_o9snd_37", Sr = "_section_o9snd_43", Pr = "_sectionTitle_o9snd_48", Br = "_rulesVisual_o9snd_101", Tr = "_rulesLabelsRow_o9snd_108", Lr = "_rulesLinesRow_o9snd_115", Rr = "_rulesLineLabelCell_o9snd_122", Fr = "_rulesLineLabel_o9snd_122", Mr = "_rulesLine_o9snd_115", Or = "_rulesLineEmpty_o9snd_156", Ar = "_rulesLineFilled_o9snd_160", qr = "_variants_o9snd_164", Vr = "_variantList_o9snd_172", Er = "_emptyState_o9snd_180", Dr = "_variantRow_o9snd_192", $r = "_variantRowInteractive_o9snd_204", zr = "_variantRowSelected_o9snd_208", Wr = "_variantRowSoldOut_o9snd_213", jr = "_variantMedia_o9snd_217", Gr = "_variantContent_o9snd_225", Ur = "_variantHeader_o9snd_233", Hr = "_variantTitle_o9snd_239", Qr = "_variantImage_o9snd_253", Yr = "_variantImageFallback_o9snd_261", Kr = "_variantMeta_o9snd_274", Xr = "_variantPrice_o9snd_279", Zr = "_variantFooterRow_o9snd_285", Jr = "_variantActions_o9snd_292", ei = "_qtyActions_o9snd_298", ti = "_qtyActionsWrap_o9snd_304", ni = "_soldOut_o9snd_355", ai = "_stockLimitNotice_o9snd_363", ri = "_qtyChip_o9snd_372", ii = "_qtyChipInteractive_o9snd_387", oi = "_qtyChipValue_o9snd_391", li = "_qtyChipPlus_o9snd_397", si = "_qtyChipClear_o9snd_402", ci = "_qtyTrash_o9snd_431", ui = "_footer_o9snd_443", di = "_boxSummaryWindow_o9snd_448", mi = "_boxSummaryRow_o9snd_462", hi = "_boxSlot_o9snd_470", bi = "_boxItem_o9snd_479", fi = "_boxItemFilled_o9snd_496", pi = "_boxItemPlaceholder_o9snd_502", _i = "_boxItemThreshold_o9snd_508", yi = "_boxItemClickable_o9snd_516", vi = "_boxItemImage_o9snd_525", wi = "_boxItemFallback_o9snd_536", gi = "_boxItemPlus_o9snd_549", Ni = "_boxItemDiscountText_o9snd_561", ki = "_boxThresholdLabel_o9snd_574", Ci = "_totalsReveal_o9snd_585", xi = "_totalsRevealOpen_o9snd_593", Ii = "_ctaTotalsWrap_o9snd_598", Si = "_ctaTotalsWrapVisible_o9snd_603", Pi = "_ctaTotals_o9snd_598", Bi = "_ctaDiscountBadge_o9snd_618", Ti = "_ctaTotalsStrike_o9snd_629", Li = "_ctaTotalsPrice_o9snd_635", Ri = "_cta_o9snd_598", Fi = "_ctaButtonGroup_o9snd_667", Mi = "_ctaDualLeft_o9snd_673", Oi = "_ctaDualRight_o9snd_674", Ai = "_poweredBy_o9snd_701", qi = "_productGroup_o9snd_716", Vi = "_productGroupHeader_o9snd_725", Ei = "_productGroupThumbWrap_o9snd_733", Di = "_productGroupThumb_o9snd_733", $i = "_productGroupThumbFallback_o9snd_748", zi = "_productGroupInfo_o9snd_760", Wi = "_productGroupTitle_o9snd_767", ji = "_productGroupActions_o9snd_776", Gi = "_selectButton_o9snd_783", Ui = "_selectButtonOpen_o9snd_804", Hi = "_selectButtonChevron_o9snd_809", Qi = "_variantPicker_o9snd_818", Yi = "_variantPickerRow_o9snd_824", Ki = "_variantPickerRowSelected_o9snd_854", Xi = "_variantPickerLabel_o9snd_858", Zi = "_variantPickerPrice_o9snd_867", Ji = "_variantPickerCheck_o9snd_873", eo = "_selectedVariantsList_o9snd_880", to = "_selectedVariantRow_o9snd_889", no = "_selectedVariantInfo_o9snd_902", ao = "_selectedVariantName_o9snd_909", ro = "_selectedVariantPrice_o9snd_918", u = {
2046
- panel: Nr,
2047
- header: kr,
2048
- title: Cr,
2049
- status: xr,
2050
- error: Ir,
2051
- section: Sr,
2052
- sectionTitle: Pr,
2053
- rulesVisual: Br,
2054
- rulesLabelsRow: Tr,
2055
- rulesLinesRow: Lr,
2056
- rulesLineLabelCell: Rr,
2057
- rulesLineLabel: Fr,
2058
- rulesLine: Mr,
2059
- rulesLineEmpty: Or,
2060
- rulesLineFilled: Ar,
2061
- variants: qr,
2062
- variantList: Vr,
2063
- emptyState: Er,
2064
- variantRow: Dr,
2065
- variantRowInteractive: $r,
2066
- variantRowSelected: zr,
2067
- variantRowSoldOut: Wr,
2068
- variantMedia: jr,
2069
- variantContent: Gr,
2070
- variantHeader: Ur,
2071
- variantTitle: Hr,
2072
- variantImage: Qr,
2073
- variantImageFallback: Yr,
2074
- variantMeta: Kr,
2075
- variantPrice: Xr,
2076
- variantFooterRow: Zr,
2077
- variantActions: Jr,
2078
- qtyActions: ei,
2079
- qtyActionsWrap: ti,
2080
- soldOut: ni,
2081
- stockLimitNotice: ai,
2082
- qtyChip: ri,
2083
- qtyChipInteractive: ii,
2084
- qtyChipValue: oi,
2085
- qtyChipPlus: li,
2086
- qtyChipClear: si,
2087
- qtyTrash: ci,
2088
- footer: ui,
2089
- boxSummaryWindow: di,
2090
- boxSummaryRow: mi,
2091
- boxSlot: hi,
2092
- boxItem: bi,
2093
- boxItemFilled: fi,
2094
- boxItemPlaceholder: pi,
2095
- boxItemThreshold: _i,
2096
- boxItemClickable: yi,
2097
- boxItemImage: vi,
2098
- boxItemFallback: wi,
2099
- boxItemPlus: gi,
2100
- boxItemDiscountText: Ni,
2101
- boxThresholdLabel: ki,
2102
- totalsReveal: Ci,
2103
- totalsRevealOpen: xi,
2104
- ctaTotalsWrap: Ii,
2105
- ctaTotalsWrapVisible: Si,
2106
- ctaTotals: Pi,
2107
- ctaDiscountBadge: Bi,
2108
- ctaTotalsStrike: Ti,
2109
- ctaTotalsPrice: Li,
2110
- cta: Ri,
2111
- ctaButtonGroup: Fi,
2112
- ctaDualLeft: Mi,
2113
- ctaDualRight: Oi,
2114
- poweredBy: Ai,
2115
- productGroup: qi,
2116
- productGroupHeader: Vi,
2117
- productGroupThumbWrap: Ei,
2118
- productGroupThumb: Di,
2119
- productGroupThumbFallback: $i,
2120
- productGroupInfo: zi,
2121
- productGroupTitle: Wi,
2122
- productGroupActions: ji,
2123
- selectButton: Gi,
2124
- selectButtonOpen: Ui,
2125
- selectButtonChevron: Hi,
2126
- variantPicker: Qi,
2127
- variantPickerRow: Yi,
2128
- variantPickerRowSelected: Ki,
2129
- variantPickerLabel: Xi,
2130
- variantPickerPrice: Zi,
2131
- variantPickerCheck: Ji,
2132
- selectedVariantsList: eo,
2133
- selectedVariantRow: to,
2134
- selectedVariantInfo: no,
2135
- selectedVariantName: ao,
2136
- selectedVariantPrice: ro
2177
+ const Vr = "_panel_o9snd_2", Er = "_header_o9snd_20", Dr = "_title_o9snd_24", $r = "_status_o9snd_32", zr = "_error_o9snd_37", Wr = "_section_o9snd_43", Gr = "_sectionTitle_o9snd_48", jr = "_rulesVisual_o9snd_101", Ur = "_rulesLabelsRow_o9snd_108", Hr = "_rulesLinesRow_o9snd_115", Qr = "_rulesLineLabelCell_o9snd_122", Yr = "_rulesLineLabel_o9snd_122", Kr = "_rulesLine_o9snd_115", Jr = "_rulesLineEmpty_o9snd_156", Xr = "_rulesLineFilled_o9snd_160", Zr = "_variants_o9snd_164", ei = "_variantList_o9snd_172", ti = "_emptyState_o9snd_180", ni = "_variantRow_o9snd_192", ai = "_variantRowInteractive_o9snd_204", ri = "_variantRowSelected_o9snd_208", ii = "_variantRowSoldOut_o9snd_213", oi = "_variantMedia_o9snd_217", si = "_variantContent_o9snd_225", li = "_variantHeader_o9snd_233", ci = "_variantTitle_o9snd_239", ui = "_variantImage_o9snd_253", di = "_variantImageFallback_o9snd_261", mi = "_variantMeta_o9snd_274", hi = "_variantPrice_o9snd_279", bi = "_variantFooterRow_o9snd_285", fi = "_variantActions_o9snd_292", pi = "_qtyActions_o9snd_298", _i = "_qtyActionsWrap_o9snd_304", yi = "_soldOut_o9snd_355", vi = "_stockLimitNotice_o9snd_363", wi = "_qtyChip_o9snd_372", gi = "_qtyChipInteractive_o9snd_387", Ni = "_qtyChipValue_o9snd_391", Ii = "_qtyChipPlus_o9snd_397", ki = "_qtyChipClear_o9snd_402", Si = "_qtyTrash_o9snd_431", Ci = "_footer_o9snd_443", xi = "_boxSummaryWindow_o9snd_448", Pi = "_boxSummaryRow_o9snd_462", Bi = "_boxSlot_o9snd_470", Ti = "_boxItem_o9snd_479", Li = "_boxItemFilled_o9snd_496", Ri = "_boxItemPlaceholder_o9snd_502", Fi = "_boxItemThreshold_o9snd_508", Mi = "_boxItemClickable_o9snd_516", Ai = "_boxItemImage_o9snd_525", Oi = "_boxItemFallback_o9snd_536", qi = "_boxItemPlus_o9snd_549", Vi = "_boxItemDiscountText_o9snd_561", Ei = "_boxThresholdLabel_o9snd_574", Di = "_totalsReveal_o9snd_585", $i = "_totalsRevealOpen_o9snd_593", zi = "_ctaTotalsWrap_o9snd_598", Wi = "_ctaTotalsWrapVisible_o9snd_603", Gi = "_ctaTotals_o9snd_598", ji = "_ctaDiscountBadge_o9snd_618", Ui = "_ctaTotalsStrike_o9snd_629", Hi = "_ctaTotalsPrice_o9snd_635", Qi = "_cta_o9snd_598", Yi = "_ctaButtonGroup_o9snd_667", Ki = "_ctaDualLeft_o9snd_673", Ji = "_ctaDualRight_o9snd_674", Xi = "_poweredBy_o9snd_701", Zi = "_productGroup_o9snd_716", eo = "_productGroupHeader_o9snd_725", to = "_productGroupThumbWrap_o9snd_733", no = "_productGroupThumb_o9snd_733", ao = "_productGroupThumbFallback_o9snd_748", ro = "_productGroupInfo_o9snd_760", io = "_productGroupTitle_o9snd_767", oo = "_productGroupActions_o9snd_776", so = "_selectButton_o9snd_783", lo = "_selectButtonOpen_o9snd_804", co = "_selectButtonChevron_o9snd_809", uo = "_variantPicker_o9snd_818", mo = "_variantPickerRow_o9snd_824", ho = "_variantPickerRowSelected_o9snd_854", bo = "_variantPickerLabel_o9snd_858", fo = "_variantPickerPrice_o9snd_867", po = "_variantPickerCheck_o9snd_873", _o = "_selectedVariantsList_o9snd_880", yo = "_selectedVariantRow_o9snd_889", vo = "_selectedVariantInfo_o9snd_902", wo = "_selectedVariantName_o9snd_909", go = "_selectedVariantPrice_o9snd_918", u = {
2178
+ panel: Vr,
2179
+ header: Er,
2180
+ title: Dr,
2181
+ status: $r,
2182
+ error: zr,
2183
+ section: Wr,
2184
+ sectionTitle: Gr,
2185
+ rulesVisual: jr,
2186
+ rulesLabelsRow: Ur,
2187
+ rulesLinesRow: Hr,
2188
+ rulesLineLabelCell: Qr,
2189
+ rulesLineLabel: Yr,
2190
+ rulesLine: Kr,
2191
+ rulesLineEmpty: Jr,
2192
+ rulesLineFilled: Xr,
2193
+ variants: Zr,
2194
+ variantList: ei,
2195
+ emptyState: ti,
2196
+ variantRow: ni,
2197
+ variantRowInteractive: ai,
2198
+ variantRowSelected: ri,
2199
+ variantRowSoldOut: ii,
2200
+ variantMedia: oi,
2201
+ variantContent: si,
2202
+ variantHeader: li,
2203
+ variantTitle: ci,
2204
+ variantImage: ui,
2205
+ variantImageFallback: di,
2206
+ variantMeta: mi,
2207
+ variantPrice: hi,
2208
+ variantFooterRow: bi,
2209
+ variantActions: fi,
2210
+ qtyActions: pi,
2211
+ qtyActionsWrap: _i,
2212
+ soldOut: yi,
2213
+ stockLimitNotice: vi,
2214
+ qtyChip: wi,
2215
+ qtyChipInteractive: gi,
2216
+ qtyChipValue: Ni,
2217
+ qtyChipPlus: Ii,
2218
+ qtyChipClear: ki,
2219
+ qtyTrash: Si,
2220
+ footer: Ci,
2221
+ boxSummaryWindow: xi,
2222
+ boxSummaryRow: Pi,
2223
+ boxSlot: Bi,
2224
+ boxItem: Ti,
2225
+ boxItemFilled: Li,
2226
+ boxItemPlaceholder: Ri,
2227
+ boxItemThreshold: Fi,
2228
+ boxItemClickable: Mi,
2229
+ boxItemImage: Ai,
2230
+ boxItemFallback: Oi,
2231
+ boxItemPlus: qi,
2232
+ boxItemDiscountText: Vi,
2233
+ boxThresholdLabel: Ei,
2234
+ totalsReveal: Di,
2235
+ totalsRevealOpen: $i,
2236
+ ctaTotalsWrap: zi,
2237
+ ctaTotalsWrapVisible: Wi,
2238
+ ctaTotals: Gi,
2239
+ ctaDiscountBadge: ji,
2240
+ ctaTotalsStrike: Ui,
2241
+ ctaTotalsPrice: Hi,
2242
+ cta: Qi,
2243
+ ctaButtonGroup: Yi,
2244
+ ctaDualLeft: Ki,
2245
+ ctaDualRight: Ji,
2246
+ poweredBy: Xi,
2247
+ productGroup: Zi,
2248
+ productGroupHeader: eo,
2249
+ productGroupThumbWrap: to,
2250
+ productGroupThumb: no,
2251
+ productGroupThumbFallback: ao,
2252
+ productGroupInfo: ro,
2253
+ productGroupTitle: io,
2254
+ productGroupActions: oo,
2255
+ selectButton: so,
2256
+ selectButtonOpen: lo,
2257
+ selectButtonChevron: co,
2258
+ variantPicker: uo,
2259
+ variantPickerRow: mo,
2260
+ variantPickerRowSelected: ho,
2261
+ variantPickerLabel: bo,
2262
+ variantPickerPrice: fo,
2263
+ variantPickerCheck: po,
2264
+ selectedVariantsList: _o,
2265
+ selectedVariantRow: yo,
2266
+ selectedVariantInfo: vo,
2267
+ selectedVariantName: wo,
2268
+ selectedVariantPrice: go
2137
2269
  };
2138
- function qo(a) {
2139
- var Ue;
2270
+ function Zo(r) {
2271
+ var ot;
2140
2272
  const {
2141
2273
  loading: e,
2142
2274
  submitting: t,
2143
2275
  error: l,
2144
- currencyCode: o,
2145
- config: r,
2146
- eligibleVariants: p,
2276
+ currencyCode: s,
2277
+ config: o,
2278
+ eligibleVariants: v,
2147
2279
  selections: b,
2148
- selectionOrder: F,
2149
- getVariantMaxSelectableQuantity: se,
2150
- setQuantity: q,
2151
- bundleSize: Y,
2152
- minRequired: de,
2153
- canSubmit: W,
2154
- submit: ye,
2155
- submitAndCheckout: H,
2156
- locale: ue,
2157
- t: v
2158
- } = yt(), {
2159
- className: ae,
2160
- showRules: k = !0,
2161
- showVariants: ge = !0
2162
- } = a, z = (m) => {
2163
- const f = Number.parseFloat(m);
2164
- return Number.isFinite(f) ? String(Math.round(f)) : m;
2165
- }, E = (m) => {
2166
- const f = (m ?? []).filter((g) => {
2167
- var j, K;
2168
- const B = (j = g == null ? void 0 : g.name) == null ? void 0 : j.trim(), T = (K = g == null ? void 0 : g.value) == null ? void 0 : K.trim();
2169
- return !(!B || !T || B.toLowerCase() === "title" || T.toLowerCase() === "default title");
2280
+ selectionOrder: A,
2281
+ getVariantMaxSelectableQuantity: le,
2282
+ setQuantity: K,
2283
+ redirectVariantToProductPage: ke,
2284
+ bundleSize: ie,
2285
+ minRequired: Pe,
2286
+ canSubmit: G,
2287
+ submit: U,
2288
+ submitAndCheckout: he,
2289
+ locale: z,
2290
+ t: g
2291
+ } = Pt(), {
2292
+ className: Se,
2293
+ showRules: I = !0,
2294
+ showVariants: q = !0
2295
+ } = r, Q = (h) => {
2296
+ const f = Number.parseFloat(h);
2297
+ return Number.isFinite(f) ? String(Math.round(f)) : h;
2298
+ }, Z = (h) => {
2299
+ const f = (h ?? []).filter((w) => {
2300
+ var V, T;
2301
+ const P = (V = w == null ? void 0 : w.name) == null ? void 0 : V.trim(), R = (T = w == null ? void 0 : w.value) == null ? void 0 : T.trim();
2302
+ return !(!P || !R || P.toLowerCase() === "title" || R.toLowerCase() === "default title");
2170
2303
  });
2171
- return f.length ? f.map((g) => `${g.name}: ${g.value}`).join(" • ") : null;
2172
- }, me = (m) => (m == null ? void 0 : m.trim().toLowerCase()) === "default title", ce = (m) => {
2173
- var T, j, K, N;
2174
- const f = (T = m.displayName) == null ? void 0 : T.trim();
2175
- if (f && !me(f)) return f;
2176
- const g = (K = (j = m.product) == null ? void 0 : j.title) == null ? void 0 : K.trim();
2177
- if (g) return g;
2178
- const B = (N = m.title) == null ? void 0 : N.trim();
2179
- return B && !me(B) ? B : f || B || g || "";
2180
- }, xe = (m) => {
2181
- const f = ce(m), g = E(m.selectedOptions);
2182
- return [f, g].filter(Boolean).join(" — ");
2183
- }, Se = (m) => {
2184
- var B;
2185
- const f = E(m.selectedOptions);
2304
+ return f.length ? f.map((w) => `${w.name}: ${w.value}`).join(" • ") : null;
2305
+ }, ce = (h) => (h == null ? void 0 : h.trim().toLowerCase()) === "default title", Ne = (h) => {
2306
+ var R, V, T, k;
2307
+ const f = (R = h.displayName) == null ? void 0 : R.trim();
2308
+ if (f && !ce(f)) return f;
2309
+ const w = (T = (V = h.product) == null ? void 0 : V.title) == null ? void 0 : T.trim();
2310
+ if (w) return w;
2311
+ const P = (k = h.title) == null ? void 0 : k.trim();
2312
+ return P && !ce(P) ? P : f || P || w || "";
2313
+ }, qe = (h) => {
2314
+ const f = Ne(h), w = Z(h.selectedOptions);
2315
+ return [f, w].filter(Boolean).join(" — ");
2316
+ }, Be = (h) => {
2317
+ var P;
2318
+ const f = Z(h.selectedOptions);
2186
2319
  if (f) return f;
2187
- const g = (B = m.title) == null ? void 0 : B.trim();
2188
- return g && !me(g) ? g : ce(m);
2189
- }, be = (m) => {
2190
- const f = Number(m);
2191
- return Number.isFinite(f) ? ft(f, o, ue) : m;
2192
- }, Ve = $(() => [...p], [p]), Ne = $(() => {
2193
- var f, g;
2194
- if (!(r != null && r.groupVariantsByProduct)) return null;
2195
- const m = /* @__PURE__ */ new Map();
2196
- for (const B of Ve) {
2197
- const T = ((f = B.product) == null ? void 0 : f.id) ?? "unknown";
2198
- m.has(T) || m.set(T, { productId: T, productTitle: ((g = B.product) == null ? void 0 : g.title) ?? "", variants: [] }), m.get(T).variants.push(B);
2320
+ const w = (P = h.title) == null ? void 0 : P.trim();
2321
+ return w && !ce(w) ? w : Ne(h);
2322
+ }, xe = (h) => {
2323
+ const f = Number(h);
2324
+ return Number.isFinite(f) ? It(f, s, z) : h;
2325
+ }, ee = E(() => [...v], [v]), Ve = E(() => {
2326
+ var f, w;
2327
+ if (!(o != null && o.groupVariantsByProduct)) return null;
2328
+ const h = /* @__PURE__ */ new Map();
2329
+ for (const P of ee) {
2330
+ const R = ((f = P.product) == null ? void 0 : f.id) ?? "unknown";
2331
+ h.has(R) || h.set(R, { productId: R, productTitle: ((w = P.product) == null ? void 0 : w.title) ?? "", variants: [] }), h.get(R).variants.push(P);
2199
2332
  }
2200
- return Array.from(m.values());
2201
- }, [r == null ? void 0 : r.groupVariantsByProduct, Ve]), [Fe, Me] = ne(null), Oe = ie(null);
2202
- U(() => {
2203
- if (!Fe) return;
2204
- const m = (f) => {
2205
- Oe.current && !Oe.current.contains(f.target) && Me(null);
2333
+ return Array.from(h.values());
2334
+ }, [o == null ? void 0 : o.groupVariantsByProduct, ee]), [Ge, Re] = X(null), Ee = re(null);
2335
+ j(() => {
2336
+ if (!Ge) return;
2337
+ const h = (f) => {
2338
+ Ee.current && !Ee.current.contains(f.target) && Re(null);
2206
2339
  };
2207
- return document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m);
2208
- }, [Fe]);
2209
- const he = $(() => [...(r == null ? void 0 : r.rules) ?? []].sort((m, f) => m.minBundleSize - f.minBundleSize), [r == null ? void 0 : r.rules]), ke = $(() => Math.max(0, de - Y), [Y, de]), Pe = $(() => {
2210
- let m = null;
2211
- for (const f of he)
2212
- Y >= f.minBundleSize && (m = f);
2213
- return m;
2214
- }, [Y, he]), Ie = $(() => {
2215
- if (!Pe) return null;
2216
- const m = Number.parseFloat(Pe.discountPercent);
2217
- return !Number.isFinite(m) || m <= 0 ? null : m;
2218
- }, [Pe]), tt = he[0], Ee = !!(tt && Y >= tt.minBundleSize), Le = $(() => {
2219
- const m = new Map(p.map((g) => [g.id, g]));
2340
+ return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
2341
+ }, [Ge]);
2342
+ const we = E(() => [...(o == null ? void 0 : o.rules) ?? []].sort((h, f) => h.minBundleSize - f.minBundleSize), [o == null ? void 0 : o.rules]), ge = E(() => Math.max(0, Pe - ie), [ie, Pe]), Te = E(() => {
2343
+ let h = null;
2344
+ for (const f of we)
2345
+ ie >= f.minBundleSize && (h = f);
2346
+ return h;
2347
+ }, [ie, we]), De = E(() => {
2348
+ if (!Te) return null;
2349
+ const h = Number.parseFloat(Te.discountPercent);
2350
+ return !Number.isFinite(h) || h <= 0 ? null : h;
2351
+ }, [Te]), Ke = we[0], $e = !!(Ke && ie >= Ke.minBundleSize), je = E(() => {
2352
+ const h = new Map(v.map((w) => [w.id, w]));
2220
2353
  let f = 0;
2221
- for (const [g, B] of Object.entries(b)) {
2222
- const T = B ?? 0;
2223
- if (T <= 0) continue;
2224
- const j = m.get(g), K = Number(j == null ? void 0 : j.price);
2225
- Number.isFinite(K) && (f += K * T);
2354
+ for (const [w, P] of Object.entries(b)) {
2355
+ const R = P ?? 0;
2356
+ if (R <= 0) continue;
2357
+ const V = h.get(w), T = Number(V == null ? void 0 : V.price);
2358
+ Number.isFinite(T) && (f += T * R);
2226
2359
  }
2227
2360
  return Math.round(f * 100) / 100;
2228
- }, [p, b]), je = $(() => {
2229
- if (!Ie) return Le;
2230
- const m = Le * (1 - Ie / 100);
2231
- return Math.round(m * 100) / 100;
2232
- }, [Ie, Le]), Ge = $(() => he.length ? Math.max(...he.map((m) => m.minBundleSize)) : 0, [he]), Re = $(() => {
2233
- const m = new Map(p.map((f) => [f.id, f]));
2234
- return F.map((f) => m.get(f)).filter((f) => !!f);
2235
- }, [p, F]), nt = $(() => {
2361
+ }, [v, b]), be = E(() => {
2362
+ if (!De) return je;
2363
+ const h = je * (1 - De / 100);
2364
+ return Math.round(h * 100) / 100;
2365
+ }, [De, je]), Fe = E(() => we.length ? Math.max(...we.map((h) => h.minBundleSize)) : 0, [we]), Ue = E(() => {
2366
+ const h = new Map(v.map((f) => [f.id, f]));
2367
+ return A.map((f) => h.get(f)).filter((f) => !!f);
2368
+ }, [v, A]), at = E(() => {
2236
2369
  var f;
2237
- const m = /* @__PURE__ */ new Map();
2238
- for (const g of he) {
2239
- const B = Math.max(0, g.minBundleSize - 1);
2240
- m.set(B, {
2241
- discountPercent: g.discountPercent,
2242
- minBundleSize: g.minBundleSize,
2243
- label: ((f = g.label) == null ? void 0 : f.trim()) || `Buy ${g.minBundleSize}+`
2370
+ const h = /* @__PURE__ */ new Map();
2371
+ for (const w of we) {
2372
+ const P = Math.max(0, w.minBundleSize - 1);
2373
+ h.set(P, {
2374
+ discountPercent: w.discountPercent,
2375
+ minBundleSize: w.minBundleSize,
2376
+ label: ((f = w.label) == null ? void 0 : f.trim()) || `Buy ${w.minBundleSize}+`
2244
2377
  });
2245
2378
  }
2246
- return m;
2247
- }, [he]), Ae = $(() => {
2248
- const m = Number((r == null ? void 0 : r.maxBundleSize) ?? NaN), f = Number.isFinite(m) ? Math.floor(m) : 100;
2379
+ return h;
2380
+ }, [we]), ze = E(() => {
2381
+ const h = Number((o == null ? void 0 : o.maxBundleSize) ?? NaN), f = Number.isFinite(h) ? Math.floor(h) : 100;
2249
2382
  return Math.max(2, Math.min(100, f));
2250
- }, [r == null ? void 0 : r.maxBundleSize]), it = ((Ue = r == null ? void 0 : r.title) == null ? void 0 : Ue.trim()) || v("bundle.title.default"), Ke = $(() => Math.max(Ge || de, Re.length), [Re.length, Ge, de]), ve = Y >= Ae, De = ie(null), $e = ie(null), qe = ie(Y);
2251
- U(() => {
2252
- const m = qe.current;
2253
- if (qe.current = Y, Y <= m) return;
2254
- const f = $e.current;
2383
+ }, [o == null ? void 0 : o.maxBundleSize]), rt = ((ot = o == null ? void 0 : o.title) == null ? void 0 : ot.trim()) || g("bundle.title.default"), ye = !!(o != null && o.redirectEligibleProductsToProductPage), pe = (h, f) => {
2384
+ const w = b[h.id] ?? 0;
2385
+ if (ye && f > w) {
2386
+ ke(h);
2387
+ return;
2388
+ }
2389
+ K(h.id, f);
2390
+ }, it = E(() => Math.max(Fe || Pe, Ue.length), [Ue.length, Fe, Pe]), Le = ie >= ze, He = re(null), We = re(null), Je = re(ie);
2391
+ j(() => {
2392
+ const h = Je.current;
2393
+ if (Je.current = ie, ie <= h) return;
2394
+ const f = We.current;
2255
2395
  if (!f) return;
2256
- const g = he.some((K) => K.minBundleSize === Y), B = he.find((K) => K.minBundleSize > Y), T = B && g ? B.minBundleSize - 1 : B ? null : Y - 1;
2257
- if (T == null || T < 0) return;
2258
- const j = requestAnimationFrame(() => {
2259
- const K = f.querySelector(`[data-box-slot="${T}"]`);
2260
- if (!K) return;
2261
- const N = f.getBoundingClientRect(), V = K.getBoundingClientRect().right - N.right;
2262
- if (V <= 1) return;
2263
- const oe = Math.max(0, f.scrollWidth - f.clientWidth), re = Math.min(oe, Math.max(0, f.scrollLeft + V));
2264
- f.scrollTo({ left: re, behavior: "smooth" });
2396
+ const w = we.some((T) => T.minBundleSize === ie), P = we.find((T) => T.minBundleSize > ie), R = P && w ? P.minBundleSize - 1 : P ? null : ie - 1;
2397
+ if (R == null || R < 0) return;
2398
+ const V = requestAnimationFrame(() => {
2399
+ const T = f.querySelector(`[data-box-slot="${R}"]`);
2400
+ if (!T) return;
2401
+ const k = f.getBoundingClientRect(), W = T.getBoundingClientRect().right - k.right;
2402
+ if (W <= 1) return;
2403
+ const te = Math.max(0, f.scrollWidth - f.clientWidth), D = Math.min(te, Math.max(0, f.scrollLeft + W));
2404
+ f.scrollTo({ left: D, behavior: "smooth" });
2265
2405
  });
2266
- return () => cancelAnimationFrame(j);
2267
- }, [Y, he]);
2268
- const ze = (m) => {
2269
- const f = De.current;
2406
+ return () => cancelAnimationFrame(V);
2407
+ }, [ie, we]);
2408
+ const Xe = (h) => {
2409
+ const f = He.current;
2270
2410
  if (!f) return;
2271
- const g = f.querySelector(`[data-variant-row="${m}"]`);
2272
- g && g.scrollIntoView({ behavior: "smooth", block: "nearest" });
2411
+ const w = f.querySelector(`[data-variant-row="${h}"]`);
2412
+ w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
2273
2413
  };
2274
- return /* @__PURE__ */ I("section", { className: [u.panel, ae].filter(Boolean).join(" "), "aria-busy": e, children: [
2275
- /* @__PURE__ */ n("header", { className: u.header, children: /* @__PURE__ */ n("h2", { className: u.title, children: it }) }),
2276
- e ? /* @__PURE__ */ n("div", { className: u.status, children: v("bundle.loading") }) : null,
2277
- l ? /* @__PURE__ */ n("div", { className: u.error, children: l }) : null,
2278
- k && he.length ? /* @__PURE__ */ n("div", { className: u.section, children: /* @__PURE__ */ I("div", { className: u.rulesVisual, children: [
2279
- /* @__PURE__ */ n("div", { className: u.rulesLabelsRow, children: Array.from({ length: Ge }).map((m, f) => {
2280
- const g = f + 1, B = he.find((j) => j.minBundleSize === g), T = B ? v("bundle.discount.off_label", { discount: z(B.discountPercent) }) : null;
2281
- return /* @__PURE__ */ n("div", { className: u.rulesLineLabelCell, children: T ? /* @__PURE__ */ n("span", { className: u.rulesLineLabel, children: T }) : null }, g);
2414
+ return /* @__PURE__ */ N("section", { className: [u.panel, Se].filter(Boolean).join(" "), "aria-busy": e, children: [
2415
+ /* @__PURE__ */ a("header", { className: u.header, children: /* @__PURE__ */ a("h2", { className: u.title, children: rt }) }),
2416
+ e ? /* @__PURE__ */ a("div", { className: u.status, children: g("bundle.loading") }) : null,
2417
+ l ? /* @__PURE__ */ a("div", { className: u.error, children: l }) : null,
2418
+ I && we.length ? /* @__PURE__ */ a("div", { className: u.section, children: /* @__PURE__ */ N("div", { className: u.rulesVisual, children: [
2419
+ /* @__PURE__ */ a("div", { className: u.rulesLabelsRow, children: Array.from({ length: Fe }).map((h, f) => {
2420
+ const w = f + 1, P = we.find((V) => V.minBundleSize === w), R = P ? g("bundle.discount.off_label", { discount: Q(P.discountPercent) }) : null;
2421
+ return /* @__PURE__ */ a("div", { className: u.rulesLineLabelCell, children: R ? /* @__PURE__ */ a("span", { className: u.rulesLineLabel, children: R }) : null }, w);
2282
2422
  }) }),
2283
- /* @__PURE__ */ n("div", { className: u.rulesLinesRow, children: Array.from({ length: Ge }).map((m, f) => {
2284
- const g = f + 1, B = Y >= g;
2285
- return /* @__PURE__ */ n(
2423
+ /* @__PURE__ */ a("div", { className: u.rulesLinesRow, children: Array.from({ length: Fe }).map((h, f) => {
2424
+ const w = f + 1, P = ie >= w;
2425
+ return /* @__PURE__ */ a(
2286
2426
  "div",
2287
2427
  {
2288
2428
  className: [
2289
2429
  u.rulesLine,
2290
- B ? u.rulesLineFilled : u.rulesLineEmpty
2430
+ P ? u.rulesLineFilled : u.rulesLineEmpty
2291
2431
  ].filter(Boolean).join(" ")
2292
2432
  },
2293
- g
2433
+ w
2294
2434
  );
2295
2435
  }) })
2296
2436
  ] }) }) : null,
2297
- ge ? /* @__PURE__ */ I("div", { className: u.section, ref: De, children: [
2298
- /* @__PURE__ */ n("div", { className: u.sectionTitle, children: v("bundle.select.items") }),
2299
- /* @__PURE__ */ n("div", { className: u.variants, children: !e && !l && Ve.length === 0 ? /* @__PURE__ */ n("div", { className: u.emptyState, children: v("bundle.empty") }) : Ne ? /* @__PURE__ */ n("ul", { className: u.variantList, children: Ne.map((m) => {
2300
- var j, K;
2301
- const f = ((j = m.variants.find((N) => {
2302
- var A;
2303
- return (A = N.image) == null ? void 0 : A.url;
2304
- })) == null ? void 0 : j.image) ?? null, g = m.variants.length > 1, B = Fe === m.productId, T = m.variants.filter((N) => (b[N.id] ?? 0) > 0);
2305
- if (!g) {
2306
- const N = m.variants[0];
2307
- if (!N) return null;
2308
- const A = b[N.id] ?? 0, V = (K = N.title) == null ? void 0 : K.trim(), oe = E(N.selectedOptions) ?? (V && V.toLowerCase() !== "default title" ? V : null), re = N.availableForSale === !1, G = se(N.id), x = G ?? Number.POSITIVE_INFINITY, D = A >= x, ee = !t && !re && !ve && !D, Ce = !re && D ? v("bundle.stock.max_reached") : null;
2309
- return /* @__PURE__ */ n("li", { className: u.productGroup, children: /* @__PURE__ */ I("div", { className: u.productGroupHeader, children: [
2310
- /* @__PURE__ */ n("div", { className: u.productGroupThumbWrap, children: f != null && f.url ? /* @__PURE__ */ n("img", { src: f.url, alt: f.altText ?? m.productTitle, width: f.width ?? 56, height: f.height ?? 56, className: u.productGroupThumb, loading: "lazy" }) : /* @__PURE__ */ n("div", { className: u.productGroupThumbFallback, children: m.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
2311
- /* @__PURE__ */ I("div", { className: u.productGroupInfo, children: [
2312
- /* @__PURE__ */ n("div", { className: u.productGroupTitle, children: m.productTitle }),
2313
- oe ? /* @__PURE__ */ n("div", { className: u.variantMeta, children: oe }) : null,
2314
- /* @__PURE__ */ n("div", { className: u.variantPrice, children: be(N.price) })
2437
+ q ? /* @__PURE__ */ N("div", { className: u.section, ref: He, children: [
2438
+ /* @__PURE__ */ a("div", { className: u.sectionTitle, children: g("bundle.select.items") }),
2439
+ /* @__PURE__ */ a("div", { className: u.variants, children: !e && !l && ee.length === 0 ? /* @__PURE__ */ a("div", { className: u.emptyState, children: g("bundle.empty") }) : Ve ? /* @__PURE__ */ a("ul", { className: u.variantList, children: Ve.map((h) => {
2440
+ var V, T;
2441
+ const f = ((V = h.variants.find((k) => {
2442
+ var L;
2443
+ return (L = k.image) == null ? void 0 : L.url;
2444
+ })) == null ? void 0 : V.image) ?? null, w = h.variants.length > 1, P = Ge === h.productId, R = h.variants.filter((k) => (b[k.id] ?? 0) > 0);
2445
+ if (!w) {
2446
+ const k = h.variants[0];
2447
+ if (!k) return null;
2448
+ const L = b[k.id] ?? 0, W = (T = k.title) == null ? void 0 : T.trim(), te = Z(k.selectedOptions) ?? (W && W.toLowerCase() !== "default title" ? W : null), D = k.availableForSale === !1, C = le(k.id), O = C ?? Number.POSITIVE_INFINITY, ue = L >= O, oe = !t && !D && !Le && !ue, de = !D && ue ? g("bundle.stock.max_reached") : null;
2449
+ return /* @__PURE__ */ a("li", { className: u.productGroup, children: /* @__PURE__ */ N("div", { className: u.productGroupHeader, children: [
2450
+ /* @__PURE__ */ a("div", { className: u.productGroupThumbWrap, children: f != null && f.url ? /* @__PURE__ */ a("img", { src: f.url, alt: f.altText ?? h.productTitle, width: f.width ?? 56, height: f.height ?? 56, className: u.productGroupThumb, loading: "lazy" }) : /* @__PURE__ */ a("div", { className: u.productGroupThumbFallback, children: h.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
2451
+ /* @__PURE__ */ N("div", { className: u.productGroupInfo, children: [
2452
+ /* @__PURE__ */ a("div", { className: u.productGroupTitle, children: h.productTitle }),
2453
+ te ? /* @__PURE__ */ a("div", { className: u.variantMeta, children: te }) : null,
2454
+ /* @__PURE__ */ a("div", { className: u.variantPrice, children: xe(k.price) })
2315
2455
  ] }),
2316
- /* @__PURE__ */ n("div", { className: u.productGroupActions, children: re ? /* @__PURE__ */ n("div", { className: u.soldOut, children: v("bundle.stock.sold_out") }) : A <= 0 && x <= 0 ? /* @__PURE__ */ n("div", { className: u.stockLimitNotice, children: v("bundle.stock.max_added") }) : /* @__PURE__ */ I("div", { className: u.qtyActionsWrap, children: [
2317
- Ce ? /* @__PURE__ */ n("div", { className: u.stockLimitNotice, children: Ce }) : null,
2318
- /* @__PURE__ */ I("div", { className: u.qtyActions, children: [
2319
- A > 0 ? /* @__PURE__ */ n("button", { type: "button", className: u.qtyTrash, "aria-label": v("bundle.a11y.remove_from_bundle", { name: N.displayName }), disabled: t, onClick: () => q(N.id, 0), children: /* @__PURE__ */ n(Mt, { size: 14 }) }) : null,
2320
- /* @__PURE__ */ n(
2456
+ /* @__PURE__ */ a("div", { className: u.productGroupActions, children: D ? /* @__PURE__ */ a("div", { className: u.soldOut, children: g("bundle.stock.sold_out") }) : L <= 0 && O <= 0 ? /* @__PURE__ */ a("div", { className: u.stockLimitNotice, children: g("bundle.stock.max_added") }) : /* @__PURE__ */ N("div", { className: u.qtyActionsWrap, children: [
2457
+ de ? /* @__PURE__ */ a("div", { className: u.stockLimitNotice, children: de }) : null,
2458
+ /* @__PURE__ */ N("div", { className: u.qtyActions, children: [
2459
+ L > 0 ? /* @__PURE__ */ a("button", { type: "button", className: u.qtyTrash, "aria-label": g("bundle.a11y.remove_from_bundle", { name: k.displayName }), disabled: t, onClick: () => K(k.id, 0), children: /* @__PURE__ */ a(zt, { size: 14 }) }) : null,
2460
+ /* @__PURE__ */ a(
2321
2461
  "div",
2322
2462
  {
2323
- className: [u.qtyChip, ee ? u.qtyChipInteractive : null].filter(Boolean).join(" "),
2324
- role: ee ? "button" : void 0,
2325
- tabIndex: ee ? 0 : void 0,
2326
- "aria-label": v("bundle.a11y.quantity", { name: N.displayName, qty: A }),
2327
- onClick: ee ? () => q(N.id, A + 1) : void 0,
2328
- onKeyDown: ee ? (X) => {
2329
- (X.key === "Enter" || X.key === " ") && (X.preventDefault(), q(N.id, A + 1));
2463
+ className: [u.qtyChip, oe ? u.qtyChipInteractive : null].filter(Boolean).join(" "),
2464
+ role: oe ? "button" : void 0,
2465
+ tabIndex: oe ? 0 : void 0,
2466
+ "aria-label": g("bundle.a11y.quantity", { name: k.displayName, qty: L }),
2467
+ onClick: oe ? () => pe(k, L + 1) : void 0,
2468
+ onKeyDown: oe ? (J) => {
2469
+ (J.key === "Enter" || J.key === " ") && (J.preventDefault(), pe(k, L + 1));
2330
2470
  } : void 0,
2331
- children: A <= 0 ? /* @__PURE__ */ n("span", { className: u.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ n(bt, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ I(ct, { children: [
2332
- /* @__PURE__ */ n("span", { className: u.qtyChipValue, children: A }),
2333
- /* @__PURE__ */ n("button", { type: "button", className: u.qtyChipClear, "aria-label": v("bundle.a11y.increase", { name: N.displayName }), disabled: !ee, onClick: (X) => {
2334
- X.stopPropagation(), q(N.id, A + 1);
2335
- }, onKeyDown: (X) => X.stopPropagation(), children: /* @__PURE__ */ n(bt, { size: 12, strokeWidth: 2 }) })
2471
+ children: L <= 0 ? /* @__PURE__ */ a("span", { className: u.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ a(Nt, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ N(bt, { children: [
2472
+ /* @__PURE__ */ a("span", { className: u.qtyChipValue, children: L }),
2473
+ /* @__PURE__ */ a("button", { type: "button", className: u.qtyChipClear, "aria-label": g("bundle.a11y.increase", { name: k.displayName }), disabled: !oe, onClick: (J) => {
2474
+ J.stopPropagation(), pe(k, L + 1);
2475
+ }, onKeyDown: (J) => J.stopPropagation(), children: /* @__PURE__ */ a(Nt, { size: 12, strokeWidth: 2 }) })
2336
2476
  ] })
2337
2477
  }
2338
2478
  )
2339
2479
  ] })
2340
2480
  ] }) })
2341
- ] }) }, m.productId);
2481
+ ] }) }, h.productId);
2342
2482
  }
2343
- return /* @__PURE__ */ I("li", { ref: B ? Oe : null, className: [u.productGroup, B ? u.productGroupPickerOpen : null].filter(Boolean).join(" "), children: [
2344
- /* @__PURE__ */ I("div", { className: u.productGroupHeader, children: [
2345
- /* @__PURE__ */ n("div", { className: u.productGroupThumbWrap, children: f != null && f.url ? /* @__PURE__ */ n("img", { src: f.url, alt: f.altText ?? m.productTitle, width: f.width ?? 56, height: f.height ?? 56, className: u.productGroupThumb, loading: "lazy" }) : /* @__PURE__ */ n("div", { className: u.productGroupThumbFallback, children: m.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
2346
- /* @__PURE__ */ n("div", { className: u.productGroupInfo, children: /* @__PURE__ */ n("div", { className: u.productGroupTitle, children: m.productTitle }) }),
2347
- /* @__PURE__ */ n("div", { className: u.productGroupActions, children: /* @__PURE__ */ I(
2483
+ return /* @__PURE__ */ N("li", { ref: P ? Ee : null, className: [u.productGroup, P ? u.productGroupPickerOpen : null].filter(Boolean).join(" "), children: [
2484
+ /* @__PURE__ */ N("div", { className: u.productGroupHeader, children: [
2485
+ /* @__PURE__ */ a("div", { className: u.productGroupThumbWrap, children: f != null && f.url ? /* @__PURE__ */ a("img", { src: f.url, alt: f.altText ?? h.productTitle, width: f.width ?? 56, height: f.height ?? 56, className: u.productGroupThumb, loading: "lazy" }) : /* @__PURE__ */ a("div", { className: u.productGroupThumbFallback, children: h.productTitle.slice(0, 1).toUpperCase() || "•" }) }),
2486
+ /* @__PURE__ */ a("div", { className: u.productGroupInfo, children: /* @__PURE__ */ a("div", { className: u.productGroupTitle, children: h.productTitle }) }),
2487
+ /* @__PURE__ */ a("div", { className: u.productGroupActions, children: /* @__PURE__ */ N(
2348
2488
  "button",
2349
2489
  {
2350
2490
  type: "button",
2351
- className: [u.selectButton, B ? u.selectButtonOpen : null].filter(Boolean).join(" "),
2352
- "aria-expanded": B,
2491
+ className: [u.selectButton, P ? u.selectButtonOpen : null].filter(Boolean).join(" "),
2492
+ "aria-expanded": P,
2353
2493
  disabled: t,
2354
- onMouseDown: (N) => N.stopPropagation(),
2355
- onClick: () => Me((N) => N === m.productId ? null : m.productId),
2494
+ onMouseDown: (k) => k.stopPropagation(),
2495
+ onClick: () => Re((k) => k === h.productId ? null : h.productId),
2356
2496
  children: [
2357
- v("bundle.select.variant"),
2358
- /* @__PURE__ */ n(Zt, { size: 13, strokeWidth: 2.5, className: u.selectButtonChevron })
2497
+ g("bundle.select.variant"),
2498
+ /* @__PURE__ */ a(dn, { size: 13, strokeWidth: 2.5, className: u.selectButtonChevron })
2359
2499
  ]
2360
2500
  }
2361
2501
  ) })
2362
2502
  ] }),
2363
- B && /* @__PURE__ */ n("div", { className: u.variantPicker, children: m.variants.map((N) => {
2364
- const A = se(N.id), V = (b[N.id] ?? 0) > 0, oe = N.availableForSale === !1, re = A != null && A <= 0, G = !V && ve, x = t || oe || re || G, D = oe ? v("bundle.stock.sold_out") : re ? v("bundle.stock.max_added") : G ? v("bundle.stock.max_reached") : null, ee = Se(N);
2365
- return /* @__PURE__ */ I(
2503
+ P && /* @__PURE__ */ a("div", { className: u.variantPicker, children: h.variants.map((k) => {
2504
+ const L = le(k.id), W = (b[k.id] ?? 0) > 0, te = k.availableForSale === !1, D = L != null && L <= 0, C = !W && Le, O = t || te || D || C, ue = te ? g("bundle.stock.sold_out") : D ? g("bundle.stock.max_added") : C ? g("bundle.stock.max_reached") : null, oe = Be(k);
2505
+ return /* @__PURE__ */ N(
2366
2506
  "button",
2367
2507
  {
2368
2508
  type: "button",
2369
- disabled: x,
2370
- className: [u.variantPickerRow, V ? u.variantPickerRowSelected : null].filter(Boolean).join(" "),
2509
+ disabled: O,
2510
+ className: [u.variantPickerRow, W ? u.variantPickerRowSelected : null].filter(Boolean).join(" "),
2371
2511
  onClick: () => {
2372
- V || q(N.id, 1), Me(null);
2512
+ if (!W) {
2513
+ if (ye) {
2514
+ pe(k, 1), Re(null);
2515
+ return;
2516
+ }
2517
+ pe(k, 1);
2518
+ }
2519
+ Re(null);
2373
2520
  },
2374
2521
  children: [
2375
- /* @__PURE__ */ n("span", { className: u.variantPickerLabel, children: ee }),
2376
- /* @__PURE__ */ n("span", { className: u.variantPickerPrice, children: D ?? be(N.price) }),
2377
- V ? /* @__PURE__ */ n("span", { className: u.variantPickerCheck, "aria-hidden": "true", children: "✓" }) : null
2522
+ /* @__PURE__ */ a("span", { className: u.variantPickerLabel, children: oe }),
2523
+ /* @__PURE__ */ a("span", { className: u.variantPickerPrice, children: ue ?? xe(k.price) }),
2524
+ W ? /* @__PURE__ */ a("span", { className: u.variantPickerCheck, "aria-hidden": "true", children: "✓" }) : null
2378
2525
  ]
2379
2526
  },
2380
- N.id
2527
+ k.id
2381
2528
  );
2382
2529
  }) }),
2383
- T.length > 0 && /* @__PURE__ */ n("ul", { className: u.selectedVariantsList, children: T.map((N) => {
2384
- const A = b[N.id] ?? 0, V = se(N.id), oe = V ?? Number.POSITIVE_INFINITY, re = A >= oe, G = !t && N.availableForSale !== !1 && !ve && !re, x = Se(N);
2385
- return /* @__PURE__ */ I("li", { className: u.selectedVariantRow, "data-variant-row": N.id, children: [
2386
- /* @__PURE__ */ I("div", { className: u.selectedVariantInfo, children: [
2387
- /* @__PURE__ */ n("span", { className: u.selectedVariantName, children: x }),
2388
- /* @__PURE__ */ n("span", { className: u.selectedVariantPrice, children: be(N.price) })
2530
+ R.length > 0 && /* @__PURE__ */ a("ul", { className: u.selectedVariantsList, children: R.map((k) => {
2531
+ const L = b[k.id] ?? 0, W = le(k.id), te = W ?? Number.POSITIVE_INFINITY, D = L >= te, C = !t && k.availableForSale !== !1 && !Le && !D, O = Be(k);
2532
+ return /* @__PURE__ */ N("li", { className: u.selectedVariantRow, "data-variant-row": k.id, children: [
2533
+ /* @__PURE__ */ N("div", { className: u.selectedVariantInfo, children: [
2534
+ /* @__PURE__ */ a("span", { className: u.selectedVariantName, children: O }),
2535
+ /* @__PURE__ */ a("span", { className: u.selectedVariantPrice, children: xe(k.price) })
2389
2536
  ] }),
2390
- /* @__PURE__ */ I("div", { className: u.qtyActions, children: [
2391
- /* @__PURE__ */ n("button", { type: "button", className: u.qtyTrash, "aria-label": v("bundle.a11y.remove_from_bundle", { name: N.displayName }), disabled: t, onClick: () => q(N.id, 0), children: /* @__PURE__ */ n(Mt, { size: 14 }) }),
2392
- /* @__PURE__ */ I(
2537
+ /* @__PURE__ */ N("div", { className: u.qtyActions, children: [
2538
+ /* @__PURE__ */ a("button", { type: "button", className: u.qtyTrash, "aria-label": g("bundle.a11y.remove_from_bundle", { name: k.displayName }), disabled: t, onClick: () => K(k.id, 0), children: /* @__PURE__ */ a(zt, { size: 14 }) }),
2539
+ /* @__PURE__ */ N(
2393
2540
  "div",
2394
2541
  {
2395
- className: [u.qtyChip, G ? u.qtyChipInteractive : null].filter(Boolean).join(" "),
2396
- role: G ? "button" : void 0,
2397
- tabIndex: G ? 0 : void 0,
2398
- "aria-label": v("bundle.a11y.quantity", { name: N.displayName, qty: A }),
2399
- onClick: G ? () => q(N.id, A + 1) : void 0,
2400
- onKeyDown: G ? (D) => {
2401
- (D.key === "Enter" || D.key === " ") && (D.preventDefault(), q(N.id, A + 1));
2542
+ className: [u.qtyChip, C ? u.qtyChipInteractive : null].filter(Boolean).join(" "),
2543
+ role: C ? "button" : void 0,
2544
+ tabIndex: C ? 0 : void 0,
2545
+ "aria-label": g("bundle.a11y.quantity", { name: k.displayName, qty: L }),
2546
+ onClick: C ? () => pe(k, L + 1) : void 0,
2547
+ onKeyDown: C ? (ue) => {
2548
+ (ue.key === "Enter" || ue.key === " ") && (ue.preventDefault(), pe(k, L + 1));
2402
2549
  } : void 0,
2403
2550
  children: [
2404
- /* @__PURE__ */ n("span", { className: u.qtyChipValue, children: A }),
2405
- /* @__PURE__ */ n("button", { type: "button", className: u.qtyChipClear, "aria-label": v("bundle.a11y.increase", { name: N.displayName }), disabled: !G, onClick: (D) => {
2406
- D.stopPropagation(), q(N.id, A + 1);
2407
- }, onKeyDown: (D) => D.stopPropagation(), children: /* @__PURE__ */ n(bt, { size: 12, strokeWidth: 2 }) })
2551
+ /* @__PURE__ */ a("span", { className: u.qtyChipValue, children: L }),
2552
+ /* @__PURE__ */ a("button", { type: "button", className: u.qtyChipClear, "aria-label": g("bundle.a11y.increase", { name: k.displayName }), disabled: !C, onClick: (ue) => {
2553
+ ue.stopPropagation(), pe(k, L + 1);
2554
+ }, onKeyDown: (ue) => ue.stopPropagation(), children: /* @__PURE__ */ a(Nt, { size: 12, strokeWidth: 2 }) })
2408
2555
  ]
2409
2556
  }
2410
2557
  )
2411
2558
  ] })
2412
- ] }, N.id);
2559
+ ] }, k.id);
2413
2560
  }) })
2414
- ] }, m.productId);
2415
- }) }) : /* @__PURE__ */ n("ul", { className: u.variantList, children: Ve.map((m) => {
2416
- var G;
2417
- const f = b[m.id] ?? 0, g = ce(m), B = xe(m), T = E(m.selectedOptions), j = m.availableForSale === !1, K = se(m.id), N = K ?? Number.POSITIVE_INFINITY, A = f >= N, V = !j && !ve && !A, oe = V, re = !j && A ? v("bundle.stock.max_reached") : null;
2418
- return /* @__PURE__ */ I(
2561
+ ] }, h.productId);
2562
+ }) }) : /* @__PURE__ */ a("ul", { className: u.variantList, children: ee.map((h) => {
2563
+ var C;
2564
+ const f = b[h.id] ?? 0, w = Ne(h), P = qe(h), R = Z(h.selectedOptions), V = h.availableForSale === !1, T = le(h.id), k = T ?? Number.POSITIVE_INFINITY, L = f >= k, W = !V && !Le && !L, te = !ye && W, D = !V && L ? g("bundle.stock.max_reached") : null;
2565
+ return /* @__PURE__ */ N(
2419
2566
  "li",
2420
2567
  {
2421
2568
  className: [
2422
2569
  u.variantRow,
2423
- oe ? u.variantRowInteractive : null,
2570
+ te ? u.variantRowInteractive : null,
2424
2571
  f > 0 ? u.variantRowSelected : null,
2425
- j ? u.variantRowSoldOut : null
2572
+ V ? u.variantRowSoldOut : null
2426
2573
  ].filter(Boolean).join(" "),
2427
- "data-variant-row": m.id,
2428
- role: oe ? "button" : void 0,
2429
- tabIndex: oe ? 0 : void 0,
2430
- onClick: oe ? () => {
2431
- q(m.id, f + 1);
2574
+ "data-variant-row": h.id,
2575
+ role: te ? "button" : void 0,
2576
+ tabIndex: te ? 0 : void 0,
2577
+ onClick: te ? () => {
2578
+ pe(h, f + 1);
2432
2579
  } : void 0,
2433
- onKeyDown: oe ? (x) => {
2434
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), q(m.id, f + 1), ze(m.id));
2580
+ onKeyDown: te ? (O) => {
2581
+ (O.key === "Enter" || O.key === " ") && (O.preventDefault(), pe(h, f + 1), Xe(h.id));
2435
2582
  } : void 0,
2436
- "aria-label": j ? v("bundle.a11y.sold_out", { name: B }) : re ? `${B} ${re.toLowerCase()}` : v("bundle.a11y.add_to_bundle", { name: B }),
2583
+ "aria-label": V ? g("bundle.a11y.sold_out", { name: P }) : D ? `${P} ${D.toLowerCase()}` : g("bundle.a11y.add_to_bundle", { name: P }),
2437
2584
  children: [
2438
- /* @__PURE__ */ n("div", { className: u.variantMedia, children: (G = m.image) != null && G.url ? /* @__PURE__ */ n(
2585
+ /* @__PURE__ */ a("div", { className: u.variantMedia, children: (C = h.image) != null && C.url ? /* @__PURE__ */ a(
2439
2586
  "img",
2440
2587
  {
2441
- src: m.image.url,
2442
- alt: m.image.altText ?? B,
2443
- width: m.image.width ?? 64,
2444
- height: m.image.height ?? 64,
2588
+ src: h.image.url,
2589
+ alt: h.image.altText ?? P,
2590
+ width: h.image.width ?? 64,
2591
+ height: h.image.height ?? 64,
2445
2592
  className: u.variantImage,
2446
2593
  loading: "lazy"
2447
2594
  }
2448
- ) : /* @__PURE__ */ n("div", { className: u.variantImageFallback, children: v("bundle.item.generic") }) }),
2449
- /* @__PURE__ */ I("div", { className: u.variantContent, children: [
2450
- /* @__PURE__ */ I("div", { className: u.variantHeader, children: [
2451
- /* @__PURE__ */ n("div", { className: u.variantTitle, children: g }),
2452
- T ? /* @__PURE__ */ n("div", { className: u.variantMeta, children: T }) : null
2595
+ ) : /* @__PURE__ */ a("div", { className: u.variantImageFallback, children: g("bundle.item.generic") }) }),
2596
+ /* @__PURE__ */ N("div", { className: u.variantContent, children: [
2597
+ /* @__PURE__ */ N("div", { className: u.variantHeader, children: [
2598
+ /* @__PURE__ */ a("div", { className: u.variantTitle, children: w }),
2599
+ R ? /* @__PURE__ */ a("div", { className: u.variantMeta, children: R }) : null
2453
2600
  ] }),
2454
- /* @__PURE__ */ I("div", { className: u.variantFooterRow, children: [
2455
- /* @__PURE__ */ n("div", { className: u.variantPrice, children: be(m.price) }),
2456
- /* @__PURE__ */ n("div", { className: u.variantActions, children: j ? /* @__PURE__ */ n("div", { className: u.soldOut, "aria-label": v("bundle.a11y.sold_out", { name: B }), children: v("bundle.stock.sold_out") }) : f <= 0 && N <= 0 ? /* @__PURE__ */ n("div", { className: u.stockLimitNotice, "aria-label": v("bundle.a11y.max_available_selected", { name: B }), children: v("bundle.stock.max_added") }) : /* @__PURE__ */ I("div", { className: u.qtyActionsWrap, children: [
2457
- /* @__PURE__ */ I("div", { className: u.qtyActions, children: [
2458
- f > 0 ? /* @__PURE__ */ n(
2601
+ /* @__PURE__ */ N("div", { className: u.variantFooterRow, children: [
2602
+ /* @__PURE__ */ a("div", { className: u.variantPrice, children: xe(h.price) }),
2603
+ /* @__PURE__ */ a("div", { className: u.variantActions, children: V ? /* @__PURE__ */ a("div", { className: u.soldOut, "aria-label": g("bundle.a11y.sold_out", { name: P }), children: g("bundle.stock.sold_out") }) : f <= 0 && k <= 0 ? /* @__PURE__ */ a("div", { className: u.stockLimitNotice, "aria-label": g("bundle.a11y.max_available_selected", { name: P }), children: g("bundle.stock.max_added") }) : /* @__PURE__ */ N("div", { className: u.qtyActionsWrap, children: [
2604
+ /* @__PURE__ */ N("div", { className: u.qtyActions, children: [
2605
+ f > 0 ? /* @__PURE__ */ a(
2459
2606
  "button",
2460
2607
  {
2461
2608
  type: "button",
2462
2609
  className: u.qtyTrash,
2463
- "aria-label": v("bundle.a11y.remove_from_bundle", { name: B }),
2464
- onClick: (x) => {
2465
- x.stopPropagation(), q(m.id, 0);
2610
+ "aria-label": g("bundle.a11y.remove_from_bundle", { name: P }),
2611
+ onClick: (O) => {
2612
+ O.stopPropagation(), K(h.id, 0);
2466
2613
  },
2467
- onKeyDown: (x) => {
2468
- x.stopPropagation();
2614
+ onKeyDown: (O) => {
2615
+ O.stopPropagation();
2469
2616
  },
2470
- children: /* @__PURE__ */ n(Mt, { size: 14 })
2617
+ children: /* @__PURE__ */ a(zt, { size: 14 })
2471
2618
  }
2472
2619
  ) : null,
2473
- /* @__PURE__ */ n(
2620
+ /* @__PURE__ */ a(
2474
2621
  "div",
2475
2622
  {
2476
- className: [u.qtyChip, V ? u.qtyChipInteractive : null].filter(Boolean).join(" "),
2477
- "aria-label": v("bundle.a11y.quantity", { name: B, qty: f }),
2478
- onClick: V ? (x) => {
2479
- x.stopPropagation(), q(m.id, f + 1);
2623
+ className: [u.qtyChip, W ? u.qtyChipInteractive : null].filter(Boolean).join(" "),
2624
+ "aria-label": g("bundle.a11y.quantity", { name: P, qty: f }),
2625
+ onClick: W ? (O) => {
2626
+ O.stopPropagation(), pe(h, f + 1);
2480
2627
  } : void 0,
2481
- onKeyDown: (x) => {
2482
- x.stopPropagation();
2628
+ onKeyDown: (O) => {
2629
+ O.stopPropagation();
2483
2630
  },
2484
- role: V ? "button" : void 0,
2485
- tabIndex: V ? 0 : void 0,
2486
- children: f <= 0 ? /* @__PURE__ */ n("span", { className: u.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ n(bt, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ I(ct, { children: [
2487
- /* @__PURE__ */ n("span", { className: u.qtyChipValue, children: f }),
2488
- /* @__PURE__ */ n(
2631
+ role: W ? "button" : void 0,
2632
+ tabIndex: W ? 0 : void 0,
2633
+ children: f <= 0 ? /* @__PURE__ */ a("span", { className: u.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ a(Nt, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ N(bt, { children: [
2634
+ /* @__PURE__ */ a("span", { className: u.qtyChipValue, children: f }),
2635
+ /* @__PURE__ */ a(
2489
2636
  "button",
2490
2637
  {
2491
2638
  type: "button",
2492
2639
  className: u.qtyChipClear,
2493
- "aria-label": v("bundle.a11y.increase", { name: B }),
2494
- onClick: (x) => {
2495
- x.stopPropagation(), q(m.id, f + 1);
2640
+ "aria-label": g("bundle.a11y.increase", { name: P }),
2641
+ onClick: (O) => {
2642
+ O.stopPropagation(), pe(h, f + 1);
2496
2643
  },
2497
- onKeyDown: (x) => {
2498
- x.stopPropagation();
2644
+ onKeyDown: (O) => {
2645
+ O.stopPropagation();
2499
2646
  },
2500
- disabled: !V,
2501
- children: /* @__PURE__ */ n(bt, { size: 12, strokeWidth: 2 })
2647
+ disabled: !W,
2648
+ children: /* @__PURE__ */ a(Nt, { size: 12, strokeWidth: 2 })
2502
2649
  }
2503
2650
  )
2504
2651
  ] })
2505
2652
  }
2506
2653
  )
2507
2654
  ] }),
2508
- re ? /* @__PURE__ */ n("div", { className: u.stockLimitNotice, children: re }) : null
2655
+ D ? /* @__PURE__ */ a("div", { className: u.stockLimitNotice, children: D }) : null
2509
2656
  ] }) })
2510
2657
  ] })
2511
2658
  ] })
2512
2659
  ]
2513
2660
  },
2514
- m.id
2661
+ h.id
2515
2662
  );
2516
2663
  }) }) })
2517
2664
  ] }) : null,
2518
- /* @__PURE__ */ I("footer", { className: u.footer, children: [
2519
- /* @__PURE__ */ n("div", { className: u.boxSummaryWindow, ref: $e, children: /* @__PURE__ */ n("div", { className: u.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Ke }).map((m, f) => {
2520
- var V, oe, re, G;
2521
- const g = Re[f], B = nt.get(f), T = !!g, j = !!B, K = j && !T, N = B ? v("bundle.discount.off_label", { discount: z(B.discountPercent) }) : null, A = T ? g.displayName : v("bundle.slot", { slot: f + 1 });
2522
- return /* @__PURE__ */ I("div", { "data-box-slot": f, className: u.boxSlot, children: [
2523
- /* @__PURE__ */ n(
2665
+ /* @__PURE__ */ N("footer", { className: u.footer, children: [
2666
+ /* @__PURE__ */ a("div", { className: u.boxSummaryWindow, ref: We, children: /* @__PURE__ */ a("div", { className: u.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: it }).map((h, f) => {
2667
+ var W, te, D, C;
2668
+ const w = Ue[f], P = at.get(f), R = !!w, V = !!P, T = V && !R, k = P ? g("bundle.discount.off_label", { discount: Q(P.discountPercent) }) : null, L = R ? w.displayName : g("bundle.slot", { slot: f + 1 });
2669
+ return /* @__PURE__ */ N("div", { "data-box-slot": f, className: u.boxSlot, children: [
2670
+ /* @__PURE__ */ a(
2524
2671
  "div",
2525
2672
  {
2526
2673
  className: [
2527
2674
  u.boxItem,
2528
- T ? u.boxItemFilled : u.boxItemPlaceholder,
2529
- j ? u.boxItemThreshold : null,
2530
- T ? u.boxItemClickable : null
2675
+ R ? u.boxItemFilled : u.boxItemPlaceholder,
2676
+ V ? u.boxItemThreshold : null,
2677
+ R ? u.boxItemClickable : null
2531
2678
  ].filter(Boolean).join(" "),
2532
- role: T ? "button" : void 0,
2533
- tabIndex: T ? 0 : void 0,
2534
- onClick: T ? () => ze(g.id) : void 0,
2535
- onKeyDown: T ? (x) => {
2536
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), ze(g.id));
2679
+ role: R ? "button" : void 0,
2680
+ tabIndex: R ? 0 : void 0,
2681
+ onClick: R ? () => Xe(w.id) : void 0,
2682
+ onKeyDown: R ? (O) => {
2683
+ (O.key === "Enter" || O.key === " ") && (O.preventDefault(), Xe(w.id));
2537
2684
  } : void 0,
2538
- "aria-label": K && N ? `${A}. ${v("bundle.unlocks", { discount: N })}.` : A,
2539
- title: K && N ? `${A} • ${v("bundle.unlocks", { discount: N })}` : A,
2540
- children: T ? (V = g.image) != null && V.url ? /* @__PURE__ */ n(
2685
+ "aria-label": T && k ? `${L}. ${g("bundle.unlocks", { discount: k })}.` : L,
2686
+ title: T && k ? `${L} • ${g("bundle.unlocks", { discount: k })}` : L,
2687
+ children: R ? (W = w.image) != null && W.url ? /* @__PURE__ */ a(
2541
2688
  "img",
2542
2689
  {
2543
2690
  className: u.boxItemImage,
2544
- src: g.image.url,
2545
- alt: g.image.altText ?? g.displayName,
2691
+ src: w.image.url,
2692
+ alt: w.image.altText ?? w.displayName,
2546
2693
  width: 1,
2547
2694
  height: 1,
2548
2695
  loading: "lazy"
2549
2696
  }
2550
- ) : /* @__PURE__ */ n("div", { className: u.boxItemFallback, "aria-hidden": "true", children: ((G = (re = (oe = g.product) == null ? void 0 : oe.title) == null ? void 0 : re.slice(0, 1)) == null ? void 0 : G.toUpperCase()) ?? "•" }) : K && N ? /* @__PURE__ */ n("div", { className: u.boxItemDiscountText, children: N }) : /* @__PURE__ */ n("div", { className: u.boxItemPlus, "aria-hidden": "true", children: "+" })
2697
+ ) : /* @__PURE__ */ a("div", { className: u.boxItemFallback, "aria-hidden": "true", children: ((C = (D = (te = w.product) == null ? void 0 : te.title) == null ? void 0 : D.slice(0, 1)) == null ? void 0 : C.toUpperCase()) ?? "•" }) : T && k ? /* @__PURE__ */ a("div", { className: u.boxItemDiscountText, children: k }) : /* @__PURE__ */ a("div", { className: u.boxItemPlus, "aria-hidden": "true", children: "+" })
2551
2698
  }
2552
2699
  ),
2553
- j ? /* @__PURE__ */ n("div", { className: u.boxThresholdLabel, children: B.label }) : null
2700
+ V ? /* @__PURE__ */ a("div", { className: u.boxThresholdLabel, children: P.label }) : null
2554
2701
  ] }, f);
2555
2702
  }) }) }),
2556
- /* @__PURE__ */ n("div", { className: [u.totalsReveal, Ee ? u.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ n(
2703
+ /* @__PURE__ */ a("div", { className: [u.totalsReveal, $e ? u.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ a(
2557
2704
  "div",
2558
2705
  {
2559
- className: [u.ctaTotalsWrap, Ee ? u.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
2560
- "aria-hidden": !Ee,
2561
- children: /* @__PURE__ */ I("div", { className: u.ctaTotals, "aria-label": v("bundle.totals"), children: [
2562
- Ie ? /* @__PURE__ */ n("span", { className: u.ctaDiscountBadge, children: v("bundle.discount.badge", { discount: Ie }) }) : /* @__PURE__ */ n("span", {}),
2563
- /* @__PURE__ */ n("span", { children: Ie ? /* @__PURE__ */ I(ct, { children: [
2564
- /* @__PURE__ */ n("span", { className: u.ctaTotalsStrike, children: be(Le.toFixed(2)) }),
2706
+ className: [u.ctaTotalsWrap, $e ? u.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
2707
+ "aria-hidden": !$e,
2708
+ children: /* @__PURE__ */ N("div", { className: u.ctaTotals, "aria-label": g("bundle.totals"), children: [
2709
+ De ? /* @__PURE__ */ a("span", { className: u.ctaDiscountBadge, children: g("bundle.discount.badge", { discount: De }) }) : /* @__PURE__ */ a("span", {}),
2710
+ /* @__PURE__ */ a("span", { children: De ? /* @__PURE__ */ N(bt, { children: [
2711
+ /* @__PURE__ */ a("span", { className: u.ctaTotalsStrike, children: xe(je.toFixed(2)) }),
2565
2712
  " ",
2566
- /* @__PURE__ */ n("span", { className: u.ctaTotalsPrice, children: be(je.toFixed(2)) })
2567
- ] }) : /* @__PURE__ */ n("span", { className: u.ctaTotalsPrice, children: be(Le.toFixed(2)) }) })
2713
+ /* @__PURE__ */ a("span", { className: u.ctaTotalsPrice, children: xe(be.toFixed(2)) })
2714
+ ] }) : /* @__PURE__ */ a("span", { className: u.ctaTotalsPrice, children: xe(je.toFixed(2)) }) })
2568
2715
  ] })
2569
2716
  }
2570
2717
  ) }),
2571
2718
  (() => {
2572
- const m = (r == null ? void 0 : r.ctaButtonMode) || "add_to_cart";
2573
- return m === "add_to_cart_checkout" ? ke > 0 ? /* @__PURE__ */ n("button", { type: "button", onClick: ye, disabled: !W, className: u.cta, children: t ? v("bundle.cta.adding") : v("bundle.cta.add_more", { count: ke, productWord: ut(ue, ke) }) }) : /* @__PURE__ */ I("div", { className: u.ctaButtonGroup, children: [
2574
- /* @__PURE__ */ n("button", { type: "button", onClick: ye, disabled: !W, className: u.ctaDualLeft, children: /* @__PURE__ */ n("span", { children: v(t ? "bundle.cta.adding" : "bundle.cta.add_to_basket") }) }),
2575
- /* @__PURE__ */ n("button", { type: "button", onClick: H, disabled: !W, className: u.ctaDualRight, children: /* @__PURE__ */ n("span", { children: v(t ? "bundle.cta.processing" : "bundle.cta.checkout") }) })
2576
- ] }) : m === "checkout" ? /* @__PURE__ */ n("button", { type: "button", onClick: H, disabled: !W, className: u.cta, children: t ? v("bundle.cta.processing") : ke > 0 ? v("bundle.cta.add_more", { count: ke, productWord: ut(ue, ke) }) : v("bundle.cta.checkout") }) : /* @__PURE__ */ n("button", { type: "button", onClick: ye, disabled: !W, className: u.cta, children: t ? v("bundle.cta.adding") : ke > 0 ? v("bundle.cta.add_more", { count: ke, productWord: ut(ue, ke) }) : v("bundle.cta.add_to_basket") });
2719
+ const h = (o == null ? void 0 : o.ctaButtonMode) || "add_to_cart";
2720
+ return h === "add_to_cart_checkout" ? ge > 0 ? /* @__PURE__ */ a("button", { type: "button", onClick: U, disabled: !G, className: u.cta, children: t ? g("bundle.cta.adding") : g("bundle.cta.add_more", { count: ge, productWord: ft(z, ge) }) }) : /* @__PURE__ */ N("div", { className: u.ctaButtonGroup, children: [
2721
+ /* @__PURE__ */ a("button", { type: "button", onClick: U, disabled: !G, className: u.ctaDualLeft, children: /* @__PURE__ */ a("span", { children: g(t ? "bundle.cta.adding" : "bundle.cta.add_to_basket") }) }),
2722
+ /* @__PURE__ */ a("button", { type: "button", onClick: he, disabled: !G, className: u.ctaDualRight, children: /* @__PURE__ */ a("span", { children: g(t ? "bundle.cta.processing" : "bundle.cta.checkout") }) })
2723
+ ] }) : h === "checkout" ? /* @__PURE__ */ a("button", { type: "button", onClick: he, disabled: !G, className: u.cta, children: t ? g("bundle.cta.processing") : ge > 0 ? g("bundle.cta.add_more", { count: ge, productWord: ft(z, ge) }) : g("bundle.cta.checkout") }) : /* @__PURE__ */ a("button", { type: "button", onClick: U, disabled: !G, className: u.cta, children: t ? g("bundle.cta.adding") : ge > 0 ? g("bundle.cta.add_more", { count: ge, productWord: ft(z, ge) }) : g("bundle.cta.add_to_basket") });
2577
2724
  })(),
2578
- /* @__PURE__ */ I("div", { className: u.poweredBy, children: [
2579
- v("bundle.powered_by"),
2725
+ /* @__PURE__ */ N("div", { className: u.poweredBy, children: [
2726
+ g("bundle.powered_by"),
2580
2727
  " ",
2581
- /* @__PURE__ */ n("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
2728
+ /* @__PURE__ */ a("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
2582
2729
  ] })
2583
2730
  ] })
2584
2731
  ] });
2585
2732
  }
2586
- const io = "_panel_mo8go_1", oo = "_title_mo8go_12", lo = "_status_mo8go_19", so = "_error_mo8go_24", co = "_rules_mo8go_30", uo = "_rule_mo8go_30", mo = "_ruleInput_mo8go_44", ho = "_ruleLabel_mo8go_50", bo = "_ruleLabelContent_mo8go_59", fo = "_ruleSelected_mo8go_66", po = "_ruleTitle_mo8go_71", _o = "_ruleSubtitle_mo8go_77", yo = "_priceRow_mo8go_83", vo = "_oldPrice_mo8go_90", wo = "_newPrice_mo8go_96", we = {
2587
- panel: io,
2588
- title: oo,
2589
- status: lo,
2590
- error: so,
2591
- rules: co,
2592
- rule: uo,
2593
- ruleInput: mo,
2594
- ruleLabel: ho,
2595
- ruleLabelContent: bo,
2596
- ruleSelected: fo,
2597
- ruleTitle: po,
2598
- ruleSubtitle: _o,
2599
- priceRow: yo,
2600
- oldPrice: vo,
2601
- newPrice: wo
2733
+ const No = "_panel_mo8go_1", Io = "_title_mo8go_12", ko = "_status_mo8go_19", So = "_error_mo8go_24", Co = "_rules_mo8go_30", xo = "_rule_mo8go_30", Po = "_ruleInput_mo8go_44", Bo = "_ruleLabel_mo8go_50", To = "_ruleLabelContent_mo8go_59", Lo = "_ruleSelected_mo8go_66", Ro = "_ruleTitle_mo8go_71", Fo = "_ruleSubtitle_mo8go_77", Mo = "_priceRow_mo8go_83", Ao = "_oldPrice_mo8go_90", Oo = "_newPrice_mo8go_96", Ie = {
2734
+ panel: No,
2735
+ title: Io,
2736
+ status: ko,
2737
+ error: So,
2738
+ rules: Co,
2739
+ rule: xo,
2740
+ ruleInput: Po,
2741
+ ruleLabel: Bo,
2742
+ ruleLabelContent: To,
2743
+ ruleSelected: Lo,
2744
+ ruleTitle: Ro,
2745
+ ruleSubtitle: Fo,
2746
+ priceRow: Mo,
2747
+ oldPrice: Ao,
2748
+ newPrice: Oo
2602
2749
  };
2603
- function Ht(a) {
2604
- const e = String(a ?? "").trim();
2750
+ function on(r) {
2751
+ const e = String(r ?? "").trim();
2605
2752
  if (!e) return "";
2606
2753
  if (e.startsWith("gid://shopify/ProductVariant/")) return e;
2607
2754
  const t = e.replace(/\D/g, "");
2608
2755
  return t ? `gid://shopify/ProductVariant/${t}` : "";
2609
2756
  }
2610
- function go() {
2757
+ function qo() {
2611
2758
  if (typeof window > "u") return "";
2612
- const a = new URLSearchParams(window.location.search).get("variant");
2613
- if (a) return Ht(a);
2759
+ const r = new URLSearchParams(window.location.search).get("variant");
2760
+ if (r) return on(r);
2614
2761
  const e = document.querySelector('form[action*="/cart/add"]'), t = e == null ? void 0 : e.querySelector('input[name="id"], select[name="id"]');
2615
- return Ht((t == null ? void 0 : t.value) ?? "");
2762
+ return on((t == null ? void 0 : t.value) ?? "");
2616
2763
  }
2617
- function Jt() {
2764
+ function mn() {
2618
2765
  if (typeof document > "u") return null;
2619
- const a = document.querySelector('form[action*="/cart/add"]');
2620
- return (a == null ? void 0 : a.querySelector('input[name="quantity"]')) ?? null;
2766
+ const r = document.querySelector('form[action*="/cart/add"]');
2767
+ return (r == null ? void 0 : r.querySelector('input[name="quantity"]')) ?? null;
2621
2768
  }
2622
- function No() {
2623
- const a = Jt();
2624
- if (!a) return null;
2625
- const e = Number(a.value ?? NaN);
2769
+ function Vo() {
2770
+ const r = mn();
2771
+ if (!r) return null;
2772
+ const e = Number(r.value ?? NaN);
2626
2773
  return !Number.isFinite(e) || e <= 0 ? null : Math.floor(e);
2627
2774
  }
2628
- function ko(a) {
2629
- const e = Jt();
2630
- return e ? (e.value = String(a), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 })), !0) : !1;
2775
+ function Eo(r) {
2776
+ const e = mn();
2777
+ return e ? (e.value = String(r), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 })), !0) : !1;
2631
2778
  }
2632
- function Vo({ className: a, preferFirstEligibleVariant: e = !1 }) {
2633
- var ae, k, ge;
2634
- const { loading: t, error: l, config: o, eligibleVariants: r, currencyCode: p, locale: b } = yt(), [F, se] = ne(""), [q, Y] = ne(null), [de, W] = ne(null), ye = e || typeof window < "u" && !!window.__BUNDLE_PREVIEW_CONFIG__;
2635
- U(() => {
2636
- const z = () => se(go());
2637
- z(), document.addEventListener("variant:change", z);
2638
- const E = window.setInterval(z, 500);
2779
+ function es({ className: r, preferFirstEligibleVariant: e = !1 }) {
2780
+ var g, Se, I;
2781
+ const { loading: t, error: l, config: s, eligibleVariants: o, currencyCode: v, locale: b } = Pt(), [A, le] = X(""), [K, ke] = X(null), [ie, Pe] = X(null), G = e || typeof window < "u" && !!window.__BUNDLE_PREVIEW_CONFIG__;
2782
+ j(() => {
2783
+ const q = () => le(qo());
2784
+ q(), document.addEventListener("variant:change", q);
2785
+ const Q = window.setInterval(q, 500);
2639
2786
  return () => {
2640
- document.removeEventListener("variant:change", z), window.clearInterval(E);
2787
+ document.removeEventListener("variant:change", q), window.clearInterval(Q);
2641
2788
  };
2642
- }, []), U(() => {
2643
- const z = () => Y(No()), E = (ce) => {
2644
- const xe = ce.target;
2645
- xe instanceof HTMLInputElement && xe.name === "quantity" && z();
2789
+ }, []), j(() => {
2790
+ const q = () => ke(Vo()), Q = (ce) => {
2791
+ const Ne = ce.target;
2792
+ Ne instanceof HTMLInputElement && Ne.name === "quantity" && q();
2646
2793
  };
2647
- z(), document.addEventListener("input", E, !0), document.addEventListener("change", E, !0);
2648
- const me = window.setInterval(z, 500);
2794
+ q(), document.addEventListener("input", Q, !0), document.addEventListener("change", Q, !0);
2795
+ const Z = window.setInterval(q, 500);
2649
2796
  return () => {
2650
- document.removeEventListener("input", E, !0), document.removeEventListener("change", E, !0), window.clearInterval(me);
2797
+ document.removeEventListener("input", Q, !0), document.removeEventListener("change", Q, !0), window.clearInterval(Z);
2651
2798
  };
2652
2799
  }, []);
2653
- const H = $(
2654
- () => [...(o == null ? void 0 : o.rules) ?? []].sort((z, E) => z.minBundleSize - E.minBundleSize),
2655
- [o == null ? void 0 : o.rules]
2656
- ), ue = ye ? ((ae = r[0]) == null ? void 0 : ae.id) || "" : F || ((k = r[0]) == null ? void 0 : k.id) || "", v = r.find((z) => z.id === ue) ?? null;
2657
- return U(() => {
2658
- var z;
2659
- if (!H.length) {
2660
- W(null);
2800
+ const U = E(
2801
+ () => [...(s == null ? void 0 : s.rules) ?? []].sort((q, Q) => q.minBundleSize - Q.minBundleSize),
2802
+ [s == null ? void 0 : s.rules]
2803
+ ), he = G ? ((g = o[0]) == null ? void 0 : g.id) || "" : A || ((Se = o[0]) == null ? void 0 : Se.id) || "", z = o.find((q) => q.id === he) ?? null;
2804
+ return j(() => {
2805
+ var q;
2806
+ if (!U.length) {
2807
+ Pe(null);
2661
2808
  return;
2662
2809
  }
2663
- if (q != null) {
2664
- let E = null;
2665
- for (const me of H)
2666
- me.minBundleSize <= q && (E = me.handle);
2667
- W(E ?? ((z = H[0]) == null ? void 0 : z.handle) ?? null);
2810
+ if (K != null) {
2811
+ let Q = null;
2812
+ for (const Z of U)
2813
+ Z.minBundleSize <= K && (Q = Z.handle);
2814
+ Pe(Q ?? ((q = U[0]) == null ? void 0 : q.handle) ?? null);
2668
2815
  return;
2669
2816
  }
2670
- W((E) => {
2671
- var me;
2672
- return E ?? ((me = H[0]) == null ? void 0 : me.handle) ?? null;
2817
+ Pe((Q) => {
2818
+ var Z;
2819
+ return Q ?? ((Z = U[0]) == null ? void 0 : Z.handle) ?? null;
2673
2820
  });
2674
- }, [q, H]), (o == null ? void 0 : o.bundleType) !== "volume_discount" ? null : /* @__PURE__ */ I("section", { className: [we.panel, a].filter(Boolean).join(" "), "aria-busy": t, children: [
2675
- /* @__PURE__ */ n("h2", { className: we.title, children: ((ge = o == null ? void 0 : o.title) == null ? void 0 : ge.trim()) || "Volume discount" }),
2676
- t ? /* @__PURE__ */ n("div", { className: we.status, children: "Loading volume discounts…" }) : null,
2677
- l ? /* @__PURE__ */ n("div", { className: we.error, children: l }) : null,
2678
- !t && !l && !v ? /* @__PURE__ */ n("div", { className: we.status, children: "Select an eligible variant to view volume discounts." }) : null,
2679
- !t && !l && v ? /* @__PURE__ */ n(ct, { children: /* @__PURE__ */ n("div", { className: we.rules, children: H.map((z) => {
2680
- const E = Number.parseFloat(z.discountPercent), me = Number.isFinite(E) && E > 0 ? `Save ${Math.round(E)}%` : "Standard", ce = de === z.handle;
2681
- return /* @__PURE__ */ n(
2821
+ }, [K, U]), (s == null ? void 0 : s.bundleType) !== "volume_discount" ? null : /* @__PURE__ */ N("section", { className: [Ie.panel, r].filter(Boolean).join(" "), "aria-busy": t, children: [
2822
+ /* @__PURE__ */ a("h2", { className: Ie.title, children: ((I = s == null ? void 0 : s.title) == null ? void 0 : I.trim()) || "Volume discount" }),
2823
+ t ? /* @__PURE__ */ a("div", { className: Ie.status, children: "Loading volume discounts…" }) : null,
2824
+ l ? /* @__PURE__ */ a("div", { className: Ie.error, children: l }) : null,
2825
+ !t && !l && !z ? /* @__PURE__ */ a("div", { className: Ie.status, children: "Select an eligible variant to view volume discounts." }) : null,
2826
+ !t && !l && z ? /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a("div", { className: Ie.rules, children: U.map((q) => {
2827
+ const Q = Number.parseFloat(q.discountPercent), Z = Number.isFinite(Q) && Q > 0 ? `Save ${Math.round(Q)}%` : "Standard", ce = ie === q.handle;
2828
+ return /* @__PURE__ */ a(
2682
2829
  "div",
2683
2830
  {
2684
- className: [we.rule, ce ? we.ruleSelected : ""].filter(Boolean).join(" "),
2685
- children: /* @__PURE__ */ I("label", { className: we.ruleLabel, children: [
2686
- /* @__PURE__ */ I("div", { className: we.ruleLabelContent, children: [
2687
- /* @__PURE__ */ n(
2831
+ className: [Ie.rule, ce ? Ie.ruleSelected : ""].filter(Boolean).join(" "),
2832
+ children: /* @__PURE__ */ N("label", { className: Ie.ruleLabel, children: [
2833
+ /* @__PURE__ */ N("div", { className: Ie.ruleLabelContent, children: [
2834
+ /* @__PURE__ */ a(
2688
2835
  "input",
2689
2836
  {
2690
- className: we.ruleInput,
2837
+ className: Ie.ruleInput,
2691
2838
  type: "radio",
2692
2839
  checked: ce,
2693
2840
  name: "bb-volume-discount-rule",
2694
2841
  onChange: () => {
2695
- W(z.handle), ko(z.minBundleSize);
2842
+ Pe(q.handle), Eo(q.minBundleSize);
2696
2843
  }
2697
2844
  }
2698
2845
  ),
2699
- /* @__PURE__ */ n("span", { className: we.ruleTitle, children: `Buy ${z.minBundleSize}` }),
2700
- /* @__PURE__ */ n("span", { className: we.ruleSubtitle, children: me })
2846
+ /* @__PURE__ */ a("span", { className: Ie.ruleTitle, children: `Buy ${q.minBundleSize}` }),
2847
+ /* @__PURE__ */ a("span", { className: Ie.ruleSubtitle, children: Z })
2701
2848
  ] }),
2702
- /* @__PURE__ */ n("div", { children: (() => {
2703
- const xe = Number(v.price ?? NaN);
2704
- if (!Number.isFinite(xe)) return null;
2705
- const Se = xe * z.minBundleSize, be = Number.isFinite(E) && E > 0, Ve = be ? Se * (1 - E / 100) : Se;
2706
- return be ? /* @__PURE__ */ I("span", { className: we.priceRow, children: [
2707
- /* @__PURE__ */ n("span", { className: we.oldPrice, children: ft(Se, p, b) }),
2708
- /* @__PURE__ */ n("span", { className: we.newPrice, children: ft(Ve, p, b) })
2709
- ] }) : /* @__PURE__ */ n("span", { className: we.priceRow, children: /* @__PURE__ */ n("span", { className: we.newPrice, children: ft(Se, p, b) }) });
2849
+ /* @__PURE__ */ a("div", { children: (() => {
2850
+ const Ne = Number(z.price ?? NaN);
2851
+ if (!Number.isFinite(Ne)) return null;
2852
+ const qe = Ne * q.minBundleSize, Be = Number.isFinite(Q) && Q > 0, xe = Be ? qe * (1 - Q / 100) : qe;
2853
+ return Be ? /* @__PURE__ */ N("span", { className: Ie.priceRow, children: [
2854
+ /* @__PURE__ */ a("span", { className: Ie.oldPrice, children: It(qe, v, b) }),
2855
+ /* @__PURE__ */ a("span", { className: Ie.newPrice, children: It(xe, v, b) })
2856
+ ] }) : /* @__PURE__ */ a("span", { className: Ie.priceRow, children: /* @__PURE__ */ a("span", { className: Ie.newPrice, children: It(qe, v, b) }) });
2710
2857
  })() })
2711
2858
  ] })
2712
2859
  },
2713
- z.handle
2860
+ q.handle
2714
2861
  );
2715
2862
  }) }) }) : null
2716
2863
  ] });
2717
2864
  }
2718
- function Ot(a) {
2719
- if (a != null && a.length)
2720
- return a.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
2865
+ function Wt(r) {
2866
+ if (r != null && r.length)
2867
+ return r.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
2721
2868
  }
2722
- function Qt(a) {
2723
- const e = /\/(\d+)$/.exec(a);
2724
- return e ? e[1] : a;
2869
+ function sn(r) {
2870
+ const e = /\/(\d+)$/.exec(r);
2871
+ return e ? e[1] : r;
2725
2872
  }
2726
- function Co(a) {
2727
- if (a == null) return null;
2728
- const e = String(a).trim();
2873
+ function Do(r) {
2874
+ if (r == null) return null;
2875
+ const e = String(r).trim();
2729
2876
  return e ? e.startsWith("gid://shopify/ProductVariant/") ? e : `gid://shopify/ProductVariant/${e}` : null;
2730
2877
  }
2731
- function xo() {
2732
- var a;
2733
- return typeof window > "u" ? null : ((a = window.Shopify) == null ? void 0 : a.theme) ?? null;
2878
+ function $o() {
2879
+ var r;
2880
+ return typeof window > "u" ? null : ((r = window.Shopify) == null ? void 0 : r.theme) ?? null;
2734
2881
  }
2735
- function Io() {
2736
- const a = xo();
2737
- return a ? a.schema_name === "Sleek" ? !0 : /sleek/i.test(a.name ?? "") : !1;
2882
+ function zo() {
2883
+ const r = $o();
2884
+ return r ? r.schema_name === "Sleek" ? !0 : /sleek/i.test(r.name ?? "") : !1;
2738
2885
  }
2739
- function So() {
2886
+ function Wo() {
2740
2887
  return typeof document > "u" ? !1 : !!document.querySelector("cart-drawer");
2741
2888
  }
2742
- function Po() {
2743
- return !Io() || !So() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2889
+ function Go() {
2890
+ return !zo() || !Wo() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2744
2891
  bubbles: !0,
2745
2892
  detail: { open: !0 }
2746
2893
  })), !0);
2747
2894
  }
2748
- function Bo() {
2895
+ function jo() {
2749
2896
  window.location.reload();
2750
2897
  }
2751
- async function Ct(a, e) {
2752
- const t = await fetch(a, {
2898
+ async function At(r, e) {
2899
+ const t = await fetch(r, {
2753
2900
  method: "POST",
2754
2901
  headers: {
2755
2902
  Accept: "application/json",
@@ -2763,8 +2910,8 @@ async function Ct(a, e) {
2763
2910
  }
2764
2911
  return t.json().catch(() => null);
2765
2912
  }
2766
- async function To() {
2767
- const a = await fetch("/cart.js", {
2913
+ async function Uo() {
2914
+ const r = await fetch("/cart.js", {
2768
2915
  method: "GET",
2769
2916
  cache: "no-store",
2770
2917
  headers: {
@@ -2772,52 +2919,52 @@ async function To() {
2772
2919
  "Content-Type": "application/json"
2773
2920
  }
2774
2921
  });
2775
- if (!a.ok)
2776
- throw new Error(`Cart request failed: ${a.status}`);
2777
- return a.json();
2922
+ if (!r.ok)
2923
+ throw new Error(`Cart request failed: ${r.status}`);
2924
+ return r.json();
2778
2925
  }
2779
- function Eo() {
2926
+ function ts() {
2780
2927
  return {
2781
- async linesAdd(a) {
2782
- const e = a.map((t) => ({
2783
- id: Qt(t.merchandiseId),
2928
+ async linesAdd(r) {
2929
+ const e = r.map((t) => ({
2930
+ id: sn(t.merchandiseId),
2784
2931
  quantity: t.quantity,
2785
- properties: Ot(t.attributes)
2932
+ properties: Wt(t.attributes)
2786
2933
  }));
2787
- await Ct("/cart/add.js", { items: e });
2934
+ await At("/cart/add.js", { items: e });
2788
2935
  },
2789
- async linesAddForCheckout(a) {
2790
- const e = a.map((t) => ({
2791
- id: Qt(t.merchandiseId),
2936
+ async linesAddForCheckout(r) {
2937
+ const e = r.map((t) => ({
2938
+ id: sn(t.merchandiseId),
2792
2939
  quantity: t.quantity,
2793
- properties: Ot(t.attributes)
2940
+ properties: Wt(t.attributes)
2794
2941
  }));
2795
- await Ct("/cart/add.js", { items: e });
2942
+ await At("/cart/add.js", { items: e });
2796
2943
  },
2797
- async linesUpdate(a) {
2798
- for (const e of a)
2799
- await Ct("/cart/change.js", {
2944
+ async linesUpdate(r) {
2945
+ for (const e of r)
2946
+ await At("/cart/change.js", {
2800
2947
  id: e.id,
2801
2948
  quantity: e.quantity,
2802
- properties: Ot(e.attributes)
2949
+ properties: Wt(e.attributes)
2803
2950
  });
2804
2951
  },
2805
- async linesRemove(a) {
2806
- for (const e of a)
2807
- await Ct("/cart/change.js", { id: e, quantity: 0 });
2952
+ async linesRemove(r) {
2953
+ for (const e of r)
2954
+ await At("/cart/change.js", { id: e, quantity: 0 });
2808
2955
  },
2809
2956
  async getLineQuantitiesByMerchandiseId() {
2810
- const a = await To(), e = {};
2811
- for (const t of a.items ?? []) {
2812
- const l = Co(t.id);
2957
+ const r = await Uo(), e = {};
2958
+ for (const t of r.items ?? []) {
2959
+ const l = Do(t.id);
2813
2960
  if (!l) continue;
2814
- const o = Number(t.quantity ?? 0);
2815
- !Number.isFinite(o) || o <= 0 || (e[l] = (e[l] ?? 0) + Math.floor(o));
2961
+ const s = Number(t.quantity ?? 0);
2962
+ !Number.isFinite(s) || s <= 0 || (e[l] = (e[l] ?? 0) + Math.floor(s));
2816
2963
  }
2817
2964
  return e;
2818
2965
  },
2819
2966
  openCartUI() {
2820
- Po() || window.setTimeout(() => Bo(), 0);
2967
+ Go() || window.setTimeout(() => jo(), 0);
2821
2968
  },
2822
2969
  navigateToCheckout() {
2823
2970
  window.location.href = "/checkout";
@@ -2825,14 +2972,14 @@ function Eo() {
2825
2972
  };
2826
2973
  }
2827
2974
  export {
2828
- Ao as BundleBuilderDrawer,
2829
- qo as BundleBuilderPanel,
2830
- Oo as BundleButton,
2831
- Nt as BundleLineAttributeKeys,
2832
- Fo as BundleProvider,
2833
- Vo as VolumeDiscountPanel,
2834
- Eo as createLiquidCartAdapter,
2835
- yt as useBundleBuilder,
2836
- Mo as useBundleBuilderDrawer
2975
+ Xo as BundleBuilderDrawer,
2976
+ Zo as BundleBuilderPanel,
2977
+ Jo as BundleButton,
2978
+ Ft as BundleLineAttributeKeys,
2979
+ Yo as BundleProvider,
2980
+ es as VolumeDiscountPanel,
2981
+ ts as createLiquidCartAdapter,
2982
+ Pt as useBundleBuilder,
2983
+ Ko as useBundleBuilderDrawer
2837
2984
  };
2838
2985
  //# sourceMappingURL=index.js.map