@best-bundles/bundle-ui 0.0.39 → 0.0.41

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,100 +1,106 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._button_18rtl_1{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--bb-font-family, inherit);border:1px solid var(--bb-button-border, rgba(0, 0, 0, .12));background:var(--bb-button-bg, #111827);color:var(--bb-button-text, #ffffff);font:inherit;line-height:1;padding:10px 14px;border-radius:var(--bb-button-radius, 10px);cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease,opacity .12s ease}._button_18rtl_1:hover{background:var(--bb-button-bg-hover, #0b1220)}._button_18rtl_1:active{transform:translateY(1px)}._button_18rtl_1:disabled{opacity:.6;cursor:not-allowed}._button_18rtl_1:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._backdrop_18x6y_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_18x6y_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_18x6y_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_18x6y_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_18x6y_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_18x6y_74{opacity:1}._backdropClosed_18x6y_78{opacity:0}._panel_18x6y_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_18x6y_103{animation:_bbSlideInFromRight_18x6y_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_18x6y_107{animation:_bbSlideOutToRight_18x6y_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_18x6y_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_18x6y_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_18x6y_1{transition:none}._celebrationChip_18x6y_23,._panelOpen_18x6y_103,._panelClosed_18x6y_107{animation:none}}._header_18x6y_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_18x6y_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_18x6y_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_18x6y_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_18x6y_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_18x6y_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_18x6y_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_18x6y_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_18x6y_211 ._headerTitleWrap_18x6y_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_18x6y_211 ._headerSearchWrap_18x6y_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_18x6y_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_18x6y_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_18x6y_235::-webkit-search-cancel-button,._searchInput_18x6y_235::-webkit-search-decoration,._searchInput_18x6y_235::-webkit-search-results-button,._searchInput_18x6y_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_18x6y_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_18x6y_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_18x6y_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_18x6y_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_18x6y_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_18x6y_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_18x6y_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_18x6y_195,._headerSearchWrap_18x6y_199{transition:none}}._body_18x6y_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_18x6y_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_18x6y_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_18x6y_327{margin-top:4px}._variantList_18x6y_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_18x6y_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_18x6y_347{opacity:.65}._variantLeft_18x6y_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_18x6y_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_18x6y_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_18x6y_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_18x6y_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_18x6y_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._soldOut_18x6y_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}._variantThumb_18x6y_403{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_18x6y_413{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_18x6y_420{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_18x6y_430{min-width:0}._variantName_18x6y_434{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_18x6y_443{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_18x6y_451{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_18x6y_458{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_18x6y_451{font-size:13px;font-weight:800}._qtyControls_18x6y_469{display:inline-flex;align-items:center;gap:6px}._qtyButton_18x6y_475{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_18x6y_475:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_18x6y_475:disabled{opacity:.6;cursor:not-allowed}._qtyButton_18x6y_475:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_18x6y_501{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_18x6y_508{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_18x6y_516{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_18x6y_516 a{color:inherit;text-decoration:none}._boxSummaryWindow_18x6y_528{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_18x6y_528::-webkit-scrollbar{display:none}._boxSummaryRow_18x6y_546{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_18x6y_554{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_18x6y_563{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_18x6y_575{cursor:pointer}._boxItemClickable_18x6y_575:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_18x6y_584{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_18x6y_595{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_18x6y_601{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_18x6y_607{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_18x6y_615{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_18x6y_623{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_18x6y_630{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_18x6y_637{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_18x6y_648{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_18x6y_655{gap:0}._cta_18x6y_648{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_18x6y_671{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_18x6y_683{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_18x6y_701{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_18x6y_701>span{opacity:0}._ctaDualRight_18x6y_714{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_18x6y_730{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_18x6y_730>span{opacity:0}._ctaTotals_18x6y_741{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_18x6y_749{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_18x6y_763{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_18x6y_776{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_18x6y_783{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_18x6y_790{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_18x6y_763{transition:none}}._cta_18x6y_648:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_18x6y_648:disabled{opacity:.6;cursor:not-allowed}._cta_18x6y_648:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_18x6y_671:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_18x6y_671:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_18x6y_671:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_18x6y_683:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_18x6y_683:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_18x6y_683:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_18x6y_714:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_18x6y_714:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_18x6y_714:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_18x6y_859{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_18x6y_1{padding:0;justify-content:stretch}._panel_18x6y_82{width:100%;height:100%;border-radius:0}}._panel_1n9m6_2 button,._panel_1n9m6_2 input,._panel_1n9m6_2 [role=button]{box-sizing:border-box;margin:0}._panel_1n9m6_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_1n9m6_20{text-align:start}._title_1n9m6_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_1n9m6_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_1n9m6_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_1n9m6_43{font-size:13px;color:#b45309;font-weight:600}._section_1n9m6_49{display:grid;gap:6px}._sectionTitle_1n9m6_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_1n9m6_63{display:flex;justify-content:center;gap:6px}._rulesList_1n9m6_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_1n9m6_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_1n9m6_92{font-weight:600;font-size:13px}._ruleDiscount_1n9m6_97{font-weight:700;font-size:13px}._ruleLabel_1n9m6_102{font-size:12px;opacity:.7}._rulesVisual_1n9m6_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_1n9m6_114,._rulesLinesRow_1n9m6_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_1n9m6_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_1n9m6_128:empty{display:flex!important}._rulesLineLabel_1n9m6_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_1n9m6_145{height:1em}._rulesLine_1n9m6_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_1n9m6_121:empty{display:block!important}._rulesLineEmpty_1n9m6_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_1n9m6_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_1n9m6_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_1n9m6_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_1n9m6_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_1n9m6_198{cursor:pointer}._variantRowSelected_1n9m6_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_1n9m6_207{opacity:.65}._variantMedia_1n9m6_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_1n9m6_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_1n9m6_227{display:flex;flex-direction:column;gap:4px}._variantTitle_1n9m6_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_1n9m6_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_1n9m6_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_1n9m6_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_1n9m6_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_1n9m6_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_1n9m6_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_1n9m6_286{display:grid;align-items:end;justify-items:end}._qtyActions_1n9m6_292{display:inline-flex;align-items:center;gap:6px}._variantUnavailable_1n9m6_298{display:none}._qtyControls_1n9m6_302{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_1n9m6_312{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_1n9m6_312:disabled{cursor:not-allowed;opacity:.4}._qtyButton_1n9m6_312:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_1n9m6_336{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_1n9m6_343{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._qtyChip_1n9m6_351{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_1n9m6_366{cursor:pointer}._qtyChipValue_1n9m6_370{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_1n9m6_376{margin-bottom:-3px;font-weight:500}._qtyChipClear_1n9m6_381{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_1n9m6_351:hover ._qtyChipClear_1n9m6_381{background:#0f172a;color:#fff}._qtyTrash_1n9m6_400{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_1n9m6_412{display:grid;padding-top:6px}._boxSummaryWindow_1n9m6_417{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_1n9m6_417::-webkit-scrollbar{display:none}._boxSummaryRow_1n9m6_431{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_1n9m6_439{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_1n9m6_448{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_1n9m6_448:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_1n9m6_465{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_1n9m6_471{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_1n9m6_477{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_1n9m6_485{cursor:pointer}._boxItemClickable_1n9m6_485:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_1n9m6_494{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_1n9m6_505{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_1n9m6_518{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_1n9m6_530{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_1n9m6_543{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_1n9m6_554{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_1n9m6_562{max-height:80px;opacity:1}._ctaTotalsWrap_1n9m6_567{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_1n9m6_572{opacity:1}._ctaTotals_1n9m6_567{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_1n9m6_587{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_1n9m6_598{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_1n9m6_604{font-weight:700;color:#0f172a}._cta_1n9m6_567{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_1n9m6_567:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_1n9m6_567:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_1n9m6_636{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_1n9m6_642,._ctaDualRight_1n9m6_643{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_1n9m6_642{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_1n9m6_643{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_1n9m6_642:disabled,._ctaDualRight_1n9m6_643:disabled{cursor:not-allowed;opacity:.6}._poweredBy_1n9m6_670{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_1n9m6_670 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_1n9m6_2{padding:16px}._variantRow_1n9m6_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_1n9m6_302{justify-self:start}._variantDetailsRow_1n9m6_239{grid-template-columns:1fr}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { jsx as s, jsxs as R, Fragment as ut } from "react/jsx-runtime";
3
- import at, { useState as G, useRef as U, useEffect as $, useCallback as me, useMemo as A, createContext as Tt, useContext as kt, forwardRef as St, createElement as dt } from "react";
4
- const et = {
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 = {
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 Rt(a) {
11
- const e = new URL("/api/public/bundle-configs-active", a.apiBaseUrl);
12
- e.searchParams.set("shop", a.shop);
13
- const i = await (await fetch(e, {
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, {
14
14
  method: "GET",
15
15
  signal: a.signal,
16
16
  headers: { "Content-Type": "application/json" }
17
17
  })).json().catch(() => null);
18
- return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
18
+ return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
19
19
  }
20
- async function Pt(a) {
21
- const e = new URL("/api/public/bundle-config", a.apiBaseUrl);
22
- e.searchParams.set("shop", a.shop), a.configHandle && e.searchParams.set("handle", a.configHandle), a.fresh && e.searchParams.set("fresh", "1");
23
- const i = await (await fetch(e, {
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, {
24
24
  method: "GET",
25
25
  signal: a.signal,
26
26
  headers: { "Content-Type": "application/json" }
27
27
  })).json().catch(() => null);
28
- return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
28
+ return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
29
29
  }
30
- async function Ot(a) {
31
- const e = new URL("/api/public/bundle-config-status", a.apiBaseUrl);
32
- e.searchParams.set("shop", a.shop), a.configHandle && e.searchParams.set("handle", a.configHandle);
33
- const i = await (await fetch(e, {
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, {
34
34
  method: "GET",
35
35
  signal: a.signal,
36
36
  headers: { "Content-Type": "application/json" }
37
37
  })).json().catch(() => null);
38
- return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
38
+ return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
39
39
  }
40
- const bt = "bb_anonymous_user_id";
41
- function tt() {
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));
45
+ }
46
+ const Te = "bb_anonymous_user_id";
47
+ function de() {
42
48
  if (typeof window > "u" || typeof localStorage > "u")
43
49
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
44
50
  try {
45
- const a = localStorage.getItem(bt);
51
+ const a = localStorage.getItem(Te);
46
52
  if (a && typeof a == "string" && a.length > 0)
47
53
  return a;
48
- let e;
54
+ let t;
49
55
  try {
50
- const t = globalThis.crypto;
51
- if (t != null && t.randomUUID)
52
- e = t.randomUUID();
56
+ const e = globalThis.crypto;
57
+ if (e != null && e.randomUUID)
58
+ t = e.randomUUID();
53
59
  else
54
60
  throw new Error("crypto.randomUUID not available");
55
61
  } catch {
56
- e = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
62
+ t = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
57
63
  }
58
- return localStorage.setItem(bt, e), e;
64
+ return localStorage.setItem(Te, t), t;
59
65
  } catch {
60
66
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
61
67
  }
62
68
  }
63
- async function He(a, e, t) {
69
+ async function te(a, t, e) {
64
70
  if (!(typeof window > "u"))
65
71
  try {
66
- const i = new URL(a, window.location.origin);
67
- i.searchParams.set("shop", e);
68
- const r = await fetch(i, {
72
+ const o = new URL(a, window.location.origin);
73
+ o.searchParams.set("shop", t);
74
+ const i = await fetch(o, {
69
75
  method: "POST",
70
76
  headers: {
71
77
  "Content-Type": "application/json"
72
78
  },
73
- body: JSON.stringify(t),
79
+ body: JSON.stringify(e),
74
80
  // Don't wait for response - fire and forget
75
81
  keepalive: !0
76
82
  });
77
- r.ok || console.warn(
78
- `[Bundle Analytics] Event tracking failed with status ${r.status}:`,
79
- await r.text().catch(() => "Unable to read response")
83
+ i.ok || console.warn(
84
+ `[Bundle Analytics] Event tracking failed with status ${i.status}:`,
85
+ await i.text().catch(() => "Unable to read response")
80
86
  );
81
- } catch (i) {
82
- console.warn("[Bundle Analytics] Failed to track event:", i);
87
+ } catch (o) {
88
+ console.warn("[Bundle Analytics] Failed to track event:", o);
83
89
  }
84
90
  }
85
- const Nt = Tt(null), Ke = "#best-bundles", Ft = [];
86
- function $e(a) {
87
- const e = String(a ?? "").trim().toLowerCase();
88
- return e && e.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
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";
89
95
  }
90
- function pt(a) {
91
- const e = String(a ?? "").trim().toLowerCase();
92
- if (!e.startsWith(Ke)) return null;
93
- if (e === Ke) return "default";
94
- const t = `${Ke}:`;
95
- return e.startsWith(t) ? $e(e.slice(t.length)) : null;
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;
96
102
  }
97
- const Mt = {
103
+ const He = {
98
104
  primaryColor: "--bb-cta-bg",
99
105
  primaryHoverColor: "--bb-cta-bg-hover",
100
106
  primaryTextColor: "--bb-cta-text",
@@ -116,48 +122,48 @@ const Mt = {
116
122
  celebrationBorderColor: "--bb-celebration-border",
117
123
  fontFamilyBody: "--bb-font-family-body",
118
124
  fontFamilyTitle: "--bb-font-family-title"
119
- }, ot = "bb-google-fonts";
120
- function _t(a) {
121
- const e = (a ?? "").trim().replace(/^["']|["']$/g, "");
122
- return e ? encodeURIComponent(e).replace(/%20/g, "+") : "";
125
+ }, _e = "bb-google-fonts";
126
+ function Re(a) {
127
+ const t = (a ?? "").trim().replace(/^["']|["']$/g, "");
128
+ return t ? encodeURIComponent(t).replace(/%20/g, "+") : "";
123
129
  }
124
- function At(a) {
125
- var c;
130
+ function Qe(a) {
131
+ var d;
126
132
  if (typeof document > "u" || !document.head) return;
127
133
  if (!a) {
128
- (c = document.getElementById(ot)) == null || c.remove();
134
+ (d = document.getElementById(_e)) == null || d.remove();
129
135
  return;
130
136
  }
131
- const e = (a.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (a.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), i = [];
132
- e && i.push("family=" + _t(e)), t && t !== e && i.push("family=" + _t(t));
133
- const r = document.getElementById(ot);
134
- if (i.length === 0) {
135
- r == null || r.remove();
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) {
141
+ i == null || i.remove();
136
142
  return;
137
143
  }
138
- const n = `https://fonts.googleapis.com/css2?${i.join("&")}&display=swap`;
139
- if (r) {
140
- r.getAttribute("href") !== n && r.setAttribute("href", n);
144
+ const r = `https://fonts.googleapis.com/css2?${o.join("&")}&display=swap`;
145
+ if (i) {
146
+ i.getAttribute("href") !== r && i.setAttribute("href", r);
141
147
  return;
142
148
  }
143
- const d = document.createElement("link");
144
- d.id = ot, d.rel = "stylesheet", d.href = n, document.head.appendChild(d);
149
+ const m = document.createElement("link");
150
+ m.id = _e, m.rel = "stylesheet", m.href = r, document.head.appendChild(m);
145
151
  }
146
- function yt(a) {
152
+ function Me(a) {
147
153
  if (!a) return;
148
- At(a);
149
- const e = document.documentElement;
150
- Object.entries(Mt).forEach(([t, i]) => {
151
- let r = a[t];
152
- r && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(r) && !/^["']/.test(r.trim()) && (r = `"${r.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(i, r));
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));
153
159
  });
154
160
  }
155
- function wt(a) {
161
+ function Le(a) {
156
162
  if (typeof window > "u") return a;
157
- const e = window.__BUNDLE_PREVIEW_STYLES__;
158
- return e && typeof e == "object" ? e : a;
163
+ const t = window.__BUNDLE_PREVIEW_STYLES__;
164
+ return t && typeof t == "object" ? t : a;
159
165
  }
160
- function Lt() {
166
+ function Ge() {
161
167
  try {
162
168
  const a = globalThis.crypto;
163
169
  if (a != null && a.randomUUID) return a.randomUUID();
@@ -165,636 +171,704 @@ function Lt() {
165
171
  }
166
172
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
167
173
  }
168
- function vt(a) {
174
+ function me(a) {
169
175
  return Number.isFinite(a) ? Math.max(0, Math.floor(a)) : 0;
170
176
  }
171
- function Dt(a, e) {
172
- return !a && !e;
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;
180
+ }
181
+ function Ye(a, t) {
182
+ return !a && !t;
173
183
  }
174
- function jr(a) {
184
+ function li(a) {
175
185
  const {
176
- apiBaseUrl: e,
177
- shop: t,
178
- cartAdapter: i,
179
- configHandle: r = "default",
180
- initialData: n,
181
- configFetcher: d,
182
- activeConfigsFetcher: c,
183
- configStatusFetcher: k,
184
- analyticsEndpoint: Y,
185
- allowDrawerWhenInactive: P = !1,
186
- children: Z
187
- } = a, O = $e(r), E = Y ?? `${e}/api/public/bundle-analytics`, X = Dt(P, n), [le, ce] = G(!1), [j, te] = G(!1), [re, ie] = G(null), [J, H] = G(O), [ee, fe] = G(() => n ? { [O]: n } : {}), [ue, Fe] = G(X), [Me, be] = G(
188
- !X && !n ? O : null
189
- ), [Ge, Ne] = G(null), [ve, ge] = G(null), [qe, ke] = G(
186
+ apiBaseUrl: t,
187
+ shop: e,
188
+ cartAdapter: o,
189
+ configHandle: i = "default",
190
+ 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(
190
200
  () => ({ selections: {}, order: [] })
191
- ), ze = U(null), je = U(null), Be = U(null), oe = U(J), xe = U(ee), Re = U(ue), de = U(null), m = d ?? Pt, b = c ?? Rt, w = k ?? Ot;
192
- $(() => {
193
- oe.current = J;
194
- }, [J]), $(() => {
195
- xe.current = ee;
196
- }, [ee]), $(() => {
197
- Re.current = ue;
198
- }, [ue]);
199
- const L = me((u) => {
200
- H($e(u));
201
- }, []), B = me(() => {
202
- if (E)
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;
207
+ }, {});
208
+ }, [o]), M = K(async () => {
209
+ const n = ++ft.current;
210
+ $t(!0);
211
+ try {
212
+ const s = await H();
213
+ return s && n === ft.current && ut(s), s;
214
+ } catch {
215
+ return null;
216
+ } finally {
217
+ n === ft.current && $t(!1);
218
+ }
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)
203
233
  try {
204
- const u = tt();
205
- He(E, t, {
234
+ const n = de();
235
+ te(C, e, {
206
236
  eventType: "DRAWER_CLOSED",
207
- shop: t,
208
- anonymousUserId: u,
237
+ shop: e,
238
+ anonymousUserId: n,
209
239
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
210
240
  mixpanelEvent: "bundle_closed"
211
- }).catch((_) => {
212
- console.warn("[Bundle Analytics] Failed to track drawer closed:", _);
241
+ }).catch((s) => {
242
+ console.warn("[Bundle Analytics] Failed to track drawer closed:", s);
213
243
  });
214
- } catch (u) {
215
- console.warn("[Bundle Analytics] Error in close() callback:", u);
244
+ } catch (n) {
245
+ console.warn("[Bundle Analytics] Error in close() callback:", n);
216
246
  }
217
- ce(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(Ke) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
218
- }, [E, t]), q = me(() => {
219
- ce((u) => {
220
- if (u) return u;
221
- if (E)
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)
222
252
  try {
223
- const _ = tt();
224
- He(E, t, {
253
+ const s = de();
254
+ te(C, e, {
225
255
  eventType: "DRAWER_OPENED",
226
- shop: t,
227
- anonymousUserId: _,
256
+ shop: e,
257
+ anonymousUserId: s,
228
258
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
229
259
  mixpanelEvent: "bundle_opened"
230
- }).catch((y) => {
231
- console.warn("[Bundle Analytics] Failed to track drawer opened:", y);
260
+ }).catch((u) => {
261
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", u);
232
262
  });
233
- } catch (_) {
234
- console.warn("[Bundle Analytics] Error in open() callback:", _);
263
+ } catch (s) {
264
+ console.warn("[Bundle Analytics] Error in open() callback:", s);
235
265
  }
236
266
  return !0;
237
267
  });
238
- }, [E, t]), T = me((u, _) => !_.ok || _.config.isActive === !1 ? (fe((y) => {
239
- if (!y[u]) return y;
240
- const v = { ...y };
241
- return delete v[u], v;
242
- }), !P && oe.current === u && (ie(_.ok ? "Bundle is inactive." : _.error || "Failed to load bundle config."), ce(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(Ke) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (fe((y) => ({
243
- ...y,
244
- [u]: {
245
- currencyCode: _.currencyCode ?? null,
246
- config: _.config,
247
- eligibleVariants: _.eligibleVariants ?? []
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]: {
275
+ currencyCode: s.currencyCode ?? null,
276
+ config: s.config,
277
+ eligibleVariants: s.eligibleVariants ?? []
248
278
  }
249
- })), oe.current === u && ie(null), !0), [P]), Q = me((u, _) => {
250
- var F;
251
- const y = $e(u);
252
- (F = je.current) == null || F.abort();
253
- const v = new AbortController();
254
- je.current = v, _ != null && _.blocking && be(y), ie(null), m({
255
- apiBaseUrl: e,
256
- shop: t,
257
- configHandle: y,
258
- fresh: (_ == null ? void 0 : _.blocking) === !0 && !xe.current[y],
259
- signal: v.signal
260
- }).then((M) => {
261
- v.signal.aborted || T(y, M);
262
- }).catch((M) => {
263
- if (v.signal.aborted) return;
264
- const ae = M instanceof Error ? M.message : "Failed to load bundle config.";
265
- oe.current === y && ie(ae);
279
+ })), h.current === n && Z(null), !0), [A]), mt = K((n, s) => {
280
+ 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);
266
296
  }).finally(() => {
267
- v.signal.aborted || be((M) => M === y ? null : M);
297
+ p.signal.aborted || Ct((g) => g === u ? null : g);
268
298
  });
269
- }, [e, T, m, t]), Ce = me((u) => {
270
- const _ = $e(u), y = xe.current[_];
271
- H(_), ie(null), Q(_, { blocking: !y });
272
- }, [Q]), z = me((u, _ = "api") => {
273
- var M, ae;
274
- const y = $e(u), v = xe.current[y];
275
- if (X && Re.current && !v) {
276
- ge({ handle: y, source: _ });
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 });
277
307
  return;
278
308
  }
279
- if (H(y), P) {
280
- q(), Q(y, { blocking: !v });
309
+ if (dt(u), A) {
310
+ L(), mt(u, { blocking: !p });
281
311
  return;
282
312
  }
283
- if ((M = v == null ? void 0 : v.config) != null && M.isActive) {
284
- ie(null), q(), Q(y, { blocking: !1 });
313
+ if ((g = p == null ? void 0 : p.config) != null && g.isActive) {
314
+ Z(null), L(), mt(u, { blocking: !1 });
285
315
  return;
286
316
  }
287
- Ne(y), (ae = Be.current) == null || ae.abort();
288
- const F = new AbortController();
289
- Be.current = F, w({
290
- apiBaseUrl: e,
291
- shop: t,
292
- configHandle: y,
293
- signal: F.signal
294
- }).then((V) => {
295
- if (!F.signal.aborted) {
296
- if (Ne((o) => o === y ? null : o), !V.ok || V.isActive !== !0) {
297
- _ === "hash" && typeof window < "u" && pt(window.location.hash) === y && window.history.replaceState(null, "", window.location.pathname + window.location.search);
317
+ Dt(u), (x = Lt.current) == null || x.abort();
318
+ const y = new AbortController();
319
+ Lt.current = y, $({
320
+ apiBaseUrl: t,
321
+ shop: e,
322
+ configHandle: u,
323
+ signal: y.signal
324
+ }).then((k) => {
325
+ 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);
298
328
  return;
299
329
  }
300
- ie(null), H(y), q(), Q(y, { blocking: !0 });
330
+ Z(null), dt(u), L(), mt(u, { blocking: !0 });
301
331
  }
302
332
  }).catch(() => {
303
- F.signal.aborted || Ne((V) => V === y ? null : V);
333
+ y.signal.aborted || Dt((k) => k === u ? null : k);
304
334
  });
305
335
  }, [
306
- P,
307
- e,
308
- q,
309
- Q,
336
+ A,
310
337
  t,
311
- w,
312
- X
313
- ]), pe = me(() => {
314
- z(oe.current, "api");
315
- }, [z]);
316
- $(() => {
317
- de.current = z;
318
- }, [z]);
319
- const Pe = me(() => {
320
- if (le) {
321
- B();
338
+ L,
339
+ mt,
340
+ e,
341
+ $,
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();
322
352
  return;
323
353
  }
324
- z(oe.current, "api");
325
- }, [B, le, z]);
326
- $(() => {
327
- H($e(r));
328
- }, [r]), $(() => {
329
- var _;
330
- if (!X) {
331
- Fe(!1), n || Q(O, { blocking: !0 });
354
+ M(), vt(h.current, "api");
355
+ }, [Q, X, vt, M]);
356
+ F(() => {
357
+ dt(qt(i));
358
+ }, [i]), F(() => {
359
+ var s;
360
+ if (!Y) {
361
+ zt(!1), r || mt(et, { blocking: !0 });
332
362
  return;
333
363
  }
334
- (_ = ze.current) == null || _.abort();
335
- const u = new AbortController();
336
- return ze.current = u, Fe(!0), b({ apiBaseUrl: e, shop: t, signal: u.signal }).then((y) => {
337
- u.signal.aborted || y.ok && fe((v) => {
338
- const F = { ...v };
339
- for (const [M, ae] of Object.entries(y.configs ?? {}))
340
- F[$e(M)] = {
341
- currencyCode: ae.currencyCode ?? null,
342
- config: ae.config,
343
- eligibleVariants: ae.eligibleVariants ?? []
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 ?? []
344
374
  };
345
- return F;
375
+ return y;
346
376
  });
347
377
  }).catch(() => {
348
378
  }).finally(() => {
349
- u.signal.aborted || Fe(!1);
350
- }), () => u.abort();
351
- }, [b, e, n, O, Q, t, X]), $(() => {
352
- ue || !ve || (z(ve.handle, ve.source), ge(null));
353
- }, [ue, z, ve]), $(() => {
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(() => {
354
384
  if (typeof window > "u") return;
355
- const u = () => {
356
- var y;
357
- const _ = pt(window.location.hash);
358
- _ && ((y = de.current) == null || y.call(de, _, "hash"));
385
+ const n = () => {
386
+ var u;
387
+ const s = ke(window.location.hash);
388
+ s && ((u = B.current) == null || u.call(B, s, "hash"));
359
389
  };
360
- return u(), window.addEventListener("hashchange", u), () => window.removeEventListener("hashchange", u);
390
+ return n(), window.addEventListener("hashchange", n), () => window.removeEventListener("hashchange", n);
361
391
  }, []);
362
- const he = ee[J] ?? null, g = (he == null ? void 0 : he.config) ?? null, Te = (he == null ? void 0 : he.eligibleVariants) ?? Ft, Ae = (he == null ? void 0 : he.currencyCode) ?? null, W = !g && (Me === J || Ge === J) || P && !g && Me != null;
363
- $(() => {
364
- const u = wt(g == null ? void 0 : g.styleSettings);
365
- u && yt(u);
366
- }, [g == null ? void 0 : g.styleSettings]), $(() => {
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(() => {
367
397
  if (typeof window > "u") return;
368
- const u = () => {
369
- const _ = wt(void 0);
370
- _ && yt(_);
398
+ const n = () => {
399
+ const s = Le(void 0);
400
+ s && Me(s);
371
401
  };
372
- return window.addEventListener("bundle-preview-styles-updated", u), () => window.removeEventListener("bundle-preview-styles-updated", u);
373
- }, []), $(() => {
402
+ return window.addEventListener("bundle-preview-styles-updated", n), () => window.removeEventListener("bundle-preview-styles-updated", n);
403
+ }, []), F(() => {
374
404
  if (typeof window > "u") return;
375
- const u = window, _ = () => {
376
- const y = u.__BUNDLE_PREVIEW_CONFIG__;
377
- if (!y) return;
378
- const v = u.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ ?? [];
379
- fe((F) => {
380
- var M;
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;
381
411
  return {
382
- ...F,
383
- [oe.current]: {
384
- currencyCode: Ae ?? null,
385
- config: y,
386
- eligibleVariants: v.length ? v : ((M = F[oe.current]) == null ? void 0 : M.eligibleVariants) ?? []
412
+ ...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) ?? []
387
417
  }
388
418
  };
389
- }), u.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? be(oe.current) : be((F) => F === oe.current ? null : F);
419
+ }), n.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? Ct(h.current) : Ct((y) => y === h.current ? null : y);
390
420
  };
391
- return u.__BUNDLE_PREVIEW_CONFIG__ && _(), window.addEventListener("bundle-preview-config-updated", _), () => window.removeEventListener("bundle-preview-config-updated", _);
392
- }, [Ae]);
393
- const ne = A(() => {
394
- const u = Number((g == null ? void 0 : g.maxBundleSize) ?? Number.NaN), _ = Number.isFinite(u) ? Math.floor(u) : 100;
395
- return Math.max(2, Math.min(100, _));
396
- }, [g == null ? void 0 : g.maxBundleSize]), Ie = A(() => new Set(
397
- Te.filter((u) => u.availableForSale !== !1).map((u) => u.id)
398
- ), [Te]), se = A(() => {
399
- const u = (g == null ? void 0 : g.rules) ?? [], _ = u.length ? Math.min(...u.map((M) => M.minBundleSize)) : 2, y = Number.isFinite(_) && _ > 0 ? _ : 2, v = Number((g == null ? void 0 : g.minBundleSize) ?? Number.NaN), F = Number.isFinite(v) && Number.isInteger(v) ? Math.max(2, Math.min(100, v)) : null;
400
- return F == null ? y : Math.min(y, F);
401
- }, [g == null ? void 0 : g.minBundleSize, g == null ? void 0 : g.rules]), Qe = me((u, _) => {
402
- if (!Ie.has(u) && !W)
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;
425
+ 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)];
432
+ })
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)
403
440
  return;
404
- const y = vt(_);
405
- ke((v) => {
406
- const F = v.selections[u] ?? 0, M = y - F, ae = Object.values(v.selections).reduce((N, x) => N + (x || 0), 0), V = M > 0 ? Math.min(M, Math.max(0, ne - ae)) : M, o = F + V;
407
- let l;
408
- if (o <= 0) {
409
- const N = { ...v.selections };
410
- delete N[u], l = N;
411
- } else F === o ? l = v.selections : l = { ...v.selections, [u]: o };
412
- let p = v.order;
413
- if (V > 0)
414
- p = [...v.order, ...Array.from({ length: V }, () => u)];
415
- else if (V < 0) {
416
- let N = -V;
417
- const x = [];
418
- for (let D = v.order.length - 1; D >= 0; D--) {
419
- const I = v.order[D];
420
- if (I === u && N > 0) {
421
- N--;
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--;
422
463
  continue;
423
464
  }
424
- x.push(I);
465
+ tt.push(I);
425
466
  }
426
- x.reverse(), p = x;
467
+ tt.reverse(), pt = tt;
427
468
  }
428
- if (l === v.selections && p === v.order) return v;
429
- const S = ae, C = Object.values(l).reduce((N, x) => N + (x || 0), 0);
430
- if (E)
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)
431
472
  try {
432
- const N = tt(), x = {
473
+ const it = de(), tt = {
433
474
  eventType: "VARIANT_SELECTION_CHANGED",
434
- shop: t,
435
- anonymousUserId: N,
436
- before: { ...v.selections },
437
- after: { ...l },
475
+ shop: e,
476
+ anonymousUserId: it,
477
+ before: { ...y.selections },
478
+ after: { ...at },
438
479
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
439
480
  };
440
- He(E, t, x), S === 0 && C >= 1 && He(E, t, {
441
- ...x,
481
+ te(C, e, tt), Gt === 0 && Yt >= 1 && te(C, e, {
482
+ ...tt,
442
483
  mixpanelEvent: "bundle_started"
443
- }), S < se && C >= se && He(E, t, {
444
- ...x,
484
+ }), Gt < Ot && Yt >= Ot && te(C, e, {
485
+ ...tt,
445
486
  mixpanelEvent: "bundle_completed"
446
487
  });
447
488
  } catch {
448
489
  }
449
- return { selections: l, order: p };
490
+ return { selections: at, order: pt };
450
491
  });
451
- }, [E, Ie, W, ne, se, t]);
452
- $(() => {
453
- W || ke((u) => {
454
- const _ = Object.entries(u.selections).filter(([F]) => Ie.has(F)), y = Object.fromEntries(_), v = u.order.filter((F) => Ie.has(F));
455
- return v.length === u.order.length && _.length === Object.keys(u.selections).length ? u : { selections: y, order: v };
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);
502
+ });
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 };
456
504
  });
457
- }, [Ie, W]), $(() => {
458
- ke({ selections: {}, order: [] });
459
- }, [J]);
460
- const Ve = me(() => ke({ selections: {}, order: [] }), []), _e = qe.selections, Xe = qe.order, Oe = A(() => Object.values(_e).reduce((u, _) => u + (_ || 0), 0), [_e]), Le = A(() => !(W || j || re || !(g != null && g.isActive) || Oe < se), [Oe, g == null ? void 0 : g.isActive, re, W, se, j]), We = me(async (u) => {
461
- var x, D;
462
- if (!Le || !g) return;
463
- const _ = Lt(), y = (g.title ?? "").trim().slice(0, 255), v = Object.entries(_e).map(([I, K]) => ({ merchandiseId: I, quantity: vt(K) })).filter((I) => I.quantity > 0).filter((I) => Ie.has(I.merchandiseId)).map((I) => ({
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);
512
+ 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)];
522
+ })
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) => ({
464
527
  merchandiseId: I.merchandiseId,
465
528
  quantity: I.quantity,
466
529
  attributes: [
467
- { key: et.bundleId, value: _ },
468
- { key: et.bundleConfig, value: J },
469
- { key: et.bundleSource, value: "bundle_builder" },
470
- ...y ? [{ key: et.bundleTitle, value: y }] : []
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 }] : []
471
534
  ]
472
535
  }));
473
- if (!v.length) return;
474
- const F = new Map(Te.map((I) => [I.id, I]));
475
- let M = 0;
476
- for (const [I, K] of Object.entries(_e)) {
477
- const we = K ?? 0;
478
- if (we <= 0) continue;
479
- const Se = F.get(I), De = Number(Se == null ? void 0 : Se.price);
480
- Number.isFinite(De) && (M += De * we);
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);
481
544
  }
482
- M = Math.round(M * 100) / 100;
483
- const ae = [...g.rules ?? []].sort((I, K) => I.minBundleSize - K.minBundleSize);
484
- let V = null;
485
- for (const I of ae)
486
- Oe >= I.minBundleSize && (V = I);
487
- const o = V ? (() => {
488
- const I = Number.parseFloat(V.discountPercent);
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);
489
552
  return Number.isFinite(I) && I > 0 ? I : null;
490
- })() : null, l = o ? Math.round(M * (1 - o / 100) * 100) / 100 : M, p = M - l, S = v.map((I) => I.merchandiseId), C = (V == null ? void 0 : V.handle) ?? "", N = ((x = V == null ? void 0 : V.label) == null ? void 0 : x.trim()) || "";
491
- te(!0);
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);
492
555
  try {
493
- if (u != null && u.checkout ? await i.linesAddForCheckout(v) : await i.linesAdd(v), E)
556
+ if (n != null && n.checkout ? await o.linesAddForCheckout(g) : await o.linesAdd(g), C)
494
557
  try {
495
- const I = tt(), K = !!(u != null && u.checkout);
496
- He(E, t, {
558
+ const I = de(), lt = !!(n != null && n.checkout);
559
+ te(C, e, {
497
560
  eventType: "BUNDLE_ADDED_TO_BASKET",
498
- shop: t,
561
+ shop: e,
499
562
  anonymousUserId: I,
500
- bundleId: _,
501
- productVariantIds: S,
502
- grossPrice: M,
503
- discountedPrice: l,
504
- currency: Ae ?? void 0,
505
- discountThresholdIdentifier: C,
506
- discountLabel: N,
507
- discountPercentage: o,
508
- discountedAmount: p,
563
+ 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,
509
572
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
510
- checkout: K,
511
- mixpanelEvent: K ? "checkout_started_with_bundle" : "bundle_added_to_cart"
573
+ checkout: lt,
574
+ mixpanelEvent: lt ? "checkout_started_with_bundle" : "bundle_added_to_cart"
512
575
  });
513
576
  } catch {
514
577
  }
515
- Ve(), B(), (D = u == null ? void 0 : u.onComplete) == null || D.call(u);
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();
516
584
  } finally {
517
- te(!1);
585
+ z(!1);
518
586
  }
519
587
  }, [
520
- E,
521
- Oe,
522
- Le,
523
- i,
524
- Ve,
525
- B,
526
- g,
527
- Ae,
528
- J,
529
- Ie,
530
- Te,
531
- _e,
532
- t
533
- ]), Ze = me(async () => {
534
- await We({
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({
535
605
  onComplete: () => {
536
- var u;
537
- (u = i.openCartUI) == null || u.call(i);
606
+ var n;
607
+ (n = o.openCartUI) == null || n.call(o);
538
608
  }
539
609
  });
540
- }, [i, We]), Ue = me(async () => {
541
- await We({
610
+ }, [o, Qt]), ie = K(async () => {
611
+ await Qt({
542
612
  checkout: !0,
543
613
  onComplete: () => {
544
- var u;
545
- (u = i.navigateToCheckout) == null || u.call(i);
614
+ var n;
615
+ (n = o.navigateToCheckout) == null || n.call(o);
546
616
  }
547
617
  });
548
- }, [i, We]), Je = A(() => ({
549
- isOpen: le,
550
- open: pe,
551
- openForHandle: z,
552
- close: B,
553
- toggle: Pe,
554
- currentHandle: J,
555
- setConfigHandle: L,
556
- loadHandle: Ce,
557
- loading: W,
558
- submitting: j,
559
- error: re,
560
- currencyCode: Ae,
561
- config: g,
562
- eligibleVariants: Te,
563
- selections: _e,
564
- selectionOrder: Xe,
565
- setQuantity: Qe,
566
- clearSelections: Ve,
567
- bundleSize: Oe,
568
- minRequired: se,
569
- canSubmit: Le,
570
- submit: Ze,
571
- submitAndCheckout: Ue
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
572
644
  }), [
573
- Oe,
574
- Le,
575
- Ve,
576
- B,
577
- g,
578
- Ae,
579
- J,
580
- Te,
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,
581
659
  re,
582
- le,
660
+ Bt,
583
661
  W,
584
- se,
585
- pe,
586
- z,
587
- Xe,
588
- _e,
589
- L,
590
- Ce,
591
- Qe,
592
- Ze,
593
- Ue,
594
- j,
595
- Pe
662
+ Jt,
663
+ ee,
664
+ ne,
665
+ ce,
666
+ ae,
667
+ ie,
668
+ J,
669
+ rt
596
670
  ]);
597
- return /* @__PURE__ */ s(Nt.Provider, { value: Je, children: Z });
671
+ return /* @__PURE__ */ l(De.Provider, { value: c, children: O });
598
672
  }
599
- function rt() {
600
- const a = kt(Nt);
673
+ function be() {
674
+ const a = Ve(De);
601
675
  if (!a)
602
676
  throw new Error("useBundleBuilder must be used within <BundleProvider />");
603
677
  return a;
604
678
  }
605
- function Wr() {
606
- const { isOpen: a, open: e, close: t, toggle: i } = rt();
607
- return { isOpen: a, open: e, close: t, toggle: i };
679
+ function ci() {
680
+ const { isOpen: a, open: t, close: e, toggle: o } = be();
681
+ return { isOpen: a, open: t, close: e, toggle: o };
608
682
  }
609
- const $t = "_button_18rtl_1", Et = {
610
- button: $t
683
+ const Ke = "_button_18rtl_1", Xe = {
684
+ button: Ke
611
685
  };
612
- function Ur(a) {
613
- const { toggle: e } = rt();
614
- return /* @__PURE__ */ s(
686
+ function ui(a) {
687
+ const { toggle: t } = be();
688
+ return /* @__PURE__ */ l(
615
689
  "button",
616
690
  {
617
691
  type: "button",
618
- onClick: e,
619
- className: [Et.button, a.className].filter(Boolean).join(" "),
692
+ onClick: t,
693
+ className: [Xe.button, a.className].filter(Boolean).join(" "),
620
694
  children: a.children ?? "Build a bundle"
621
695
  }
622
696
  );
623
697
  }
624
- var st, gt;
625
- function qt() {
626
- if (gt) return st;
627
- gt = 1;
698
+ var ge, Pe;
699
+ function Je() {
700
+ if (Pe) return ge;
701
+ Pe = 1;
628
702
  var a = {
629
- linear: function(e, t, i, r) {
630
- var n = i - t;
631
- return n * e / r + t;
703
+ linear: function(t, e, o, i) {
704
+ var r = o - e;
705
+ return r * t / i + e;
632
706
  },
633
- easeInQuad: function(e, t, i, r) {
634
- var n = i - t;
635
- return n * (e /= r) * e + t;
707
+ easeInQuad: function(t, e, o, i) {
708
+ var r = o - e;
709
+ return r * (t /= i) * t + e;
636
710
  },
637
- easeOutQuad: function(e, t, i, r) {
638
- var n = i - t;
639
- return -n * (e /= r) * (e - 2) + t;
711
+ easeOutQuad: function(t, e, o, i) {
712
+ var r = o - e;
713
+ return -r * (t /= i) * (t - 2) + e;
640
714
  },
641
- easeInOutQuad: function(e, t, i, r) {
642
- var n = i - t;
643
- return (e /= r / 2) < 1 ? n / 2 * e * e + t : -n / 2 * (--e * (e - 2) - 1) + t;
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;
644
718
  },
645
- easeInCubic: function(e, t, i, r) {
646
- var n = i - t;
647
- return n * (e /= r) * e * e + t;
719
+ easeInCubic: function(t, e, o, i) {
720
+ var r = o - e;
721
+ return r * (t /= i) * t * t + e;
648
722
  },
649
- easeOutCubic: function(e, t, i, r) {
650
- var n = i - t;
651
- return n * ((e = e / r - 1) * e * e + 1) + t;
723
+ easeOutCubic: function(t, e, o, i) {
724
+ var r = o - e;
725
+ return r * ((t = t / i - 1) * t * t + 1) + e;
652
726
  },
653
- easeInOutCubic: function(e, t, i, r) {
654
- var n = i - t;
655
- return (e /= r / 2) < 1 ? n / 2 * e * e * e + t : n / 2 * ((e -= 2) * e * e + 2) + t;
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;
656
730
  },
657
- easeInQuart: function(e, t, i, r) {
658
- var n = i - t;
659
- return n * (e /= r) * e * e * e + t;
731
+ easeInQuart: function(t, e, o, i) {
732
+ var r = o - e;
733
+ return r * (t /= i) * t * t * t + e;
660
734
  },
661
- easeOutQuart: function(e, t, i, r) {
662
- var n = i - t;
663
- return -n * ((e = e / r - 1) * e * e * e - 1) + t;
735
+ easeOutQuart: function(t, e, o, i) {
736
+ var r = o - e;
737
+ return -r * ((t = t / i - 1) * t * t * t - 1) + e;
664
738
  },
665
- easeInOutQuart: function(e, t, i, r) {
666
- var n = i - t;
667
- return (e /= r / 2) < 1 ? n / 2 * e * e * e * e + t : -n / 2 * ((e -= 2) * e * e * e - 2) + t;
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;
668
742
  },
669
- easeInQuint: function(e, t, i, r) {
670
- var n = i - t;
671
- return n * (e /= r) * e * e * e * e + t;
743
+ easeInQuint: function(t, e, o, i) {
744
+ var r = o - e;
745
+ return r * (t /= i) * t * t * t * t + e;
672
746
  },
673
- easeOutQuint: function(e, t, i, r) {
674
- var n = i - t;
675
- return n * ((e = e / r - 1) * e * e * e * e + 1) + t;
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;
676
750
  },
677
- easeInOutQuint: function(e, t, i, r) {
678
- var n = i - t;
679
- return (e /= r / 2) < 1 ? n / 2 * e * e * e * e * e + t : n / 2 * ((e -= 2) * e * e * e * e + 2) + t;
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;
680
754
  },
681
- easeInSine: function(e, t, i, r) {
682
- var n = i - t;
683
- return -n * Math.cos(e / r * (Math.PI / 2)) + n + t;
755
+ easeInSine: function(t, e, o, i) {
756
+ var r = o - e;
757
+ return -r * Math.cos(t / i * (Math.PI / 2)) + r + e;
684
758
  },
685
- easeOutSine: function(e, t, i, r) {
686
- var n = i - t;
687
- return n * Math.sin(e / r * (Math.PI / 2)) + t;
759
+ easeOutSine: function(t, e, o, i) {
760
+ var r = o - e;
761
+ return r * Math.sin(t / i * (Math.PI / 2)) + e;
688
762
  },
689
- easeInOutSine: function(e, t, i, r) {
690
- var n = i - t;
691
- return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t;
763
+ easeInOutSine: function(t, e, o, i) {
764
+ var r = o - e;
765
+ return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + e;
692
766
  },
693
- easeInExpo: function(e, t, i, r) {
694
- var n = i - t;
695
- return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t;
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;
696
770
  },
697
- easeOutExpo: function(e, t, i, r) {
698
- var n = i - t;
699
- return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t;
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;
700
774
  },
701
- easeInOutExpo: function(e, t, i, r) {
702
- var n = i - t;
703
- return e === 0 ? t : e === r ? t + n : (e /= r / 2) < 1 ? n / 2 * Math.pow(2, 10 * (e - 1)) + t : n / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
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;
704
778
  },
705
- easeInCirc: function(e, t, i, r) {
706
- var n = i - t;
707
- return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t;
779
+ easeInCirc: function(t, e, o, i) {
780
+ var r = o - e;
781
+ return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + e;
708
782
  },
709
- easeOutCirc: function(e, t, i, r) {
710
- var n = i - t;
711
- return n * Math.sqrt(1 - (e = e / r - 1) * e) + t;
783
+ easeOutCirc: function(t, e, o, i) {
784
+ var r = o - e;
785
+ return r * Math.sqrt(1 - (t = t / i - 1) * t) + e;
712
786
  },
713
- easeInOutCirc: function(e, t, i, r) {
714
- var n = i - t;
715
- return (e /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + t : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
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;
716
790
  },
717
- easeInElastic: function(e, t, i, r) {
718
- var n = i - t, d, c, k;
719
- return k = 1.70158, c = 0, d = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), d < Math.abs(n) ? (d = n, k = c / 4) : k = c / (2 * Math.PI) * Math.asin(n / d), -(d * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - k) * (2 * Math.PI) / c)) + t);
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);
720
794
  },
721
- easeOutElastic: function(e, t, i, r) {
722
- var n = i - t, d, c, k;
723
- return k = 1.70158, c = 0, d = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), d < Math.abs(n) ? (d = n, k = c / 4) : k = c / (2 * Math.PI) * Math.asin(n / d), d * Math.pow(2, -10 * e) * Math.sin((e * r - k) * (2 * Math.PI) / c) + n + t);
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);
724
798
  },
725
- easeInOutElastic: function(e, t, i, r) {
726
- var n = i - t, d, c, k;
727
- return k = 1.70158, c = 0, d = n, e === 0 ? t : (e /= r / 2) === 2 ? t + n : (c || (c = r * (0.3 * 1.5)), d < Math.abs(n) ? (d = n, k = c / 4) : k = c / (2 * Math.PI) * Math.asin(n / d), e < 1 ? -0.5 * (d * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - k) * (2 * Math.PI) / c)) + t : d * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - k) * (2 * Math.PI) / c) * 0.5 + n + t);
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);
728
802
  },
729
- easeInBack: function(e, t, i, r, n) {
730
- var d = i - t;
731
- return n === void 0 && (n = 1.70158), d * (e /= r) * e * ((n + 1) * e - n) + t;
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;
732
806
  },
733
- easeOutBack: function(e, t, i, r, n) {
734
- var d = i - t;
735
- return n === void 0 && (n = 1.70158), d * ((e = e / r - 1) * e * ((n + 1) * e + n) + 1) + t;
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;
736
810
  },
737
- easeInOutBack: function(e, t, i, r, n) {
738
- var d = i - t;
739
- return n === void 0 && (n = 1.70158), (e /= r / 2) < 1 ? d / 2 * (e * e * (((n *= 1.525) + 1) * e - n)) + t : d / 2 * ((e -= 2) * e * (((n *= 1.525) + 1) * e + n) + 2) + t;
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;
740
814
  },
741
- easeInBounce: function(e, t, i, r) {
742
- var n = i - t, d;
743
- return d = a.easeOutBounce(r - e, 0, n, r), n - d + t;
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;
744
818
  },
745
- easeOutBounce: function(e, t, i, r) {
746
- var n = i - t;
747
- return (e /= r) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
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;
748
822
  },
749
- easeInOutBounce: function(e, t, i, r) {
750
- var n = i - t, d;
751
- return e < r / 2 ? (d = a.easeInBounce(e * 2, 0, n, r), d * 0.5 + t) : (d = a.easeOutBounce(e * 2 - r, 0, n, r), d * 0.5 + n * 0.5 + t);
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);
752
826
  }
753
827
  };
754
- return st = a, st;
828
+ return ge = a, ge;
755
829
  }
756
- var zt = qt();
757
- function Vt(a) {
830
+ var Ze = Je();
831
+ function tn(a) {
758
832
  return a * Math.PI / 180;
759
833
  }
760
- function ye(a, e) {
761
- return a + Math.random() * (e - a);
834
+ function _t(a, t) {
835
+ return a + Math.random() * (t - a);
762
836
  }
763
- function jt(a, e) {
764
- return Math.floor(a + Math.random() * (e - a + 1));
837
+ function en(a, t) {
838
+ return Math.floor(a + Math.random() * (t - a + 1));
765
839
  }
766
- var Ye;
840
+ var se;
767
841
  (function(a) {
768
842
  a[a.Circle = 0] = "Circle", a[a.Square = 1] = "Square", a[a.Strip = 2] = "Strip";
769
- })(Ye || (Ye = {}));
770
- var Ee;
843
+ })(se || (se = {}));
844
+ var Vt;
771
845
  (function(a) {
772
846
  a[a.Positive = 1] = "Positive", a[a.Negative = -1] = "Negative";
773
- })(Ee || (Ee = {}));
774
- const Wt = 1e3 / 60;
775
- class Ut {
776
- constructor(e, t, i, r) {
777
- this.getOptions = t;
778
- const { colors: n, initialVelocityX: d, initialVelocityY: c } = this.getOptions();
779
- this.context = e, this.x = i, this.y = r, this.w = ye(5, 20), this.h = ye(5, 20), this.radius = ye(5, 10), this.vx = typeof d == "number" ? ye(-d, d) : ye(d.min, d.max), this.vy = typeof c == "number" ? ye(-c, 0) : ye(c.min, c.max), this.shape = jt(0, 2), this.angle = Vt(ye(0, 360)), this.angularSpin = ye(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = ye(0, 1), this.rotationDirection = ye(0, 1) ? Ee.Positive : Ee.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;
780
854
  }
781
- update(e) {
782
- const { gravity: t, wind: i, friction: r, opacity: n, drawShape: d } = this.getOptions(), c = e / Wt;
783
- this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx += i * c, this.vx *= r ** c, this.vy *= r ** c, this.rotateY >= 1 && this.rotationDirection === Ee.Positive ? this.rotationDirection = Ee.Negative : this.rotateY <= -1 && this.rotationDirection === Ee.Negative && (this.rotationDirection = Ee.Positive);
784
- const k = 0.1 * this.rotationDirection * c;
785
- if (this.rotateY += k, this.angle += this.angularSpin, this.context.save(), this.context.translate(this.x, this.y), this.context.rotate(this.angle), this.context.scale(1, this.rotateY), this.context.rotate(this.angle), this.context.beginPath(), this.context.fillStyle = this.color, this.context.strokeStyle = this.color, this.context.globalAlpha = n, this.context.lineCap = "round", this.context.lineWidth = 2, d && typeof d == "function")
786
- d.call(this, this.context);
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);
787
861
  else
788
862
  switch (this.shape) {
789
- case Ye.Circle: {
863
+ case se.Circle: {
790
864
  this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
791
865
  break;
792
866
  }
793
- case Ye.Square: {
867
+ case se.Square: {
794
868
  this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
795
869
  break;
796
870
  }
797
- case Ye.Strip: {
871
+ case se.Strip: {
798
872
  this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
799
873
  break;
800
874
  }
@@ -802,39 +876,39 @@ class Ut {
802
876
  this.context.closePath(), this.context.restore();
803
877
  }
804
878
  }
805
- class Ht {
806
- constructor(e, t) {
807
- this.x = 0, this.y = 0, this.w = 0, this.h = 0, this.lastNumberOfPieces = 0, this.tweenProgress = 0, this.tweenFrom = 0, this.particles = [], this.particlesGenerated = 0, this.removeParticleAt = (r) => {
808
- this.particles.splice(r, 1);
879
+ class an {
880
+ constructor(t, e) {
881
+ 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
+ this.particles.splice(i, 1);
809
883
  }, this.getParticle = () => {
810
- const r = ye(this.x, this.w + this.x), n = ye(this.y, this.h + this.y);
811
- return new Ut(this.context, this.getOptions, r, n);
812
- }, this.animate = (r) => {
813
- const { canvas: n, context: d, particlesGenerated: c, lastNumberOfPieces: k } = this, { run: Y, recycle: P, numberOfPieces: Z, debug: O, tweenFunction: E, tweenDuration: X } = this.getOptions();
814
- if (!Y)
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);
886
+ }, 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)
815
889
  return !1;
816
- const le = this.particles.length, ce = P ? le : c;
817
- if (ce < Z) {
818
- k !== Z && (this.tweenProgress = 0, this.tweenFrom = ce, this.lastNumberOfPieces = Z), this.tweenProgress = Math.min(X, Math.max(0, this.tweenProgress + r));
819
- const j = E(this.tweenProgress, this.tweenFrom, Z, X), te = Math.round(j - ce);
820
- for (let re = 0; re < te; re++)
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++)
821
895
  this.particles.push(this.getParticle());
822
- this.particlesGenerated += te;
896
+ this.particlesGenerated += z;
823
897
  }
824
- O && (d.font = "12px sans-serif", d.fillStyle = "#333", d.textAlign = "right", d.fillText(`Particles: ${le}`, n.width - 10, n.height - 20));
825
- for (let j = this.particles.length - 1; j >= 0; j--) {
826
- const te = this.particles[j];
827
- te.update(r), (te.y > n.height || te.y < -100 || te.x > n.width + 100 || te.x < -100) && (P && ce <= Z ? this.particles[j] = this.getParticle() : this.removeParticleAt(j));
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));
828
902
  }
829
- return le > 0 || ce < Z;
830
- }, this.canvas = e;
831
- const i = this.canvas.getContext("2d");
832
- if (!i)
903
+ return X > 0 || ot < O;
904
+ }, this.canvas = t;
905
+ const o = this.canvas.getContext("2d");
906
+ if (!o)
833
907
  throw new Error("Could not get canvas context");
834
- this.context = i, this.getOptions = t;
908
+ this.context = o, this.getOptions = e;
835
909
  }
836
910
  }
837
- const ht = {
911
+ const Ie = {
838
912
  width: typeof window < "u" ? window.innerWidth : 300,
839
913
  height: typeof window < "u" ? window.innerHeight : 200,
840
914
  numberOfPieces: 200,
@@ -864,15 +938,15 @@ const ht = {
864
938
  ],
865
939
  opacity: 1,
866
940
  debug: !1,
867
- tweenFunction: zt.easeInOutQuad,
941
+ tweenFunction: Ze.easeInOutQuad,
868
942
  tweenDuration: 5e3,
869
943
  recycle: !0,
870
944
  run: !0
871
945
  };
872
- class Gt {
873
- constructor(e, t) {
874
- this.lastFrameTime = 0, this.setOptionsWithDefaults = (r) => {
875
- const n = {
946
+ class on {
947
+ constructor(t, e) {
948
+ this.lastFrameTime = 0, this.setOptionsWithDefaults = (i) => {
949
+ const r = {
876
950
  confettiSource: {
877
951
  x: 0,
878
952
  y: 0,
@@ -881,56 +955,56 @@ class Gt {
881
955
  }
882
956
  };
883
957
  this._options = {
884
- ...n,
885
- ...ht,
886
- ...r
887
- }, Object.assign(this, r.confettiSource);
888
- }, this.update = (r = 0) => {
889
- const { options: { run: n, onConfettiComplete: d, frameRate: c }, canvas: k, context: Y } = this, P = Math.min(r - this.lastFrameTime, 50);
890
- if (c && P < 1e3 / c) {
958
+ ...r,
959
+ ...Ie,
960
+ ...i
961
+ }, Object.assign(this, i.confettiSource);
962
+ }, 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) {
891
965
  this.rafId = requestAnimationFrame(this.update);
892
966
  return;
893
967
  }
894
- this.lastFrameTime = r - (c ? P % c : 0), n && (Y.fillStyle = "white", Y.clearRect(0, 0, k.width, k.height)), this.generator.animate(P) ? this.rafId = requestAnimationFrame(this.update) : (d && typeof d == "function" && this.generator.particlesGenerated > 0 && d.call(this, this), this._options.run = !1);
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);
895
969
  }, this.reset = () => {
896
970
  this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
897
971
  }, this.stop = () => {
898
972
  this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
899
- }, this.canvas = e;
900
- const i = this.canvas.getContext("2d");
901
- if (!i)
973
+ }, this.canvas = t;
974
+ const o = this.canvas.getContext("2d");
975
+ if (!o)
902
976
  throw new Error("Could not get canvas context");
903
- this.context = i, this.generator = new Ht(this.canvas, () => this.options), this.options = t, this.update();
977
+ this.context = o, this.generator = new an(this.canvas, () => this.options), this.options = e, this.update();
904
978
  }
905
979
  get options() {
906
980
  return this._options;
907
981
  }
908
- set options(e) {
909
- var r, n;
910
- const t = (r = this._options) == null ? void 0 : r.run, i = (n = this._options) == null ? void 0 : n.recycle;
911
- this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && i === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
982
+ set options(t) {
983
+ 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();
912
986
  }
913
987
  }
914
- const Qt = at.createRef();
915
- class mt extends at.Component {
916
- constructor(e) {
917
- super(e), this.canvas = at.createRef(), this.canvas = e.canvasRef || Qt;
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;
918
992
  }
919
993
  componentDidMount() {
920
994
  if (this.canvas.current) {
921
- const e = lt(this.props)[0];
922
- this.confetti = new Gt(this.canvas.current, e);
995
+ const t = we(this.props)[0];
996
+ this.confetti = new on(this.canvas.current, t);
923
997
  }
924
998
  }
925
999
  componentDidUpdate() {
926
- const e = lt(this.props)[0];
927
- this.confetti && (this.confetti.options = e);
1000
+ const t = we(this.props)[0];
1001
+ this.confetti && (this.confetti.options = t);
928
1002
  }
929
1003
  componentWillUnmount() {
930
1004
  this.confetti && this.confetti.stop(), this.confetti = void 0;
931
1005
  }
932
1006
  render() {
933
- const [e, t] = lt(this.props), i = {
1007
+ const [t, e] = we(this.props), o = {
934
1008
  zIndex: 2,
935
1009
  position: "absolute",
936
1010
  pointerEvents: "none",
@@ -938,45 +1012,45 @@ class mt extends at.Component {
938
1012
  left: 0,
939
1013
  bottom: 0,
940
1014
  right: 0,
941
- ...t.style
1015
+ ...e.style
942
1016
  };
943
- return s("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: i });
1017
+ return l("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style: o });
944
1018
  }
945
1019
  }
946
- mt.defaultProps = {
947
- ...ht
1020
+ Ne.defaultProps = {
1021
+ ...Ie
948
1022
  };
949
- mt.displayName = "ReactConfetti";
950
- function lt(a) {
951
- const e = {}, t = {}, i = {}, r = [
952
- ...Object.keys(ht),
1023
+ Ne.displayName = "ReactConfetti";
1024
+ function we(a) {
1025
+ const t = {}, e = {}, o = {}, i = [
1026
+ ...Object.keys(Ie),
953
1027
  "confettiSource",
954
1028
  "drawShape",
955
1029
  "onConfettiComplete",
956
1030
  "frameRate"
957
- ], n = ["canvasRef"];
958
- for (const d in a) {
959
- const c = a[d];
960
- r.includes(d) ? e[d] = c : n.includes(d) ? n[d] = c : i[d] = c;
1031
+ ], 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;
961
1035
  }
962
- return [e, i, t];
1036
+ return [t, o, e];
963
1037
  }
964
- const Kt = at.forwardRef((a, e) => s(mt, { canvasRef: e, ...a }));
1038
+ const ln = fe.forwardRef((a, t) => l(Ne, { canvasRef: t, ...a }));
965
1039
  /**
966
1040
  * @license lucide-react v0.515.0 - ISC
967
1041
  *
968
1042
  * This source code is licensed under the ISC license.
969
1043
  * See the LICENSE file in the root directory of this source tree.
970
1044
  */
971
- const Yt = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xt = (a) => a.replace(
1045
+ const cn = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), un = (a) => a.replace(
972
1046
  /^([A-Z])|[\s-_]+(\w)/g,
973
- (e, t, i) => i ? i.toUpperCase() : t.toLowerCase()
974
- ), xt = (a) => {
975
- const e = Xt(a);
976
- return e.charAt(0).toUpperCase() + e.slice(1);
977
- }, Bt = (...a) => a.filter((e, t, i) => !!e && e.trim() !== "" && i.indexOf(e) === t).join(" ").trim(), Zt = (a) => {
978
- for (const e in a)
979
- if (e.startsWith("aria-") || e === "role" || e === "title")
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")
980
1054
  return !0;
981
1055
  };
982
1056
  /**
@@ -985,7 +1059,7 @@ const Yt = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xt = (
985
1059
  * This source code is licensed under the ISC license.
986
1060
  * See the LICENSE file in the root directory of this source tree.
987
1061
  */
988
- var Jt = {
1062
+ var hn = {
989
1063
  xmlns: "http://www.w3.org/2000/svg",
990
1064
  width: 24,
991
1065
  height: 24,
@@ -1002,32 +1076,32 @@ var Jt = {
1002
1076
  * This source code is licensed under the ISC license.
1003
1077
  * See the LICENSE file in the root directory of this source tree.
1004
1078
  */
1005
- const en = St(
1079
+ const mn = $e(
1006
1080
  ({
1007
1081
  color: a = "currentColor",
1008
- size: e = 24,
1009
- strokeWidth: t = 2,
1010
- absoluteStrokeWidth: i,
1011
- className: r = "",
1012
- children: n,
1013
- iconNode: d,
1014
- ...c
1015
- }, k) => dt(
1082
+ size: t = 24,
1083
+ strokeWidth: e = 2,
1084
+ absoluteStrokeWidth: o,
1085
+ className: i = "",
1086
+ children: r,
1087
+ iconNode: m,
1088
+ ...d
1089
+ }, S) => Ce(
1016
1090
  "svg",
1017
1091
  {
1018
- ref: k,
1019
- ...Jt,
1020
- width: e,
1021
- height: e,
1092
+ ref: S,
1093
+ ...hn,
1094
+ width: t,
1095
+ height: t,
1022
1096
  stroke: a,
1023
- strokeWidth: i ? Number(t) * 24 / Number(e) : t,
1024
- className: Bt("lucide", r),
1025
- ...!n && !Zt(c) && { "aria-hidden": "true" },
1026
- ...c
1097
+ strokeWidth: o ? Number(e) * 24 / Number(t) : e,
1098
+ className: Ee("lucide", i),
1099
+ ...!r && !dn(d) && { "aria-hidden": "true" },
1100
+ ...d
1027
1101
  },
1028
1102
  [
1029
- ...d.map(([Y, P]) => dt(Y, P)),
1030
- ...Array.isArray(n) ? n : [n]
1103
+ ...m.map(([ct, A]) => Ce(ct, A)),
1104
+ ...Array.isArray(r) ? r : [r]
1031
1105
  ]
1032
1106
  )
1033
1107
  );
@@ -1037,20 +1111,20 @@ const en = St(
1037
1111
  * This source code is licensed under the ISC license.
1038
1112
  * See the LICENSE file in the root directory of this source tree.
1039
1113
  */
1040
- const ft = (a, e) => {
1041
- const t = St(
1042
- ({ className: i, ...r }, n) => dt(en, {
1043
- ref: n,
1044
- iconNode: e,
1045
- className: Bt(
1046
- `lucide-${Yt(xt(a))}`,
1114
+ const Se = (a, t) => {
1115
+ const e = $e(
1116
+ ({ className: o, ...i }, r) => Ce(mn, {
1117
+ ref: r,
1118
+ iconNode: t,
1119
+ className: Ee(
1120
+ `lucide-${cn(Fe(a))}`,
1047
1121
  `lucide-${a}`,
1048
- i
1122
+ o
1049
1123
  ),
1050
- ...r
1124
+ ...i
1051
1125
  })
1052
1126
  );
1053
- return t.displayName = xt(a), t;
1127
+ return e.displayName = Fe(a), e;
1054
1128
  };
1055
1129
  /**
1056
1130
  * @license lucide-react v0.515.0 - ISC
@@ -1058,323 +1132,327 @@ const ft = (a, e) => {
1058
1132
  * This source code is licensed under the ISC license.
1059
1133
  * See the LICENSE file in the root directory of this source tree.
1060
1134
  */
1061
- const tn = [
1135
+ const fn = [
1062
1136
  ["path", { d: "M5 12h14", key: "1ays0h" }],
1063
1137
  ["path", { d: "M12 5v14", key: "s699le" }]
1064
- ], Ct = ft("plus", tn);
1138
+ ], Oe = Se("plus", fn);
1065
1139
  /**
1066
1140
  * @license lucide-react v0.515.0 - ISC
1067
1141
  *
1068
1142
  * This source code is licensed under the ISC license.
1069
1143
  * See the LICENSE file in the root directory of this source tree.
1070
1144
  */
1071
- const nn = [
1145
+ const bn = [
1072
1146
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
1073
1147
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
1074
- ], an = ft("search", nn);
1148
+ ], pn = Se("search", bn);
1075
1149
  /**
1076
1150
  * @license lucide-react v0.515.0 - ISC
1077
1151
  *
1078
1152
  * This source code is licensed under the ISC license.
1079
1153
  * See the LICENSE file in the root directory of this source tree.
1080
1154
  */
1081
- const rn = [
1155
+ const _n = [
1082
1156
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
1083
1157
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
1084
1158
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
1085
1159
  ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
1086
1160
  ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
1087
- ], on = ft("trash-2", rn), sn = "_backdrop_18x6y_1", ln = "_celebrationOverlay_18x6y_14", cn = "_celebrationChip_18x6y_23", un = "_backdropOpen_18x6y_74", dn = "_backdropClosed_18x6y_78", hn = "_panel_18x6y_82", mn = "_panelOpen_18x6y_103", fn = "_panelClosed_18x6y_107", bn = "_header_18x6y_146", pn = "_headerCenter_18x6y_155", _n = "_title_18x6y_163", yn = "_searchIconButton_18x6y_172", wn = "_headerTitleWrap_18x6y_195", vn = "_headerSearchWrap_18x6y_199", gn = "_headerSearchOpen_18x6y_211", xn = "_searchBar_18x6y_223", Cn = "_searchInput_18x6y_235", In = "_searchClearButton_18x6y_256", Sn = "_closeButton_18x6y_278", Nn = "_body_18x6y_312", Bn = "_muted_18x6y_317", Tn = "_error_18x6y_322", kn = "_variants_18x6y_327", Rn = "_variantList_18x6y_331", Pn = "_variantRow_18x6y_339", On = "_variantRowSoldOut_18x6y_347", Fn = "_variantLeft_18x6y_351", Mn = "_addToBundleButton_18x6y_358", An = "_soldOutContainer_18x6y_386", Ln = "_soldOut_18x6y_386", Dn = "_variantThumb_18x6y_403", $n = "_variantThumbImg_18x6y_413", En = "_variantThumbFallback_18x6y_420", qn = "_variantInfo_18x6y_430", zn = "_variantName_18x6y_434", Vn = "_variantMeta_18x6y_443", jn = "_variantPriceRow_18x6y_451", Wn = "_variantCompareAt_18x6y_458", Un = "_variantPrice_18x6y_451", Hn = "_qtyControls_18x6y_469", Gn = "_qtyButton_18x6y_475", Qn = "_qtyValue_18x6y_501", Kn = "_footer_18x6y_508", Yn = "_poweredBy_18x6y_516", Xn = "_boxSummaryWindow_18x6y_528", Zn = "_boxSummaryRow_18x6y_546", Jn = "_boxSlot_18x6y_554", ea = "_boxItem_18x6y_563", ta = "_boxItemClickable_18x6y_575", na = "_boxThresholdLabel_18x6y_584", aa = "_boxItemPlaceholder_18x6y_595", ra = "_boxItemFilled_18x6y_601", ia = "_boxItemThreshold_18x6y_607", oa = "_boxItemDiscountText_18x6y_615", sa = "_boxItemPlus_18x6y_623", la = "_boxItemImage_18x6y_630", ca = "_boxItemFallback_18x6y_637", ua = "_ctaButtonGroup_18x6y_648", da = "_ctaButtonGroupAnimating_18x6y_655", ha = "_cta_18x6y_648", ma = "_ctaDualLeft_18x6y_683", fa = "_ctaDualLeftAnimating_18x6y_701", ba = "_ctaDualRight_18x6y_714", pa = "_ctaDualRightAnimating_18x6y_730", _a = "_ctaTotals_18x6y_741", ya = "_ctaDiscountBadge_18x6y_749", wa = "_ctaTotalsWrap_18x6y_763", va = "_ctaTotalsWrapVisible_18x6y_776", ga = "_ctaTotalsStrike_18x6y_783", xa = "_ctaTotalsPrice_18x6y_790", h = {
1088
- backdrop: sn,
1089
- celebrationOverlay: ln,
1090
- celebrationChip: cn,
1091
- backdropOpen: un,
1092
- backdropClosed: dn,
1093
- panel: hn,
1094
- panelOpen: mn,
1095
- panelClosed: fn,
1096
- header: bn,
1097
- headerCenter: pn,
1098
- title: _n,
1099
- searchIconButton: yn,
1100
- headerTitleWrap: wn,
1101
- headerSearchWrap: vn,
1102
- headerSearchOpen: gn,
1103
- searchBar: xn,
1104
- searchInput: Cn,
1105
- searchClearButton: In,
1106
- closeButton: Sn,
1107
- body: Nn,
1108
- muted: Bn,
1109
- error: Tn,
1110
- variants: kn,
1111
- variantList: Rn,
1112
- variantRow: Pn,
1113
- variantRowSoldOut: On,
1114
- variantLeft: Fn,
1115
- addToBundleButton: Mn,
1116
- soldOutContainer: An,
1117
- soldOut: Ln,
1118
- variantThumb: Dn,
1119
- variantThumbImg: $n,
1120
- variantThumbFallback: En,
1121
- variantInfo: qn,
1122
- variantName: zn,
1123
- variantMeta: Vn,
1124
- variantPriceRow: jn,
1125
- variantCompareAt: Wn,
1126
- variantPrice: Un,
1127
- qtyControls: Hn,
1128
- qtyButton: Gn,
1129
- qtyValue: Qn,
1130
- footer: Kn,
1131
- poweredBy: Yn,
1132
- boxSummaryWindow: Xn,
1133
- boxSummaryRow: Zn,
1134
- boxSlot: Jn,
1135
- boxItem: ea,
1136
- boxItemClickable: ta,
1137
- boxThresholdLabel: na,
1138
- boxItemPlaceholder: aa,
1139
- boxItemFilled: ra,
1140
- boxItemThreshold: ia,
1141
- boxItemDiscountText: oa,
1142
- boxItemPlus: sa,
1143
- boxItemImage: la,
1144
- boxItemFallback: ca,
1145
- ctaButtonGroup: ua,
1146
- ctaButtonGroupAnimating: da,
1147
- cta: ha,
1148
- ctaDualLeft: ma,
1149
- ctaDualLeftAnimating: fa,
1150
- ctaDualRight: ba,
1151
- ctaDualRightAnimating: pa,
1152
- ctaTotals: _a,
1153
- ctaDiscountBadge: ya,
1154
- ctaTotalsWrap: wa,
1155
- ctaTotalsWrapVisible: va,
1156
- ctaTotalsStrike: ga,
1157
- ctaTotalsPrice: xa
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
1158
1235
  };
1159
- function Hr(a) {
1160
- var ae, V;
1236
+ function di(a) {
1237
+ var ae, ie;
1161
1238
  const {
1162
- isOpen: e,
1163
- close: t,
1164
- loading: i,
1165
- submitting: r,
1166
- error: n,
1167
- currencyCode: d,
1168
- config: c,
1169
- eligibleVariants: k,
1170
- selections: Y,
1171
- selectionOrder: P,
1172
- setQuantity: Z,
1173
- bundleSize: O,
1174
- minRequired: E,
1239
+ isOpen: t,
1240
+ close: e,
1241
+ loading: o,
1242
+ submitting: i,
1243
+ 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,
1175
1253
  canSubmit: X,
1176
- submit: le,
1177
- submitAndCheckout: ce
1178
- } = rt(), [j, te] = G(!1), [re, ie] = G(""), J = U(null), H = U(null), ee = U(null), [fe, ue] = G(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Fe, Me] = G(0), [be, Ge] = G(null), [Ne, ve] = G(!1), ge = U(null), qe = U(O), ke = 7e3, [ze, je] = G(0), [Be, oe] = G(null), [xe, Re] = G(!1), de = U(null), m = 2800, b = [
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, _ = [
1179
1257
  "#2563eb",
1180
1258
  "#3b82f6",
1181
1259
  "#60a5fa",
1182
1260
  "#93c5fd",
1183
1261
  "#bae6fd",
1184
1262
  "#e0f2fe"
1185
- ], w = A(() => {
1186
- var l;
1187
- const o = (l = c == null ? void 0 : c.styleSettings) == null ? void 0 : l.confettiColors;
1188
- return Array.isArray(o) && o.length >= 6 ? o.slice(0, 6).map(
1189
- (p, S) => typeof p == "string" && p.trim() ? p : b[S]
1190
- ) : [...b];
1191
- }, [(ae = c == null ? void 0 : c.styleSettings) == null ? void 0 : ae.confettiColors]), L = (o) => {
1192
- const l = Number.parseFloat(o);
1193
- return Number.isFinite(l) ? String(Math.round(l)) : o;
1194
- }, B = (o) => {
1195
- const l = (o ?? []).filter((p) => {
1196
- var N, x;
1197
- const S = (N = p == null ? void 0 : p.name) == null ? void 0 : N.trim(), C = (x = p == null ? void 0 : p.value) == null ? void 0 : x.trim();
1198
- return !(!S || !C || S.toLowerCase() === "title");
1263
+ ], w = T(() => {
1264
+ var n;
1265
+ const c = (n = d == null ? void 0 : d.styleSettings) == null ? void 0 : n.confettiColors;
1266
+ 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");
1199
1277
  });
1200
- return l.length ? l.map((p) => `${p.name}: ${p.value}`).join(" · ") : null;
1201
- }, q = (o) => {
1202
- var l;
1203
- return ((l = o.product) == null ? void 0 : l.title) ?? o.displayName ?? o.title;
1204
- }, T = (o) => {
1205
- const l = q(o), p = B(o.selectedOptions);
1206
- return [l, p].filter(Boolean).join(" — ");
1207
- }, [Q, Ce] = G(e), z = U(null), pe = (o) => {
1208
- const l = Number(o);
1209
- if (!Number.isFinite(l)) return o;
1210
- if (d)
1278
+ return n.length ? n.map((s) => `${s.name}: ${s.value}`).join(" · ") : null;
1279
+ }, 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)
1211
1289
  try {
1212
- return new Intl.NumberFormat(void 0, { style: "currency", currency: d }).format(l);
1290
+ return new Intl.NumberFormat(void 0, { style: "currency", currency: m }).format(n);
1213
1291
  } catch {
1214
1292
  }
1215
- return `$${l.toFixed(2)}`;
1216
- }, Pe = ((V = c == null ? void 0 : c.title) == null ? void 0 : V.trim()) || "Build your bundle", he = A(() => {
1217
- const o = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), l = Number.isFinite(o) ? Math.floor(o) : 100;
1218
- return Math.max(2, Math.min(100, l));
1219
- }, [c == null ? void 0 : c.maxBundleSize]), g = O >= he, Te = A(() => [...k].sort((o, l) => o.displayName.localeCompare(l.displayName)), [k]), Ae = A(() => {
1220
- const o = re.trim().toLowerCase();
1221
- if (!o) return Te;
1222
- const l = o.split(/\s+/).filter(Boolean), p = (S) => {
1223
- var x;
1224
- const C = [];
1225
- C.push(S.displayName), (x = S.product) != null && x.title && C.push(S.product.title);
1226
- for (const D of S.selectedOptions ?? [])
1227
- C.push(D.name), C.push(D.value);
1228
- const N = C.join(" ").toLowerCase();
1229
- return l.every((D) => N.includes(D));
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));
1230
1308
  };
1231
- return Te.filter(p);
1232
- }, [re, Te]), W = A(() => [...(c == null ? void 0 : c.rules) ?? []].sort((o, l) => o.minBundleSize - l.minBundleSize), [c == null ? void 0 : c.rules]), ne = A(() => Math.max(0, E - O), [O, E]), Ie = A(() => {
1233
- let o = null;
1234
- for (const l of W)
1235
- O >= l.minBundleSize && (o = l);
1236
- return o;
1237
- }, [O, W]), se = A(() => {
1238
- if (!Ie) return null;
1239
- const o = Number.parseFloat(Ie.discountPercent);
1240
- return !Number.isFinite(o) || o <= 0 ? null : o;
1241
- }, [Ie]), Qe = W[0], Ve = !!(Qe && O >= Qe.minBundleSize), _e = A(() => {
1242
- const o = new Map(k.map((p) => [p.id, p]));
1243
- let l = 0;
1244
- for (const [p, S] of Object.entries(Y)) {
1245
- const C = S ?? 0;
1246
- if (C <= 0) continue;
1247
- const N = o.get(p), x = Number(N == null ? void 0 : N.price);
1248
- Number.isFinite(x) && (l += x * C);
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(() => {
1311
+ let c = null;
1312
+ for (const n of nt)
1313
+ C >= n.minBundleSize && (c = n);
1314
+ return c;
1315
+ }, [C, nt]), v = T(() => {
1316
+ if (!bt) return null;
1317
+ const c = Number.parseFloat(bt.discountPercent);
1318
+ 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);
1249
1327
  }
1250
- return Math.round(l * 100) / 100;
1251
- }, [k, Y]), Xe = A(() => {
1252
- if (!se) return _e;
1253
- const o = _e * (1 - se / 100);
1254
- return Math.round(o * 100) / 100;
1255
- }, [se, _e]), Oe = A(() => W.length ? Math.max(...W.map((o) => o.minBundleSize)) : 0, [W]), Le = A(() => {
1256
- const o = new Map(k.map((l) => [l.id, l]));
1257
- return P.map((l) => o.get(l)).filter((l) => !!l);
1258
- }, [k, P]), We = A(() => {
1259
- var l;
1260
- const o = /* @__PURE__ */ new Map();
1261
- for (const p of W) {
1262
- const S = Math.max(0, p.minBundleSize - 1);
1263
- o.set(S, {
1264
- discountPercent: p.discountPercent,
1265
- minBundleSize: p.minBundleSize,
1266
- label: ((l = p.label) == null ? void 0 : l.trim()) || `Buy ${p.minBundleSize}+`
1328
+ return Math.round(n * 100) / 100;
1329
+ }, [S, ct]), le = T(() => {
1330
+ if (!v) return st;
1331
+ const c = st * (1 - v / 100);
1332
+ 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;
1338
+ 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}+`
1267
1345
  });
1268
1346
  }
1269
- return o;
1270
- }, [W]), Ze = A(() => Math.max(Oe || E, Le.length), [Le.length, Oe, E]), [Ue, Je] = G(!0), u = U(ne);
1271
- $(() => {
1272
- if (((c == null ? void 0 : c.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1273
- const l = u.current > 0;
1274
- Je(!(l && ne === 0));
1347
+ 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));
1275
1353
  }
1276
- u.current = ne;
1277
- }, [ne, c == null ? void 0 : c.ctaButtonMode]);
1278
- const _ = U(null), y = U(null), v = U(null), F = U(O), M = (o) => {
1279
- const l = y.current;
1280
- if (!l) return;
1281
- const p = l.querySelector(`[data-variant-row="${o}"]`);
1282
- if (!p) return;
1283
- const S = l.getBoundingClientRect(), C = p.getBoundingClientRect(), N = 8;
1284
- if (C.top >= S.top + N && C.bottom <= S.bottom - N) return;
1285
- const D = Math.max(0, l.scrollHeight - l.clientHeight), I = C.top - S.top + C.height / 2, K = l.scrollTop + I - l.clientHeight / 2, we = Math.min(D, Math.max(0, K));
1286
- l.scrollTo({ top: we, behavior: "smooth" });
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" });
1287
1365
  };
1288
- return $(() => {
1289
- if (!e) return;
1290
- const o = (l) => {
1291
- l.key === "Escape" && t();
1366
+ return F(() => {
1367
+ if (!t) return;
1368
+ const c = (n) => {
1369
+ n.key === "Escape" && e();
1292
1370
  };
1293
- return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
1294
- }, [t, e]), $(() => {
1371
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
1372
+ }, [e, t]), F(() => {
1295
1373
  if (typeof window > "u") return;
1296
- const o = () => ue({ width: window.innerWidth, height: window.innerHeight });
1297
- return o(), window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
1298
- }, []), $(() => {
1299
- if (z.current != null && (window.clearTimeout(z.current), z.current = null), e) {
1300
- Ce(!0);
1374
+ const c = () => dt({ width: window.innerWidth, height: window.innerHeight });
1375
+ 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);
1301
1379
  return;
1302
1380
  }
1303
- z.current = window.setTimeout(() => {
1304
- Ce(!1), z.current = null;
1381
+ W.current = window.setTimeout(() => {
1382
+ M(!1), W.current = null;
1305
1383
  }, 220);
1306
- }, [e]), $(() => () => {
1307
- z.current != null && window.clearTimeout(z.current);
1308
- }, []), $(() => () => {
1309
- ge.current != null && window.clearTimeout(ge.current);
1310
- }, []), $(() => () => {
1311
- de.current != null && window.clearTimeout(de.current);
1312
- }, []), $(() => {
1313
- if (!e || !j) return;
1314
- const o = requestAnimationFrame(() => {
1315
- var l;
1316
- return (l = J.current) == null ? void 0 : l.focus();
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;
1392
+ const c = requestAnimationFrame(() => {
1393
+ var n;
1394
+ return (n = $t.current) == null ? void 0 : n.focus();
1317
1395
  });
1318
- return () => cancelAnimationFrame(o);
1319
- }, [e, j]), $(() => {
1320
- const o = F.current;
1321
- if (F.current = O, O <= o) return;
1322
- const l = v.current;
1323
- if (!l) return;
1324
- const p = W.some((x) => x.minBundleSize === O), S = W.find((x) => x.minBundleSize > O), C = S && p ? S.minBundleSize - 1 : S ? null : O - 1;
1325
- if (C == null || C < 0) return;
1326
- const N = requestAnimationFrame(() => {
1327
- const x = l.querySelector(`[data-box-slot="${C}"]`);
1328
- if (!x) return;
1329
- const D = l.getBoundingClientRect(), K = x.getBoundingClientRect().right - D.right;
1330
- if (K <= 1) return;
1331
- const we = Math.max(0, l.scrollWidth - l.clientWidth), Se = Math.min(we, Math.max(0, l.scrollLeft + K));
1332
- l.scrollTo({ left: Se, behavior: "smooth" });
1396
+ 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" });
1333
1411
  });
1334
- return () => cancelAnimationFrame(N);
1335
- }, [O, W]), $(() => {
1336
- if (!e) return;
1337
- const o = qe.current;
1338
- if (qe.current = O, O <= o) return;
1339
- const l = W.find((p) => p.minBundleSize === O);
1340
- l && (oe(`You received a ${L(l.discountPercent)}% discount!`), je((p) => p + 1), Re(!0), de.current != null && window.clearTimeout(de.current), de.current = window.setTimeout(() => {
1341
- Re(!1), de.current = null;
1342
- }, m));
1343
- }, [O, e, W]), $(() => {
1344
- if (!e || !xe || !Be) return;
1345
- const o = requestAnimationFrame(() => {
1346
- var D;
1347
- const l = ee.current, p = l == null ? void 0 : l.getBoundingClientRect(), S = (D = _.current) == null ? void 0 : D.getBoundingClientRect(), C = p ? p.left + p.width / 2 : S ? S.left + S.width / 2 : window.innerWidth / 2, N = p ? p.top + p.height / 2 : S ? S.top + S.height / 2 : window.innerHeight / 2, x = {
1348
- x: C - 2,
1349
- y: N - 2,
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;
1423
+ 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,
1350
1428
  w: 4,
1351
1429
  h: 4
1352
1430
  };
1353
- Ge(x), Me((I) => I + 1), ve(!0), ge.current != null && window.clearTimeout(ge.current), ge.current = window.setTimeout(() => {
1354
- ve(!1), ge.current = null;
1355
- }, ke);
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);
1356
1434
  });
1357
- return () => cancelAnimationFrame(o);
1358
- }, [ze, Be, ke, xe, e]), $(() => {
1359
- var o;
1360
- e && ((o = _.current) == null || o.focus());
1361
- }, [e]), Q ? /* @__PURE__ */ R(
1435
+ return () => cancelAnimationFrame(c);
1436
+ }, [Wt, wt, Rt, Mt, t]), F(() => {
1437
+ var c;
1438
+ t && ((c = Bt.current) == null || c.focus());
1439
+ }, [t]), H ? /* @__PURE__ */ N(
1362
1440
  "div",
1363
1441
  {
1364
1442
  role: "dialog",
1365
1443
  "aria-modal": "true",
1366
1444
  "aria-label": "Bundle builder",
1367
- className: [h.backdrop, e ? h.backdropOpen : h.backdropClosed, a.className].filter(Boolean).join(" "),
1368
- onMouseDown: (o) => {
1369
- o.target === o.currentTarget && t();
1445
+ className: [f.backdrop, t ? f.backdropOpen : f.backdropClosed, a.className].filter(Boolean).join(" "),
1446
+ onMouseDown: (c) => {
1447
+ c.target === c.currentTarget && e();
1370
1448
  },
1371
1449
  children: [
1372
- Ne && be && fe.width > 0 && fe.height > 0 ? /* @__PURE__ */ s(
1373
- Kt,
1450
+ kt && ht && U.width > 0 && U.height > 0 ? /* @__PURE__ */ l(
1451
+ ln,
1374
1452
  {
1375
- width: fe.width,
1376
- height: fe.height,
1377
- confettiSource: be,
1453
+ width: U.width,
1454
+ height: U.height,
1455
+ confettiSource: ht,
1378
1456
  colors: w,
1379
1457
  recycle: !1,
1380
1458
  numberOfPieces: 70,
@@ -1384,52 +1462,52 @@ function Hr(a) {
1384
1462
  initialVelocityX: { min: -6, max: 6 },
1385
1463
  style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
1386
1464
  },
1387
- Fe
1465
+ Tt
1388
1466
  ) : null,
1389
- /* @__PURE__ */ R("aside", { ref: _, className: [h.panel, e ? h.panelOpen : h.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1390
- xe && Be ? /* @__PURE__ */ s("div", { className: h.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ s("div", { ref: ee, className: h.celebrationChip, children: Be }, ze) }) : null,
1391
- /* @__PURE__ */ R("header", { className: [h.header, j ? h.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1392
- /* @__PURE__ */ s(
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: [
1470
+ /* @__PURE__ */ l(
1393
1471
  "button",
1394
1472
  {
1395
1473
  type: "button",
1396
- className: h.searchIconButton,
1397
- "aria-label": j ? "Search (expanded)" : "Search",
1398
- "aria-expanded": j,
1474
+ className: f.searchIconButton,
1475
+ "aria-label": z ? "Search (expanded)" : "Search",
1476
+ "aria-expanded": z,
1399
1477
  onClick: () => {
1400
- te(!0);
1478
+ yt(!0);
1401
1479
  },
1402
- children: /* @__PURE__ */ s(an, { size: 18, "aria-hidden": "true" })
1480
+ children: /* @__PURE__ */ l(pn, { size: 18, "aria-hidden": "true" })
1403
1481
  }
1404
1482
  ),
1405
- /* @__PURE__ */ R("div", { className: h.headerCenter, children: [
1406
- /* @__PURE__ */ s("div", { className: h.headerTitleWrap, "aria-hidden": j, children: /* @__PURE__ */ s("h2", { className: h.title, children: Pe }) }),
1407
- /* @__PURE__ */ s("div", { className: h.headerSearchWrap, "aria-hidden": !j, children: /* @__PURE__ */ R("div", { className: h.searchBar, children: [
1408
- /* @__PURE__ */ s(
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: [
1486
+ /* @__PURE__ */ l(
1409
1487
  "input",
1410
1488
  {
1411
- ref: J,
1412
- className: h.searchInput,
1489
+ ref: $t,
1490
+ className: f.searchInput,
1413
1491
  type: "search",
1414
- value: re,
1492
+ value: Z,
1415
1493
  placeholder: "Search",
1416
- onChange: (o) => ie(o.target.value),
1494
+ onChange: (c) => gt(c.target.value),
1417
1495
  onBlur: () => {
1418
- re.trim() === "" && te(!1);
1496
+ Z.trim() === "" && yt(!1);
1419
1497
  }
1420
1498
  }
1421
1499
  ),
1422
- re.trim() ? /* @__PURE__ */ s(
1500
+ Z.trim() ? /* @__PURE__ */ l(
1423
1501
  "button",
1424
1502
  {
1425
1503
  type: "button",
1426
- className: h.searchClearButton,
1427
- onMouseDown: (o) => {
1428
- o.preventDefault();
1504
+ className: f.searchClearButton,
1505
+ onMouseDown: (c) => {
1506
+ c.preventDefault();
1429
1507
  },
1430
1508
  onClick: () => {
1431
- var o;
1432
- ie(""), (o = J.current) == null || o.focus();
1509
+ var c;
1510
+ gt(""), (c = $t.current) == null || c.focus();
1433
1511
  },
1434
1512
  "aria-label": "Clear search",
1435
1513
  children: "Clear"
@@ -1437,168 +1515,171 @@ function Hr(a) {
1437
1515
  ) : null
1438
1516
  ] }) })
1439
1517
  ] }),
1440
- /* @__PURE__ */ s("button", { type: "button", onClick: t, disabled: r, className: h.closeButton, "aria-label": "Close", children: "×" })
1518
+ /* @__PURE__ */ l("button", { type: "button", onClick: e, disabled: i, className: f.closeButton, "aria-label": "Close", children: "×" })
1441
1519
  ] }),
1442
- /* @__PURE__ */ R("div", { className: h.body, ref: y, children: [
1443
- i ? /* @__PURE__ */ s("p", { className: h.muted, children: "Loading…" }) : null,
1444
- n ? /* @__PURE__ */ s("p", { className: h.error, children: n }) : null,
1445
- /* @__PURE__ */ s("div", { className: h.variants, children: /* @__PURE__ */ s("ul", { className: h.variantList, children: Ae.map((o) => {
1446
- var K, we, Se, De;
1447
- const l = Y[o.id] ?? 0, p = q(o), S = B(o.selectedOptions), C = T(o), N = se, x = Number(o.price), D = N != null && Number.isFinite(N) && N > 0 && Number.isFinite(x), I = D ? Math.round(x * (1 - N / 100) * 100) / 100 : null;
1448
- return /* @__PURE__ */ R(
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(
1449
1527
  "li",
1450
1528
  {
1451
- className: [h.variantRow, o.availableForSale === !1 && h.variantRowSoldOut].filter(Boolean).join(" "),
1452
- "data-variant-row": o.id,
1529
+ className: [f.variantRow, c.availableForSale === !1 && f.variantRowSoldOut].filter(Boolean).join(" "),
1530
+ "data-variant-row": c.id,
1453
1531
  children: [
1454
- /* @__PURE__ */ R("div", { className: h.variantLeft, children: [
1455
- /* @__PURE__ */ s("div", { className: h.variantThumb, "aria-hidden": "true", children: (K = o.image) != null && K.url ? /* @__PURE__ */ s(
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(
1456
1534
  "img",
1457
1535
  {
1458
- className: h.variantThumbImg,
1459
- src: o.image.url,
1460
- alt: o.image.altText ?? C,
1536
+ className: f.variantThumbImg,
1537
+ src: c.image.url,
1538
+ alt: c.image.altText ?? p,
1461
1539
  loading: "lazy"
1462
1540
  }
1463
- ) : /* @__PURE__ */ s("div", { className: h.variantThumbFallback, children: ((De = (Se = (we = o.product) == null ? void 0 : we.title) == null ? void 0 : Se.slice(0, 1)) == null ? void 0 : De.toUpperCase()) ?? "•" }) }),
1464
- /* @__PURE__ */ R("div", { className: h.variantInfo, children: [
1465
- /* @__PURE__ */ s("div", { className: h.variantName, children: p }),
1466
- S ? /* @__PURE__ */ s("div", { className: h.variantMeta, children: S }) : null,
1467
- /* @__PURE__ */ R("div", { className: h.variantPriceRow, children: [
1468
- D ? /* @__PURE__ */ s("span", { className: h.variantCompareAt, children: pe(Number.isFinite(x) ? x.toFixed(2) : o.price) }) : null,
1469
- /* @__PURE__ */ s("span", { className: h.variantPrice, children: pe(
1470
- I != null ? I.toFixed(2) : Number.isFinite(x) ? x.toFixed(2) : o.price
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
1471
1549
  ) })
1472
1550
  ] })
1473
1551
  ] })
1474
1552
  ] }),
1475
- o.availableForSale === !1 ? /* @__PURE__ */ s("div", { className: h.soldOutContainer, children: /* @__PURE__ */ R("span", { className: h.soldOut, "aria-label": `${C} is sold out`, children: [
1553
+ c.availableForSale === !1 ? /* @__PURE__ */ l("div", { className: f.soldOutContainer, children: /* @__PURE__ */ N("span", { className: f.soldOut, "aria-label": `${p} is sold out`, children: [
1476
1554
  "Sold",
1477
- /* @__PURE__ */ s("br", {}),
1555
+ /* @__PURE__ */ l("br", {}),
1478
1556
  "Out"
1479
- ] }) }) : l <= 0 ? /* @__PURE__ */ s(
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(
1480
1558
  "button",
1481
1559
  {
1482
1560
  type: "button",
1483
- onClick: () => Z(o.id, 1),
1484
- disabled: r || g,
1485
- className: h.addToBundleButton,
1486
- "aria-label": `Add ${C} to bundle`,
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`,
1487
1565
  children: "Add"
1488
1566
  }
1489
- ) : /* @__PURE__ */ R("div", { className: h.qtyControls, children: [
1490
- /* @__PURE__ */ s(
1491
- "button",
1492
- {
1493
- type: "button",
1494
- onClick: () => Z(o.id, l - 1),
1495
- disabled: r || l <= 0,
1496
- className: h.qtyButton,
1497
- "aria-label": `Decrease ${C}`,
1498
- children: "−"
1499
- }
1500
- ),
1501
- /* @__PURE__ */ s("span", { className: h.qtyValue, "aria-label": `Quantity ${l}`, children: l }),
1502
- /* @__PURE__ */ s(
1503
- "button",
1504
- {
1505
- type: "button",
1506
- onClick: () => Z(o.id, l + 1),
1507
- disabled: r || g,
1508
- className: h.qtyButton,
1509
- "aria-label": `Increase ${C}`,
1510
- children: "+"
1511
- }
1512
- )
1567
+ ) : /* @__PURE__ */ N("div", { className: f.qtyControlsWrap, children: [
1568
+ /* @__PURE__ */ N("div", { className: f.qtyControls, children: [
1569
+ /* @__PURE__ */ l(
1570
+ "button",
1571
+ {
1572
+ type: "button",
1573
+ onClick: () => et(c.id, n - 1),
1574
+ disabled: i || n <= 0,
1575
+ className: f.qtyButton,
1576
+ "aria-label": `Decrease ${p}`,
1577
+ children: "−"
1578
+ }
1579
+ ),
1580
+ /* @__PURE__ */ l("span", { className: f.qtyValue, "aria-label": `Quantity ${n}`, children: n }),
1581
+ /* @__PURE__ */ l(
1582
+ "button",
1583
+ {
1584
+ 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}`,
1589
+ children: "+"
1590
+ }
1591
+ )
1592
+ ] }),
1593
+ D ? /* @__PURE__ */ l("div", { className: f.stockLimitNotice, children: D }) : null
1513
1594
  ] })
1514
1595
  ]
1515
1596
  },
1516
- o.id
1597
+ c.id
1517
1598
  );
1518
1599
  }) }) })
1519
1600
  ] }),
1520
- /* @__PURE__ */ R("footer", { className: h.footer, ref: H, children: [
1521
- /* @__PURE__ */ s("div", { className: h.boxSummaryWindow, ref: v, children: /* @__PURE__ */ s("div", { className: h.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Ze }).map((o, l) => {
1522
- var K, we, Se, De;
1523
- const p = Le[l], S = We.get(l), C = !!p, N = !!S, x = N && !C, D = S ? `${S.discountPercent}% off` : null, I = C ? p.displayName : `Slot ${l + 1}`;
1524
- return /* @__PURE__ */ R("div", { "data-box-slot": l, className: h.boxSlot, children: [
1525
- /* @__PURE__ */ s(
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: [
1606
+ /* @__PURE__ */ l(
1526
1607
  "div",
1527
1608
  {
1528
1609
  className: [
1529
- h.boxItem,
1530
- C ? h.boxItemFilled : h.boxItemPlaceholder,
1531
- N ? h.boxItemThreshold : null,
1532
- C ? h.boxItemClickable : null
1610
+ f.boxItem,
1611
+ p ? f.boxItemFilled : f.boxItemPlaceholder,
1612
+ y ? f.boxItemThreshold : null,
1613
+ p ? f.boxItemClickable : null
1533
1614
  ].filter(Boolean).join(" "),
1534
- role: C ? "button" : void 0,
1535
- tabIndex: C ? 0 : void 0,
1536
- onClick: C ? () => M(p.id) : void 0,
1537
- onKeyDown: C ? (it) => {
1538
- (it.key === "Enter" || it.key === " ") && (it.preventDefault(), M(p.id));
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));
1539
1620
  } : void 0,
1540
- "aria-label": x && D ? `${I}. Unlocks ${D}.` : I,
1541
- title: x && D ? `${I} • Unlocks ${D}` : I,
1542
- children: C ? (K = p.image) != null && K.url ? /* @__PURE__ */ s(
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(
1543
1624
  "img",
1544
1625
  {
1545
- className: h.boxItemImage,
1546
- src: p.image.url,
1547
- alt: p.image.altText ?? p.displayName,
1626
+ className: f.boxItemImage,
1627
+ src: s.image.url,
1628
+ alt: s.image.altText ?? s.displayName,
1548
1629
  loading: "lazy"
1549
1630
  }
1550
- ) : /* @__PURE__ */ s("div", { className: h.boxItemFallback, "aria-hidden": "true", children: ((De = (Se = (we = p.product) == null ? void 0 : we.title) == null ? void 0 : Se.slice(0, 1)) == null ? void 0 : De.toUpperCase()) ?? "•" }) : x && D ? /* @__PURE__ */ s("div", { className: h.boxItemDiscountText, children: D }) : /* @__PURE__ */ s("div", { className: h.boxItemPlus, "aria-hidden": "true", children: "+" })
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: "+" })
1551
1632
  }
1552
1633
  ),
1553
- N ? /* @__PURE__ */ s("div", { className: h.boxThresholdLabel, children: S.label }) : null
1554
- ] }, l);
1634
+ y ? /* @__PURE__ */ l("div", { className: f.boxThresholdLabel, children: u.label }) : null
1635
+ ] }, n);
1555
1636
  }) }) }),
1556
- /* @__PURE__ */ s(
1637
+ /* @__PURE__ */ l(
1557
1638
  "div",
1558
1639
  {
1559
- className: [h.ctaTotalsWrap, Ve ? h.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1560
- "aria-hidden": !Ve,
1561
- children: /* @__PURE__ */ R("div", { className: h.ctaTotals, "aria-label": "Totals", children: [
1562
- se ? /* @__PURE__ */ R("span", { className: h.ctaDiscountBadge, children: [
1563
- se,
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,
1564
1645
  "% Discount"
1565
- ] }) : /* @__PURE__ */ s("span", {}),
1566
- /* @__PURE__ */ s("span", { children: se ? /* @__PURE__ */ R(ut, { children: [
1567
- /* @__PURE__ */ s("span", { className: h.ctaTotalsStrike, children: pe(_e.toFixed(2)) }),
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)) }),
1568
1649
  " ",
1569
- /* @__PURE__ */ s("span", { className: h.ctaTotalsPrice, children: pe(Xe.toFixed(2)) })
1570
- ] }) : /* @__PURE__ */ s("span", { className: h.ctaTotalsPrice, children: pe(_e.toFixed(2)) }) })
1650
+ /* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(le.toFixed(2)) })
1651
+ ] }) : /* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(st.toFixed(2)) }) })
1571
1652
  ] })
1572
1653
  }
1573
1654
  ),
1574
1655
  (() => {
1575
- const o = (c == null ? void 0 : c.ctaButtonMode) || "add_to_cart";
1576
- return o === "add_to_cart_checkout" ? ne > 0 ? /* @__PURE__ */ s("button", { type: "button", onClick: le, disabled: !X, className: h.cta, children: r ? "Adding…" : `Add ${ne} more product${ne === 1 ? "" : "s"}` }) : /* @__PURE__ */ R("div", { className: `${h.ctaButtonGroup} ${Ue ? h.ctaButtonGroupAnimating : ""}`, children: [
1577
- /* @__PURE__ */ s(
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: [
1658
+ /* @__PURE__ */ l(
1578
1659
  "button",
1579
1660
  {
1580
1661
  type: "button",
1581
- onClick: le,
1662
+ onClick: ot,
1582
1663
  disabled: !X,
1583
- className: `${h.ctaDualLeft} ${Ue ? h.ctaDualLeftAnimating : ""}`,
1584
- children: /* @__PURE__ */ s("span", { children: r ? "Adding…" : "Add to Basket" })
1664
+ className: `${f.ctaDualLeft} ${Et ? f.ctaDualLeftAnimating : ""}`,
1665
+ children: /* @__PURE__ */ l("span", { children: i ? "Adding…" : "Add to Basket" })
1585
1666
  }
1586
1667
  ),
1587
- /* @__PURE__ */ s(
1668
+ /* @__PURE__ */ l(
1588
1669
  "button",
1589
1670
  {
1590
1671
  type: "button",
1591
- onClick: ce,
1672
+ onClick: J,
1592
1673
  disabled: !X,
1593
- className: `${h.ctaDualRight} ${Ue ? h.ctaDualRightAnimating : ""}`,
1594
- children: /* @__PURE__ */ s("span", { children: r ? "Processing…" : "Checkout" })
1674
+ className: `${f.ctaDualRight} ${Et ? f.ctaDualRightAnimating : ""}`,
1675
+ children: /* @__PURE__ */ l("span", { children: i ? "Processing…" : "Checkout" })
1595
1676
  }
1596
1677
  )
1597
- ] }) : o === "checkout" ? /* @__PURE__ */ s("button", { type: "button", onClick: ce, disabled: !X, className: h.cta, children: r ? "Processing…" : ne > 0 ? `Add ${ne} more product${ne === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ s("button", { type: "button", onClick: le, disabled: !X, className: h.cta, children: r ? "Adding…" : ne > 0 ? `Add ${ne} more product${ne === 1 ? "" : "s"}` : "Add to Basket" });
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" });
1598
1679
  })(),
1599
- /* @__PURE__ */ R("div", { className: h.poweredBy, children: [
1680
+ /* @__PURE__ */ N("div", { className: f.poweredBy, children: [
1600
1681
  "powered by ",
1601
- /* @__PURE__ */ s("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
1682
+ /* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
1602
1683
  ] })
1603
1684
  ] })
1604
1685
  ] })
@@ -1606,451 +1687,486 @@ function Hr(a) {
1606
1687
  }
1607
1688
  ) : null;
1608
1689
  }
1609
- const Ca = "_panel_1n9m6_2", Ia = "_header_1n9m6_20", Sa = "_title_1n9m6_24", Na = "_status_1n9m6_32", Ba = "_error_1n9m6_37", Ta = "_inactive_1n9m6_43", ka = "_section_1n9m6_49", Ra = "_sectionTitle_1n9m6_54", Pa = "_rulesVisual_1n9m6_107", Oa = "_rulesLabelsRow_1n9m6_114", Fa = "_rulesLinesRow_1n9m6_121", Ma = "_rulesLineLabelCell_1n9m6_128", Aa = "_rulesLineLabel_1n9m6_128", La = "_rulesLine_1n9m6_121", Da = "_rulesLineEmpty_1n9m6_162", $a = "_rulesLineFilled_1n9m6_166", Ea = "_variants_1n9m6_170", qa = "_variantList_1n9m6_178", za = "_variantRow_1n9m6_186", Va = "_variantRowInteractive_1n9m6_198", ja = "_variantRowSelected_1n9m6_202", Wa = "_variantRowSoldOut_1n9m6_207", Ua = "_variantMedia_1n9m6_211", Ha = "_variantContent_1n9m6_219", Ga = "_variantHeader_1n9m6_227", Qa = "_variantTitle_1n9m6_233", Ka = "_variantImage_1n9m6_247", Ya = "_variantImageFallback_1n9m6_255", Xa = "_variantMeta_1n9m6_268", Za = "_variantPrice_1n9m6_273", Ja = "_variantFooterRow_1n9m6_279", er = "_variantActions_1n9m6_286", tr = "_qtyActions_1n9m6_292", nr = "_soldOut_1n9m6_343", ar = "_qtyChip_1n9m6_351", rr = "_qtyChipInteractive_1n9m6_366", ir = "_qtyChipValue_1n9m6_370", or = "_qtyChipPlus_1n9m6_376", sr = "_qtyChipClear_1n9m6_381", lr = "_qtyTrash_1n9m6_400", cr = "_footer_1n9m6_412", ur = "_boxSummaryWindow_1n9m6_417", dr = "_boxSummaryRow_1n9m6_431", hr = "_boxSlot_1n9m6_439", mr = "_boxItem_1n9m6_448", fr = "_boxItemFilled_1n9m6_465", br = "_boxItemPlaceholder_1n9m6_471", pr = "_boxItemThreshold_1n9m6_477", _r = "_boxItemClickable_1n9m6_485", yr = "_boxItemImage_1n9m6_494", wr = "_boxItemFallback_1n9m6_505", vr = "_boxItemPlus_1n9m6_518", gr = "_boxItemDiscountText_1n9m6_530", xr = "_boxThresholdLabel_1n9m6_543", Cr = "_totalsReveal_1n9m6_554", Ir = "_totalsRevealOpen_1n9m6_562", Sr = "_ctaTotalsWrap_1n9m6_567", Nr = "_ctaTotalsWrapVisible_1n9m6_572", Br = "_ctaTotals_1n9m6_567", Tr = "_ctaDiscountBadge_1n9m6_587", kr = "_ctaTotalsStrike_1n9m6_598", Rr = "_ctaTotalsPrice_1n9m6_604", Pr = "_cta_1n9m6_567", Or = "_ctaButtonGroup_1n9m6_636", Fr = "_ctaDualLeft_1n9m6_642", Mr = "_ctaDualRight_1n9m6_643", Ar = "_poweredBy_1n9m6_670", f = {
1610
- panel: Ca,
1611
- header: Ia,
1612
- title: Sa,
1613
- status: Na,
1614
- error: Ba,
1615
- inactive: Ta,
1616
- section: ka,
1617
- sectionTitle: Ra,
1618
- rulesVisual: Pa,
1619
- rulesLabelsRow: Oa,
1620
- rulesLinesRow: Fa,
1621
- rulesLineLabelCell: Ma,
1622
- rulesLineLabel: Aa,
1623
- rulesLine: La,
1624
- rulesLineEmpty: Da,
1625
- rulesLineFilled: $a,
1626
- variants: Ea,
1627
- variantList: qa,
1628
- variantRow: za,
1629
- variantRowInteractive: Va,
1630
- variantRowSelected: ja,
1631
- variantRowSoldOut: Wa,
1632
- variantMedia: Ua,
1633
- variantContent: Ha,
1634
- variantHeader: Ga,
1635
- variantTitle: Qa,
1636
- variantImage: Ka,
1637
- variantImageFallback: Ya,
1638
- variantMeta: Xa,
1639
- variantPrice: Za,
1640
- variantFooterRow: Ja,
1641
- variantActions: er,
1642
- qtyActions: tr,
1643
- soldOut: nr,
1644
- qtyChip: ar,
1645
- qtyChipInteractive: rr,
1646
- qtyChipValue: ir,
1647
- qtyChipPlus: or,
1648
- qtyChipClear: sr,
1649
- qtyTrash: lr,
1650
- footer: cr,
1651
- boxSummaryWindow: ur,
1652
- boxSummaryRow: dr,
1653
- boxSlot: hr,
1654
- boxItem: mr,
1655
- boxItemFilled: fr,
1656
- boxItemPlaceholder: br,
1657
- boxItemThreshold: pr,
1658
- boxItemClickable: _r,
1659
- boxItemImage: yr,
1660
- boxItemFallback: wr,
1661
- boxItemPlus: vr,
1662
- boxItemDiscountText: gr,
1663
- boxThresholdLabel: xr,
1664
- totalsReveal: Cr,
1665
- totalsRevealOpen: Ir,
1666
- ctaTotalsWrap: Sr,
1667
- ctaTotalsWrapVisible: Nr,
1668
- ctaTotals: Br,
1669
- ctaDiscountBadge: Tr,
1670
- ctaTotalsStrike: kr,
1671
- ctaTotalsPrice: Rr,
1672
- cta: Pr,
1673
- ctaButtonGroup: Or,
1674
- ctaDualLeft: Fr,
1675
- ctaDualRight: Mr,
1676
- poweredBy: Ar
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
1677
1760
  };
1678
- function Gr(a) {
1679
- var de;
1761
+ function hi(a) {
1762
+ var ft;
1680
1763
  const {
1681
- loading: e,
1682
- submitting: t,
1683
- error: i,
1684
- currencyCode: r,
1685
- config: n,
1686
- eligibleVariants: d,
1687
- selections: c,
1688
- selectionOrder: k,
1689
- setQuantity: Y,
1690
- bundleSize: P,
1691
- minRequired: Z,
1692
- canSubmit: O,
1693
- submit: E,
1764
+ loading: t,
1765
+ submitting: e,
1766
+ error: o,
1767
+ currencyCode: i,
1768
+ 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,
1694
1778
  submitAndCheckout: X
1695
- } = rt(), {
1696
- className: le,
1697
- showRules: ce = !0,
1698
- showVariants: j = !0
1699
- } = a, te = (m) => {
1700
- const b = Number.parseFloat(m);
1701
- return Number.isFinite(b) ? String(Math.round(b)) : m;
1702
- }, re = (m) => {
1703
- const b = (m ?? []).filter((w) => {
1704
- var q, T;
1705
- const L = (q = w == null ? void 0 : w.name) == null ? void 0 : q.trim(), B = (T = w == null ? void 0 : w.value) == null ? void 0 : T.trim();
1706
- return !(!L || !B || L.toLowerCase() === "title");
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");
1707
1791
  });
1708
- return b.length ? b.map((w) => `${w.name}: ${w.value}`).join(" • ") : null;
1709
- }, ie = (m) => {
1710
- const b = Number(m);
1711
- if (!Number.isFinite(b)) return m;
1712
- if (r)
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)
1713
1797
  try {
1714
- return new Intl.NumberFormat(void 0, { style: "currency", currency: r }).format(b);
1798
+ return new Intl.NumberFormat(void 0, { style: "currency", currency: i }).format(_);
1715
1799
  } catch {
1716
1800
  }
1717
- return `$${b.toFixed(2)}`;
1718
- }, J = A(() => [...d].sort((m, b) => m.displayName.localeCompare(b.displayName)), [d]), H = A(() => [...(n == null ? void 0 : n.rules) ?? []].sort((m, b) => m.minBundleSize - b.minBundleSize), [n == null ? void 0 : n.rules]), ee = A(() => Math.max(0, Z - P), [P, Z]), fe = A(() => {
1719
- let m = null;
1720
- for (const b of H)
1721
- P >= b.minBundleSize && (m = b);
1722
- return m;
1723
- }, [P, H]), ue = A(() => {
1724
- if (!fe) return null;
1725
- const m = Number.parseFloat(fe.discountPercent);
1726
- return !Number.isFinite(m) || m <= 0 ? null : m;
1727
- }, [fe]), Fe = H[0], Me = !!(Fe && P >= Fe.minBundleSize), be = A(() => {
1728
- const m = new Map(d.map((w) => [w.id, w]));
1729
- let b = 0;
1730
- for (const [w, L] of Object.entries(c)) {
1731
- const B = L ?? 0;
1732
- if (B <= 0) continue;
1733
- const q = m.get(w), T = Number(q == null ? void 0 : q.price);
1734
- Number.isFinite(T) && (b += T * B);
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);
1735
1819
  }
1736
- return Math.round(b * 100) / 100;
1737
- }, [d, c]), Ge = A(() => {
1738
- if (!ue) return be;
1739
- const m = be * (1 - ue / 100);
1740
- return Math.round(m * 100) / 100;
1741
- }, [ue, be]), Ne = A(() => H.length ? Math.max(...H.map((m) => m.minBundleSize)) : 0, [H]), ve = A(() => {
1742
- const m = new Map(d.map((b) => [b.id, b]));
1743
- return k.map((b) => m.get(b)).filter((b) => !!b);
1744
- }, [d, k]), ge = A(() => {
1745
- var b;
1746
- const m = /* @__PURE__ */ new Map();
1747
- for (const w of H) {
1748
- const L = Math.max(0, w.minBundleSize - 1);
1749
- m.set(L, {
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, {
1750
1834
  discountPercent: w.discountPercent,
1751
1835
  minBundleSize: w.minBundleSize,
1752
- label: ((b = w.label) == null ? void 0 : b.trim()) || `Buy ${w.minBundleSize}+`
1836
+ label: ((_ = w.label) == null ? void 0 : _.trim()) || `Buy ${w.minBundleSize}+`
1753
1837
  });
1754
1838
  }
1755
- return m;
1756
- }, [H]), qe = A(() => {
1757
- const m = Number((n == null ? void 0 : n.maxBundleSize) ?? NaN), b = Number.isFinite(m) ? Math.floor(m) : 100;
1758
- return Math.max(2, Math.min(100, b));
1759
- }, [n == null ? void 0 : n.maxBundleSize]), ke = ((de = n == null ? void 0 : n.title) == null ? void 0 : de.trim()) || "Build your bundle", ze = A(() => Math.max(Ne || Z, ve.length), [ve.length, Ne, Z]), je = P >= qe, Be = U(null), oe = U(null), xe = U(P);
1760
- $(() => {
1761
- const m = xe.current;
1762
- if (xe.current = P, P <= m) return;
1763
- const b = oe.current;
1764
- if (!b) return;
1765
- const w = H.some((T) => T.minBundleSize === P), L = H.find((T) => T.minBundleSize > P), B = L && w ? L.minBundleSize - 1 : L ? null : P - 1;
1766
- if (B == null || B < 0) return;
1767
- const q = requestAnimationFrame(() => {
1768
- const T = b.querySelector(`[data-box-slot="${B}"]`);
1769
- if (!T) return;
1770
- const Q = b.getBoundingClientRect(), z = T.getBoundingClientRect().right - Q.right;
1771
- if (z <= 1) return;
1772
- const pe = Math.max(0, b.scrollWidth - b.clientWidth), Pe = Math.min(pe, Math.max(0, b.scrollLeft + z));
1773
- b.scrollTo({ left: Pe, behavior: "smooth" });
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;
1851
+ 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" });
1774
1858
  });
1775
- return () => cancelAnimationFrame(q);
1776
- }, [P, H]);
1777
- const Re = (m) => {
1778
- const b = Be.current;
1779
- if (!b) return;
1780
- const w = b.querySelector(`[data-variant-row="${m}"]`);
1859
+ 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}"]`);
1781
1865
  w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
1782
1866
  };
1783
- return /* @__PURE__ */ R("section", { className: [f.panel, le].filter(Boolean).join(" "), "aria-busy": e, children: [
1784
- /* @__PURE__ */ s("header", { className: f.header, children: /* @__PURE__ */ s("h2", { className: f.title, children: ke }) }),
1785
- e ? /* @__PURE__ */ s("div", { className: f.status, children: "Loading…" }) : null,
1786
- i ? /* @__PURE__ */ s("div", { className: f.error, children: i }) : null,
1787
- !e && n && !n.isActive ? /* @__PURE__ */ s("div", { className: f.inactive, children: "Bundles are not active." }) : null,
1788
- ce && H.length ? /* @__PURE__ */ s("div", { className: f.section, children: /* @__PURE__ */ R("div", { className: f.rulesVisual, children: [
1789
- /* @__PURE__ */ s("div", { className: f.rulesLabelsRow, children: Array.from({ length: Ne }).map((m, b) => {
1790
- const w = b + 1, L = H.find((q) => q.minBundleSize === w), B = L ? `${te(L.discountPercent)}% off` : null;
1791
- return /* @__PURE__ */ s("div", { className: f.rulesLineLabelCell, children: B ? /* @__PURE__ */ s("span", { className: f.rulesLineLabel, children: B }) : null }, w);
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);
1792
1876
  }) }),
1793
- /* @__PURE__ */ s("div", { className: f.rulesLinesRow, children: Array.from({ length: Ne }).map((m, b) => {
1794
- const w = b + 1, L = P >= w;
1795
- return /* @__PURE__ */ s(
1877
+ /* @__PURE__ */ l("div", { className: b.rulesLinesRow, children: Array.from({ length: kt }).map((h, _) => {
1878
+ const w = _ + 1, B = O >= w;
1879
+ return /* @__PURE__ */ l(
1796
1880
  "div",
1797
1881
  {
1798
1882
  className: [
1799
- f.rulesLine,
1800
- L ? f.rulesLineFilled : f.rulesLineEmpty
1883
+ b.rulesLine,
1884
+ B ? b.rulesLineFilled : b.rulesLineEmpty
1801
1885
  ].filter(Boolean).join(" ")
1802
1886
  },
1803
1887
  w
1804
1888
  );
1805
1889
  }) })
1806
1890
  ] }) }) : null,
1807
- j ? /* @__PURE__ */ R("div", { className: f.section, ref: Be, children: [
1808
- /* @__PURE__ */ s("div", { className: f.sectionTitle, children: "Select items" }),
1809
- /* @__PURE__ */ s("div", { className: f.variants, children: /* @__PURE__ */ s("ul", { className: f.variantList, children: J.map((m) => {
1810
- var q;
1811
- const b = c[m.id] ?? 0, w = re(m.selectedOptions), L = m.availableForSale === !1, B = !L && !je;
1812
- return /* @__PURE__ */ R(
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(
1813
1897
  "li",
1814
1898
  {
1815
1899
  className: [
1816
- f.variantRow,
1817
- B ? f.variantRowInteractive : null,
1818
- b > 0 ? f.variantRowSelected : null,
1819
- L ? f.variantRowSoldOut : null
1900
+ b.variantRow,
1901
+ M ? b.variantRowInteractive : null,
1902
+ _ > 0 ? b.variantRowSelected : null,
1903
+ B ? b.variantRowSoldOut : null
1820
1904
  ].filter(Boolean).join(" "),
1821
- "data-variant-row": m.id,
1822
- role: B ? "button" : void 0,
1823
- tabIndex: B ? 0 : void 0,
1824
- onClick: B ? () => {
1825
- Y(m.id, b + 1);
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);
1826
1910
  } : void 0,
1827
- onKeyDown: B ? (T) => {
1828
- (T.key === "Enter" || T.key === " ") && (T.preventDefault(), Y(m.id, b + 1), Re(m.id));
1911
+ onKeyDown: M ? (L) => {
1912
+ (L.key === "Enter" || L.key === " ") && (L.preventDefault(), A(h.id, _ + 1), Lt(h.id));
1829
1913
  } : void 0,
1830
- "aria-label": L ? `${m.displayName} is sold out` : `Add ${m.displayName} to bundle`,
1914
+ "aria-label": B ? `${h.displayName} is sold out` : W ? `${h.displayName} ${W.toLowerCase()}` : `Add ${h.displayName} to bundle`,
1831
1915
  children: [
1832
- /* @__PURE__ */ s("div", { className: f.variantMedia, children: (q = m.image) != null && q.url ? /* @__PURE__ */ s(
1916
+ /* @__PURE__ */ l("div", { className: b.variantMedia, children: (Q = h.image) != null && Q.url ? /* @__PURE__ */ l(
1833
1917
  "img",
1834
1918
  {
1835
- src: m.image.url,
1836
- alt: m.image.altText ?? m.displayName,
1837
- width: m.image.width ?? 64,
1838
- height: m.image.height ?? 64,
1839
- className: f.variantImage,
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,
1840
1924
  loading: "lazy"
1841
1925
  }
1842
- ) : /* @__PURE__ */ s("div", { className: f.variantImageFallback, children: "Item" }) }),
1843
- /* @__PURE__ */ R("div", { className: f.variantContent, children: [
1844
- /* @__PURE__ */ R("div", { className: f.variantHeader, children: [
1845
- /* @__PURE__ */ s("div", { className: f.variantTitle, children: m.displayName }),
1846
- w ? /* @__PURE__ */ s("div", { className: f.variantMeta, children: w }) : null
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
1847
1931
  ] }),
1848
- /* @__PURE__ */ R("div", { className: f.variantFooterRow, children: [
1849
- /* @__PURE__ */ s("div", { className: f.variantPrice, children: ie(m.price) }),
1850
- /* @__PURE__ */ s("div", { className: f.variantActions, children: L ? /* @__PURE__ */ s("div", { className: f.soldOut, "aria-label": `${m.displayName} is sold out`, children: "Sold Out" }) : /* @__PURE__ */ R("div", { className: f.qtyActions, children: [
1851
- b > 0 ? /* @__PURE__ */ s(
1852
- "button",
1853
- {
1854
- type: "button",
1855
- className: f.qtyTrash,
1856
- "aria-label": `Remove ${m.displayName} from bundle`,
1857
- onClick: (T) => {
1858
- T.stopPropagation(), Y(m.id, 0);
1859
- },
1860
- onKeyDown: (T) => {
1861
- T.stopPropagation();
1862
- },
1863
- children: /* @__PURE__ */ s(on, { size: 14 })
1864
- }
1865
- ) : null,
1866
- /* @__PURE__ */ s(
1867
- "div",
1868
- {
1869
- className: [f.qtyChip, b > 0 ? f.qtyChipInteractive : null].filter(Boolean).join(" "),
1870
- "aria-label": `${m.displayName} quantity ${b}`,
1871
- onClick: (T) => {
1872
- T.stopPropagation(), Y(m.id, b + 1);
1873
- },
1874
- onKeyDown: (T) => {
1875
- T.stopPropagation();
1876
- },
1877
- role: "button",
1878
- tabIndex: 0,
1879
- children: b <= 0 ? /* @__PURE__ */ s("span", { className: f.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ s(Ct, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ R(ut, { children: [
1880
- /* @__PURE__ */ s("span", { className: f.qtyChipValue, children: b }),
1881
- /* @__PURE__ */ s(
1882
- "button",
1883
- {
1884
- type: "button",
1885
- className: f.qtyChipClear,
1886
- "aria-label": `Add ${m.displayName}`,
1887
- onClick: (T) => {
1888
- T.stopPropagation(), Y(m.id, b + 1);
1889
- },
1890
- onKeyDown: (T) => {
1891
- T.stopPropagation();
1892
- },
1893
- children: /* @__PURE__ */ s(Ct, { size: 12, strokeWidth: 2 })
1894
- }
1895
- )
1896
- ] })
1897
- }
1898
- )
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(
1937
+ "button",
1938
+ {
1939
+ type: "button",
1940
+ className: b.qtyTrash,
1941
+ "aria-label": `Remove ${h.displayName} from bundle`,
1942
+ onClick: (L) => {
1943
+ L.stopPropagation(), A(h.id, 0);
1944
+ },
1945
+ onKeyDown: (L) => {
1946
+ L.stopPropagation();
1947
+ },
1948
+ children: /* @__PURE__ */ l(yn, { size: 14 })
1949
+ }
1950
+ ) : null,
1951
+ /* @__PURE__ */ l(
1952
+ "div",
1953
+ {
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);
1958
+ } : void 0,
1959
+ onKeyDown: (L) => {
1960
+ L.stopPropagation();
1961
+ },
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: _ }),
1966
+ /* @__PURE__ */ l(
1967
+ "button",
1968
+ {
1969
+ type: "button",
1970
+ className: b.qtyChipClear,
1971
+ "aria-label": `Add ${h.displayName}`,
1972
+ onClick: (L) => {
1973
+ L.stopPropagation(), A(h.id, _ + 1);
1974
+ },
1975
+ onKeyDown: (L) => {
1976
+ L.stopPropagation();
1977
+ },
1978
+ disabled: !H,
1979
+ children: /* @__PURE__ */ l(Oe, { size: 12, strokeWidth: 2 })
1980
+ }
1981
+ )
1982
+ ] })
1983
+ }
1984
+ )
1985
+ ] }),
1986
+ W ? /* @__PURE__ */ l("div", { className: b.stockLimitNotice, children: W }) : null
1899
1987
  ] }) })
1900
1988
  ] })
1901
1989
  ] })
1902
1990
  ]
1903
1991
  },
1904
- m.id
1992
+ h.id
1905
1993
  );
1906
1994
  }) }) })
1907
1995
  ] }) : null,
1908
- /* @__PURE__ */ R("footer", { className: f.footer, children: [
1909
- /* @__PURE__ */ s("div", { className: f.boxSummaryWindow, ref: oe, children: /* @__PURE__ */ s("div", { className: f.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ze }).map((m, b) => {
1910
- var z, pe, Pe, he;
1911
- const w = ve[b], L = ge.get(b), B = !!w, q = !!L, T = q && !B, Q = L ? `${L.discountPercent}% off` : null, Ce = B ? w.displayName : `Slot ${b + 1}`;
1912
- return /* @__PURE__ */ R("div", { "data-box-slot": b, className: f.boxSlot, children: [
1913
- /* @__PURE__ */ s(
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: [
2001
+ /* @__PURE__ */ l(
1914
2002
  "div",
1915
2003
  {
1916
2004
  className: [
1917
- f.boxItem,
1918
- B ? f.boxItemFilled : f.boxItemPlaceholder,
1919
- q ? f.boxItemThreshold : null,
1920
- B ? f.boxItemClickable : null
2005
+ b.boxItem,
2006
+ R ? b.boxItemFilled : b.boxItemPlaceholder,
2007
+ E ? b.boxItemThreshold : null,
2008
+ R ? b.boxItemClickable : null
1921
2009
  ].filter(Boolean).join(" "),
1922
- role: B ? "button" : void 0,
1923
- tabIndex: B ? 0 : void 0,
1924
- onClick: B ? () => Re(w.id) : void 0,
1925
- onKeyDown: B ? (g) => {
1926
- (g.key === "Enter" || g.key === " ") && (g.preventDefault(), Re(w.id));
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));
1927
2015
  } : void 0,
1928
- "aria-label": T && Q ? `${Ce}. Unlocks ${Q}.` : Ce,
1929
- title: T && Q ? `${Ce} • Unlocks ${Q}` : Ce,
1930
- children: B ? (z = w.image) != null && z.url ? /* @__PURE__ */ s(
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(
1931
2019
  "img",
1932
2020
  {
1933
- className: f.boxItemImage,
2021
+ className: b.boxItemImage,
1934
2022
  src: w.image.url,
1935
2023
  alt: w.image.altText ?? w.displayName,
1936
2024
  width: 1,
1937
2025
  height: 1,
1938
2026
  loading: "lazy"
1939
2027
  }
1940
- ) : /* @__PURE__ */ s("div", { className: f.boxItemFallback, "aria-hidden": "true", children: ((he = (Pe = (pe = w.product) == null ? void 0 : pe.title) == null ? void 0 : Pe.slice(0, 1)) == null ? void 0 : he.toUpperCase()) ?? "•" }) : T && Q ? /* @__PURE__ */ s("div", { className: f.boxItemDiscountText, children: Q }) : /* @__PURE__ */ s("div", { className: f.boxItemPlus, "aria-hidden": "true", children: "+" })
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: "+" })
1941
2029
  }
1942
2030
  ),
1943
- q ? /* @__PURE__ */ s("div", { className: f.boxThresholdLabel, children: L.label }) : null
1944
- ] }, b);
2031
+ E ? /* @__PURE__ */ l("div", { className: b.boxThresholdLabel, children: B.label }) : null
2032
+ ] }, _);
1945
2033
  }) }) }),
1946
- /* @__PURE__ */ s("div", { className: [f.totalsReveal, Me ? f.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ s(
2034
+ /* @__PURE__ */ l("div", { className: [b.totalsReveal, It ? b.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ l(
1947
2035
  "div",
1948
2036
  {
1949
- className: [f.ctaTotalsWrap, Me ? f.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1950
- "aria-hidden": !Me,
1951
- children: /* @__PURE__ */ R("div", { className: f.ctaTotals, "aria-label": "Totals", children: [
1952
- ue ? /* @__PURE__ */ R("span", { className: f.ctaDiscountBadge, children: [
1953
- ue,
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,
1954
2042
  "% Discount"
1955
- ] }) : /* @__PURE__ */ s("span", {}),
1956
- /* @__PURE__ */ s("span", { children: ue ? /* @__PURE__ */ R(ut, { children: [
1957
- /* @__PURE__ */ s("span", { className: f.ctaTotalsStrike, children: ie(be.toFixed(2)) }),
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)) }),
1958
2046
  " ",
1959
- /* @__PURE__ */ s("span", { className: f.ctaTotalsPrice, children: ie(Ge.toFixed(2)) })
1960
- ] }) : /* @__PURE__ */ s("span", { className: f.ctaTotalsPrice, children: ie(be.toFixed(2)) }) })
2047
+ /* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(zt.toFixed(2)) })
2048
+ ] }) : /* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(ht.toFixed(2)) }) })
1961
2049
  ] })
1962
2050
  }
1963
2051
  ) }),
1964
2052
  (() => {
1965
- const m = (n == null ? void 0 : n.ctaButtonMode) || "add_to_cart";
1966
- return m === "add_to_cart_checkout" ? ee > 0 ? /* @__PURE__ */ s("button", { type: "button", onClick: E, disabled: !O, className: f.cta, children: t ? "Adding…" : `Add ${ee} more product${ee === 1 ? "" : "s"}` }) : /* @__PURE__ */ R("div", { className: f.ctaButtonGroup, children: [
1967
- /* @__PURE__ */ s("button", { type: "button", onClick: E, disabled: !O, className: f.ctaDualLeft, children: /* @__PURE__ */ s("span", { children: t ? "Adding…" : "Add to Basket" }) }),
1968
- /* @__PURE__ */ s("button", { type: "button", onClick: X, disabled: !O, className: f.ctaDualRight, children: /* @__PURE__ */ s("span", { children: t ? "Processing…" : "Checkout" }) })
1969
- ] }) : m === "checkout" ? /* @__PURE__ */ s("button", { type: "button", onClick: X, disabled: !O, className: f.cta, children: t ? "Processing…" : ee > 0 ? `Add ${ee} more product${ee === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ s("button", { type: "button", onClick: E, disabled: !O, className: f.cta, children: t ? "Adding…" : ee > 0 ? `Add ${ee} more product${ee === 1 ? "" : "s"}` : "Add to Basket" });
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" });
1970
2058
  })(),
1971
- /* @__PURE__ */ R("div", { className: f.poweredBy, children: [
2059
+ /* @__PURE__ */ N("div", { className: b.poweredBy, children: [
1972
2060
  "powered by",
1973
2061
  " ",
1974
- /* @__PURE__ */ s("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
2062
+ /* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
1975
2063
  ] })
1976
2064
  ] })
1977
2065
  ] });
1978
2066
  }
1979
- function ct(a) {
2067
+ function ve(a) {
1980
2068
  if (a != null && a.length)
1981
- return a.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
2069
+ return a.reduce((t, e) => (e != null && e.key && (t[e.key] = e.value ?? ""), t), {});
2070
+ }
2071
+ function Ae(a) {
2072
+ const t = /\/(\d+)$/.exec(a);
2073
+ return t ? t[1] : a;
1982
2074
  }
1983
- function It(a) {
1984
- const e = /\/(\d+)$/.exec(a);
1985
- return e ? e[1] : a;
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;
1986
2079
  }
1987
- function Lr() {
2080
+ function ti() {
1988
2081
  var a;
1989
2082
  return typeof window > "u" ? null : ((a = window.Shopify) == null ? void 0 : a.theme) ?? null;
1990
2083
  }
1991
- function Dr() {
1992
- const a = Lr();
2084
+ function ei() {
2085
+ const a = ti();
1993
2086
  return a ? a.schema_name === "Sleek" ? !0 : /sleek/i.test(a.name ?? "") : !1;
1994
2087
  }
1995
- function $r() {
2088
+ function ni() {
1996
2089
  return typeof document > "u" ? !1 : !!document.querySelector("cart-drawer");
1997
2090
  }
1998
- function Er() {
1999
- return !Dr() || !$r() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2091
+ function ri() {
2092
+ return !ei() || !ni() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2000
2093
  bubbles: !0,
2001
2094
  detail: { open: !0 }
2002
2095
  })), !0);
2003
2096
  }
2004
- function qr() {
2097
+ function ai() {
2005
2098
  window.location.reload();
2006
2099
  }
2007
- async function nt(a, e) {
2008
- const t = await fetch(a, {
2100
+ async function he(a, t) {
2101
+ const e = await fetch(a, {
2009
2102
  method: "POST",
2010
2103
  headers: {
2011
2104
  Accept: "application/json",
2012
2105
  "Content-Type": "application/json"
2013
2106
  },
2014
- body: JSON.stringify(e)
2107
+ body: JSON.stringify(t)
2015
2108
  });
2016
- if (!t.ok) {
2017
- const i = await t.text().catch(() => "");
2018
- throw new Error(i || `Cart request failed: ${t.status}`);
2109
+ if (!e.ok) {
2110
+ const o = await e.text().catch(() => "");
2111
+ throw new Error(o || `Cart request failed: ${e.status}`);
2019
2112
  }
2020
- return t.json().catch(() => null);
2113
+ return e.json().catch(() => null);
2021
2114
  }
2022
- function Qr() {
2115
+ async function ii() {
2116
+ const a = await fetch("/cart.js", {
2117
+ method: "GET",
2118
+ cache: "no-store",
2119
+ headers: {
2120
+ Accept: "application/json",
2121
+ "Content-Type": "application/json"
2122
+ }
2123
+ });
2124
+ if (!a.ok)
2125
+ throw new Error(`Cart request failed: ${a.status}`);
2126
+ return a.json();
2127
+ }
2128
+ function mi() {
2023
2129
  return {
2024
2130
  async linesAdd(a) {
2025
- const e = a.map((t) => ({
2026
- id: It(t.merchandiseId),
2027
- quantity: t.quantity,
2028
- properties: ct(t.attributes)
2131
+ const t = a.map((e) => ({
2132
+ id: Ae(e.merchandiseId),
2133
+ quantity: e.quantity,
2134
+ properties: ve(e.attributes)
2029
2135
  }));
2030
- await nt("/cart/add.js", { items: e });
2136
+ await he("/cart/add.js", { items: t });
2031
2137
  },
2032
2138
  async linesAddForCheckout(a) {
2033
- const e = a.map((t) => ({
2034
- id: It(t.merchandiseId),
2035
- quantity: t.quantity,
2036
- properties: ct(t.attributes)
2139
+ const t = a.map((e) => ({
2140
+ id: Ae(e.merchandiseId),
2141
+ quantity: e.quantity,
2142
+ properties: ve(e.attributes)
2037
2143
  }));
2038
- await nt("/cart/add.js", { items: e });
2144
+ await he("/cart/add.js", { items: t });
2039
2145
  },
2040
2146
  async linesUpdate(a) {
2041
- for (const e of a)
2042
- await nt("/cart/change.js", {
2043
- id: e.id,
2044
- quantity: e.quantity,
2045
- properties: ct(e.attributes)
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)
2046
2152
  });
2047
2153
  },
2048
2154
  async linesRemove(a) {
2049
- for (const e of a)
2050
- await nt("/cart/change.js", { id: e, quantity: 0 });
2155
+ for (const t of a)
2156
+ await he("/cart/change.js", { id: t, quantity: 0 });
2157
+ },
2158
+ 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));
2165
+ }
2166
+ return t;
2051
2167
  },
2052
2168
  openCartUI() {
2053
- Er() || window.setTimeout(() => qr(), 0);
2169
+ ri() || window.setTimeout(() => ai(), 0);
2054
2170
  },
2055
2171
  navigateToCheckout() {
2056
2172
  window.location.href = "/checkout";
@@ -2058,13 +2174,13 @@ function Qr() {
2058
2174
  };
2059
2175
  }
2060
2176
  export {
2061
- Hr as BundleBuilderDrawer,
2062
- Gr as BundleBuilderPanel,
2063
- Ur as BundleButton,
2064
- et as BundleLineAttributeKeys,
2065
- jr as BundleProvider,
2066
- Qr as createLiquidCartAdapter,
2067
- rt as useBundleBuilder,
2068
- Wr as useBundleBuilderDrawer
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
2069
2185
  };
2070
2186
  //# sourceMappingURL=index.js.map