@cimplify/sdk 0.8.14 → 0.9.1

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/react.js CHANGED
@@ -603,18 +603,6 @@ function normalizeCatalogueProductPayload(product) {
603
603
  const derivedDefaultPrice = readFinalPrice(normalized["default_price_info"]) || readFinalPrice(normalized["price_info"]) || (typeof normalized["final_price"] === "string" || typeof normalized["final_price"] === "number" ? normalized["final_price"] : void 0);
604
604
  normalized["default_price"] = derivedDefaultPrice ?? "0";
605
605
  }
606
- const variants = normalized["variants"];
607
- if (Array.isArray(variants)) {
608
- normalized["variants"] = variants.map((variant) => {
609
- if (!isRecord(variant)) return variant;
610
- const normalizedVariant = { ...variant };
611
- const variantAdjustment = normalizedVariant["price_adjustment"];
612
- if (variantAdjustment === void 0 || variantAdjustment === null || variantAdjustment === "") {
613
- normalizedVariant["price_adjustment"] = readFinalPrice(normalizedVariant["price_info"]) ?? "0";
614
- }
615
- return normalizedVariant;
616
- });
617
- }
618
606
  const addOns = normalized["add_ons"];
619
607
  if (Array.isArray(addOns)) {
620
608
  normalized["add_ons"] = addOns.map((addOn) => normalizeAddOnPayload(addOn));
@@ -757,9 +745,7 @@ var CatalogueQueries = class {
757
745
  return safe(
758
746
  this.client.post(
759
747
  `/api/v1/catalogue/products/${encodedId}/variants/find`,
760
- {
761
- axis_selections: selections
762
- }
748
+ { axis_selections: selections }
763
749
  )
764
750
  );
765
751
  }
@@ -6778,16 +6764,940 @@ function useCheckout() {
6778
6764
  );
6779
6765
  return { submit, process, isLoading };
6780
6766
  }
