@gomusdev/web-components 1.55.3 → 1.56.0
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-js/gomus-webcomponents.iife.js +102 -109
- package/dist-js/gomus-webcomponents.js +102 -109
- package/dist-js/src/components/cart/mocks/gomusTicketMocks.d.ts +6 -6
- package/dist-js/src/components/ticketSelection/subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.d.ts +86 -5
- package/dist-js/src/components/ticketSelection/subcomponents/tickets/subcomponents/utils.svelte.d.ts +2 -2
- package/dist-js/src/factories/EventTicketFactories.d.ts +57 -0
- package/dist-js/src/factories/TicketFactories.d.ts +3 -3
- package/dist-js/src/lib/models/cart/CartItem.d.ts +11 -6
- package/dist-js/src/lib/models/cart/cart.svelte.d.ts +173 -11
- package/dist-js/src/lib/models/cart/localStorage.svelte.d.ts +39 -1
- package/dist-js/src/lib/models/cart/types.d.ts +12 -5
- package/dist-js/src/lib/models/eventTicket/UIEventTicket.svelte.d.ts +66 -0
- package/dist-js/src/lib/models/ticket/UITicket.svelte.d.ts +8 -8
- package/dist-js/src/lib/stores/shop.svelte.d.ts +86 -5
- package/dist-js/src/lib/vitest/msw/handlers.d.ts +1 -1
- package/dist-js/src/workflowSpecs/flat-event-workflow.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist-js/src/factories/ScalingPriceFactories.d.ts +0 -11
- package/dist-js/src/lib/models/scalePrice/UIScaledPrice.svelte.d.ts +0 -35
- /package/dist-js/src/lib/models/{scalePrice/UIScaledPrice.spec.d.ts → eventTicket/UIEventTicket.spec.d.ts} +0 -0
|
@@ -10953,25 +10953,26 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
10953
10953
|
}
|
|
10954
10954
|
let uuid$2 = 1;
|
|
10955
10955
|
function isUITicket(x) {
|
|
10956
|
-
return x.
|
|
10956
|
+
return x.type === "Ticket";
|
|
10957
10957
|
}
|
|
10958
10958
|
function createUITicket(apiTicket, options) {
|
|
10959
10959
|
const uiTicket = {
|
|
10960
10960
|
...apiTicket,
|
|
10961
10961
|
uid: uuid$2++,
|
|
10962
10962
|
selectedTime: options?.selectedTime ?? "",
|
|
10963
|
-
|
|
10964
|
-
|
|
10963
|
+
type: "Ticket",
|
|
10964
|
+
// Product_type
|
|
10965
|
+
subtype: { time_slot: "timeslot", normal: "day", annual: "annual" }[apiTicket.ticket_type],
|
|
10965
10966
|
shop_order: apiTicket.shop_order ?? 0
|
|
10966
10967
|
};
|
|
10967
10968
|
return uiTicket;
|
|
10968
10969
|
}
|
|
10969
|
-
function initUITimeslotTickets(tickets,
|
|
10970
|
-
return sort(Object.values(tickets).map((ticket) => createUITicket(ticket, { selectedTime
|
|
10970
|
+
function initUITimeslotTickets(tickets, selectedTime = "") {
|
|
10971
|
+
return sort(Object.values(tickets).map((ticket) => createUITicket(ticket, { selectedTime })), (f) => f.shop_order);
|
|
10971
10972
|
}
|
|
10972
|
-
function filterAvailabletickets(tickets,
|
|
10973
|
+
function filterAvailabletickets(tickets, selectedTime = "") {
|
|
10973
10974
|
let available = Object.entries(tickets);
|
|
10974
|
-
if (
|
|
10975
|
+
if (selectedTime !== "") available = available.filter(([, t]) => t.total_capacities?.[selectedTime] && t.total_capacities[selectedTime] > 0);
|
|
10975
10976
|
return Object.fromEntries(available);
|
|
10976
10977
|
}
|
|
10977
10978
|
const maxQuantity_Quotas = function(manager, cart, item, preCart) {
|
|
@@ -10997,38 +10998,48 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
10997
10998
|
unavailable: total === 0
|
|
10998
10999
|
};
|
|
10999
11000
|
};
|
|
11000
|
-
function
|
|
11001
|
-
return x.
|
|
11001
|
+
function isEventTicket(x) {
|
|
11002
|
+
return x.type === "Event";
|
|
11003
|
+
}
|
|
11004
|
+
function isScaleEventTicket(x) {
|
|
11005
|
+
return isEventTicket(x) && x.subtype === "scale";
|
|
11002
11006
|
}
|
|
11003
11007
|
let uuid$1 = 1;
|
|
11004
|
-
function
|
|
11005
|
-
const finalOptions = {
|
|
11006
|
-
minAvailableCapacity: 0,
|
|
11007
|
-
selectedTime: "",
|
|
11008
|
-
event_title: "",
|
|
11009
|
-
...options ?? {},
|
|
11010
|
-
...apiTicket
|
|
11011
|
-
};
|
|
11008
|
+
function buildUIEventTicket(apiTicket, dateId, options) {
|
|
11012
11009
|
const product = {
|
|
11013
|
-
|
|
11010
|
+
type: "Event",
|
|
11011
|
+
// todo: remove this id and keep explicit ids from event and date and price
|
|
11014
11012
|
id: dateId,
|
|
11015
11013
|
tax_included: true,
|
|
11016
11014
|
...apiTicket
|
|
11017
11015
|
};
|
|
11018
|
-
|
|
11016
|
+
if (options?.date) {
|
|
11017
|
+
const date2 = options.date;
|
|
11018
|
+
options.date_title = date2.title || "";
|
|
11019
|
+
options.date_description = date2.description || "";
|
|
11020
|
+
options.event_title = date2.event_title || "";
|
|
11021
|
+
options.event_subtitle = date2.event_sub_title || "";
|
|
11022
|
+
options.price_title = apiTicket.title || "";
|
|
11023
|
+
options.price_description = apiTicket.description || "";
|
|
11024
|
+
}
|
|
11025
|
+
return {
|
|
11019
11026
|
uid: uuid$1++,
|
|
11020
11027
|
dateId,
|
|
11021
|
-
|
|
11028
|
+
minAvailableCapacity: 0,
|
|
11029
|
+
selectedTime: "",
|
|
11030
|
+
...options,
|
|
11022
11031
|
...product,
|
|
11023
11032
|
...apiTicket,
|
|
11024
|
-
|
|
11025
|
-
|
|
11033
|
+
type: "Event",
|
|
11034
|
+
subtype: apiTicket.scale_price_id === void 0 ? "flat" : "scale"
|
|
11026
11035
|
};
|
|
11027
|
-
|
|
11036
|
+
}
|
|
11037
|
+
function createUIEventTicket(apiTicket, dateId, options) {
|
|
11038
|
+
return buildUIEventTicket(apiTicket, dateId, options);
|
|
11028
11039
|
}
|
|
11029
11040
|
const maxQuantity_Seats = function(manager, cart, item, preCart) {
|
|
11030
11041
|
if (manager.capacityPolicy(item) !== "seats") throw new Error("(getMaxQuantitySeats) impossible");
|
|
11031
|
-
if (!
|
|
11042
|
+
if (!isEventTicket(item.product)) {
|
|
11032
11043
|
throw new Error("(getMaxQuantitySeats) impossible");
|
|
11033
11044
|
}
|
|
11034
11045
|
const p2 = item.product;
|
|
@@ -11180,7 +11191,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11180
11191
|
};
|
|
11181
11192
|
return {
|
|
11182
11193
|
...finalOptions,
|
|
11183
|
-
type: product.
|
|
11194
|
+
type: product.type,
|
|
11184
11195
|
product,
|
|
11185
11196
|
/**
|
|
11186
11197
|
* is passed to the Order API
|
|
@@ -11188,29 +11199,35 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11188
11199
|
orderAttributes() {
|
|
11189
11200
|
const base = {
|
|
11190
11201
|
shipped_with_merchandise_id: null,
|
|
11191
|
-
shipping_mode: "email"
|
|
11202
|
+
shipping_mode: "email",
|
|
11203
|
+
id: this.product.id
|
|
11192
11204
|
};
|
|
11193
|
-
switch (
|
|
11205
|
+
switch (product.type) {
|
|
11194
11206
|
case "Ticket":
|
|
11195
11207
|
return {
|
|
11196
|
-
|
|
11208
|
+
...base,
|
|
11197
11209
|
time: this.time,
|
|
11198
|
-
quantity: this.quantity
|
|
11199
|
-
...base
|
|
11210
|
+
quantity: this.quantity
|
|
11200
11211
|
};
|
|
11201
11212
|
case "Event":
|
|
11202
|
-
|
|
11203
|
-
|
|
11213
|
+
switch (product.subtype) {
|
|
11214
|
+
case "flat":
|
|
11215
|
+
return {
|
|
11216
|
+
...base,
|
|
11217
|
+
quantity: this.quantity
|
|
11218
|
+
};
|
|
11219
|
+
case "scale":
|
|
11220
|
+
return {
|
|
11221
|
+
...base,
|
|
11222
|
+
quantities: { [product.scale_price_id]: this.quantity }
|
|
11223
|
+
};
|
|
11224
|
+
default:
|
|
11225
|
+
const exhaustedSubtype = product;
|
|
11226
|
+
throw new Error(`(orderAttributes) Unhandled Event subtype: ${exhaustedSubtype}`);
|
|
11204
11227
|
}
|
|
11205
|
-
const scaleTicket = this.product;
|
|
11206
|
-
return {
|
|
11207
|
-
id: this.product.id,
|
|
11208
|
-
quantities: { [scaleTicket.scale_price_id]: this.quantity },
|
|
11209
|
-
...base
|
|
11210
|
-
};
|
|
11211
11228
|
default:
|
|
11212
|
-
const
|
|
11213
|
-
throw new Error(`(orderAttributes) Unhandled
|
|
11229
|
+
const exhaustedChecking = product;
|
|
11230
|
+
throw new Error(`(orderAttributes) Unhandled product type: ${exhaustedChecking}`);
|
|
11214
11231
|
}
|
|
11215
11232
|
},
|
|
11216
11233
|
get uuid() {
|
|
@@ -11221,7 +11238,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11221
11238
|
if (this.time) {
|
|
11222
11239
|
segments.push(`time: ${this.time}`);
|
|
11223
11240
|
}
|
|
11224
|
-
if (
|
|
11241
|
+
if (isScaleEventTicket(this.product)) {
|
|
11225
11242
|
segments.push(`scale_price: ${this.product.scale_price_id}`);
|
|
11226
11243
|
}
|
|
11227
11244
|
if (this.display?.discounted) {
|
|
@@ -11257,15 +11274,15 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11257
11274
|
};
|
|
11258
11275
|
}
|
|
11259
11276
|
function generateCartItem(cartItem) {
|
|
11260
|
-
const type = cartItem.type;
|
|
11277
|
+
const type = cartItem.product.type;
|
|
11261
11278
|
switch (type) {
|
|
11262
11279
|
case "Ticket":
|
|
11263
|
-
if (cartItem.product.
|
|
11280
|
+
if (cartItem.product.subtype === "timeslot" && !inTheFuture(cartItem.time)) return;
|
|
11264
11281
|
const ticket = createUITicket(cartItem.product);
|
|
11265
11282
|
return createCartItem(ticket, { time: cartItem.time, quantity: cartItem.quantity });
|
|
11266
11283
|
case "Event":
|
|
11267
11284
|
if (cartItem.time && !inTheFuture(cartItem.time)) return;
|
|
11268
|
-
const event2 =
|
|
11285
|
+
const event2 = createUIEventTicket(cartItem.product, cartItem.id);
|
|
11269
11286
|
return createCartItem(event2, { time: cartItem.time, quantity: cartItem.quantity });
|
|
11270
11287
|
default:
|
|
11271
11288
|
const _exhaustiveCheck = type;
|
|
@@ -11323,7 +11340,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11323
11340
|
};
|
|
11324
11341
|
const defined = (x) => x !== void 0;
|
|
11325
11342
|
let lastUuid = 0;
|
|
11326
|
-
function createCart(products) {
|
|
11343
|
+
function createCart(products, contingent = 20) {
|
|
11327
11344
|
const items = proxy([]);
|
|
11328
11345
|
const coupons = proxy([]);
|
|
11329
11346
|
let paymentModeId = void 0;
|
|
@@ -11486,10 +11503,12 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11486
11503
|
if (saveToLocalStorage2) saveCapacityToLocalStorage(this.allSeats, this.allQuotas);
|
|
11487
11504
|
},
|
|
11488
11505
|
capacityPolicy(item) {
|
|
11489
|
-
|
|
11506
|
+
const type = item.product.type;
|
|
11507
|
+
switch (type) {
|
|
11490
11508
|
case "Ticket":
|
|
11491
|
-
const
|
|
11492
|
-
|
|
11509
|
+
const product1 = item.product;
|
|
11510
|
+
const subtype1 = product1.subtype;
|
|
11511
|
+
switch (subtype1) {
|
|
11493
11512
|
case "timeslot":
|
|
11494
11513
|
case "event:ticket":
|
|
11495
11514
|
case "day":
|
|
@@ -11499,21 +11518,23 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11499
11518
|
return "unlimited";
|
|
11500
11519
|
// UNLIMITED CASE
|
|
11501
11520
|
default:
|
|
11502
|
-
const unhandled2 =
|
|
11521
|
+
const unhandled2 = subtype1;
|
|
11503
11522
|
throw new Error(`(getMaxAvailability) Unhandled case: ${unhandled2}`);
|
|
11504
11523
|
}
|
|
11505
11524
|
case "Event":
|
|
11506
11525
|
const product2 = item.product;
|
|
11507
|
-
|
|
11526
|
+
const subtype2 = product2.subtype;
|
|
11527
|
+
switch (subtype2) {
|
|
11528
|
+
case "flat":
|
|
11508
11529
|
case "scale":
|
|
11509
11530
|
return "seats";
|
|
11510
11531
|
// SEATS CASE
|
|
11511
11532
|
default:
|
|
11512
|
-
const unhandled2 =
|
|
11533
|
+
const unhandled2 = subtype2;
|
|
11513
11534
|
throw new Error(`(getMaxAvailability) Unhandled case: ${unhandled2}`);
|
|
11514
11535
|
}
|
|
11515
11536
|
default:
|
|
11516
|
-
const unhandled =
|
|
11537
|
+
const unhandled = type;
|
|
11517
11538
|
throw new Error(`(getMaxAvailability) Unhandled case: ${unhandled}`);
|
|
11518
11539
|
}
|
|
11519
11540
|
},
|
|
@@ -16804,7 +16825,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16804
16825
|
function Event$2($$anchor, $$props) {
|
|
16805
16826
|
push($$props, true);
|
|
16806
16827
|
let cartItem = prop($$props, "cartItem", 7);
|
|
16807
|
-
if (!
|
|
16828
|
+
if (!isEventTicket(cartItem().product)) throw new Error("Product is not an event ticket");
|
|
16808
16829
|
const product = cartItem().product;
|
|
16809
16830
|
var $$exports = {
|
|
16810
16831
|
get cartItem() {
|
|
@@ -16894,7 +16915,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16894
16915
|
append($$anchor3, span_2);
|
|
16895
16916
|
};
|
|
16896
16917
|
if_block(node_1, ($$render) => {
|
|
16897
|
-
if (cartItem().product.
|
|
16918
|
+
if (cartItem().product.subtype === "timeslot") $$render(consequent);
|
|
16898
16919
|
});
|
|
16899
16920
|
}
|
|
16900
16921
|
template_effect(($0) => set_text(text_1, $0), [
|
|
@@ -17030,7 +17051,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17030
17051
|
if_block(
|
|
17031
17052
|
node_2,
|
|
17032
17053
|
($$render) => {
|
|
17033
|
-
if (displayItem().product.
|
|
17054
|
+
if (displayItem().product.type === "Event") $$render(consequent_1);
|
|
17034
17055
|
},
|
|
17035
17056
|
true
|
|
17036
17057
|
);
|
|
@@ -17038,7 +17059,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17038
17059
|
append($$anchor3, fragment_2);
|
|
17039
17060
|
};
|
|
17040
17061
|
if_block(node_1, ($$render) => {
|
|
17041
|
-
if (displayItem().product.
|
|
17062
|
+
if (displayItem().product.type === "Ticket") $$render(consequent);
|
|
17042
17063
|
else $$render(alternate, false);
|
|
17043
17064
|
});
|
|
17044
17065
|
}
|
|
@@ -17178,7 +17199,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17178
17199
|
const attrs = apiItem.attributes;
|
|
17179
17200
|
const scalePriceId = getScalePriceId(attrs);
|
|
17180
17201
|
const itemInBaseCart = baseCart.items.find(
|
|
17181
|
-
(i) => i.type.toLowerCase() === apiItem.type.toLowerCase() && i.product.id === attrs.id && (!attrs.time || i.time === attrs.time) && (scalePriceId === void 0 ||
|
|
17202
|
+
(i) => i.type.toLowerCase() === apiItem.type.toLowerCase() && i.product.id === attrs.id && (!attrs.time || i.time === attrs.time) && (scalePriceId === void 0 || isEventTicket(i.product) && i.product.scale_price_id === scalePriceId)
|
|
17182
17203
|
);
|
|
17183
17204
|
if (!itemInBaseCart) {
|
|
17184
17205
|
console.error("(go-cart) Ignoring unmatched cart line", { type: apiItem.type, attrs });
|
|
@@ -35010,7 +35031,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35010
35031
|
shop.capacityManager.addQuotas(quotas);
|
|
35011
35032
|
const available = filterAvailabletickets(tickets, timeslot);
|
|
35012
35033
|
const uiTickets = initUITimeslotTickets(available, timeslot);
|
|
35013
|
-
segment.preCart = createCart(
|
|
35034
|
+
segment.preCart = createCart();
|
|
35035
|
+
for (const ticket of uiTickets) {
|
|
35036
|
+
segment.preCart.addItem(createCartItem(ticket, { time: timeslot }));
|
|
35037
|
+
}
|
|
35014
35038
|
}
|
|
35015
35039
|
async function load_Event_ScaledPricesTickets(segment) {
|
|
35016
35040
|
const tsd = segment.ticketSelectionDetails;
|
|
@@ -35038,11 +35062,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35038
35062
|
const eid = tsd.eventIds[0];
|
|
35039
35063
|
const eventDate = await shop.asyncFetch(() => shop.getEventDetailsOnDate(eid, segment.dateId));
|
|
35040
35064
|
if (eventDate.prices) {
|
|
35041
|
-
|
|
35042
|
-
|
|
35043
|
-
event_title: eventDate.event_title
|
|
35044
|
-
|
|
35045
|
-
|
|
35065
|
+
segment.preCart = createCart();
|
|
35066
|
+
for (const price of eventDate.prices) {
|
|
35067
|
+
const ticket = createUIEventTicket(price, segment.dateId, { event_title: eventDate.event_title });
|
|
35068
|
+
segment.preCart.addItem(createCartItem(ticket, { time: eventDate.start_time }));
|
|
35069
|
+
}
|
|
35046
35070
|
} else console.warn("(loadEventScaledPricesTickets) event.prices is undefined");
|
|
35047
35071
|
if (eventDate.seats) shop.capacityManager.addSeats(segment.dateId, eventDate.seats);
|
|
35048
35072
|
else console.warn("(loadEventScaledPricesTickets) event.seats is undefined");
|
|
@@ -35086,7 +35110,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35086
35110
|
shop.capacityManager.addQuotas(quotas);
|
|
35087
35111
|
const available = filterAvailabletickets(tickets, tsd.selectedTime);
|
|
35088
35112
|
const uiTickets = initUITimeslotTickets(available, tsd.selectedTime);
|
|
35089
|
-
segment.preCart = createCart(
|
|
35113
|
+
segment.preCart = createCart();
|
|
35114
|
+
for (const ticket of uiTickets) {
|
|
35115
|
+
segment.preCart.addItem(createCartItem(ticket, { time: tsd.selectedTime }));
|
|
35116
|
+
}
|
|
35090
35117
|
}
|
|
35091
35118
|
const TWO_HOURS_IN_MILLISECONDS = 2 * 60 * 60 * 1e3;
|
|
35092
35119
|
async function load_Events_ScaledPricesTickets(segment) {
|
|
@@ -35140,9 +35167,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35140
35167
|
if (date2.prices) {
|
|
35141
35168
|
let prices = date2.prices;
|
|
35142
35169
|
if (segment.query) prices = prices.filter((p2) => p2.title.includes(segment.query));
|
|
35143
|
-
const
|
|
35144
|
-
|
|
35145
|
-
|
|
35170
|
+
for (const price of prices) {
|
|
35171
|
+
const ticket = createUIEventTicket(price, date2.id, { event_title: date2.event_title });
|
|
35172
|
+
segment.preCart.addItem(createCartItem(ticket, { time: date2.start_time }));
|
|
35173
|
+
}
|
|
35146
35174
|
} else console.warn("(load_Events_ScaledPricesTickets) event.prices is undefined");
|
|
35147
35175
|
if (date2.seats) {
|
|
35148
35176
|
shop.capacityManager.addSeats(date2.id, date2.seats);
|
|
@@ -35179,7 +35207,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35179
35207
|
shop.capacityManager.addQuotas(quotas);
|
|
35180
35208
|
const available = filterAvailabletickets(tickets, tsd.selectedTime);
|
|
35181
35209
|
const uiTickets = initUITimeslotTickets(available, tsd.selectedTime);
|
|
35182
|
-
segment.preCart = createCart(
|
|
35210
|
+
segment.preCart = createCart();
|
|
35211
|
+
for (const ticket of uiTickets) {
|
|
35212
|
+
segment.preCart.addItem(createCartItem(ticket, { time: tsd.selectedTime }));
|
|
35213
|
+
}
|
|
35183
35214
|
}
|
|
35184
35215
|
class SegmentDetails {
|
|
35185
35216
|
#ticketSelectionDetails;
|
|
@@ -35415,43 +35446,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35415
35446
|
pop();
|
|
35416
35447
|
}
|
|
35417
35448
|
customElements.define("go-ticket-segment-empty", create_custom_element(TicketSegmentEmpty, {}, [], []));
|
|
35418
|
-
function selectedTime(product, tsd) {
|
|
35419
|
-
switch (product.product_type) {
|
|
35420
|
-
case "Ticket":
|
|
35421
|
-
if (!isUITicket(product)) {
|
|
35422
|
-
throw new Error("(selectedTime) this should not happen");
|
|
35423
|
-
}
|
|
35424
|
-
const ticket = product;
|
|
35425
|
-
switch (ticket.type) {
|
|
35426
|
-
case "timeslot":
|
|
35427
|
-
if (!tsd.selectedTimeslot) {
|
|
35428
|
-
throw new Error("(selectedTime) selected timeslot is undefined");
|
|
35429
|
-
}
|
|
35430
|
-
return tsd.selectedTimeslot;
|
|
35431
|
-
case "annual":
|
|
35432
|
-
return berlinNowISO();
|
|
35433
|
-
case "day":
|
|
35434
|
-
return product.selectedTime;
|
|
35435
|
-
case "event:ticket":
|
|
35436
|
-
return tsd.selectedDate;
|
|
35437
|
-
default:
|
|
35438
|
-
const exhaustedChecking2 = ticket.type;
|
|
35439
|
-
throw new Error(`(selectedTime) Unhandled Ticket Type: ${exhaustedChecking2}`);
|
|
35440
|
-
}
|
|
35441
|
-
case "Event":
|
|
35442
|
-
if (!isUIScaledPricesTicket(product)) {
|
|
35443
|
-
throw new Error("(selectedTime) this should not happen");
|
|
35444
|
-
}
|
|
35445
|
-
return product.selectedTime || "";
|
|
35446
|
-
default:
|
|
35447
|
-
const exhaustedChecking = product.product_type;
|
|
35448
|
-
throw new Error(`(selectedTime) Unhandled product type: ${exhaustedChecking}`);
|
|
35449
|
-
}
|
|
35450
|
-
}
|
|
35451
|
-
function berlinNowISO() {
|
|
35452
|
-
const d = /* @__PURE__ */ new Date();
|
|
35453
|
-
return d.toISOString();
|
|
35454
|
-
}
|
|
35455
35449
|
var root_1$3 = /* @__PURE__ */ from_html(`<span class="go-tickets-item-title-event-title"> </span> <span class="go-tickets-item-title-product-title"> </span>`, 1);
|
|
35456
35450
|
var root_4 = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
35457
35451
|
var root_3$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>`);
|
|
@@ -35467,10 +35461,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35467
35461
|
reset(span_1);
|
|
35468
35462
|
template_effect(
|
|
35469
35463
|
($0) => {
|
|
35470
|
-
set_text(text2, `${item().product.
|
|
35464
|
+
set_text(text2, `${item().product.eventTitle ?? ""} - ${$0 ?? ""}`);
|
|
35471
35465
|
set_text(text_1, item().product.title);
|
|
35472
35466
|
},
|
|
35473
|
-
[() => formatTime(item().
|
|
35467
|
+
[() => formatTime(item().time)]
|
|
35474
35468
|
);
|
|
35475
35469
|
append($$anchor2, fragment);
|
|
35476
35470
|
};
|
|
@@ -35491,10 +35485,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35491
35485
|
function update(ci, target, tsd) {
|
|
35492
35486
|
const el = target;
|
|
35493
35487
|
ci.quantity = parseInt(el.value);
|
|
35494
|
-
ci.time = selectedTime(ci.product, tsd);
|
|
35495
35488
|
}
|
|
35496
35489
|
let titleSnippet = default_title;
|
|
35497
|
-
if (
|
|
35490
|
+
if (isEventTicket(item().product)) titleSnippet = scaled_title;
|
|
35498
35491
|
var $$exports = {
|
|
35499
35492
|
get item() {
|
|
35500
35493
|
return item();
|