@gomusdev/web-components 0.0.17 → 0.0.19

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.
Files changed (123) hide show
  1. package/dist-js/components/cart/components/Cart.svelte.d.ts +1 -0
  2. package/dist-js/components/cart/components/items/Ticket.svelte.d.ts +1 -0
  3. package/dist-js/components/cart/entry.d.ts +0 -0
  4. package/dist-js/components/cart/lib/cart.spec.d.ts +1 -0
  5. package/dist-js/components/cart/lib/cart.svelte.d.ts +25 -0
  6. package/dist-js/components/cart/lib/lib.d.ts +3 -0
  7. package/dist-js/components/cart/mocks/gomusTickets.d.ts +56 -0
  8. package/dist-js/components/cart/mocks/testCart.d.ts +306 -0
  9. package/dist-js/components/donations/lib/donation.spec.d.ts +1 -0
  10. package/dist-js/components/donations/lib/donation.svelte.d.ts +9 -0
  11. package/dist-js/components/entry.d.ts +0 -0
  12. package/dist-js/components/forms/entry.d.ts +0 -0
  13. package/dist-js/components/forms/lib/Field.svelte.d.ts +26 -0
  14. package/dist-js/components/forms/lib/allFields.d.ts +3 -0
  15. package/dist-js/components/forms/lib/details.svelte.d.ts +11 -0
  16. package/dist-js/components/forms/lib/forms.svelte.d.ts +19 -0
  17. package/dist-js/components/graveyard/event/entry.d.ts +0 -0
  18. package/dist-js/components/graveyard/event/lib.svelte.d.ts +43 -0
  19. package/dist-js/components/graveyard/events/entry.d.ts +0 -0
  20. package/dist-js/components/if/If.svelte.spec.d.ts +1 -0
  21. package/dist-js/components/if/expression.d.ts +1 -0
  22. package/dist-js/components/if/expression.spec.d.ts +1 -0
  23. package/dist-js/components/init/GomusInit.svelte.d.ts +1 -0
  24. package/dist-js/components/init/GomusInit.test.d.ts +1 -0
  25. package/dist-js/components/init/Init.svelte.d.ts +1 -0
  26. package/dist-js/components/init/entry.d.ts +0 -0
  27. package/dist-js/components/mainnav/components/MainNav.spec.d.ts +1 -0
  28. package/dist-js/components/mainnav/fixtures/fixtures.d.ts +2 -0
  29. package/dist-js/components/mainnav/lib/generators/generate.d.ts +4 -0
  30. package/dist-js/components/mainnav/lib/generators/generate.spec.d.ts +1 -0
  31. package/dist-js/components/mainnav/lib/generators/labelGenerators.d.ts +2 -0
  32. package/dist-js/components/mainnav/lib/generators/navGenerators.d.ts +2 -0
  33. package/dist-js/components/mainnav/lib/generators/subNavGenerators.d.ts +7 -0
  34. package/dist-js/components/mainnav/lib/generators/urlGenerators.d.ts +2 -0
  35. package/dist-js/components/mainnav/lib/navigation.d.ts +32 -0
  36. package/dist-js/components/mainnav/lib/navigation.spec.d.ts +1 -0
  37. package/dist-js/components/mainnav/lib/states/OpenedDropdown.svelte.d.ts +20 -0
  38. package/dist-js/components/mainnav/lib/states/pageState.svelte.d.ts +7 -0
  39. package/dist-js/components/paypal/lib/PaymentError.d.ts +3 -0
  40. package/dist-js/components/paypal/lib/approvePaypalOrder.d.ts +4 -0
  41. package/dist-js/components/paypal/lib/getPaypalOrder.d.ts +1 -0
  42. package/dist-js/components/paypal/payment-method-component/paymentIcons.d.ts +14 -0
  43. package/dist-js/components/paypal/payment-method-component/paymentMethodStore.svelte.d.ts +3 -0
  44. package/dist-js/components/paypal/payment-methods/apm.d.ts +3 -0
  45. package/dist-js/components/paypal/payment-methods/applepay/applePay.d.ts +2 -0
  46. package/dist-js/components/paypal/payment-methods/currentOrder.svelte.d.ts +3 -0
  47. package/dist-js/components/paypal/payment-methods/defaults.d.ts +28 -0
  48. package/dist-js/components/paypal/payment-methods/googlepay/googlePay.d.ts +2 -0
  49. package/dist-js/components/paypal/payment-methods/loadPaypalScript.d.ts +5 -0
  50. package/dist-js/components/ticketSelection/SelectionTotal.svelte.d.ts +1 -0
  51. package/dist-js/components/ticketSelection/TicketSelection.spec.d.ts +1 -0
  52. package/dist-js/components/ticketSelection/TicketSelection.svelte.d.ts +1 -0
  53. package/dist-js/components/ticketSelection/entry.d.ts +0 -0
  54. package/dist-js/components/ticketSelection/lib.spec.d.ts +1 -0
  55. package/dist-js/components/ticketSelection/lib.svelte.d.ts +23 -0
  56. package/dist-js/components/ticketSelection/subcomponents/calendar/components/Calendar.svelte.d.ts +1 -0
  57. package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.spec.d.ts +1 -0
  58. package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.svelte.d.ts +1 -0
  59. package/dist-js/components/ticketSelection/subcomponents/calendar/entry.d.ts +0 -0
  60. package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +38 -0
  61. package/dist-js/components/ticketSelection/subcomponents/calendar/mocks/datesMock.d.ts +33 -0
  62. package/dist-js/components/ticketSelection/subcomponents/checkoutButton/components/CheckoutButton.svelte.d.ts +1 -0
  63. package/dist-js/components/ticketSelection/subcomponents/checkoutButton/entry.d.ts +0 -0
  64. package/dist-js/components/ticketSelection/subcomponents/checkoutButton/lib/lib.svelte.d.ts +6 -0
  65. package/dist-js/components/ticketSelection/subcomponents/tickets/components/Tickets.spec.d.ts +1 -0
  66. package/dist-js/components/ticketSelection/subcomponents/tickets/components/Tickets.svelte.d.ts +1 -0
  67. package/dist-js/components/ticketSelection/subcomponents/tickets/components/fixtures/ticketFixtures.d.ts +191 -0
  68. package/dist-js/components/ticketSelection/subcomponents/tickets/entry.d.ts +0 -0
  69. package/dist-js/components/ticketSelection/subcomponents/tickets/lib/lib.svelte.d.ts +9 -0
  70. package/dist-js/components/ticketSelection/subcomponents/timeslots/Timeslots.spec.d.ts +1 -0
  71. package/dist-js/components/ticketSelection/subcomponents/timeslots/Timeslots.svelte.d.ts +1 -0
  72. package/dist-js/components/ticketSelection/subcomponents/timeslots/entry.d.ts +1 -0
  73. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.d.ts +50 -0
  74. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.specs.d.ts +121 -0
  75. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.spec.d.ts +1 -0
  76. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.svelte.d.ts +6 -0
  77. package/dist-js/config/config.d.ts +1 -0
  78. package/dist-js/e2e/APMs.e2e.spec.d.ts +1 -0
  79. package/dist-js/e2e/Card.e2e.spec.d.ts +1 -0
  80. package/dist-js/e2e/testApm.d.ts +7 -0
  81. package/dist-js/go.svelte.d.ts +1 -0
  82. package/dist-js/gomus-webcomponents.css +111 -0
  83. package/dist-js/gomus-webcomponents.iife.js +178 -294
  84. package/dist-js/gomus-webcomponents.js +17039 -0
  85. package/dist-js/lib/annual-ticket-personalization/index.d.ts +1 -0
  86. package/dist-js/lib/annual-ticket-personalization/stores.d.ts +3 -0
  87. package/dist-js/lib/gomusTickets.spec.d.ts +1 -0
  88. package/dist-js/lib/gomusTickets.svelte.d.ts +47 -0
  89. package/dist-js/lib/helpers/DataHolder.d.ts +3 -0
  90. package/dist-js/lib/helpers/Events.d.ts +6 -0
  91. package/dist-js/lib/helpers/ShadowStyles.svelte.d.ts +1 -0
  92. package/dist-js/lib/helpers/Wrapper.svelte.d.ts +1 -0
  93. package/dist-js/lib/helpers/context.spec.d.ts +1 -0
  94. package/dist-js/lib/helpers/context.svelte.d.ts +2 -0
  95. package/dist-js/lib/helpers/dataAttr.d.ts +9 -0
  96. package/dist-js/lib/helpers/dataAttr.spec.d.ts +1 -0
  97. package/dist-js/lib/helpers/fixtures/context/lib.d.ts +5 -0
  98. package/dist-js/lib/helpers/reactivity.svelte.test.d.ts +1 -0
  99. package/dist-js/lib/helpers/shopCart.d.ts +34 -0
  100. package/dist-js/lib/helpers/translations.d.ts +752 -0
  101. package/dist-js/lib/helpers/urls.d.ts +62 -0
  102. package/dist-js/lib/helpers/utils.d.ts +24 -0
  103. package/dist-js/lib/stores/__mocks__/shop.svelte.d.ts +2 -0
  104. package/dist-js/lib/stores/shop.svelte.d.ts +1170 -0
  105. package/dist-js/lib/stores/shop.svelte.test.d.ts +3 -0
  106. package/dist-js/lib/stores/user.svelte.d.ts +16 -0
  107. package/dist-js/lib/stores/user.svelte.test.d.ts +1 -0
  108. package/dist-js/lib/storybook/WrapperComponent.d.ts +1 -0
  109. package/dist-js/lib/storybook/sbGlobals.svelte.d.ts +9 -0
  110. package/dist-js/lib/types/types.d.ts +1 -0
  111. package/dist-js/lib/utils.d.ts +1 -0
  112. package/dist-js/lib/vitest/mockedCookies.d.ts +2 -0
  113. package/dist-js/lib/vitest/msw/basicHandlers.d.ts +3 -0
  114. package/dist-js/lib/vitest/msw/handlers.d.ts +1758 -0
  115. package/dist-js/lib/vitest/msw/vitestMSWSetup.d.ts +2 -0
  116. package/dist-js/lib/vitest/snapshotSerializer.d.ts +1 -0
  117. package/dist-js/main.d.ts +5 -0
  118. package/dist-js/sveltekit/app/environment.d.ts +1 -0
  119. package/dist-js/sveltekit/app/forms.d.ts +23 -0
  120. package/dist-js/sveltekit/app/navigation.d.ts +4 -0
  121. package/dist-js/sveltekit/app/stores.d.ts +2 -0
  122. package/dist-js/vitest-setup.d.ts +0 -0
  123. package/package.json +3 -2