6767
+ function QuantitySelector({
6768
+ value,
6769
+ onChange,
6770
+ min = 1,
6771
+ max,
6772
+ className
6773
+ }) {
6774
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-quantity": true, className, style: { display: "inline-flex", alignItems: "center", gap: "0.5rem" }, children: [
6775
+ /* @__PURE__ */ jsxRuntime.jsx(
6776
+ "button",
6777
+ {
6778
+ type: "button",
6779
+ onClick: () => onChange(Math.max(min, value - 1)),
6780
+ disabled: value <= min,
6781
+ "aria-label": "Decrease quantity",
6782
+ "data-cimplify-quantity-decrement": true,
6783
+ children: "\u2212"
6784
+ }
6785
+ ),
6786
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-quantity-value": true, "aria-live": "polite", children: value }),
6787
+ /* @__PURE__ */ jsxRuntime.jsx(
6788
+ "button",
6789
+ {
6790
+ type: "button",
6791
+ onClick: () => onChange(max != null ? Math.min(max, value + 1) : value + 1),
6792
+ disabled: max != null && value >= max,
6793
+ "aria-label": "Increase quantity",
6794
+ "data-cimplify-quantity-increment": true,
6795
+ children: "+"
6796
+ }
6797
+ )
6798
+ ] });
6799
+ }
6800
+
6801
+ // src/utils/variant.ts
6802
+ function getVariantDisplayName(variant) {
6803
+ if (variant.name) return variant.name;
6804
+ if (variant.display_attributes?.length) {
6805
+ return variant.display_attributes.map((a) => a.value_name).join(" / ");
6806
+ }
6807
+ return variant.is_default ? "Default" : "Option";
6808
+ }
6809
+ function VariantSelector({
6810
+ variants,
6811
+ variantAxes,
6812
+ basePrice,
6813
+ selectedVariantId,
6814
+ onVariantChange,
6815
+ className
6816
+ }) {
6817
+ const [axisSelections, setAxisSelections] = React3.useState({});
6818
+ const initialized = React3.useRef(false);
6819
+ React3.useEffect(() => {
6820
+ initialized.current = false;
6821
+ }, [variants]);
6822
+ React3.useEffect(() => {
6823
+ if (initialized.current) return;
6824
+ if (!variants || variants.length === 0) return;
6825
+ const defaultVariant = variants.find((v) => v.is_default) || variants[0];
6826
+ if (!defaultVariant) return;
6827
+ initialized.current = true;
6828
+ onVariantChange(defaultVariant.id, defaultVariant);
6829
+ if (defaultVariant.display_attributes) {
6830
+ const initial = {};
6831
+ for (const attr of defaultVariant.display_attributes) {
6832
+ initial[attr.axis_id] = attr.value_id;
6833
+ }
6834
+ setAxisSelections(initial);
6835
+ }
6836
+ }, [variants, onVariantChange]);
6837
+ React3.useEffect(() => {
6838
+ if (!initialized.current) return;
6839
+ if (!variantAxes || variantAxes.length === 0) return;
6840
+ const match = variants.find((v) => {
6841
+ if (!v.display_attributes) return false;
6842
+ return v.display_attributes.every(
6843
+ (attr) => axisSelections[attr.axis_id] === attr.value_id
6844
+ );
6845
+ });
6846
+ if (match && match.id !== selectedVariantId) {
6847
+ onVariantChange(match.id, match);
6848
+ }
6849
+ }, [axisSelections, variants, variantAxes, selectedVariantId, onVariantChange]);
6850
+ if (!variants || variants.length <= 1) {
6851
+ return null;
6852
+ }
6853
+ const basePriceNum = basePrice != null ? parsePrice(basePrice) : 0;
6854
+ if (variantAxes && variantAxes.length > 0) {
6855
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className, children: variantAxes.map((axis) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-variant-axis": true, children: [
6856
+ /* @__PURE__ */ jsxRuntime.jsx("label", { "data-cimplify-variant-axis-label": true, children: axis.name }),
6857
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-axis-options": true, children: axis.values.map((value) => {
6858
+ const isSelected = axisSelections[axis.id] === value.id;
6859
+ return /* @__PURE__ */ jsxRuntime.jsx(
6860
+ "button",
6861
+ {
6862
+ type: "button",
6863
+ "aria-selected": isSelected,
6864
+ onClick: () => {
6865
+ setAxisSelections((prev) => ({
6866
+ ...prev,
6867
+ [axis.id]: value.id
6868
+ }));
6869
+ },
6870
+ "data-cimplify-variant-option": true,
6871
+ "data-selected": isSelected || void 0,
6872
+ children: value.name
6873
+ },
6874
+ value.id
6875
+ );
6876
+ }) })
6877
+ ] }, axis.id)) });
6878
+ }
6879
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-variant-selector": true, className, children: [
6880
+ /* @__PURE__ */ jsxRuntime.jsx("label", { "data-cimplify-variant-list-label": true, children: "Options" }),
6881
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-list": true, children: variants.map((variant) => {
6882
+ const isSelected = selectedVariantId === variant.id;
6883
+ const adjustment = parsePrice(variant.price_adjustment);
6884
+ const effectivePrice = basePriceNum + adjustment;
6885
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6886
+ "button",
6887
+ {
6888
+ type: "button",
6889
+ "aria-selected": isSelected,
6890
+ onClick: () => onVariantChange(variant.id, variant),
6891
+ "data-cimplify-variant-option": true,
6892
+ "data-selected": isSelected || void 0,
6893
+ children: [
6894
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-variant-name": true, children: getVariantDisplayName(variant) }),
6895
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-variant-pricing": true, children: [
6896
+ adjustment !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-variant-adjustment": true, children: [
6897
+ adjustment > 0 ? "+" : "",
6898
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: variant.price_adjustment })
6899
+ ] }),
6900
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: effectivePrice })
6901
+ ] })
6902
+ ]
6903
+ },
6904
+ variant.id
6905
+ );
6906
+ }) })
6907
+ ] });
6908
+ }
6909
+ function AddOnSelector({
6910
+ addOns,
6911
+ selectedOptions,
6912
+ onOptionsChange,
6913
+ className
6914
+ }) {
6915
+ const isOptionSelected = React3.useCallback(
6916
+ (optionId) => selectedOptions.includes(optionId),
6917
+ [selectedOptions]
6918
+ );
6919
+ const toggleOption = React3.useCallback(
6920
+ (addOn, optionId) => {
6921
+ const isSelected = selectedOptions.includes(optionId);
6922
+ if (addOn.is_mutually_exclusive || !addOn.is_multiple_allowed) {
6923
+ const groupOptionIds = new Set(addOn.options.map((o) => o.id));
6924
+ const withoutGroup = selectedOptions.filter((id) => !groupOptionIds.has(id));
6925
+ if (isSelected) {
6926
+ if (!addOn.is_required) {
6927
+ onOptionsChange(withoutGroup);
6928
+ }
6929
+ } else {
6930
+ onOptionsChange([...withoutGroup, optionId]);
6931
+ }
6932
+ } else {
6933
+ if (isSelected) {
6934
+ onOptionsChange(selectedOptions.filter((id) => id !== optionId));
6935
+ } else {
6936
+ const currentCount = selectedOptions.filter(
6937
+ (id) => addOn.options.some((o) => o.id === id)
6938
+ ).length;
6939
+ if (addOn.max_selections && currentCount >= addOn.max_selections) {
6940
+ return;
6941
+ }
6942
+ onOptionsChange([...selectedOptions, optionId]);
6943
+ }
6944
+ }
6945
+ },
6946
+ [selectedOptions, onOptionsChange]
6947
+ );
6948
+ if (!addOns || addOns.length === 0) {
6949
+ return null;
6950
+ }
6951
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-addon-selector": true, className, children: addOns.map((addOn) => {
6952
+ const currentSelections = selectedOptions.filter(
6953
+ (id) => addOn.options.some((o) => o.id === id)
6954
+ ).length;
6955
+ const minMet = !addOn.min_selections || currentSelections >= addOn.min_selections;
6956
+ const isSingleSelect = addOn.is_mutually_exclusive || !addOn.is_multiple_allowed;
6957
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-addon-group": true, children: [
6958
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-addon-header": true, children: [
6959
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
6960
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-addon-name": true, children: [
6961
+ addOn.name,
6962
+ addOn.is_required && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-addon-required": true, children: " *" })
6963
+ ] }),
6964
+ (addOn.min_selections || addOn.max_selections) && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-addon-constraint": true, children: addOn.min_selections && addOn.max_selections ? `Choose ${addOn.min_selections}\u2013${addOn.max_selections}` : addOn.min_selections ? `Choose at least ${addOn.min_selections}` : `Choose up to ${addOn.max_selections}` })
6965
+ ] }),
6966
+ !minMet && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-addon-validation": true, children: "Required" })
6967
+ ] }),
6968
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-addon-options": true, children: addOn.options.map((option) => {
6969
+ const isSelected = isOptionSelected(option.id);
6970
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6971
+ "button",
6972
+ {
6973
+ type: "button",
6974
+ role: isSingleSelect ? "radio" : "checkbox",
6975
+ "aria-checked": isSelected,
6976
+ onClick: () => toggleOption(addOn, option.id),
6977
+ "data-cimplify-addon-option": true,
6978
+ "data-selected": isSelected || void 0,
6979
+ children: [
6980
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-addon-option-name": true, children: option.name }),
6981
+ option.default_price && option.default_price !== "0" && /* @__PURE__ */ jsxRuntime.jsx(
6982
+ Price,
6983
+ {
6984
+ amount: option.default_price,
6985
+ prefix: "+"
6986
+ }
6987
+ )
6988
+ ]
6989
+ },
6990
+ option.id
6991
+ );
6992
+ }) })
6993
+ ] }, addOn.id);
6994
+ }) });
6995
+ }
6996
+ function CompositeSelector({
6997
+ productId,
6998
+ onSelectionsChange,
6999
+ onPriceChange,
7000
+ onReady,
7001
+ className
7002
+ }) {
7003
+ const { composite, isLoading, error, calculatePrice, priceResult, isPriceLoading } = useComposite(productId);
7004
+ const [groupSelections, setGroupSelections] = React3.useState({});
7005
+ const selections = React3.useMemo(() => {
7006
+ const result = [];
7007
+ for (const groupSels of Object.values(groupSelections)) {
7008
+ for (const [componentId, qty] of Object.entries(groupSels)) {
7009
+ if (qty > 0) {
7010
+ result.push({ component_id: componentId, quantity: qty });
7011
+ }
7012
+ }
7013
+ }
7014
+ return result;
7015
+ }, [groupSelections]);
7016
+ React3.useEffect(() => {
7017
+ onSelectionsChange(selections);
7018
+ }, [selections, onSelectionsChange]);
7019
+ React3.useEffect(() => {
7020
+ onPriceChange?.(priceResult);
7021
+ }, [priceResult, onPriceChange]);
7022
+ const allGroupsSatisfied = React3.useMemo(() => {
7023
+ if (!composite) return false;
7024
+ for (const group of composite.groups) {
7025
+ const groupSels = groupSelections[group.id] || {};
7026
+ const totalSelected = Object.values(groupSels).reduce((sum, q) => sum + q, 0);
7027
+ if (totalSelected < group.min_selections) return false;
7028
+ }
7029
+ return true;
7030
+ }, [composite, groupSelections]);
7031
+ React3.useEffect(() => {
7032
+ onReady?.(allGroupsSatisfied);
7033
+ }, [allGroupsSatisfied, onReady]);
7034
+ React3.useEffect(() => {
7035
+ if (allGroupsSatisfied && selections.length > 0) {
7036
+ void calculatePrice(selections);
7037
+ }
7038
+ }, [selections, allGroupsSatisfied, calculatePrice]);
7039
+ const toggleComponent = React3.useCallback(
7040
+ (group, component) => {
7041
+ setGroupSelections((prev) => {
7042
+ const groupSels = { ...prev[group.id] || {} };
7043
+ const currentQty = groupSels[component.id] || 0;
7044
+ if (currentQty > 0) {
7045
+ if (group.min_selections > 0) {
7046
+ const totalOthers = Object.entries(groupSels).filter(([id]) => id !== component.id).reduce((sum, [, q]) => sum + q, 0);
7047
+ if (totalOthers < group.min_selections) {
7048
+ return prev;
7049
+ }
7050
+ }
7051
+ delete groupSels[component.id];
7052
+ } else {
7053
+ const totalSelected = Object.values(groupSels).reduce((sum, q) => sum + q, 0);
7054
+ if (group.max_selections && totalSelected >= group.max_selections) {
7055
+ if (group.max_selections === 1) {
7056
+ return { ...prev, [group.id]: { [component.id]: 1 } };
7057
+ }
7058
+ return prev;
7059
+ }
7060
+ groupSels[component.id] = 1;
7061
+ }
7062
+ return { ...prev, [group.id]: groupSels };
7063
+ });
7064
+ },
7065
+ []
7066
+ );
7067
+ const updateQuantity = React3.useCallback(
7068
+ (group, componentId, delta) => {
7069
+ setGroupSelections((prev) => {
7070
+ const groupSels = { ...prev[group.id] || {} };
7071
+ const current = groupSels[componentId] || 0;
7072
+ const next = Math.max(0, current + delta);
7073
+ if (group.max_quantity_per_component && next > group.max_quantity_per_component) {
7074
+ return prev;
7075
+ }
7076
+ if (next === 0) {
7077
+ delete groupSels[componentId];
7078
+ } else {
7079
+ groupSels[componentId] = next;
7080
+ }
7081
+ return { ...prev, [group.id]: groupSels };
7082
+ });
7083
+ },
7084
+ []
7085
+ );
7086
+ if (isLoading) {
7087
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-composite-selector": true, "data-loading": true, className, children: "Loading options..." });
7088
+ }
7089
+ if (error || !composite) {
7090
+ return null;
7091
+ }
7092
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-selector": true, className, children: [
7093
+ composite.groups.sort((a, b) => a.display_order - b.display_order).map((group) => {
7094
+ const groupSels = groupSelections[group.id] || {};
7095
+ const totalSelected = Object.values(groupSels).reduce((sum, q) => sum + q, 0);
7096
+ const minMet = totalSelected >= group.min_selections;
7097
+ const isSingleSelect = group.max_selections === 1;
7098
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-group": true, children: [
7099
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-group-header": true, children: [
7100
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
7101
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-composite-group-name": true, children: [
7102
+ group.name,
7103
+ group.min_selections > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-required": true, children: " *" })
7104
+ ] }),
7105
+ group.description && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-group-description": true, children: group.description }),
7106
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-group-constraint": true, children: group.min_selections > 0 && group.max_selections ? `Choose ${group.min_selections}\u2013${group.max_selections}` : group.min_selections > 0 ? `Choose at least ${group.min_selections}` : group.max_selections ? `Choose up to ${group.max_selections}` : "Choose as many as you like" })
7107
+ ] }),
7108
+ !minMet && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-validation": true, children: "Required" })
7109
+ ] }),
7110
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-composite-components": true, children: group.components.filter((c) => c.is_available && !c.is_archived).sort((a, b) => a.display_order - b.display_order).map((component) => {
7111
+ const qty = groupSels[component.id] || 0;
7112
+ const isSelected = qty > 0;
7113
+ const displayName = component.display_name || component.product_id || component.id;
7114
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7115
+ "button",
7116
+ {
7117
+ type: "button",
7118
+ role: isSingleSelect ? "radio" : "checkbox",
7119
+ "aria-checked": isSelected,
7120
+ onClick: () => toggleComponent(group, component),
7121
+ "data-cimplify-composite-component": true,
7122
+ "data-selected": isSelected || void 0,
7123
+ children: [
7124
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-component-info": true, children: [
7125
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-component-name": true, children: displayName }),
7126
+ component.is_popular && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-badge": "popular", children: "Popular" }),
7127
+ component.is_premium && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-badge": "premium", children: "Premium" }),
7128
+ component.display_description && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-composite-component-description": true, children: component.display_description }),
7129
+ component.calories != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-composite-component-calories": true, children: [
7130
+ component.calories,
7131
+ " cal"
7132
+ ] })
7133
+ ] }),
7134
+ group.allow_quantity && isSelected && /* @__PURE__ */ jsxRuntime.jsxs(
7135
+ "span",
7136
+ {
7137
+ "data-cimplify-composite-qty": true,
7138
+ onClick: (e) => e.stopPropagation(),
7139
+ children: [
7140
+ /* @__PURE__ */ jsxRuntime.jsx(
7141
+ "button",
7142
+ {
7143
+ type: "button",
7144
+ onClick: () => updateQuantity(group, component.id, -1),
7145
+ "aria-label": `Decrease ${displayName} quantity`,
7146
+ children: "\u2212"
7147
+ }
7148
+ ),
7149
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: qty }),
7150
+ /* @__PURE__ */ jsxRuntime.jsx(
7151
+ "button",
7152
+ {
7153
+ type: "button",
7154
+ onClick: () => updateQuantity(group, component.id, 1),
7155
+ "aria-label": `Increase ${displayName} quantity`,
7156
+ children: "+"
7157
+ }
7158
+ )
7159
+ ]
7160
+ }
7161
+ ),
7162
+ component.price && component.price !== "0" && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: component.price, prefix: "+" })
7163
+ ]
7164
+ },
7165
+ component.id
7166
+ );
7167
+ }) })
7168
+ ] }, group.id);
7169
+ }),
7170
+ priceResult && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-summary": true, children: [
7171
+ priceResult.base_price !== "0" && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-summary-line": true, children: [
7172
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Base" }),
7173
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.base_price })
7174
+ ] }),
7175
+ priceResult.components_total !== "0" && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-summary-line": true, children: [
7176
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Selections" }),
7177
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.components_total })
7178
+ ] }),
7179
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-composite-summary-total": true, children: [
7180
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Total" }),
7181
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.final_price })
7182
+ ] })
7183
+ ] }),
7184
+ isPriceLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-composite-calculating": true, children: "Calculating price..." })
7185
+ ] });
7186
+ }
7187
+ function BundleSelector({
7188
+ bundleIdOrSlug,
7189
+ onSelectionsChange,
7190
+ onReady,
7191
+ className
7192
+ }) {
7193
+ const { bundle, isLoading, error } = useBundle(bundleIdOrSlug);
7194
+ const [variantChoices, setVariantChoices] = React3.useState({});
7195
+ React3.useEffect(() => {
7196
+ if (!bundle) return;
7197
+ const defaults = {};
7198
+ for (const comp of bundle.components) {
7199
+ if (comp.component.variant_id) {
7200
+ defaults[comp.component.id] = comp.component.variant_id;
7201
+ } else if (comp.variants.length > 0) {
7202
+ const defaultVariant = comp.variants.find((v) => v.is_default) || comp.variants[0];
7203
+ if (defaultVariant) {
7204
+ defaults[comp.component.id] = defaultVariant.id;
7205
+ }
7206
+ }
7207
+ }
7208
+ setVariantChoices(defaults);
7209
+ }, [bundle]);
7210
+ const selections = React3.useMemo(() => {
7211
+ if (!bundle) return [];
7212
+ return bundle.components.map((comp) => ({
7213
+ component_id: comp.component.id,
7214
+ variant_id: variantChoices[comp.component.id],
7215
+ quantity: comp.component.quantity
7216
+ }));
7217
+ }, [bundle, variantChoices]);
7218
+ React3.useEffect(() => {
7219
+ onSelectionsChange(selections);
7220
+ }, [selections, onSelectionsChange]);
7221
+ React3.useEffect(() => {
7222
+ onReady?.(bundle != null && selections.length > 0);
7223
+ }, [bundle, selections, onReady]);
7224
+ const handleVariantChange = React3.useCallback(
7225
+ (componentId, variantId) => {
7226
+ setVariantChoices((prev) => ({ ...prev, [componentId]: variantId }));
7227
+ },
7228
+ []
7229
+ );
7230
+ if (isLoading) {
7231
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-bundle-selector": true, "data-loading": true, className, children: "Loading bundle..." });
7232
+ }
7233
+ if (error || !bundle) {
7234
+ return null;
7235
+ }
7236
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bundle-selector": true, className, children: [
7237
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-bundle-heading": true, children: "Included in this bundle" }),
7238
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-bundle-components": true, children: bundle.components.map((comp) => /* @__PURE__ */ jsxRuntime.jsx(
7239
+ BundleComponentCard,
7240
+ {
7241
+ data: comp,
7242
+ selectedVariantId: variantChoices[comp.component.id],
7243
+ onVariantChange: (variantId) => handleVariantChange(comp.component.id, variantId)
7244
+ },
7245
+ comp.component.id
7246
+ )) }),
7247
+ bundle.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bundle-summary": true, children: [
7248
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Bundle price" }),
7249
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: bundle.bundle_price })
7250
+ ] }),
7251
+ bundle.discount_value && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bundle-savings": true, children: [
7252
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "You save" }),
7253
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: bundle.discount_value })
7254
+ ] })
7255
+ ] });
7256
+ }
7257
+ function BundleComponentCard({
7258
+ data,
7259
+ selectedVariantId,
7260
+ onVariantChange
7261
+ }) {
7262
+ const { component, product, variants } = data;
7263
+ const showVariantPicker = component.allow_variant_choice && variants.length > 1;
7264
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bundle-component": true, children: [
7265
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bundle-component-header": true, children: [
7266
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
7267
+ component.quantity > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-bundle-component-qty": true, children: [
7268
+ "\xD7",
7269
+ component.quantity
7270
+ ] }),
7271
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-bundle-component-name": true, children: product.name })
7272
+ ] }),
7273
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price })
7274
+ ] }),
7275
+ showVariantPicker && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-bundle-variant-picker": true, children: variants.map((variant) => {
7276
+ const isSelected = selectedVariantId === variant.id;
7277
+ const adjustment = parsePrice(variant.price_adjustment);
7278
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7279
+ "button",
7280
+ {
7281
+ type: "button",
7282
+ "aria-selected": isSelected,
7283
+ onClick: () => onVariantChange(variant.id),
7284
+ "data-cimplify-bundle-variant-option": true,
7285
+ "data-selected": isSelected || void 0,
7286
+ children: [
7287
+ getVariantDisplayName(variant),
7288
+ adjustment !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-bundle-variant-adjustment": true, children: [
7289
+ adjustment > 0 ? "+" : "",
7290
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: variant.price_adjustment })
7291
+ ] })
7292
+ ]
7293
+ },
7294
+ variant.id
7295
+ );
7296
+ }) })
7297
+ ] });
7298
+ }
7299
+ function ProductCustomizer({
7300
+ product,
7301
+ onAddToCart,
7302
+ className
7303
+ }) {
7304
+ const [quantity, setQuantity] = React3.useState(1);
7305
+ const [isAdded, setIsAdded] = React3.useState(false);
7306
+ const [isSubmitting, setIsSubmitting] = React3.useState(false);
7307
+ const [selectedVariantId, setSelectedVariantId] = React3.useState();
7308
+ const [selectedVariant, setSelectedVariant] = React3.useState();
7309
+ const [selectedAddOnOptionIds, setSelectedAddOnOptionIds] = React3.useState([]);
7310
+ const [compositeSelections, setCompositeSelections] = React3.useState([]);
7311
+ const [compositePrice, setCompositePrice] = React3.useState(null);
7312
+ const [compositeReady, setCompositeReady] = React3.useState(false);
7313
+ const [bundleSelections, setBundleSelections] = React3.useState([]);
7314
+ const [bundleReady, setBundleReady] = React3.useState(false);
7315
+ const cart = useCart();
7316
+ const productType = product.product_type || "product";
7317
+ const isComposite = productType === "composite";
7318
+ const isBundle = productType === "bundle";
7319
+ const isStandard = !isComposite && !isBundle;
7320
+ const hasVariants = isStandard && product.variants && product.variants.length > 0;
7321
+ const hasAddOns = isStandard && product.add_ons && product.add_ons.length > 0;
7322
+ React3.useEffect(() => {
7323
+ setQuantity(1);
7324
+ setIsAdded(false);
7325
+ setIsSubmitting(false);
7326
+ setSelectedVariantId(void 0);
7327
+ setSelectedVariant(void 0);
7328
+ setSelectedAddOnOptionIds([]);
7329
+ setCompositeSelections([]);
7330
+ setCompositePrice(null);
7331
+ setCompositeReady(false);
7332
+ setBundleSelections([]);
7333
+ setBundleReady(false);
7334
+ }, [product.id]);
7335
+ const selectedAddOnOptions = React3.useMemo(() => {
7336
+ if (!product.add_ons) return [];
7337
+ const options = [];
7338
+ for (const addOn of product.add_ons) {
7339
+ for (const option of addOn.options) {
7340
+ if (selectedAddOnOptionIds.includes(option.id)) {
7341
+ options.push(option);
7342
+ }
7343
+ }
7344
+ }
7345
+ return options;
7346
+ }, [product.add_ons, selectedAddOnOptionIds]);
7347
+ const normalizedAddOnOptionIds = React3.useMemo(() => {
7348
+ if (selectedAddOnOptionIds.length === 0) return [];
7349
+ return Array.from(new Set(selectedAddOnOptionIds.map((id) => id.trim()).filter(Boolean))).sort();
7350
+ }, [selectedAddOnOptionIds]);
7351
+ const localTotalPrice = React3.useMemo(() => {
7352
+ if (isComposite && compositePrice) {
7353
+ return parsePrice(compositePrice.final_price) * quantity;
7354
+ }
7355
+ let price = parsePrice(product.default_price);
7356
+ if (selectedVariant?.price_adjustment) {
7357
+ price += parsePrice(selectedVariant.price_adjustment);
7358
+ }
7359
+ for (const option of selectedAddOnOptions) {
7360
+ if (option.default_price) {
7361
+ price += parsePrice(option.default_price);
7362
+ }
7363
+ }
7364
+ return price * quantity;
7365
+ }, [product.default_price, selectedVariant, selectedAddOnOptions, quantity, isComposite, compositePrice]);
7366
+ const requiredAddOnsSatisfied = React3.useMemo(() => {
7367
+ if (!product.add_ons) return true;
7368
+ for (const addOn of product.add_ons) {
7369
+ if (addOn.is_required) {
7370
+ const selectedInGroup = selectedAddOnOptionIds.filter(
7371
+ (id) => addOn.options.some((opt) => opt.id === id)
7372
+ ).length;
7373
+ const minRequired = addOn.min_selections || 1;
7374
+ if (selectedInGroup < minRequired) {
7375
+ return false;
7376
+ }
7377
+ }
7378
+ }
7379
+ return true;
7380
+ }, [product.add_ons, selectedAddOnOptionIds]);
7381
+ const quoteInput = React3.useMemo(
7382
+ () => ({
7383
+ productId: product.id,
7384
+ quantity,
7385
+ variantId: selectedVariantId,
7386
+ addOnOptionIds: normalizedAddOnOptionIds.length > 0 ? normalizedAddOnOptionIds : void 0
7387
+ }),
7388
+ [product.id, quantity, selectedVariantId, normalizedAddOnOptionIds]
7389
+ );
7390
+ const { quote } = useQuote(quoteInput, {
7391
+ enabled: isStandard && requiredAddOnsSatisfied
7392
+ });
7393
+ const quoteId = quote?.quote_id;
7394
+ const quotedTotalPrice = React3.useMemo(() => {
7395
+ if (!quote) return void 0;
7396
+ const quotedTotal = quote.quoted_total_price_info?.final_price ?? quote.final_price_info.final_price;
7397
+ return quotedTotal === void 0 || quotedTotal === null ? void 0 : parsePrice(quotedTotal);
7398
+ }, [quote]);
7399
+ const displayTotalPrice = quotedTotalPrice ?? localTotalPrice;
7400
+ const canAddToCart = React3.useMemo(() => {
7401
+ if (isComposite) return compositeReady;
7402
+ if (isBundle) return bundleReady;
7403
+ return requiredAddOnsSatisfied;
7404
+ }, [isComposite, isBundle, compositeReady, bundleReady, requiredAddOnsSatisfied]);
7405
+ const handleVariantChange = React3.useCallback(
7406
+ (variantId, variant) => {
7407
+ setSelectedVariantId(variantId);
7408
+ setSelectedVariant(variant);
7409
+ },
7410
+ []
7411
+ );
7412
+ const handleAddToCart = async () => {
7413
+ if (isSubmitting) return;
7414
+ setIsSubmitting(true);
7415
+ const options = {
7416
+ variantId: selectedVariantId,
7417
+ variant: selectedVariant ? { id: selectedVariant.id, name: selectedVariant.name || "", price_adjustment: selectedVariant.price_adjustment } : void 0,
7418
+ quoteId,
7419
+ addOnOptionIds: normalizedAddOnOptionIds.length > 0 ? normalizedAddOnOptionIds : void 0,
7420
+ addOnOptions: selectedAddOnOptions.length > 0 ? selectedAddOnOptions.map((opt) => ({
7421
+ id: opt.id,
7422
+ name: opt.name,
7423
+ add_on_id: opt.add_on_id,
7424
+ default_price: opt.default_price
7425
+ })) : void 0,
7426
+ compositeSelections: isComposite && compositeSelections.length > 0 ? compositeSelections : void 0,
7427
+ bundleSelections: isBundle && bundleSelections.length > 0 ? bundleSelections : void 0
7428
+ };
7429
+ try {
7430
+ if (onAddToCart) {
7431
+ await onAddToCart(product, quantity, options);
7432
+ } else {
7433
+ await cart.addItem(product, quantity, options);
7434
+ }
7435
+ setIsAdded(true);
7436
+ setTimeout(() => {
7437
+ setIsAdded(false);
7438
+ setQuantity(1);
7439
+ }, 2e3);
7440
+ } catch {
7441
+ } finally {
7442
+ setIsSubmitting(false);
7443
+ }
7444
+ };
7445
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customizer": true, className, children: [
7446
+ isComposite && /* @__PURE__ */ jsxRuntime.jsx(
7447
+ CompositeSelector,
7448
+ {
7449
+ productId: product.id,
7450
+ onSelectionsChange: setCompositeSelections,
7451
+ onPriceChange: setCompositePrice,
7452
+ onReady: setCompositeReady
7453
+ }
7454
+ ),
7455
+ isBundle && /* @__PURE__ */ jsxRuntime.jsx(
7456
+ BundleSelector,
7457
+ {
7458
+ bundleIdOrSlug: product.slug,
7459
+ onSelectionsChange: setBundleSelections,
7460
+ onReady: setBundleReady
7461
+ }
7462
+ ),
7463
+ hasVariants && /* @__PURE__ */ jsxRuntime.jsx(
7464
+ VariantSelector,
7465
+ {
7466
+ variants: product.variants,
7467
+ variantAxes: product.variant_axes,
7468
+ basePrice: product.default_price,
7469
+ selectedVariantId,
7470
+ onVariantChange: handleVariantChange
7471
+ }
7472
+ ),
7473
+ hasAddOns && /* @__PURE__ */ jsxRuntime.jsx(
7474
+ AddOnSelector,
7475
+ {
7476
+ addOns: product.add_ons,
7477
+ selectedOptions: selectedAddOnOptionIds,
7478
+ onOptionsChange: setSelectedAddOnOptionIds
7479
+ }
7480
+ ),
7481
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customizer-actions": true, children: [
7482
+ /* @__PURE__ */ jsxRuntime.jsx(
7483
+ QuantitySelector,
7484
+ {
7485
+ value: quantity,
7486
+ onChange: setQuantity,
7487
+ min: 1
7488
+ }
7489
+ ),
7490
+ /* @__PURE__ */ jsxRuntime.jsx(
7491
+ "button",
7492
+ {
7493
+ type: "button",
7494
+ onClick: handleAddToCart,
7495
+ disabled: isAdded || isSubmitting || !canAddToCart,
7496
+ "data-cimplify-customizer-submit": true,
7497
+ children: isAdded ? "Added to Cart" : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7498
+ "Add to Cart \xB7 ",
7499
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: displayTotalPrice })
7500
+ ] })
7501
+ }
7502
+ )
7503
+ ] }),
7504
+ !canAddToCart && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-customizer-validation": true, children: "Please select all required options" })
7505
+ ] });
7506
+ }
7507
+ var ASPECT_STYLES = {
7508
+ square: { aspectRatio: "1/1" },
7509
+ "4/3": { aspectRatio: "4/3" },
7510
+ "16/10": { aspectRatio: "16/10" },
7511
+ "3/4": { aspectRatio: "3/4" }
7512
+ };
7513
+ function ProductImageGallery({
7514
+ images,
7515
+ productName,
7516
+ aspectRatio = "4/3",
7517
+ className
7518
+ }) {
7519
+ const normalizedImages = React3.useMemo(
7520
+ () => images.filter(
7521
+ (image) => typeof image === "string" && image.trim().length > 0
7522
+ ),
7523
+ [images]
7524
+ );
7525
+ const [selectedImage, setSelectedImage] = React3.useState(0);
7526
+ React3.useEffect(() => {
7527
+ setSelectedImage(0);
7528
+ }, [normalizedImages.length, productName]);
7529
+ if (normalizedImages.length === 0) {
7530
+ return null;
7531
+ }
7532
+ const activeImage = normalizedImages[selectedImage] || normalizedImages[0];
7533
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-image-gallery": true, className, children: [
7534
+ /* @__PURE__ */ jsxRuntime.jsx(
7535
+ "div",
7536
+ {
7537
+ "data-cimplify-image-gallery-main": true,
7538
+ style: { position: "relative", overflow: "hidden", ...ASPECT_STYLES[aspectRatio] },
7539
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7540
+ "img",
7541
+ {
7542
+ src: activeImage,
7543
+ alt: productName,
7544
+ style: { width: "100%", height: "100%", objectFit: "cover" },
7545
+ "data-cimplify-image-gallery-active": true
7546
+ }
7547
+ )
7548
+ }
7549
+ ),
7550
+ normalizedImages.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-image-gallery-thumbnails": true, style: { display: "flex", gap: "0.5rem", marginTop: "0.75rem" }, children: normalizedImages.map((image, index) => /* @__PURE__ */ jsxRuntime.jsx(
7551
+ "button",
7552
+ {
7553
+ type: "button",
7554
+ onClick: () => setSelectedImage(index),
7555
+ "aria-selected": selectedImage === index,
7556
+ "data-cimplify-image-gallery-thumb": true,
7557
+ "data-selected": selectedImage === index || void 0,
7558
+ style: {
7559
+ width: "4rem",
7560
+ height: "4rem",
7561
+ overflow: "hidden",
7562
+ padding: 0,
7563
+ border: "none",
7564
+ cursor: "pointer"
7565
+ },
7566
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7567
+ "img",
7568
+ {
7569
+ src: image,
7570
+ alt: "",
7571
+ style: { width: "100%", height: "100%", objectFit: "cover" }
7572
+ }
7573
+ )
7574
+ },
7575
+ `${image}-${index}`
7576
+ )) })
7577
+ ] });
7578
+ }
7579
+ function computeUnitPrice(item) {
7580
+ let price = parsePrice(item.product.default_price);
7581
+ if (item.variant?.price_adjustment) {
7582
+ price += parsePrice(item.variant.price_adjustment);
7583
+ }
7584
+ for (const option of item.addOnOptions || []) {
7585
+ if (option.default_price) {
7586
+ price += parsePrice(option.default_price);
7587
+ }
7588
+ }
7589
+ return Math.round(price * 100) / 100;
7590
+ }
7591
+ function CartSummary({
7592
+ onCheckout,
7593
+ onItemRemove,
7594
+ onQuantityChange,
7595
+ emptyMessage = "Your cart is empty",
7596
+ className
7597
+ }) {
7598
+ const { items, itemCount, subtotal, tax, total, isEmpty, removeItem, updateQuantity } = useCart();
7599
+ const handleRemove = (itemId) => {
7600
+ if (onItemRemove) {
7601
+ onItemRemove(itemId);
7602
+ } else {
7603
+ void removeItem(itemId);
7604
+ }
7605
+ };
7606
+ const handleQuantityChange = (itemId, qty) => {
7607
+ if (onQuantityChange) {
7608
+ onQuantityChange(itemId, qty);
7609
+ } else {
7610
+ void updateQuantity(itemId, qty);
7611
+ }
7612
+ };
7613
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-summary": true, className, children: isEmpty ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-empty": true, children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: emptyMessage }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7614
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-cart-items": true, children: items.map((item) => {
7615
+ const unitPrice = computeUnitPrice(item);
7616
+ const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
7617
+ const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
7618
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-item": true, children: [
7619
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-item-info": true, children: [
7620
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-item-name": true, children: item.product.name }),
7621
+ item.variant && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-item-variant": true, children: getVariantDisplayName(item.variant) }),
7622
+ item.addOnOptions && item.addOnOptions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-cart-item-addons": true, children: [
7623
+ "+ ",
7624
+ item.addOnOptions.map((opt) => opt.name).join(", ")
7625
+ ] }),
7626
+ (hasComposite || hasBundle) && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-cart-item-badge": true, children: hasComposite ? "Custom" : "Bundle" }),
7627
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: unitPrice })
7628
+ ] }),
7629
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-item-controls": true, children: [
7630
+ /* @__PURE__ */ jsxRuntime.jsx(
7631
+ QuantitySelector,
7632
+ {
7633
+ value: item.quantity,
7634
+ onChange: (qty) => handleQuantityChange(item.id, qty),
7635
+ min: 0
7636
+ }
7637
+ ),
7638
+ /* @__PURE__ */ jsxRuntime.jsx(
7639
+ "button",
7640
+ {
7641
+ type: "button",
7642
+ onClick: () => handleRemove(item.id),
7643
+ "data-cimplify-cart-item-remove": true,
7644
+ "aria-label": `Remove ${item.product.name}`,
7645
+ children: "Remove"
7646
+ }
7647
+ )
7648
+ ] })
7649
+ ] }, item.id);
7650
+ }) }),
7651
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-totals": true, children: [
7652
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-subtotal": true, children: [
7653
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
7654
+ "Subtotal (",
7655
+ itemCount,
7656
+ " ",
7657
+ itemCount === 1 ? "item" : "items",
7658
+ ")"
7659
+ ] }),
7660
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal })
7661
+ ] }),
7662
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-tax": true, children: [
7663
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
7664
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: tax })
7665
+ ] }),
7666
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-total": true, children: [
7667
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Total" }),
7668
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: total })
7669
+ ] })
7670
+ ] }),
7671
+ onCheckout && /* @__PURE__ */ jsxRuntime.jsx(
7672
+ "button",
7673
+ {
7674
+ type: "button",
7675
+ onClick: onCheckout,
7676
+ "data-cimplify-cart-checkout": true,
7677
+ children: "Proceed to Checkout"
7678
+ }
7679
+ )
7680
+ ] }) });
7681
+ }
6781
7682
 
6782
7683
  exports.Ad = Ad;
6783
7684
  exports.AdProvider = AdProvider;
7685
+ exports.AddOnSelector = AddOnSelector;
6784
7686
  exports.AddressElement = AddressElement;
6785
7687
  exports.AuthElement = AuthElement;
7688
+ exports.BundleSelector = BundleSelector;
7689
+ exports.CartSummary = CartSummary;
6786
7690
  exports.CimplifyCheckout = CimplifyCheckout;
6787
7691
  exports.CimplifyProvider = CimplifyProvider;
7692
+ exports.CompositeSelector = CompositeSelector;
6788
7693
  exports.ElementsProvider = ElementsProvider;
6789
7694
  exports.PaymentElement = PaymentElement;
6790
7695
  exports.Price = Price;
7696
+ exports.ProductCustomizer = ProductCustomizer;
7697
+ exports.ProductImageGallery = ProductImageGallery;
7698
+ exports.QuantitySelector = QuantitySelector;
7699
+ exports.VariantSelector = VariantSelector;
7700
+ exports.getVariantDisplayName = getVariantDisplayName;
6791
7701
  exports.useAds = useAds;
6792
7702
  exports.useBundle = useBundle;
6793
7703
  exports.useCart = useCart;