@gomusdev/web-components 4.15.0 → 4.16.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.
@@ -6382,13 +6382,17 @@ var defaultTranslations_default = {
6382
6382
  "quantity.remove": "Remove item",
6383
6383
  "quantity.remove.label": "✕",
6384
6384
  "cart.item.remove": "✕",
6385
- "common.table.donation": "Donation"
6385
+ "common.table.donation": "Donation",
6386
+ "cart.donation.title": "Donation",
6387
+ "donations.checkbox.label": "Add a {{amount}} donation to {{campaign}}"
6386
6388
  },
6387
6389
  de: {
6388
6390
  "quantity.remove": "Artikel entfernen",
6389
6391
  "quantity.remove.label": "✕",
6390
6392
  "cart.item.remove": "✕",
6391
- "common.table.donation": "Spende"
6393
+ "common.table.donation": "Spende",
6394
+ "cart.donation.title": "Spende",
6395
+ "donations.checkbox.label": "{{amount}} für {{campaign}} spenden"
6392
6396
  }
6393
6397
  };
6394
6398
  //#endregion
@@ -12399,9 +12403,10 @@ function createUICoupon(apiCoupon) {
12399
12403
  //#endregion
12400
12404
  //#region src/lib/models/cart/localStorage.svelte.ts
12401
12405
  var KEY$7 = "go-cart";
12402
- var persistCart = (items, coupons) => localStorage.setItem(KEY$7, JSON.stringify({
12406
+ var persistCart = (items, coupons, donations) => localStorage.setItem(KEY$7, JSON.stringify({
12403
12407
  items,
12404
12408
  coupons,
12409
+ donations,
12405
12410
  savedAt: Date.now()
12406
12411
  }));
12407
12412
  function generateCartItem(cartItem) {
@@ -12434,6 +12439,7 @@ function generateCartItem(cartItem) {
12434
12439
  function loadFromLocalStorage(cart) {
12435
12440
  let lsItems = [];
12436
12441
  let lsCoupons = [];
12442
+ let lsDonations = [];
12437
12443
  let savedAt;
12438
12444
  try {
12439
12445
  const content = localStorage.getItem(KEY$7);
@@ -12442,9 +12448,11 @@ function loadFromLocalStorage(cart) {
12442
12448
  if (Array.isArray(parsed)) {
12443
12449
  lsItems = parsed;
12444
12450
  lsCoupons = [];
12451
+ lsDonations = [];
12445
12452
  } else if (typeof parsed === "object" && parsed !== null) {
12446
12453
  lsItems = parsed.items || [];
12447
12454
  lsCoupons = parsed.coupons || [];
12455
+ lsDonations = parsed.donations || [];
12448
12456
  savedAt = parsed.savedAt;
12449
12457
  } else {
12450
12458
  console.dir({
@@ -12453,10 +12461,11 @@ function loadFromLocalStorage(cart) {
12453
12461
  });
12454
12462
  throw new Error("go-cart has invalid format");
12455
12463
  }
12456
- if (!!savedAt && Date.now() - savedAt > 9e5) {
12464
+ if (typeof savedAt === "number" && Date.now() - savedAt > 9e5) {
12457
12465
  cart.clearItems();
12458
12466
  cart.clearCoupons();
12459
- persistCart([], []);
12467
+ cart.clearDonations();
12468
+ persistCart([], [], []);
12460
12469
  return [];
12461
12470
  }
12462
12471
  if (lsItems.length === 0) cart.clearItems();
@@ -12466,10 +12475,17 @@ function loadFromLocalStorage(cart) {
12466
12475
  code: coupon,
12467
12476
  kind: "actionToken"
12468
12477
  } : coupon));
12478
+ cart.clearDonations();
12479
+ lsDonations.forEach((d) => {
12480
+ if (typeof d?.value === "number" && typeof d?.campaign_id === "number") cart.addDonation({
12481
+ value: d.value,
12482
+ campaign_id: d.campaign_id
12483
+ });
12484
+ });
12469
12485
  return cart.items;
12470
12486
  } catch (e) {
12471
12487
  console.error(e);
12472
- persistCart([], []);
12488
+ persistCart([], [], []);
12473
12489
  return [];
12474
12490
  }
12475
12491
  }
@@ -12483,18 +12499,20 @@ function syncCartToLocalStorage(cart) {
12483
12499
  loadFromLocalStorage(cart);
12484
12500
  let lastWritten = JSON.stringify({
12485
12501
  items: cart.items || [],
12486
- coupons: cart.coupons || []
12502
+ coupons: cart.coupons || [],
12503
+ donations: cart.donations || []
12487
12504
  });
12488
- persistCart(cart.items || [], cart.coupons || []);
12505
+ persistCart(cart.items || [], cart.coupons || [], cart.donations || []);
12489
12506
  effect_root(() => {
12490
12507
  user_effect(() => {
12491
12508
  const content = JSON.stringify({
12492
12509
  items: cart.items || [],
12493
- coupons: cart.coupons || []
12510
+ coupons: cart.coupons || [],
12511
+ donations: cart.donations || []
12494
12512
  });
12495
12513
  if (content === lastWritten) return;
12496
12514
  lastWritten = content;
12497
- persistCart(cart.items || [], cart.coupons || []);
12515
+ persistCart(cart.items || [], cart.coupons || [], cart.donations || []);
12498
12516
  });
12499
12517
  });
12500
12518
  }
@@ -12513,10 +12531,12 @@ var lastUuid = 0;
12513
12531
  function createCart(products, contingent = 20) {
12514
12532
  const items = proxy([]);
12515
12533
  const coupons = proxy([]);
12534
+ const donations = proxy([]);
12516
12535
  let paymentModeId = /* @__PURE__ */ state(void 0);
12517
12536
  const cart = {
12518
12537
  items,
12519
12538
  coupons,
12539
+ donations,
12520
12540
  get paymentModeId() {
12521
12541
  return get$2(paymentModeId);
12522
12542
  },
@@ -12528,7 +12548,10 @@ function createCart(products, contingent = 20) {
12528
12548
  return this.items.filter((i) => i.quantity > 0);
12529
12549
  },
12530
12550
  get totalPriceCents() {
12531
- return Math.max(0, sum(this.items, (item) => item.total_price_cents));
12551
+ return Math.max(0, sum(this.items, (item) => item.total_price_cents) + this.donationCents);
12552
+ },
12553
+ get donationCents() {
12554
+ return sum(this.donations, (d) => d.value);
12532
12555
  },
12533
12556
  get totalQuantity() {
12534
12557
  return sum(this.items, (item) => item.quantity);
@@ -12537,7 +12560,8 @@ function createCart(products, contingent = 20) {
12537
12560
  return sum(this.coupons.filter((c) => c.kind === "valueVoucher"), (c) => c.valueCents ?? 0);
12538
12561
  },
12539
12562
  get amountToPayCents() {
12540
- return Math.max(0, this.totalPriceCents - this.valueVoucherCents);
12563
+ const itemsTotal = sum(this.items, (item) => item.total_price_cents);
12564
+ return Math.max(0, itemsTotal - this.valueVoucherCents) + this.donationCents;
12541
12565
  },
12542
12566
  /**
12543
12567
  * Generates a formatted string representation of the current object.
@@ -12556,7 +12580,10 @@ function createCart(products, contingent = 20) {
12556
12580
  reference: null,
12557
12581
  payment_mode_id: this.paymentModeId ?? shop.settings?.defaultPaymentModeId,
12558
12582
  coupons: this.coupons.map((c) => c.code),
12559
- donations: [],
12583
+ donations: this.donations.map((d) => ({
12584
+ value: d.value,
12585
+ campaign_id: d.campaign_id
12586
+ })),
12560
12587
  affiliate: {},
12561
12588
  total: this.amountToPayCents
12562
12589
  };
@@ -12597,6 +12624,19 @@ function createCart(products, contingent = 20) {
12597
12624
  },
12598
12625
  clearCoupons() {
12599
12626
  while (this.coupons.length > 0) this.coupons.pop();
12627
+ },
12628
+ hasDonation(campaignId, value) {
12629
+ return this.donations.some((d) => d.campaign_id === campaignId && d.value === value);
12630
+ },
12631
+ addDonation(donation) {
12632
+ if (!this.hasDonation(donation.campaign_id, donation.value)) this.donations.push(donation);
12633
+ },
12634
+ removeDonation(campaignId, value) {
12635
+ const index = this.donations.findIndex((d) => d.campaign_id === campaignId && d.value === value);
12636
+ if (index > -1) this.donations.splice(index, 1);
12637
+ },
12638
+ clearDonations() {
12639
+ while (this.donations.length > 0) this.donations.pop();
12600
12640
  }
12601
12641
  };
12602
12642
  if (products) products.forEach((p) => cart.addItem(createCartItem(p)));
@@ -14318,8 +14358,8 @@ var setPersonalizationDetails = createSetDetails(KEY$5);
14318
14358
  var getPersonalizationDetails = createGetDetails(KEY$5);
14319
14359
  //#endregion
14320
14360
  //#region src/components/annualTicketPersonalization/components/AnnualTicketPersonalization.svelte
14321
- var root$61 = /* @__PURE__ */ from_html(`<li><a> </a></li>`);
14322
- var root_1$21 = /* @__PURE__ */ from_html(`<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>`);
14361
+ var root$63 = /* @__PURE__ */ from_html(`<li><a> </a></li>`);
14362
+ var root_1$23 = /* @__PURE__ */ from_html(`<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>`);
14323
14363
  function AnnualTicketPersonalization($$anchor, $$props) {
14324
14364
  push($$props, true);
14325
14365
  let token = prop($$props, "token", 7);
@@ -14344,7 +14384,7 @@ function AnnualTicketPersonalization($$anchor, $$props) {
14344
14384
  var consequent_1 = ($$anchor) => {
14345
14385
  var fragment_1 = comment();
14346
14386
  each(first_child(fragment_1), 17, () => get$2(order).ticket_sales, (ticketSale) => ticketSale.id, ($$anchor, ticketSale) => {
14347
- var ul = root_1$21();
14387
+ var ul = root_1$23();
14348
14388
  var li = child(ul);
14349
14389
  var text = child(li, true);
14350
14390
  reset(li);
@@ -14353,7 +14393,7 @@ function AnnualTicketPersonalization($$anchor, $$props) {
14353
14393
  reset(li_1);
14354
14394
  var node_2 = sibling(li_1, 2);
14355
14395
  var consequent = ($$anchor) => {
14356
- var li_2 = root$61();
14396
+ var li_2 = root$63();
14357
14397
  var a = child(li_2);
14358
14398
  var text_2 = child(a, true);
14359
14399
  reset(a);
@@ -15040,7 +15080,7 @@ function wrapInElement(host, tag, props) {
15040
15080
  }
15041
15081
  //#endregion
15042
15082
  //#region src/components/forms/ui/generic/Form.svelte
15043
- var root$60 = /* @__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);
15083
+ var root$62 = /* @__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);
15044
15084
  function Form($$anchor, $$props) {
15045
15085
  push($$props, true);
15046
15086
  let formId = prop($$props, "formId", 7), custom = prop($$props, "custom", 7);
@@ -15086,7 +15126,7 @@ function Form($$anchor, $$props) {
15086
15126
  var fragment = comment();
15087
15127
  var node = first_child(fragment);
15088
15128
  var consequent = ($$anchor) => {
15089
- var fragment_1 = root$60();
15129
+ var fragment_1 = root$62();
15090
15130
  var go_submit = sibling(sibling(first_child(fragment_1), 2), 2);
15091
15131
  var text = child(go_submit, true);
15092
15132
  reset(go_submit);
@@ -15113,7 +15153,7 @@ customElements.define("go-form", create_custom_element(Form, {
15113
15153
  }, [], ["details"]));
15114
15154
  //#endregion
15115
15155
  //#region src/components/auth/passwordReset/PasswordReset.svelte
15116
- var root$59 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15156
+ var root$61 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15117
15157
  function PasswordReset($$anchor, $$props) {
15118
15158
  push($$props, true);
15119
15159
  let custom = prop($$props, "custom", 7, false), redirectUrl = prop($$props, "redirectUrl", 7, "");
@@ -15157,7 +15197,7 @@ function PasswordReset($$anchor, $$props) {
15157
15197
  flushSync();
15158
15198
  }
15159
15199
  };
15160
- var go_form = root$59();
15200
+ var go_form = root$61();
15161
15201
  set_custom_element_data(go_form, "formId", "passwordReset");
15162
15202
  template_effect(() => set_custom_element_data(go_form, "custom", custom()));
15163
15203
  event("submit", go_form, passwordReset);
@@ -15173,7 +15213,7 @@ customElements.define("go-password-reset", create_custom_element(PasswordReset,
15173
15213
  }, [], []));
15174
15214
  //#endregion
15175
15215
  //#region src/components/auth/setPassword/SetPassword.svelte
15176
- var root$58 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15216
+ var root$60 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15177
15217
  function SetPassword($$anchor, $$props) {
15178
15218
  push($$props, true);
15179
15219
  let accessToken = prop($$props, "accessToken", 7, ""), client = prop($$props, "client", 7, ""), uid = prop($$props, "uid", 7, "");
@@ -15227,7 +15267,7 @@ function SetPassword($$anchor, $$props) {
15227
15267
  flushSync();
15228
15268
  }
15229
15269
  };
15230
- var go_form = root$58();
15270
+ var go_form = root$60();
15231
15271
  set_custom_element_data(go_form, "formId", "setPassword");
15232
15272
  event("submit", go_form, setNewPassword);
15233
15273
  append($$anchor, go_form);
@@ -15387,6 +15427,7 @@ function createDisplayCart(baseCart, apiItems) {
15387
15427
  ...coupon,
15388
15428
  applied: coupon.kind !== "actionToken" || echoed.has(coupon.code)
15389
15429
  }));
15430
+ baseCart.donations.forEach((donation) => displayCart.addDonation(donation));
15390
15431
  apiItems.forEach((apiItem) => {
15391
15432
  const attrs = apiItem.attributes;
15392
15433
  const ref = attrs.uuid;
@@ -15479,7 +15520,7 @@ var setCartDetails = createSetDetails(KEY$3);
15479
15520
  var getCartDetails = createGetDetails(KEY$3);
15480
15521
  //#endregion
15481
15522
  //#region src/components/cart/components/itemTitles/Coupon.svelte
15482
- var root$57 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span>`);
15523
+ var root$59 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span>`);
15483
15524
  function Coupon$1($$anchor, $$props) {
15484
15525
  push($$props, true);
15485
15526
  let cartItem = prop($$props, "cartItem", 7);
@@ -15492,7 +15533,7 @@ function Coupon$1($$anchor, $$props) {
15492
15533
  flushSync();
15493
15534
  }
15494
15535
  };
15495
- var span = root$57();
15536
+ var span = root$59();
15496
15537
  var text = child(span, true);
15497
15538
  reset(span);
15498
15539
  template_effect(() => set_text(text, cartItem().product.title));
@@ -15502,8 +15543,8 @@ function Coupon$1($$anchor, $$props) {
15502
15543
  create_custom_element(Coupon$1, { cartItem: {} }, [], [], { mode: "open" });
15503
15544
  //#endregion
15504
15545
  //#region src/components/cart/components/itemTitles/Event.svelte
15505
- var root$56 = /* @__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);
15506
- var root_1$20 = /* @__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);
15546
+ var root$58 = /* @__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);
15547
+ var root_1$22 = /* @__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);
15507
15548
  function Event$2($$anchor, $$props) {
15508
15549
  push($$props, true);
15509
15550
  let cartItem = prop($$props, "cartItem", 7);
@@ -15518,7 +15559,7 @@ function Event$2($$anchor, $$props) {
15518
15559
  flushSync();
15519
15560
  }
15520
15561
  };
15521
- var fragment = root_1$20();
15562
+ var fragment = root_1$22();
15522
15563
  var span = first_child(fragment);
15523
15564
  var span_1 = child(span);
15524
15565
  var text = child(span_1, true);
@@ -15529,7 +15570,7 @@ function Event$2($$anchor, $$props) {
15529
15570
  reset(span);
15530
15571
  var node = sibling(span);
15531
15572
  var consequent = ($$anchor) => {
15532
- var fragment_1 = root$56();
15573
+ var fragment_1 = root$58();
15533
15574
  var span_3 = first_child(fragment_1);
15534
15575
  var text_2 = child(span_3, true);
15535
15576
  reset(span_3);
@@ -15555,9 +15596,9 @@ function Event$2($$anchor, $$props) {
15555
15596
  create_custom_element(Event$2, { cartItem: {} }, [], [], { mode: "open" });
15556
15597
  //#endregion
15557
15598
  //#region src/components/cart/components/itemTitles/Ticket.svelte
15558
- var root$55 = /* @__PURE__ */ from_html(`<span class="go-cart-item-subtitle" data-testid="cart-item-subtitle"> </span>`);
15559
- var root_1$19 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
15560
- var root_2$14 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
15599
+ var root$57 = /* @__PURE__ */ from_html(`<span class="go-cart-item-subtitle" data-testid="cart-item-subtitle"> </span>`);
15600
+ var root_1$21 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
15601
+ var root_2$15 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
15561
15602
  var root_3$10 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <!> <!>`, 1);
15562
15603
  function Ticket($$anchor, $$props) {
15563
15604
  push($$props, true);
@@ -15577,7 +15618,7 @@ function Ticket($$anchor, $$props) {
15577
15618
  reset(span);
15578
15619
  var node = sibling(span, 2);
15579
15620
  var consequent = ($$anchor) => {
15580
- var span_1 = root$55();
15621
+ var span_1 = root$57();
15581
15622
  var text_1 = child(span_1, true);
15582
15623
  reset(span_1);
15583
15624
  template_effect(() => set_text(text_1, cartItem().product.sub_title));
@@ -15589,13 +15630,13 @@ function Ticket($$anchor, $$props) {
15589
15630
  });
15590
15631
  var node_1 = sibling(node, 2);
15591
15632
  var consequent_2 = ($$anchor) => {
15592
- var fragment_1 = root_2$14();
15633
+ var fragment_1 = root_2$15();
15593
15634
  var span_2 = first_child(fragment_1);
15594
15635
  var text_2 = child(span_2, true);
15595
15636
  reset(span_2);
15596
15637
  var node_2 = sibling(span_2, 2);
15597
15638
  var consequent_1 = ($$anchor) => {
15598
- var span_3 = root_1$19();
15639
+ var span_3 = root_1$21();
15599
15640
  var text_3 = child(span_3, true);
15600
15641
  reset(span_3);
15601
15642
  template_effect(($0) => set_text(text_3, $0), [() => shop.formatTime(cartItem().time)]);
@@ -15617,9 +15658,9 @@ function Ticket($$anchor, $$props) {
15617
15658
  create_custom_element(Ticket, { cartItem: {} }, [], [], { mode: "open" });
15618
15659
  //#endregion
15619
15660
  //#region src/components/cart/components/itemTitles/Tour.svelte
15620
- var root$54 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
15621
- var root_1$18 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
15622
- var root_2$13 = /* @__PURE__ */ from_html(`<span class="go-cart-item-custom" data-testid="cart-item-custom"> </span>`);
15661
+ var root$56 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
15662
+ var root_1$20 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
15663
+ var root_2$14 = /* @__PURE__ */ from_html(`<span class="go-cart-item-custom" data-testid="cart-item-custom"> </span>`);
15623
15664
  var root_3$9 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <span class="go-cart-item-participants" data-testid="cart-item-participants"> </span> <!> <!>`, 1);
15624
15665
  function Tour$1($$anchor, $$props) {
15625
15666
  push($$props, true);
@@ -15659,13 +15700,13 @@ function Tour$1($$anchor, $$props) {
15659
15700
  reset(span_1);
15660
15701
  var node = sibling(span_1, 2);
15661
15702
  var consequent_1 = ($$anchor) => {
15662
- var fragment_1 = root_1$18();
15703
+ var fragment_1 = root_1$20();
15663
15704
  var span_2 = first_child(fragment_1);
15664
15705
  var text_2 = child(span_2, true);
15665
15706
  reset(span_2);
15666
15707
  var node_1 = sibling(span_2, 2);
15667
15708
  var consequent = ($$anchor) => {
15668
- var span_3 = root$54();
15709
+ var span_3 = root$56();
15669
15710
  var text_3 = child(span_3, true);
15670
15711
  reset(span_3);
15671
15712
  template_effect(() => set_text(text_3, get$2(slot).time));
@@ -15684,7 +15725,7 @@ function Tour$1($$anchor, $$props) {
15684
15725
  var $$array = /* @__PURE__ */ user_derived(() => to_array(get$2($$item), 2));
15685
15726
  let key = () => get$2($$array)[0];
15686
15727
  let value = () => get$2($$array)[1];
15687
- var span_4 = root_2$13();
15728
+ var span_4 = root_2$14();
15688
15729
  var text_4 = child(span_4);
15689
15730
  reset(span_4);
15690
15731
  template_effect(($0) => set_text(text_4, `${key() ?? ""}: ${$0 ?? ""}`), [() => displayCustom(value())]);
@@ -15732,7 +15773,7 @@ function canDecrement(value, { floor = 0 }) {
15732
15773
  }
15733
15774
  //#endregion
15734
15775
  //#region src/components/shared/quantityStepper/QuantityStepper.svelte
15735
- var root$53 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button" 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>`);
15776
+ var root$55 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button" 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>`);
15736
15777
  function QuantityStepper($$anchor, $$props) {
15737
15778
  const inputId = props_id();
15738
15779
  push($$props, true);
@@ -15886,7 +15927,7 @@ function QuantityStepper($$anchor, $$props) {
15886
15927
  flushSync();
15887
15928
  }
15888
15929
  };
15889
- var div = root$53();
15930
+ var div = root$55();
15890
15931
  var button = child(div);
15891
15932
  let classes;
15892
15933
  var span = child(button);
@@ -15966,8 +16007,8 @@ function option(value) {
15966
16007
  }
15967
16008
  //#endregion
15968
16009
  //#region src/components/shared/quantityStepper/QuantityControl.svelte
15969
- var root$52 = /* @__PURE__ */ from_html(`<option> </option>`);
15970
- var root_1$17 = /* @__PURE__ */ from_html(`<select class="go-quantity-select"></select>`);
16010
+ var root$54 = /* @__PURE__ */ from_html(`<option> </option>`);
16011
+ var root_1$19 = /* @__PURE__ */ from_html(`<select class="go-quantity-select"></select>`);
15971
16012
  function QuantityControl($$anchor, $$props) {
15972
16013
  push($$props, true);
15973
16014
  /** Current committed quantity. */
@@ -16094,9 +16135,9 @@ function QuantityControl($$anchor, $$props) {
16094
16135
  }
16095
16136
  };
16096
16137
  var alternate = ($$anchor) => {
16097
- var select = root_1$17();
16138
+ var select = root_1$19();
16098
16139
  each(select, 21, () => generateQuantityOptions(min(), max(), { floor: deselectable() ? floor() : min() }), (q) => q.value, ($$anchor, q) => {
16099
- var option = root$52();
16140
+ var option = root$54();
16100
16141
  var text = child(option, true);
16101
16142
  reset(option);
16102
16143
  var option_value = {};
@@ -17981,9 +18022,9 @@ function createDOMPurify() {
17981
18022
  var purify = createDOMPurify();
17982
18023
  //#endregion
17983
18024
  //#region src/components/cart/components/SubRow.svelte
17984
- var root$51 = /* @__PURE__ */ from_html(`<span class="go-sub-ticket-description"></span>`);
17985
- var root_1$16 = /* @__PURE__ */ from_html(`<span class="go-sub-ticket-quantity"> </span>`);
17986
- var root_2$12 = /* @__PURE__ */ from_html(`<li><span class="go-sub-ticket-title"> </span> <!> <!></li>`);
18025
+ var root$53 = /* @__PURE__ */ from_html(`<span class="go-sub-ticket-description"></span>`);
18026
+ var root_1$18 = /* @__PURE__ */ from_html(`<span class="go-sub-ticket-quantity"> </span>`);
18027
+ var root_2$13 = /* @__PURE__ */ from_html(`<li><span class="go-sub-ticket-title"> </span> <!> <!></li>`);
17987
18028
  function SubRow($$anchor, $$props) {
17988
18029
  push($$props, true);
17989
18030
  /** Capacity-aware ceiling from CapacityManager.subTicketMaxes; the combination max when absent. */
@@ -18026,13 +18067,13 @@ function SubRow($$anchor, $$props) {
18026
18067
  flushSync();
18027
18068
  }
18028
18069
  };
18029
- var li = root_2$12();
18070
+ var li = root_2$13();
18030
18071
  var span = child(li);
18031
18072
  var text = child(span, true);
18032
18073
  reset(span);
18033
18074
  var node = sibling(span, 2);
18034
18075
  var consequent = ($$anchor) => {
18035
- var span_1 = root$51();
18076
+ var span_1 = root$53();
18036
18077
  html$2(span_1, () => purify.sanitize(sub().description), true);
18037
18078
  reset(span_1);
18038
18079
  append($$anchor, span_1);
@@ -18042,7 +18083,7 @@ function SubRow($$anchor, $$props) {
18042
18083
  });
18043
18084
  var node_1 = sibling(node, 2);
18044
18085
  var consequent_1 = ($$anchor) => {
18045
- var span_2 = root_1$16();
18086
+ var span_2 = root_1$18();
18046
18087
  var text_1 = child(span_2, true);
18047
18088
  reset(span_2);
18048
18089
  template_effect(() => {
@@ -18119,9 +18160,9 @@ function quantityLabel(item, locale) {
18119
18160
  }
18120
18161
  //#endregion
18121
18162
  //#region src/components/cart/components/Item.svelte
18122
- var root$50 = /* @__PURE__ */ from_html(`<s class="go-cart-item-price-original"> </s> <span class="go-cart-item-price-discounted"> </span>`, 1);
18123
- var root_1$15 = /* @__PURE__ */ from_html(`<span class="go-cart-item-price-discounted"> </span>`);
18124
- var root_2$11 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-participant-count"> </span>`);
18163
+ var root$52 = /* @__PURE__ */ from_html(`<s class="go-cart-item-price-original"> </s> <span class="go-cart-item-price-discounted"> </span>`, 1);
18164
+ var root_1$17 = /* @__PURE__ */ from_html(`<span class="go-cart-item-price-discounted"> </span>`);
18165
+ var root_2$12 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-participant-count"> </span>`);
18125
18166
  var root_3$8 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-voucher-quantity"> </span>`);
18126
18167
  var root_4$4 = /* @__PURE__ */ from_html(`<span> </span>`);
18127
18168
  var root_5$3 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"> </button></li>`);
@@ -18227,7 +18268,7 @@ function Item$1($$anchor, $$props) {
18227
18268
  var li_1 = sibling(li, 2);
18228
18269
  var node_2 = child(li_1);
18229
18270
  var consequent_4 = ($$anchor) => {
18230
- var fragment_6 = root$50();
18271
+ var fragment_6 = root$52();
18231
18272
  var s = first_child(fragment_6);
18232
18273
  var text = child(s, true);
18233
18274
  reset(s);
@@ -18241,7 +18282,7 @@ function Item$1($$anchor, $$props) {
18241
18282
  append($$anchor, fragment_6);
18242
18283
  };
18243
18284
  var alternate = ($$anchor) => {
18244
- var span_1 = root_1$15();
18285
+ var span_1 = root_1$17();
18245
18286
  var text_2 = child(span_1, true);
18246
18287
  reset(span_1);
18247
18288
  template_effect(($0) => set_text(text_2, $0), [() => formatCurrency(displayItem().final_price_cents)]);
@@ -18255,7 +18296,7 @@ function Item$1($$anchor, $$props) {
18255
18296
  var li_2 = sibling(li_1, 2);
18256
18297
  var node_3 = child(li_2);
18257
18298
  var consequent_5 = ($$anchor) => {
18258
- var span_2 = root_2$11();
18299
+ var span_2 = root_2$12();
18259
18300
  var text_3 = child(span_2, true);
18260
18301
  reset(span_2);
18261
18302
  template_effect(() => set_text(text_3, displayItem().product.participants));
@@ -18373,10 +18414,78 @@ create_custom_element(Item$1, {
18373
18414
  preview: {}
18374
18415
  }, [], [], { mode: "open" });
18375
18416
  //#endregion
18417
+ //#region src/components/cart/components/DonationRow.svelte
18418
+ var root$51 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"> </button></li>`);
18419
+ var root_1$16 = /* @__PURE__ */ from_html(`<article class="go-cart-donation" data-testid="cart-donation"><ul><li class="go-cart-item-title-container"><span class="go-cart-donation-title"> </span></li> <li class="go-cart-item-price"></li> <li class="go-cart-item-count"></li> <!> <li class="go-cart-item-sum"> </li></ul></article>`);
18420
+ function DonationRow($$anchor, $$props) {
18421
+ push($$props, true);
18422
+ let donation = prop($$props, "donation", 7), preview = prop($$props, "preview", 7);
18423
+ const campaign = /* @__PURE__ */ user_derived(() => shop.donations?.campaigns?.find((c) => c.id === donation().campaign_id));
18424
+ function remove() {
18425
+ shop.cart?.removeDonation(donation().campaign_id, donation().value);
18426
+ }
18427
+ var $$exports = {
18428
+ get donation() {
18429
+ return donation();
18430
+ },
18431
+ set donation($$value) {
18432
+ donation($$value);
18433
+ flushSync();
18434
+ },
18435
+ get preview() {
18436
+ return preview();
18437
+ },
18438
+ set preview($$value) {
18439
+ preview($$value);
18440
+ flushSync();
18441
+ }
18442
+ };
18443
+ var article = root_1$16();
18444
+ var ul = child(article);
18445
+ var li = child(ul);
18446
+ var span = child(li);
18447
+ var text = child(span, true);
18448
+ reset(span);
18449
+ reset(li);
18450
+ var node = sibling(li, 6);
18451
+ var consequent = ($$anchor) => {
18452
+ var li_1 = root$51();
18453
+ var button = child(li_1);
18454
+ var text_1 = child(button, true);
18455
+ reset(button);
18456
+ reset(li_1);
18457
+ template_effect(($0, $1) => {
18458
+ set_attribute(button, "aria-label", $0);
18459
+ set_text(text_1, $1);
18460
+ }, [() => shop.t("cart.item.aria.removeItem"), () => shop.t("cart.item.remove")]);
18461
+ delegated("click", button, remove);
18462
+ append($$anchor, li_1);
18463
+ };
18464
+ if_block(node, ($$render) => {
18465
+ if (!preview()) $$render(consequent);
18466
+ });
18467
+ var li_2 = sibling(node, 2);
18468
+ var text_2 = child(li_2, true);
18469
+ reset(li_2);
18470
+ reset(ul);
18471
+ reset(article);
18472
+ template_effect(($0, $1) => {
18473
+ set_text(text, $0);
18474
+ set_text(text_2, $1);
18475
+ }, [() => get$2(campaign)?.name ?? shop.t("cart.donation.title"), () => formatCurrency(donation().value)]);
18476
+ append($$anchor, article);
18477
+ return pop($$exports);
18478
+ }
18479
+ delegate(["click"]);
18480
+ create_custom_element(DonationRow, {
18481
+ donation: {},
18482
+ preview: {}
18483
+ }, [], [], { mode: "open" });
18484
+ //#endregion
18376
18485
  //#region src/components/cart/components/CartItems.svelte
18377
- var root$49 = /* @__PURE__ */ from_html(`<li class="go-cart-header-remove"></li>`);
18378
- var root_1$14 = /* @__PURE__ */ from_html(`<li class="go-cart-item"><!></li>`);
18379
- var root_2$10 = /* @__PURE__ */ from_html(`<ol data-testid="cart-items"><li class="go-cart-header"><ul><li class="go-cart-header-title"> </li> <li class="go-cart-header-price"> </li> <li class="go-cart-header-count"> </li> <!> <li class="go-cart-header-sum"> </li></ul></li> <!></ol>`);
18486
+ var root$50 = /* @__PURE__ */ from_html(`<li class="go-cart-header-remove"></li>`);
18487
+ var root_1$15 = /* @__PURE__ */ from_html(`<li class="go-cart-item"><!></li>`);
18488
+ var root_2$11 = /* @__PURE__ */ from_html(`<ol data-testid="cart-items"><li class="go-cart-header"><ul><li class="go-cart-header-title"> </li> <li class="go-cart-header-price"> </li> <li class="go-cart-header-count"> </li> <!> <li class="go-cart-header-sum"> </li></ul></li> <!> <!></ol>`);
18380
18489
  function CartItems($$anchor, $$props) {
18381
18490
  push($$props, true);
18382
18491
  const _details = getCartDetails($$props.$$host);
@@ -18384,7 +18493,7 @@ function CartItems($$anchor, $$props) {
18384
18493
  var fragment = comment();
18385
18494
  var node = first_child(fragment);
18386
18495
  var consequent_1 = ($$anchor) => {
18387
- var ol = root_2$10();
18496
+ var ol = root_2$11();
18388
18497
  var li = child(ol);
18389
18498
  var ul = child(li);
18390
18499
  var li_1 = child(ul);
@@ -18398,7 +18507,7 @@ function CartItems($$anchor, $$props) {
18398
18507
  reset(li_3);
18399
18508
  var node_1 = sibling(li_3, 2);
18400
18509
  var consequent = ($$anchor) => {
18401
- append($$anchor, root$49());
18510
+ append($$anchor, root$50());
18402
18511
  };
18403
18512
  if_block(node_1, ($$render) => {
18404
18513
  if (!get$2(details).preview) $$render(consequent);
@@ -18408,8 +18517,9 @@ function CartItems($$anchor, $$props) {
18408
18517
  reset(li_5);
18409
18518
  reset(ul);
18410
18519
  reset(li);
18411
- each(sibling(li, 2), 17, () => get$2(details).displayCart.items, (item) => item.uuid, ($$anchor, item) => {
18412
- var li_6 = root_1$14();
18520
+ var node_2 = sibling(li, 2);
18521
+ each(node_2, 17, () => get$2(details).displayCart.items, (item) => item.uuid, ($$anchor, item) => {
18522
+ var li_6 = root_1$15();
18413
18523
  Item$1(child(li_6), {
18414
18524
  get displayItem() {
18415
18525
  return get$2(item);
@@ -18424,6 +18534,19 @@ function CartItems($$anchor, $$props) {
18424
18534
  reset(li_6);
18425
18535
  append($$anchor, li_6);
18426
18536
  });
18537
+ each(sibling(node_2, 2), 17, () => get$2(details).displayCart.donations, (donation) => donation.campaign_id + "-" + donation.value, ($$anchor, donation) => {
18538
+ var li_7 = root_1$15();
18539
+ DonationRow(child(li_7), {
18540
+ get donation() {
18541
+ return get$2(donation);
18542
+ },
18543
+ get preview() {
18544
+ return get$2(details).preview;
18545
+ }
18546
+ });
18547
+ reset(li_7);
18548
+ append($$anchor, li_7);
18549
+ });
18427
18550
  reset(ol);
18428
18551
  template_effect(($0, $1, $2, $3) => {
18429
18552
  set_text(text, $0);
@@ -18439,7 +18562,7 @@ function CartItems($$anchor, $$props) {
18439
18562
  append($$anchor, ol);
18440
18563
  };
18441
18564
  if_block(node, ($$render) => {
18442
- if (get$2(details) && get$2(details).displayCart && get$2(details).displayCart.items.length) $$render(consequent_1);
18565
+ if (get$2(details) && get$2(details).displayCart && (get$2(details).displayCart.items.length || get$2(details).displayCart.donations.length)) $$render(consequent_1);
18443
18566
  });
18444
18567
  append($$anchor, fragment);
18445
18568
  pop();
@@ -18447,9 +18570,9 @@ function CartItems($$anchor, $$props) {
18447
18570
  customElements.define("go-cart-items", create_custom_element(CartItems, {}, [], []));
18448
18571
  //#endregion
18449
18572
  //#region src/components/cart/components/CartCoupons.svelte
18450
- var root$48 = /* @__PURE__ */ from_html(`<li class="go-cart-coupon-remove-cell"><button class="go-cart-remove go-cart-coupon-remove">⨉</button></li>`);
18451
- var root_1$13 = /* @__PURE__ */ from_html(`<li><article class="go-cart-coupon-content"><ul><li class="go-cart-coupon-code"> </li> <!></ul></article></li>`);
18452
- var root_2$9 = /* @__PURE__ */ from_html(`<ol data-testid="cart-coupons"></ol>`);
18573
+ var root$49 = /* @__PURE__ */ from_html(`<li class="go-cart-coupon-remove-cell"><button class="go-cart-remove go-cart-coupon-remove">⨉</button></li>`);
18574
+ var root_1$14 = /* @__PURE__ */ from_html(`<li><article class="go-cart-coupon-content"><ul><li class="go-cart-coupon-code"> </li> <!></ul></article></li>`);
18575
+ var root_2$10 = /* @__PURE__ */ from_html(`<ol data-testid="cart-coupons"></ol>`);
18453
18576
  function CartCoupons($$anchor, $$props) {
18454
18577
  push($$props, true);
18455
18578
  const _details = getCartDetails($$props.$$host);
@@ -18457,9 +18580,9 @@ function CartCoupons($$anchor, $$props) {
18457
18580
  var fragment = comment();
18458
18581
  var node = first_child(fragment);
18459
18582
  var consequent_1 = ($$anchor) => {
18460
- var ol = root_2$9();
18583
+ var ol = root_2$10();
18461
18584
  each(ol, 21, () => get$2(details).displayCart.coupons, (coupon) => coupon.code, ($$anchor, coupon) => {
18462
- var li = root_1$13();
18585
+ var li = root_1$14();
18463
18586
  let classes;
18464
18587
  var article = child(li);
18465
18588
  var ul = child(article);
@@ -18468,7 +18591,7 @@ function CartCoupons($$anchor, $$props) {
18468
18591
  reset(li_1);
18469
18592
  var node_1 = sibling(li_1, 2);
18470
18593
  var consequent = ($$anchor) => {
18471
- var li_2 = root$48();
18594
+ var li_2 = root$49();
18472
18595
  var button = child(li_2);
18473
18596
  reset(li_2);
18474
18597
  template_effect(($0) => set_attribute(button, "aria-label", $0), [() => shop.t("cart.coupons.remove")]);
@@ -18500,7 +18623,7 @@ delegate(["click"]);
18500
18623
  customElements.define("go-cart-coupons", create_custom_element(CartCoupons, {}, [], []));
18501
18624
  //#endregion
18502
18625
  //#region src/components/cart/components/CartTotalAmount.svelte
18503
- var root$47 = /* @__PURE__ */ from_html(`<span class="go-cart-total-amount" data-testid="cart-total-amount"> </span>`);
18626
+ var root$48 = /* @__PURE__ */ from_html(`<span class="go-cart-total-amount" data-testid="cart-total-amount"> </span>`);
18504
18627
  function CartTotalAmount($$anchor, $$props) {
18505
18628
  push($$props, true);
18506
18629
  const _details = getCartDetails($$props.$$host);
@@ -18508,7 +18631,7 @@ function CartTotalAmount($$anchor, $$props) {
18508
18631
  var fragment = comment();
18509
18632
  var node = first_child(fragment);
18510
18633
  var consequent = ($$anchor) => {
18511
- var span = root$47();
18634
+ var span = root$48();
18512
18635
  var text = child(span, true);
18513
18636
  reset(span);
18514
18637
  template_effect(($0) => set_text(text, $0), [() => formatCurrency(get$2(details).totalPriceCents)]);
@@ -18536,6 +18659,7 @@ function Cart($$anchor, $$props) {
18536
18659
  shop.cart.items.map((i) => i.uuid + ":" + i.quantity + ":" + i.time);
18537
18660
  shop.cart.coupons.map((c) => c.code).join("|");
18538
18661
  shop.cart.items.forEach((i) => i.mantle && Object.values(i.mantle.composition));
18662
+ shop.cart.donations.map((d) => d.campaign_id + ":" + d.value).join("|");
18539
18663
  untrack(() => details.calculateDisplayCart());
18540
18664
  });
18541
18665
  async function flushCoupons() {
@@ -18577,7 +18701,7 @@ customElements.define("go-cart", create_custom_element(Cart, { preview: {
18577
18701
  } }, [], []));
18578
18702
  //#endregion
18579
18703
  //#region src/components/cart/components/CartSubtotalAmount.svelte
18580
- var root$46 = /* @__PURE__ */ from_html(`<span class="go-cart-subtotal-amount" data-testid="cart-subtotal-amount"> </span>`);
18704
+ var root$47 = /* @__PURE__ */ from_html(`<span class="go-cart-subtotal-amount" data-testid="cart-subtotal-amount"> </span>`);
18581
18705
  function CartSubtotalAmount($$anchor, $$props) {
18582
18706
  push($$props, true);
18583
18707
  const _details = getCartDetails($$props.$$host);
@@ -18585,7 +18709,7 @@ function CartSubtotalAmount($$anchor, $$props) {
18585
18709
  var fragment = comment();
18586
18710
  var node = first_child(fragment);
18587
18711
  var consequent = ($$anchor) => {
18588
- var span = root$46();
18712
+ var span = root$47();
18589
18713
  var text = child(span, true);
18590
18714
  reset(span);
18591
18715
  template_effect(($0) => set_text(text, $0), [() => formatCurrency(get$2(details).subtotalPriceCents)]);
@@ -18600,7 +18724,7 @@ function CartSubtotalAmount($$anchor, $$props) {
18600
18724
  customElements.define("go-cart-subtotal-amount", create_custom_element(CartSubtotalAmount, {}, [], []));
18601
18725
  //#endregion
18602
18726
  //#region src/components/cart/components/CartDiscountedAmount.svelte
18603
- var root$45 = /* @__PURE__ */ from_html(`<span class="go-cart-discounted-amount" data-testid="cart-discounted-amount"><span class="go-cart-discounted-amount-sign">−</span> </span>`);
18727
+ var root$46 = /* @__PURE__ */ from_html(`<span class="go-cart-discounted-amount" data-testid="cart-discounted-amount"><span class="go-cart-discounted-amount-sign">−</span> </span>`);
18604
18728
  function CartDiscountedAmount($$anchor, $$props) {
18605
18729
  push($$props, true);
18606
18730
  const _details = getCartDetails($$props.$$host);
@@ -18608,7 +18732,7 @@ function CartDiscountedAmount($$anchor, $$props) {
18608
18732
  var fragment = comment();
18609
18733
  var node = first_child(fragment);
18610
18734
  var consequent = ($$anchor) => {
18611
- var span = root$45();
18735
+ var span = root$46();
18612
18736
  var text = sibling(child(span), 1, true);
18613
18737
  reset(span);
18614
18738
  template_effect(($0) => set_text(text, $0), [() => formatCurrency(get$2(details).discountedAmountCents)]);
@@ -18671,13 +18795,14 @@ async function finalizeCheckout(form, formId) {
18671
18795
  if (beforeSubmit) await beforeSubmit(form.details.formData);
18672
18796
  const meta = checkout.data.meta;
18673
18797
  const navigateTo = configStore.config.navigateTo;
18798
+ const checkoutFailure = configStore.config.urls.checkoutFailure ?? shop.urls.checkoutFailure;
18674
18799
  if (meta.status === "success") {
18675
18800
  const checkoutSuccess = configStore.config.urls.checkoutSuccess ?? shop.urls.checkoutSuccess;
18676
18801
  navigateTo?.(checkoutSuccess(checkout.data.order.token));
18677
- } else if (meta.status === "fail") navigateTo?.(shop.urls.checkoutFailure(""));
18802
+ } else if (meta.status === "fail") navigateTo?.(checkoutFailure(""));
18678
18803
  else if (meta.payment_url) navigateTo?.(meta.payment_url);
18679
18804
  else if (meta.payment_data) postToPaymentProvider(meta.payment_data);
18680
- else navigateTo?.(shop.urls.checkoutFailure(""));
18805
+ else navigateTo?.(checkoutFailure(""));
18681
18806
  }
18682
18807
  function setupGuestCheckout(host, custom) {
18683
18808
  Forms.defineForm({
@@ -18852,7 +18977,7 @@ function fail(errors) {
18852
18977
  }
18853
18978
  //#endregion
18854
18979
  //#region src/components/couponRedemption/CouponRedemption.svelte
18855
- var root$44 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
18980
+ var root$45 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
18856
18981
  function CouponRedemption($$anchor, $$props) {
18857
18982
  push($$props, true);
18858
18983
  Forms.defineForm({
@@ -18889,7 +19014,7 @@ function CouponRedemption($$anchor, $$props) {
18889
19014
  return runRedeem(form);
18890
19015
  }
18891
19016
  var $$exports = { flush };
18892
- var go_form = root$44();
19017
+ var go_form = root$45();
18893
19018
  set_custom_element_data(go_form, "formId", "couponRedemption");
18894
19019
  event("submit", go_form, redeem$1);
18895
19020
  append($$anchor, go_form);
@@ -18897,6 +19022,116 @@ function CouponRedemption($$anchor, $$props) {
18897
19022
  }
18898
19023
  customElements.define("go-coupon-redemption", create_custom_element(CouponRedemption, {}, [], ["flush"]));
18899
19024
  //#endregion
19025
+ //#region src/components/donations/components/DonationCheckbox.svelte
19026
+ var root$44 = /* @__PURE__ */ from_html(`<span class="go-donation-checkbox-label"></span>`);
19027
+ var root_1$13 = /* @__PURE__ */ from_html(`<span class="go-donation-checkbox-label"> </span>`);
19028
+ var root_2$9 = /* @__PURE__ */ from_html(`<label class="go-donation-checkbox"><input type="checkbox" data-testid="donation-checkbox"/> <!></label>`);
19029
+ function DonationCheckbox($$anchor, $$props) {
19030
+ push($$props, true);
19031
+ let campaignId = prop($$props, "campaignId", 7), amountCents = prop($$props, "amountCents", 7), describedby = prop($$props, "describedby", 7);
19032
+ const adopted = document.createDocumentFragment();
19033
+ for (const node of Array.from($$props.$$host.childNodes)) if (!(node.nodeType === Node.TEXT_NODE && node.textContent === "") && node.nodeType !== Node.COMMENT_NODE) adopted.appendChild(node);
19034
+ const hasCustomLabel = Array.from(adopted.childNodes).some((n) => n.nodeType === Node.ELEMENT_NODE || !!n.textContent?.trim());
19035
+ let customLabelSpan = /* @__PURE__ */ state(void 0);
19036
+ user_effect(() => {
19037
+ if (!hasCustomLabel || !get$2(customLabelSpan)) return;
19038
+ const span = get$2(customLabelSpan);
19039
+ span.appendChild(adopted);
19040
+ return () => {
19041
+ while (span.firstChild) adopted.appendChild(span.firstChild);
19042
+ };
19043
+ });
19044
+ const campaign = /* @__PURE__ */ user_derived(() => shop.donations?.campaigns?.find((c) => c.id === campaignId()));
19045
+ const guest = /* @__PURE__ */ user_derived(() => !shop.currentUser?.isAuthenticated || shop.currentUser?.isGuest);
19046
+ const overGuestLimit = /* @__PURE__ */ user_derived(() => !!get$2(campaign) && get$2(campaign).guest_limit > 0 && (amountCents() ?? 0) > get$2(campaign).guest_limit && get$2(guest));
19047
+ const checked = /* @__PURE__ */ user_derived(() => !!get$2(campaign) && !!amountCents() && !!shop.cart?.hasDonation(get$2(campaign).id, amountCents()));
19048
+ function toggle(event) {
19049
+ if (!get$2(campaign) || !amountCents() || !shop.cart) return;
19050
+ if (event.currentTarget.checked) shop.cart.addDonation({
19051
+ value: amountCents(),
19052
+ campaign_id: get$2(campaign).id
19053
+ });
19054
+ else shop.cart.removeDonation(get$2(campaign).id, amountCents());
19055
+ }
19056
+ var $$exports = {
19057
+ get campaignId() {
19058
+ return campaignId();
19059
+ },
19060
+ set campaignId($$value) {
19061
+ campaignId($$value);
19062
+ flushSync();
19063
+ },
19064
+ get amountCents() {
19065
+ return amountCents();
19066
+ },
19067
+ set amountCents($$value) {
19068
+ amountCents($$value);
19069
+ flushSync();
19070
+ },
19071
+ get describedby() {
19072
+ return describedby();
19073
+ },
19074
+ set describedby($$value) {
19075
+ describedby($$value);
19076
+ flushSync();
19077
+ }
19078
+ };
19079
+ var fragment = comment();
19080
+ var node_1 = first_child(fragment);
19081
+ var consequent_1 = ($$anchor) => {
19082
+ var label = root_2$9();
19083
+ var input = child(label);
19084
+ remove_input_defaults(input);
19085
+ var node_2 = sibling(input, 2);
19086
+ var consequent = ($$anchor) => {
19087
+ var span_1 = root$44();
19088
+ bind_this(span_1, ($$value) => set(customLabelSpan, $$value), () => get$2(customLabelSpan));
19089
+ append($$anchor, span_1);
19090
+ };
19091
+ var alternate = ($$anchor) => {
19092
+ var span_2 = root_1$13();
19093
+ var text = child(span_2, true);
19094
+ reset(span_2);
19095
+ template_effect(($0) => set_text(text, $0), [() => shop.t("donations.checkbox.label", {
19096
+ campaign: get$2(campaign).name,
19097
+ amount: formatCurrency(amountCents())
19098
+ })]);
19099
+ append($$anchor, span_2);
19100
+ };
19101
+ if_block(node_2, ($$render) => {
19102
+ if (hasCustomLabel) $$render(consequent);
19103
+ else $$render(alternate, -1);
19104
+ });
19105
+ reset(label);
19106
+ template_effect(() => {
19107
+ set_checked(input, get$2(checked));
19108
+ set_attribute(input, "aria-describedby", describedby() || void 0);
19109
+ });
19110
+ delegated("change", input, toggle);
19111
+ append($$anchor, label);
19112
+ };
19113
+ if_block(node_1, ($$render) => {
19114
+ if (get$2(campaign) && amountCents() && amountCents() > 0 && !get$2(overGuestLimit)) $$render(consequent_1);
19115
+ });
19116
+ append($$anchor, fragment);
19117
+ return pop($$exports);
19118
+ }
19119
+ delegate(["change"]);
19120
+ customElements.define("go-donation-checkbox", create_custom_element(DonationCheckbox, {
19121
+ campaignId: {
19122
+ attribute: "campaign-id",
19123
+ type: "Number"
19124
+ },
19125
+ amountCents: {
19126
+ attribute: "amount-cents",
19127
+ type: "Number"
19128
+ },
19129
+ describedby: {
19130
+ attribute: "describedby",
19131
+ type: "String"
19132
+ }
19133
+ }, [], []));
19134
+ //#endregion
18900
19135
  //#region ../../node_modules/.pnpm/svelte@5.56.1_@typescript-eslint+types@8.60.1/node_modules/svelte/src/internal/flags/legacy.js
18901
19136
  enable_legacy_mode_flag();
18902
19137
  //#endregion
@@ -36571,6 +36806,7 @@ function Order($$anchor, $$props) {
36571
36806
  untrack(() => {
36572
36807
  cart.clearItems();
36573
36808
  cart.clearCoupons();
36809
+ cart.clearDonations();
36574
36810
  if (shop.auth.isGuest()) shop.auth.signOut();
36575
36811
  });
36576
36812
  });