@@ -11,7 +11,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
12
  (function() {
13
13
  "use strict";
14
- var _a, _previous, _callbacks, _pending, _deferred, _neutered, _async_effects, _boundary_async_effects, _render_effects, _effects, _block_effects, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, commit_fn, _events, _instance, _data, _fetchStatus, _Shop_instances, defaultApiParams_get, _canFetch, _ensureFetch, _items, _total, _b, _mode, _filters, _eventId, _museumIds, _exhibitionIds, _ticketIds, _selectedDate, _selectedTimeslot, _selectedTickets, _ticketList, _total2, _document, _subscribe, _name, _key, _root, _variant, _prefix, _visibleMonths, _months, _weekdays, _initialPlaceholderYear, _defaultYears, _CalendarRootState_instances, setupInitialFocusEffect_fn, setupAccessibleHeadingEffect_fn, setupFormatterEffect_fn, _isNextButtonDisabled, _isPrevButtonDisabled, _isInvalid, _headingValue, _fullCalendarLabel, isMultipleSelectionValid_fn, _snippetProps, _props, _props2, _cellDate, _isUnavailable, _isDateToday, _isOutsideMonth, _isOutsideVisibleMonths, _isDisabled, _isFocusedDate, _isSelectedDate, _labelText, _snippetProps2, _ariaDisabled, _sharedDataAttrs, _props3, _tabindex, _snippetProps3, _props4, _isDisabled2, _props5, _isDisabled3, _props6, _props7, _props8, _props9, _props10, _props11, _props12, _startAt, _selected, _c, _details, _params, _ticketSelectionDetails, _d, _ticketSelectionDetails2, _e, _ticketSelectionDetails3;
14
+ var _a, _previous, _callbacks, _pending, _deferred, _neutered, _async_effects, _boundary_async_effects, _render_effects, _effects, _block_effects, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, commit_fn, _events, _instance, _data, _fetchStatus, _Shop_instances, defaultApiParams_get, _canFetch, _ensureFetch, _priceCents, _priceFormatted, _quantity, _totalPriceCents, _totalPriceFormatted, _GomusTicket_instances, calcPriceCentes_fn, createTimeslots_fn, _items, _total, _b, _mode, _filters, _eventId, _museumIds, _exhibitionIds, _ticketIds, _selectedDate, _selectedTimeslot, _selectedTickets, _ticketList, _total2, _document, _subscribe, _name, _key, _root, _variant, _prefix, _visibleMonths, _months, _weekdays, _initialPlaceholderYear, _defaultYears, _CalendarRootState_instances, setupInitialFocusEffect_fn, setupAccessibleHeadingEffect_fn, setupFormatterEffect_fn, _isNextButtonDisabled, _isPrevButtonDisabled, _isInvalid, _headingValue, _fullCalendarLabel, isMultipleSelectionValid_fn, _snippetProps, _props, _props2, _cellDate, _isUnavailable, _isDateToday, _isOutsideMonth, _isOutsideVisibleMonths, _isDisabled, _isFocusedDate, _isSelectedDate, _labelText, _snippetProps2, _ariaDisabled, _sharedDataAttrs, _props3, _tabindex, _snippetProps3, _props4, _isDisabled2, _props5, _isDisabled3, _props6, _props7, _props8, _props9, _props10, _props11, _props12, _startAt, _selected, _c, _details, _params, _ticketSelectionDetails, _d, _ticketSelectionDetails2, _e, _ticketSelectionDetails3;
15
15
  const PUBLIC_VERSION = "5";
16
16
  if (typeof window !== "undefined") {
17
17
  ((_a = window.__svelte ?? (window.__svelte = {})).v ?? (_a.v = /* @__PURE__ */ new Set())).add(PUBLIC_VERSION);
@@ -3567,9 +3567,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3567
3567
  const whitespace = [..." \n\r\f \v\uFEFF"];
3568
3568
  function to_class(value, hash, directives) {
3569
3569
  var classname = value == null ? "" : "" + value;
3570
- if (hash) {
3571
- classname = classname ? classname + " " + hash : hash;
3572
- }
3573
3570
  if (directives) {
3574
3571
  for (var key in directives) {
3575
3572
  if (directives[key]) {
@@ -10924,109 +10921,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
10924
10921
  {}
10925
10922
  );
10926
10923
  };
10927
- class GomusTicket {
10928
- constructor(ticketObject, minAvailableCapacity = 0, selectedTime = "", quantity) {
10929
- __publicField(this, "id");
10930
- __publicField(this, "title");
10931
- __publicField(this, "description");
10932
- __publicField(this, "type");
10933
- __publicField(this, "selectedTime");
10934
- __publicField(this, "_quantity", 0);
10935
- __publicField(this, "quantityOptions");
10936
- __publicField(this, "vatPct");
10937
- __publicField(this, "priceCents");
10938
- __publicField(this, "priceFormatted");
10939
- __publicField(this, "totalPriceCents");
10940
- __publicField(this, "totalPriceFormatted");
10941
- __publicField(this, "minQuantity");
10942
- __publicField(this, "maxQuantity");
10943
- __publicField(this, "maxPersons");
10944
- __publicField(this, "timeSlots");
10945
- __publicField(this, "capacities");
10946
- __publicField(this, "totalCapacities");
10947
- __publicField(this, "maxCapacity");
10948
- __publicField(this, "maxTotalCapacity");
10949
- __publicField(this, "quotaIds");
10950
- __publicField(this, "shopOrder");
10951
- __publicField(this, "minAvailableCapacity");
10952
- __publicField(this, "reductionReason");
10953
- __publicField(this, "ticketObject");
10954
- this.ticketObject = ticketObject;
10955
- this.minAvailableCapacity = minAvailableCapacity;
10956
- this.id = ticketObject.id;
10957
- this.title = ticketObject.title;
10958
- this.description = ticketObject.description;
10959
- this.type = ticketObject.ticket_type;
10960
- this.selectedTime = selectedTime;
10961
- this.vatPct = ticketObject.vat_pct;
10962
- if (ticketObject.tax_included) {
10963
- this.priceCents = ticketObject.price_cents;
10964
- } else {
10965
- this.priceCents = ticketObject.price_cents * (1 + this.vatPct / 100);
10966
- }
10967
- this.priceFormatted = formatCurrency$1(this.priceCents);
10968
- this.quantity = quantity || 0;
10969
- this.minQuantity = ticketObject.min_persons;
10970
- this.maxPersons = ticketObject.max_persons;
10971
- this.maxTotalCapacity = ticketObject.max_total_capacity;
10972
- this.capacities = { ...ticketObject.capacities };
10973
- this.totalCapacities = { ...ticketObject.total_capacities };
10974
- this.timeSlots = Object.keys(this.capacities).map((key) => {
10975
- return {
10976
- startAt: key,
10977
- timeFormatted: formatTime(key),
10978
- capacity: this.capacities[key],
10979
- totalCapacity: this.totalCapacities[key],
10980
- available: this.capacities[key] >= minAvailableCapacity,
10981
- selected: this.selectedTime === key,
10982
- quotaIds: ticketObject.quota_ids
10983
- };
10984
- });
10985
- this.timeSlots = this.timeSlots.filter((st) => this.totalCapacities[st.startAt]).sort((a, b) => a.startAt > b.startAt ? 1 : -1);
10986
- this.quotaIds = ticketObject.quota_ids;
10987
- this.updateMaxCapacity(selectedTime ?? null);
10988
- this.shopOrder = ticketObject.shop_order ? ticketObject.shop_order : 0;
10989
- }
10990
- set quantity(value) {
10991
- this._quantity = value;
10992
- this.updateTotalPrices();
10993
- }
10994
- get quantity() {
10995
- return this._quantity;
10996
- }
10997
- updateMaxCapacity(isoTime) {
10998
- if (isoTime) {
10999
- this.maxCapacity = Math.max(0, this.capacities[isoTime] ?? 0);
11000
- } else {
11001
- this.maxCapacity = Math.max(0, ...Object.keys(this.capacities).map((key) => this.capacities[key])) + this.quantity;
11002
- }
11003
- this.updateMaxQuantity();
11004
- }
11005
- updateMaxQuantity() {
11006
- this.maxQuantity = Math.min(this.maxPersons, this.maxCapacity);
11007
- this.quantityOptions = generateQuantityOptions(this.minQuantity, this.maxQuantity);
11008
- this.updateTimeslots();
11009
- }
11010
- updateTimeslots() {
11011
- this.timeSlots.forEach((timeslot) => {
11012
- timeslot.capacity = Math.max(this.capacities[timeslot.startAt], 0);
11013
- const selectedQuantity = timeslot.startAt === this.selectedTime ? this.quantity : 0;
11014
- timeslot.available = this.capacities[timeslot.startAt] + selectedQuantity >= this.quantity && this.capacities[timeslot.startAt] + selectedQuantity >= this.minAvailableCapacity;
11015
- timeslot.selected = this.selectedTime === timeslot.startAt;
11016
- });
11017
- }
11018
- updateTotalPrices() {
11019
- this.totalPriceCents = this.quantity * this.priceCents;
11020
- this.totalPriceFormatted = formatCurrency$1(this.totalPriceCents);
11021
- }
11022
- }
11023
- function initGomusTickets(tickets) {
11024
- const tmpTickets = {};
11025
- Object.keys(tickets).forEach((ticketId) => {
11026
- if (tickets[ticketId]) tmpTickets[ticketId] = new GomusTicket(tickets[ticketId]);
11027
- });
11028
- return sort(Object.values(tmpTickets), (f) => f.shopOrder);
11029
- }
11030
10924
  class GomusAnnualTicket {
11031
10925
  constructor(ticketObject, minAvailableCapacity = 0, selectedTime = "", quantity) {
11032
10926
  __publicField(this, "id");
@@ -11419,6 +11313,140 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
11419
11313
  }
11420
11314
  };
11421
11315
  }
11316
+ class GomusTicket {
11317
+ constructor(apiTicket, options) {
11318
+ __privateAdd(this, _GomusTicket_instances);
11319
+ __publicField(this, "id");
11320
+ __publicField(this, "title");
11321
+ __publicField(this, "description");
11322
+ __publicField(this, "type");
11323
+ __publicField(this, "selectedTime");
11324
+ __publicField(this, "quantityOptions");
11325
+ __publicField(this, "vatPct");
11326
+ __privateAdd(this, _priceCents, /* @__PURE__ */ state(0));
11327
+ __privateAdd(this, _priceFormatted, /* @__PURE__ */ user_derived(() => formatCurrency$1(this.priceCents)));
11328
+ __privateAdd(this, _quantity, /* @__PURE__ */ state(0));
11329
+ __privateAdd(this, _totalPriceCents, /* @__PURE__ */ user_derived(() => this.quantity * this.priceCents));
11330
+ __privateAdd(this, _totalPriceFormatted, /* @__PURE__ */ user_derived(() => formatCurrency$1(this.totalPriceCents)));
11331
+ __publicField(this, "minQuantity");
11332
+ __publicField(this, "maxQuantity");
11333
+ __publicField(this, "maxPersons");
11334
+ __publicField(this, "timeSlots");
11335
+ __publicField(this, "capacities");
11336
+ __publicField(this, "totalCapacities");
11337
+ __publicField(this, "minAvailableCapacity");
11338
+ __publicField(this, "maxCapacity");
11339
+ __publicField(this, "maxTotalCapacity");
11340
+ __publicField(this, "quotaIds");
11341
+ __publicField(this, "shopOrder");
11342
+ __publicField(this, "reductionReason");
11343
+ __publicField(this, "apiTicket");
11344
+ const { minAvailableCapacity = 0, selectedTime = "", quantity = 0 } = { ...options };
11345
+ this.apiTicket = apiTicket;
11346
+ this.minAvailableCapacity = minAvailableCapacity;
11347
+ this.id = apiTicket.id;
11348
+ this.title = apiTicket.title;
11349
+ this.description = apiTicket.description;
11350
+ this.type = apiTicket.ticket_type;
11351
+ this.selectedTime = selectedTime;
11352
+ this.vatPct = apiTicket.vat_pct;
11353
+ __privateMethod(this, _GomusTicket_instances, calcPriceCentes_fn).call(this);
11354
+ this.quantity = quantity;
11355
+ this.minQuantity = apiTicket.min_persons;
11356
+ this.maxPersons = apiTicket.max_persons;
11357
+ this.maxTotalCapacity = apiTicket.max_total_capacity;
11358
+ this.capacities = { ...apiTicket.capacities };
11359
+ this.totalCapacities = { ...apiTicket.total_capacities };
11360
+ this.timeSlots = __privateMethod(this, _GomusTicket_instances, createTimeslots_fn).call(this);
11361
+ this.quotaIds = apiTicket.quota_ids;
11362
+ this.updateMaxCapacity(selectedTime ?? null);
11363
+ this.shopOrder = apiTicket.shop_order ? apiTicket.shop_order : 0;
11364
+ }
11365
+ get priceCents() {
11366
+ return get(__privateGet(this, _priceCents));
11367
+ }
11368
+ set priceCents(value) {
11369
+ set(__privateGet(this, _priceCents), value, true);
11370
+ }
11371
+ get priceFormatted() {
11372
+ return get(__privateGet(this, _priceFormatted));
11373
+ }
11374
+ set priceFormatted(value) {
11375
+ set(__privateGet(this, _priceFormatted), value);
11376
+ }
11377
+ get quantity() {
11378
+ return get(__privateGet(this, _quantity));
11379
+ }
11380
+ set quantity(value) {
11381
+ set(__privateGet(this, _quantity), value, true);
11382
+ }
11383
+ get totalPriceCents() {
11384
+ return get(__privateGet(this, _totalPriceCents));
11385
+ }
11386
+ set totalPriceCents(value) {
11387
+ set(__privateGet(this, _totalPriceCents), value);
11388
+ }
11389
+ get totalPriceFormatted() {
11390
+ return get(__privateGet(this, _totalPriceFormatted));
11391
+ }
11392
+ set totalPriceFormatted(value) {
11393
+ set(__privateGet(this, _totalPriceFormatted), value);
11394
+ }
11395
+ updateMaxCapacity(isoTime) {
11396
+ if (isoTime) {
11397
+ this.maxCapacity = Math.max(0, this.capacities[isoTime] ?? 0);
11398
+ } else {
11399
+ this.maxCapacity = Math.max(0, ...Object.keys(this.capacities).map((key) => this.capacities[key])) + this.quantity;
11400
+ }
11401
+ this.updateMaxQuantity();
11402
+ }
11403
+ updateMaxQuantity() {
11404
+ this.maxQuantity = Math.min(this.maxPersons, this.maxCapacity);
11405
+ this.quantityOptions = generateQuantityOptions(this.minQuantity, this.maxQuantity);
11406
+ this.updateTimeslots();
11407
+ }
11408
+ updateTimeslots() {
11409
+ this.timeSlots.forEach((timeslot) => {
11410
+ timeslot.capacity = Math.max(this.capacities[timeslot.startAt], 0);
11411
+ const selectedQuantity = timeslot.startAt === this.selectedTime ? this.quantity : 0;
11412
+ timeslot.available = this.capacities[timeslot.startAt] + selectedQuantity >= this.quantity && this.capacities[timeslot.startAt] + selectedQuantity >= this.minAvailableCapacity;
11413
+ timeslot.selected = this.selectedTime === timeslot.startAt;
11414
+ });
11415
+ }
11416
+ }
11417
+ _priceCents = new WeakMap();
11418
+ _priceFormatted = new WeakMap();
11419
+ _quantity = new WeakMap();
11420
+ _totalPriceCents = new WeakMap();
11421
+ _totalPriceFormatted = new WeakMap();
11422
+ _GomusTicket_instances = new WeakSet();
11423
+ calcPriceCentes_fn = function() {
11424
+ if (this.apiTicket.tax_included) {
11425
+ this.priceCents = this.apiTicket.price_cents;
11426
+ } else {
11427
+ this.priceCents = this.apiTicket.price_cents * (1 + this.vatPct / 100);
11428
+ }
11429
+ };
11430
+ createTimeslots_fn = function() {
11431
+ let ret = Object.keys(this.capacities).map((key) => ({
11432
+ startAt: key,
11433
+ timeFormatted: formatTime(key),
11434
+ capacity: this.capacities[key],
11435
+ totalCapacity: this.totalCapacities[key],
11436
+ available: this.capacities[key] >= this.minAvailableCapacity,
11437
+ selected: this.selectedTime === key,
11438
+ quotaIds: this.apiTicket.quota_ids
11439
+ }));
11440
+ ret = ret.filter((st) => this.totalCapacities[st.startAt]).sort((a, b) => a.startAt > b.startAt ? 1 : -1);
11441
+ return ret;
11442
+ };
11443
+ function initGomusTickets(tickets) {
11444
+ const tmpTickets = {};
11445
+ Object.keys(tickets).forEach((ticketId) => {
11446
+ if (tickets[ticketId]) tmpTickets[ticketId] = new GomusTicket(tickets[ticketId]);
11447
+ });
11448
+ return sort(Object.values(tmpTickets), (f) => f.shopOrder);
11449
+ }
11422
11450
  const defaultErrorConfig = {
11423
11451
  withStackTrace: false
11424
11452
  };
@@ -11909,7 +11937,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
11909
11937
  }
11910
11938
  items.push(
11911
11939
  new CartItem(
11912
- new GomusTicket(cartItem.item.ticketObject, 0, cartItem.item.selectedTime, cartItem.attributes.quantity),
11940
+ new GomusTicket(cartItem.item.apiTicket, {
11941
+ minAvailableCapacity: 0,
11942
+ selectedTime: cartItem.item.selectedTime,
11943
+ quantity: cartItem.attributes.quantity
11944
+ }),
11913
11945
  cartItem.type
11914
11946
  )
11915
11947
  );
@@ -14749,7 +14781,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
14749
14781
  };
14750
14782
  _props12 = new WeakMap();
14751
14783
  let CalendarHeaderState = _CalendarHeaderState;
14752
- var root_2$i = /* @__PURE__ */ from_html(`<div><!></div>`);
14784
+ var root_2$g = /* @__PURE__ */ from_html(`<div><!></div>`);
14753
14785
  function Calendar$2($$anchor, $$props) {
14754
14786
  push($$props, true);
14755
14787
  let child$1 = prop($$props, "child", 7), children = prop($$props, "children", 7), id = prop($$props, "id", 23, useId), ref = prop($$props, "ref", 15, null), value = prop($$props, "value", 15), onValueChange = prop($$props, "onValueChange", 7, noop), placeholder = prop($$props, "placeholder", 15), onPlaceholderChange = prop($$props, "onPlaceholderChange", 7, noop), weekdayFormat = prop($$props, "weekdayFormat", 7, "narrow"), weekStartsOn = prop($$props, "weekStartsOn", 7), pagedNavigation = prop($$props, "pagedNavigation", 7, false), isDateDisabled = prop($$props, "isDateDisabled", 7, () => false), isDateUnavailable = prop($$props, "isDateUnavailable", 7, () => false), fixedWeeks = prop($$props, "fixedWeeks", 7, false), numberOfMonths = prop($$props, "numberOfMonths", 7, 1), locale = prop($$props, "locale", 7), calendarLabel = prop($$props, "calendarLabel", 7, "Event"), disabled = prop($$props, "disabled", 7, false), readonly = prop($$props, "readonly", 7, false), minValue = prop($$props, "minValue", 7, void 0), maxValue = prop($$props, "maxValue", 7, void 0), preventDeselect = prop($$props, "preventDeselect", 7, false), type = prop($$props, "type", 7), disableDaysOutsideMonth = prop($$props, "disableDaysOutsideMonth", 7, true), initialFocus = prop($$props, "initialFocus", 7, false), maxDays = prop($$props, "maxDays", 7), monthFormat = prop($$props, "monthFormat", 7, "long"), yearFormat = prop($$props, "yearFormat", 7, "numeric"), restProps = /* @__PURE__ */ rest_props($$props, [
@@ -14850,7 +14882,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
14850
14882
  append($$anchor2, fragment_1);
14851
14883
  };
14852
14884
  var alternate = ($$anchor2) => {
14853
- var div = root_2$i();
14885
+ var div = root_2$g();
14854
14886
  attribute_effect(div, () => ({ ...get(mergedProps) }));
14855
14887
  var node_2 = child(div);
14856
14888
  snippet(node_2, () => children() ?? noop$1, () => rootState.snippetProps);
@@ -15098,7 +15130,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15098
15130
  [],
15099
15131
  true
15100
15132
  );
15101
- var root_2$h = /* @__PURE__ */ from_html(`<div><!></div>`);
15133
+ var root_2$f = /* @__PURE__ */ from_html(`<div><!></div>`);
15102
15134
  function Calendar_day($$anchor, $$props) {
15103
15135
  const uid = props_id();
15104
15136
  push($$props, true);
@@ -15130,7 +15162,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15130
15162
  append($$anchor2, fragment_1);
15131
15163
  };
15132
15164
  var alternate_1 = ($$anchor2) => {
15133
- var div = root_2$h();
15165
+ var div = root_2$f();
15134
15166
  attribute_effect(div, () => ({ ...get(mergedProps) }));
15135
15167
  var node_2 = child(div);
15136
15168
  {
@@ -15191,7 +15223,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15191
15223
  });
15192
15224
  }
15193
15225
  create_custom_element(Calendar_day, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15194
- var root_2$g = /* @__PURE__ */ from_html(`<table><!></table>`);
15226
+ var root_2$e = /* @__PURE__ */ from_html(`<table><!></table>`);
15195
15227
  function Calendar_grid($$anchor, $$props) {
15196
15228
  const uid = props_id();
15197
15229
  push($$props, true);
@@ -15220,7 +15252,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15220
15252
  append($$anchor2, fragment_1);
15221
15253
  };
15222
15254
  var alternate = ($$anchor2) => {
15223
- var table = root_2$g();
15255
+ var table = root_2$e();
15224
15256
  attribute_effect(table, () => ({ ...get(mergedProps) }));
15225
15257
  var node_2 = child(table);
15226
15258
  snippet(node_2, () => children() ?? noop$1);
@@ -15265,7 +15297,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15265
15297
  });
15266
15298
  }
15267
15299
  create_custom_element(Calendar_grid, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15268
- var root_2$f = /* @__PURE__ */ from_html(`<tbody><!></tbody>`);
15300
+ var root_2$d = /* @__PURE__ */ from_html(`<tbody><!></tbody>`);
15269
15301
  function Calendar_grid_body($$anchor, $$props) {
15270
15302
  const uid = props_id();
15271
15303
  push($$props, true);
@@ -15294,7 +15326,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15294
15326
  append($$anchor2, fragment_1);
15295
15327
  };
15296
15328
  var alternate = ($$anchor2) => {
15297
- var tbody = root_2$f();
15329
+ var tbody = root_2$d();
15298
15330
  attribute_effect(tbody, () => ({ ...get(mergedProps) }));
15299
15331
  var node_2 = child(tbody);
15300
15332
  snippet(node_2, () => children() ?? noop$1);
@@ -15339,7 +15371,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15339
15371
  });
15340
15372
  }
15341
15373
  create_custom_element(Calendar_grid_body, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15342
- var root_2$e = /* @__PURE__ */ from_html(`<td><!></td>`);
15374
+ var root_2$c = /* @__PURE__ */ from_html(`<td><!></td>`);
15343
15375
  function Calendar_cell($$anchor, $$props) {
15344
15376
  const uid = props_id();
15345
15377
  push($$props, true);
@@ -15375,7 +15407,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15375
15407
  append($$anchor2, fragment_1);
15376
15408
  };
15377
15409
  var alternate = ($$anchor2) => {
15378
- var td = root_2$e();
15410
+ var td = root_2$c();
15379
15411
  attribute_effect(td, () => ({ ...get(mergedProps) }));
15380
15412
  var node_2 = child(td);
15381
15413
  snippet(node_2, () => children() ?? noop$1, () => cellState.snippetProps);
@@ -15447,7 +15479,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15447
15479
  [],
15448
15480
  true
15449
15481
  );
15450
- var root_2$d = /* @__PURE__ */ from_html(`<thead><!></thead>`);
15482
+ var root_2$b = /* @__PURE__ */ from_html(`<thead><!></thead>`);
15451
15483
  function Calendar_grid_head($$anchor, $$props) {
15452
15484
  const uid = props_id();
15453
15485
  push($$props, true);
@@ -15476,7 +15508,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15476
15508
  append($$anchor2, fragment_1);
15477
15509
  };
15478
15510
  var alternate = ($$anchor2) => {
15479
- var thead = root_2$d();
15511
+ var thead = root_2$b();
15480
15512
  attribute_effect(thead, () => ({ ...get(mergedProps) }));
15481
15513
  var node_2 = child(thead);
15482
15514
  snippet(node_2, () => children() ?? noop$1);
@@ -15521,7 +15553,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15521
15553
  });
15522
15554
  }
