@brytdesigns/shopify-ajax-cart-api 1.0.4 → 1.0.5

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/esm/index.js CHANGED
@@ -935,6 +935,15 @@ var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false
935
935
  var make3 = (...elements) => elements;
936
936
 
937
937
  // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Record.js
938
+ var fromEntries = Object.fromEntries;
939
+ var collect = /* @__PURE__ */ dual(2, (self, f) => {
940
+ const out = [];
941
+ for (const key of keys(self)) {
942
+ out.push(f(key, self[key]));
943
+ }
944
+ return out;
945
+ });
946
+ var toEntries = /* @__PURE__ */ collect((key, value2) => [key, value2]);
938
947
  var map3 = /* @__PURE__ */ dual(2, (self, f) => {
939
948
  const out = {
940
949
  ...self
@@ -14766,343 +14775,49 @@ var filterLevelOrNever = (level, effect3) => gen2(function* () {
14766
14775
  });
14767
14776
  var makeNamespacedLogSpan = (prefix) => (label) => withLogSpan2(`${prefix}:${label}`);
14768
14777
 
14769
- // src/effect/schema.ts
14770
- var BaseAttributeValue = Union2(
14771
- Null,
14772
- String$,
14773
- Boolean$,
14774
- Number$
14775
- );
14776
- var BaseAttributes = Record({
14777
- key: String$,
14778
- value: BaseAttributeValue
14779
- });
14780
- var Attributes = BaseAttributes;
14781
- var AttributesArray = transform2(
14782
- Attributes,
14783
- Array$(
14784
- Struct({ key: String$, value: BaseAttributeValue })
14785
- ),
14786
- {
14787
- decode: (record2) => Object.keys(record2).map((key) => ({
14788
- key,
14789
- value: record2[key]
14790
- })),
14791
- encode: (array3) => array3.reduce(
14792
- (result, { key, value: value2 }) => ({
14793
- ...result,
14794
- [key]: value2
14795
- }),
14796
- {}
14797
- )
14778
+ // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/queue.js
14779
+ var EnqueueSymbolKey = "effect/QueueEnqueue";
14780
+ var EnqueueTypeId = /* @__PURE__ */ Symbol.for(EnqueueSymbolKey);
14781
+ var DequeueSymbolKey = "effect/QueueDequeue";
14782
+ var DequeueTypeId = /* @__PURE__ */ Symbol.for(DequeueSymbolKey);
14783
+ var QueueStrategySymbolKey = "effect/QueueStrategy";
14784
+ var QueueStrategyTypeId = /* @__PURE__ */ Symbol.for(QueueStrategySymbolKey);
14785
+ var BackingQueueSymbolKey = "effect/BackingQueue";
14786
+ var BackingQueueTypeId = /* @__PURE__ */ Symbol.for(BackingQueueSymbolKey);
14787
+ var queueStrategyVariance = {
14788
+ /* c8 ignore next */
14789
+ _A: (_) => _
14790
+ };
14791
+ var backingQueueVariance = {
14792
+ /* c8 ignore next */
14793
+ _A: (_) => _
14794
+ };
14795
+ var enqueueVariance = {
14796
+ /* c8 ignore next */
14797
+ _In: (_) => _
14798
+ };
14799
+ var dequeueVariance = {
14800
+ /* c8 ignore next */
14801
+ _Out: (_) => _
14802
+ };
14803
+ var QueueImpl = class extends Class2 {
14804
+ queue;
14805
+ takers;
14806
+ shutdownHook;
14807
+ shutdownFlag;
14808
+ strategy;
14809
+ [EnqueueTypeId] = enqueueVariance;
14810
+ [DequeueTypeId] = dequeueVariance;
14811
+ constructor(queue, takers, shutdownHook, shutdownFlag, strategy) {
14812
+ super();
14813
+ this.queue = queue;
14814
+ this.takers = takers;
14815
+ this.shutdownHook = shutdownHook;
14816
+ this.shutdownFlag = shutdownFlag;
14817
+ this.strategy = strategy;
14798
14818
  }
14799
- );
14800
- var DiscountApplication = Struct({
14801
- target_selection: Literal2("all", "entitled", "explicit"),
14802
- target_type: Literal2("line_item", "shipping_line"),
14803
- title: NonEmptyString,
14804
- total_allocated_amount: Number$,
14805
- type: Literal2("", "automatic", "discount_code", "manual", "script"),
14806
- value: Union2(Number$, NumberFromString),
14807
- value_type: Literal2("fixed_amount", "percentage"),
14808
- description: NullOr(String$)
14809
- });
14810
- var Discount = Struct({
14811
- amount: Number$,
14812
- title: String$
14813
- });
14814
- var CurrencyCode = String$;
14815
- var Image = Struct({
14816
- aspect_ratio: Number$,
14817
- alt: String$,
14818
- height: Number$,
14819
- url: String$,
14820
- width: Number$
14821
- });
14822
- var OptionWithValue = Struct({
14823
- name: String$,
14824
- value: String$
14825
- });
14826
- var QuantityRule = Struct({
14827
- min: Number$,
14828
- max: NullOr(Number$),
14829
- increment: Number$
14830
- });
14831
- var SellingPlanAllocationPriceAdjustment = Struct({
14832
- position: Number$,
14833
- price: Number$
14834
- });
14835
- var SellingPlanPriceAdjustment = Struct({
14836
- order_count: NullOr(Number$),
14837
- position: Number$,
14838
- value: Number$,
14839
- value_type: Literal2("percentage", "fixed_amount", "price")
14840
- });
14841
- var SellingPlanOption = Struct({
14842
- name: String$,
14843
- position: Number$,
14844
- value: String$
14845
- });
14846
- var SellingPlan = Struct({
14847
- id: Resource_exports.ID,
14848
- name: String$,
14849
- description: NullOr(String$),
14850
- options: Array$(SellingPlanOption),
14851
- recurring_deliveries: optionalWith(Boolean$, {
14852
- default: () => false
14853
- }),
14854
- fixed_selling_plan: optionalWith(Boolean$, {
14855
- default: () => false
14856
- }),
14857
- price_adjustments: Array$(SellingPlanPriceAdjustment)
14858
- });
14859
- var SellingPlanAllocation = Struct({
14860
- price_adjustments: Array$(SellingPlanAllocationPriceAdjustment),
14861
- price: Number$,
14862
- compare_at_price: Number$,
14863
- per_delivery_price: Number$,
14864
- selling_plan: SellingPlan
14865
- });
14866
- var LineLevelDiscountAllocation = Struct({
14867
- amount: Number$,
14868
- discount_application: DiscountApplication
14869
- });
14870
- var CartLevelDiscountApplicationUpdate = transform2(
14871
- Struct({
14872
- discount_application: DiscountApplication
14873
- }),
14874
- DiscountApplication,
14875
- {
14876
- decode: (application) => application.discount_application,
14877
- encode: (discountApplication) => ({
14878
- discount_application: discountApplication
14879
- }),
14880
- strict: false
14881
- }
14882
- );
14883
- var CartLevelDiscountApplication = Union2(
14884
- DiscountApplication,
14885
- CartLevelDiscountApplicationUpdate
14886
- );
14887
- var UnitPriceMeasurement = Struct({
14888
- measured_type: Literal2("volume", "weight", "dimension"),
14889
- quantity_unit: String$,
14890
- quantity_value: Number$,
14891
- reference_unit: String$,
14892
- reference_value: Number$
14893
- });
14894
- var LineItem = Struct({
14895
- id: Resource_exports.ID,
14896
- properties: optionalWith(NullOr(Attributes), {
14897
- default: () => ({})
14898
- }),
14899
- properties_array: optionalWith(NullOr(AttributesArray), {
14900
- default: () => []
14901
- }),
14902
- quantity: Number$,
14903
- variant_id: Resource_exports.ID,
14904
- key: String$,
14905
- title: String$,
14906
- price: Number$,
14907
- original_price: Number$,
14908
- discounted_price: Number$,
14909
- line_price: Number$,
14910
- original_line_price: Number$,
14911
- total_discount: Number$,
14912
- discounts: optionalWith(Array$(Discount), { default: () => [] }),
14913
- sku: NullOr(String$),
14914
- grams: Number$,
14915
- vendor: String$,
14916
- taxable: Boolean$,
14917
- product_id: Resource_exports.ID,
14918
- product_has_only_default_variant: Boolean$,
14919
- gift_card: Boolean$,
14920
- final_line_price: Number$,
14921
- final_price: Number$,
14922
- url: String$,
14923
- featured_image: optional(Image),
14924
- image: String$,
14925
- handle: String$,
14926
- requires_shipping: Boolean$,
14927
- product_type: String$,
14928
- product_title: String$,
14929
- product_description: String$,
14930
- variant_title: NullOr(String$),
14931
- variant_options: Array$(String$),
14932
- options_with_values: Array$(OptionWithValue),
14933
- line_level_discount_allocations: Array$(LineLevelDiscountAllocation),
14934
- line_level_total_discount: Number$,
14935
- quantity_rule: optional(QuantityRule),
14936
- has_components: optionalWith(Boolean$, { default: () => false }),
14937
- unit_price: optional(Number$),
14938
- unit_price_measurement: optional(UnitPriceMeasurement),
14939
- selling_plan_allocation: optionalWith(
14940
- NullOr(SellingPlanAllocation),
14941
- { default: () => null }
14942
- )
14943
- });
14944
- var Cart = Struct({
14945
- token: String$,
14946
- note: NullOr(String$),
14947
- attributes: optionalWith(Attributes, {
14948
- default: () => ({})
14949
- }),
14950
- attributes_array: optionalWith(AttributesArray, { default: () => [] }),
14951
- discounts: optionalWith(Array$(Discount), { default: () => [] }),
14952
- discount_codes: optionalWith(
14953
- Array$(
14954
- Struct({ code: String$, applicable: Boolean$ })
14955
- ),
14956
- { default: () => [] }
14957
- ),
14958
- original_total_price: Number$,
14959
- total_price: Number$,
14960
- total_discount: Number$,
14961
- total_weight: Number$,
14962
- item_count: Number$,
14963
- items: Array$(LineItem),
14964
- requires_shipping: Boolean$,
14965
- currency: CurrencyCode,
14966
- items_subtotal_price: Number$,
14967
- cart_level_discount_applications: Array$(CartLevelDiscountApplication)
14968
- });
14969
- var AddItemInput = Struct({
14970
- id: Resource_exports.ID,
14971
- quantity: optionalWith(Number$, { default: () => 1 }),
14972
- properties: optionalWith(BaseAttributes, { default: () => ({}) }),
14973
- selling_plan: optional(Resource_exports.ID)
14974
- });
14975
- var BaseInput = extend3(Ajax_exports.Sections.Input);
14976
- var CartAddInput = Struct({
14977
- items: Array$(AddItemInput)
14978
- }).pipe(BaseInput);
14979
- var CartAddOutput = Struct({
14980
- items: Array$(LineItem)
14981
- });
14982
- var UpdateItemRecordInput = Record({
14983
- key: String$,
14984
- value: Number$
14985
- });
14986
- var DiscountCodeInput = Array$(String$);
14987
- var DiscountCodeTransformed = String$;
14988
- var CartUpdateInput = Struct({
14989
- updates: optional(
14990
- Union2(UpdateItemRecordInput, Array$(Number$))
14991
- ),
14992
- note: optional(NullOr(String$)),
14993
- attributes: optional(Attributes),
14994
- discount: optional(
14995
- transform2(DiscountCodeInput, DiscountCodeTransformed, {
14996
- decode: (input) => input.join(","),
14997
- encode: (input) => input.split(",")
14998
- })
14999
- )
15000
- }).pipe(BaseInput);
15001
- var ItemAddedChangelog = Struct({
15002
- variant_id: Number$,
15003
- quantity: Number$
15004
- });
15005
- var CartUpdateOutput = Struct({
15006
- ...Cart.fields,
15007
- items_changelog: Struct({
15008
- added: Array$(ItemAddedChangelog)
15009
- })
15010
- });
15011
- var CartChangeItemOptionalInput = Struct({
15012
- quantity: optional(Number$),
15013
- properties: optional(
15014
- Record({
15015
- key: String$,
15016
- value: NullOr(String$)
15017
- })
15018
- ),
15019
- selling_plan: optional(NullOr(Resource_exports.ID))
15020
- }).pipe(BaseInput);
15021
- var LineItemChange = Struct({
15022
- product_id: Number$,
15023
- variant_id: Number$,
15024
- id: String$,
15025
- image: String$,
15026
- price: String$,
15027
- presentment_price: Number$,
15028
- quantity: Number$,
15029
- title: String$,
15030
- product_title: String$,
15031
- variant_title: String$,
15032
- vendor: String$,
15033
- product_type: String$,
15034
- sku: String$,
15035
- url: String$,
15036
- untranslated_product_title: String$,
15037
- untranslated_variant_title: String$,
15038
- view_key: String$
15039
- });
15040
- var CartChangeInput = Union2(
15041
- extend3(CartChangeItemOptionalInput)(
15042
- Struct({
15043
- id: String$
15044
- })
15045
- ),
15046
- extend3(CartChangeItemOptionalInput)(
15047
- Struct({
15048
- line: Number$
15049
- })
15050
- )
15051
- );
15052
- var CartChangeOutput = Struct({
15053
- ...Cart.fields,
15054
- items_added: Array$(LineItemChange),
15055
- items_removed: Array$(LineItemChange)
15056
- });
15057
- var CartClearInput = Ajax_exports.Sections.Input;
15058
- var CartGetInput = Ajax_exports.Sections.Input;
15059
- mutable2(
15060
- Array$(NonEmptyString)
15061
- );
15062
-
15063
- // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/queue.js
15064
- var EnqueueSymbolKey = "effect/QueueEnqueue";
15065
- var EnqueueTypeId = /* @__PURE__ */ Symbol.for(EnqueueSymbolKey);
15066
- var DequeueSymbolKey = "effect/QueueDequeue";
15067
- var DequeueTypeId = /* @__PURE__ */ Symbol.for(DequeueSymbolKey);
15068
- var QueueStrategySymbolKey = "effect/QueueStrategy";
15069
- var QueueStrategyTypeId = /* @__PURE__ */ Symbol.for(QueueStrategySymbolKey);
15070
- var BackingQueueSymbolKey = "effect/BackingQueue";
15071
- var BackingQueueTypeId = /* @__PURE__ */ Symbol.for(BackingQueueSymbolKey);
15072
- var queueStrategyVariance = {
15073
- /* c8 ignore next */
15074
- _A: (_) => _
15075
- };
15076
- var backingQueueVariance = {
15077
- /* c8 ignore next */
15078
- _A: (_) => _
15079
- };
15080
- var enqueueVariance = {
15081
- /* c8 ignore next */
15082
- _In: (_) => _
15083
- };
15084
- var dequeueVariance = {
15085
- /* c8 ignore next */
15086
- _Out: (_) => _
15087
- };
15088
- var QueueImpl = class extends Class2 {
15089
- queue;
15090
- takers;
15091
- shutdownHook;
15092
- shutdownFlag;
15093
- strategy;
15094
- [EnqueueTypeId] = enqueueVariance;
15095
- [DequeueTypeId] = dequeueVariance;
15096
- constructor(queue, takers, shutdownHook, shutdownFlag, strategy) {
15097
- super();
15098
- this.queue = queue;
15099
- this.takers = takers;
15100
- this.shutdownHook = shutdownHook;
15101
- this.shutdownFlag = shutdownFlag;
15102
- this.strategy = strategy;
15103
- }
15104
- pipe() {
15105
- return pipeArguments(this, arguments);
14819
+ pipe() {
14820
+ return pipeArguments(this, arguments);
15106
14821
  }
15107
14822
  commit() {
15108
14823
  return this.take;
@@ -16951,9 +16666,6 @@ var ChannelException = (error) => ({
16951
16666
  });
16952
16667
  var isChannelException = (u) => hasProperty(u, ChannelExceptionTypeId);
16953
16668
 
16954
- // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Runtime.js
16955
- var runFork3 = unsafeFork3;
16956
-
16957
16669
  // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/sink.js
16958
16670
  var SinkTypeId2 = /* @__PURE__ */ Symbol.for("effect/Sink");
16959
16671
  var sinkVariance2 = {
@@ -16989,6 +16701,9 @@ var forEachChunk = (f) => {
16989
16701
  var fromEffect6 = (effect3) => new SinkImpl(fromEffect4(effect3));
16990
16702
  var toChannel = (self) => isEffect2(self) ? toChannel(fromEffect6(self)) : self.channel;
16991
16703
 
16704
+ // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Runtime.js
16705
+ var runFork3 = unsafeFork3;
16706
+
16992
16707
  // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/stream.js
16993
16708
  var StreamSymbolKey = "effect/Stream";
16994
16709
  var StreamTypeId2 = /* @__PURE__ */ Symbol.for(StreamSymbolKey);
@@ -17123,6 +16838,315 @@ var fromReadableStream2 = fromReadableStream;
17123
16838
  var suspend7 = suspend6;
17124
16839
  var toReadableStreamEffect2 = toReadableStreamEffect;
17125
16840
 
16841
+ // src/effect/schema.ts
16842
+ var BaseAttributeValue = Union2(
16843
+ Null,
16844
+ String$,
16845
+ Boolean$,
16846
+ Number$
16847
+ );
16848
+ var BaseAttributes = Record({
16849
+ key: String$,
16850
+ value: BaseAttributeValue
16851
+ });
16852
+ var BaseAttributesArray = transform2(
16853
+ BaseAttributes,
16854
+ Array$(
16855
+ Struct({ key: String$, value: BaseAttributeValue })
16856
+ ),
16857
+ {
16858
+ decode: (record2) => toEntries(record2).map(([key, value2]) => ({ key, value: value2 })),
16859
+ encode: (array3) => fromEntries(
16860
+ pipe(
16861
+ array3,
16862
+ map4(({ key, value: value2 }) => [key, value2])
16863
+ )
16864
+ )
16865
+ }
16866
+ );
16867
+ var Attributes = transform2(
16868
+ BaseAttributes,
16869
+ Struct({
16870
+ array: BaseAttributesArray,
16871
+ record: BaseAttributes
16872
+ }),
16873
+ {
16874
+ decode: (attributes) => ({
16875
+ array: attributes,
16876
+ record: attributes
16877
+ }),
16878
+ encode: (attributes) => ({
16879
+ ...attributes.record
16880
+ })
16881
+ }
16882
+ );
16883
+ var DiscountApplication = Struct({
16884
+ target_selection: Literal2("all", "entitled", "explicit"),
16885
+ target_type: Literal2("line_item", "shipping_line"),
16886
+ title: NonEmptyString,
16887
+ total_allocated_amount: Number$,
16888
+ type: Literal2("", "automatic", "discount_code", "manual", "script"),
16889
+ value: Union2(Number$, NumberFromString),
16890
+ value_type: Literal2("fixed_amount", "percentage"),
16891
+ description: NullOr(String$)
16892
+ });
16893
+ var Discount = Struct({
16894
+ amount: Number$,
16895
+ title: String$
16896
+ });
16897
+ var CurrencyCode = String$;
16898
+ var Image = Struct({
16899
+ aspect_ratio: Number$,
16900
+ alt: String$,
16901
+ height: Number$,
16902
+ url: String$,
16903
+ width: Number$
16904
+ });
16905
+ var OptionWithValue = Struct({
16906
+ name: String$,
16907
+ value: String$
16908
+ });
16909
+ var QuantityRule = Struct({
16910
+ min: Number$,
16911
+ max: NullOr(Number$),
16912
+ increment: Number$
16913
+ });
16914
+ var SellingPlanAllocationPriceAdjustment = Struct({
16915
+ position: Number$,
16916
+ price: Number$
16917
+ });
16918
+ var SellingPlanPriceAdjustment = Struct({
16919
+ order_count: NullOr(Number$),
16920
+ position: Number$,
16921
+ value: Number$,
16922
+ value_type: Literal2("percentage", "fixed_amount", "price")
16923
+ });
16924
+ var SellingPlanOption = Struct({
16925
+ name: String$,
16926
+ position: Number$,
16927
+ value: String$
16928
+ });
16929
+ var SellingPlan = Struct({
16930
+ id: Resource_exports.ID,
16931
+ name: String$,
16932
+ description: NullOr(String$),
16933
+ options: Array$(SellingPlanOption),
16934
+ recurring_deliveries: optionalWith(Boolean$, {
16935
+ default: () => false
16936
+ }),
16937
+ fixed_selling_plan: optionalWith(Boolean$, {
16938
+ default: () => false
16939
+ }),
16940
+ price_adjustments: Array$(SellingPlanPriceAdjustment)
16941
+ });
16942
+ var SellingPlanAllocation = Struct({
16943
+ price_adjustments: Array$(SellingPlanAllocationPriceAdjustment),
16944
+ price: Number$,
16945
+ compare_at_price: Number$,
16946
+ per_delivery_price: Number$,
16947
+ selling_plan: SellingPlan
16948
+ });
16949
+ var LineLevelDiscountAllocation = Struct({
16950
+ amount: Number$,
16951
+ discount_application: DiscountApplication
16952
+ });
16953
+ var CartLevelDiscountApplicationUpdate = transform2(
16954
+ Struct({
16955
+ discount_application: DiscountApplication
16956
+ }),
16957
+ DiscountApplication,
16958
+ {
16959
+ decode: (application) => application.discount_application,
16960
+ encode: (discountApplication) => ({
16961
+ discount_application: discountApplication
16962
+ }),
16963
+ strict: false
16964
+ }
16965
+ );
16966
+ var CartLevelDiscountApplication = Union2(
16967
+ DiscountApplication,
16968
+ CartLevelDiscountApplicationUpdate
16969
+ );
16970
+ var UnitPriceMeasurement = Struct({
16971
+ measured_type: Literal2("volume", "weight", "dimension"),
16972
+ quantity_unit: String$,
16973
+ quantity_value: Number$,
16974
+ reference_unit: String$,
16975
+ reference_value: Number$
16976
+ });
16977
+ var LineItem = Struct({
16978
+ id: Resource_exports.ID,
16979
+ properties: optionalWith(Attributes, {
16980
+ default: () => ({
16981
+ array: [],
16982
+ record: {}
16983
+ }),
16984
+ nullable: true
16985
+ }),
16986
+ quantity: Number$,
16987
+ variant_id: Resource_exports.ID,
16988
+ key: String$,
16989
+ title: String$,
16990
+ price: Number$,
16991
+ original_price: Number$,
16992
+ discounted_price: Number$,
16993
+ line_price: Number$,
16994
+ original_line_price: Number$,
16995
+ total_discount: Number$,
16996
+ discounts: optionalWith(Array$(Discount), { default: () => [] }),
16997
+ sku: NullOr(String$),
16998
+ grams: Number$,
16999
+ vendor: String$,
17000
+ taxable: Boolean$,
17001
+ product_id: Resource_exports.ID,
17002
+ product_has_only_default_variant: Boolean$,
17003
+ gift_card: Boolean$,
17004
+ final_line_price: Number$,
17005
+ final_price: Number$,
17006
+ url: String$,
17007
+ featured_image: optional(Image),
17008
+ image: String$,
17009
+ handle: String$,
17010
+ requires_shipping: Boolean$,
17011
+ product_type: String$,
17012
+ product_title: String$,
17013
+ product_description: String$,
17014
+ variant_title: NullOr(String$),
17015
+ variant_options: Array$(String$),
17016
+ options_with_values: Array$(OptionWithValue),
17017
+ line_level_discount_allocations: Array$(LineLevelDiscountAllocation),
17018
+ line_level_total_discount: Number$,
17019
+ quantity_rule: optional(QuantityRule),
17020
+ has_components: optionalWith(Boolean$, { default: () => false }),
17021
+ unit_price: optional(Number$),
17022
+ unit_price_measurement: optional(UnitPriceMeasurement),
17023
+ selling_plan_allocation: optionalWith(
17024
+ NullOr(SellingPlanAllocation),
17025
+ { default: () => null }
17026
+ )
17027
+ });
17028
+ var Cart = Struct({
17029
+ token: String$,
17030
+ note: NullOr(String$),
17031
+ attributes: optionalWith(Attributes, {
17032
+ default: () => ({
17033
+ record: {},
17034
+ array: []
17035
+ }),
17036
+ nullable: true
17037
+ }),
17038
+ discounts: optionalWith(Array$(Discount), { default: () => [] }),
17039
+ discount_codes: optionalWith(
17040
+ Array$(
17041
+ Struct({ code: String$, applicable: Boolean$ })
17042
+ ),
17043
+ { default: () => [] }
17044
+ ),
17045
+ original_total_price: Number$,
17046
+ total_price: Number$,
17047
+ total_discount: Number$,
17048
+ total_weight: Number$,
17049
+ item_count: Number$,
17050
+ items: Array$(LineItem),
17051
+ requires_shipping: Boolean$,
17052
+ currency: CurrencyCode,
17053
+ items_subtotal_price: Number$,
17054
+ cart_level_discount_applications: Array$(CartLevelDiscountApplication)
17055
+ });
17056
+ var AddItemInput = Struct({
17057
+ id: Resource_exports.ID,
17058
+ quantity: optionalWith(Number$, { default: () => 1 }),
17059
+ properties: optionalWith(BaseAttributes, { default: () => ({}) }),
17060
+ selling_plan: optional(Resource_exports.ID)
17061
+ });
17062
+ var BaseInput = extend3(Ajax_exports.Sections.Input);
17063
+ var CartAddInput = Struct({
17064
+ items: Array$(AddItemInput)
17065
+ }).pipe(BaseInput);
17066
+ var CartAddOutput = Struct({
17067
+ items: Array$(LineItem)
17068
+ });
17069
+ var UpdateItemRecordInput = Record({
17070
+ key: String$,
17071
+ value: Number$
17072
+ });
17073
+ var DiscountCodeInput = Array$(String$);
17074
+ var DiscountCodeTransformed = String$;
17075
+ var CartUpdateInput = Struct({
17076
+ updates: optional(
17077
+ Union2(UpdateItemRecordInput, Array$(Number$))
17078
+ ),
17079
+ note: optional(NullOr(String$)),
17080
+ attributes: optional(Attributes),
17081
+ discount: optional(
17082
+ transform2(DiscountCodeInput, DiscountCodeTransformed, {
17083
+ decode: (input) => input.join(","),
17084
+ encode: (input) => input.split(",")
17085
+ })
17086
+ )
17087
+ }).pipe(BaseInput);
17088
+ var ItemAddedChangelog = Struct({
17089
+ variant_id: Number$,
17090
+ quantity: Number$
17091
+ });
17092
+ var CartUpdateOutput = Struct({
17093
+ ...Cart.fields,
17094
+ items_changelog: Struct({
17095
+ added: Array$(ItemAddedChangelog)
17096
+ })
17097
+ });
17098
+ var CartChangeItemOptionalInput = Struct({
17099
+ quantity: optional(Number$),
17100
+ properties: optional(
17101
+ Record({
17102
+ key: String$,
17103
+ value: NullOr(String$)
17104
+ })
17105
+ ),
17106
+ selling_plan: optional(NullOr(Resource_exports.ID))
17107
+ }).pipe(BaseInput);
17108
+ var LineItemChange = Struct({
17109
+ product_id: Number$,
17110
+ variant_id: Number$,
17111
+ id: String$,
17112
+ image: String$,
17113
+ price: String$,
17114
+ presentment_price: Number$,
17115
+ quantity: Number$,
17116
+ title: String$,
17117
+ product_title: String$,
17118
+ variant_title: String$,
17119
+ vendor: String$,
17120
+ product_type: String$,
17121
+ sku: String$,
17122
+ url: String$,
17123
+ untranslated_product_title: String$,
17124
+ untranslated_variant_title: String$,
17125
+ view_key: String$
17126
+ });
17127
+ var CartChangeInput = Union2(
17128
+ extend3(CartChangeItemOptionalInput)(
17129
+ Struct({
17130
+ id: String$
17131
+ })
17132
+ ),
17133
+ extend3(CartChangeItemOptionalInput)(
17134
+ Struct({
17135
+ line: Number$
17136
+ })
17137
+ )
17138
+ );
17139
+ var CartChangeOutput = Struct({
17140
+ ...Cart.fields,
17141
+ items_added: Array$(LineItemChange),
17142
+ items_removed: Array$(LineItemChange)
17143
+ });
17144
+ var CartClearInput = Ajax_exports.Sections.Input;
17145
+ var CartGetInput = Ajax_exports.Sections.Input;
17146
+ mutable2(
17147
+ Array$(NonEmptyString)
17148
+ );
17149
+
17126
17150
  // ../../../node_modules/.pnpm/@effect+platform@0.82.4_effect@3.15.2/node_modules/@effect/platform/dist/esm/Error.js
17127
17151
  var TypeIdError = (typeId, tag2) => {
17128
17152
  class Base3 extends Error3 {