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