15523
15555
  create_custom_element(Calendar_grid_head, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15524
- var root_2$c = /* @__PURE__ */ from_html(`<th><!></th>`);
15556
+ var root_2$a = /* @__PURE__ */ from_html(`<th><!></th>`);
15525
15557
  function Calendar_head_cell($$anchor, $$props) {
15526
15558
  const uid = props_id();
15527
15559
  push($$props, true);
@@ -15550,7 +15582,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15550
15582
  append($$anchor2, fragment_1);
15551
15583
  };
15552
15584
  var alternate = ($$anchor2) => {
15553
- var th = root_2$c();
15585
+ var th = root_2$a();
15554
15586
  attribute_effect(th, () => ({ ...get(mergedProps) }));
15555
15587
  var node_2 = child(th);
15556
15588
  snippet(node_2, () => children() ?? noop$1);
@@ -15595,7 +15627,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15595
15627
  });
15596
15628
  }
15597
15629
  create_custom_element(Calendar_head_cell, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15598
- var root_2$b = /* @__PURE__ */ from_html(`<tr><!></tr>`);
15630
+ var root_2$9 = /* @__PURE__ */ from_html(`<tr><!></tr>`);
15599
15631
  function Calendar_grid_row($$anchor, $$props) {
15600
15632
  const uid = props_id();
15601
15633
  push($$props, true);
@@ -15624,7 +15656,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15624
15656
  append($$anchor2, fragment_1);
15625
15657
  };
15626
15658
  var alternate = ($$anchor2) => {
15627
- var tr = root_2$b();
15659
+ var tr = root_2$9();
15628
15660
  attribute_effect(tr, () => ({ ...get(mergedProps) }));
15629
15661
  var node_2 = child(tr);
15630
15662
  snippet(node_2, () => children() ?? noop$1);
@@ -15669,7 +15701,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15669
15701
  });
