@gomusdev/web-components 3.9.0 → 3.10.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.
@@ -1458,7 +1458,7 @@ function createSubscriber(start) {
1458
1458
  if (effect_tracking()) {
1459
1459
  get$2(version);
1460
1460
  render_effect(() => {
1461
- if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
1461
+ if (subscribers === 0) stop = untrack(() => start(() => increment$1(version)));
1462
1462
  subscribers += 1;
1463
1463
  return () => {
1464
1464
  queue_micro_task(() => {
@@ -1466,7 +1466,7 @@ function createSubscriber(start) {
1466
1466
  if (subscribers === 0) {
1467
1467
  stop?.();
1468
1468
  stop = void 0;
1469
- increment(version);
1469
+ increment$1(version);
1470
1470
  }
1471
1471
  });
1472
1472
  };
@@ -2205,7 +2205,7 @@ function flush_eager_effects() {
2205
2205
  * Silently (without using `get`) increment a source
2206
2206
  * @param {Source<number>} source
2207
2207
  */
2208
- function increment(source) {
2208
+ function increment$1(source) {
2209
2209
  set(source, source.v + 1);
2210
2210
  }
2211
2211
  /**
@@ -2295,11 +2295,11 @@ function proxy(value) {
2295
2295
  if (prop in target) {
2296
2296
  const s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED, stack));
2297
2297
  sources.set(prop, s);
2298
- increment(version);
2298
+ increment$1(version);
2299
2299
  }
2300
2300
  } else {
2301
2301
  set(s, UNINITIALIZED);
2302
- increment(version);
2302
+ increment$1(version);
2303
2303
  }
2304
2304
  return true;
2305
2305
  },
@@ -2381,7 +2381,7 @@ function proxy(value) {
2381
2381
  var n = Number(prop);
2382
2382
  if (Number.isInteger(n) && n >= ls.v) set(ls, n + 1);
2383
2383
  }
2384
- increment(version);
2384
+ increment$1(version);
2385
2385
  }
2386
2386
  return true;
2387
2387
  },
@@ -13908,12 +13908,13 @@ var defaultConfig = {
13908
13908
  window.location.assign(url);
13909
13909
  },
13910
13910
  forms: {},
13911
- fields: {}
13911
+ fields: {},
13912
+ quantityStepper: true
13912
13913
  };
13913
13914
  var ConfigStoreSvelte = class {
13914
13915
  defaultConfig = assign(defaultConfig, window.customOptions);
13915
13916
  override = this.defaultConfig;
13916
- #options = /* @__PURE__ */ state(proxy({}));
13917
+ #options = /* @__PURE__ */ state(proxy(this.defaultConfig));
13917
13918
  get options() {
13918
13919
  return get$2(this.#options);
13919
13920
  }
@@ -13989,7 +13990,7 @@ var setPersonalizationDetails = createSetDetails(KEY$5);
13989
13990
  var getPersonalizationDetails = createGetDetails(KEY$5);
13990
13991
  //#endregion
13991
13992
  //#region src/components/annualTicketPersonalization/components/AnnualTicketPersonalization.svelte
13992
- var root$52 = /* @__PURE__ */ from_html(`<li><a> </a></li>`);
13993
+ var root$53 = /* @__PURE__ */ from_html(`<li><a> </a></li>`);
13993
13994
  var root_1$17 = /* @__PURE__ */ from_html(`<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>`);
13994
13995
  function AnnualTicketPersonalization($$anchor, $$props) {
13995
13996
  push($$props, true);
@@ -14024,7 +14025,7 @@ function AnnualTicketPersonalization($$anchor, $$props) {
14024
14025
  reset(li_1);
14025
14026
  var node_2 = sibling(li_1, 2);
14026
14027
  var consequent = ($$anchor) => {
14027
- var li_2 = root$52();
14028
+ var li_2 = root$53();
14028
14029
  var a = child(li_2);
14029
14030
  var text_2 = child(a, true);
14030
14031
  reset(a);
@@ -14699,7 +14700,7 @@ function wrapInElement(host, tag, props) {
14699
14700
  }
14700
14701
  //#endregion
14701
14702
  //#region src/components/forms/ui/generic/Form.svelte
14702
- var root$51 = /* @__PURE__ */ from_html(`<go-all-fields></go-all-fields> <go-form-feedback><go-errors-feedback></go-errors-feedback> <go-success-feedback></go-success-feedback></go-form-feedback> <go-submit> </go-submit>`, 3);
14703
+ var root$52 = /* @__PURE__ */ from_html(`<go-all-fields></go-all-fields> <go-form-feedback><go-errors-feedback></go-errors-feedback> <go-success-feedback></go-success-feedback></go-form-feedback> <go-submit> </go-submit>`, 3);
14703
14704
  function Form($$anchor, $$props) {
14704
14705
  push($$props, true);
14705
14706
  let formId = prop($$props, "formId", 7), custom = prop($$props, "custom", 7);
@@ -14744,7 +14745,7 @@ function Form($$anchor, $$props) {
14744
14745
  var fragment = comment();
14745
14746
  var node = first_child(fragment);
14746
14747
  var consequent = ($$anchor) => {
14747
- var fragment_1 = root$51();
14748
+ var fragment_1 = root$52();
14748
14749
  var go_submit = sibling(sibling(first_child(fragment_1), 2), 2);
14749
14750
  var text = child(go_submit, true);
14750
14751
  reset(go_submit);
@@ -14771,7 +14772,7 @@ customElements.define("go-form", create_custom_element(Form, {
14771
14772
  }, [], ["details"]));
14772
14773
  //#endregion
14773
14774
  //#region src/components/auth/passwordReset/PasswordReset.svelte
14774
- var root$50 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
14775
+ var root$51 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
14775
14776
  function PasswordReset($$anchor, $$props) {
14776
14777
  push($$props, true);
14777
14778
  let custom = prop($$props, "custom", 7, false);
@@ -14804,7 +14805,7 @@ function PasswordReset($$anchor, $$props) {
14804
14805
  flushSync();
14805
14806
  }
14806
14807
  };
14807
- var go_form = root$50();
14808
+ var go_form = root$51();
14808
14809
  set_custom_element_data(go_form, "formId", "passwordReset");
14809
14810
  template_effect(() => set_custom_element_data(go_form, "custom", custom()));
14810
14811
  event("submit", go_form, passwordReset);
@@ -15047,7 +15048,7 @@ var setCartDetails = createSetDetails(KEY$3);
15047
15048
  var getCartDetails = createGetDetails(KEY$3);
15048
15049
  //#endregion
15049
15050
  //#region src/components/cart/components/itemTitles/Coupon.svelte
15050
- var root$49 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span>`);
15051
+ var root$50 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span>`);
15051
15052
  function Coupon($$anchor, $$props) {
15052
15053
  push($$props, true);
15053
15054
  let cartItem = prop($$props, "cartItem", 7);
@@ -15060,7 +15061,7 @@ function Coupon($$anchor, $$props) {
15060
15061
  flushSync();
15061
15062
  }
15062
15063
  };
15063
- var span = root$49();
15064
+ var span = root$50();
15064
15065
  var text = child(span, true);
15065
15066
  reset(span);
15066
15067
  template_effect(() => set_text(text, cartItem().product.title));
@@ -15070,7 +15071,7 @@ function Coupon($$anchor, $$props) {
15070
15071
  create_custom_element(Coupon, { cartItem: {} }, [], [], { mode: "open" });
15071
15072
  //#endregion
15072
15073
  //#region src/components/cart/components/itemTitles/Event.svelte
15073
- var root$48 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span><span class="go-cart-item-time" data-testid="cart-item-time"> </span>`, 1);
15074
+ var root$49 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span><span class="go-cart-item-time" data-testid="cart-item-time"> </span>`, 1);
15074
15075
  var root_1$16 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"><span class="go-cart-item-title-event-title"> </span><span class="go-cart-item-title-ticket-title"> </span></span><!>`, 1);
15075
15076
  function Event$2($$anchor, $$props) {
15076
15077
  push($$props, true);
@@ -15097,7 +15098,7 @@ function Event$2($$anchor, $$props) {
15097
15098
  reset(span);
15098
15099
  var node = sibling(span);
15099
15100
  var consequent = ($$anchor) => {
15100
- var fragment_1 = root$48();
15101
+ var fragment_1 = root$49();
15101
15102
  var span_3 = first_child(fragment_1);
15102
15103
  var text_2 = child(span_3, true);
15103
15104
  reset(span_3);
@@ -15126,7 +15127,7 @@ function Event$2($$anchor, $$props) {
15126
15127
  create_custom_element(Event$2, { cartItem: {} }, [], [], { mode: "open" });
15127
15128
  //#endregion
15128
15129
  //#region src/components/cart/components/itemTitles/Ticket.svelte
15129
- var root$47 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
15130
+ var root$48 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
15130
15131
  var root_1$15 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
15131
15132
  var root_2$11 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <!>`, 1);
15132
15133
  function Ticket($$anchor, $$props) {
@@ -15153,7 +15154,7 @@ function Ticket($$anchor, $$props) {
15153
15154
  reset(span_1);
15154
15155
  var node_1 = sibling(span_1, 2);
15155
15156
  var consequent = ($$anchor) => {
15156
- var span_2 = root$47();
15157
+ var span_2 = root$48();
15157
15158
  var text_2 = child(span_2, true);
15158
15159
  reset(span_2);
15159
15160
  template_effect(($0) => set_text(text_2, $0), [() => formatTime(cartItem().time)]);
@@ -15177,6 +15178,208 @@ function Ticket($$anchor, $$props) {
15177
15178
  }
15178
15179
  create_custom_element(Ticket, { cartItem: {} }, [], [], { mode: "open" });
15179
15180
  //#endregion
15181
+ //#region src/lib/models/cart/quantityStepper.ts
15182
+ /** `+`: from `0` jump to the order minimum (at least `1`); otherwise step up by one. Capped at `max`. */
15183
+ function increment(value, { min, max }) {
15184
+ const target = value === 0 ? Math.max(min, 1) : value + 1;
15185
+ return target > max ? value : target;
15186
+ }
15187
+ /** `−`: from the order minimum drop straight to `0` (skipping the invalid `1..min-1` band); otherwise step down by one. */
15188
+ function decrement(value, { min }) {
15189
+ return value <= min ? 0 : value - 1;
15190
+ }
15191
+ /** Clamp a typed value into `{0} ∪ [min, max]`: `≤0` → `0`, `0<v<min` rounds up to `min`, `>max` → `max`. */
15192
+ function clampTyped(raw, { min, max }) {
15193
+ if (!Number.isFinite(raw) || raw <= 0) return 0;
15194
+ let v = Math.floor(raw);
15195
+ if (v < min) v = min;
15196
+ if (v > max) v = max;
15197
+ return v;
15198
+ }
15199
+ /** Whether `value` is a committable quantity for these bounds. */
15200
+ function isValid(value, { min, max }) {
15201
+ if (value < 0 || value > max) return false;
15202
+ return value === 0 || value >= min;
15203
+ }
15204
+ /** Whether `+` can change the value (false → the button is `aria-disabled`). */
15205
+ function canIncrement(value, bounds) {
15206
+ return increment(value, bounds) > value;
15207
+ }
15208
+ /** Whether `−` can change the value (false → the button is `aria-disabled`). */
15209
+ function canDecrement(value) {
15210
+ return value > 0;
15211
+ }
15212
+ //#endregion
15213
+ //#region src/components/shared/quantityStepper/QuantityStepper.svelte
15214
+ var root$47 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button" class="go-quantity-stepper-button go-quantity-stepper-decrement" tabindex="-1"><span aria-hidden="true">−</span></button> <input class="go-quantity-stepper-value" type="text" role="spinbutton" inputmode="numeric" autocomplete="off"/> <button type="button" class="go-quantity-stepper-button go-quantity-stepper-increment" tabindex="-1"><span aria-hidden="true">+</span></button></div>`);
15215
+ function QuantityStepper($$anchor, $$props) {
15216
+ const inputId = props_id();
15217
+ push($$props, true);
15218
+ let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), label = prop($$props, "label", 7), decreaseLabel = prop($$props, "decreaseLabel", 7), increaseLabel = prop($$props, "increaseLabel", 7), onChange = prop($$props, "onChange", 7);
15219
+ let inputEl;
15220
+ let invalid = /* @__PURE__ */ state(false);
15221
+ const decDisabled = /* @__PURE__ */ user_derived(() => !canDecrement(value()));
15222
+ const incDisabled = /* @__PURE__ */ user_derived(() => !canIncrement(value(), {
15223
+ min: min(),
15224
+ max: max()
15225
+ }));
15226
+ function emit(next) {
15227
+ if (next !== value()) onChange()(next);
15228
+ }
15229
+ function stepDown() {
15230
+ if (canDecrement(value())) emit(decrement(value(), {
15231
+ min: min(),
15232
+ max: max()
15233
+ }));
15234
+ }
15235
+ function stepUp() {
15236
+ if (canIncrement(value(), {
15237
+ min: min(),
15238
+ max: max()
15239
+ })) emit(increment(value(), {
15240
+ min: min(),
15241
+ max: max()
15242
+ }));
15243
+ }
15244
+ function commitTyped() {
15245
+ const next = clampTyped(parseInt(inputEl.value, 10), {
15246
+ min: min(),
15247
+ max: max()
15248
+ });
15249
+ set(invalid, false);
15250
+ inputEl.value = String(next);
15251
+ emit(next);
15252
+ }
15253
+ function onInput() {
15254
+ const raw = inputEl.value.trim();
15255
+ set(invalid, !(/^\d+$/.test(raw) && isValid(parseInt(raw, 10), {
15256
+ min: min(),
15257
+ max: max()
15258
+ })));
15259
+ }
15260
+ function onKeydown(e) {
15261
+ switch (e.key) {
15262
+ case "ArrowUp":
15263
+ e.preventDefault();
15264
+ stepUp();
15265
+ break;
15266
+ case "ArrowDown":
15267
+ e.preventDefault();
15268
+ stepDown();
15269
+ break;
15270
+ case "Home":
15271
+ e.preventDefault();
15272
+ emit(0);
15273
+ break;
15274
+ case "End":
15275
+ e.preventDefault();
15276
+ emit(max());
15277
+ break;
15278
+ case "Enter":
15279
+ e.preventDefault();
15280
+ commitTyped();
15281
+ break;
15282
+ }
15283
+ }
15284
+ var $$exports = {
15285
+ get value() {
15286
+ return value();
15287
+ },
15288
+ set value($$value) {
15289
+ value($$value);
15290
+ flushSync();
15291
+ },
15292
+ get min() {
15293
+ return min();
15294
+ },
15295
+ set min($$value) {
15296
+ min($$value);
15297
+ flushSync();
15298
+ },
15299
+ get max() {
15300
+ return max();
15301
+ },
15302
+ set max($$value) {
15303
+ max($$value);
15304
+ flushSync();
15305
+ },
15306
+ get label() {
15307
+ return label();
15308
+ },
15309
+ set label($$value) {
15310
+ label($$value);
15311
+ flushSync();
15312
+ },
15313
+ get decreaseLabel() {
15314
+ return decreaseLabel();
15315
+ },
15316
+ set decreaseLabel($$value) {
15317
+ decreaseLabel($$value);
15318
+ flushSync();
15319
+ },
15320
+ get increaseLabel() {
15321
+ return increaseLabel();
15322
+ },
15323
+ set increaseLabel($$value) {
15324
+ increaseLabel($$value);
15325
+ flushSync();
15326
+ },
15327
+ get onChange() {
15328
+ return onChange();
15329
+ },
15330
+ set onChange($$value) {
15331
+ onChange($$value);
15332
+ flushSync();
15333
+ }
15334
+ };
15335
+ var div = root$47();
15336
+ var button = child(div);
15337
+ var input = sibling(button, 2);
15338
+ remove_input_defaults(input);
15339
+ set_attribute(input, "aria-valuemin", 0);
15340
+ bind_this(input, ($$value) => inputEl = $$value, () => inputEl);
15341
+ var button_1 = sibling(input, 2);
15342
+ reset(div);
15343
+ template_effect(() => {
15344
+ set_attribute(div, "aria-label", label());
15345
+ set_attribute(button, "title", decreaseLabel());
15346
+ set_attribute(button, "aria-controls", inputId);
15347
+ set_attribute(button, "aria-disabled", get$2(decDisabled));
15348
+ set_attribute(input, "id", inputId);
15349
+ set_attribute(input, "aria-label", label());
15350
+ set_value(input, value());
15351
+ set_attribute(input, "aria-valuenow", value());
15352
+ set_attribute(input, "aria-valuemax", max());
15353
+ set_attribute(input, "aria-invalid", get$2(invalid) ? "true" : void 0);
15354
+ set_attribute(button_1, "title", increaseLabel());
15355
+ set_attribute(button_1, "aria-controls", inputId);
15356
+ set_attribute(button_1, "aria-disabled", get$2(incDisabled));
15357
+ });
15358
+ delegated("click", button, stepDown);
15359
+ delegated("input", input, onInput);
15360
+ delegated("change", input, commitTyped);
15361
+ event("blur", input, commitTyped);
15362
+ delegated("keydown", input, onKeydown);
15363
+ delegated("click", button_1, stepUp);
15364
+ append($$anchor, div);
15365
+ return pop($$exports);
15366
+ }
15367
+ delegate([
15368
+ "click",
15369
+ "input",
15370
+ "change",
15371
+ "keydown"
15372
+ ]);
15373
+ create_custom_element(QuantityStepper, {
15374
+ value: {},
15375
+ min: {},
15376
+ max: {},
15377
+ label: {},
15378
+ decreaseLabel: {},
15379
+ increaseLabel: {},
15380
+ onChange: {}
15381
+ }, [], [], { mode: "open" });
15382
+ //#endregion
15180
15383
  //#region src/lib/models/cart/selectOptions.ts
15181
15384
  function generateQuantityOptions(from, to, options = { floor: 0 }) {
15182
15385
  const { floor } = options;
@@ -15203,10 +15406,11 @@ var root_1$14 = /* @__PURE__ */ from_html(`<span class="go-cart-item-price-disco
15203
15406
  var root_2$10 = /* @__PURE__ */ from_html(`<span> </span>`);
15204
15407
  var root_3$7 = /* @__PURE__ */ from_html(`<option> </option>`);
15205
15408
  var root_4$4 = /* @__PURE__ */ from_html(`<select class="go-cart-item-select"></select>`);
15206
- var root_5$2 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove">⨉</button></li>`);
15409
+ var root_5$3 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove">⨉</button></li>`);
15207
15410
  var root_6$2 = /* @__PURE__ */ from_html(`<article class="go-cart-item-content"><ul><li class="go-cart-item-title-container"><!></li> <li class="go-cart-item-price"><!></li> <li class="go-cart-item-count"><!></li> <!> <li class="go-cart-item-sum"> </li></ul></article>`);
15208
15411
  function Item$1($$anchor, $$props) {
15209
15412
  push($$props, true);
15413
+ const useStepper = /* @__PURE__ */ user_derived(() => configStore.config.quantityStepper);
15210
15414
  let displayItem = prop($$props, "displayItem", 7), displayCart = prop($$props, "displayCart", 7), preview = prop($$props, "preview", 7);
15211
15415
  let capacity = /* @__PURE__ */ state(void 0);
15212
15416
  const itemInMaincart = /* @__PURE__ */ user_derived(() => shop.cart?.items.find((item) => item.uuid === (displayItem().display?.reference_uuid ?? displayItem().uuid)));
@@ -15217,15 +15421,16 @@ function Item$1($$anchor, $$props) {
15217
15421
  set(capacity, shop.capacityManager.capacity(displayCart(), displayItem(), emptyCart), true);
15218
15422
  });
15219
15423
  });
15220
- function update(target) {
15221
- const el = target;
15424
+ function updateQuantity(nextLineQuantity) {
15222
15425
  if (!get$2(itemInMaincart)) {
15223
15426
  console.error("(CartItem) Could not find main item for line", displayItem());
15224
15427
  return;
15225
15428
  }
15226
- const nextLineQuantity = parseInt(el.value, 10);
15227
15429
  get$2(itemInMaincart).quantity = Math.max(0, get$2(itemInMaincart).quantity - displayItem().quantity + nextLineQuantity);
15228
15430
  }
15431
+ function update(target) {
15432
+ updateQuantity(parseInt(target.value, 10));
15433
+ }
15229
15434
  function del() {
15230
15435
  if (!get$2(itemInMaincart)) {
15231
15436
  console.error("(CartItem) Could not find main item for line", displayItem());
@@ -15260,7 +15465,7 @@ function Item$1($$anchor, $$props) {
15260
15465
  };
15261
15466
  var fragment = comment();
15262
15467
  var node = first_child(fragment);
15263
- var consequent_6 = ($$anchor) => {
15468
+ var consequent_7 = ($$anchor) => {
15264
15469
  var article = root_6$2();
15265
15470
  var ul = child(article);
15266
15471
  var li = child(ul);
@@ -15323,6 +15528,34 @@ function Item$1($$anchor, $$props) {
15323
15528
  template_effect(() => set_text(text_3, displayItem().quantity));
15324
15529
  append($$anchor, span_2);
15325
15530
  };
15531
+ var consequent_5 = ($$anchor) => {
15532
+ {
15533
+ let $0 = /* @__PURE__ */ user_derived(() => displayItem().quantity ?? 0);
15534
+ let $1 = /* @__PURE__ */ user_derived(() => shop.t("quantity.decrease"));
15535
+ let $2 = /* @__PURE__ */ user_derived(() => shop.t("quantity.increase"));
15536
+ QuantityStepper($$anchor, {
15537
+ get value() {
15538
+ return get$2($0);
15539
+ },
15540
+ get min() {
15541
+ return get$2(capacity).min;
15542
+ },
15543
+ get max() {
15544
+ return get$2(capacity).max;
15545
+ },
15546
+ get label() {
15547
+ return displayItem().product.title;
15548
+ },
15549
+ get decreaseLabel() {
15550
+ return get$2($1);
15551
+ },
15552
+ get increaseLabel() {
15553
+ return get$2($2);
15554
+ },
15555
+ onChange: updateQuantity
15556
+ });
15557
+ }
15558
+ };
15326
15559
  var alternate_1 = ($$anchor) => {
15327
15560
  var select = root_4$4();
15328
15561
  each(select, 21, () => generateQuantityOptions(get$2(capacity).min, get$2(capacity).max, { floor: 1 }), (q) => q.value, ($$anchor, q) => {
@@ -15344,12 +15577,13 @@ function Item$1($$anchor, $$props) {
15344
15577
  };
15345
15578
  if_block(node_3, ($$render) => {
15346
15579
  if (preview()) $$render(consequent_4);
15580
+ else if (get$2(useStepper)) $$render(consequent_5, 1);
15347
15581
  else $$render(alternate_1, -1);
15348
15582
  });
15349
15583
  reset(li_2);
15350
15584
  var node_4 = sibling(li_2, 2);
15351
- var consequent_5 = ($$anchor) => {
15352
- var li_3 = root_5$2();
15585
+ var consequent_6 = ($$anchor) => {
15586
+ var li_3 = root_5$3();
15353
15587
  var button = child(li_3);
15354
15588
  reset(li_3);
15355
15589
  template_effect(($0) => set_attribute(button, "aria-label", $0), [() => shop.t("cart.item.remove")]);
@@ -15357,7 +15591,7 @@ function Item$1($$anchor, $$props) {
15357
15591
  append($$anchor, li_3);
15358
15592
  };
15359
15593
  if_block(node_4, ($$render) => {
15360
- if (!preview()) $$render(consequent_5);
15594
+ if (!preview()) $$render(consequent_6);
15361
15595
  });
15362
15596
  var li_4 = sibling(node_4, 2);
15363
15597
  var text_5 = child(li_4, true);
@@ -15368,7 +15602,7 @@ function Item$1($$anchor, $$props) {
15368
15602
  append($$anchor, article);
15369
15603
  };
15370
15604
  if_block(node, ($$render) => {
15371
- if (get$2(capacity)) $$render(consequent_6);
15605
+ if (get$2(capacity)) $$render(consequent_7);
15372
15606
  });
15373
15607
  append($$anchor, fragment);
15374
15608
  return pop($$exports);
@@ -16864,11 +17098,11 @@ var SvelteMap = class extends Map {
16864
17098
  s = this.#source(0);
16865
17099
  sources.set(key, s);
16866
17100
  set(this.#size, super.size);
16867
- increment(version);
17101
+ increment$1(version);
16868
17102
  } else if (prev_res !== value) {
16869
- increment(s);
17103
+ increment$1(s);
16870
17104
  var v_reactions = version.reactions === null ? null : new Set(version.reactions);
16871
- if (v_reactions === null || !s.reactions?.every((r) => v_reactions.has(r))) increment(version);
17105
+ if (v_reactions === null || !s.reactions?.every((r) => v_reactions.has(r))) increment$1(version);
16872
17106
  }
16873
17107
  return res;
16874
17108
  }
@@ -16883,7 +17117,7 @@ var SvelteMap = class extends Map {
16883
17117
  }
16884
17118
  if (res) {
16885
17119
  set(this.#size, super.size);
16886
- increment(this.#version);
17120
+ increment$1(this.#version);
16887
17121
  }
16888
17122
  return res;
16889
17123
  }
@@ -16893,7 +17127,7 @@ var SvelteMap = class extends Map {
16893
17127
  var sources = this.#sources;
16894
17128
  set(this.#size, 0);
16895
17129
  for (var s of sources.values()) set(s, -1);
16896
- increment(this.#version);
17130
+ increment$1(this.#version);
16897
17131
  sources.clear();
16898
17132
  }
16899
17133
  #read_all() {
@@ -30313,7 +30547,7 @@ var root_1$7 = /* @__PURE__ */ from_html(` <!>`, 1);
30313
30547
  var root_2$6 = /* @__PURE__ */ from_html(`<label><!></label> <input/>`, 1);
30314
30548
  var root_3$6 = /* @__PURE__ */ from_html(`<label><!></label> <textarea></textarea>`, 1);
30315
30549
  var root_4$3 = /* @__PURE__ */ from_html(`<figure role="status" aria-live="polite"><img class="go-file-preview"/> <figcaption class="go-file-preview-caption"> </figcaption></figure>`);
30316
- var root_5$1 = /* @__PURE__ */ from_html(`<label><!></label> <input/> <!>`, 1);
30550
+ var root_5$2 = /* @__PURE__ */ from_html(`<label><!></label> <input/> <!>`, 1);
30317
30551
  var root_6$1 = /* @__PURE__ */ from_html(`<label><input/> <span class="go-checkbox-label"><!></span></label>`);
30318
30552
  var root_7$1 = /* @__PURE__ */ from_html(`<img src="" alt=""/> <option> </option>`, 1);
30319
30553
  var root_8$1 = /* @__PURE__ */ from_html(`<option disabled="" hidden="" selected=""> </option> <!>`, 1);
@@ -30384,7 +30618,7 @@ function InputAndLabel($$anchor, $$props) {
30384
30618
  append($$anchor, fragment_2);
30385
30619
  };
30386
30620
  const file = ($$anchor) => {
30387
- var fragment_3 = root_5$1();
30621
+ var fragment_3 = root_5$2();
30388
30622
  var label_3 = first_child(fragment_3);
30389
30623
  labelText(child(label_3));
30390
30624
  reset(label_3);
@@ -33437,7 +33671,7 @@ var root_1$3 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date"> </spa
33437
33671
  var root_2$2 = /* @__PURE__ */ from_html(`<!> <br/> <a class="go-ticket-download" target="_blank" rel="noopener noreferrer"> </a>`, 1);
33438
33672
  var root_3$2 = /* @__PURE__ */ from_html(`<br/> <a class="go-ticket-personalization"> </a>`, 1);
33439
33673
  var root_4$2 = /* @__PURE__ */ from_html(`<a aria-label="passbook link"><img alt="apple wallet icon"/></a>`);
33440
- var root_5 = /* @__PURE__ */ from_html(`<a aria-label="iCal link"> </a>`);
33674
+ var root_5$1 = /* @__PURE__ */ from_html(`<a aria-label="iCal link"> </a>`);
33441
33675
  var root_6 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count"></li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"><!></li> <li class="go-order-breakdown-ical"><!></li></ul></article></li>`);
33442
33676
  var root_7 = /* @__PURE__ */ from_html(`<a class="go-ticket-download" target="_blank" rel="noopener noreferrer"> </a>`);
33443
33677
  var root_8 = /* @__PURE__ */ from_html(`<a class="go-ticket-personalization"> </a>`);
@@ -33559,7 +33793,7 @@ function TicketSale($$anchor, $$props) {
33559
33793
  var li_5 = sibling(li_4, 2);
33560
33794
  var node_5 = child(li_5);
33561
33795
  var consequent_4 = ($$anchor) => {
33562
- var a_3 = root_5();
33796
+ var a_3 = root_5$1();
33563
33797
  var text_7 = child(a_3, true);
33564
33798
  reset(a_3);
33565
33799
  template_effect(($0) => {
@@ -36199,7 +36433,8 @@ var root$3 = /* @__PURE__ */ from_html(`<span class="go-tickets-item-title-event
36199
36433
  var root_1$2 = /* @__PURE__ */ from_html(`<li class="go-tickets-item-info"><button type="button" data-testid="ticket-info-toggle"></button></li>`);
36200
36434
  var root_2$1 = /* @__PURE__ */ from_html(`<li class="go-ticket-additional-info" data-testid="ticket-additional-info"> </li>`);
36201
36435
  var root_3$1 = /* @__PURE__ */ from_html(`<option> </option>`);
36202
- var root_4$1 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-tickets-item-title"><!></li> <!> <li class="go-tickets-item-description" data-go-tickets-description=""></li> <!> <li class="go-tickets-item-price" data-go-tickets-price=""> </li> <li class="go-tickets-item-quality" data-go-tickets-quality=""><select class="go-tickets-item-select"></select></li></ul></article></li>`);
36436
+ var root_4$1 = /* @__PURE__ */ from_html(`<select class="go-tickets-item-select"></select>`);
36437
+ var root_5 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-tickets-item-title"><!></li> <!> <li class="go-tickets-item-description" data-go-tickets-description=""></li> <!> <li class="go-tickets-item-price" data-go-tickets-price=""> </li> <li class="go-tickets-item-quality" data-go-tickets-quality=""><!></li></ul></article></li>`);
36203
36438
  function Item($$anchor, $$props) {
36204
36439
  const uid = props_id();
36205
36440
  push($$props, true);
@@ -36224,12 +36459,14 @@ function Item($$anchor, $$props) {
36224
36459
  append($$anchor, text_2);
36225
36460
  };
36226
36461
  let item = prop($$props, "item", 7), details = prop($$props, "details", 7);
36462
+ const useStepper = /* @__PURE__ */ user_derived(() => configStore.config.quantityStepper);
36227
36463
  let capacity = /* @__PURE__ */ state(void 0);
36228
36464
  let infoExpanded = /* @__PURE__ */ state(false);
36229
36465
  const reductionReason = /* @__PURE__ */ user_derived(() => item().product?.content?.reduction_reason);
36230
36466
  const infoPanelId = `go-ticket-info-${uid}`;
36231
36467
  user_effect(() => {
36232
36468
  details().preCart.items.map((i) => i.quantity);
36469
+ shop.cart?.items.map((i) => i.quantity);
36233
36470
  untrack(() => {
36234
36471
  set(capacity, shop.capacityManager.capacity(shop.cart, item(), details().preCart), true);
36235
36472
  });
@@ -36257,8 +36494,8 @@ function Item($$anchor, $$props) {
36257
36494
  };
36258
36495
  var fragment_2 = comment();
36259
36496
  var node = first_child(fragment_2);
36260
- var consequent_2 = ($$anchor) => {
36261
- var li = root_4$1();
36497
+ var consequent_3 = ($$anchor) => {
36498
+ var li = root_5();
36262
36499
  var article = child(li);
36263
36500
  var ul = child(article);
36264
36501
  var li_1 = child(ul);
@@ -36304,35 +36541,70 @@ function Item($$anchor, $$props) {
36304
36541
  var text_4 = child(li_5, true);
36305
36542
  reset(li_5);
36306
36543
  var li_6 = sibling(li_5, 2);
36307
- var select = child(li_6);
36308
- each(select, 21, () => generateQuantityOptions(get$2(capacity).min, get$2(capacity).max), (q) => q.value, ($$anchor, q) => {
36309
- var option = root_3$1();
36310
- var text_5 = child(option, true);
36311
- reset(option);
36312
- var option_value = {};
36313
- template_effect(() => {
36314
- set_selected(option, item().quantity === get$2(q).value);
36315
- set_text(text_5, get$2(q).label);
36316
- if (option_value !== (option_value = get$2(q).value)) option.value = (option.__value = get$2(q).value) ?? "";
36544
+ var node_4 = child(li_6);
36545
+ var consequent_2 = ($$anchor) => {
36546
+ {
36547
+ let $0 = /* @__PURE__ */ user_derived(() => shop.t("quantity.decrease"));
36548
+ let $1 = /* @__PURE__ */ user_derived(() => shop.t("quantity.increase"));
36549
+ QuantityStepper($$anchor, {
36550
+ get value() {
36551
+ return item().quantity;
36552
+ },
36553
+ get min() {
36554
+ return get$2(capacity).min;
36555
+ },
36556
+ get max() {
36557
+ return get$2(capacity).max;
36558
+ },
36559
+ get label() {
36560
+ return item().product.title;
36561
+ },
36562
+ get decreaseLabel() {
36563
+ return get$2($0);
36564
+ },
36565
+ get increaseLabel() {
36566
+ return get$2($1);
36567
+ },
36568
+ onChange: (q) => item().quantity = q
36569
+ });
36570
+ }
36571
+ };
36572
+ var alternate = ($$anchor) => {
36573
+ var select = root_4$1();
36574
+ each(select, 21, () => generateQuantityOptions(get$2(capacity).min, get$2(capacity).max), (q) => q.value, ($$anchor, q) => {
36575
+ var option = root_3$1();
36576
+ var text_5 = child(option, true);
36577
+ reset(option);
36578
+ var option_value = {};
36579
+ template_effect(() => {
36580
+ set_selected(option, item().quantity === get$2(q).value);
36581
+ set_text(text_5, get$2(q).label);
36582
+ if (option_value !== (option_value = get$2(q).value)) option.value = (option.__value = get$2(q).value) ?? "";
36583
+ });
36584
+ append($$anchor, option);
36317
36585
  });
36318
- append($$anchor, option);
36586
+ reset(select);
36587
+ template_effect(($0) => set_attribute(select, "aria-label", $0), [() => shop.t("cart.content.table.edit")]);
36588
+ delegated("change", select, (e) => update(item(), e.target, details()?.ticketSelectionDetails));
36589
+ append($$anchor, select);
36590
+ };
36591
+ if_block(node_4, ($$render) => {
36592
+ if (get$2(useStepper)) $$render(consequent_2);
36593
+ else $$render(alternate, -1);
36319
36594
  });
36320
- reset(select);
36321
36595
  reset(li_6);
36322
36596
  reset(ul);
36323
36597
  reset(article);
36324
36598
  reset(li);
36325
- template_effect(($0) => {
36599
+ template_effect(() => {
36326
36600
  set_class(article, 1, clsx(["go-tickets-item", get$2(capacity).bookedOut && "is-booked-out"]));
36327
36601
  set_attribute(article, "data-testid", item().uuid);
36328
36602
  set_text(text_4, item().price_formatted);
36329
- set_attribute(select, "aria-label", $0);
36330
- }, [() => shop.t("cart.content.table.edit")]);
36331
- delegated("change", select, (e) => update(item(), e.target, details()?.ticketSelectionDetails));
36603
+ });
36332
36604
  append($$anchor, li);
36333
36605
  };
36334
36606
  if_block(node, ($$render) => {
36335
- if (get$2(capacity) && !get$2(capacity).unavailable) $$render(consequent_2);
36607
+ if (get$2(capacity) && !get$2(capacity).unavailable) $$render(consequent_3);
36336
36608
  });
36337
36609
  append($$anchor, fragment_2);
36338
36610
  return pop($$exports);
@@ -36445,7 +36717,13 @@ var Details$1 = class {
36445
36717
  this.timeslots = [];
36446
36718
  return;
36447
36719
  }
36448
- this.timeslots = shop.capacityManager.quotaManager.timeslotsOn(date, this.tsd?.timeslotTicketIds).map((x) => ({
36720
+ const quotaManager = shop.capacityManager.quotaManager;
36721
+ quotaManager.clearPrecart();
36722
+ for (const item of shop.cart?.items ?? []) {
36723
+ const product = item.product;
36724
+ if (isUITicket(product)) quotaManager.setPrecartItemQuantity(product.id, item.quantity ?? 0);
36725
+ }
36726
+ this.timeslots = quotaManager.timeslotsOn(date, this.tsd?.timeslotTicketIds).map((x) => ({
36449
36727
  ...x,
36450
36728
  startAt: x.timeSlot,
36451
36729
  timeFormatted: x.timeSlot.substring(11, 16),
@@ -36472,6 +36750,10 @@ function Timeslots($$anchor, $$props) {
36472
36750
  details.recalculateCapacities();
36473
36751
  });
36474
36752
  });
36753
+ user_effect(() => {
36754
+ shop.cart?.items.map((i) => i.quantity);
36755
+ untrack(() => details.recalculateCapacities());
36756
+ });
36475
36757
  const dispatchTimeslotSelect = (target, selected) => {
36476
36758
  if (!target || !("dispatchEvent" in target)) return;
36477
36759
  target.dispatchEvent(new CustomEvent("go-timeslot-select", {