@best-bundles/bundle-ui 0.0.41 → 0.0.43

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,82 +1,82 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.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_ta0om_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_ta0om_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_ta0om_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_ta0om_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_ta0om_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_ta0om_74{opacity:1}._backdropClosed_ta0om_78{opacity:0}._panel_ta0om_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_ta0om_103{animation:_bbSlideInFromRight_ta0om_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_ta0om_107{animation:_bbSlideOutToRight_ta0om_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_ta0om_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_ta0om_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_ta0om_1{transition:none}._celebrationChip_ta0om_23,._panelOpen_ta0om_103,._panelClosed_ta0om_107{animation:none}}._header_ta0om_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_ta0om_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_ta0om_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_ta0om_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_ta0om_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_ta0om_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_ta0om_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_ta0om_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_ta0om_211 ._headerTitleWrap_ta0om_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_ta0om_211 ._headerSearchWrap_ta0om_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_ta0om_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_ta0om_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_ta0om_235::-webkit-search-cancel-button,._searchInput_ta0om_235::-webkit-search-decoration,._searchInput_ta0om_235::-webkit-search-results-button,._searchInput_ta0om_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_ta0om_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_ta0om_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_ta0om_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_ta0om_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_ta0om_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_ta0om_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_ta0om_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_ta0om_195,._headerSearchWrap_ta0om_199{transition:none}}._body_ta0om_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_ta0om_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_ta0om_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_ta0om_327{margin-top:4px}._variantList_ta0om_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_ta0om_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_ta0om_347{opacity:.65}._variantLeft_ta0om_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_ta0om_358{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_ta0om_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_ta0om_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_ta0om_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_ta0om_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._stockLimitContainer_ta0om_394{display:flex;align-items:center;justify-content:center;height:100%;max-width:120px;padding:0 12px}._soldOut_ta0om_386{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_ta0om_412{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_ta0om_421{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_ta0om_431{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_ta0om_438{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_ta0om_448{min-width:0}._variantName_ta0om_452{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_ta0om_461{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_ta0om_469{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_ta0om_476{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_ta0om_469{font-size:13px;font-weight:800}._qtyControls_ta0om_487{display:inline-flex;align-items:center;gap:6px}._qtyControlsWrap_ta0om_493{display:grid;justify-items:center;gap:4px}._qtyButton_ta0om_499{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_ta0om_499:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_ta0om_499:disabled{opacity:.6;cursor:not-allowed}._qtyButton_ta0om_499:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_ta0om_525{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_ta0om_532{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_ta0om_540{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_ta0om_540 a{color:inherit;text-decoration:none}._boxSummaryWindow_ta0om_552{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_ta0om_552::-webkit-scrollbar{display:none}._boxSummaryRow_ta0om_570{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_ta0om_578{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_ta0om_587{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_ta0om_599{cursor:pointer}._boxItemClickable_ta0om_599:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_ta0om_608{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_ta0om_619{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_ta0om_625{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_ta0om_631{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_ta0om_639{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_ta0om_647{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_ta0om_654{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_ta0om_661{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_ta0om_672{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_ta0om_679{gap:0}._cta_ta0om_672{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_ta0om_695{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_ta0om_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;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_ta0om_725{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_ta0om_725>span{opacity:0}._ctaDualRight_ta0om_738{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_ta0om_754{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_ta0om_754>span{opacity:0}._ctaTotals_ta0om_765{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_ta0om_773{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_ta0om_787{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_ta0om_800{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_ta0om_807{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_ta0om_814{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_ta0om_787{transition:none}}._cta_ta0om_672:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_ta0om_672:disabled{opacity:.6;cursor:not-allowed}._cta_ta0om_672:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_ta0om_695:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_ta0om_695:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_ta0om_695:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_ta0om_707:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_ta0om_707:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_ta0om_707:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_ta0om_738:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_ta0om_738:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_ta0om_738:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_ta0om_883{margin-top:8px;font-size:12px;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center}@media(max-width:767px){._backdrop_ta0om_1{padding:0;justify-content:stretch}._panel_ta0om_82{width:100%;height:100%;border-radius:0}}._panel_96rr4_2 button,._panel_96rr4_2 input,._panel_96rr4_2 [role=button]{box-sizing:border-box;margin:0}._panel_96rr4_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_96rr4_20{text-align:start}._title_96rr4_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_96rr4_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_96rr4_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_96rr4_43{font-size:13px;color:#b45309;font-weight:600}._section_96rr4_49{display:grid;gap:6px}._sectionTitle_96rr4_54{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_96rr4_63{display:flex;justify-content:center;gap:6px}._rulesList_96rr4_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_96rr4_80{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_96rr4_92{font-weight:600;font-size:13px}._ruleDiscount_96rr4_97{font-weight:700;font-size:13px}._ruleLabel_96rr4_102{font-size:12px;opacity:.7}._rulesVisual_96rr4_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_96rr4_114,._rulesLinesRow_96rr4_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_96rr4_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_96rr4_128:empty{display:flex!important}._rulesLineLabel_96rr4_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_96rr4_145{height:1em}._rulesLine_96rr4_121{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_96rr4_121:empty{display:block!important}._rulesLineEmpty_96rr4_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_96rr4_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_96rr4_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_96rr4_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_96rr4_186{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_96rr4_198{cursor:pointer}._variantRowSelected_96rr4_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_96rr4_207{opacity:.65}._variantMedia_96rr4_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_96rr4_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_96rr4_227{display:flex;flex-direction:column;gap:4px}._variantTitle_96rr4_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_96rr4_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_96rr4_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_96rr4_255{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_96rr4_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_96rr4_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_96rr4_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_96rr4_286{display:grid;align-items:end;justify-items:end}._qtyActions_96rr4_292{display:inline-flex;align-items:center;gap:6px}._qtyActionsWrap_96rr4_298{display:grid;justify-items:end;gap:4px}._variantUnavailable_96rr4_304{display:none}._qtyControls_96rr4_308{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_96rr4_318{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_96rr4_318:disabled{cursor:not-allowed;opacity:.4}._qtyButton_96rr4_318:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_96rr4_342{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_96rr4_349{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._stockLimitNotice_96rr4_357{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_96rr4_366{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_96rr4_381{cursor:pointer}._qtyChipValue_96rr4_385{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_96rr4_391{margin-bottom:-3px;font-weight:500}._qtyChipClear_96rr4_396{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_96rr4_366:hover ._qtyChipClear_96rr4_396{background:#0f172a;color:#fff}._qtyChipClear_96rr4_396:disabled{cursor:not-allowed;opacity:.45}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396:disabled{background:#fff;color:#0f172a}._qtyTrash_96rr4_425{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_96rr4_437{display:grid;padding-top:6px}._boxSummaryWindow_96rr4_442{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_96rr4_442::-webkit-scrollbar{display:none}._boxSummaryRow_96rr4_456{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_96rr4_464{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_96rr4_473{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_96rr4_473:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_96rr4_490{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_96rr4_496{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_96rr4_502{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_96rr4_510{cursor:pointer}._boxItemClickable_96rr4_510:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_96rr4_519{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_96rr4_530{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_96rr4_543{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_96rr4_555{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_96rr4_568{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_96rr4_579{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_96rr4_587{max-height:80px;opacity:1}._ctaTotalsWrap_96rr4_592{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_96rr4_597{opacity:1}._ctaTotals_96rr4_592{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_96rr4_612{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_96rr4_623{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_96rr4_629{font-weight:700;color:#0f172a}._cta_96rr4_592{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_96rr4_592:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_96rr4_592:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_96rr4_661{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_96rr4_667,._ctaDualRight_96rr4_668{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_96rr4_667{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_96rr4_668{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_96rr4_667:disabled,._ctaDualRight_96rr4_668:disabled{cursor:not-allowed;opacity:.6}._poweredBy_96rr4_695{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_96rr4_695 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_96rr4_2{padding:16px}._variantRow_96rr4_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_96rr4_308{justify-self:start}._variantDetailsRow_96rr4_239{grid-template-columns:1fr}}')),document.head.appendChild(r)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { jsx as l, jsxs as N, Fragment as xe } from "react/jsx-runtime";
3
- import fe, { useState as q, useRef as V, useCallback as K, useEffect as F, useMemo as T, createContext as qe, useContext as Ve, forwardRef as $e, createElement as Ce } from "react";
4
- const ue = {
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.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_1i4y2_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_1i4y2_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_1i4y2_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_1i4y2_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_1i4y2_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_1i4y2_74{opacity:1}._backdropClosed_1i4y2_78{opacity:0}._panel_1i4y2_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_1i4y2_103{animation:_bbSlideInFromRight_1i4y2_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_1i4y2_107{animation:_bbSlideOutToRight_1i4y2_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_1i4y2_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_1i4y2_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_1i4y2_1{transition:none}._celebrationChip_1i4y2_23,._panelOpen_1i4y2_103,._panelClosed_1i4y2_107{animation:none}}._header_1i4y2_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_1i4y2_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_1i4y2_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_1i4y2_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_1i4y2_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_1i4y2_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_1i4y2_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_1i4y2_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_1i4y2_211 ._headerTitleWrap_1i4y2_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_1i4y2_211 ._headerSearchWrap_1i4y2_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_1i4y2_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_1i4y2_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_1i4y2_235::-webkit-search-cancel-button,._searchInput_1i4y2_235::-webkit-search-decoration,._searchInput_1i4y2_235::-webkit-search-results-button,._searchInput_1i4y2_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_1i4y2_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_1i4y2_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_1i4y2_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_1i4y2_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_1i4y2_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_1i4y2_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_1i4y2_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_1i4y2_195,._headerSearchWrap_1i4y2_199{transition:none}}._body_1i4y2_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_1i4y2_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_1i4y2_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_1i4y2_327{margin-top:4px}._variantList_1i4y2_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_1i4y2_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_1i4y2_347{opacity:.65}._variantLeft_1i4y2_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_1i4y2_358{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_1i4y2_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_1i4y2_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_1i4y2_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_1i4y2_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._stockLimitContainer_1i4y2_394{display:flex;align-items:center;justify-content:center;height:100%;max-width:120px;padding:0 12px}._soldOut_1i4y2_386{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_1i4y2_412{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_1i4y2_421{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_1i4y2_431{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_1i4y2_438{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_1i4y2_448{min-width:0}._variantName_1i4y2_452{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_1i4y2_461{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_1i4y2_469{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_1i4y2_476{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_1i4y2_469{font-size:13px;font-weight:800}._qtyControls_1i4y2_487{display:inline-flex;align-items:center;gap:6px}._qtyControlsWrap_1i4y2_493{display:grid;justify-items:center;gap:4px}._qtyButton_1i4y2_499{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_1i4y2_499:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_1i4y2_499:disabled{opacity:.6;cursor:not-allowed}._qtyButton_1i4y2_499:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_1i4y2_525{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_1i4y2_532{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_1i4y2_540{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_1i4y2_540 a{color:inherit;text-decoration:none}._boxSummaryWindow_1i4y2_552{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_1i4y2_552::-webkit-scrollbar{display:none}._boxSummaryRow_1i4y2_570{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_1i4y2_578{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_1i4y2_587{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_1i4y2_599{cursor:pointer}._boxItemClickable_1i4y2_599:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_1i4y2_608{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_1i4y2_619{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_1i4y2_625{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_1i4y2_631{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_1i4y2_639{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_1i4y2_647{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_1i4y2_654{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_1i4y2_661{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_1i4y2_672{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_1i4y2_679{gap:0}._cta_1i4y2_672{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_1i4y2_695{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_1i4y2_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;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_1i4y2_725{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_1i4y2_725>span{opacity:0}._ctaDualRight_1i4y2_738{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_1i4y2_754{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_1i4y2_754>span{opacity:0}._ctaTotals_1i4y2_765{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_1i4y2_773{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_1i4y2_787{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_1i4y2_800{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_1i4y2_807{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_1i4y2_814{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_1i4y2_787{transition:none}}._cta_1i4y2_672:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_1i4y2_672:disabled{opacity:.6;cursor:not-allowed}._cta_1i4y2_672:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_1i4y2_695:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_1i4y2_695:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_1i4y2_695:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_1i4y2_707:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_1i4y2_707:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_1i4y2_707:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_1i4y2_738:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_1i4y2_738:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_1i4y2_738:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_1i4y2_883{margin-top:8px;font-size:12px;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center}@media(max-width:767px){._backdrop_1i4y2_1{padding:0;justify-content:stretch}._panel_1i4y2_82{width:100%;height:100%;border-radius:0}}._panel_96rr4_2 button,._panel_96rr4_2 input,._panel_96rr4_2 [role=button]{box-sizing:border-box;margin:0}._panel_96rr4_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_96rr4_20{text-align:start}._title_96rr4_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_96rr4_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_96rr4_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_96rr4_43{font-size:13px;color:#b45309;font-weight:600}._section_96rr4_49{display:grid;gap:6px}._sectionTitle_96rr4_54{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_96rr4_63{display:flex;justify-content:center;gap:6px}._rulesList_96rr4_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_96rr4_80{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_96rr4_92{font-weight:600;font-size:13px}._ruleDiscount_96rr4_97{font-weight:700;font-size:13px}._ruleLabel_96rr4_102{font-size:12px;opacity:.7}._rulesVisual_96rr4_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_96rr4_114,._rulesLinesRow_96rr4_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_96rr4_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_96rr4_128:empty{display:flex!important}._rulesLineLabel_96rr4_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_96rr4_145{height:1em}._rulesLine_96rr4_121{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_96rr4_121:empty{display:block!important}._rulesLineEmpty_96rr4_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_96rr4_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_96rr4_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_96rr4_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_96rr4_186{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_96rr4_198{cursor:pointer}._variantRowSelected_96rr4_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_96rr4_207{opacity:.65}._variantMedia_96rr4_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_96rr4_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_96rr4_227{display:flex;flex-direction:column;gap:4px}._variantTitle_96rr4_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_96rr4_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_96rr4_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_96rr4_255{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_96rr4_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_96rr4_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_96rr4_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_96rr4_286{display:grid;align-items:end;justify-items:end}._qtyActions_96rr4_292{display:inline-flex;align-items:center;gap:6px}._qtyActionsWrap_96rr4_298{display:grid;justify-items:end;gap:4px}._variantUnavailable_96rr4_304{display:none}._qtyControls_96rr4_308{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_96rr4_318{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_96rr4_318:disabled{cursor:not-allowed;opacity:.4}._qtyButton_96rr4_318:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_96rr4_342{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_96rr4_349{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._stockLimitNotice_96rr4_357{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_96rr4_366{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_96rr4_381{cursor:pointer}._qtyChipValue_96rr4_385{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_96rr4_391{margin-bottom:-3px;font-weight:500}._qtyChipClear_96rr4_396{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_96rr4_366:hover ._qtyChipClear_96rr4_396{background:#0f172a;color:#fff}._qtyChipClear_96rr4_396:disabled{cursor:not-allowed;opacity:.45}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396:disabled{background:#fff;color:#0f172a}._qtyTrash_96rr4_425{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_96rr4_437{display:grid;padding-top:6px}._boxSummaryWindow_96rr4_442{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_96rr4_442::-webkit-scrollbar{display:none}._boxSummaryRow_96rr4_456{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_96rr4_464{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_96rr4_473{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_96rr4_473:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_96rr4_490{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_96rr4_496{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_96rr4_502{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_96rr4_510{cursor:pointer}._boxItemClickable_96rr4_510:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_96rr4_519{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_96rr4_530{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_96rr4_543{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_96rr4_555{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_96rr4_568{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_96rr4_579{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_96rr4_587{max-height:80px;opacity:1}._ctaTotalsWrap_96rr4_592{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_96rr4_597{opacity:1}._ctaTotals_96rr4_592{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_96rr4_612{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_96rr4_623{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_96rr4_629{font-weight:700;color:#0f172a}._cta_96rr4_592{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_96rr4_592:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_96rr4_592:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_96rr4_661{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_96rr4_667,._ctaDualRight_96rr4_668{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_96rr4_667{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_96rr4_668{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_96rr4_667:disabled,._ctaDualRight_96rr4_668:disabled{cursor:not-allowed;opacity:.6}._poweredBy_96rr4_695{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_96rr4_695 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_96rr4_2{padding:16px}._variantRow_96rr4_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_96rr4_308{justify-self:start}._variantDetailsRow_96rr4_239{grid-template-columns:1fr}}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { jsx as l, jsxs as R, Fragment as kt } from "react/jsx-runtime";
3
+ import vt, { useCallback as J, useState as j, useRef as U, useEffect as O, useMemo as L, createContext as Qt, useContext as Gt, forwardRef as zt, createElement as Tt } from "react";
4
+ const _t = {
5
5
  bundleId: "_bundle_id",
6
6
  bundleConfig: "_bundle_config",
7
7
  bundleSource: "_bundle_source",
8
8
  bundleTitle: "_bundle_title"
9
9
  };
10
- async function ze(a) {
11
- const t = new URL("/api/public/bundle-configs-active", a.apiBaseUrl);
12
- t.searchParams.set("shop", a.shop);
13
- const o = await (await fetch(t, {
10
+ async function Yt(n) {
11
+ const e = new URL("/api/public/bundle-configs-active", n.apiBaseUrl);
12
+ e.searchParams.set("shop", n.shop);
13
+ const a = await (await fetch(e, {
14
14
  method: "GET",
15
- signal: a.signal,
15
+ signal: n.signal,
16
16
  headers: { "Content-Type": "application/json" }
17
17
  })).json().catch(() => null);
18
- return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
18
+ return !a || typeof a != "object" ? { ok: !1, error: "Invalid response." } : a;
19
19
  }
20
- async function We(a) {
21
- const t = new URL("/api/public/bundle-config", a.apiBaseUrl);
22
- t.searchParams.set("shop", a.shop), a.configHandle && t.searchParams.set("handle", a.configHandle), a.fresh && t.searchParams.set("fresh", "1");
23
- const o = await (await fetch(t, {
20
+ async function Kt(n) {
21
+ const e = new URL("/api/public/bundle-config", n.apiBaseUrl);
22
+ e.searchParams.set("shop", n.shop), n.configHandle && e.searchParams.set("handle", n.configHandle), n.fresh && e.searchParams.set("fresh", "1");
23
+ const a = await (await fetch(e, {
24
24
  method: "GET",
25
- signal: a.signal,
25
+ signal: n.signal,
26
26
  headers: { "Content-Type": "application/json" }
27
27
  })).json().catch(() => null);
28
- return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
28
+ return !a || typeof a != "object" ? { ok: !1, error: "Invalid response." } : a;
29
29
  }
30
- async function je(a) {
31
- const t = new URL("/api/public/bundle-config-status", a.apiBaseUrl);
32
- t.searchParams.set("shop", a.shop), a.configHandle && t.searchParams.set("handle", a.configHandle);
33
- const o = await (await fetch(t, {
30
+ async function Xt(n) {
31
+ const e = new URL("/api/public/bundle-config-status", n.apiBaseUrl);
32
+ e.searchParams.set("shop", n.shop), n.configHandle && e.searchParams.set("handle", n.configHandle);
33
+ const a = await (await fetch(e, {
34
34
  method: "GET",
35
- signal: a.signal,
35
+ signal: n.signal,
36
36
  headers: { "Content-Type": "application/json" }
37
37
  })).json().catch(() => null);
38
- return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
38
+ return !a || typeof a != "object" ? { ok: !1, error: "Invalid response." } : a;
39
39
  }
40
- function pe(a) {
41
- if (!a || a.availableForSale === !1) return 0;
42
- if (a.inventoryPolicy === "CONTINUE" || a.sellableOnlineQuantity == null) return Number.POSITIVE_INFINITY;
43
- const t = Number(a.sellableOnlineQuantity);
44
- return !Number.isFinite(t) || t <= 0 && a.availableForSale === !0 ? Number.POSITIVE_INFINITY : Math.max(0, Math.floor(t));
40
+ function xt(n) {
41
+ if (!n || n.availableForSale === !1) return 0;
42
+ if (n.inventoryPolicy === "CONTINUE" || n.sellableOnlineQuantity == null) return Number.POSITIVE_INFINITY;
43
+ const e = Number(n.sellableOnlineQuantity);
44
+ return !Number.isFinite(e) || e <= 0 && n.availableForSale === !0 ? Number.POSITIVE_INFINITY : Math.max(0, Math.floor(e));
45
45
  }
46
- const Te = "bb_anonymous_user_id";
47
- function de() {
46
+ const Ft = "bb_anonymous_user_id";
47
+ function pt() {
48
48
  if (typeof window > "u" || typeof localStorage > "u")
49
49
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
50
50
  try {
51
- const a = localStorage.getItem(Te);
52
- if (a && typeof a == "string" && a.length > 0)
53
- return a;
54
- let t;
51
+ const n = localStorage.getItem(Ft);
52
+ if (n && typeof n == "string" && n.length > 0)
53
+ return n;
54
+ let e;
55
55
  try {
56
- const e = globalThis.crypto;
57
- if (e != null && e.randomUUID)
58
- t = e.randomUUID();
56
+ const t = globalThis.crypto;
57
+ if (t != null && t.randomUUID)
58
+ e = t.randomUUID();
59
59
  else
60
60
  throw new Error("crypto.randomUUID not available");
61
61
  } catch {
62
- t = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
62
+ e = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
63
63
  }
64
- return localStorage.setItem(Te, t), t;
64
+ return localStorage.setItem(Ft, e), e;
65
65
  } catch {
66
66
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
67
67
  }
68
68
  }
69
- async function te(a, t, e) {
69
+ async function lt(n, e, t) {
70
70
  if (!(typeof window > "u"))
71
71
  try {
72
- const o = new URL(a, window.location.origin);
73
- o.searchParams.set("shop", t);
74
- const i = await fetch(o, {
72
+ const a = new URL(n, window.location.origin);
73
+ a.searchParams.set("shop", e);
74
+ const i = await fetch(a, {
75
75
  method: "POST",
76
76
  headers: {
77
77
  "Content-Type": "application/json"
78
78
  },
79
- body: JSON.stringify(e),
79
+ body: JSON.stringify(t),
80
80
  // Don't wait for response - fire and forget
81
81
  keepalive: !0
82
82
  });
@@ -84,23 +84,182 @@ async function te(a, t, e) {
84
84
  `[Bundle Analytics] Event tracking failed with status ${i.status}:`,
85
85
  await i.text().catch(() => "Unable to read response")
86
86
  );
87
- } catch (o) {
88
- console.warn("[Bundle Analytics] Failed to track event:", o);
87
+ } catch (a) {
88
+ console.warn("[Bundle Analytics] Failed to track event:", a);
89
89
  }
90
90
  }
91
- const De = qe(null), oe = "#best-bundles", Ue = [];
92
- function qt(a) {
93
- const t = String(a ?? "").trim().toLowerCase();
94
- return t && t.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
91
+ const ft = {
92
+ "bundle.title.default": "Build your bundle",
93
+ "bundle.loading": "Loading...",
94
+ "bundle.inactive": "Bundles are not active.",
95
+ "bundle.drawer.aria": "Bundle builder",
96
+ "bundle.search": "Search",
97
+ "bundle.search.expanded": "Search (expanded)",
98
+ "bundle.search.placeholder": "Search",
99
+ "bundle.search.clear": "Clear search",
100
+ "bundle.close": "Close",
101
+ "bundle.section.discount_tiers": "Discount tiers",
102
+ "bundle.section.your_bundle": "Your bundle",
103
+ "bundle.section.select_items": "Choose items",
104
+ "bundle.select.items": "Select items",
105
+ "bundle.size.min": "(min {{min}})",
106
+ "bundle.stock.max_reached": "Max Reached",
107
+ "bundle.stock.max_added": "Max Added To Cart",
108
+ "bundle.stock.sold_out": "Sold Out",
109
+ "bundle.item.generic": "Item",
110
+ "bundle.slot": "Slot {{slot}}",
111
+ "bundle.unlocks": "Unlocks {{discount}}",
112
+ "bundle.totals": "Totals",
113
+ "bundle.discount.badge": "{{discount}}% Discount",
114
+ "bundle.discount.off_label": "{{discount}}% off",
115
+ "bundle.celebration.received_discount": "You received a {{discount}}% discount!",
116
+ "bundle.cta.adding": "Adding...",
117
+ "bundle.cta.processing": "Processing...",
118
+ "bundle.cta.checkout": "Checkout",
119
+ "bundle.cta.add_to_bundle": "Add",
120
+ "bundle.cta.add_to_basket": "Add to Basket",
121
+ "bundle.cta.add_more": "Add {{count}} more {{productWord}}",
122
+ "bundle.powered_by": "powered by",
123
+ "bundle.button.default": "Build a bundle",
124
+ "bundle.provider.inactive_error": "Bundle is inactive.",
125
+ "bundle.provider.load_error": "Failed to load bundle config.",
126
+ "bundle.provider.stock_error": "Some bundle items are no longer available in the requested quantity. Please review your selection.",
127
+ "bundle.provider.add_error": "We couldn't add this bundle right now. Please try again.",
128
+ "bundle.a11y.add_to_bundle": "Add {{name}} to bundle",
129
+ "bundle.a11y.remove_from_bundle": "Remove {{name}} from bundle",
130
+ "bundle.a11y.quantity": "{{name}} quantity {{qty}}",
131
+ "bundle.a11y.sold_out": "{{name}} is sold out",
132
+ "bundle.a11y.max_available_selected": "{{name}} max available selected",
133
+ "bundle.a11y.increase": "Increase {{name}}",
134
+ "bundle.a11y.decrease": "Decrease {{name}}"
135
+ }, Zt = {
136
+ ...ft,
137
+ "bundle.title.default": "Creez votre bundle",
138
+ "bundle.loading": "Chargement...",
139
+ "bundle.inactive": "Les bundles ne sont pas actifs.",
140
+ "bundle.drawer.aria": "Constructeur de bundle",
141
+ "bundle.search": "Rechercher",
142
+ "bundle.search.expanded": "Rechercher (deplie)",
143
+ "bundle.search.placeholder": "Rechercher",
144
+ "bundle.search.clear": "Effacer la recherche",
145
+ "bundle.close": "Fermer",
146
+ "bundle.section.discount_tiers": "Paliers de remise",
147
+ "bundle.section.your_bundle": "Votre bundle",
148
+ "bundle.section.select_items": "Choisir des articles",
149
+ "bundle.select.items": "Selectionner des articles",
150
+ "bundle.stock.max_reached": "Maximum atteint",
151
+ "bundle.stock.max_added": "Maximum deja dans le panier",
152
+ "bundle.stock.sold_out": "Rupture de stock",
153
+ "bundle.totals": "Totaux",
154
+ "bundle.discount.badge": "{{discount}}% de réduction",
155
+ "bundle.discount.off_label": "{{discount}}% de réduction",
156
+ "bundle.celebration.received_discount": "Vous avez recu une reduction de {{discount}}% !",
157
+ "bundle.cta.checkout": "Paiement",
158
+ "bundle.cta.add_to_bundle": "Ajouter",
159
+ "bundle.cta.add_to_basket": "Ajouter au panier",
160
+ "bundle.cta.add_more": "Ajoutez encore {{count}} {{productWord}}",
161
+ "bundle.powered_by": "propulse par",
162
+ "bundle.button.default": "Creer un bundle"
163
+ }, Jt = {
164
+ ...ft,
165
+ "bundle.title.default": "Bundle erstellen",
166
+ "bundle.loading": "Wird geladen...",
167
+ "bundle.inactive": "Bundles sind nicht aktiv.",
168
+ "bundle.drawer.aria": "Bundle-Builder",
169
+ "bundle.search": "Suchen",
170
+ "bundle.search.expanded": "Suche (erweitert)",
171
+ "bundle.search.placeholder": "Suchen",
172
+ "bundle.search.clear": "Suche loschen",
173
+ "bundle.close": "Schliessen",
174
+ "bundle.section.discount_tiers": "Rabattstufen",
175
+ "bundle.section.your_bundle": "Ihr Bundle",
176
+ "bundle.section.select_items": "Artikel auswahlen",
177
+ "bundle.select.items": "Artikel auswahlen",
178
+ "bundle.stock.max_reached": "Maximum erreicht",
179
+ "bundle.stock.max_added": "Maximum bereits im Warenkorb",
180
+ "bundle.stock.sold_out": "Ausverkauft",
181
+ "bundle.totals": "Summen",
182
+ "bundle.discount.badge": "{{discount}}% Rabatt",
183
+ "bundle.discount.off_label": "{{discount}}% Rabatt",
184
+ "bundle.celebration.received_discount": "Sie haben {{discount}}% Rabatt erhalten!",
185
+ "bundle.cta.checkout": "Zur Kasse",
186
+ "bundle.cta.add_to_bundle": "Hinzufügen",
187
+ "bundle.cta.add_to_basket": "In den Warenkorb",
188
+ "bundle.cta.add_more": "Fuge noch {{count}} {{productWord}} hinzu",
189
+ "bundle.powered_by": "powered by",
190
+ "bundle.button.default": "Bundle erstellen"
191
+ }, en = {
192
+ ...ft,
193
+ "bundle.title.default": "Crea tu bundle",
194
+ "bundle.loading": "Cargando...",
195
+ "bundle.inactive": "Los bundles no estan activos.",
196
+ "bundle.drawer.aria": "Constructor de bundles",
197
+ "bundle.search": "Buscar",
198
+ "bundle.search.expanded": "Buscar (expandido)",
199
+ "bundle.search.placeholder": "Buscar",
200
+ "bundle.search.clear": "Limpiar busqueda",
201
+ "bundle.close": "Cerrar",
202
+ "bundle.section.discount_tiers": "Niveles de descuento",
203
+ "bundle.section.your_bundle": "Tu bundle",
204
+ "bundle.section.select_items": "Elegir articulos",
205
+ "bundle.select.items": "Seleccionar articulos",
206
+ "bundle.stock.max_reached": "Maximo alcanzado",
207
+ "bundle.stock.max_added": "Maximo agregado al carrito",
208
+ "bundle.stock.sold_out": "Agotado",
209
+ "bundle.totals": "Totales",
210
+ "bundle.discount.badge": "{{discount}}% de descuento",
211
+ "bundle.discount.off_label": "{{discount}}% de descuento",
212
+ "bundle.celebration.received_discount": "Has recibido un {{discount}}% de descuento!",
213
+ "bundle.cta.checkout": "Pagar",
214
+ "bundle.cta.add_to_bundle": "Agregar",
215
+ "bundle.cta.add_to_basket": "Agregar al carrito",
216
+ "bundle.cta.add_more": "Agrega {{count}} {{productWord}} mas",
217
+ "bundle.powered_by": "impulsado por",
218
+ "bundle.button.default": "Crear bundle"
219
+ }, tn = {
220
+ en: ft,
221
+ fr: Zt,
222
+ de: Jt,
223
+ es: en
224
+ };
225
+ function nn(n) {
226
+ const e = String(n ?? "").trim().toLowerCase();
227
+ if (!e) return "en";
228
+ const t = e.split("-")[0] ?? "en";
229
+ return t === "fr" || t === "de" || t === "en" || t === "es" ? t : "en";
230
+ }
231
+ function rn(n, e, t, a) {
232
+ var r;
233
+ const i = (a == null ? void 0 : a[e]) ?? ((r = tn[n]) == null ? void 0 : r[e]) ?? ft[e] ?? e;
234
+ return t ? Object.entries(t).reduce((h, [u, B]) => h.replaceAll(`{{${u}}}`, String(B)), i) : i;
235
+ }
236
+ function jt(n, e, t) {
237
+ const a = Number(n);
238
+ if (!Number.isFinite(a)) return String(n);
239
+ if (e)
240
+ try {
241
+ return new Intl.NumberFormat(t || void 0, { style: "currency", currency: e }).format(a);
242
+ } catch {
243
+ }
244
+ return `$${a.toFixed(2)}`;
245
+ }
246
+ function ct(n, e) {
247
+ const t = e === 1 ? "one" : "many";
248
+ return n === "fr" ? t === "one" ? "produit" : "produits" : n === "de" ? t === "one" ? "Produkt" : "Produkte" : n === "es" ? t === "one" ? "producto" : "productos" : t === "one" ? "product" : "products";
249
+ }
250
+ const Ut = Qt(null), mt = "#best-bundles", an = [];
251
+ function Qe(n) {
252
+ const e = String(n ?? "").trim().toLowerCase();
253
+ return e && e.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
95
254
  }
96
- function ke(a) {
97
- const t = String(a ?? "").trim().toLowerCase();
98
- if (!t.startsWith(oe)) return null;
99
- if (t === oe) return "default";
100
- const e = `${oe}:`;
101
- return t.startsWith(e) ? qt(t.slice(e.length)) : null;
255
+ function Ot(n) {
256
+ const e = String(n ?? "").trim().toLowerCase();
257
+ if (!e.startsWith(mt)) return null;
258
+ if (e === mt) return "default";
259
+ const t = `${mt}:`;
260
+ return e.startsWith(t) ? Qe(e.slice(t.length)) : null;
102
261
  }
103
- const He = {
262
+ const on = {
104
263
  primaryColor: "--bb-cta-bg",
105
264
  primaryHoverColor: "--bb-cta-bg-hover",
106
265
  primaryTextColor: "--bb-cta-text",
@@ -122,753 +281,760 @@ const He = {
122
281
  celebrationBorderColor: "--bb-celebration-border",
123
282
  fontFamilyBody: "--bb-font-family-body",
124
283
  fontFamilyTitle: "--bb-font-family-title"
125
- }, _e = "bb-google-fonts";
126
- function Re(a) {
127
- const t = (a ?? "").trim().replace(/^["']|["']$/g, "");
128
- return t ? encodeURIComponent(t).replace(/%20/g, "+") : "";
284
+ }, Ct = "bb-google-fonts";
285
+ function At(n) {
286
+ const e = (n ?? "").trim().replace(/^["']|["']$/g, "");
287
+ return e ? encodeURIComponent(e).replace(/%20/g, "+") : "";
129
288
  }
130
- function Qe(a) {
131
- var d;
289
+ function sn(n) {
290
+ var u;
132
291
  if (typeof document > "u" || !document.head) return;
133
- if (!a) {
134
- (d = document.getElementById(_e)) == null || d.remove();
292
+ if (!n) {
293
+ (u = document.getElementById(Ct)) == null || u.remove();
135
294
  return;
136
295
  }
137
- const t = (a.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), e = (a.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), o = [];
138
- t && o.push("family=" + Re(t)), e && e !== t && o.push("family=" + Re(e));
139
- const i = document.getElementById(_e);
140
- if (o.length === 0) {
296
+ const e = (n.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (n.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), a = [];
297
+ e && a.push("family=" + At(e)), t && t !== e && a.push("family=" + At(t));
298
+ const i = document.getElementById(Ct);
299
+ if (a.length === 0) {
141
300
  i == null || i.remove();
142
301
  return;
143
302
  }
144
- const r = `https://fonts.googleapis.com/css2?${o.join("&")}&display=swap`;
303
+ const r = `https://fonts.googleapis.com/css2?${a.join("&")}&display=swap`;
145
304
  if (i) {
146
305
  i.getAttribute("href") !== r && i.setAttribute("href", r);
147
306
  return;
148
307
  }
149
- const m = document.createElement("link");
150
- m.id = _e, m.rel = "stylesheet", m.href = r, document.head.appendChild(m);
308
+ const h = document.createElement("link");
309
+ h.id = Ct, h.rel = "stylesheet", h.href = r, document.head.appendChild(h);
151
310
  }
152
- function Me(a) {
153
- if (!a) return;
154
- Qe(a);
155
- const t = document.documentElement;
156
- Object.entries(He).forEach(([e, o]) => {
157
- let i = a[e];
158
- i && ((e === "fontFamilyBody" || e === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(i) && !/^["']/.test(i.trim()) && (i = `"${i.trim().replace(/^["']|["']$/g, "")}"`), t.style.setProperty(o, i));
311
+ function Dt(n) {
312
+ if (!n) return;
313
+ sn(n);
314
+ const e = document.documentElement;
315
+ Object.entries(on).forEach(([t, a]) => {
316
+ let i = n[t];
317
+ i && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(i) && !/^["']/.test(i.trim()) && (i = `"${i.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(a, i));
159
318
  });
160
319
  }
161
- function Le(a) {
162
- if (typeof window > "u") return a;
163
- const t = window.__BUNDLE_PREVIEW_STYLES__;
164
- return t && typeof t == "object" ? t : a;
320
+ function Et(n) {
321
+ if (typeof window > "u") return n;
322
+ const e = window.__BUNDLE_PREVIEW_STYLES__;
323
+ return e && typeof e == "object" ? e : n;
165
324
  }
166
- function Ge() {
325
+ function ln() {
167
326
  try {
168
- const a = globalThis.crypto;
169
- if (a != null && a.randomUUID) return a.randomUUID();
327
+ const n = globalThis.crypto;
328
+ if (n != null && n.randomUUID) return n.randomUUID();
170
329
  } catch {
171
330
  }
172
331
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
173
332
  }
174
- function me(a) {
175
- return Number.isFinite(a) ? Math.max(0, Math.floor(a)) : 0;
333
+ function gt(n) {
334
+ return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0;
176
335
  }
177
- function ye(a, t) {
178
- const e = me(a);
179
- return Number.isFinite(t) ? Math.min(e, Math.max(0, Math.floor(t))) : e;
336
+ function It(n, e) {
337
+ const t = gt(n);
338
+ return Number.isFinite(e) ? Math.min(t, Math.max(0, Math.floor(e))) : t;
180
339
  }
181
- function Ye(a, t) {
182
- return !a && !t;
340
+ function cn(n, e) {
341
+ return !n && !e;
183
342
  }
184
- function li(a) {
343
+ function wi(n) {
185
344
  const {
186
- apiBaseUrl: t,
187
- shop: e,
188
- cartAdapter: o,
345
+ apiBaseUrl: e,
346
+ shop: t,
347
+ cartAdapter: a,
189
348
  configHandle: i = "default",
190
349
  initialData: r,
191
- configFetcher: m,
192
- activeConfigsFetcher: d,
193
- configStatusFetcher: S,
194
- analyticsEndpoint: ct,
195
- allowDrawerWhenInactive: A = !1,
196
- children: O
197
- } = a, et = qt(i), C = ct ?? `${t}/api/public/bundle-analytics`, Y = Ye(A, r), [X, ot] = q(!1), [J, z] = q(!1), [yt, Z] = q(null), [gt, $t] = q(!1), [j, ut] = q({}), [U, dt] = q(et), [Tt, It] = q(() => r ? { [et]: r } : {}), [ht, zt] = q(Y), [kt, Ct] = q(
198
- !Y && !r ? et : null
199
- ), [Nt, Dt] = q(null), [Rt, Wt] = q(null), [Xt, wt] = q(
350
+ configFetcher: h,
351
+ activeConfigsFetcher: u,
352
+ configStatusFetcher: B,
353
+ analyticsEndpoint: le,
354
+ allowDrawerWhenInactive: $ = !1,
355
+ locale: D,
356
+ messages: de,
357
+ children: F
358
+ } = n, te = nn(D), z = J((o, s) => rn(te, o, s, de), [te, de]), K = Qe(i), g = le ?? `${e}/api/public/bundle-analytics`, H = cn($, r), [I, he] = j(!1), [ke, Te] = j(!1), [ye, ae] = j(null), [X, ie] = j(!1), [me, Re] = j({}), [ne, Ce] = j(K), [be, Ve] = j(() => r ? { [K]: r } : {}), [ge, Le] = j(H), [Ie, Ae] = j(
359
+ !H && !r ? K : null
360
+ ), [nt, We] = j(null), [ze, Me] = j(null), [Ye, Ne] = j(
200
361
  () => ({ selections: {}, order: [] })
201
- ), jt = V(null), Mt = V(null), Lt = V(null), ft = V(0), h = V(U), _ = V(Tt), w = V(ht), B = V(null), R = m ?? We, E = d ?? ze, $ = S ?? je, H = K(async () => {
202
- if (typeof o.getLineQuantitiesByMerchandiseId != "function") return null;
203
- const n = await o.getLineQuantitiesByMerchandiseId();
204
- return Object.entries(n ?? {}).reduce((s, [u, p]) => {
205
- const y = me(p);
206
- return y > 0 && (s[u] = y), s;
362
+ ), De = U(null), ve = U(null), f = U(null), p = U(0), x = U(ne), T = U(be), M = U(ge), E = U(null), V = h ?? Kt, Z = u ?? Yt, ee = B ?? Xt, Q = J(async () => {
363
+ if (typeof a.getLineQuantitiesByMerchandiseId != "function") return null;
364
+ const o = await a.getLineQuantitiesByMerchandiseId();
365
+ return Object.entries(o ?? {}).reduce((s, [b, w]) => {
366
+ const y = gt(w);
367
+ return y > 0 && (s[b] = y), s;
207
368
  }, {});
208
- }, [o]), M = K(async () => {
209
- const n = ++ft.current;
210
- $t(!0);
369
+ }, [a]), A = J(async () => {
370
+ const o = ++p.current;
371
+ ie(!0);
211
372
  try {
212
- const s = await H();
213
- return s && n === ft.current && ut(s), s;
373
+ const s = await Q();
374
+ return s && o === p.current && Re(s), s;
214
375
  } catch {
215
376
  return null;
216
377
  } finally {
217
- n === ft.current && $t(!1);
378
+ o === p.current && ie(!1);
218
379
  }
219
- }, [H]);
220
- F(() => {
221
- h.current = U;
222
- }, [U]), F(() => {
223
- _.current = Tt;
224
- }, [Tt]), F(() => {
225
- w.current = ht;
226
- }, [ht]), F(() => {
227
- M();
228
- }, [M]);
229
- const W = K((n) => {
230
- dt(qt(n));
231
- }, []), Q = K(() => {
232
- if (C)
380
+ }, [Q]);
381
+ O(() => {
382
+ x.current = ne;
383
+ }, [ne]), O(() => {
384
+ T.current = be;
385
+ }, [be]), O(() => {
386
+ M.current = ge;
387
+ }, [ge]), O(() => {
388
+ A();
389
+ }, [A]);
390
+ const q = J((o) => {
391
+ Ce(Qe(o));
392
+ }, []), Se = J(() => {
393
+ if (g)
233
394
  try {
234
- const n = de();
235
- te(C, e, {
395
+ const o = pt();
396
+ lt(g, t, {
236
397
  eventType: "DRAWER_CLOSED",
237
- shop: e,
238
- anonymousUserId: n,
398
+ shop: t,
399
+ anonymousUserId: o,
239
400
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
240
401
  mixpanelEvent: "bundle_closed"
241
402
  }).catch((s) => {
242
403
  console.warn("[Bundle Analytics] Failed to track drawer closed:", s);
243
404
  });
244
- } catch (n) {
245
- console.warn("[Bundle Analytics] Error in close() callback:", n);
405
+ } catch (o) {
406
+ console.warn("[Bundle Analytics] Error in close() callback:", o);
246
407
  }
247
- ot(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(oe) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
248
- }, [C, e]), L = K(() => {
249
- ot((n) => {
250
- if (n) return n;
251
- if (C)
408
+ he(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(mt) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
409
+ }, [g, t]), Pe = J(() => {
410
+ he((o) => {
411
+ if (o) return o;
412
+ if (g)
252
413
  try {
253
- const s = de();
254
- te(C, e, {
414
+ const s = pt();
415
+ lt(g, t, {
255
416
  eventType: "DRAWER_OPENED",
256
- shop: e,
417
+ shop: t,
257
418
  anonymousUserId: s,
258
419
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
259
420
  mixpanelEvent: "bundle_opened"
260
- }).catch((u) => {
261
- console.warn("[Bundle Analytics] Failed to track drawer opened:", u);
421
+ }).catch((b) => {
422
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", b);
262
423
  });
263
424
  } catch (s) {
264
425
  console.warn("[Bundle Analytics] Error in open() callback:", s);
265
426
  }
266
427
  return !0;
267
428
  });
268
- }, [C, e]), Ut = K((n, s) => !s.ok || s.config.isActive === !1 ? (It((u) => {
269
- if (!u[n]) return u;
270
- const p = { ...u };
271
- return delete p[n], p;
272
- }), !A && h.current === n && (Z(s.ok ? "Bundle is inactive." : s.error || "Failed to load bundle config."), ot(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(oe) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (It((u) => ({
273
- ...u,
274
- [n]: {
429
+ }, [g, t]), rt = J((o, s) => !s.ok || s.config.isActive === !1 ? (Ve((b) => {
430
+ if (!b[o]) return b;
431
+ const w = { ...b };
432
+ return delete w[o], w;
433
+ }), !$ && x.current === o && (ae(s.ok ? z("bundle.provider.inactive_error") : s.error || z("bundle.provider.load_error")), he(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(mt) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (Ve((b) => ({
434
+ ...b,
435
+ [o]: {
275
436
  currencyCode: s.currencyCode ?? null,
276
437
  config: s.config,
277
438
  eligibleVariants: s.eligibleVariants ?? []
278
439
  }
279
- })), h.current === n && Z(null), !0), [A]), mt = K((n, s) => {
440
+ })), x.current === o && ae(null), !0), [$, z]), Fe = J((o, s) => {
280
441
  var y;
281
- const u = qt(n);
282
- (y = Mt.current) == null || y.abort();
283
- const p = new AbortController();
284
- Mt.current = p, s != null && s.blocking && Ct(u), Z(null), R({
285
- apiBaseUrl: t,
286
- shop: e,
287
- configHandle: u,
288
- fresh: (s == null ? void 0 : s.blocking) === !0 && !_.current[u],
289
- signal: p.signal
290
- }).then((g) => {
291
- p.signal.aborted || Ut(u, g);
292
- }).catch((g) => {
293
- if (p.signal.aborted) return;
294
- const x = g instanceof Error ? g.message : "Failed to load bundle config.";
295
- h.current === u && Z(x);
442
+ const b = Qe(o);
443
+ (y = ve.current) == null || y.abort();
444
+ const w = new AbortController();
445
+ ve.current = w, s != null && s.blocking && Ae(b), ae(null), V({
446
+ apiBaseUrl: e,
447
+ shop: t,
448
+ configHandle: b,
449
+ fresh: (s == null ? void 0 : s.blocking) === !0 && !T.current[b],
450
+ signal: w.signal
451
+ }).then((C) => {
452
+ w.signal.aborted || rt(b, C);
453
+ }).catch((C) => {
454
+ if (w.signal.aborted) return;
455
+ const k = C instanceof Error ? C.message : z("bundle.provider.load_error");
456
+ x.current === b && ae(k);
296
457
  }).finally(() => {
297
- p.signal.aborted || Ct((g) => g === u ? null : g);
458
+ w.signal.aborted || Ae((C) => C === b ? null : C);
298
459
  });
299
- }, [t, Ut, R, e]), Jt = K((n) => {
300
- const s = qt(n), u = _.current[s];
301
- dt(s), Z(null), mt(s, { blocking: !u });
302
- }, [mt]), vt = K((n, s = "api") => {
303
- var g, x;
304
- const u = qt(n), p = _.current[u];
305
- if (Y && w.current && !p) {
306
- Wt({ handle: u, source: s });
460
+ }, [e, rt, V, t, z]), re = J((o) => {
461
+ const s = Qe(o), b = T.current[s];
462
+ Ce(s), ae(null), Fe(s, { blocking: !b });
463
+ }, [Fe]), W = J((o, s = "api") => {
464
+ var C, k;
465
+ const b = Qe(o), w = T.current[b];
466
+ if (H && M.current && !w) {
467
+ Me({ handle: b, source: s });
307
468
  return;
308
469
  }
309
- if (dt(u), A) {
310
- L(), mt(u, { blocking: !p });
470
+ if (Ce(b), $) {
471
+ Pe(), Fe(b, { blocking: !w });
311
472
  return;
312
473
  }
313
- if ((g = p == null ? void 0 : p.config) != null && g.isActive) {
314
- Z(null), L(), mt(u, { blocking: !1 });
474
+ if ((C = w == null ? void 0 : w.config) != null && C.isActive) {
475
+ ae(null), Pe(), Fe(b, { blocking: !1 });
315
476
  return;
316
477
  }
317
- Dt(u), (x = Lt.current) == null || x.abort();
478
+ We(b), (k = f.current) == null || k.abort();
318
479
  const y = new AbortController();
319
- Lt.current = y, $({
320
- apiBaseUrl: t,
321
- shop: e,
322
- configHandle: u,
480
+ f.current = y, ee({
481
+ apiBaseUrl: e,
482
+ shop: t,
483
+ configHandle: b,
323
484
  signal: y.signal
324
- }).then((k) => {
485
+ }).then((P) => {
325
486
  if (!y.signal.aborted) {
326
- if (Dt((D) => D === u ? null : D), !k.ok || k.isActive !== !0) {
327
- s === "hash" && typeof window < "u" && ke(window.location.hash) === u && window.history.replaceState(null, "", window.location.pathname + window.location.search);
487
+ if (We((G) => G === b ? null : G), !P.ok || P.isActive !== !0) {
488
+ s === "hash" && typeof window < "u" && Ot(window.location.hash) === b && window.history.replaceState(null, "", window.location.pathname + window.location.search);
328
489
  return;
329
490
  }
330
- Z(null), dt(u), L(), mt(u, { blocking: !0 });
491
+ ae(null), Ce(b), Pe(), Fe(b, { blocking: !0 });
331
492
  }
332
493
  }).catch(() => {
333
- y.signal.aborted || Dt((k) => k === u ? null : k);
494
+ y.signal.aborted || We((P) => P === b ? null : P);
334
495
  });
335
496
  }, [
336
- A,
337
- t,
338
- L,
339
- mt,
340
- e,
341
497
  $,
342
- Y
343
- ]), nt = K(() => {
344
- M(), vt(h.current, "api");
345
- }, [vt, M]);
346
- F(() => {
347
- B.current = vt;
348
- }, [vt]);
349
- const rt = K(() => {
350
- if (X) {
351
- Q();
498
+ e,
499
+ Pe,
500
+ Fe,
501
+ t,
502
+ ee,
503
+ H
504
+ ]), at = J(() => {
505
+ A(), W(x.current, "api");
506
+ }, [W, A]);
507
+ O(() => {
508
+ E.current = W;
509
+ }, [W]);
510
+ const Oe = J(() => {
511
+ if (I) {
512
+ Se();
352
513
  return;
353
514
  }
354
- M(), vt(h.current, "api");
355
- }, [Q, X, vt, M]);
356
- F(() => {
357
- dt(qt(i));
358
- }, [i]), F(() => {
515
+ A(), W(x.current, "api");
516
+ }, [Se, I, W, A]);
517
+ O(() => {
518
+ Ce(Qe(i));
519
+ }, [i]), O(() => {
359
520
  var s;
360
- if (!Y) {
361
- zt(!1), r || mt(et, { blocking: !0 });
521
+ if (!H) {
522
+ Le(!1), r || Fe(K, { blocking: !0 });
362
523
  return;
363
524
  }
364
- (s = jt.current) == null || s.abort();
365
- const n = new AbortController();
366
- return jt.current = n, zt(!0), E({ apiBaseUrl: t, shop: e, signal: n.signal }).then((u) => {
367
- n.signal.aborted || u.ok && It((p) => {
368
- const y = { ...p };
369
- for (const [g, x] of Object.entries(u.configs ?? {}))
370
- y[qt(g)] = {
371
- currencyCode: x.currencyCode ?? null,
372
- config: x.config,
373
- eligibleVariants: x.eligibleVariants ?? []
525
+ (s = De.current) == null || s.abort();
526
+ const o = new AbortController();
527
+ return De.current = o, Le(!0), Z({ apiBaseUrl: e, shop: t, signal: o.signal }).then((b) => {
528
+ o.signal.aborted || b.ok && Ve((w) => {
529
+ const y = { ...w };
530
+ for (const [C, k] of Object.entries(b.configs ?? {}))
531
+ y[Qe(C)] = {
532
+ currencyCode: k.currencyCode ?? null,
533
+ config: k.config,
534
+ eligibleVariants: k.eligibleVariants ?? []
374
535
  };
375
536
  return y;
376
537
  });
377
538
  }).catch(() => {
378
539
  }).finally(() => {
379
- n.signal.aborted || zt(!1);
380
- }), () => n.abort();
381
- }, [E, t, r, et, mt, e, Y]), F(() => {
382
- ht || !Rt || (vt(Rt.handle, Rt.source), Wt(null));
383
- }, [ht, vt, Rt]), F(() => {
540
+ o.signal.aborted || Le(!1);
541
+ }), () => o.abort();
542
+ }, [Z, e, r, K, Fe, t, H]), O(() => {
543
+ ge || !ze || (W(ze.handle, ze.source), Me(null));
544
+ }, [ge, W, ze]), O(() => {
384
545
  if (typeof window > "u") return;
385
- const n = () => {
386
- var u;
387
- const s = ke(window.location.hash);
388
- s && ((u = B.current) == null || u.call(B, s, "hash"));
546
+ const o = () => {
547
+ var b;
548
+ const s = Ot(window.location.hash);
549
+ s && ((b = E.current) == null || b.call(E, s, "hash"));
389
550
  };
390
- return n(), window.addEventListener("hashchange", n), () => window.removeEventListener("hashchange", n);
551
+ return o(), window.addEventListener("hashchange", o), () => window.removeEventListener("hashchange", o);
391
552
  }, []);
392
- const bt = Tt[U] ?? null, v = (bt == null ? void 0 : bt.config) ?? null, xt = (bt == null ? void 0 : bt.eligibleVariants) ?? Ue, Pt = (bt == null ? void 0 : bt.currencyCode) ?? null, st = !v && (kt === U || Nt === U) || A && !v && kt != null;
393
- F(() => {
394
- const n = Le(v == null ? void 0 : v.styleSettings);
395
- n && Me(n);
396
- }, [v == null ? void 0 : v.styleSettings]), F(() => {
553
+ const we = be[ne] ?? null, N = (we == null ? void 0 : we.config) ?? null, oe = (we == null ? void 0 : we.eligibleVariants) ?? an, je = (we == null ? void 0 : we.currencyCode) ?? null, xe = !N && (Ie === ne || nt === ne) || $ && !N && Ie != null;
554
+ O(() => {
555
+ const o = Et(N == null ? void 0 : N.styleSettings);
556
+ o && Dt(o);
557
+ }, [N == null ? void 0 : N.styleSettings]), O(() => {
397
558
  if (typeof window > "u") return;
398
- const n = () => {
399
- const s = Le(void 0);
400
- s && Me(s);
559
+ const o = () => {
560
+ const s = Et(void 0);
561
+ s && Dt(s);
401
562
  };
402
- return window.addEventListener("bundle-preview-styles-updated", n), () => window.removeEventListener("bundle-preview-styles-updated", n);
403
- }, []), F(() => {
563
+ return window.addEventListener("bundle-preview-styles-updated", o), () => window.removeEventListener("bundle-preview-styles-updated", o);
564
+ }, []), O(() => {
404
565
  if (typeof window > "u") return;
405
- const n = window, s = () => {
406
- const u = n.__BUNDLE_PREVIEW_CONFIG__;
407
- if (!u) return;
408
- const p = n.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ ?? [];
409
- It((y) => {
410
- var g;
566
+ const o = window, s = () => {
567
+ const b = o.__BUNDLE_PREVIEW_CONFIG__;
568
+ if (!b) return;
569
+ const w = o.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ ?? [];
570
+ Ve((y) => {
571
+ var C;
411
572
  return {
412
573
  ...y,
413
- [h.current]: {
414
- currencyCode: Pt ?? null,
415
- config: u,
416
- eligibleVariants: p.length ? p : ((g = y[h.current]) == null ? void 0 : g.eligibleVariants) ?? []
574
+ [x.current]: {
575
+ currencyCode: je ?? null,
576
+ config: b,
577
+ eligibleVariants: w.length ? w : ((C = y[x.current]) == null ? void 0 : C.eligibleVariants) ?? []
417
578
  }
418
579
  };
419
- }), n.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? Ct(h.current) : Ct((y) => y === h.current ? null : y);
580
+ }), o.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? Ae(x.current) : Ae((y) => y === x.current ? null : y);
420
581
  };
421
- return n.__BUNDLE_PREVIEW_CONFIG__ && s(), window.addEventListener("bundle-preview-config-updated", s), () => window.removeEventListener("bundle-preview-config-updated", s);
422
- }, [Pt]);
423
- const le = T(() => {
424
- const n = Number((v == null ? void 0 : v.maxBundleSize) ?? Number.NaN), s = Number.isFinite(n) ? Math.floor(n) : 100;
582
+ return o.__BUNDLE_PREVIEW_CONFIG__ && s(), window.addEventListener("bundle-preview-config-updated", s), () => window.removeEventListener("bundle-preview-config-updated", s);
583
+ }, [je]);
584
+ const it = L(() => {
585
+ const o = Number((N == null ? void 0 : N.maxBundleSize) ?? Number.NaN), s = Number.isFinite(o) ? Math.floor(o) : 100;
425
586
  return Math.max(2, Math.min(100, s));
426
- }, [v == null ? void 0 : v.maxBundleSize]), Ft = T(() => new Map(
427
- xt.map((n) => {
428
- const s = pe(n);
429
- if (!Number.isFinite(s)) return [n.id, s];
430
- const u = me(j[n.id] ?? 0);
431
- return [n.id, Math.max(0, Math.floor(s) - u)];
587
+ }, [N == null ? void 0 : N.maxBundleSize]), Ue = L(() => new Map(
588
+ oe.map((o) => {
589
+ const s = xt(o);
590
+ if (!Number.isFinite(s)) return [o.id, s];
591
+ const b = gt(me[o.id] ?? 0);
592
+ return [o.id, Math.max(0, Math.floor(s) - b)];
432
593
  })
433
- ), [xt, j]), St = T(() => new Set(
434
- xt.filter((n) => pe(n) > 0).map((n) => n.id)
435
- ), [xt]), Ot = T(() => {
436
- const n = (v == null ? void 0 : v.rules) ?? [], s = n.length ? Math.min(...n.map((g) => g.minBundleSize)) : 2, u = Number.isFinite(s) && s > 0 ? s : 2, p = Number((v == null ? void 0 : v.minBundleSize) ?? Number.NaN), y = Number.isFinite(p) && Number.isInteger(p) ? Math.max(2, Math.min(100, p)) : null;
437
- return y == null ? u : Math.min(u, y);
438
- }, [v == null ? void 0 : v.minBundleSize, v == null ? void 0 : v.rules]), ce = K((n, s) => {
439
- if (gt || !St.has(n) && !st)
594
+ ), [oe, me]), He = L(() => new Set(
595
+ oe.filter((o) => xt(o) > 0).map((o) => o.id)
596
+ ), [oe]), Be = L(() => {
597
+ const o = (N == null ? void 0 : N.rules) ?? [], s = o.length ? Math.min(...o.map((C) => C.minBundleSize)) : 2, b = Number.isFinite(s) && s > 0 ? s : 2, w = Number((N == null ? void 0 : N.minBundleSize) ?? Number.NaN), y = Number.isFinite(w) && Number.isInteger(w) ? Math.max(2, Math.min(100, w)) : null;
598
+ return y == null ? b : Math.min(b, y);
599
+ }, [N == null ? void 0 : N.minBundleSize, N == null ? void 0 : N.rules]), ut = J((o, s) => {
600
+ if (X || !He.has(o) && !xe)
440
601
  return;
441
- const u = Ft.get(n) ?? (st ? Number.POSITIVE_INFINITY : 0), p = ye(s, u);
442
- wt((y) => {
443
- const g = y.selections[n] ?? 0, x = p - g, k = Object.values(y.selections).reduce((it, tt) => it + (tt || 0), 0), D = Number.isFinite(u) ? Math.max(0, Math.floor(u) - g) : x, P = x > 0 ? Math.min(
444
- x,
445
- Math.max(0, le - k),
446
- D
447
- ) : x, G = g + P;
448
- let at;
449
- if (G <= 0) {
450
- const it = { ...y.selections };
451
- delete it[n], at = it;
452
- } else g === G ? at = y.selections : at = { ...y.selections, [n]: G };
453
- let pt = y.order;
454
- if (P > 0)
455
- pt = [...y.order, ...Array.from({ length: P }, () => n)];
456
- else if (P < 0) {
457
- let it = -P;
458
- const tt = [];
459
- for (let Zt = y.order.length - 1; Zt >= 0; Zt--) {
460
- const I = y.order[Zt];
461
- if (I === n && it > 0) {
462
- it--;
602
+ const b = Ue.get(o) ?? (xe ? Number.POSITIVE_INFINITY : 0), w = It(s, b);
603
+ Ne((y) => {
604
+ const C = y.selections[o] ?? 0, k = w - C, P = Object.values(y.selections).reduce((_e, ue) => _e + (ue || 0), 0), G = Number.isFinite(b) ? Math.max(0, Math.floor(b) - C) : k, Y = k > 0 ? Math.min(
605
+ k,
606
+ Math.max(0, it - P),
607
+ G
608
+ ) : k, ce = C + Y;
609
+ let fe;
610
+ if (ce <= 0) {
611
+ const _e = { ...y.selections };
612
+ delete _e[o], fe = _e;
613
+ } else C === ce ? fe = y.selections : fe = { ...y.selections, [o]: ce };
614
+ let $e = y.order;
615
+ if (Y > 0)
616
+ $e = [...y.order, ...Array.from({ length: Y }, () => o)];
617
+ else if (Y < 0) {
618
+ let _e = -Y;
619
+ const ue = [];
620
+ for (let st = y.order.length - 1; st >= 0; st--) {
621
+ const S = y.order[st];
622
+ if (S === o && _e > 0) {
623
+ _e--;
463
624
  continue;
464
625
  }
465
- tt.push(I);
626
+ ue.push(S);
466
627
  }
467
- tt.reverse(), pt = tt;
628
+ ue.reverse(), $e = ue;
468
629
  }
469
- if (at === y.selections && pt === y.order) return y;
470
- const Gt = k, Yt = Object.values(at).reduce((it, tt) => it + (tt || 0), 0);
471
- if (C)
630
+ if (fe === y.selections && $e === y.order) return y;
631
+ const Je = P, et = Object.values(fe).reduce((_e, ue) => _e + (ue || 0), 0);
632
+ if (g)
472
633
  try {
473
- const it = de(), tt = {
634
+ const _e = pt(), ue = {
474
635
  eventType: "VARIANT_SELECTION_CHANGED",
475
- shop: e,
476
- anonymousUserId: it,
636
+ shop: t,
637
+ anonymousUserId: _e,
477
638
  before: { ...y.selections },
478
- after: { ...at },
639
+ after: { ...fe },
479
640
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
480
641
  };
481
- te(C, e, tt), Gt === 0 && Yt >= 1 && te(C, e, {
482
- ...tt,
642
+ lt(g, t, ue), Je === 0 && et >= 1 && lt(g, t, {
643
+ ...ue,
483
644
  mixpanelEvent: "bundle_started"
484
- }), Gt < Ot && Yt >= Ot && te(C, e, {
485
- ...tt,
645
+ }), Je < Be && et >= Be && lt(g, t, {
646
+ ...ue,
486
647
  mixpanelEvent: "bundle_completed"
487
648
  });
488
649
  } catch {
489
650
  }
490
- return { selections: at, order: pt };
651
+ return { selections: fe, order: $e };
491
652
  });
492
- }, [C, gt, St, st, le, Ot, e, Ft]);
493
- F(() => {
494
- st || wt((n) => {
495
- const s = Object.entries(n.selections).map(([g, x]) => {
496
- if (!St.has(g)) return null;
497
- const k = Ft.get(g) ?? 0, D = ye(x, k);
498
- return D <= 0 ? null : [g, D];
499
- }).filter(Boolean), u = Object.fromEntries(s), p = new Map(s), y = n.order.filter((g) => {
500
- const x = p.get(g) ?? 0;
501
- return x <= 0 ? !1 : (p.set(g, x - 1), !0);
653
+ }, [g, X, He, xe, it, Be, t, Ue]);
654
+ O(() => {
655
+ xe || Ne((o) => {
656
+ const s = Object.entries(o.selections).map(([C, k]) => {
657
+ if (!He.has(C)) return null;
658
+ const P = Ue.get(C) ?? 0, G = It(k, P);
659
+ return G <= 0 ? null : [C, G];
660
+ }).filter(Boolean), b = Object.fromEntries(s), w = new Map(s), y = o.order.filter((C) => {
661
+ const k = w.get(C) ?? 0;
662
+ return k <= 0 ? !1 : (w.set(C, k - 1), !0);
502
663
  });
503
- return y.length === n.order.length && s.length === Object.keys(n.selections).length && s.every(([g, x]) => n.selections[g] === x) ? n : { selections: u, order: y };
664
+ return y.length === o.order.length && s.length === Object.keys(o.selections).length && s.every(([C, k]) => o.selections[C] === k) ? o : { selections: b, order: y };
504
665
  });
505
- }, [St, st, Ft]), F(() => {
506
- wt({ selections: {}, order: [] });
507
- }, [U]);
508
- const Et = K(() => wt({ selections: {}, order: [] }), []), ee = K(async () => {
509
- await M();
510
- }, [M]), ne = K((n) => {
511
- const s = Ft.get(n);
666
+ }, [He, xe, Ue]), O(() => {
667
+ Ne({ selections: {}, order: [] });
668
+ }, [ne]);
669
+ const Ke = J(() => Ne({ selections: {}, order: [] }), []), ot = J(async () => {
670
+ await A();
671
+ }, [A]), dt = J((o) => {
672
+ const s = Ue.get(o);
512
673
  return s == null || !Number.isFinite(s) ? null : Math.max(0, Math.floor(s));
513
- }, [Ft]), Bt = Xt.selections, re = Xt.order, At = T(() => Object.values(Bt).reduce((n, s) => n + (s || 0), 0), [Bt]), Ht = T(() => !(st || gt || J || yt || !(v != null && v.isActive) || At < Ot), [At, gt, v == null ? void 0 : v.isActive, yt, st, Ot, J]), Qt = K(async (n) => {
514
- var tt, Zt;
515
- if (!Ht || !v) return;
516
- const s = Ge(), u = (v.title ?? "").trim().slice(0, 255), p = await M(), y = new Map(
517
- xt.map((I) => {
518
- const lt = pe(I);
519
- if (!Number.isFinite(lt)) return [I.id, lt];
520
- const Kt = me((p ?? j)[I.id] ?? 0);
521
- return [I.id, Math.max(0, Math.floor(lt) - Kt)];
674
+ }, [Ue]), Ee = Ye.selections, ht = Ye.order, qe = L(() => Object.values(Ee).reduce((o, s) => o + (s || 0), 0), [Ee]), Xe = L(() => !(xe || X || ke || ye || !(N != null && N.isActive) || qe < Be), [qe, X, N == null ? void 0 : N.isActive, ye, xe, Be, ke]), Ze = J(async (o) => {
675
+ var ue, st;
676
+ if (!Xe || !N) return;
677
+ const s = ln(), b = (N.title ?? "").trim().slice(0, 255), w = await A(), y = new Map(
678
+ oe.map((S) => {
679
+ const se = xt(S);
680
+ if (!Number.isFinite(se)) return [S.id, se];
681
+ const tt = gt((w ?? me)[S.id] ?? 0);
682
+ return [S.id, Math.max(0, Math.floor(se) - tt)];
522
683
  })
523
- ), g = Object.entries(Bt).map(([I, lt]) => ({
524
- merchandiseId: I,
525
- quantity: ye(lt, y.get(I) ?? 0)
526
- })).filter((I) => I.quantity > 0).filter((I) => St.has(I.merchandiseId)).map((I) => ({
527
- merchandiseId: I.merchandiseId,
528
- quantity: I.quantity,
684
+ ), C = Object.entries(Ee).map(([S, se]) => ({
685
+ merchandiseId: S,
686
+ quantity: It(se, y.get(S) ?? 0)
687
+ })).filter((S) => S.quantity > 0).filter((S) => He.has(S.merchandiseId)).map((S) => ({
688
+ merchandiseId: S.merchandiseId,
689
+ quantity: S.quantity,
529
690
  attributes: [
530
- { key: ue.bundleId, value: s },
531
- { key: ue.bundleConfig, value: U },
532
- { key: ue.bundleSource, value: "bundle_builder" },
533
- ...u ? [{ key: ue.bundleTitle, value: u }] : []
691
+ { key: _t.bundleId, value: s },
692
+ { key: _t.bundleConfig, value: ne },
693
+ { key: _t.bundleSource, value: "bundle_builder" },
694
+ ...b ? [{ key: _t.bundleTitle, value: b }] : []
534
695
  ]
535
696
  }));
536
- if (!g.length) return;
537
- const x = new Map(xt.map((I) => [I.id, I]));
538
- let k = 0;
539
- for (const I of g) {
540
- const lt = I.quantity ?? 0;
541
- if (lt <= 0) continue;
542
- const Kt = x.get(I.merchandiseId), Be = Number(Kt == null ? void 0 : Kt.price);
543
- Number.isFinite(Be) && (k += Be * lt);
697
+ if (!C.length) return;
698
+ const k = new Map(oe.map((S) => [S.id, S]));
699
+ let P = 0;
700
+ for (const S of C) {
701
+ const se = S.quantity ?? 0;
702
+ if (se <= 0) continue;
703
+ const tt = k.get(S.merchandiseId), Pt = Number(tt == null ? void 0 : tt.price);
704
+ Number.isFinite(Pt) && (P += Pt * se);
544
705
  }
545
- k = Math.round(k * 100) / 100;
546
- const D = [...v.rules ?? []].sort((I, lt) => I.minBundleSize - lt.minBundleSize);
547
- let P = null;
548
- for (const I of D)
549
- At >= I.minBundleSize && (P = I);
550
- const G = P ? (() => {
551
- const I = Number.parseFloat(P.discountPercent);
552
- return Number.isFinite(I) && I > 0 ? I : null;
553
- })() : null, at = G ? Math.round(k * (1 - G / 100) * 100) / 100 : k, pt = k - at, Gt = g.map((I) => I.merchandiseId), Yt = (P == null ? void 0 : P.handle) ?? "", it = ((tt = P == null ? void 0 : P.label) == null ? void 0 : tt.trim()) || "";
554
- z(!0);
706
+ P = Math.round(P * 100) / 100;
707
+ const G = [...N.rules ?? []].sort((S, se) => S.minBundleSize - se.minBundleSize);
708
+ let Y = null;
709
+ for (const S of G)
710
+ qe >= S.minBundleSize && (Y = S);
711
+ const ce = Y ? (() => {
712
+ const S = Number.parseFloat(Y.discountPercent);
713
+ return Number.isFinite(S) && S > 0 ? S : null;
714
+ })() : null, fe = ce ? Math.round(P * (1 - ce / 100) * 100) / 100 : P, $e = P - fe, Je = C.map((S) => S.merchandiseId), et = (Y == null ? void 0 : Y.handle) ?? "", _e = ((ue = Y == null ? void 0 : Y.label) == null ? void 0 : ue.trim()) || "";
715
+ Te(!0);
555
716
  try {
556
- if (n != null && n.checkout ? await o.linesAddForCheckout(g) : await o.linesAdd(g), C)
717
+ if (o != null && o.checkout ? await a.linesAddForCheckout(C) : await a.linesAdd(C), g)
557
718
  try {
558
- const I = de(), lt = !!(n != null && n.checkout);
559
- te(C, e, {
719
+ const S = pt(), se = !!(o != null && o.checkout);
720
+ lt(g, t, {
560
721
  eventType: "BUNDLE_ADDED_TO_BASKET",
561
- shop: e,
562
- anonymousUserId: I,
722
+ shop: t,
723
+ anonymousUserId: S,
563
724
  bundleId: s,
564
- productVariantIds: Gt,
565
- grossPrice: k,
566
- discountedPrice: at,
567
- currency: Pt ?? void 0,
568
- discountThresholdIdentifier: Yt,
569
- discountLabel: it,
570
- discountPercentage: G,
571
- discountedAmount: pt,
725
+ productVariantIds: Je,
726
+ grossPrice: P,
727
+ discountedPrice: fe,
728
+ currency: je ?? void 0,
729
+ discountThresholdIdentifier: et,
730
+ discountLabel: _e,
731
+ discountPercentage: ce,
732
+ discountedAmount: $e,
572
733
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
573
- checkout: lt,
574
- mixpanelEvent: lt ? "checkout_started_with_bundle" : "bundle_added_to_cart"
734
+ checkout: se,
735
+ mixpanelEvent: se ? "checkout_started_with_bundle" : "bundle_added_to_cart"
575
736
  });
576
737
  } catch {
577
738
  }
578
- Et(), Q(), M(), (Zt = n == null ? void 0 : n.onComplete) == null || Zt.call(n), Z(null);
579
- } catch (I) {
580
- const lt = I instanceof Error ? I.message : "", Kt = /stock|sold out|inventory|insufficient|available|422/i.test(lt);
581
- Z(
582
- Kt ? "Some bundle items are no longer available in the requested quantity. Please review your selection." : "We couldn't add this bundle right now. Please try again."
583
- ), M();
739
+ Ke(), Se(), A(), (st = o == null ? void 0 : o.onComplete) == null || st.call(o), ae(null);
740
+ } catch (S) {
741
+ const se = S instanceof Error ? S.message : "", tt = /stock|sold out|inventory|insufficient|available|422/i.test(se);
742
+ ae(
743
+ z(tt ? "bundle.provider.stock_error" : "bundle.provider.add_error")
744
+ ), A();
584
745
  } finally {
585
- z(!1);
746
+ Te(!1);
586
747
  }
587
748
  }, [
588
- C,
589
- At,
590
- Ht,
591
- o,
592
- Et,
593
- Q,
594
- v,
595
- Pt,
596
- j,
597
- U,
598
- St,
599
- xt,
600
- M,
601
- Bt,
602
- e
603
- ]), ae = K(async () => {
604
- await Qt({
749
+ g,
750
+ qe,
751
+ Xe,
752
+ a,
753
+ Ke,
754
+ Se,
755
+ N,
756
+ je,
757
+ me,
758
+ ne,
759
+ He,
760
+ oe,
761
+ A,
762
+ Ee,
763
+ t,
764
+ z
765
+ ]), c = J(async () => {
766
+ await Ze({
605
767
  onComplete: () => {
606
- var n;
607
- (n = o.openCartUI) == null || n.call(o);
768
+ var o;
769
+ (o = a.openCartUI) == null || o.call(a);
608
770
  }
609
771
  });
610
- }, [o, Qt]), ie = K(async () => {
611
- await Qt({
772
+ }, [a, Ze]), d = J(async () => {
773
+ await Ze({
612
774
  checkout: !0,
613
775
  onComplete: () => {
614
- var n;
615
- (n = o.navigateToCheckout) == null || n.call(o);
776
+ var o;
777
+ (o = a.navigateToCheckout) == null || o.call(a);
616
778
  }
617
779
  });
618
- }, [o, Qt]), c = T(() => ({
619
- isOpen: X,
620
- open: nt,
621
- openForHandle: vt,
622
- close: Q,
623
- toggle: rt,
624
- currentHandle: U,
625
- setConfigHandle: W,
626
- loadHandle: Jt,
627
- syncCartQuantities: ee,
628
- loading: st,
629
- submitting: J,
630
- error: yt,
631
- currencyCode: Pt,
632
- config: v,
633
- eligibleVariants: xt,
634
- selections: Bt,
635
- selectionOrder: re,
636
- getVariantMaxSelectableQuantity: ne,
637
- setQuantity: ce,
638
- clearSelections: Et,
639
- bundleSize: At,
640
- minRequired: Ot,
641
- canSubmit: Ht,
642
- submit: ae,
643
- submitAndCheckout: ie
780
+ }, [a, Ze]), v = L(() => ({
781
+ isOpen: I,
782
+ open: at,
783
+ openForHandle: W,
784
+ close: Se,
785
+ toggle: Oe,
786
+ currentHandle: ne,
787
+ setConfigHandle: q,
788
+ loadHandle: re,
789
+ syncCartQuantities: ot,
790
+ loading: xe,
791
+ submitting: ke,
792
+ error: ye,
793
+ currencyCode: je,
794
+ config: N,
795
+ eligibleVariants: oe,
796
+ selections: Ee,
797
+ selectionOrder: ht,
798
+ getVariantMaxSelectableQuantity: dt,
799
+ setQuantity: ut,
800
+ clearSelections: Ke,
801
+ bundleSize: qe,
802
+ minRequired: Be,
803
+ canSubmit: Xe,
804
+ submit: c,
805
+ submitAndCheckout: d,
806
+ locale: te,
807
+ t: z
644
808
  }), [
645
- At,
646
- Ht,
647
- Et,
648
- Q,
649
- v,
650
- Pt,
651
- U,
652
- xt,
653
- yt,
654
- X,
655
- st,
656
- Ot,
657
- nt,
658
- vt,
659
- re,
660
- Bt,
661
- W,
662
- Jt,
663
- ee,
809
+ qe,
810
+ Xe,
811
+ Ke,
812
+ Se,
813
+ N,
814
+ je,
664
815
  ne,
665
- ce,
666
- ae,
667
- ie,
668
- J,
669
- rt
816
+ oe,
817
+ ye,
818
+ I,
819
+ xe,
820
+ Be,
821
+ at,
822
+ W,
823
+ ht,
824
+ Ee,
825
+ q,
826
+ re,
827
+ ot,
828
+ dt,
829
+ ut,
830
+ c,
831
+ d,
832
+ ke,
833
+ Oe,
834
+ te,
835
+ z
670
836
  ]);
671
- return /* @__PURE__ */ l(De.Provider, { value: c, children: O });
837
+ return /* @__PURE__ */ l(Ut.Provider, { value: v, children: F });
672
838
  }
673
- function be() {
674
- const a = Ve(De);
675
- if (!a)
839
+ function wt() {
840
+ const n = Gt(Ut);
841
+ if (!n)
676
842
  throw new Error("useBundleBuilder must be used within <BundleProvider />");
677
- return a;
843
+ return n;
678
844
  }
679
- function ci() {
680
- const { isOpen: a, open: t, close: e, toggle: o } = be();
681
- return { isOpen: a, open: t, close: e, toggle: o };
845
+ function xi() {
846
+ const { isOpen: n, open: e, close: t, toggle: a } = wt();
847
+ return { isOpen: n, open: e, close: t, toggle: a };
682
848
  }
683
- const Ke = "_button_18rtl_1", Xe = {
684
- button: Ke
849
+ const un = "_button_18rtl_1", dn = {
850
+ button: un
685
851
  };
686
- function ui(a) {
687
- const { toggle: t } = be();
852
+ function Ci(n) {
853
+ const { toggle: e, t } = wt();
688
854
  return /* @__PURE__ */ l(
689
855
  "button",
690
856
  {
691
857
  type: "button",
692
- onClick: t,
693
- className: [Xe.button, a.className].filter(Boolean).join(" "),
694
- children: a.children ?? "Build a bundle"
858
+ onClick: e,
859
+ className: [dn.button, n.className].filter(Boolean).join(" "),
860
+ children: n.children ?? t("bundle.button.default")
695
861
  }
696
862
  );
697
863
  }
698
- var ge, Pe;
699
- function Je() {
700
- if (Pe) return ge;
701
- Pe = 1;
702
- var a = {
703
- linear: function(t, e, o, i) {
704
- var r = o - e;
705
- return r * t / i + e;
864
+ var Nt, qt;
865
+ function hn() {
866
+ if (qt) return Nt;
867
+ qt = 1;
868
+ var n = {
869
+ linear: function(e, t, a, i) {
870
+ var r = a - t;
871
+ return r * e / i + t;
706
872
  },
707
- easeInQuad: function(t, e, o, i) {
708
- var r = o - e;
709
- return r * (t /= i) * t + e;
873
+ easeInQuad: function(e, t, a, i) {
874
+ var r = a - t;
875
+ return r * (e /= i) * e + t;
710
876
  },
711
- easeOutQuad: function(t, e, o, i) {
712
- var r = o - e;
713
- return -r * (t /= i) * (t - 2) + e;
877
+ easeOutQuad: function(e, t, a, i) {
878
+ var r = a - t;
879
+ return -r * (e /= i) * (e - 2) + t;
714
880
  },
715
- easeInOutQuad: function(t, e, o, i) {
716
- var r = o - e;
717
- return (t /= i / 2) < 1 ? r / 2 * t * t + e : -r / 2 * (--t * (t - 2) - 1) + e;
881
+ easeInOutQuad: function(e, t, a, i) {
882
+ var r = a - t;
883
+ return (e /= i / 2) < 1 ? r / 2 * e * e + t : -r / 2 * (--e * (e - 2) - 1) + t;
718
884
  },
719
- easeInCubic: function(t, e, o, i) {
720
- var r = o - e;
721
- return r * (t /= i) * t * t + e;
885
+ easeInCubic: function(e, t, a, i) {
886
+ var r = a - t;
887
+ return r * (e /= i) * e * e + t;
722
888
  },
723
- easeOutCubic: function(t, e, o, i) {
724
- var r = o - e;
725
- return r * ((t = t / i - 1) * t * t + 1) + e;
889
+ easeOutCubic: function(e, t, a, i) {
890
+ var r = a - t;
891
+ return r * ((e = e / i - 1) * e * e + 1) + t;
726
892
  },
727
- easeInOutCubic: function(t, e, o, i) {
728
- var r = o - e;
729
- return (t /= i / 2) < 1 ? r / 2 * t * t * t + e : r / 2 * ((t -= 2) * t * t + 2) + e;
893
+ easeInOutCubic: function(e, t, a, i) {
894
+ var r = a - t;
895
+ return (e /= i / 2) < 1 ? r / 2 * e * e * e + t : r / 2 * ((e -= 2) * e * e + 2) + t;
730
896
  },
731
- easeInQuart: function(t, e, o, i) {
732
- var r = o - e;
733
- return r * (t /= i) * t * t * t + e;
897
+ easeInQuart: function(e, t, a, i) {
898
+ var r = a - t;
899
+ return r * (e /= i) * e * e * e + t;
734
900
  },
735
- easeOutQuart: function(t, e, o, i) {
736
- var r = o - e;
737
- return -r * ((t = t / i - 1) * t * t * t - 1) + e;
901
+ easeOutQuart: function(e, t, a, i) {
902
+ var r = a - t;
903
+ return -r * ((e = e / i - 1) * e * e * e - 1) + t;
738
904
  },
739
- easeInOutQuart: function(t, e, o, i) {
740
- var r = o - e;
741
- return (t /= i / 2) < 1 ? r / 2 * t * t * t * t + e : -r / 2 * ((t -= 2) * t * t * t - 2) + e;
905
+ easeInOutQuart: function(e, t, a, i) {
906
+ var r = a - t;
907
+ return (e /= i / 2) < 1 ? r / 2 * e * e * e * e + t : -r / 2 * ((e -= 2) * e * e * e - 2) + t;
742
908
  },
743
- easeInQuint: function(t, e, o, i) {
744
- var r = o - e;
745
- return r * (t /= i) * t * t * t * t + e;
909
+ easeInQuint: function(e, t, a, i) {
910
+ var r = a - t;
911
+ return r * (e /= i) * e * e * e * e + t;
746
912
  },
747
- easeOutQuint: function(t, e, o, i) {
748
- var r = o - e;
749
- return r * ((t = t / i - 1) * t * t * t * t + 1) + e;
913
+ easeOutQuint: function(e, t, a, i) {
914
+ var r = a - t;
915
+ return r * ((e = e / i - 1) * e * e * e * e + 1) + t;
750
916
  },
751
- easeInOutQuint: function(t, e, o, i) {
752
- var r = o - e;
753
- return (t /= i / 2) < 1 ? r / 2 * t * t * t * t * t + e : r / 2 * ((t -= 2) * t * t * t * t + 2) + e;
917
+ easeInOutQuint: function(e, t, a, i) {
918
+ var r = a - t;
919
+ return (e /= i / 2) < 1 ? r / 2 * e * e * e * e * e + t : r / 2 * ((e -= 2) * e * e * e * e + 2) + t;
754
920
  },
755
- easeInSine: function(t, e, o, i) {
756
- var r = o - e;
757
- return -r * Math.cos(t / i * (Math.PI / 2)) + r + e;
921
+ easeInSine: function(e, t, a, i) {
922
+ var r = a - t;
923
+ return -r * Math.cos(e / i * (Math.PI / 2)) + r + t;
758
924
  },
759
- easeOutSine: function(t, e, o, i) {
760
- var r = o - e;
761
- return r * Math.sin(t / i * (Math.PI / 2)) + e;
925
+ easeOutSine: function(e, t, a, i) {
926
+ var r = a - t;
927
+ return r * Math.sin(e / i * (Math.PI / 2)) + t;
762
928
  },
763
- easeInOutSine: function(t, e, o, i) {
764
- var r = o - e;
765
- return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + e;
929
+ easeInOutSine: function(e, t, a, i) {
930
+ var r = a - t;
931
+ return -r / 2 * (Math.cos(Math.PI * e / i) - 1) + t;
766
932
  },
767
- easeInExpo: function(t, e, o, i) {
768
- var r = o - e;
769
- return t == 0 ? e : r * Math.pow(2, 10 * (t / i - 1)) + e;
933
+ easeInExpo: function(e, t, a, i) {
934
+ var r = a - t;
935
+ return e == 0 ? t : r * Math.pow(2, 10 * (e / i - 1)) + t;
770
936
  },
771
- easeOutExpo: function(t, e, o, i) {
772
- var r = o - e;
773
- return t == i ? e + r : r * (-Math.pow(2, -10 * t / i) + 1) + e;
937
+ easeOutExpo: function(e, t, a, i) {
938
+ var r = a - t;
939
+ return e == i ? t + r : r * (-Math.pow(2, -10 * e / i) + 1) + t;
774
940
  },
775
- easeInOutExpo: function(t, e, o, i) {
776
- var r = o - e;
777
- return t === 0 ? e : t === i ? e + r : (t /= i / 2) < 1 ? r / 2 * Math.pow(2, 10 * (t - 1)) + e : r / 2 * (-Math.pow(2, -10 * --t) + 2) + e;
941
+ easeInOutExpo: function(e, t, a, i) {
942
+ var r = a - t;
943
+ return e === 0 ? t : e === i ? t + r : (e /= i / 2) < 1 ? r / 2 * Math.pow(2, 10 * (e - 1)) + t : r / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
778
944
  },
779
- easeInCirc: function(t, e, o, i) {
780
- var r = o - e;
781
- return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + e;
945
+ easeInCirc: function(e, t, a, i) {
946
+ var r = a - t;
947
+ return -r * (Math.sqrt(1 - (e /= i) * e) - 1) + t;
782
948
  },
783
- easeOutCirc: function(t, e, o, i) {
784
- var r = o - e;
785
- return r * Math.sqrt(1 - (t = t / i - 1) * t) + e;
949
+ easeOutCirc: function(e, t, a, i) {
950
+ var r = a - t;
951
+ return r * Math.sqrt(1 - (e = e / i - 1) * e) + t;
786
952
  },
787
- easeInOutCirc: function(t, e, o, i) {
788
- var r = o - e;
789
- return (t /= i / 2) < 1 ? -r / 2 * (Math.sqrt(1 - t * t) - 1) + e : r / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + e;
953
+ easeInOutCirc: function(e, t, a, i) {
954
+ var r = a - t;
955
+ return (e /= i / 2) < 1 ? -r / 2 * (Math.sqrt(1 - e * e) - 1) + t : r / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
790
956
  },
791
- easeInElastic: function(t, e, o, i) {
792
- var r = o - e, m, d, S;
793
- return S = 1.70158, d = 0, m = r, t === 0 ? e : (t /= i) === 1 ? e + r : (d || (d = i * 0.3), m < Math.abs(r) ? (m = r, S = d / 4) : S = d / (2 * Math.PI) * Math.asin(r / m), -(m * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - S) * (2 * Math.PI) / d)) + e);
957
+ easeInElastic: function(e, t, a, i) {
958
+ var r = a - t, h, u, B;
959
+ return B = 1.70158, u = 0, h = r, e === 0 ? t : (e /= i) === 1 ? t + r : (u || (u = i * 0.3), h < Math.abs(r) ? (h = r, B = u / 4) : B = u / (2 * Math.PI) * Math.asin(r / h), -(h * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * i - B) * (2 * Math.PI) / u)) + t);
794
960
  },
795
- easeOutElastic: function(t, e, o, i) {
796
- var r = o - e, m, d, S;
797
- return S = 1.70158, d = 0, m = r, t === 0 ? e : (t /= i) === 1 ? e + r : (d || (d = i * 0.3), m < Math.abs(r) ? (m = r, S = d / 4) : S = d / (2 * Math.PI) * Math.asin(r / m), m * Math.pow(2, -10 * t) * Math.sin((t * i - S) * (2 * Math.PI) / d) + r + e);
961
+ easeOutElastic: function(e, t, a, i) {
962
+ var r = a - t, h, u, B;
963
+ return B = 1.70158, u = 0, h = r, e === 0 ? t : (e /= i) === 1 ? t + r : (u || (u = i * 0.3), h < Math.abs(r) ? (h = r, B = u / 4) : B = u / (2 * Math.PI) * Math.asin(r / h), h * Math.pow(2, -10 * e) * Math.sin((e * i - B) * (2 * Math.PI) / u) + r + t);
798
964
  },
799
- easeInOutElastic: function(t, e, o, i) {
800
- var r = o - e, m, d, S;
801
- return S = 1.70158, d = 0, m = r, t === 0 ? e : (t /= i / 2) === 2 ? e + r : (d || (d = i * (0.3 * 1.5)), m < Math.abs(r) ? (m = r, S = d / 4) : S = d / (2 * Math.PI) * Math.asin(r / m), t < 1 ? -0.5 * (m * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - S) * (2 * Math.PI) / d)) + e : m * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * i - S) * (2 * Math.PI) / d) * 0.5 + r + e);
965
+ easeInOutElastic: function(e, t, a, i) {
966
+ var r = a - t, h, u, B;
967
+ return B = 1.70158, u = 0, h = r, e === 0 ? t : (e /= i / 2) === 2 ? t + r : (u || (u = i * (0.3 * 1.5)), h < Math.abs(r) ? (h = r, B = u / 4) : B = u / (2 * Math.PI) * Math.asin(r / h), e < 1 ? -0.5 * (h * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * i - B) * (2 * Math.PI) / u)) + t : h * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * i - B) * (2 * Math.PI) / u) * 0.5 + r + t);
802
968
  },
803
- easeInBack: function(t, e, o, i, r) {
804
- var m = o - e;
805
- return r === void 0 && (r = 1.70158), m * (t /= i) * t * ((r + 1) * t - r) + e;
969
+ easeInBack: function(e, t, a, i, r) {
970
+ var h = a - t;
971
+ return r === void 0 && (r = 1.70158), h * (e /= i) * e * ((r + 1) * e - r) + t;
806
972
  },
807
- easeOutBack: function(t, e, o, i, r) {
808
- var m = o - e;
809
- return r === void 0 && (r = 1.70158), m * ((t = t / i - 1) * t * ((r + 1) * t + r) + 1) + e;
973
+ easeOutBack: function(e, t, a, i, r) {
974
+ var h = a - t;
975
+ return r === void 0 && (r = 1.70158), h * ((e = e / i - 1) * e * ((r + 1) * e + r) + 1) + t;
810
976
  },
811
- easeInOutBack: function(t, e, o, i, r) {
812
- var m = o - e;
813
- return r === void 0 && (r = 1.70158), (t /= i / 2) < 1 ? m / 2 * (t * t * (((r *= 1.525) + 1) * t - r)) + e : m / 2 * ((t -= 2) * t * (((r *= 1.525) + 1) * t + r) + 2) + e;
977
+ easeInOutBack: function(e, t, a, i, r) {
978
+ var h = a - t;
979
+ return r === void 0 && (r = 1.70158), (e /= i / 2) < 1 ? h / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : h / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t;
814
980
  },
815
- easeInBounce: function(t, e, o, i) {
816
- var r = o - e, m;
817
- return m = a.easeOutBounce(i - t, 0, r, i), r - m + e;
981
+ easeInBounce: function(e, t, a, i) {
982
+ var r = a - t, h;
983
+ return h = n.easeOutBounce(i - e, 0, r, i), r - h + t;
818
984
  },
819
- easeOutBounce: function(t, e, o, i) {
820
- var r = o - e;
821
- return (t /= i) < 1 / 2.75 ? r * (7.5625 * t * t) + e : t < 2 / 2.75 ? r * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + e : t < 2.5 / 2.75 ? r * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + e : r * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + e;
985
+ easeOutBounce: function(e, t, a, i) {
986
+ var r = a - t;
987
+ return (e /= i) < 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;
822
988
  },
823
- easeInOutBounce: function(t, e, o, i) {
824
- var r = o - e, m;
825
- return t < i / 2 ? (m = a.easeInBounce(t * 2, 0, r, i), m * 0.5 + e) : (m = a.easeOutBounce(t * 2 - i, 0, r, i), m * 0.5 + r * 0.5 + e);
989
+ easeInOutBounce: function(e, t, a, i) {
990
+ var r = a - t, h;
991
+ return e < i / 2 ? (h = n.easeInBounce(e * 2, 0, r, i), h * 0.5 + t) : (h = n.easeOutBounce(e * 2 - i, 0, r, i), h * 0.5 + r * 0.5 + t);
826
992
  }
827
993
  };
828
- return ge = a, ge;
994
+ return Nt = n, Nt;
829
995
  }
830
- var Ze = Je();
831
- function tn(a) {
832
- return a * Math.PI / 180;
996
+ var mn = hn();
997
+ function bn(n) {
998
+ return n * Math.PI / 180;
833
999
  }
834
- function _t(a, t) {
835
- return a + Math.random() * (t - a);
1000
+ function pe(n, e) {
1001
+ return n + Math.random() * (e - n);
836
1002
  }
837
- function en(a, t) {
838
- return Math.floor(a + Math.random() * (t - a + 1));
1003
+ function fn(n, e) {
1004
+ return Math.floor(n + Math.random() * (e - n + 1));
839
1005
  }
840
- var se;
841
- (function(a) {
842
- a[a.Circle = 0] = "Circle", a[a.Square = 1] = "Square", a[a.Strip = 2] = "Strip";
843
- })(se || (se = {}));
844
- var Vt;
845
- (function(a) {
846
- a[a.Positive = 1] = "Positive", a[a.Negative = -1] = "Negative";
847
- })(Vt || (Vt = {}));
848
- const nn = 1e3 / 60;
849
- class rn {
850
- constructor(t, e, o, i) {
851
- this.getOptions = e;
852
- const { colors: r, initialVelocityX: m, initialVelocityY: d } = this.getOptions();
853
- this.context = t, this.x = o, this.y = i, this.w = _t(5, 20), this.h = _t(5, 20), this.radius = _t(5, 10), this.vx = typeof m == "number" ? _t(-m, m) : _t(m.min, m.max), this.vy = typeof d == "number" ? _t(-d, 0) : _t(d.min, d.max), this.shape = en(0, 2), this.angle = tn(_t(0, 360)), this.angularSpin = _t(-0.2, 0.2), this.color = r[Math.floor(Math.random() * r.length)], this.rotateY = _t(0, 1), this.rotationDirection = _t(0, 1) ? Vt.Positive : Vt.Negative;
1006
+ var bt;
1007
+ (function(n) {
1008
+ n[n.Circle = 0] = "Circle", n[n.Square = 1] = "Square", n[n.Strip = 2] = "Strip";
1009
+ })(bt || (bt = {}));
1010
+ var Ge;
1011
+ (function(n) {
1012
+ n[n.Positive = 1] = "Positive", n[n.Negative = -1] = "Negative";
1013
+ })(Ge || (Ge = {}));
1014
+ const _n = 1e3 / 60;
1015
+ class pn {
1016
+ constructor(e, t, a, i) {
1017
+ this.getOptions = t;
1018
+ const { colors: r, initialVelocityX: h, initialVelocityY: u } = this.getOptions();
1019
+ this.context = e, this.x = a, this.y = i, this.w = pe(5, 20), this.h = pe(5, 20), this.radius = pe(5, 10), this.vx = typeof h == "number" ? pe(-h, h) : pe(h.min, h.max), this.vy = typeof u == "number" ? pe(-u, 0) : pe(u.min, u.max), this.shape = fn(0, 2), this.angle = bn(pe(0, 360)), this.angularSpin = pe(-0.2, 0.2), this.color = r[Math.floor(Math.random() * r.length)], this.rotateY = pe(0, 1), this.rotationDirection = pe(0, 1) ? Ge.Positive : Ge.Negative;
854
1020
  }
855
- update(t) {
856
- const { gravity: e, wind: o, friction: i, opacity: r, drawShape: m } = this.getOptions(), d = t / nn;
857
- this.x += this.vx * d, this.y += this.vy * d, this.vy += e * d, this.vx += o * d, this.vx *= i ** d, this.vy *= i ** d, this.rotateY >= 1 && this.rotationDirection === Vt.Positive ? this.rotationDirection = Vt.Negative : this.rotateY <= -1 && this.rotationDirection === Vt.Negative && (this.rotationDirection = Vt.Positive);
858
- const S = 0.1 * this.rotationDirection * d;
859
- if (this.rotateY += S, 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, m && typeof m == "function")
860
- m.call(this, this.context);
1021
+ update(e) {
1022
+ const { gravity: t, wind: a, friction: i, opacity: r, drawShape: h } = this.getOptions(), u = e / _n;
1023
+ this.x += this.vx * u, this.y += this.vy * u, this.vy += t * u, this.vx += a * u, this.vx *= i ** u, this.vy *= i ** u, this.rotateY >= 1 && this.rotationDirection === Ge.Positive ? this.rotationDirection = Ge.Negative : this.rotateY <= -1 && this.rotationDirection === Ge.Negative && (this.rotationDirection = Ge.Positive);
1024
+ const B = 0.1 * this.rotationDirection * u;
1025
+ if (this.rotateY += B, this.angle += this.angularSpin, this.context.save(), this.context.translate(this.x, this.y), this.context.rotate(this.angle), this.context.scale(1, this.rotateY), this.context.rotate(this.angle), this.context.beginPath(), this.context.fillStyle = this.color, this.context.strokeStyle = this.color, this.context.globalAlpha = r, this.context.lineCap = "round", this.context.lineWidth = 2, h && typeof h == "function")
1026
+ h.call(this, this.context);
861
1027
  else
862
1028
  switch (this.shape) {
863
- case se.Circle: {
1029
+ case bt.Circle: {
864
1030
  this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
865
1031
  break;
866
1032
  }
867
- case se.Square: {
1033
+ case bt.Square: {
868
1034
  this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
869
1035
  break;
870
1036
  }
871
- case se.Strip: {
1037
+ case bt.Strip: {
872
1038
  this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
873
1039
  break;
874
1040
  }
@@ -876,39 +1042,39 @@ class rn {
876
1042
  this.context.closePath(), this.context.restore();
877
1043
  }
878
1044
  }
879
- class an {
880
- constructor(t, e) {
1045
+ class yn {
1046
+ constructor(e, t) {
881
1047
  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 = (i) => {
882
1048
  this.particles.splice(i, 1);
883
1049
  }, this.getParticle = () => {
884
- const i = _t(this.x, this.w + this.x), r = _t(this.y, this.h + this.y);
885
- return new rn(this.context, this.getOptions, i, r);
1050
+ const i = pe(this.x, this.w + this.x), r = pe(this.y, this.h + this.y);
1051
+ return new pn(this.context, this.getOptions, i, r);
886
1052
  }, this.animate = (i) => {
887
- const { canvas: r, context: m, particlesGenerated: d, lastNumberOfPieces: S } = this, { run: ct, recycle: A, numberOfPieces: O, debug: et, tweenFunction: C, tweenDuration: Y } = this.getOptions();
888
- if (!ct)
1053
+ const { canvas: r, context: h, particlesGenerated: u, lastNumberOfPieces: B } = this, { run: le, recycle: $, numberOfPieces: D, debug: de, tweenFunction: F, tweenDuration: te } = this.getOptions();
1054
+ if (!le)
889
1055
  return !1;
890
- const X = this.particles.length, ot = A ? X : d;
891
- if (ot < O) {
892
- S !== O && (this.tweenProgress = 0, this.tweenFrom = ot, this.lastNumberOfPieces = O), this.tweenProgress = Math.min(Y, Math.max(0, this.tweenProgress + i));
893
- const J = C(this.tweenProgress, this.tweenFrom, O, Y), z = Math.round(J - ot);
894
- for (let yt = 0; yt < z; yt++)
1056
+ const z = this.particles.length, K = $ ? z : u;
1057
+ if (K < D) {
1058
+ B !== D && (this.tweenProgress = 0, this.tweenFrom = K, this.lastNumberOfPieces = D), this.tweenProgress = Math.min(te, Math.max(0, this.tweenProgress + i));
1059
+ const g = F(this.tweenProgress, this.tweenFrom, D, te), H = Math.round(g - K);
1060
+ for (let I = 0; I < H; I++)
895
1061
  this.particles.push(this.getParticle());
896
- this.particlesGenerated += z;
1062
+ this.particlesGenerated += H;
897
1063
  }
898
- et && (m.font = "12px sans-serif", m.fillStyle = "#333", m.textAlign = "right", m.fillText(`Particles: ${X}`, r.width - 10, r.height - 20));
899
- for (let J = this.particles.length - 1; J >= 0; J--) {
900
- const z = this.particles[J];
901
- z.update(i), (z.y > r.height || z.y < -100 || z.x > r.width + 100 || z.x < -100) && (A && ot <= O ? this.particles[J] = this.getParticle() : this.removeParticleAt(J));
1064
+ de && (h.font = "12px sans-serif", h.fillStyle = "#333", h.textAlign = "right", h.fillText(`Particles: ${z}`, r.width - 10, r.height - 20));
1065
+ for (let g = this.particles.length - 1; g >= 0; g--) {
1066
+ const H = this.particles[g];
1067
+ H.update(i), (H.y > r.height || H.y < -100 || H.x > r.width + 100 || H.x < -100) && ($ && K <= D ? this.particles[g] = this.getParticle() : this.removeParticleAt(g));
902
1068
  }
903
- return X > 0 || ot < O;
904
- }, this.canvas = t;
905
- const o = this.canvas.getContext("2d");
906
- if (!o)
1069
+ return z > 0 || K < D;
1070
+ }, this.canvas = e;
1071
+ const a = this.canvas.getContext("2d");
1072
+ if (!a)
907
1073
  throw new Error("Could not get canvas context");
908
- this.context = o, this.getOptions = e;
1074
+ this.context = a, this.getOptions = t;
909
1075
  }
910
1076
  }
911
- const Ie = {
1077
+ const Rt = {
912
1078
  width: typeof window < "u" ? window.innerWidth : 300,
913
1079
  height: typeof window < "u" ? window.innerHeight : 200,
914
1080
  numberOfPieces: 200,
@@ -938,13 +1104,13 @@ const Ie = {
938
1104
  ],
939
1105
  opacity: 1,
940
1106
  debug: !1,
941
- tweenFunction: Ze.easeInOutQuad,
1107
+ tweenFunction: mn.easeInOutQuad,
942
1108
  tweenDuration: 5e3,
943
1109
  recycle: !0,
944
1110
  run: !0
945
1111
  };
946
- class on {
947
- constructor(t, e) {
1112
+ class gn {
1113
+ constructor(e, t) {
948
1114
  this.lastFrameTime = 0, this.setOptionsWithDefaults = (i) => {
949
1115
  const r = {
950
1116
  confettiSource: {
@@ -956,55 +1122,55 @@ class on {
956
1122
  };
957
1123
  this._options = {
958
1124
  ...r,
959
- ...Ie,
1125
+ ...Rt,
960
1126
  ...i
961
1127
  }, Object.assign(this, i.confettiSource);
962
1128
  }, this.update = (i = 0) => {
963
- const { options: { run: r, onConfettiComplete: m, frameRate: d }, canvas: S, context: ct } = this, A = Math.min(i - this.lastFrameTime, 50);
964
- if (d && A < 1e3 / d) {
1129
+ const { options: { run: r, onConfettiComplete: h, frameRate: u }, canvas: B, context: le } = this, $ = Math.min(i - this.lastFrameTime, 50);
1130
+ if (u && $ < 1e3 / u) {
965
1131
  this.rafId = requestAnimationFrame(this.update);
966
1132
  return;
967
1133
  }
968
- this.lastFrameTime = i - (d ? A % d : 0), r && (ct.fillStyle = "white", ct.clearRect(0, 0, S.width, S.height)), this.generator.animate(A) ? this.rafId = requestAnimationFrame(this.update) : (m && typeof m == "function" && this.generator.particlesGenerated > 0 && m.call(this, this), this._options.run = !1);
1134
+ this.lastFrameTime = i - (u ? $ % u : 0), r && (le.fillStyle = "white", le.clearRect(0, 0, B.width, B.height)), this.generator.animate($) ? this.rafId = requestAnimationFrame(this.update) : (h && typeof h == "function" && this.generator.particlesGenerated > 0 && h.call(this, this), this._options.run = !1);
969
1135
  }, this.reset = () => {
970
1136
  this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
971
1137
  }, this.stop = () => {
972
1138
  this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
973
- }, this.canvas = t;
974
- const o = this.canvas.getContext("2d");
975
- if (!o)
1139
+ }, this.canvas = e;
1140
+ const a = this.canvas.getContext("2d");
1141
+ if (!a)
976
1142
  throw new Error("Could not get canvas context");
977
- this.context = o, this.generator = new an(this.canvas, () => this.options), this.options = e, this.update();
1143
+ this.context = a, this.generator = new yn(this.canvas, () => this.options), this.options = t, this.update();
978
1144
  }
979
1145
  get options() {
980
1146
  return this._options;
981
1147
  }
982
- set options(t) {
1148
+ set options(e) {
983
1149
  var i, r;
984
- const e = (i = this._options) == null ? void 0 : i.run, o = (r = this._options) == null ? void 0 : r.recycle;
985
- this.setOptionsWithDefaults(t), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof t.recycle == "boolean" && t.recycle && o === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof t.run == "boolean" && t.run && e === !1 && this.update();
1150
+ const t = (i = this._options) == null ? void 0 : i.run, a = (r = this._options) == null ? void 0 : r.recycle;
1151
+ this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && a === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
986
1152
  }
987
1153
  }
988
- const sn = fe.createRef();
989
- class Ne extends fe.Component {
990
- constructor(t) {
991
- super(t), this.canvas = fe.createRef(), this.canvas = t.canvasRef || sn;
1154
+ const vn = vt.createRef();
1155
+ class Lt extends vt.Component {
1156
+ constructor(e) {
1157
+ super(e), this.canvas = vt.createRef(), this.canvas = e.canvasRef || vn;
992
1158
  }
993
1159
  componentDidMount() {
994
1160
  if (this.canvas.current) {
995
- const t = we(this.props)[0];
996
- this.confetti = new on(this.canvas.current, t);
1161
+ const e = St(this.props)[0];
1162
+ this.confetti = new gn(this.canvas.current, e);
997
1163
  }
998
1164
  }
999
1165
  componentDidUpdate() {
1000
- const t = we(this.props)[0];
1001
- this.confetti && (this.confetti.options = t);
1166
+ const e = St(this.props)[0];
1167
+ this.confetti && (this.confetti.options = e);
1002
1168
  }
1003
1169
  componentWillUnmount() {
1004
1170
  this.confetti && this.confetti.stop(), this.confetti = void 0;
1005
1171
  }
1006
1172
  render() {
1007
- const [t, e] = we(this.props), o = {
1173
+ const [e, t] = St(this.props), a = {
1008
1174
  zIndex: 2,
1009
1175
  position: "absolute",
1010
1176
  pointerEvents: "none",
@@ -1012,45 +1178,45 @@ class Ne extends fe.Component {
1012
1178
  left: 0,
1013
1179
  bottom: 0,
1014
1180
  right: 0,
1015
- ...e.style
1181
+ ...t.style
1016
1182
  };
1017
- return l("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style: o });
1183
+ return l("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: a });
1018
1184
  }
1019
1185
  }
1020
- Ne.defaultProps = {
1021
- ...Ie
1186
+ Lt.defaultProps = {
1187
+ ...Rt
1022
1188
  };
1023
- Ne.displayName = "ReactConfetti";
1024
- function we(a) {
1025
- const t = {}, e = {}, o = {}, i = [
1026
- ...Object.keys(Ie),
1189
+ Lt.displayName = "ReactConfetti";
1190
+ function St(n) {
1191
+ const e = {}, t = {}, a = {}, i = [
1192
+ ...Object.keys(Rt),
1027
1193
  "confettiSource",
1028
1194
  "drawShape",
1029
1195
  "onConfettiComplete",
1030
1196
  "frameRate"
1031
1197
  ], r = ["canvasRef"];
1032
- for (const m in a) {
1033
- const d = a[m];
1034
- i.includes(m) ? t[m] = d : r.includes(m) ? r[m] = d : o[m] = d;
1198
+ for (const h in n) {
1199
+ const u = n[h];
1200
+ i.includes(h) ? e[h] = u : r.includes(h) ? r[h] = u : a[h] = u;
1035
1201
  }
1036
- return [t, o, e];
1202
+ return [e, a, t];
1037
1203
  }
1038
- const ln = fe.forwardRef((a, t) => l(Ne, { canvasRef: t, ...a }));
1204
+ const wn = vt.forwardRef((n, e) => l(Lt, { canvasRef: e, ...n }));
1039
1205
  /**
1040
1206
  * @license lucide-react v0.515.0 - ISC
1041
1207
  *
1042
1208
  * This source code is licensed under the ISC license.
1043
1209
  * See the LICENSE file in the root directory of this source tree.
1044
1210
  */
1045
- const cn = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), un = (a) => a.replace(
1211
+ const xn = (n) => n.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Cn = (n) => n.replace(
1046
1212
  /^([A-Z])|[\s-_]+(\w)/g,
1047
- (t, e, o) => o ? o.toUpperCase() : e.toLowerCase()
1048
- ), Fe = (a) => {
1049
- const t = un(a);
1050
- return t.charAt(0).toUpperCase() + t.slice(1);
1051
- }, Ee = (...a) => a.filter((t, e, o) => !!t && t.trim() !== "" && o.indexOf(t) === e).join(" ").trim(), dn = (a) => {
1052
- for (const t in a)
1053
- if (t.startsWith("aria-") || t === "role" || t === "title")
1213
+ (e, t, a) => a ? a.toUpperCase() : t.toLowerCase()
1214
+ ), $t = (n) => {
1215
+ const e = Cn(n);
1216
+ return e.charAt(0).toUpperCase() + e.slice(1);
1217
+ }, Ht = (...n) => n.filter((e, t, a) => !!e && e.trim() !== "" && a.indexOf(e) === t).join(" ").trim(), In = (n) => {
1218
+ for (const e in n)
1219
+ if (e.startsWith("aria-") || e === "role" || e === "title")
1054
1220
  return !0;
1055
1221
  };
1056
1222
  /**
@@ -1059,7 +1225,7 @@ const cn = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), un = (
1059
1225
  * This source code is licensed under the ISC license.
1060
1226
  * See the LICENSE file in the root directory of this source tree.
1061
1227
  */
1062
- var hn = {
1228
+ var Nn = {
1063
1229
  xmlns: "http://www.w3.org/2000/svg",
1064
1230
  width: 24,
1065
1231
  height: 24,
@@ -1076,31 +1242,31 @@ var hn = {
1076
1242
  * This source code is licensed under the ISC license.
1077
1243
  * See the LICENSE file in the root directory of this source tree.
1078
1244
  */
1079
- const mn = $e(
1245
+ const Sn = zt(
1080
1246
  ({
1081
- color: a = "currentColor",
1082
- size: t = 24,
1083
- strokeWidth: e = 2,
1084
- absoluteStrokeWidth: o,
1247
+ color: n = "currentColor",
1248
+ size: e = 24,
1249
+ strokeWidth: t = 2,
1250
+ absoluteStrokeWidth: a,
1085
1251
  className: i = "",
1086
1252
  children: r,
1087
- iconNode: m,
1088
- ...d
1089
- }, S) => Ce(
1253
+ iconNode: h,
1254
+ ...u
1255
+ }, B) => Tt(
1090
1256
  "svg",
1091
1257
  {
1092
- ref: S,
1093
- ...hn,
1094
- width: t,
1095
- height: t,
1096
- stroke: a,
1097
- strokeWidth: o ? Number(e) * 24 / Number(t) : e,
1098
- className: Ee("lucide", i),
1099
- ...!r && !dn(d) && { "aria-hidden": "true" },
1100
- ...d
1258
+ ref: B,
1259
+ ...Nn,
1260
+ width: e,
1261
+ height: e,
1262
+ stroke: n,
1263
+ strokeWidth: a ? Number(t) * 24 / Number(e) : t,
1264
+ className: Ht("lucide", i),
1265
+ ...!r && !In(u) && { "aria-hidden": "true" },
1266
+ ...u
1101
1267
  },
1102
1268
  [
1103
- ...m.map(([ct, A]) => Ce(ct, A)),
1269
+ ...h.map(([le, $]) => Tt(le, $)),
1104
1270
  ...Array.isArray(r) ? r : [r]
1105
1271
  ]
1106
1272
  )
@@ -1111,20 +1277,20 @@ const mn = $e(
1111
1277
  * This source code is licensed under the ISC license.
1112
1278
  * See the LICENSE file in the root directory of this source tree.
1113
1279
  */
1114
- const Se = (a, t) => {
1115
- const e = $e(
1116
- ({ className: o, ...i }, r) => Ce(mn, {
1280
+ const Mt = (n, e) => {
1281
+ const t = zt(
1282
+ ({ className: a, ...i }, r) => Tt(Sn, {
1117
1283
  ref: r,
1118
- iconNode: t,
1119
- className: Ee(
1120
- `lucide-${cn(Fe(a))}`,
1121
- `lucide-${a}`,
1122
- o
1284
+ iconNode: e,
1285
+ className: Ht(
1286
+ `lucide-${xn($t(n))}`,
1287
+ `lucide-${n}`,
1288
+ a
1123
1289
  ),
1124
1290
  ...i
1125
1291
  })
1126
1292
  );
1127
- return e.displayName = Fe(a), e;
1293
+ return t.displayName = $t(n), t;
1128
1294
  };
1129
1295
  /**
1130
1296
  * @license lucide-react v0.515.0 - ISC
@@ -1132,328 +1298,328 @@ const Se = (a, t) => {
1132
1298
  * This source code is licensed under the ISC license.
1133
1299
  * See the LICENSE file in the root directory of this source tree.
1134
1300
  */
1135
- const fn = [
1301
+ const Bn = [
1136
1302
  ["path", { d: "M5 12h14", key: "1ays0h" }],
1137
1303
  ["path", { d: "M12 5v14", key: "s699le" }]
1138
- ], Oe = Se("plus", fn);
1304
+ ], Vt = Mt("plus", Bn);
1139
1305
  /**
1140
1306
  * @license lucide-react v0.515.0 - ISC
1141
1307
  *
1142
1308
  * This source code is licensed under the ISC license.
1143
1309
  * See the LICENSE file in the root directory of this source tree.
1144
1310
  */
1145
- const bn = [
1311
+ const kn = [
1146
1312
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
1147
1313
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
1148
- ], pn = Se("search", bn);
1314
+ ], Tn = Mt("search", kn);
1149
1315
  /**
1150
1316
  * @license lucide-react v0.515.0 - ISC
1151
1317
  *
1152
1318
  * This source code is licensed under the ISC license.
1153
1319
  * See the LICENSE file in the root directory of this source tree.
1154
1320
  */
1155
- const _n = [
1321
+ const Rn = [
1156
1322
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
1157
1323
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
1158
1324
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
1159
1325
  ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
1160
1326
  ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
1161
- ], yn = Se("trash-2", _n), gn = "_backdrop_ta0om_1", wn = "_celebrationOverlay_ta0om_14", vn = "_celebrationChip_ta0om_23", xn = "_backdropOpen_ta0om_74", Cn = "_backdropClosed_ta0om_78", In = "_panel_ta0om_82", Nn = "_panelOpen_ta0om_103", Sn = "_panelClosed_ta0om_107", Bn = "_header_ta0om_146", Tn = "_headerCenter_ta0om_155", kn = "_title_ta0om_163", Rn = "_searchIconButton_ta0om_172", Mn = "_headerTitleWrap_ta0om_195", Ln = "_headerSearchWrap_ta0om_199", Pn = "_headerSearchOpen_ta0om_211", Fn = "_searchBar_ta0om_223", On = "_searchInput_ta0om_235", An = "_searchClearButton_ta0om_256", $n = "_closeButton_ta0om_278", Dn = "_body_ta0om_312", En = "_muted_ta0om_317", qn = "_error_ta0om_322", Vn = "_variants_ta0om_327", zn = "_variantList_ta0om_331", Wn = "_variantRow_ta0om_339", jn = "_variantRowSoldOut_ta0om_347", Un = "_variantLeft_ta0om_351", Hn = "_addToBundleButton_ta0om_358", Qn = "_soldOutContainer_ta0om_386", Gn = "_stockLimitContainer_ta0om_394", Yn = "_soldOut_ta0om_386", Kn = "_stockLimitNotice_ta0om_412", Xn = "_variantThumb_ta0om_421", Jn = "_variantThumbImg_ta0om_431", Zn = "_variantThumbFallback_ta0om_438", tr = "_variantInfo_ta0om_448", er = "_variantName_ta0om_452", nr = "_variantMeta_ta0om_461", rr = "_variantPriceRow_ta0om_469", ar = "_variantCompareAt_ta0om_476", ir = "_variantPrice_ta0om_469", or = "_qtyControls_ta0om_487", sr = "_qtyControlsWrap_ta0om_493", lr = "_qtyButton_ta0om_499", cr = "_qtyValue_ta0om_525", ur = "_footer_ta0om_532", dr = "_poweredBy_ta0om_540", hr = "_boxSummaryWindow_ta0om_552", mr = "_boxSummaryRow_ta0om_570", fr = "_boxSlot_ta0om_578", br = "_boxItem_ta0om_587", pr = "_boxItemClickable_ta0om_599", _r = "_boxThresholdLabel_ta0om_608", yr = "_boxItemPlaceholder_ta0om_619", gr = "_boxItemFilled_ta0om_625", wr = "_boxItemThreshold_ta0om_631", vr = "_boxItemDiscountText_ta0om_639", xr = "_boxItemPlus_ta0om_647", Cr = "_boxItemImage_ta0om_654", Ir = "_boxItemFallback_ta0om_661", Nr = "_ctaButtonGroup_ta0om_672", Sr = "_ctaButtonGroupAnimating_ta0om_679", Br = "_cta_ta0om_672", Tr = "_ctaDualLeft_ta0om_707", kr = "_ctaDualLeftAnimating_ta0om_725", Rr = "_ctaDualRight_ta0om_738", Mr = "_ctaDualRightAnimating_ta0om_754", Lr = "_ctaTotals_ta0om_765", Pr = "_ctaDiscountBadge_ta0om_773", Fr = "_ctaTotalsWrap_ta0om_787", Or = "_ctaTotalsWrapVisible_ta0om_800", Ar = "_ctaTotalsStrike_ta0om_807", $r = "_ctaTotalsPrice_ta0om_814", f = {
1162
- backdrop: gn,
1163
- celebrationOverlay: wn,
1164
- celebrationChip: vn,
1165
- backdropOpen: xn,
1166
- backdropClosed: Cn,
1167
- panel: In,
1168
- panelOpen: Nn,
1169
- panelClosed: Sn,
1170
- header: Bn,
1171
- headerCenter: Tn,
1172
- title: kn,
1173
- searchIconButton: Rn,
1174
- headerTitleWrap: Mn,
1175
- headerSearchWrap: Ln,
1176
- headerSearchOpen: Pn,
1177
- searchBar: Fn,
1178
- searchInput: On,
1179
- searchClearButton: An,
1180
- closeButton: $n,
1181
- body: Dn,
1182
- muted: En,
1183
- error: qn,
1184
- variants: Vn,
1185
- variantList: zn,
1186
- variantRow: Wn,
1187
- variantRowSoldOut: jn,
1188
- variantLeft: Un,
1189
- addToBundleButton: Hn,
1190
- soldOutContainer: Qn,
1191
- stockLimitContainer: Gn,
1192
- soldOut: Yn,
1193
- stockLimitNotice: Kn,
1194
- variantThumb: Xn,
1195
- variantThumbImg: Jn,
1196
- variantThumbFallback: Zn,
1197
- variantInfo: tr,
1198
- variantName: er,
1199
- variantMeta: nr,
1200
- variantPriceRow: rr,
1201
- variantCompareAt: ar,
1202
- variantPrice: ir,
1203
- qtyControls: or,
1204
- qtyControlsWrap: sr,
1205
- qtyButton: lr,
1206
- qtyValue: cr,
1207
- footer: ur,
1208
- poweredBy: dr,
1209
- boxSummaryWindow: hr,
1210
- boxSummaryRow: mr,
1211
- boxSlot: fr,
1212
- boxItem: br,
1213
- boxItemClickable: pr,
1214
- boxThresholdLabel: _r,
1215
- boxItemPlaceholder: yr,
1216
- boxItemFilled: gr,
1217
- boxItemThreshold: wr,
1218
- boxItemDiscountText: vr,
1219
- boxItemPlus: xr,
1220
- boxItemImage: Cr,
1221
- boxItemFallback: Ir,
1222
- ctaButtonGroup: Nr,
1223
- ctaButtonGroupAnimating: Sr,
1224
- cta: Br,
1225
- ctaDualLeft: Tr,
1226
- ctaDualLeftAnimating: kr,
1227
- ctaDualRight: Rr,
1228
- ctaDualRightAnimating: Mr,
1229
- ctaTotals: Lr,
1230
- ctaDiscountBadge: Pr,
1231
- ctaTotalsWrap: Fr,
1232
- ctaTotalsWrapVisible: Or,
1233
- ctaTotalsStrike: Ar,
1234
- ctaTotalsPrice: $r
1327
+ ], Ln = Mt("trash-2", Rn), Mn = "_backdrop_1i4y2_1", Pn = "_celebrationOverlay_1i4y2_14", Fn = "_celebrationChip_1i4y2_23", On = "_backdropOpen_1i4y2_74", An = "_backdropClosed_1i4y2_78", Dn = "_panel_1i4y2_82", En = "_panelOpen_1i4y2_103", qn = "_panelClosed_1i4y2_107", $n = "_header_1i4y2_146", Vn = "_headerCenter_1i4y2_155", Wn = "_title_1i4y2_163", zn = "_searchIconButton_1i4y2_172", jn = "_headerTitleWrap_1i4y2_195", Un = "_headerSearchWrap_1i4y2_199", Hn = "_headerSearchOpen_1i4y2_211", Qn = "_searchBar_1i4y2_223", Gn = "_searchInput_1i4y2_235", Yn = "_searchClearButton_1i4y2_256", Kn = "_closeButton_1i4y2_278", Xn = "_body_1i4y2_312", Zn = "_muted_1i4y2_317", Jn = "_error_1i4y2_322", er = "_variants_1i4y2_327", tr = "_variantList_1i4y2_331", nr = "_variantRow_1i4y2_339", rr = "_variantRowSoldOut_1i4y2_347", ar = "_variantLeft_1i4y2_351", ir = "_addToBundleButton_1i4y2_358", or = "_soldOutContainer_1i4y2_386", sr = "_stockLimitContainer_1i4y2_394", lr = "_soldOut_1i4y2_386", cr = "_stockLimitNotice_1i4y2_412", ur = "_variantThumb_1i4y2_421", dr = "_variantThumbImg_1i4y2_431", hr = "_variantThumbFallback_1i4y2_438", mr = "_variantInfo_1i4y2_448", br = "_variantName_1i4y2_452", fr = "_variantMeta_1i4y2_461", _r = "_variantPriceRow_1i4y2_469", pr = "_variantCompareAt_1i4y2_476", yr = "_variantPrice_1i4y2_469", gr = "_qtyControls_1i4y2_487", vr = "_qtyControlsWrap_1i4y2_493", wr = "_qtyButton_1i4y2_499", xr = "_qtyValue_1i4y2_525", Cr = "_footer_1i4y2_532", Ir = "_poweredBy_1i4y2_540", Nr = "_boxSummaryWindow_1i4y2_552", Sr = "_boxSummaryRow_1i4y2_570", Br = "_boxSlot_1i4y2_578", kr = "_boxItem_1i4y2_587", Tr = "_boxItemClickable_1i4y2_599", Rr = "_boxThresholdLabel_1i4y2_608", Lr = "_boxItemPlaceholder_1i4y2_619", Mr = "_boxItemFilled_1i4y2_625", Pr = "_boxItemThreshold_1i4y2_631", Fr = "_boxItemDiscountText_1i4y2_639", Or = "_boxItemPlus_1i4y2_647", Ar = "_boxItemImage_1i4y2_654", Dr = "_boxItemFallback_1i4y2_661", Er = "_ctaButtonGroup_1i4y2_672", qr = "_ctaButtonGroupAnimating_1i4y2_679", $r = "_cta_1i4y2_672", Vr = "_ctaDualLeft_1i4y2_707", Wr = "_ctaDualLeftAnimating_1i4y2_725", zr = "_ctaDualRight_1i4y2_738", jr = "_ctaDualRightAnimating_1i4y2_754", Ur = "_ctaTotals_1i4y2_765", Hr = "_ctaDiscountBadge_1i4y2_773", Qr = "_ctaTotalsWrap_1i4y2_787", Gr = "_ctaTotalsWrapVisible_1i4y2_800", Yr = "_ctaTotalsStrike_1i4y2_807", Kr = "_ctaTotalsPrice_1i4y2_814", m = {
1328
+ backdrop: Mn,
1329
+ celebrationOverlay: Pn,
1330
+ celebrationChip: Fn,
1331
+ backdropOpen: On,
1332
+ backdropClosed: An,
1333
+ panel: Dn,
1334
+ panelOpen: En,
1335
+ panelClosed: qn,
1336
+ header: $n,
1337
+ headerCenter: Vn,
1338
+ title: Wn,
1339
+ searchIconButton: zn,
1340
+ headerTitleWrap: jn,
1341
+ headerSearchWrap: Un,
1342
+ headerSearchOpen: Hn,
1343
+ searchBar: Qn,
1344
+ searchInput: Gn,
1345
+ searchClearButton: Yn,
1346
+ closeButton: Kn,
1347
+ body: Xn,
1348
+ muted: Zn,
1349
+ error: Jn,
1350
+ variants: er,
1351
+ variantList: tr,
1352
+ variantRow: nr,
1353
+ variantRowSoldOut: rr,
1354
+ variantLeft: ar,
1355
+ addToBundleButton: ir,
1356
+ soldOutContainer: or,
1357
+ stockLimitContainer: sr,
1358
+ soldOut: lr,
1359
+ stockLimitNotice: cr,
1360
+ variantThumb: ur,
1361
+ variantThumbImg: dr,
1362
+ variantThumbFallback: hr,
1363
+ variantInfo: mr,
1364
+ variantName: br,
1365
+ variantMeta: fr,
1366
+ variantPriceRow: _r,
1367
+ variantCompareAt: pr,
1368
+ variantPrice: yr,
1369
+ qtyControls: gr,
1370
+ qtyControlsWrap: vr,
1371
+ qtyButton: wr,
1372
+ qtyValue: xr,
1373
+ footer: Cr,
1374
+ poweredBy: Ir,
1375
+ boxSummaryWindow: Nr,
1376
+ boxSummaryRow: Sr,
1377
+ boxSlot: Br,
1378
+ boxItem: kr,
1379
+ boxItemClickable: Tr,
1380
+ boxThresholdLabel: Rr,
1381
+ boxItemPlaceholder: Lr,
1382
+ boxItemFilled: Mr,
1383
+ boxItemThreshold: Pr,
1384
+ boxItemDiscountText: Fr,
1385
+ boxItemPlus: Or,
1386
+ boxItemImage: Ar,
1387
+ boxItemFallback: Dr,
1388
+ ctaButtonGroup: Er,
1389
+ ctaButtonGroupAnimating: qr,
1390
+ cta: $r,
1391
+ ctaDualLeft: Vr,
1392
+ ctaDualLeftAnimating: Wr,
1393
+ ctaDualRight: zr,
1394
+ ctaDualRightAnimating: jr,
1395
+ ctaTotals: Ur,
1396
+ ctaDiscountBadge: Hr,
1397
+ ctaTotalsWrap: Qr,
1398
+ ctaTotalsWrapVisible: Gr,
1399
+ ctaTotalsStrike: Yr,
1400
+ ctaTotalsPrice: Kr
1235
1401
  };
1236
- function di(a) {
1237
- var ae, ie;
1402
+ function Ii(n) {
1403
+ var Xe, Ze;
1238
1404
  const {
1239
- isOpen: t,
1240
- close: e,
1241
- loading: o,
1405
+ isOpen: e,
1406
+ close: t,
1407
+ loading: a,
1242
1408
  submitting: i,
1243
1409
  error: r,
1244
- currencyCode: m,
1245
- config: d,
1246
- eligibleVariants: S,
1247
- selections: ct,
1248
- selectionOrder: A,
1249
- getVariantMaxSelectableQuantity: O,
1250
- setQuantity: et,
1251
- bundleSize: C,
1252
- minRequired: Y,
1253
- canSubmit: X,
1254
- submit: ot,
1255
- submitAndCheckout: J
1256
- } = be(), [z, yt] = q(!1), [Z, gt] = q(""), $t = V(null), j = V(null), ut = V(null), [U, dt] = q(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Tt, It] = q(0), [ht, zt] = q(null), [kt, Ct] = q(!1), Nt = V(null), Dt = V(C), Rt = 7e3, [Wt, Xt] = q(0), [wt, jt] = q(null), [Mt, Lt] = q(!1), ft = V(null), h = 2800, _ = [
1410
+ currencyCode: h,
1411
+ config: u,
1412
+ eligibleVariants: B,
1413
+ selections: le,
1414
+ selectionOrder: $,
1415
+ getVariantMaxSelectableQuantity: D,
1416
+ setQuantity: de,
1417
+ bundleSize: F,
1418
+ minRequired: te,
1419
+ canSubmit: z,
1420
+ submit: K,
1421
+ submitAndCheckout: g,
1422
+ locale: H,
1423
+ t: I
1424
+ } = wt(), [he, ke] = j(!1), [Te, ye] = j(""), ae = U(null), X = U(null), ie = U(null), [me, Re] = j(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [ne, Ce] = j(0), [be, Ve] = j(null), [ge, Le] = j(!1), Ie = U(null), Ae = U(F), nt = 7e3, [We, ze] = j(0), [Me, Ye] = j(null), [Ne, De] = j(!1), ve = U(null), f = 2800, p = [
1257
1425
  "#2563eb",
1258
1426
  "#3b82f6",
1259
1427
  "#60a5fa",
1260
1428
  "#93c5fd",
1261
1429
  "#bae6fd",
1262
1430
  "#e0f2fe"
1263
- ], w = T(() => {
1264
- var n;
1265
- const c = (n = d == null ? void 0 : d.styleSettings) == null ? void 0 : n.confettiColors;
1431
+ ], x = L(() => {
1432
+ var d;
1433
+ const c = (d = u == null ? void 0 : u.styleSettings) == null ? void 0 : d.confettiColors;
1266
1434
  return Array.isArray(c) && c.length >= 6 ? c.slice(0, 6).map(
1267
- (s, u) => typeof s == "string" && s.trim() ? s : _[u]
1268
- ) : [..._];
1269
- }, [(ae = d == null ? void 0 : d.styleSettings) == null ? void 0 : ae.confettiColors]), B = (c) => {
1270
- const n = Number.parseFloat(c);
1271
- return Number.isFinite(n) ? String(Math.round(n)) : c;
1272
- }, R = (c) => {
1273
- const n = (c ?? []).filter((s) => {
1274
- var y, g;
1275
- const u = (y = s == null ? void 0 : s.name) == null ? void 0 : y.trim(), p = (g = s == null ? void 0 : s.value) == null ? void 0 : g.trim();
1276
- return !(!u || !p || u.toLowerCase() === "title");
1435
+ (v, o) => typeof v == "string" && v.trim() ? v : p[o]
1436
+ ) : [...p];
1437
+ }, [(Xe = u == null ? void 0 : u.styleSettings) == null ? void 0 : Xe.confettiColors]), T = (c) => {
1438
+ const d = Number.parseFloat(c);
1439
+ return Number.isFinite(d) ? String(Math.round(d)) : c;
1440
+ }, M = (c) => {
1441
+ const d = (c ?? []).filter((v) => {
1442
+ var b, w;
1443
+ const o = (b = v == null ? void 0 : v.name) == null ? void 0 : b.trim(), s = (w = v == null ? void 0 : v.value) == null ? void 0 : w.trim();
1444
+ return !(!o || !s || o.toLowerCase() === "title");
1277
1445
  });
1278
- return n.length ? n.map((s) => `${s.name}: ${s.value}`).join(" · ") : null;
1446
+ return d.length ? d.map((v) => `${v.name}: ${v.value}`).join(" · ") : null;
1279
1447
  }, E = (c) => {
1280
- var n;
1281
- return ((n = c.product) == null ? void 0 : n.title) ?? c.displayName ?? c.title;
1282
- }, $ = (c) => {
1283
- const n = E(c), s = R(c.selectedOptions);
1284
- return [n, s].filter(Boolean).join(" — ");
1285
- }, [H, M] = q(t), W = V(null), Q = (c) => {
1286
- const n = Number(c);
1287
- if (!Number.isFinite(n)) return c;
1288
- if (m)
1289
- try {
1290
- return new Intl.NumberFormat(void 0, { style: "currency", currency: m }).format(n);
1291
- } catch {
1292
- }
1293
- return `$${n.toFixed(2)}`;
1294
- }, L = ((ie = d == null ? void 0 : d.title) == null ? void 0 : ie.trim()) || "Build your bundle", Ut = T(() => {
1295
- const c = Number((d == null ? void 0 : d.maxBundleSize) ?? NaN), n = Number.isFinite(c) ? Math.floor(c) : 100;
1296
- return Math.max(2, Math.min(100, n));
1297
- }, [d == null ? void 0 : d.maxBundleSize]), mt = C >= Ut, Jt = T(() => [...S].sort((c, n) => c.displayName.localeCompare(n.displayName)), [S]), vt = T(() => {
1298
- const c = Z.trim().toLowerCase();
1299
- if (!c) return Jt;
1300
- const n = c.split(/\s+/).filter(Boolean), s = (u) => {
1301
- var g;
1302
- const p = [];
1303
- p.push(u.displayName), (g = u.product) != null && g.title && p.push(u.product.title);
1304
- for (const x of u.selectedOptions ?? [])
1305
- p.push(x.name), p.push(x.value);
1306
- const y = p.join(" ").toLowerCase();
1307
- return n.every((x) => y.includes(x));
1448
+ var d;
1449
+ return ((d = c.product) == null ? void 0 : d.title) ?? c.displayName ?? c.title;
1450
+ }, V = (c) => {
1451
+ const d = E(c), v = M(c.selectedOptions);
1452
+ return [d, v].filter(Boolean).join(" — ");
1453
+ }, [Z, ee] = j(e), Q = U(null), A = (c) => {
1454
+ const d = Number(c);
1455
+ return Number.isFinite(d) ? jt(d, h, H) : c;
1456
+ }, q = ((Ze = u == null ? void 0 : u.title) == null ? void 0 : Ze.trim()) || I("bundle.title.default"), Se = L(() => {
1457
+ const c = Number((u == null ? void 0 : u.maxBundleSize) ?? NaN), d = Number.isFinite(c) ? Math.floor(c) : 100;
1458
+ return Math.max(2, Math.min(100, d));
1459
+ }, [u == null ? void 0 : u.maxBundleSize]), Pe = F >= Se, rt = L(() => [...B].sort((c, d) => c.displayName.localeCompare(d.displayName)), [B]), Fe = L(() => {
1460
+ const c = Te.trim().toLowerCase();
1461
+ if (!c) return rt;
1462
+ const d = c.split(/\s+/).filter(Boolean), v = (o) => {
1463
+ var w;
1464
+ const s = [];
1465
+ s.push(o.displayName), (w = o.product) != null && w.title && s.push(o.product.title);
1466
+ for (const y of o.selectedOptions ?? [])
1467
+ s.push(y.name), s.push(y.value);
1468
+ const b = s.join(" ").toLowerCase();
1469
+ return d.every((y) => b.includes(y));
1308
1470
  };
1309
- return Jt.filter(s);
1310
- }, [Z, Jt]), nt = T(() => [...(d == null ? void 0 : d.rules) ?? []].sort((c, n) => c.minBundleSize - n.minBundleSize), [d == null ? void 0 : d.rules]), rt = T(() => Math.max(0, Y - C), [C, Y]), bt = T(() => {
1471
+ return rt.filter(v);
1472
+ }, [Te, rt]), re = L(() => [...(u == null ? void 0 : u.rules) ?? []].sort((c, d) => c.minBundleSize - d.minBundleSize), [u == null ? void 0 : u.rules]), W = L(() => Math.max(0, te - F), [F, te]), at = L(() => {
1311
1473
  let c = null;
1312
- for (const n of nt)
1313
- C >= n.minBundleSize && (c = n);
1474
+ for (const d of re)
1475
+ F >= d.minBundleSize && (c = d);
1314
1476
  return c;
1315
- }, [C, nt]), v = T(() => {
1316
- if (!bt) return null;
1317
- const c = Number.parseFloat(bt.discountPercent);
1477
+ }, [F, re]), Oe = L(() => {
1478
+ if (!at) return null;
1479
+ const c = Number.parseFloat(at.discountPercent);
1318
1480
  return !Number.isFinite(c) || c <= 0 ? null : c;
1319
- }, [bt]), xt = nt[0], Pt = !!(xt && C >= xt.minBundleSize), st = T(() => {
1320
- const c = new Map(S.map((s) => [s.id, s]));
1321
- let n = 0;
1322
- for (const [s, u] of Object.entries(ct)) {
1323
- const p = u ?? 0;
1324
- if (p <= 0) continue;
1325
- const y = c.get(s), g = Number(y == null ? void 0 : y.price);
1326
- Number.isFinite(g) && (n += g * p);
1481
+ }, [at]), we = re[0], N = !!(we && F >= we.minBundleSize), oe = L(() => {
1482
+ const c = new Map(B.map((v) => [v.id, v]));
1483
+ let d = 0;
1484
+ for (const [v, o] of Object.entries(le)) {
1485
+ const s = o ?? 0;
1486
+ if (s <= 0) continue;
1487
+ const b = c.get(v), w = Number(b == null ? void 0 : b.price);
1488
+ Number.isFinite(w) && (d += w * s);
1327
1489
  }
1328
- return Math.round(n * 100) / 100;
1329
- }, [S, ct]), le = T(() => {
1330
- if (!v) return st;
1331
- const c = st * (1 - v / 100);
1490
+ return Math.round(d * 100) / 100;
1491
+ }, [B, le]), je = L(() => {
1492
+ if (!Oe) return oe;
1493
+ const c = oe * (1 - Oe / 100);
1332
1494
  return Math.round(c * 100) / 100;
1333
- }, [v, st]), Ft = T(() => nt.length ? Math.max(...nt.map((c) => c.minBundleSize)) : 0, [nt]), St = T(() => {
1334
- const c = new Map(S.map((n) => [n.id, n]));
1335
- return A.map((n) => c.get(n)).filter((n) => !!n);
1336
- }, [S, A]), Ot = T(() => {
1337
- var n;
1495
+ }, [Oe, oe]), xe = L(() => re.length ? Math.max(...re.map((c) => c.minBundleSize)) : 0, [re]), it = L(() => {
1496
+ const c = new Map(B.map((d) => [d.id, d]));
1497
+ return $.map((d) => c.get(d)).filter((d) => !!d);
1498
+ }, [B, $]), Ue = L(() => {
1499
+ var d;
1338
1500
  const c = /* @__PURE__ */ new Map();
1339
- for (const s of nt) {
1340
- const u = Math.max(0, s.minBundleSize - 1);
1341
- c.set(u, {
1342
- discountPercent: s.discountPercent,
1343
- minBundleSize: s.minBundleSize,
1344
- label: ((n = s.label) == null ? void 0 : n.trim()) || `Buy ${s.minBundleSize}+`
1501
+ for (const v of re) {
1502
+ const o = Math.max(0, v.minBundleSize - 1);
1503
+ c.set(o, {
1504
+ discountPercent: v.discountPercent,
1505
+ minBundleSize: v.minBundleSize,
1506
+ label: ((d = v.label) == null ? void 0 : d.trim()) || `Buy ${v.minBundleSize}+`
1345
1507
  });
1346
1508
  }
1347
1509
  return c;
1348
- }, [nt]), ce = T(() => Math.max(Ft || Y, St.length), [St.length, Ft, Y]), [Et, ee] = q(!0), ne = V(rt);
1349
- F(() => {
1350
- if (((d == null ? void 0 : d.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1351
- const n = ne.current > 0;
1352
- ee(!(n && rt === 0));
1510
+ }, [re]), He = L(() => Math.max(xe || te, it.length), [it.length, xe, te]), [Be, ut] = j(!0), Ke = U(W);
1511
+ O(() => {
1512
+ if (((u == null ? void 0 : u.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1513
+ const d = Ke.current > 0;
1514
+ ut(!(d && W === 0));
1353
1515
  }
1354
- ne.current = rt;
1355
- }, [rt, d == null ? void 0 : d.ctaButtonMode]);
1356
- const Bt = V(null), re = V(null), At = V(null), Ht = V(C), Qt = (c) => {
1357
- const n = re.current;
1358
- if (!n) return;
1359
- const s = n.querySelector(`[data-variant-row="${c}"]`);
1360
- if (!s) return;
1361
- const u = n.getBoundingClientRect(), p = s.getBoundingClientRect(), y = 8;
1362
- if (p.top >= u.top + y && p.bottom <= u.bottom - y) return;
1363
- const x = Math.max(0, n.scrollHeight - n.clientHeight), k = p.top - u.top + p.height / 2, D = n.scrollTop + k - n.clientHeight / 2, P = Math.min(x, Math.max(0, D));
1364
- n.scrollTo({ top: P, behavior: "smooth" });
1516
+ Ke.current = W;
1517
+ }, [W, u == null ? void 0 : u.ctaButtonMode]);
1518
+ const ot = U(null), dt = U(null), Ee = U(null), ht = U(F), qe = (c) => {
1519
+ const d = dt.current;
1520
+ if (!d) return;
1521
+ const v = d.querySelector(`[data-variant-row="${c}"]`);
1522
+ if (!v) return;
1523
+ const o = d.getBoundingClientRect(), s = v.getBoundingClientRect(), b = 8;
1524
+ if (s.top >= o.top + b && s.bottom <= o.bottom - b) return;
1525
+ const y = Math.max(0, d.scrollHeight - d.clientHeight), C = s.top - o.top + s.height / 2, k = d.scrollTop + C - d.clientHeight / 2, P = Math.min(y, Math.max(0, k));
1526
+ d.scrollTo({ top: P, behavior: "smooth" });
1365
1527
  };
1366
- return F(() => {
1367
- if (!t) return;
1368
- const c = (n) => {
1369
- n.key === "Escape" && e();
1528
+ return O(() => {
1529
+ if (!e) return;
1530
+ const c = (d) => {
1531
+ d.key === "Escape" && t();
1370
1532
  };
1371
1533
  return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
1372
- }, [e, t]), F(() => {
1534
+ }, [t, e]), O(() => {
1373
1535
  if (typeof window > "u") return;
1374
- const c = () => dt({ width: window.innerWidth, height: window.innerHeight });
1536
+ const c = () => Re({ width: window.innerWidth, height: window.innerHeight });
1375
1537
  return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
1376
- }, []), F(() => {
1377
- if (W.current != null && (window.clearTimeout(W.current), W.current = null), t) {
1378
- M(!0);
1538
+ }, []), O(() => {
1539
+ if (Q.current != null && (window.clearTimeout(Q.current), Q.current = null), e) {
1540
+ ee(!0);
1379
1541
  return;
1380
1542
  }
1381
- W.current = window.setTimeout(() => {
1382
- M(!1), W.current = null;
1543
+ Q.current = window.setTimeout(() => {
1544
+ ee(!1), Q.current = null;
1383
1545
  }, 220);
1384
- }, [t]), F(() => () => {
1385
- W.current != null && window.clearTimeout(W.current);
1386
- }, []), F(() => () => {
1387
- Nt.current != null && window.clearTimeout(Nt.current);
1388
- }, []), F(() => () => {
1389
- ft.current != null && window.clearTimeout(ft.current);
1390
- }, []), F(() => {
1391
- if (!t || !z) return;
1546
+ }, [e]), O(() => () => {
1547
+ Q.current != null && window.clearTimeout(Q.current);
1548
+ }, []), O(() => () => {
1549
+ Ie.current != null && window.clearTimeout(Ie.current);
1550
+ }, []), O(() => () => {
1551
+ ve.current != null && window.clearTimeout(ve.current);
1552
+ }, []), O(() => {
1553
+ if (!e || !he) return;
1392
1554
  const c = requestAnimationFrame(() => {
1393
- var n;
1394
- return (n = $t.current) == null ? void 0 : n.focus();
1555
+ var d;
1556
+ return (d = ae.current) == null ? void 0 : d.focus();
1395
1557
  });
1396
1558
  return () => cancelAnimationFrame(c);
1397
- }, [t, z]), F(() => {
1398
- const c = Ht.current;
1399
- if (Ht.current = C, C <= c) return;
1400
- const n = At.current;
1401
- if (!n) return;
1402
- const s = nt.some((g) => g.minBundleSize === C), u = nt.find((g) => g.minBundleSize > C), p = u && s ? u.minBundleSize - 1 : u ? null : C - 1;
1403
- if (p == null || p < 0) return;
1404
- const y = requestAnimationFrame(() => {
1405
- const g = n.querySelector(`[data-box-slot="${p}"]`);
1406
- if (!g) return;
1407
- const x = n.getBoundingClientRect(), D = g.getBoundingClientRect().right - x.right;
1408
- if (D <= 1) return;
1409
- const P = Math.max(0, n.scrollWidth - n.clientWidth), G = Math.min(P, Math.max(0, n.scrollLeft + D));
1410
- n.scrollTo({ left: G, behavior: "smooth" });
1559
+ }, [e, he]), O(() => {
1560
+ const c = ht.current;
1561
+ if (ht.current = F, F <= c) return;
1562
+ const d = Ee.current;
1563
+ if (!d) return;
1564
+ const v = re.some((w) => w.minBundleSize === F), o = re.find((w) => w.minBundleSize > F), s = o && v ? o.minBundleSize - 1 : o ? null : F - 1;
1565
+ if (s == null || s < 0) return;
1566
+ const b = requestAnimationFrame(() => {
1567
+ const w = d.querySelector(`[data-box-slot="${s}"]`);
1568
+ if (!w) return;
1569
+ const y = d.getBoundingClientRect(), k = w.getBoundingClientRect().right - y.right;
1570
+ if (k <= 1) return;
1571
+ const P = Math.max(0, d.scrollWidth - d.clientWidth), G = Math.min(P, Math.max(0, d.scrollLeft + k));
1572
+ d.scrollTo({ left: G, behavior: "smooth" });
1411
1573
  });
1412
- return () => cancelAnimationFrame(y);
1413
- }, [C, nt]), F(() => {
1414
- if (!t) return;
1415
- const c = Dt.current;
1416
- if (Dt.current = C, C <= c) return;
1417
- const n = nt.find((s) => s.minBundleSize === C);
1418
- n && (jt(`You received a ${B(n.discountPercent)}% discount!`), Xt((s) => s + 1), Lt(!0), ft.current != null && window.clearTimeout(ft.current), ft.current = window.setTimeout(() => {
1419
- Lt(!1), ft.current = null;
1420
- }, h));
1421
- }, [C, t, nt]), F(() => {
1422
- if (!t || !Mt || !wt) return;
1574
+ return () => cancelAnimationFrame(b);
1575
+ }, [F, re]), O(() => {
1576
+ if (!e) return;
1577
+ const c = Ae.current;
1578
+ if (Ae.current = F, F <= c) return;
1579
+ const d = re.find((v) => v.minBundleSize === F);
1580
+ d && (Ye(
1581
+ I("bundle.celebration.received_discount", {
1582
+ discount: T(d.discountPercent)
1583
+ })
1584
+ ), ze((v) => v + 1), De(!0), ve.current != null && window.clearTimeout(ve.current), ve.current = window.setTimeout(() => {
1585
+ De(!1), ve.current = null;
1586
+ }, f));
1587
+ }, [F, e, re]), O(() => {
1588
+ if (!e || !Ne || !Me) return;
1423
1589
  const c = requestAnimationFrame(() => {
1424
- var x;
1425
- const n = ut.current, s = n == null ? void 0 : n.getBoundingClientRect(), u = (x = Bt.current) == null ? void 0 : x.getBoundingClientRect(), p = s ? s.left + s.width / 2 : u ? u.left + u.width / 2 : window.innerWidth / 2, y = s ? s.top + s.height / 2 : u ? u.top + u.height / 2 : window.innerHeight / 2, g = {
1426
- x: p - 2,
1427
- y: y - 2,
1590
+ var y;
1591
+ const d = ie.current, v = d == null ? void 0 : d.getBoundingClientRect(), o = (y = ot.current) == null ? void 0 : y.getBoundingClientRect(), s = v ? v.left + v.width / 2 : o ? o.left + o.width / 2 : window.innerWidth / 2, b = v ? v.top + v.height / 2 : o ? o.top + o.height / 2 : window.innerHeight / 2, w = {
1592
+ x: s - 2,
1593
+ y: b - 2,
1428
1594
  w: 4,
1429
1595
  h: 4
1430
1596
  };
1431
- zt(g), It((k) => k + 1), Ct(!0), Nt.current != null && window.clearTimeout(Nt.current), Nt.current = window.setTimeout(() => {
1432
- Ct(!1), Nt.current = null;
1433
- }, Rt);
1597
+ Ve(w), Ce((C) => C + 1), Le(!0), Ie.current != null && window.clearTimeout(Ie.current), Ie.current = window.setTimeout(() => {
1598
+ Le(!1), Ie.current = null;
1599
+ }, nt);
1434
1600
  });
1435
1601
  return () => cancelAnimationFrame(c);
1436
- }, [Wt, wt, Rt, Mt, t]), F(() => {
1602
+ }, [We, Me, nt, Ne, e]), O(() => {
1437
1603
  var c;
1438
- t && ((c = Bt.current) == null || c.focus());
1439
- }, [t]), H ? /* @__PURE__ */ N(
1604
+ e && ((c = ot.current) == null || c.focus());
1605
+ }, [e]), Z ? /* @__PURE__ */ R(
1440
1606
  "div",
1441
1607
  {
1442
1608
  role: "dialog",
1443
1609
  "aria-modal": "true",
1444
- "aria-label": "Bundle builder",
1445
- className: [f.backdrop, t ? f.backdropOpen : f.backdropClosed, a.className].filter(Boolean).join(" "),
1610
+ "aria-label": I("bundle.drawer.aria"),
1611
+ className: [m.backdrop, e ? m.backdropOpen : m.backdropClosed, n.className].filter(Boolean).join(" "),
1446
1612
  onMouseDown: (c) => {
1447
- c.target === c.currentTarget && e();
1613
+ c.target === c.currentTarget && t();
1448
1614
  },
1449
1615
  children: [
1450
- kt && ht && U.width > 0 && U.height > 0 ? /* @__PURE__ */ l(
1451
- ln,
1616
+ ge && be && me.width > 0 && me.height > 0 ? /* @__PURE__ */ l(
1617
+ wn,
1452
1618
  {
1453
- width: U.width,
1454
- height: U.height,
1455
- confettiSource: ht,
1456
- colors: w,
1619
+ width: me.width,
1620
+ height: me.height,
1621
+ confettiSource: be,
1622
+ colors: x,
1457
1623
  recycle: !1,
1458
1624
  numberOfPieces: 70,
1459
1625
  tweenDuration: 100,
@@ -1462,135 +1628,131 @@ function di(a) {
1462
1628
  initialVelocityX: { min: -6, max: 6 },
1463
1629
  style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
1464
1630
  },
1465
- Tt
1631
+ ne
1466
1632
  ) : null,
1467
- /* @__PURE__ */ N("aside", { ref: Bt, className: [f.panel, t ? f.panelOpen : f.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1468
- Mt && wt ? /* @__PURE__ */ l("div", { className: f.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ l("div", { ref: ut, className: f.celebrationChip, children: wt }, Wt) }) : null,
1469
- /* @__PURE__ */ N("header", { className: [f.header, z ? f.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1633
+ /* @__PURE__ */ R("aside", { ref: ot, className: [m.panel, e ? m.panelOpen : m.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1634
+ Ne && Me ? /* @__PURE__ */ l("div", { className: m.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ l("div", { ref: ie, className: m.celebrationChip, children: Me }, We) }) : null,
1635
+ /* @__PURE__ */ R("header", { className: [m.header, he ? m.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1470
1636
  /* @__PURE__ */ l(
1471
1637
  "button",
1472
1638
  {
1473
1639
  type: "button",
1474
- className: f.searchIconButton,
1475
- "aria-label": z ? "Search (expanded)" : "Search",
1476
- "aria-expanded": z,
1640
+ className: m.searchIconButton,
1641
+ "aria-label": I(he ? "bundle.search.expanded" : "bundle.search"),
1642
+ "aria-expanded": he,
1477
1643
  onClick: () => {
1478
- yt(!0);
1644
+ ke(!0);
1479
1645
  },
1480
- children: /* @__PURE__ */ l(pn, { size: 18, "aria-hidden": "true" })
1646
+ children: /* @__PURE__ */ l(Tn, { size: 18, "aria-hidden": "true" })
1481
1647
  }
1482
1648
  ),
1483
- /* @__PURE__ */ N("div", { className: f.headerCenter, children: [
1484
- /* @__PURE__ */ l("div", { className: f.headerTitleWrap, "aria-hidden": z, children: /* @__PURE__ */ l("h2", { className: f.title, children: L }) }),
1485
- /* @__PURE__ */ l("div", { className: f.headerSearchWrap, "aria-hidden": !z, children: /* @__PURE__ */ N("div", { className: f.searchBar, children: [
1649
+ /* @__PURE__ */ R("div", { className: m.headerCenter, children: [
1650
+ /* @__PURE__ */ l("div", { className: m.headerTitleWrap, "aria-hidden": he, children: /* @__PURE__ */ l("h2", { className: m.title, children: q }) }),
1651
+ /* @__PURE__ */ l("div", { className: m.headerSearchWrap, "aria-hidden": !he, children: /* @__PURE__ */ R("div", { className: m.searchBar, children: [
1486
1652
  /* @__PURE__ */ l(
1487
1653
  "input",
1488
1654
  {
1489
- ref: $t,
1490
- className: f.searchInput,
1655
+ ref: ae,
1656
+ className: m.searchInput,
1491
1657
  type: "search",
1492
- value: Z,
1493
- placeholder: "Search",
1494
- onChange: (c) => gt(c.target.value),
1658
+ value: Te,
1659
+ placeholder: I("bundle.search.placeholder"),
1660
+ onChange: (c) => ye(c.target.value),
1495
1661
  onBlur: () => {
1496
- Z.trim() === "" && yt(!1);
1662
+ Te.trim() === "" && ke(!1);
1497
1663
  }
1498
1664
  }
1499
1665
  ),
1500
- Z.trim() ? /* @__PURE__ */ l(
1666
+ Te.trim() ? /* @__PURE__ */ l(
1501
1667
  "button",
1502
1668
  {
1503
1669
  type: "button",
1504
- className: f.searchClearButton,
1670
+ className: m.searchClearButton,
1505
1671
  onMouseDown: (c) => {
1506
1672
  c.preventDefault();
1507
1673
  },
1508
1674
  onClick: () => {
1509
1675
  var c;
1510
- gt(""), (c = $t.current) == null || c.focus();
1676
+ ye(""), (c = ae.current) == null || c.focus();
1511
1677
  },
1512
- "aria-label": "Clear search",
1513
- children: "Clear"
1678
+ "aria-label": I("bundle.search.clear"),
1679
+ children: I("bundle.search.clear")
1514
1680
  }
1515
1681
  ) : null
1516
1682
  ] }) })
1517
1683
  ] }),
1518
- /* @__PURE__ */ l("button", { type: "button", onClick: e, disabled: i, className: f.closeButton, "aria-label": "Close", children: "×" })
1684
+ /* @__PURE__ */ l("button", { type: "button", onClick: t, disabled: i, className: m.closeButton, "aria-label": I("bundle.close"), children: "×" })
1519
1685
  ] }),
1520
- /* @__PURE__ */ N("div", { className: f.body, ref: re, children: [
1521
- o ? /* @__PURE__ */ l("p", { className: f.muted, children: "Loading…" }) : null,
1522
- r ? /* @__PURE__ */ l("p", { className: f.error, children: r }) : null,
1523
- /* @__PURE__ */ l("div", { className: f.variants, children: /* @__PURE__ */ l("ul", { className: f.variantList, children: vt.map((c) => {
1524
- var Gt, Yt, it, tt;
1525
- const n = ct[c.id] ?? 0, s = E(c), u = R(c.selectedOptions), p = $(c), y = O(c.id), g = y ?? Number.POSITIVE_INFINITY, x = n >= g, k = c.availableForSale !== !1 && !mt && !x, D = c.availableForSale === !1 ? null : x ? "Max Reached" : null, P = v, G = Number(c.price), at = P != null && Number.isFinite(P) && P > 0 && Number.isFinite(G), pt = at ? Math.round(G * (1 - P / 100) * 100) / 100 : null;
1526
- return /* @__PURE__ */ N(
1686
+ /* @__PURE__ */ R("div", { className: m.body, ref: dt, children: [
1687
+ a ? /* @__PURE__ */ l("p", { className: m.muted, children: I("bundle.loading") }) : null,
1688
+ r ? /* @__PURE__ */ l("p", { className: m.error, children: r }) : null,
1689
+ /* @__PURE__ */ l("div", { className: m.variants, children: /* @__PURE__ */ l("ul", { className: m.variantList, children: Fe.map((c) => {
1690
+ var fe, $e, Je, et;
1691
+ const d = le[c.id] ?? 0, v = E(c), o = M(c.selectedOptions), s = V(c), b = D(c.id), w = b ?? Number.POSITIVE_INFINITY, y = d >= w, C = c.availableForSale !== !1 && !Pe && !y, k = c.availableForSale === !1 ? null : y ? I("bundle.stock.max_reached") : null, P = Oe, G = Number(c.price), Y = P != null && Number.isFinite(P) && P > 0 && Number.isFinite(G), ce = Y ? Math.round(G * (1 - P / 100) * 100) / 100 : null;
1692
+ return /* @__PURE__ */ R(
1527
1693
  "li",
1528
1694
  {
1529
- className: [f.variantRow, c.availableForSale === !1 && f.variantRowSoldOut].filter(Boolean).join(" "),
1695
+ className: [m.variantRow, c.availableForSale === !1 && m.variantRowSoldOut].filter(Boolean).join(" "),
1530
1696
  "data-variant-row": c.id,
1531
1697
  children: [
1532
- /* @__PURE__ */ N("div", { className: f.variantLeft, children: [
1533
- /* @__PURE__ */ l("div", { className: f.variantThumb, "aria-hidden": "true", children: (Gt = c.image) != null && Gt.url ? /* @__PURE__ */ l(
1698
+ /* @__PURE__ */ R("div", { className: m.variantLeft, children: [
1699
+ /* @__PURE__ */ l("div", { className: m.variantThumb, "aria-hidden": "true", children: (fe = c.image) != null && fe.url ? /* @__PURE__ */ l(
1534
1700
  "img",
1535
1701
  {
1536
- className: f.variantThumbImg,
1702
+ className: m.variantThumbImg,
1537
1703
  src: c.image.url,
1538
- alt: c.image.altText ?? p,
1704
+ alt: c.image.altText ?? s,
1539
1705
  loading: "lazy"
1540
1706
  }
1541
- ) : /* @__PURE__ */ l("div", { className: f.variantThumbFallback, children: ((tt = (it = (Yt = c.product) == null ? void 0 : Yt.title) == null ? void 0 : it.slice(0, 1)) == null ? void 0 : tt.toUpperCase()) ?? "•" }) }),
1542
- /* @__PURE__ */ N("div", { className: f.variantInfo, children: [
1543
- /* @__PURE__ */ l("div", { className: f.variantName, children: s }),
1544
- u ? /* @__PURE__ */ l("div", { className: f.variantMeta, children: u }) : null,
1545
- /* @__PURE__ */ N("div", { className: f.variantPriceRow, children: [
1546
- at ? /* @__PURE__ */ l("span", { className: f.variantCompareAt, children: Q(Number.isFinite(G) ? G.toFixed(2) : c.price) }) : null,
1547
- /* @__PURE__ */ l("span", { className: f.variantPrice, children: Q(
1548
- pt != null ? pt.toFixed(2) : Number.isFinite(G) ? G.toFixed(2) : c.price
1707
+ ) : /* @__PURE__ */ l("div", { className: m.variantThumbFallback, children: ((et = (Je = ($e = c.product) == null ? void 0 : $e.title) == null ? void 0 : Je.slice(0, 1)) == null ? void 0 : et.toUpperCase()) ?? "•" }) }),
1708
+ /* @__PURE__ */ R("div", { className: m.variantInfo, children: [
1709
+ /* @__PURE__ */ l("div", { className: m.variantName, children: v }),
1710
+ o ? /* @__PURE__ */ l("div", { className: m.variantMeta, children: o }) : null,
1711
+ /* @__PURE__ */ R("div", { className: m.variantPriceRow, children: [
1712
+ Y ? /* @__PURE__ */ l("span", { className: m.variantCompareAt, children: A(Number.isFinite(G) ? G.toFixed(2) : c.price) }) : null,
1713
+ /* @__PURE__ */ l("span", { className: m.variantPrice, children: A(
1714
+ ce != null ? ce.toFixed(2) : Number.isFinite(G) ? G.toFixed(2) : c.price
1549
1715
  ) })
1550
1716
  ] })
1551
1717
  ] })
1552
1718
  ] }),
1553
- c.availableForSale === !1 ? /* @__PURE__ */ l("div", { className: f.soldOutContainer, children: /* @__PURE__ */ N("span", { className: f.soldOut, "aria-label": `${p} is sold out`, children: [
1554
- "Sold",
1555
- /* @__PURE__ */ l("br", {}),
1556
- "Out"
1557
- ] }) }) : n <= 0 && g <= 0 ? /* @__PURE__ */ l("div", { className: f.stockLimitContainer, children: /* @__PURE__ */ l("span", { className: f.stockLimitNotice, "aria-label": `${p} max available selected`, children: "Max Added To Cart" }) }) : n <= 0 ? /* @__PURE__ */ l(
1719
+ c.availableForSale === !1 ? /* @__PURE__ */ l("div", { className: m.soldOutContainer, children: /* @__PURE__ */ l("span", { className: m.soldOut, "aria-label": I("bundle.a11y.sold_out", { name: s }), children: I("bundle.stock.sold_out") }) }) : d <= 0 && w <= 0 ? /* @__PURE__ */ l("div", { className: m.stockLimitContainer, children: /* @__PURE__ */ l("span", { className: m.stockLimitNotice, "aria-label": I("bundle.a11y.max_available_selected", { name: s }), children: I("bundle.stock.max_added") }) }) : d <= 0 ? /* @__PURE__ */ l(
1558
1720
  "button",
1559
1721
  {
1560
1722
  type: "button",
1561
- onClick: () => et(c.id, 1),
1562
- disabled: i || !k,
1563
- className: f.addToBundleButton,
1564
- "aria-label": D ? `${p} ${D.toLowerCase()}` : `Add ${p} to bundle`,
1565
- children: "Add"
1723
+ onClick: () => de(c.id, 1),
1724
+ disabled: i || !C,
1725
+ className: m.addToBundleButton,
1726
+ "aria-label": k ? `${s} ${k.toLowerCase()}` : I("bundle.a11y.add_to_bundle", { name: s }),
1727
+ children: I("bundle.cta.add_to_bundle")
1566
1728
  }
1567
- ) : /* @__PURE__ */ N("div", { className: f.qtyControlsWrap, children: [
1568
- /* @__PURE__ */ N("div", { className: f.qtyControls, children: [
1729
+ ) : /* @__PURE__ */ R("div", { className: m.qtyControlsWrap, children: [
1730
+ /* @__PURE__ */ R("div", { className: m.qtyControls, children: [
1569
1731
  /* @__PURE__ */ l(
1570
1732
  "button",
1571
1733
  {
1572
1734
  type: "button",
1573
- onClick: () => et(c.id, n - 1),
1574
- disabled: i || n <= 0,
1575
- className: f.qtyButton,
1576
- "aria-label": `Decrease ${p}`,
1735
+ onClick: () => de(c.id, d - 1),
1736
+ disabled: i || d <= 0,
1737
+ className: m.qtyButton,
1738
+ "aria-label": I("bundle.a11y.decrease", { name: s }),
1577
1739
  children: "−"
1578
1740
  }
1579
1741
  ),
1580
- /* @__PURE__ */ l("span", { className: f.qtyValue, "aria-label": `Quantity ${n}`, children: n }),
1742
+ /* @__PURE__ */ l("span", { className: m.qtyValue, "aria-label": I("bundle.a11y.quantity", { name: s, qty: d }), children: d }),
1581
1743
  /* @__PURE__ */ l(
1582
1744
  "button",
1583
1745
  {
1584
1746
  type: "button",
1585
- onClick: () => et(c.id, n + 1),
1586
- disabled: i || !k,
1587
- className: f.qtyButton,
1588
- "aria-label": D ? `${p} ${D.toLowerCase()}` : `Increase ${p}`,
1747
+ onClick: () => de(c.id, d + 1),
1748
+ disabled: i || !C,
1749
+ className: m.qtyButton,
1750
+ "aria-label": k ? `${s} ${k.toLowerCase()}` : I("bundle.a11y.increase", { name: s }),
1589
1751
  children: "+"
1590
1752
  }
1591
1753
  )
1592
1754
  ] }),
1593
- D ? /* @__PURE__ */ l("div", { className: f.stockLimitNotice, children: D }) : null
1755
+ k ? /* @__PURE__ */ l("div", { className: m.stockLimitNotice, children: k }) : null
1594
1756
  ] })
1595
1757
  ]
1596
1758
  },
@@ -1598,87 +1760,85 @@ function di(a) {
1598
1760
  );
1599
1761
  }) }) })
1600
1762
  ] }),
1601
- /* @__PURE__ */ N("footer", { className: f.footer, ref: j, children: [
1602
- /* @__PURE__ */ l("div", { className: f.boxSummaryWindow, ref: At, children: /* @__PURE__ */ l("div", { className: f.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ce }).map((c, n) => {
1603
- var D, P, G, at;
1604
- const s = St[n], u = Ot.get(n), p = !!s, y = !!u, g = y && !p, x = u ? `${u.discountPercent}% off` : null, k = p ? s.displayName : `Slot ${n + 1}`;
1605
- return /* @__PURE__ */ N("div", { "data-box-slot": n, className: f.boxSlot, children: [
1763
+ /* @__PURE__ */ R("footer", { className: m.footer, ref: X, children: [
1764
+ /* @__PURE__ */ l("div", { className: m.boxSummaryWindow, ref: Ee, children: /* @__PURE__ */ l("div", { className: m.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: He }).map((c, d) => {
1765
+ var k, P, G, Y;
1766
+ const v = it[d], o = Ue.get(d), s = !!v, b = !!o, w = b && !s, y = o ? I("bundle.discount.off_label", { discount: T(o.discountPercent) }) : null, C = s ? v.displayName : I("bundle.slot", { slot: d + 1 });
1767
+ return /* @__PURE__ */ R("div", { "data-box-slot": d, className: m.boxSlot, children: [
1606
1768
  /* @__PURE__ */ l(
1607
1769
  "div",
1608
1770
  {
1609
1771
  className: [
1610
- f.boxItem,
1611
- p ? f.boxItemFilled : f.boxItemPlaceholder,
1612
- y ? f.boxItemThreshold : null,
1613
- p ? f.boxItemClickable : null
1772
+ m.boxItem,
1773
+ s ? m.boxItemFilled : m.boxItemPlaceholder,
1774
+ b ? m.boxItemThreshold : null,
1775
+ s ? m.boxItemClickable : null
1614
1776
  ].filter(Boolean).join(" "),
1615
- role: p ? "button" : void 0,
1616
- tabIndex: p ? 0 : void 0,
1617
- onClick: p ? () => Qt(s.id) : void 0,
1618
- onKeyDown: p ? (pt) => {
1619
- (pt.key === "Enter" || pt.key === " ") && (pt.preventDefault(), Qt(s.id));
1777
+ role: s ? "button" : void 0,
1778
+ tabIndex: s ? 0 : void 0,
1779
+ onClick: s ? () => qe(v.id) : void 0,
1780
+ onKeyDown: s ? (ce) => {
1781
+ (ce.key === "Enter" || ce.key === " ") && (ce.preventDefault(), qe(v.id));
1620
1782
  } : void 0,
1621
- "aria-label": g && x ? `${k}. Unlocks ${x}.` : k,
1622
- title: g && x ? `${k} • Unlocks ${x}` : k,
1623
- children: p ? (D = s.image) != null && D.url ? /* @__PURE__ */ l(
1783
+ "aria-label": w && y ? `${C}. ${I("bundle.unlocks", { discount: y })}.` : C,
1784
+ title: w && y ? `${C} • ${I("bundle.unlocks", { discount: y })}` : C,
1785
+ children: s ? (k = v.image) != null && k.url ? /* @__PURE__ */ l(
1624
1786
  "img",
1625
1787
  {
1626
- className: f.boxItemImage,
1627
- src: s.image.url,
1628
- alt: s.image.altText ?? s.displayName,
1788
+ className: m.boxItemImage,
1789
+ src: v.image.url,
1790
+ alt: v.image.altText ?? v.displayName,
1629
1791
  loading: "lazy"
1630
1792
  }
1631
- ) : /* @__PURE__ */ l("div", { className: f.boxItemFallback, "aria-hidden": "true", children: ((at = (G = (P = s.product) == null ? void 0 : P.title) == null ? void 0 : G.slice(0, 1)) == null ? void 0 : at.toUpperCase()) ?? "•" }) : g && x ? /* @__PURE__ */ l("div", { className: f.boxItemDiscountText, children: x }) : /* @__PURE__ */ l("div", { className: f.boxItemPlus, "aria-hidden": "true", children: "+" })
1793
+ ) : /* @__PURE__ */ l("div", { className: m.boxItemFallback, "aria-hidden": "true", children: ((Y = (G = (P = v.product) == null ? void 0 : P.title) == null ? void 0 : G.slice(0, 1)) == null ? void 0 : Y.toUpperCase()) ?? "•" }) : w && y ? /* @__PURE__ */ l("div", { className: m.boxItemDiscountText, children: y }) : /* @__PURE__ */ l("div", { className: m.boxItemPlus, "aria-hidden": "true", children: "+" })
1632
1794
  }
1633
1795
  ),
1634
- y ? /* @__PURE__ */ l("div", { className: f.boxThresholdLabel, children: u.label }) : null
1635
- ] }, n);
1796
+ b ? /* @__PURE__ */ l("div", { className: m.boxThresholdLabel, children: o.label }) : null
1797
+ ] }, d);
1636
1798
  }) }) }),
1637
1799
  /* @__PURE__ */ l(
1638
1800
  "div",
1639
1801
  {
1640
- className: [f.ctaTotalsWrap, Pt ? f.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1641
- "aria-hidden": !Pt,
1642
- children: /* @__PURE__ */ N("div", { className: f.ctaTotals, "aria-label": "Totals", children: [
1643
- v ? /* @__PURE__ */ N("span", { className: f.ctaDiscountBadge, children: [
1644
- v,
1645
- "% Discount"
1646
- ] }) : /* @__PURE__ */ l("span", {}),
1647
- /* @__PURE__ */ l("span", { children: v ? /* @__PURE__ */ N(xe, { children: [
1648
- /* @__PURE__ */ l("span", { className: f.ctaTotalsStrike, children: Q(st.toFixed(2)) }),
1802
+ className: [m.ctaTotalsWrap, N ? m.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1803
+ "aria-hidden": !N,
1804
+ children: /* @__PURE__ */ R("div", { className: m.ctaTotals, "aria-label": I("bundle.totals"), children: [
1805
+ Oe ? /* @__PURE__ */ l("span", { className: m.ctaDiscountBadge, children: I("bundle.discount.badge", { discount: Oe }) }) : /* @__PURE__ */ l("span", {}),
1806
+ /* @__PURE__ */ l("span", { children: Oe ? /* @__PURE__ */ R(kt, { children: [
1807
+ /* @__PURE__ */ l("span", { className: m.ctaTotalsStrike, children: A(oe.toFixed(2)) }),
1649
1808
  " ",
1650
- /* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(le.toFixed(2)) })
1651
- ] }) : /* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(st.toFixed(2)) }) })
1809
+ /* @__PURE__ */ l("span", { className: m.ctaTotalsPrice, children: A(je.toFixed(2)) })
1810
+ ] }) : /* @__PURE__ */ l("span", { className: m.ctaTotalsPrice, children: A(oe.toFixed(2)) }) })
1652
1811
  ] })
1653
1812
  }
1654
1813
  ),
1655
1814
  (() => {
1656
- const c = (d == null ? void 0 : d.ctaButtonMode) || "add_to_cart";
1657
- return c === "add_to_cart_checkout" ? rt > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: ot, disabled: !X, className: f.cta, children: i ? "Adding…" : `Add ${rt} more product${rt === 1 ? "" : "s"}` }) : /* @__PURE__ */ N("div", { className: `${f.ctaButtonGroup} ${Et ? f.ctaButtonGroupAnimating : ""}`, children: [
1815
+ const c = (u == null ? void 0 : u.ctaButtonMode) || "add_to_cart";
1816
+ return c === "add_to_cart_checkout" ? W > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: K, disabled: !z, className: m.cta, children: i ? I("bundle.cta.adding") : I("bundle.cta.add_more", { count: W, productWord: ct(H, W) }) }) : /* @__PURE__ */ R("div", { className: `${m.ctaButtonGroup} ${Be ? m.ctaButtonGroupAnimating : ""}`, children: [
1658
1817
  /* @__PURE__ */ l(
1659
1818
  "button",
1660
1819
  {
1661
1820
  type: "button",
1662
- onClick: ot,
1663
- disabled: !X,
1664
- className: `${f.ctaDualLeft} ${Et ? f.ctaDualLeftAnimating : ""}`,
1665
- children: /* @__PURE__ */ l("span", { children: i ? "Adding…" : "Add to Basket" })
1821
+ onClick: K,
1822
+ disabled: !z,
1823
+ className: `${m.ctaDualLeft} ${Be ? m.ctaDualLeftAnimating : ""}`,
1824
+ children: /* @__PURE__ */ l("span", { children: I(i ? "bundle.cta.adding" : "bundle.cta.add_to_basket") })
1666
1825
  }
1667
1826
  ),
1668
1827
  /* @__PURE__ */ l(
1669
1828
  "button",
1670
1829
  {
1671
1830
  type: "button",
1672
- onClick: J,
1673
- disabled: !X,
1674
- className: `${f.ctaDualRight} ${Et ? f.ctaDualRightAnimating : ""}`,
1675
- children: /* @__PURE__ */ l("span", { children: i ? "Processing…" : "Checkout" })
1831
+ onClick: g,
1832
+ disabled: !z,
1833
+ className: `${m.ctaDualRight} ${Be ? m.ctaDualRightAnimating : ""}`,
1834
+ children: /* @__PURE__ */ l("span", { children: I(i ? "bundle.cta.processing" : "bundle.cta.checkout") })
1676
1835
  }
1677
1836
  )
1678
- ] }) : c === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: J, disabled: !X, className: f.cta, children: i ? "Processing…" : rt > 0 ? `Add ${rt} more product${rt === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ l("button", { type: "button", onClick: ot, disabled: !X, className: f.cta, children: i ? "Adding…" : rt > 0 ? `Add ${rt} more product${rt === 1 ? "" : "s"}` : "Add to Basket" });
1837
+ ] }) : c === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: g, disabled: !z, className: m.cta, children: i ? I("bundle.cta.processing") : W > 0 ? I("bundle.cta.add_more", { count: W, productWord: ct(H, W) }) : I("bundle.cta.checkout") }) : /* @__PURE__ */ l("button", { type: "button", onClick: K, disabled: !z, className: m.cta, children: i ? I("bundle.cta.adding") : W > 0 ? I("bundle.cta.add_more", { count: W, productWord: ct(H, W) }) : I("bundle.cta.add_to_basket") });
1679
1838
  })(),
1680
- /* @__PURE__ */ N("div", { className: f.poweredBy, children: [
1681
- "powered by ",
1839
+ /* @__PURE__ */ R("div", { className: m.poweredBy, children: [
1840
+ I("bundle.powered_by"),
1841
+ " ",
1682
1842
  /* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
1683
1843
  ] })
1684
1844
  ] })
@@ -1687,433 +1847,426 @@ function di(a) {
1687
1847
  }
1688
1848
  ) : null;
1689
1849
  }
1690
- const Dr = "_panel_96rr4_2", Er = "_header_96rr4_20", qr = "_title_96rr4_24", Vr = "_status_96rr4_32", zr = "_error_96rr4_37", Wr = "_inactive_96rr4_43", jr = "_section_96rr4_49", Ur = "_sectionTitle_96rr4_54", Hr = "_rulesVisual_96rr4_107", Qr = "_rulesLabelsRow_96rr4_114", Gr = "_rulesLinesRow_96rr4_121", Yr = "_rulesLineLabelCell_96rr4_128", Kr = "_rulesLineLabel_96rr4_128", Xr = "_rulesLine_96rr4_121", Jr = "_rulesLineEmpty_96rr4_162", Zr = "_rulesLineFilled_96rr4_166", ta = "_variants_96rr4_170", ea = "_variantList_96rr4_178", na = "_variantRow_96rr4_186", ra = "_variantRowInteractive_96rr4_198", aa = "_variantRowSelected_96rr4_202", ia = "_variantRowSoldOut_96rr4_207", oa = "_variantMedia_96rr4_211", sa = "_variantContent_96rr4_219", la = "_variantHeader_96rr4_227", ca = "_variantTitle_96rr4_233", ua = "_variantImage_96rr4_247", da = "_variantImageFallback_96rr4_255", ha = "_variantMeta_96rr4_268", ma = "_variantPrice_96rr4_273", fa = "_variantFooterRow_96rr4_279", ba = "_variantActions_96rr4_286", pa = "_qtyActions_96rr4_292", _a = "_qtyActionsWrap_96rr4_298", ya = "_soldOut_96rr4_349", ga = "_stockLimitNotice_96rr4_357", wa = "_qtyChip_96rr4_366", va = "_qtyChipInteractive_96rr4_381", xa = "_qtyChipValue_96rr4_385", Ca = "_qtyChipPlus_96rr4_391", Ia = "_qtyChipClear_96rr4_396", Na = "_qtyTrash_96rr4_425", Sa = "_footer_96rr4_437", Ba = "_boxSummaryWindow_96rr4_442", Ta = "_boxSummaryRow_96rr4_456", ka = "_boxSlot_96rr4_464", Ra = "_boxItem_96rr4_473", Ma = "_boxItemFilled_96rr4_490", La = "_boxItemPlaceholder_96rr4_496", Pa = "_boxItemThreshold_96rr4_502", Fa = "_boxItemClickable_96rr4_510", Oa = "_boxItemImage_96rr4_519", Aa = "_boxItemFallback_96rr4_530", $a = "_boxItemPlus_96rr4_543", Da = "_boxItemDiscountText_96rr4_555", Ea = "_boxThresholdLabel_96rr4_568", qa = "_totalsReveal_96rr4_579", Va = "_totalsRevealOpen_96rr4_587", za = "_ctaTotalsWrap_96rr4_592", Wa = "_ctaTotalsWrapVisible_96rr4_597", ja = "_ctaTotals_96rr4_592", Ua = "_ctaDiscountBadge_96rr4_612", Ha = "_ctaTotalsStrike_96rr4_623", Qa = "_ctaTotalsPrice_96rr4_629", Ga = "_cta_96rr4_592", Ya = "_ctaButtonGroup_96rr4_661", Ka = "_ctaDualLeft_96rr4_667", Xa = "_ctaDualRight_96rr4_668", Ja = "_poweredBy_96rr4_695", b = {
1691
- panel: Dr,
1692
- header: Er,
1693
- title: qr,
1694
- status: Vr,
1695
- error: zr,
1696
- inactive: Wr,
1697
- section: jr,
1698
- sectionTitle: Ur,
1699
- rulesVisual: Hr,
1700
- rulesLabelsRow: Qr,
1701
- rulesLinesRow: Gr,
1702
- rulesLineLabelCell: Yr,
1703
- rulesLineLabel: Kr,
1704
- rulesLine: Xr,
1705
- rulesLineEmpty: Jr,
1706
- rulesLineFilled: Zr,
1707
- variants: ta,
1708
- variantList: ea,
1709
- variantRow: na,
1710
- variantRowInteractive: ra,
1711
- variantRowSelected: aa,
1712
- variantRowSoldOut: ia,
1713
- variantMedia: oa,
1714
- variantContent: sa,
1715
- variantHeader: la,
1716
- variantTitle: ca,
1717
- variantImage: ua,
1718
- variantImageFallback: da,
1719
- variantMeta: ha,
1720
- variantPrice: ma,
1721
- variantFooterRow: fa,
1722
- variantActions: ba,
1723
- qtyActions: pa,
1724
- qtyActionsWrap: _a,
1725
- soldOut: ya,
1726
- stockLimitNotice: ga,
1727
- qtyChip: wa,
1728
- qtyChipInteractive: va,
1729
- qtyChipValue: xa,
1730
- qtyChipPlus: Ca,
1731
- qtyChipClear: Ia,
1732
- qtyTrash: Na,
1733
- footer: Sa,
1734
- boxSummaryWindow: Ba,
1735
- boxSummaryRow: Ta,
1736
- boxSlot: ka,
1737
- boxItem: Ra,
1738
- boxItemFilled: Ma,
1739
- boxItemPlaceholder: La,
1740
- boxItemThreshold: Pa,
1741
- boxItemClickable: Fa,
1742
- boxItemImage: Oa,
1743
- boxItemFallback: Aa,
1744
- boxItemPlus: $a,
1745
- boxItemDiscountText: Da,
1746
- boxThresholdLabel: Ea,
1747
- totalsReveal: qa,
1748
- totalsRevealOpen: Va,
1749
- ctaTotalsWrap: za,
1750
- ctaTotalsWrapVisible: Wa,
1751
- ctaTotals: ja,
1752
- ctaDiscountBadge: Ua,
1753
- ctaTotalsStrike: Ha,
1754
- ctaTotalsPrice: Qa,
1755
- cta: Ga,
1756
- ctaButtonGroup: Ya,
1757
- ctaDualLeft: Ka,
1758
- ctaDualRight: Xa,
1759
- poweredBy: Ja
1850
+ const Xr = "_panel_96rr4_2", Zr = "_header_96rr4_20", Jr = "_title_96rr4_24", ea = "_status_96rr4_32", ta = "_error_96rr4_37", na = "_inactive_96rr4_43", ra = "_section_96rr4_49", aa = "_sectionTitle_96rr4_54", ia = "_rulesVisual_96rr4_107", oa = "_rulesLabelsRow_96rr4_114", sa = "_rulesLinesRow_96rr4_121", la = "_rulesLineLabelCell_96rr4_128", ca = "_rulesLineLabel_96rr4_128", ua = "_rulesLine_96rr4_121", da = "_rulesLineEmpty_96rr4_162", ha = "_rulesLineFilled_96rr4_166", ma = "_variants_96rr4_170", ba = "_variantList_96rr4_178", fa = "_variantRow_96rr4_186", _a = "_variantRowInteractive_96rr4_198", pa = "_variantRowSelected_96rr4_202", ya = "_variantRowSoldOut_96rr4_207", ga = "_variantMedia_96rr4_211", va = "_variantContent_96rr4_219", wa = "_variantHeader_96rr4_227", xa = "_variantTitle_96rr4_233", Ca = "_variantImage_96rr4_247", Ia = "_variantImageFallback_96rr4_255", Na = "_variantMeta_96rr4_268", Sa = "_variantPrice_96rr4_273", Ba = "_variantFooterRow_96rr4_279", ka = "_variantActions_96rr4_286", Ta = "_qtyActions_96rr4_292", Ra = "_qtyActionsWrap_96rr4_298", La = "_soldOut_96rr4_349", Ma = "_stockLimitNotice_96rr4_357", Pa = "_qtyChip_96rr4_366", Fa = "_qtyChipInteractive_96rr4_381", Oa = "_qtyChipValue_96rr4_385", Aa = "_qtyChipPlus_96rr4_391", Da = "_qtyChipClear_96rr4_396", Ea = "_qtyTrash_96rr4_425", qa = "_footer_96rr4_437", $a = "_boxSummaryWindow_96rr4_442", Va = "_boxSummaryRow_96rr4_456", Wa = "_boxSlot_96rr4_464", za = "_boxItem_96rr4_473", ja = "_boxItemFilled_96rr4_490", Ua = "_boxItemPlaceholder_96rr4_496", Ha = "_boxItemThreshold_96rr4_502", Qa = "_boxItemClickable_96rr4_510", Ga = "_boxItemImage_96rr4_519", Ya = "_boxItemFallback_96rr4_530", Ka = "_boxItemPlus_96rr4_543", Xa = "_boxItemDiscountText_96rr4_555", Za = "_boxThresholdLabel_96rr4_568", Ja = "_totalsReveal_96rr4_579", ei = "_totalsRevealOpen_96rr4_587", ti = "_ctaTotalsWrap_96rr4_592", ni = "_ctaTotalsWrapVisible_96rr4_597", ri = "_ctaTotals_96rr4_592", ai = "_ctaDiscountBadge_96rr4_612", ii = "_ctaTotalsStrike_96rr4_623", oi = "_ctaTotalsPrice_96rr4_629", si = "_cta_96rr4_592", li = "_ctaButtonGroup_96rr4_661", ci = "_ctaDualLeft_96rr4_667", ui = "_ctaDualRight_96rr4_668", di = "_poweredBy_96rr4_695", _ = {
1851
+ panel: Xr,
1852
+ header: Zr,
1853
+ title: Jr,
1854
+ status: ea,
1855
+ error: ta,
1856
+ inactive: na,
1857
+ section: ra,
1858
+ sectionTitle: aa,
1859
+ rulesVisual: ia,
1860
+ rulesLabelsRow: oa,
1861
+ rulesLinesRow: sa,
1862
+ rulesLineLabelCell: la,
1863
+ rulesLineLabel: ca,
1864
+ rulesLine: ua,
1865
+ rulesLineEmpty: da,
1866
+ rulesLineFilled: ha,
1867
+ variants: ma,
1868
+ variantList: ba,
1869
+ variantRow: fa,
1870
+ variantRowInteractive: _a,
1871
+ variantRowSelected: pa,
1872
+ variantRowSoldOut: ya,
1873
+ variantMedia: ga,
1874
+ variantContent: va,
1875
+ variantHeader: wa,
1876
+ variantTitle: xa,
1877
+ variantImage: Ca,
1878
+ variantImageFallback: Ia,
1879
+ variantMeta: Na,
1880
+ variantPrice: Sa,
1881
+ variantFooterRow: Ba,
1882
+ variantActions: ka,
1883
+ qtyActions: Ta,
1884
+ qtyActionsWrap: Ra,
1885
+ soldOut: La,
1886
+ stockLimitNotice: Ma,
1887
+ qtyChip: Pa,
1888
+ qtyChipInteractive: Fa,
1889
+ qtyChipValue: Oa,
1890
+ qtyChipPlus: Aa,
1891
+ qtyChipClear: Da,
1892
+ qtyTrash: Ea,
1893
+ footer: qa,
1894
+ boxSummaryWindow: $a,
1895
+ boxSummaryRow: Va,
1896
+ boxSlot: Wa,
1897
+ boxItem: za,
1898
+ boxItemFilled: ja,
1899
+ boxItemPlaceholder: Ua,
1900
+ boxItemThreshold: Ha,
1901
+ boxItemClickable: Qa,
1902
+ boxItemImage: Ga,
1903
+ boxItemFallback: Ya,
1904
+ boxItemPlus: Ka,
1905
+ boxItemDiscountText: Xa,
1906
+ boxThresholdLabel: Za,
1907
+ totalsReveal: Ja,
1908
+ totalsRevealOpen: ei,
1909
+ ctaTotalsWrap: ti,
1910
+ ctaTotalsWrapVisible: ni,
1911
+ ctaTotals: ri,
1912
+ ctaDiscountBadge: ai,
1913
+ ctaTotalsStrike: ii,
1914
+ ctaTotalsPrice: oi,
1915
+ cta: si,
1916
+ ctaButtonGroup: li,
1917
+ ctaDualLeft: ci,
1918
+ ctaDualRight: ui,
1919
+ poweredBy: di
1760
1920
  };
1761
- function hi(a) {
1762
- var ft;
1921
+ function Ni(n) {
1922
+ var ve;
1763
1923
  const {
1764
- loading: t,
1765
- submitting: e,
1766
- error: o,
1924
+ loading: e,
1925
+ submitting: t,
1926
+ error: a,
1767
1927
  currencyCode: i,
1768
1928
  config: r,
1769
- eligibleVariants: m,
1770
- selections: d,
1771
- selectionOrder: S,
1772
- getVariantMaxSelectableQuantity: ct,
1773
- setQuantity: A,
1774
- bundleSize: O,
1775
- minRequired: et,
1776
- canSubmit: C,
1777
- submit: Y,
1778
- submitAndCheckout: X
1779
- } = be(), {
1780
- className: ot,
1781
- showRules: J = !0,
1782
- showVariants: z = !0
1783
- } = a, yt = (h) => {
1784
- const _ = Number.parseFloat(h);
1785
- return Number.isFinite(_) ? String(Math.round(_)) : h;
1786
- }, Z = (h) => {
1787
- const _ = (h ?? []).filter((w) => {
1788
- var E, $;
1789
- const B = (E = w == null ? void 0 : w.name) == null ? void 0 : E.trim(), R = ($ = w == null ? void 0 : w.value) == null ? void 0 : $.trim();
1790
- return !(!B || !R || B.toLowerCase() === "title");
1929
+ eligibleVariants: h,
1930
+ selections: u,
1931
+ selectionOrder: B,
1932
+ getVariantMaxSelectableQuantity: le,
1933
+ setQuantity: $,
1934
+ bundleSize: D,
1935
+ minRequired: de,
1936
+ canSubmit: F,
1937
+ submit: te,
1938
+ submitAndCheckout: z,
1939
+ locale: K,
1940
+ t: g
1941
+ } = wt(), {
1942
+ className: H,
1943
+ showRules: I = !0,
1944
+ showVariants: he = !0
1945
+ } = n, ke = (f) => {
1946
+ const p = Number.parseFloat(f);
1947
+ return Number.isFinite(p) ? String(Math.round(p)) : f;
1948
+ }, Te = (f) => {
1949
+ const p = (f ?? []).filter((x) => {
1950
+ var E, V;
1951
+ const T = (E = x == null ? void 0 : x.name) == null ? void 0 : E.trim(), M = (V = x == null ? void 0 : x.value) == null ? void 0 : V.trim();
1952
+ return !(!T || !M || T.toLowerCase() === "title");
1791
1953
  });
1792
- return _.length ? _.map((w) => `${w.name}: ${w.value}`).join(" • ") : null;
1793
- }, gt = (h) => {
1794
- const _ = Number(h);
1795
- if (!Number.isFinite(_)) return h;
1796
- if (i)
1797
- try {
1798
- return new Intl.NumberFormat(void 0, { style: "currency", currency: i }).format(_);
1799
- } catch {
1800
- }
1801
- return `$${_.toFixed(2)}`;
1802
- }, $t = T(() => [...m].sort((h, _) => h.displayName.localeCompare(_.displayName)), [m]), j = T(() => [...(r == null ? void 0 : r.rules) ?? []].sort((h, _) => h.minBundleSize - _.minBundleSize), [r == null ? void 0 : r.rules]), ut = T(() => Math.max(0, et - O), [O, et]), U = T(() => {
1803
- let h = null;
1804
- for (const _ of j)
1805
- O >= _.minBundleSize && (h = _);
1806
- return h;
1807
- }, [O, j]), dt = T(() => {
1808
- if (!U) return null;
1809
- const h = Number.parseFloat(U.discountPercent);
1810
- return !Number.isFinite(h) || h <= 0 ? null : h;
1811
- }, [U]), Tt = j[0], It = !!(Tt && O >= Tt.minBundleSize), ht = T(() => {
1812
- const h = new Map(m.map((w) => [w.id, w]));
1813
- let _ = 0;
1814
- for (const [w, B] of Object.entries(d)) {
1815
- const R = B ?? 0;
1816
- if (R <= 0) continue;
1817
- const E = h.get(w), $ = Number(E == null ? void 0 : E.price);
1818
- Number.isFinite($) && (_ += $ * R);
1954
+ return p.length ? p.map((x) => `${x.name}: ${x.value}`).join(" • ") : null;
1955
+ }, ye = (f) => {
1956
+ const p = Number(f);
1957
+ return Number.isFinite(p) ? jt(p, i, K) : f;
1958
+ }, ae = L(() => [...h].sort((f, p) => f.displayName.localeCompare(p.displayName)), [h]), X = L(() => [...(r == null ? void 0 : r.rules) ?? []].sort((f, p) => f.minBundleSize - p.minBundleSize), [r == null ? void 0 : r.rules]), ie = L(() => Math.max(0, de - D), [D, de]), me = L(() => {
1959
+ let f = null;
1960
+ for (const p of X)
1961
+ D >= p.minBundleSize && (f = p);
1962
+ return f;
1963
+ }, [D, X]), Re = L(() => {
1964
+ if (!me) return null;
1965
+ const f = Number.parseFloat(me.discountPercent);
1966
+ return !Number.isFinite(f) || f <= 0 ? null : f;
1967
+ }, [me]), ne = X[0], Ce = !!(ne && D >= ne.minBundleSize), be = L(() => {
1968
+ const f = new Map(h.map((x) => [x.id, x]));
1969
+ let p = 0;
1970
+ for (const [x, T] of Object.entries(u)) {
1971
+ const M = T ?? 0;
1972
+ if (M <= 0) continue;
1973
+ const E = f.get(x), V = Number(E == null ? void 0 : E.price);
1974
+ Number.isFinite(V) && (p += V * M);
1819
1975
  }
1820
- return Math.round(_ * 100) / 100;
1821
- }, [m, d]), zt = T(() => {
1822
- if (!dt) return ht;
1823
- const h = ht * (1 - dt / 100);
1824
- return Math.round(h * 100) / 100;
1825
- }, [dt, ht]), kt = T(() => j.length ? Math.max(...j.map((h) => h.minBundleSize)) : 0, [j]), Ct = T(() => {
1826
- const h = new Map(m.map((_) => [_.id, _]));
1827
- return S.map((_) => h.get(_)).filter((_) => !!_);
1828
- }, [m, S]), Nt = T(() => {
1829
- var _;
1830
- const h = /* @__PURE__ */ new Map();
1831
- for (const w of j) {
1832
- const B = Math.max(0, w.minBundleSize - 1);
1833
- h.set(B, {
1834
- discountPercent: w.discountPercent,
1835
- minBundleSize: w.minBundleSize,
1836
- label: ((_ = w.label) == null ? void 0 : _.trim()) || `Buy ${w.minBundleSize}+`
1976
+ return Math.round(p * 100) / 100;
1977
+ }, [h, u]), Ve = L(() => {
1978
+ if (!Re) return be;
1979
+ const f = be * (1 - Re / 100);
1980
+ return Math.round(f * 100) / 100;
1981
+ }, [Re, be]), ge = L(() => X.length ? Math.max(...X.map((f) => f.minBundleSize)) : 0, [X]), Le = L(() => {
1982
+ const f = new Map(h.map((p) => [p.id, p]));
1983
+ return B.map((p) => f.get(p)).filter((p) => !!p);
1984
+ }, [h, B]), Ie = L(() => {
1985
+ var p;
1986
+ const f = /* @__PURE__ */ new Map();
1987
+ for (const x of X) {
1988
+ const T = Math.max(0, x.minBundleSize - 1);
1989
+ f.set(T, {
1990
+ discountPercent: x.discountPercent,
1991
+ minBundleSize: x.minBundleSize,
1992
+ label: ((p = x.label) == null ? void 0 : p.trim()) || `Buy ${x.minBundleSize}+`
1837
1993
  });
1838
1994
  }
1839
- return h;
1840
- }, [j]), Dt = T(() => {
1841
- const h = Number((r == null ? void 0 : r.maxBundleSize) ?? NaN), _ = Number.isFinite(h) ? Math.floor(h) : 100;
1842
- return Math.max(2, Math.min(100, _));
1843
- }, [r == null ? void 0 : r.maxBundleSize]), Rt = ((ft = r == null ? void 0 : r.title) == null ? void 0 : ft.trim()) || "Build your bundle", Wt = T(() => Math.max(kt || et, Ct.length), [Ct.length, kt, et]), Xt = O >= Dt, wt = V(null), jt = V(null), Mt = V(O);
1844
- F(() => {
1845
- const h = Mt.current;
1846
- if (Mt.current = O, O <= h) return;
1847
- const _ = jt.current;
1848
- if (!_) return;
1849
- const w = j.some(($) => $.minBundleSize === O), B = j.find(($) => $.minBundleSize > O), R = B && w ? B.minBundleSize - 1 : B ? null : O - 1;
1850
- if (R == null || R < 0) return;
1995
+ return f;
1996
+ }, [X]), Ae = L(() => {
1997
+ const f = Number((r == null ? void 0 : r.maxBundleSize) ?? NaN), p = Number.isFinite(f) ? Math.floor(f) : 100;
1998
+ return Math.max(2, Math.min(100, p));
1999
+ }, [r == null ? void 0 : r.maxBundleSize]), nt = ((ve = r == null ? void 0 : r.title) == null ? void 0 : ve.trim()) || g("bundle.title.default"), We = L(() => Math.max(ge || de, Le.length), [Le.length, ge, de]), ze = D >= Ae, Me = U(null), Ye = U(null), Ne = U(D);
2000
+ O(() => {
2001
+ const f = Ne.current;
2002
+ if (Ne.current = D, D <= f) return;
2003
+ const p = Ye.current;
2004
+ if (!p) return;
2005
+ const x = X.some((V) => V.minBundleSize === D), T = X.find((V) => V.minBundleSize > D), M = T && x ? T.minBundleSize - 1 : T ? null : D - 1;
2006
+ if (M == null || M < 0) return;
1851
2007
  const E = requestAnimationFrame(() => {
1852
- const $ = _.querySelector(`[data-box-slot="${R}"]`);
1853
- if (!$) return;
1854
- const H = _.getBoundingClientRect(), W = $.getBoundingClientRect().right - H.right;
1855
- if (W <= 1) return;
1856
- const Q = Math.max(0, _.scrollWidth - _.clientWidth), L = Math.min(Q, Math.max(0, _.scrollLeft + W));
1857
- _.scrollTo({ left: L, behavior: "smooth" });
2008
+ const V = p.querySelector(`[data-box-slot="${M}"]`);
2009
+ if (!V) return;
2010
+ const Z = p.getBoundingClientRect(), Q = V.getBoundingClientRect().right - Z.right;
2011
+ if (Q <= 1) return;
2012
+ const A = Math.max(0, p.scrollWidth - p.clientWidth), q = Math.min(A, Math.max(0, p.scrollLeft + Q));
2013
+ p.scrollTo({ left: q, behavior: "smooth" });
1858
2014
  });
1859
2015
  return () => cancelAnimationFrame(E);
1860
- }, [O, j]);
1861
- const Lt = (h) => {
1862
- const _ = wt.current;
1863
- if (!_) return;
1864
- const w = _.querySelector(`[data-variant-row="${h}"]`);
1865
- w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
2016
+ }, [D, X]);
2017
+ const De = (f) => {
2018
+ const p = Me.current;
2019
+ if (!p) return;
2020
+ const x = p.querySelector(`[data-variant-row="${f}"]`);
2021
+ x && x.scrollIntoView({ behavior: "smooth", block: "nearest" });
1866
2022
  };
1867
- return /* @__PURE__ */ N("section", { className: [b.panel, ot].filter(Boolean).join(" "), "aria-busy": t, children: [
1868
- /* @__PURE__ */ l("header", { className: b.header, children: /* @__PURE__ */ l("h2", { className: b.title, children: Rt }) }),
1869
- t ? /* @__PURE__ */ l("div", { className: b.status, children: "Loading…" }) : null,
1870
- o ? /* @__PURE__ */ l("div", { className: b.error, children: o }) : null,
1871
- !t && r && !r.isActive ? /* @__PURE__ */ l("div", { className: b.inactive, children: "Bundles are not active." }) : null,
1872
- J && j.length ? /* @__PURE__ */ l("div", { className: b.section, children: /* @__PURE__ */ N("div", { className: b.rulesVisual, children: [
1873
- /* @__PURE__ */ l("div", { className: b.rulesLabelsRow, children: Array.from({ length: kt }).map((h, _) => {
1874
- const w = _ + 1, B = j.find((E) => E.minBundleSize === w), R = B ? `${yt(B.discountPercent)}% off` : null;
1875
- return /* @__PURE__ */ l("div", { className: b.rulesLineLabelCell, children: R ? /* @__PURE__ */ l("span", { className: b.rulesLineLabel, children: R }) : null }, w);
2023
+ return /* @__PURE__ */ R("section", { className: [_.panel, H].filter(Boolean).join(" "), "aria-busy": e, children: [
2024
+ /* @__PURE__ */ l("header", { className: _.header, children: /* @__PURE__ */ l("h2", { className: _.title, children: nt }) }),
2025
+ e ? /* @__PURE__ */ l("div", { className: _.status, children: g("bundle.loading") }) : null,
2026
+ a ? /* @__PURE__ */ l("div", { className: _.error, children: a }) : null,
2027
+ !e && r && !r.isActive ? /* @__PURE__ */ l("div", { className: _.inactive, children: g("bundle.inactive") }) : null,
2028
+ I && X.length ? /* @__PURE__ */ l("div", { className: _.section, children: /* @__PURE__ */ R("div", { className: _.rulesVisual, children: [
2029
+ /* @__PURE__ */ l("div", { className: _.rulesLabelsRow, children: Array.from({ length: ge }).map((f, p) => {
2030
+ const x = p + 1, T = X.find((E) => E.minBundleSize === x), M = T ? g("bundle.discount.off_label", { discount: ke(T.discountPercent) }) : null;
2031
+ return /* @__PURE__ */ l("div", { className: _.rulesLineLabelCell, children: M ? /* @__PURE__ */ l("span", { className: _.rulesLineLabel, children: M }) : null }, x);
1876
2032
  }) }),
1877
- /* @__PURE__ */ l("div", { className: b.rulesLinesRow, children: Array.from({ length: kt }).map((h, _) => {
1878
- const w = _ + 1, B = O >= w;
2033
+ /* @__PURE__ */ l("div", { className: _.rulesLinesRow, children: Array.from({ length: ge }).map((f, p) => {
2034
+ const x = p + 1, T = D >= x;
1879
2035
  return /* @__PURE__ */ l(
1880
2036
  "div",
1881
2037
  {
1882
2038
  className: [
1883
- b.rulesLine,
1884
- B ? b.rulesLineFilled : b.rulesLineEmpty
2039
+ _.rulesLine,
2040
+ T ? _.rulesLineFilled : _.rulesLineEmpty
1885
2041
  ].filter(Boolean).join(" ")
1886
2042
  },
1887
- w
2043
+ x
1888
2044
  );
1889
2045
  }) })
1890
2046
  ] }) }) : null,
1891
- z ? /* @__PURE__ */ N("div", { className: b.section, ref: wt, children: [
1892
- /* @__PURE__ */ l("div", { className: b.sectionTitle, children: "Select items" }),
1893
- /* @__PURE__ */ l("div", { className: b.variants, children: /* @__PURE__ */ l("ul", { className: b.variantList, children: $t.map((h) => {
1894
- var Q;
1895
- const _ = d[h.id] ?? 0, w = Z(h.selectedOptions), B = h.availableForSale === !1, R = ct(h.id), E = R ?? Number.POSITIVE_INFINITY, $ = _ >= E, H = !B && !Xt && !$, M = H, W = !B && $ ? "Max Reached" : null;
1896
- return /* @__PURE__ */ N(
2047
+ he ? /* @__PURE__ */ R("div", { className: _.section, ref: Me, children: [
2048
+ /* @__PURE__ */ l("div", { className: _.sectionTitle, children: g("bundle.select.items") }),
2049
+ /* @__PURE__ */ l("div", { className: _.variants, children: /* @__PURE__ */ l("ul", { className: _.variantList, children: ae.map((f) => {
2050
+ var A;
2051
+ const p = u[f.id] ?? 0, x = Te(f.selectedOptions), T = f.availableForSale === !1, M = le(f.id), E = M ?? Number.POSITIVE_INFINITY, V = p >= E, Z = !T && !ze && !V, ee = Z, Q = !T && V ? g("bundle.stock.max_reached") : null;
2052
+ return /* @__PURE__ */ R(
1897
2053
  "li",
1898
2054
  {
1899
2055
  className: [
1900
- b.variantRow,
1901
- M ? b.variantRowInteractive : null,
1902
- _ > 0 ? b.variantRowSelected : null,
1903
- B ? b.variantRowSoldOut : null
2056
+ _.variantRow,
2057
+ ee ? _.variantRowInteractive : null,
2058
+ p > 0 ? _.variantRowSelected : null,
2059
+ T ? _.variantRowSoldOut : null
1904
2060
  ].filter(Boolean).join(" "),
1905
- "data-variant-row": h.id,
1906
- role: M ? "button" : void 0,
1907
- tabIndex: M ? 0 : void 0,
1908
- onClick: M ? () => {
1909
- A(h.id, _ + 1);
2061
+ "data-variant-row": f.id,
2062
+ role: ee ? "button" : void 0,
2063
+ tabIndex: ee ? 0 : void 0,
2064
+ onClick: ee ? () => {
2065
+ $(f.id, p + 1);
1910
2066
  } : void 0,
1911
- onKeyDown: M ? (L) => {
1912
- (L.key === "Enter" || L.key === " ") && (L.preventDefault(), A(h.id, _ + 1), Lt(h.id));
2067
+ onKeyDown: ee ? (q) => {
2068
+ (q.key === "Enter" || q.key === " ") && (q.preventDefault(), $(f.id, p + 1), De(f.id));
1913
2069
  } : void 0,
1914
- "aria-label": B ? `${h.displayName} is sold out` : W ? `${h.displayName} ${W.toLowerCase()}` : `Add ${h.displayName} to bundle`,
2070
+ "aria-label": T ? g("bundle.a11y.sold_out", { name: f.displayName }) : Q ? `${f.displayName} ${Q.toLowerCase()}` : g("bundle.a11y.add_to_bundle", { name: f.displayName }),
1915
2071
  children: [
1916
- /* @__PURE__ */ l("div", { className: b.variantMedia, children: (Q = h.image) != null && Q.url ? /* @__PURE__ */ l(
2072
+ /* @__PURE__ */ l("div", { className: _.variantMedia, children: (A = f.image) != null && A.url ? /* @__PURE__ */ l(
1917
2073
  "img",
1918
2074
  {
1919
- src: h.image.url,
1920
- alt: h.image.altText ?? h.displayName,
1921
- width: h.image.width ?? 64,
1922
- height: h.image.height ?? 64,
1923
- className: b.variantImage,
2075
+ src: f.image.url,
2076
+ alt: f.image.altText ?? f.displayName,
2077
+ width: f.image.width ?? 64,
2078
+ height: f.image.height ?? 64,
2079
+ className: _.variantImage,
1924
2080
  loading: "lazy"
1925
2081
  }
1926
- ) : /* @__PURE__ */ l("div", { className: b.variantImageFallback, children: "Item" }) }),
1927
- /* @__PURE__ */ N("div", { className: b.variantContent, children: [
1928
- /* @__PURE__ */ N("div", { className: b.variantHeader, children: [
1929
- /* @__PURE__ */ l("div", { className: b.variantTitle, children: h.displayName }),
1930
- w ? /* @__PURE__ */ l("div", { className: b.variantMeta, children: w }) : null
2082
+ ) : /* @__PURE__ */ l("div", { className: _.variantImageFallback, children: g("bundle.item.generic") }) }),
2083
+ /* @__PURE__ */ R("div", { className: _.variantContent, children: [
2084
+ /* @__PURE__ */ R("div", { className: _.variantHeader, children: [
2085
+ /* @__PURE__ */ l("div", { className: _.variantTitle, children: f.displayName }),
2086
+ x ? /* @__PURE__ */ l("div", { className: _.variantMeta, children: x }) : null
1931
2087
  ] }),
1932
- /* @__PURE__ */ N("div", { className: b.variantFooterRow, children: [
1933
- /* @__PURE__ */ l("div", { className: b.variantPrice, children: gt(h.price) }),
1934
- /* @__PURE__ */ l("div", { className: b.variantActions, children: B ? /* @__PURE__ */ l("div", { className: b.soldOut, "aria-label": `${h.displayName} is sold out`, children: "Sold Out" }) : _ <= 0 && E <= 0 ? /* @__PURE__ */ l("div", { className: b.stockLimitNotice, "aria-label": `${h.displayName} max available selected`, children: "Max Added To Cart" }) : /* @__PURE__ */ N("div", { className: b.qtyActionsWrap, children: [
1935
- /* @__PURE__ */ N("div", { className: b.qtyActions, children: [
1936
- _ > 0 ? /* @__PURE__ */ l(
2088
+ /* @__PURE__ */ R("div", { className: _.variantFooterRow, children: [
2089
+ /* @__PURE__ */ l("div", { className: _.variantPrice, children: ye(f.price) }),
2090
+ /* @__PURE__ */ l("div", { className: _.variantActions, children: T ? /* @__PURE__ */ l("div", { className: _.soldOut, "aria-label": g("bundle.a11y.sold_out", { name: f.displayName }), children: g("bundle.stock.sold_out") }) : p <= 0 && E <= 0 ? /* @__PURE__ */ l("div", { className: _.stockLimitNotice, "aria-label": g("bundle.a11y.max_available_selected", { name: f.displayName }), children: g("bundle.stock.max_added") }) : /* @__PURE__ */ R("div", { className: _.qtyActionsWrap, children: [
2091
+ /* @__PURE__ */ R("div", { className: _.qtyActions, children: [
2092
+ p > 0 ? /* @__PURE__ */ l(
1937
2093
  "button",
1938
2094
  {
1939
2095
  type: "button",
1940
- className: b.qtyTrash,
1941
- "aria-label": `Remove ${h.displayName} from bundle`,
1942
- onClick: (L) => {
1943
- L.stopPropagation(), A(h.id, 0);
2096
+ className: _.qtyTrash,
2097
+ "aria-label": g("bundle.a11y.remove_from_bundle", { name: f.displayName }),
2098
+ onClick: (q) => {
2099
+ q.stopPropagation(), $(f.id, 0);
1944
2100
  },
1945
- onKeyDown: (L) => {
1946
- L.stopPropagation();
2101
+ onKeyDown: (q) => {
2102
+ q.stopPropagation();
1947
2103
  },
1948
- children: /* @__PURE__ */ l(yn, { size: 14 })
2104
+ children: /* @__PURE__ */ l(Ln, { size: 14 })
1949
2105
  }
1950
2106
  ) : null,
1951
2107
  /* @__PURE__ */ l(
1952
2108
  "div",
1953
2109
  {
1954
- className: [b.qtyChip, H ? b.qtyChipInteractive : null].filter(Boolean).join(" "),
1955
- "aria-label": `${h.displayName} quantity ${_}`,
1956
- onClick: H ? (L) => {
1957
- L.stopPropagation(), A(h.id, _ + 1);
2110
+ className: [_.qtyChip, Z ? _.qtyChipInteractive : null].filter(Boolean).join(" "),
2111
+ "aria-label": g("bundle.a11y.quantity", { name: f.displayName, qty: p }),
2112
+ onClick: Z ? (q) => {
2113
+ q.stopPropagation(), $(f.id, p + 1);
1958
2114
  } : void 0,
1959
- onKeyDown: (L) => {
1960
- L.stopPropagation();
2115
+ onKeyDown: (q) => {
2116
+ q.stopPropagation();
1961
2117
  },
1962
- role: H ? "button" : void 0,
1963
- tabIndex: H ? 0 : void 0,
1964
- children: _ <= 0 ? /* @__PURE__ */ l("span", { className: b.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ l(Oe, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ N(xe, { children: [
1965
- /* @__PURE__ */ l("span", { className: b.qtyChipValue, children: _ }),
2118
+ role: Z ? "button" : void 0,
2119
+ tabIndex: Z ? 0 : void 0,
2120
+ children: p <= 0 ? /* @__PURE__ */ l("span", { className: _.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ l(Vt, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ R(kt, { children: [
2121
+ /* @__PURE__ */ l("span", { className: _.qtyChipValue, children: p }),
1966
2122
  /* @__PURE__ */ l(
1967
2123
  "button",
1968
2124
  {
1969
2125
  type: "button",
1970
- className: b.qtyChipClear,
1971
- "aria-label": `Add ${h.displayName}`,
1972
- onClick: (L) => {
1973
- L.stopPropagation(), A(h.id, _ + 1);
2126
+ className: _.qtyChipClear,
2127
+ "aria-label": g("bundle.a11y.increase", { name: f.displayName }),
2128
+ onClick: (q) => {
2129
+ q.stopPropagation(), $(f.id, p + 1);
1974
2130
  },
1975
- onKeyDown: (L) => {
1976
- L.stopPropagation();
2131
+ onKeyDown: (q) => {
2132
+ q.stopPropagation();
1977
2133
  },
1978
- disabled: !H,
1979
- children: /* @__PURE__ */ l(Oe, { size: 12, strokeWidth: 2 })
2134
+ disabled: !Z,
2135
+ children: /* @__PURE__ */ l(Vt, { size: 12, strokeWidth: 2 })
1980
2136
  }
1981
2137
  )
1982
2138
  ] })
1983
2139
  }
1984
2140
  )
1985
2141
  ] }),
1986
- W ? /* @__PURE__ */ l("div", { className: b.stockLimitNotice, children: W }) : null
2142
+ Q ? /* @__PURE__ */ l("div", { className: _.stockLimitNotice, children: Q }) : null
1987
2143
  ] }) })
1988
2144
  ] })
1989
2145
  ] })
1990
2146
  ]
1991
2147
  },
1992
- h.id
2148
+ f.id
1993
2149
  );
1994
2150
  }) }) })
1995
2151
  ] }) : null,
1996
- /* @__PURE__ */ N("footer", { className: b.footer, children: [
1997
- /* @__PURE__ */ l("div", { className: b.boxSummaryWindow, ref: jt, children: /* @__PURE__ */ l("div", { className: b.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Wt }).map((h, _) => {
1998
- var W, Q, L, Ut;
1999
- const w = Ct[_], B = Nt.get(_), R = !!w, E = !!B, $ = E && !R, H = B ? `${B.discountPercent}% off` : null, M = R ? w.displayName : `Slot ${_ + 1}`;
2000
- return /* @__PURE__ */ N("div", { "data-box-slot": _, className: b.boxSlot, children: [
2152
+ /* @__PURE__ */ R("footer", { className: _.footer, children: [
2153
+ /* @__PURE__ */ l("div", { className: _.boxSummaryWindow, ref: Ye, children: /* @__PURE__ */ l("div", { className: _.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: We }).map((f, p) => {
2154
+ var Q, A, q, Se;
2155
+ const x = Le[p], T = Ie.get(p), M = !!x, E = !!T, V = E && !M, Z = T ? g("bundle.discount.off_label", { discount: ke(T.discountPercent) }) : null, ee = M ? x.displayName : g("bundle.slot", { slot: p + 1 });
2156
+ return /* @__PURE__ */ R("div", { "data-box-slot": p, className: _.boxSlot, children: [
2001
2157
  /* @__PURE__ */ l(
2002
2158
  "div",
2003
2159
  {
2004
2160
  className: [
2005
- b.boxItem,
2006
- R ? b.boxItemFilled : b.boxItemPlaceholder,
2007
- E ? b.boxItemThreshold : null,
2008
- R ? b.boxItemClickable : null
2161
+ _.boxItem,
2162
+ M ? _.boxItemFilled : _.boxItemPlaceholder,
2163
+ E ? _.boxItemThreshold : null,
2164
+ M ? _.boxItemClickable : null
2009
2165
  ].filter(Boolean).join(" "),
2010
- role: R ? "button" : void 0,
2011
- tabIndex: R ? 0 : void 0,
2012
- onClick: R ? () => Lt(w.id) : void 0,
2013
- onKeyDown: R ? (mt) => {
2014
- (mt.key === "Enter" || mt.key === " ") && (mt.preventDefault(), Lt(w.id));
2166
+ role: M ? "button" : void 0,
2167
+ tabIndex: M ? 0 : void 0,
2168
+ onClick: M ? () => De(x.id) : void 0,
2169
+ onKeyDown: M ? (Pe) => {
2170
+ (Pe.key === "Enter" || Pe.key === " ") && (Pe.preventDefault(), De(x.id));
2015
2171
  } : void 0,
2016
- "aria-label": $ && H ? `${M}. Unlocks ${H}.` : M,
2017
- title: $ && H ? `${M} • Unlocks ${H}` : M,
2018
- children: R ? (W = w.image) != null && W.url ? /* @__PURE__ */ l(
2172
+ "aria-label": V && Z ? `${ee}. ${g("bundle.unlocks", { discount: Z })}.` : ee,
2173
+ title: V && Z ? `${ee} • ${g("bundle.unlocks", { discount: Z })}` : ee,
2174
+ children: M ? (Q = x.image) != null && Q.url ? /* @__PURE__ */ l(
2019
2175
  "img",
2020
2176
  {
2021
- className: b.boxItemImage,
2022
- src: w.image.url,
2023
- alt: w.image.altText ?? w.displayName,
2177
+ className: _.boxItemImage,
2178
+ src: x.image.url,
2179
+ alt: x.image.altText ?? x.displayName,
2024
2180
  width: 1,
2025
2181
  height: 1,
2026
2182
  loading: "lazy"
2027
2183
  }
2028
- ) : /* @__PURE__ */ l("div", { className: b.boxItemFallback, "aria-hidden": "true", children: ((Ut = (L = (Q = w.product) == null ? void 0 : Q.title) == null ? void 0 : L.slice(0, 1)) == null ? void 0 : Ut.toUpperCase()) ?? "•" }) : $ && H ? /* @__PURE__ */ l("div", { className: b.boxItemDiscountText, children: H }) : /* @__PURE__ */ l("div", { className: b.boxItemPlus, "aria-hidden": "true", children: "+" })
2184
+ ) : /* @__PURE__ */ l("div", { className: _.boxItemFallback, "aria-hidden": "true", children: ((Se = (q = (A = x.product) == null ? void 0 : A.title) == null ? void 0 : q.slice(0, 1)) == null ? void 0 : Se.toUpperCase()) ?? "•" }) : V && Z ? /* @__PURE__ */ l("div", { className: _.boxItemDiscountText, children: Z }) : /* @__PURE__ */ l("div", { className: _.boxItemPlus, "aria-hidden": "true", children: "+" })
2029
2185
  }
2030
2186
  ),
2031
- E ? /* @__PURE__ */ l("div", { className: b.boxThresholdLabel, children: B.label }) : null
2032
- ] }, _);
2187
+ E ? /* @__PURE__ */ l("div", { className: _.boxThresholdLabel, children: T.label }) : null
2188
+ ] }, p);
2033
2189
  }) }) }),
2034
- /* @__PURE__ */ l("div", { className: [b.totalsReveal, It ? b.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ l(
2190
+ /* @__PURE__ */ l("div", { className: [_.totalsReveal, Ce ? _.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ l(
2035
2191
  "div",
2036
2192
  {
2037
- className: [b.ctaTotalsWrap, It ? b.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
2038
- "aria-hidden": !It,
2039
- children: /* @__PURE__ */ N("div", { className: b.ctaTotals, "aria-label": "Totals", children: [
2040
- dt ? /* @__PURE__ */ N("span", { className: b.ctaDiscountBadge, children: [
2041
- dt,
2042
- "% Discount"
2043
- ] }) : /* @__PURE__ */ l("span", {}),
2044
- /* @__PURE__ */ l("span", { children: dt ? /* @__PURE__ */ N(xe, { children: [
2045
- /* @__PURE__ */ l("span", { className: b.ctaTotalsStrike, children: gt(ht.toFixed(2)) }),
2193
+ className: [_.ctaTotalsWrap, Ce ? _.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
2194
+ "aria-hidden": !Ce,
2195
+ children: /* @__PURE__ */ R("div", { className: _.ctaTotals, "aria-label": g("bundle.totals"), children: [
2196
+ Re ? /* @__PURE__ */ l("span", { className: _.ctaDiscountBadge, children: g("bundle.discount.badge", { discount: Re }) }) : /* @__PURE__ */ l("span", {}),
2197
+ /* @__PURE__ */ l("span", { children: Re ? /* @__PURE__ */ R(kt, { children: [
2198
+ /* @__PURE__ */ l("span", { className: _.ctaTotalsStrike, children: ye(be.toFixed(2)) }),
2046
2199
  " ",
2047
- /* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(zt.toFixed(2)) })
2048
- ] }) : /* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(ht.toFixed(2)) }) })
2200
+ /* @__PURE__ */ l("span", { className: _.ctaTotalsPrice, children: ye(Ve.toFixed(2)) })
2201
+ ] }) : /* @__PURE__ */ l("span", { className: _.ctaTotalsPrice, children: ye(be.toFixed(2)) }) })
2049
2202
  ] })
2050
2203
  }
2051
2204
  ) }),
2052
2205
  (() => {
2053
- const h = (r == null ? void 0 : r.ctaButtonMode) || "add_to_cart";
2054
- return h === "add_to_cart_checkout" ? ut > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.cta, children: e ? "Adding…" : `Add ${ut} more product${ut === 1 ? "" : "s"}` }) : /* @__PURE__ */ N("div", { className: b.ctaButtonGroup, children: [
2055
- /* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.ctaDualLeft, children: /* @__PURE__ */ l("span", { children: e ? "Adding…" : "Add to Basket" }) }),
2056
- /* @__PURE__ */ l("button", { type: "button", onClick: X, disabled: !C, className: b.ctaDualRight, children: /* @__PURE__ */ l("span", { children: e ? "Processing…" : "Checkout" }) })
2057
- ] }) : h === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: X, disabled: !C, className: b.cta, children: e ? "Processing…" : ut > 0 ? `Add ${ut} more product${ut === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.cta, children: e ? "Adding…" : ut > 0 ? `Add ${ut} more product${ut === 1 ? "" : "s"}` : "Add to Basket" });
2206
+ const f = (r == null ? void 0 : r.ctaButtonMode) || "add_to_cart";
2207
+ return f === "add_to_cart_checkout" ? ie > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: te, disabled: !F, className: _.cta, children: t ? g("bundle.cta.adding") : g("bundle.cta.add_more", { count: ie, productWord: ct(K, ie) }) }) : /* @__PURE__ */ R("div", { className: _.ctaButtonGroup, children: [
2208
+ /* @__PURE__ */ l("button", { type: "button", onClick: te, disabled: !F, className: _.ctaDualLeft, children: /* @__PURE__ */ l("span", { children: g(t ? "bundle.cta.adding" : "bundle.cta.add_to_basket") }) }),
2209
+ /* @__PURE__ */ l("button", { type: "button", onClick: z, disabled: !F, className: _.ctaDualRight, children: /* @__PURE__ */ l("span", { children: g(t ? "bundle.cta.processing" : "bundle.cta.checkout") }) })
2210
+ ] }) : f === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: z, disabled: !F, className: _.cta, children: t ? g("bundle.cta.processing") : ie > 0 ? g("bundle.cta.add_more", { count: ie, productWord: ct(K, ie) }) : g("bundle.cta.checkout") }) : /* @__PURE__ */ l("button", { type: "button", onClick: te, disabled: !F, className: _.cta, children: t ? g("bundle.cta.adding") : ie > 0 ? g("bundle.cta.add_more", { count: ie, productWord: ct(K, ie) }) : g("bundle.cta.add_to_basket") });
2058
2211
  })(),
2059
- /* @__PURE__ */ N("div", { className: b.poweredBy, children: [
2060
- "powered by",
2212
+ /* @__PURE__ */ R("div", { className: _.poweredBy, children: [
2213
+ g("bundle.powered_by"),
2061
2214
  " ",
2062
2215
  /* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
2063
2216
  ] })
2064
2217
  ] })
2065
2218
  ] });
2066
2219
  }
2067
- function ve(a) {
2068
- if (a != null && a.length)
2069
- return a.reduce((t, e) => (e != null && e.key && (t[e.key] = e.value ?? ""), t), {});
2220
+ function Bt(n) {
2221
+ if (n != null && n.length)
2222
+ return n.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
2070
2223
  }
2071
- function Ae(a) {
2072
- const t = /\/(\d+)$/.exec(a);
2073
- return t ? t[1] : a;
2224
+ function Wt(n) {
2225
+ const e = /\/(\d+)$/.exec(n);
2226
+ return e ? e[1] : n;
2074
2227
  }
2075
- function Za(a) {
2076
- if (a == null) return null;
2077
- const t = String(a).trim();
2078
- return t ? t.startsWith("gid://shopify/ProductVariant/") ? t : `gid://shopify/ProductVariant/${t}` : null;
2228
+ function hi(n) {
2229
+ if (n == null) return null;
2230
+ const e = String(n).trim();
2231
+ return e ? e.startsWith("gid://shopify/ProductVariant/") ? e : `gid://shopify/ProductVariant/${e}` : null;
2079
2232
  }
2080
- function ti() {
2081
- var a;
2082
- return typeof window > "u" ? null : ((a = window.Shopify) == null ? void 0 : a.theme) ?? null;
2233
+ function mi() {
2234
+ var n;
2235
+ return typeof window > "u" ? null : ((n = window.Shopify) == null ? void 0 : n.theme) ?? null;
2083
2236
  }
2084
- function ei() {
2085
- const a = ti();
2086
- return a ? a.schema_name === "Sleek" ? !0 : /sleek/i.test(a.name ?? "") : !1;
2237
+ function bi() {
2238
+ const n = mi();
2239
+ return n ? n.schema_name === "Sleek" ? !0 : /sleek/i.test(n.name ?? "") : !1;
2087
2240
  }
2088
- function ni() {
2241
+ function fi() {
2089
2242
  return typeof document > "u" ? !1 : !!document.querySelector("cart-drawer");
2090
2243
  }
2091
- function ri() {
2092
- return !ei() || !ni() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2244
+ function _i() {
2245
+ return !bi() || !fi() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2093
2246
  bubbles: !0,
2094
2247
  detail: { open: !0 }
2095
2248
  })), !0);
2096
2249
  }
2097
- function ai() {
2250
+ function pi() {
2098
2251
  window.location.reload();
2099
2252
  }
2100
- async function he(a, t) {
2101
- const e = await fetch(a, {
2253
+ async function yt(n, e) {
2254
+ const t = await fetch(n, {
2102
2255
  method: "POST",
2103
2256
  headers: {
2104
2257
  Accept: "application/json",
2105
2258
  "Content-Type": "application/json"
2106
2259
  },
2107
- body: JSON.stringify(t)
2260
+ body: JSON.stringify(e)
2108
2261
  });
2109
- if (!e.ok) {
2110
- const o = await e.text().catch(() => "");
2111
- throw new Error(o || `Cart request failed: ${e.status}`);
2262
+ if (!t.ok) {
2263
+ const a = await t.text().catch(() => "");
2264
+ throw new Error(a || `Cart request failed: ${t.status}`);
2112
2265
  }
2113
- return e.json().catch(() => null);
2266
+ return t.json().catch(() => null);
2114
2267
  }
2115
- async function ii() {
2116
- const a = await fetch("/cart.js", {
2268
+ async function yi() {
2269
+ const n = await fetch("/cart.js", {
2117
2270
  method: "GET",
2118
2271
  cache: "no-store",
2119
2272
  headers: {
@@ -2121,52 +2274,52 @@ async function ii() {
2121
2274
  "Content-Type": "application/json"
2122
2275
  }
2123
2276
  });
2124
- if (!a.ok)
2125
- throw new Error(`Cart request failed: ${a.status}`);
2126
- return a.json();
2277
+ if (!n.ok)
2278
+ throw new Error(`Cart request failed: ${n.status}`);
2279
+ return n.json();
2127
2280
  }
2128
- function mi() {
2281
+ function Si() {
2129
2282
  return {
2130
- async linesAdd(a) {
2131
- const t = a.map((e) => ({
2132
- id: Ae(e.merchandiseId),
2133
- quantity: e.quantity,
2134
- properties: ve(e.attributes)
2283
+ async linesAdd(n) {
2284
+ const e = n.map((t) => ({
2285
+ id: Wt(t.merchandiseId),
2286
+ quantity: t.quantity,
2287
+ properties: Bt(t.attributes)
2135
2288
  }));
2136
- await he("/cart/add.js", { items: t });
2289
+ await yt("/cart/add.js", { items: e });
2137
2290
  },
2138
- async linesAddForCheckout(a) {
2139
- const t = a.map((e) => ({
2140
- id: Ae(e.merchandiseId),
2141
- quantity: e.quantity,
2142
- properties: ve(e.attributes)
2291
+ async linesAddForCheckout(n) {
2292
+ const e = n.map((t) => ({
2293
+ id: Wt(t.merchandiseId),
2294
+ quantity: t.quantity,
2295
+ properties: Bt(t.attributes)
2143
2296
  }));
2144
- await he("/cart/add.js", { items: t });
2297
+ await yt("/cart/add.js", { items: e });
2145
2298
  },
2146
- async linesUpdate(a) {
2147
- for (const t of a)
2148
- await he("/cart/change.js", {
2149
- id: t.id,
2150
- quantity: t.quantity,
2151
- properties: ve(t.attributes)
2299
+ async linesUpdate(n) {
2300
+ for (const e of n)
2301
+ await yt("/cart/change.js", {
2302
+ id: e.id,
2303
+ quantity: e.quantity,
2304
+ properties: Bt(e.attributes)
2152
2305
  });
2153
2306
  },
2154
- async linesRemove(a) {
2155
- for (const t of a)
2156
- await he("/cart/change.js", { id: t, quantity: 0 });
2307
+ async linesRemove(n) {
2308
+ for (const e of n)
2309
+ await yt("/cart/change.js", { id: e, quantity: 0 });
2157
2310
  },
2158
2311
  async getLineQuantitiesByMerchandiseId() {
2159
- const a = await ii(), t = {};
2160
- for (const e of a.items ?? []) {
2161
- const o = Za(e.id);
2162
- if (!o) continue;
2163
- const i = Number(e.quantity ?? 0);
2164
- !Number.isFinite(i) || i <= 0 || (t[o] = (t[o] ?? 0) + Math.floor(i));
2312
+ const n = await yi(), e = {};
2313
+ for (const t of n.items ?? []) {
2314
+ const a = hi(t.id);
2315
+ if (!a) continue;
2316
+ const i = Number(t.quantity ?? 0);
2317
+ !Number.isFinite(i) || i <= 0 || (e[a] = (e[a] ?? 0) + Math.floor(i));
2165
2318
  }
2166
- return t;
2319
+ return e;
2167
2320
  },
2168
2321
  openCartUI() {
2169
- ri() || window.setTimeout(() => ai(), 0);
2322
+ _i() || window.setTimeout(() => pi(), 0);
2170
2323
  },
2171
2324
  navigateToCheckout() {
2172
2325
  window.location.href = "/checkout";
@@ -2174,13 +2327,13 @@ function mi() {
2174
2327
  };
2175
2328
  }
2176
2329
  export {
2177
- di as BundleBuilderDrawer,
2178
- hi as BundleBuilderPanel,
2179
- ui as BundleButton,
2180
- ue as BundleLineAttributeKeys,
2181
- li as BundleProvider,
2182
- mi as createLiquidCartAdapter,
2183
- be as useBundleBuilder,
2184
- ci as useBundleBuilderDrawer
2330
+ Ii as BundleBuilderDrawer,
2331
+ Ni as BundleBuilderPanel,
2332
+ Ci as BundleButton,
2333
+ _t as BundleLineAttributeKeys,
2334
+ wi as BundleProvider,
2335
+ Si as createLiquidCartAdapter,
2336
+ wt as useBundleBuilder,
2337
+ xi as useBundleBuilderDrawer
2185
2338
  };
2186
2339
  //# sourceMappingURL=index.js.map