15670
15702
  }
15671
15703
  create_custom_element(Calendar_grid_row, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15672
- var root_2$a = /* @__PURE__ */ from_html(`<header><!></header>`);
15704
+ var root_2$8 = /* @__PURE__ */ from_html(`<header><!></header>`);
15673
15705
  function Calendar_header($$anchor, $$props) {
15674
15706
  const uid = props_id();
15675
15707
  push($$props, true);
@@ -15698,7 +15730,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15698
15730
  append($$anchor2, fragment_1);
15699
15731
  };
15700
15732
  var alternate = ($$anchor2) => {
15701
- var header = root_2$a();
15733
+ var header = root_2$8();
15702
15734
  attribute_effect(header, () => ({ ...get(mergedProps) }));
15703
15735
  var node_2 = child(header);
15704
15736
  snippet(node_2, () => children() ?? noop$1);
@@ -15743,7 +15775,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15743
15775
  });
15744
15776
  }
15745
15777
  create_custom_element(Calendar_header, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15746
- var root_2$9 = /* @__PURE__ */ from_html(`<div><!></div>`);
15778
+ var root_2$7 = /* @__PURE__ */ from_html(`<div><!></div>`);
15747
15779
  function Calendar_heading($$anchor, $$props) {
15748
15780
  const uid = props_id();
15749
15781
  push($$props, true);
@@ -15775,7 +15807,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15775
15807
  append($$anchor2, fragment_1);
15776
15808
  };
15777
15809
  var alternate_1 = ($$anchor2) => {
15778
- var div = root_2$9();
15810
+ var div = root_2$7();
15779
15811
  attribute_effect(div, () => ({ ...get(mergedProps) }));
15780
15812
  var node_2 = child(div);
15781
15813
  {
@@ -15836,7 +15868,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15836
15868
  });
15837
15869
  }
15838
15870
  create_custom_element(Calendar_heading, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
15839
- var root_2$8 = /* @__PURE__ */ from_html(`<button><!></button>`);
15871
+ var root_2$6 = /* @__PURE__ */ from_html(`<button><!></button>`);
15840
15872
  function Calendar_next_button($$anchor, $$props) {
15841
15873
  const uid = props_id();
15842
15874
  push($$props, true);
@@ -15866,7 +15898,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15866
15898
  append($$anchor2, fragment_1);
15867
15899
  };
15868
15900
  var alternate = ($$anchor2) => {
15869
- var button = root_2$8();
15901
+ var button = root_2$6();
15870
15902
  attribute_effect(button, () => ({ ...get(mergedProps) }));
15871
15903
  var node_2 = child(button);
15872
15904
  snippet(node_2, () => children() ?? noop$1);
@@ -15918,7 +15950,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15918
15950
  });
15919
15951
  }
15920
15952
  create_custom_element(Calendar_next_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
15921
- var root_2$7 = /* @__PURE__ */ from_html(`<button><!></button>`);
15953
+ var root_2$5 = /* @__PURE__ */ from_html(`<button><!></button>`);
15922
15954
  function Calendar_prev_button($$anchor, $$props) {
15923
15955
  const uid = props_id();
15924
15956
  push($$props, true);
@@ -15948,7 +15980,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
15948
15980
  append($$anchor2, fragment_1);
15949
15981
  };
15950
15982
  var alternate = ($$anchor2) => {
15951
- var button = root_2$7();
15983
+ var button = root_2$5();
15952
15984
  attribute_effect(button, () => ({ ...get(mergedProps) }));
15953
15985
  var node_2 = child(button);
15954
15986
  snippet(node_2, () => children() ?? noop$1);
@@ -16065,12 +16097,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16065
16097
  _details = new WeakMap();
16066
16098
  _params = new WeakMap();
16067
16099
  const ticketsCalendar = new TicketsCalendar();
16068
- var root_3$3 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
16100
+ var root_3$2 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
16069
16101
  var root_11 = /* @__PURE__ */ from_html(`<div> </div>`);
16070
16102
  var root_17 = /* @__PURE__ */ from_html(`<div></div> `, 1);
16071
16103
  var root_7 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
16072
- var root_2$6 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
16073
- var root_1$5 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
16104
+ var root_2$4 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
16105
+ var root_1$4 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
16074
16106
  function CalendarUI($$anchor, $$props) {
16075
16107
  push($$props, true);
16076
16108
  let calendarClass = prop($$props, "calendarClass", 7);
@@ -16082,18 +16114,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16082
16114
  bubbles: true
16083
16115
  }));
16084
16116
  });
16085
- var div = root_1$5();
16117
+ var div = root_1$4();
16086
16118
  var node = child(div);
16087
16119
  {
16088
16120
  const children = ($$anchor2, $$arg0) => {
16089
16121
  let months = () => $$arg0 == null ? void 0 : $$arg0().months;
16090
16122
  let weekdays = () => $$arg0 == null ? void 0 : $$arg0().weekdays;
16091
- var fragment = root_2$6();
16123
+ var fragment = root_2$4();
16092
16124
  var node_1 = first_child(fragment);
16093
16125
  component(node_1, () => Calendar_header, ($$anchor3, Calendar_Header) => {
16094
16126
  Calendar_Header($$anchor3, {
16095
16127
  children: ($$anchor4, $$slotProps) => {
16096
- var fragment_1 = root_3$3();
16128
+ var fragment_1 = root_3$2();
16097
16129
  var node_2 = first_child(fragment_1);
16098
16130
  component(node_2, () => Calendar_prev_button, ($$anchor5, Calendar_PrevButton) => {
16099
16131
  Calendar_PrevButton($$anchor5, {
@@ -16409,8 +16441,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16409
16441
  }
16410
16442
  };
16411
16443
  }
16412
- var root_2$5 = /* @__PURE__ */ from_html(`<li><label> <input type="radio" name="timeslot"/></label></li>`);
16413
- var root_1$4 = /* @__PURE__ */ from_html(`<ul data-testid="timeslots" data-go-timeslots=""></ul>`);
16444
+ var root_2$3 = /* @__PURE__ */ from_html(`<li><label> <input type="radio" name="timeslot"/></label></li>`);
16445
+ var root_1$3 = /* @__PURE__ */ from_html(`<ul data-testid="timeslots" data-go-timeslots=""></ul>`);
16414
16446
  function Timeslots($$anchor, $$props) {
16415
16447
  push($$props, true);
16416
16448
  const binding_group = [];
@@ -16427,13 +16459,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16427
16459
  var node = first_child(fragment);
16428
16460
  {
16429
16461
  var consequent = ($$anchor2) => {
16430
- var ul = root_1$4();
16462
+ var ul = root_1$3();
16431
16463
  each(ul, 20, () => details.timeslots, (timeslot) => timeslot, ($$anchor3, timeslot) => {
16432
16464
  const selected = /* @__PURE__ */ user_derived(() => {
16433
16465
  var _a2;
16434
16466
  return ((_a2 = details.ticketSelectionDetails) == null ? void 0 : _a2.selectedTimeslot) === timeslot.startAt;
16435
16467
  });
16436
- var li = root_2$5();
16468
+ var li = root_2$3();
16437
16469
  var label = child(li);
16438
16470
  var text2 = child(label);
16439
16471
  var input = sibling(text2);
@@ -16475,7 +16507,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16475
16507
  }
16476
16508
  delegate(["change"]);
16477
16509
  customElements.define("go-timeslots", create_custom_element(Timeslots, {}, [], ["details"], false));
16478
- var root_2$4 = /* @__PURE__ */ from_html(`<div><!></div>`);
16510
+ var root_2$2 = /* @__PURE__ */ from_html(`<div><!></div>`);
16479
16511
  var root$3 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
16480
16512
  function Wrapper($$anchor, $$props) {
16481
16513
  push($$props, true);
@@ -16508,7 +16540,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16508
16540
  var node_2 = sibling(node, 2);
16509
16541
  {
16510
16542
  var consequent_1 = ($$anchor2) => {
16511
- var div = root_2$4();
16543
+ var div = root_2$2();
16512
16544
  attribute_effect(div, () => ({ ...restProps }));
16513
16545
  var node_3 = child(div);
16514
16546
  snippet(node_3, children);
@@ -16702,6 +16734,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16702
16734
  }
16703
16735
  updateSelectedTickets(ticket, quantity) {
16704
16736
  var _a2, _b2, _c2;
16737
+ if (!this.ticketSelectionDetails) return;
16705
16738
  const index2 = this.timeslotTickets.findIndex((t) => t.id == ticket.id);
16706
16739
  const duplicate = this.timeslotTickets[index2];
16707
16740
  duplicate.quantity = quantity;
@@ -16713,159 +16746,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
16713
16746
  this.ticketSelectionDetails.ticketList = (_c2 = this.ticketSelectionDetails) == null ? void 0 : _c2.ticketList.concat(duplicate);
16714
16747
  }
16715
16748
  }, _ticketSelectionDetails2 = new WeakMap(), _e);
16716
- var root_2$3 = /* @__PURE__ */ from_html(`<option> </option>`);
16717
- var root_1$3 = /* @__PURE__ */ from_html(`<tr><td><select></select></td><td><p> </p> <!></td><td> </td></tr>`);
16718
- function Annual($$anchor, $$props) {
16719
- push($$props, true);
16720
- let details = prop($$props, "details", 7);
16721
- var fragment = comment();
16722
- var node = first_child(fragment);
16723
- each(node, 16, () => Object.values(details().annualTickets), (ticket) => ticket, ($$anchor2, ticket) => {
16724
- var tr = root_1$3();
16725
- var td = child(tr);
16726
- var select = child(td);
16727
- each(select, 21, () => ticket.quantityOptions, index, ($$anchor3, quantity) => {
16728
- var option = root_2$3();
16729
- var text2 = child(option, true);
16730
- reset(option);
16731
- var option_value = {};
16732
- template_effect(() => {
16733
- set_selected(option, get(quantity).selected);
16734
- set_text(text2, get(quantity).label);
16735
- if (option_value !== (option_value = get(quantity).value)) {
16736
- option.value = (option.__value = get(quantity).value) ?? "";
16737
- }
16738
- });
16739
- append($$anchor3, option);
16740
- });
16741
- reset(select);
16742
- reset(td);
16743
- var td_1 = sibling(td);
16744
- var p = child(td_1);
16745
- var text_1 = child(p, true);
16746
- reset(p);
16747
- var node_1 = sibling(p, 2);
16748
- html(node_1, () => ticket.description);
16749
- reset(td_1);
16750
- var td_2 = sibling(td_1);
16751
- var text_2 = child(td_2, true);
16752
- reset(td_2);
16753
- reset(tr);
16754
- template_effect(
16755
- ($0) => {
16756
- set_attribute(select, "name", $0);
16757
- set_text(text_1, ticket.title);
16758
- set_text(text_2, ticket.priceFormatted);
16759
- },
16760
- [() => ticket.id.toString()]
16761
- );
16762
- append($$anchor2, tr);
16763
- });
16764
- append($$anchor, fragment);
16765
- return pop({
16766
- get details() {
16767
- return details();
16768
- },
16769
- set details($$value) {
16770
- details($$value);
16771
- flushSync();
16772
- }
16773
- });
16774
- }
16775
- create_custom_element(Annual, { details: {} }, [], [], true);
16776
- var on_change = (e, details, ticket) => {
16777
- var _a2;
16778
- return details().updateSelectedTickets(ticket, parseInt((_a2 = e == null ? void 0 : e.target) == null ? void 0 : _a2.value));
16779
- };
16780
- var root_3$2 = /* @__PURE__ */ from_html(`<option> </option>`);
16781
- var root_2$2 = /* @__PURE__ */ from_html(`<tr><td><select></select></td><td><p> </p> <!></td><td> </td></tr>`);
16782
- function Timeslot($$anchor, $$props) {
16783
- push($$props, true);
16784
- let details = prop($$props, "details", 7);
16785
- function hasTimeSlotInCapacities(ticket) {
16786
- var _a2;
16787
- if ((_a2 = details().ticketSelectionDetails) == null ? void 0 : _a2.selectedTimeslot) {
16788
- return Object.keys(ticket.capacities).includes(details().ticketSelectionDetails.selectedTimeslot);
16789
- } else {
16790
- return false;
16791
- }
16792
- }
16793
- var fragment = comment();
16794
- var node = first_child(fragment);
16795
- each(node, 16, () => Object.values(details().timeslotTickets), (ticket) => ticket, ($$anchor2, ticket) => {
16796
- var fragment_1 = comment();
16797
- var node_1 = first_child(fragment_1);
16798
- {
16799
- var consequent = ($$anchor3) => {
16800
- var tr = root_2$2();
16801
- let classes;
16802
- var td = child(tr);
16803
- var select = child(td);
16804
- select.__change = [on_change, details, ticket];
16805
- each(select, 21, () => ticket.quantityOptions, index, ($$anchor4, quantity) => {
16806
- var option = root_3$2();
16807
- var text2 = child(option, true);
16808
- reset(option);
16809
- var option_value = {};
16810
- template_effect(() => {
16811
- set_selected(option, get(quantity).selected);
16812
- set_text(text2, get(quantity).label);
16813
- if (option_value !== (option_value = get(quantity).value)) {
16814
- option.value = (option.__value = get(quantity).value) ?? "";
16815
- }
16816
- });
16817
- append($$anchor4, option);
16818
- });
16819
- reset(select);
16820
- reset(td);
16821
- var td_1 = sibling(td);
16822
- var p = child(td_1);
16823
- var text_1 = child(p, true);
16824
- reset(p);
16825
- var node_2 = sibling(p, 2);
16826
- html(node_2, () => ticket.description);
16827
- reset(td_1);
16828
- var td_2 = sibling(td_1);
16829
- var text_2 = child(td_2, true);
16830
- reset(td_2);
16831
- reset(tr);
16832
- template_effect(
16833
- ($0, $1) => {
16834
- classes = set_class(tr, 1, "", null, classes, $0);
16835
- set_attribute(select, "name", $1);
16836
- set_text(text_1, ticket.title);
16837
- set_text(text_2, ticket.priceFormatted);
16838
- },
16839
- [
16840
- () => ({ hidden: hasTimeSlotInCapacities(ticket) }),
16841
- () => ticket.id.toString()
16842
- ]
16843
- );
16844
- append($$anchor3, tr);
16845
- };
16846
- if_block(node_1, ($$render) => {
16847
- if (hasTimeSlotInCapacities(ticket) || ticket.type == "normal") $$render(consequent);
16848
- });
16849
- }
16850
- append($$anchor2, fragment_1);
16851
- });
16852
- append($$anchor, fragment);
16853
- return pop({
16854
- get details() {
16855
- return details();
16856
- },
16857
- set details($$value) {
16858
- details($$value);
16859
- flushSync();
16860
- }
16861
- });
16862
- }
16863
- delegate(["change"]);
16864
- create_custom_element(Timeslot, { details: {} }, [], [], true);
16865
16749
  var root_2$1 = /* @__PURE__ */ from_html(`<option> </option>`);
16866
16750
  var root_1$2 = /* @__PURE__ */ from_html(`<select></select>`);
16867
16751
  var root_4$1 = /* @__PURE__ */ from_html(`<li><article data-go-ticket=""><ul><li data-go-tickets-title=""> </li> <li data-go-tickets-description=""><!></li> <li data-go-tickets-price=""> </li> <li data-go-tickets-quality=""><!></li></ul></article></li>`);
16868
- var root_3$1 = /* @__PURE__ */ from_html(`<ol data-go-tickets="" data-testid="tickets"><li data-go-tickets-header="" data-testid="tickets-header"><ul><li data-go-tickets-title="">Title</li> <li data-go-tickets-description="">Description</li> <li data-go-tickets-price="">Price</li> <li data-go-tickets-quality="">Quantity</li></ul></li> <!></ol>`);
16752
+ var root_3$1 = /* @__PURE__ */ from_html(`<ol data-testid="tickets"><li data-go-tickets-header="" data-testid="tickets-header"><ul><li data-go-tickets-title="">Title</li> <li data-go-tickets-description="">Description</li> <li data-go-tickets-price="">Price</li> <li data-go-tickets-quality="">Quantity</li></ul></li> <!></ol>`);
16869
16753
  function Tickets($$anchor, $$props) {
16870
16754
  push($$props, true);
16871
16755
  const select = ($$anchor2, ticket = noop$1) => {