@getmicdrop/venue-calendar 4.0.109 → 4.0.111

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 (110) hide show
  1. package/dist/CartView-DiSdmuA_.js +2475 -0
  2. package/dist/CartView-DiSdmuA_.js.map +1 -0
  3. package/dist/{Checkout-CMEf_qnp.js → Checkout-DBaNrRya.js} +323 -333
  4. package/dist/Checkout-DBaNrRya.js.map +1 -0
  5. package/dist/{Checkout-Chki2df_.js → Checkout-DwJr030c.js} +206 -205
  6. package/dist/Checkout-DwJr030c.js.map +1 -0
  7. package/dist/{CheckoutTimer-BAaY_60w.js → CheckoutTimer-DPFVh7QG.js} +5 -5
  8. package/dist/{CheckoutTimer-BAaY_60w.js.map → CheckoutTimer-DPFVh7QG.js.map} +1 -1
  9. package/dist/{ClockIcon-Dbbj_qur.js → ClockIcon-BoEIfS3d.js} +2 -2
  10. package/dist/{ClockIcon-Dbbj_qur.js.map → ClockIcon-BoEIfS3d.js.map} +1 -1
  11. package/dist/{CollectionView-RM30YPOJ.js → CollectionView-DM3WLpLu.js} +78 -77
  12. package/dist/CollectionView-DM3WLpLu.js.map +1 -0
  13. package/dist/{Event-kdxMa6OT.js → Event-DymZpajQ.js} +659 -657
  14. package/dist/Event-DymZpajQ.js.map +1 -0
  15. package/dist/{EventPage-BRBByBHe.js → EventPage-D7GG_BWH.js} +300 -306
  16. package/dist/EventPage-D7GG_BWH.js.map +1 -0
  17. package/dist/{Heading-CSDFD80h.js → Heading-C8oOcA05.js} +2 -2
  18. package/dist/{Heading-CSDFD80h.js.map → Heading-C8oOcA05.js.map} +1 -1
  19. package/dist/{ScarcityBadge-B0ca48su.js → ScarcityBadge-BqJHRkab.js} +11 -11
  20. package/dist/{ScarcityBadge-B0ca48su.js.map → ScarcityBadge-BqJHRkab.js.map} +1 -1
  21. package/dist/SeriesPage-DsJ9zGPQ.js +34 -0
  22. package/dist/SeriesPage-DsJ9zGPQ.js.map +1 -0
  23. package/dist/{Spinner--TOwvv9A.js → Spinner-DPzuHWU6.js} +2 -2
  24. package/dist/{Spinner--TOwvv9A.js.map → Spinner-DPzuHWU6.js.map} +1 -1
  25. package/dist/Success-C0D_INAc.js +896 -0
  26. package/dist/Success-C0D_INAc.js.map +1 -0
  27. package/dist/{Text-WLl_ELy9.js → Text-DOd8068v.js} +19 -19
  28. package/dist/Text-DOd8068v.js.map +1 -0
  29. package/dist/VenueCalendar-B809Hecp.js +16467 -0
  30. package/dist/VenueCalendar-B809Hecp.js.map +1 -0
  31. package/dist/{ViewTicketsEmbed-BOukxQIF.js → ViewTicketsEmbed-BPMp4JM0.js} +86 -85
  32. package/dist/{ViewTicketsEmbed-BOukxQIF.js.map → ViewTicketsEmbed-BPMp4JM0.js.map} +1 -1
  33. package/dist/__SKIP_PATHS__-BtJ0tS93.js +10 -0
  34. package/dist/__SKIP_PATHS__-BtJ0tS93.js.map +1 -0
  35. package/dist/{labels-DXGieQXs.js → labels-wFEhrJkb.js} +154 -149
  36. package/dist/labels-wFEhrJkb.js.map +1 -0
  37. package/dist/{modalManager.svelte-Dbd1xgTQ.js → modalManager.svelte-DjiZPIja.js} +2 -2
  38. package/dist/{modalManager.svelte-Dbd1xgTQ.js.map → modalManager.svelte-DjiZPIja.js.map} +1 -1
  39. package/dist/navigation--gZASiSa.js +19 -0
  40. package/dist/navigation--gZASiSa.js.map +1 -0
  41. package/dist/{promo-oWi_MKmY.js → promo-DK6Hxogl.js} +2 -2
  42. package/dist/{promo-oWi_MKmY.js.map → promo-DK6Hxogl.js.map} +1 -1
  43. package/dist/{showcase-state-options-DJJdjxvZ.js → showcase-state-options-BuPnUf0V.js} +21 -21
  44. package/dist/showcase-state-options-BuPnUf0V.js.map +1 -0
  45. package/dist/{transform-Bgqwj9i-.js → transform-C6LCkao6.js} +81 -77
  46. package/dist/transform-C6LCkao6.js.map +1 -0
  47. package/dist/types/index.d.ts +18 -14
  48. package/dist/utm-DYGTGbVA.js +288 -0
  49. package/dist/utm-DYGTGbVA.js.map +1 -0
  50. package/dist/venue-calendar.css +1 -1
  51. package/dist/venue-calendar.es.js +2 -2
  52. package/dist/venue-calendar.iife.js +50 -50
  53. package/dist/venue-calendar.iife.js.map +1 -1
  54. package/dist/venue-calendar.umd.js +45 -45
  55. package/dist/venue-calendar.umd.js.map +1 -1
  56. package/package.json +199 -199
  57. package/dist/CartView-C3N5pw89.js +0 -2381
  58. package/dist/CartView-C3N5pw89.js.map +0 -1
  59. package/dist/Checkout-CMEf_qnp.js.map +0 -1
  60. package/dist/Checkout-Chki2df_.js.map +0 -1
  61. package/dist/CollectionView-RM30YPOJ.js.map +0 -1
  62. package/dist/Event-kdxMa6OT.js.map +0 -1
  63. package/dist/EventPage-BRBByBHe.js.map +0 -1
  64. package/dist/SeriesPage-CczfbUKO.js +0 -33
  65. package/dist/SeriesPage-CczfbUKO.js.map +0 -1
  66. package/dist/Success-DIWUGUPs.js +0 -886
  67. package/dist/Success-DIWUGUPs.js.map +0 -1
  68. package/dist/Text-WLl_ELy9.js.map +0 -1
  69. package/dist/VenueCalendar-CU5N9klc.js +0 -16579
  70. package/dist/VenueCalendar-CU5N9klc.js.map +0 -1
  71. package/dist/api/api/client.d.ts +0 -17
  72. package/dist/api/api/cta.d.ts +0 -34
  73. package/dist/api/api/events.d.ts +0 -183
  74. package/dist/api/api/gift-cards.d.ts +0 -108
  75. package/dist/api/api/index.d.ts +0 -46
  76. package/dist/api/api/orders.d.ts +0 -149
  77. package/dist/api/api/promo.d.ts +0 -45
  78. package/dist/api/api/result.d.ts +0 -78
  79. package/dist/api/api/route-manifest.d.ts +0 -179
  80. package/dist/api/api/transformers/address.d.ts +0 -18
  81. package/dist/api/api/transformers/cart.d.ts +0 -19
  82. package/dist/api/api/transformers/collection.d.ts +0 -12
  83. package/dist/api/api/transformers/event.d.ts +0 -173
  84. package/dist/api/api/transformers/giftCard.d.ts +0 -11
  85. package/dist/api/api/transformers/index.d.ts +0 -27
  86. package/dist/api/api/transformers/order.d.ts +0 -44
  87. package/dist/api/api/transformers/performer.d.ts +0 -8
  88. package/dist/api/api/transformers/series.d.ts +0 -12
  89. package/dist/api/api/transformers/venue.d.ts +0 -39
  90. package/dist/api/api/venues.d.ts +0 -33
  91. package/dist/api/api/waitlist.d.ts +0 -49
  92. package/dist/api/api.cjs +0 -2
  93. package/dist/api/api.cjs.map +0 -1
  94. package/dist/api/api.mjs +0 -1299
  95. package/dist/api/api.mjs.map +0 -1
  96. package/dist/api/types.d.ts +0 -483
  97. package/dist/labels-DXGieQXs.js.map +0 -1
  98. package/dist/seo/HostSeoController.d.ts +0 -68
  99. package/dist/seo/buildCollectionJsonLd.d.ts +0 -8
  100. package/dist/seo/buildEventJsonLd.d.ts +0 -9
  101. package/dist/seo/buildSeriesJsonLd.d.ts +0 -6
  102. package/dist/seo/helpers.d.ts +0 -88
  103. package/dist/seo/index.d.ts +0 -10
  104. package/dist/seo/seo.cjs +0 -2
  105. package/dist/seo/seo.cjs.map +0 -1
  106. package/dist/seo/seo.mjs +0 -541
  107. package/dist/seo/seo.mjs.map +0 -1
  108. package/dist/seo/types.d.ts +0 -150
  109. package/dist/showcase-state-options-DJJdjxvZ.js.map +0 -1
  110. package/dist/transform-Bgqwj9i-.js.map +0 -1
@@ -1,8 +0,0 @@
1
- import { CollectionJsonLdInput } from './types';
2
- export interface BuildCollectionJsonLdOptions {
3
- collection: CollectionJsonLdInput;
4
- baseEventUrl?: string;
5
- /** Accepted for API compatibility; the summary ItemList carries no dates. */
6
- defaultTimeZone?: string;
7
- }
8
- export declare function buildCollectionJsonLd(options: BuildCollectionJsonLdOptions): Record<string, unknown> | null;
@@ -1,9 +0,0 @@
1
- import { EventJsonLdInput, VenueInput, OrganizerInput } from './types';
2
- export interface BuildEventJsonLdOptions {
3
- event: EventJsonLdInput;
4
- venue: VenueInput;
5
- venueTimeZone?: string;
6
- eventUrl?: string;
7
- organizer?: OrganizerInput;
8
- }
9
- export declare function buildEventJsonLd(options: BuildEventJsonLdOptions): Record<string, unknown> | null;
@@ -1,6 +0,0 @@
1
- import { SeriesJsonLdInput } from './types';
2
- export interface BuildSeriesJsonLdOptions {
3
- series: SeriesJsonLdInput;
4
- baseEventUrl?: string;
5
- }
6
- export declare function buildSeriesJsonLd(options: BuildSeriesJsonLdOptions): Record<string, unknown> | null;
@@ -1,88 +0,0 @@
1
- import { EventTicketInput, EventPerformerInput } from './types';
2
- /**
3
- * Escape a JSON string for safe embedding inside an inline
4
- * <script type="application/ld+json"> element.
5
- *
6
- * JSON.stringify does NOT escape `<`, `>` or `&`, so a field value containing
7
- * `</script><script>...` would break out of the script element and execute
8
- * (stored XSS). Replacing those characters with their unicode escape sequences
9
- * keeps the output valid JSON (parsers decode `<` back to `<`) while making
10
- * it impossible to terminate the surrounding <script> tag.
11
- *
12
- * This is the standard JSON-LD-in-<script> hardening; the sibling
13
- * HostSeoController avoids the issue entirely by using element.textContent.
14
- */
15
- export declare function escapeJsonLdForScript(json: string): string;
16
- /**
17
- * Format datetime to ISO-8601 with timezone offset.
18
- * Google requires: "2025-07-21T19:00:00-05:00"
19
- *
20
- * Extracted from EventStructuredData.svelte lines 25-68.
21
- */
22
- export declare function formatDateTimeWithOffset(isoString: string | null | undefined, tz: string): string | null;
23
- /**
24
- * Parse address string into PostalAddress components.
25
- * Input: "7702 Santa Monica Blvd, West Hollywood, CA 90046"
26
- * Output: { @type, streetAddress, addressLocality, addressRegion, postalCode, addressCountry }
27
- *
28
- * Extracted from EventStructuredData.svelte lines 75-111.
29
- */
30
- export declare function parseAddressToPostal(addressStr: string | null | undefined): Record<string, string> | null;
31
- /**
32
- * Structured postal-address parts, as the public resolve/series payloads now
33
- * expose them: `address` is the STREET line, with city/state/postalCode/country
34
- * as discrete fields (PublicVenueInfo / SeriesVenueDTO).
35
- */
36
- export interface PostalAddressParts {
37
- address?: string | null;
38
- city?: string | null;
39
- state?: string | null;
40
- postalCode?: string | null;
41
- country?: string | null;
42
- }
43
- /**
44
- * Build a schema.org PostalAddress, preferring discrete structured fields when
45
- * any locality signal (city / state / postalCode) is present, and otherwise
46
- * falling back to parsing a single comma-separated string (the street `address`
47
- * field if it carries a full address, else `googleLocationNameCache`).
48
- *
49
- * Discrete fields are more reliable than string-splitting — Google requires a
50
- * well-formed PostalAddress for Event rich-result eligibility (online-only
51
- * events lost eligibility June 2025).
52
- */
53
- export declare function buildPostalAddress(parts: PostalAddressParts | null | undefined, fallback?: string | null): Record<string, string> | null;
54
- /**
55
- * Map event status to schema.org EventStatusType.
56
- *
57
- * Extracted from EventStructuredData.svelte lines 116-132.
58
- */
59
- export declare function getEventStatus(rawStatus: string | null | undefined): string;
60
- /**
61
- * Map ticket availability to schema.org ItemAvailability.
62
- *
63
- * Extracted from EventStructuredData.svelte lines 137-157.
64
- */
65
- export declare function getTicketAvailability(ticket: EventTicketInput): string;
66
- /**
67
- * Build a schema.org price-range offer from a low/high price and availability.
68
- *
69
- * The shared primitive behind every JSON-LD offer block: emit an AggregateOffer
70
- * when the range spans two prices, or a single Offer when low === high. Any
71
- * caller-specific fields (a buy `url`, a `validFrom` sales-start) ride along in
72
- * `extra`, spread verbatim after the core fields so each caller reproduces its
73
- * exact prior shape — the event builder passes url/validFrom, the series builder
74
- * passes nothing.
75
- */
76
- export declare function buildPriceRangeOffer(lowPrice: number, highPrice: number, availability: string, extra?: Record<string, unknown>): Record<string, unknown>;
77
- /**
78
- * Build offers from available tickets.
79
- *
80
- * Extracted from EventStructuredData.svelte lines 162-208.
81
- */
82
- export declare function buildOffers(tickets: EventTicketInput[] | null | undefined, url?: string): Record<string, unknown> | null;
83
- /**
84
- * Build performer array from event performers.
85
- *
86
- * Extracted from EventStructuredData.svelte lines 213-237.
87
- */
88
- export declare function buildPerformers(performers: EventPerformerInput[] | null | undefined): Array<Record<string, string>> | null;
@@ -1,10 +0,0 @@
1
- export { buildEventJsonLd } from './buildEventJsonLd';
2
- export { buildSeriesJsonLd } from './buildSeriesJsonLd';
3
- export { buildCollectionJsonLd } from './buildCollectionJsonLd';
4
- export { HostSeoController } from './HostSeoController';
5
- export type { BuildEventJsonLdOptions } from './buildEventJsonLd';
6
- export type { BuildSeriesJsonLdOptions } from './buildSeriesJsonLd';
7
- export type { BuildCollectionJsonLdOptions } from './buildCollectionJsonLd';
8
- export type { EventJsonLdInput, EventTicketInput, EventPerformerInput, VenueInput, OrganizerInput, SeriesJsonLdInput, CollectionJsonLdInput, HostSeoControllerOptions, } from './types';
9
- export { formatDateTimeWithOffset, parseAddressToPostal, buildPostalAddress, getEventStatus, getTicketAvailability, buildOffers, buildPerformers, escapeJsonLdForScript, } from './helpers';
10
- export type { PostalAddressParts } from './helpers';
package/dist/seo/seo.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function E(){return"America/Los_Angeles"}const w=/<\/(?:p|div|h[1-6]|li|ul|ol|blockquote|tr)>/gi,q=/<br\s*\/?>/gi,j=/<[^>]*>/g,J={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&apos;":"'","&nbsp;":" "};function z(i){return i.replace(/&#x([0-9a-f]+);/gi,(t,e)=>I(parseInt(e,16))).replace(/&#(\d+);/g,(t,e)=>I(Number(e))).replace(/&[a-z0-9]+;/gi,t=>J[t.toLowerCase()]??t)}function I(i){return Number.isFinite(i)&&i>0&&i<=1114111?String.fromCodePoint(i):""}function y(i,t){if(!i)return"";let e=String(i).replace(q," ").replace(w," ").replace(j,"");if(e=z(e).replace(/\s+/g," ").trim(),t&&t>0&&e.length>t){const n=e.slice(0,t),s=n.lastIndexOf(" ");e=(s>40?n.slice(0,s):n).trimEnd()+"…"}return e}function B(){return new Date}function F(i){return i.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function _(i,t){if(!i)return null;const e=new Date(i);if(isNaN(e.getTime()))return null;const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZoneName:"shortOffset"};let s;try{s=new Intl.DateTimeFormat("en-US",{...n,timeZone:t})}catch{s=new Intl.DateTimeFormat("en-US",{...n,timeZone:E()})}const o=s.formatToParts(e),l=m=>o.find(b=>b.type===m)?.value||"",a=l("year"),u=l("month"),r=l("day"),d=l("hour"),c=l("minute"),h=l("second"),g=l("timeZoneName");let p="+00:00";if(g){const m=g.match(/GMT([+-])(\d+)(?::(\d+))?/);if(m){const b=m[1],U=m[2].padStart(2,"0"),Z=m[3]||"00";p=`${b}${U}:${Z}`}}return`${a}-${u}-${r}T${d}:${c}:${h}${p}`}function L(i){if(!i)return null;const t=i.split(",").map(s=>s.trim());if(t.length<2)return{"@type":"PostalAddress",streetAddress:i,addressCountry:"US"};const n=t[t.length-1].match(/^([A-Z]{2})\s+(\d{5}(?:-\d{4})?)$/);return n&&t.length>=3?{"@type":"PostalAddress",streetAddress:t.slice(0,-2).join(", "),addressLocality:t[t.length-2],addressRegion:n[1],postalCode:n[2],addressCountry:"US"}:{"@type":"PostalAddress",streetAddress:t[0],addressLocality:t.slice(1).join(", "),addressCountry:"US"}}function N(i,t){if(i&&(i.city||i.state||i.postalCode)){const e={"@type":"PostalAddress"};return i.address&&(e.streetAddress=i.address),i.city&&(e.addressLocality=i.city),i.state&&(e.addressRegion=i.state),i.postalCode&&(e.postalCode=i.postalCode),e.addressCountry=i.country||"US",e}return L(i&&i.address||t||null)}function T(i){if(!i)return"https://schema.org/EventScheduled";const t=i.toLowerCase();return t==="cancelled"||t==="canceled"?"https://schema.org/EventCancelled":t==="postponed"?"https://schema.org/EventPostponed":t==="rescheduled"?"https://schema.org/EventRescheduled":"https://schema.org/EventScheduled"}function O(i){if((i.remainingCapacity??i.quantityRemaining??i.quantity)===0||i.soldOut)return"https://schema.org/SoldOut";const e=B(),n=i.salesBegin||i.salesStart||i.saleBegin||i.onSaleStart,s=i.salesEnd||i.saleEnd||i.onSaleEnd;return n&&new Date(n)>e?"https://schema.org/PreOrder":s&&new Date(s)<e?"https://schema.org/SoldOut":"https://schema.org/InStock"}function S(i,t,e,n={}){return i!==t?{"@type":"AggregateOffer",lowPrice:i,highPrice:t,priceCurrency:"USD",availability:e,...n}:{"@type":"Offer",price:i,priceCurrency:"USD",availability:e,...n}}function P(i,t){if(!i||i.length===0)return null;const e=i.filter(a=>{const u=a.visibility??0,r=u===0||u===1,d=a.salesChannel!==2;return r&&d});if(e.length===0)return null;const n=e.map(a=>parseFloat(String(a.price??0))).filter(a=>!isNaN(a));if(n.length===0)return null;const s=Math.min(...n),o=Math.max(...n),l=e[0];return S(s,o,O(l),{url:t||void 0,validFrom:l?.salesBegin||l?.salesStart||void 0})}function D(i){if(!i||i.length===0)return null;const t=i.filter(e=>{const n=e.acceptedState===2,s=!e.shouldBeHidden,o=e.RosterPerformer?.User?.performerProfile,l=o?.firstName||o?.lastName||o?.displayName;return n&&s&&l});return t.length===0?null:t.map(e=>{const n=e.RosterPerformer?.User?.performerProfile;return{"@type":"PerformingGroup",name:n?.displayName||[n?.firstName,n?.lastName].filter(Boolean).join(" ")}})}function $(i){const{event:t,venue:e,venueTimeZone:n=E(),eventUrl:s,organizer:o}=i;if(!t)return null;const l=_(t.startDateTime,n);if(!t.name||!l||!e?.name)return null;const a=N(e,e?.googleLocationNameCache),u={"@type":"Place",name:e.name};a&&(u.address=a);const r={"@context":"https://schema.org","@type":"Event",name:t.name,startDate:l,eventStatus:T(t.status),eventAttendanceMode:"https://schema.org/OfflineEventAttendanceMode",location:u},d=_(t.endDateTime,n);d&&(r.endDate=d);const c=y(t.description)||t.eventSummary;c&&(r.description=c);const h=t.image||t.coverImage||t.ShowImage;h&&(r.image=[h]);const g=P(t.availableTickets,s);g&&(r.offers=g);const p=D(t.performers);if(p&&p.length>0&&(r.performer=p),o?.name){const m={"@type":"Organization",name:o.name};o.url&&(m.url=o.url),r.organizer=m}return s&&(r.url=s),r}function x(i){switch(i){case"available":return"https://schema.org/InStock";case"sold_out":return"https://schema.org/SoldOut";case"coming_soon":return"https://schema.org/PreOrder";case"ended":return"https://schema.org/SoldOut";default:return"https://schema.org/InStock"}}function R(i,t){if(!i||i.length===0)return null;const e=i.filter(s=>s.status!=="sold_out"&&s.status!=="ended");if(e.length===0){const s=i.map(o=>o.price).filter(o=>!isNaN(o));return s.length===0?null:S(Math.min(...s),Math.max(...s),"https://schema.org/SoldOut")}const n=e.map(s=>s.price).filter(s=>!isNaN(s));return n.length===0?null:S(Math.min(...n),Math.max(...n),x(e[0].status))}function C(i){const{series:t,baseEventUrl:e}=i;if(!t.title||!t.occurrences||t.occurrences.length===0||!t.venue?.name)return null;const n=N(t.venue,t.venue.googleLocationNameCache),s={"@type":"Place",name:t.venue.name};n&&(s.address=n);const o={"@context":"https://schema.org","@type":"EventSeries",name:t.title,location:s},l=y(t.description)||t.eventSummary;l&&(o.description=l),t.image&&(o.image=[t.image]);const a=t.performers?.filter(r=>r.displayName);a&&a.length>0&&(o.performer=a.map(r=>({"@type":"PerformingGroup",name:r.displayName})));const u=[];for(const r of t.occurrences){const d=_(r.startDateTime,t.timeZone);if(!d)continue;const c={"@type":"Event",name:r.title,startDate:d,eventStatus:T(r.status),location:s};e&&(c["@id"]=`${e}/${r.id}-${r.slug}`);const h=_(r.endDateTime,t.timeZone);h&&(c.endDate=h);const g=R(r.tickets,r.status);g&&(c.offers=g),u.push(c)}return u.length===0?null:(o.subEvent=u,o)}function M(i){const{collection:t,baseEventUrl:e}=i;if(!t.collectionTitle||!t.events||t.events.length===0)return null;const n=[];for(const l of t.events){if(!l.title)continue;const a={"@type":"ListItem",position:n.length+1,name:l.title};e&&(a.url=l.slug?`${e}/${l.id}-${l.slug}`:`${e}/${l.id}`),n.push(a)}if(n.length===0)return null;const s={"@context":"https://schema.org","@type":"CollectionPage",name:t.collectionTitle},o=y(t.description)||t.summary;return o&&(s.description=o),t.coverImage&&(s.image=[t.coverImage]),s.mainEntity={"@type":"ItemList",numberOfItems:n.length,itemListElement:n},s}const G=70;function H(i){return i.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,G).replace(/-+$/g,"")}function v(i){return i?H(i):""}const f=class f{constructor(t){this._state="idle",this._originals=null,this._originalsSaved=!1,this._events=[],!(typeof document>"u")&&(f._activeInstance&&f._activeInstance!==this&&f._activeInstance.destroy(),this._venueName=t.venueName,this._venueAddress=t.venueAddress,this._venueTimeZone=t.venueTimeZone||E(),this._baseUrl=t.baseUrl||window.location.origin+window.location.pathname,this._saveOriginals(),f._activeInstance=this)}_saveOriginals(){if(this._originalsSaved)return;const t=document.querySelector('link[rel="canonical"]'),e=document.querySelector('meta[property="og:title"]'),n=document.querySelector('meta[property="og:description"]'),s=document.querySelector('meta[property="og:image"]'),o=document.querySelector('meta[property="og:url"]'),l=document.querySelector('meta[property="og:type"]'),a=document.querySelector('meta[name="description"]');this._originals={title:document.title,canonicalHref:t?.getAttribute("href")??null,ogTitle:e?.getAttribute("content")??null,ogDescription:n?.getAttribute("content")??null,ogImage:s?.getAttribute("content")??null,ogUrl:o?.getAttribute("content")??null,ogType:l?.getAttribute("content")??null,metaDescription:a?.getAttribute("content")??null},this._originalsSaved=!0}_injectJsonLd(t){if(typeof document>"u")return;document.querySelectorAll('script[data-micdrop="jsonld"]').forEach(n=>n.remove());const e=document.createElement("script");e.setAttribute("type","application/ld+json"),e.setAttribute("data-micdrop","jsonld"),e.textContent=JSON.stringify(t),document.head.appendChild(e)}_setMeta(t,e){if(!(typeof document>"u"))if(t.startsWith("og:")){let n=document.querySelector(`meta[property="${t}"]`);n?n.setAttribute("content",e):(n=document.createElement("meta"),n.setAttribute("property",t),n.setAttribute("content",e),n.setAttribute("data-micdrop","og"),document.head.appendChild(n))}else{let n=document.querySelector(`meta[name="${t}"]`);n?n.setAttribute("content",e):(n=document.createElement("meta"),n.setAttribute("name",t),n.setAttribute("content",e),n.setAttribute("data-micdrop","meta"),document.head.appendChild(n))}}_setCanonical(t){if(typeof document>"u")return;let e=document.querySelector('link[rel="canonical"]');e?e.setAttribute("href",t):(e=document.createElement("link"),e.setAttribute("rel","canonical"),e.setAttribute("href",t),e.setAttribute("data-micdrop","canonical"),document.head.appendChild(e))}_removeAllInjected(){typeof document>"u"||document.querySelectorAll("[data-micdrop]").forEach(t=>t.remove())}_restoreOriginals(){if(!(typeof document>"u"||!this._originals)){if(document.title=this._originals.title,this._originals.canonicalHref!==null){const t=document.querySelector('link[rel="canonical"]');t&&t.setAttribute("href",this._originals.canonicalHref)}this._restoreMetaProperty("og:title",this._originals.ogTitle),this._restoreMetaProperty("og:description",this._originals.ogDescription),this._restoreMetaProperty("og:image",this._originals.ogImage),this._restoreMetaProperty("og:url",this._originals.ogUrl),this._restoreMetaProperty("og:type",this._originals.ogType),this._restoreMetaName("description",this._originals.metaDescription),this._originalsSaved=!1}}_restoreMetaProperty(t,e){const n=document.querySelector(`meta[property="${t}"]`);e!==null&&n?n.setAttribute("content",e):e===null&&n?.hasAttribute("data-micdrop")&&n.remove()}_restoreMetaName(t,e){const n=document.querySelector(`meta[name="${t}"]`);e!==null&&n?n.setAttribute("content",e):e===null&&n?.hasAttribute("data-micdrop")&&n.remove()}_buildItemList(t){return{"@context":"https://schema.org","@type":"ItemList",itemListElement:t.map((e,n)=>{const s=e.slug||v(e.name);return{"@type":"ListItem",position:n+1,url:`${this._baseUrl}?e=${e.id}-${s}`}})}}_buildEntityUrl(t,e,n){const s=t==="event"?"e":t==="series"?"s":"c";return`${this._baseUrl}?${s}=${e}-${n}`}onEventsLoaded(t,e){if(typeof document>"u"||this._state==="destroyed")return;if(e){this._venueName=e.name||this._venueName,this._venueAddress=e.address||e.googleLocationNameCache||this._venueAddress;const s=e.timeZone||e.timezone;s&&(this._venueTimeZone=s)}this._events=t;const n=this._buildItemList(t);this._injectJsonLd(n),this._state="listing"}onEntitySelected(t,e,n){if(typeof document>"u"||this._state==="destroyed")return;if(this._saveOriginals(),n){this._venueName=n.name||this._venueName,this._venueAddress=n.address||n.googleLocationNameCache||this._venueAddress;const c=n.timeZone||n.timezone;c&&(this._venueTimeZone=c)}let s=null,o="",l="",a="",u="",r="";if(t==="event"){const c=e.slug||v(e.name||"");r=this._buildEntityUrl("event",e.id||e.eventID||"",c),s=$({event:e,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},venueTimeZone:this._venueTimeZone,eventUrl:r}),o=e.name||"",l=e.description||"",a=e.eventSummary||"",u=e.image||e.coverImage||e.ShowImage||""}else if(t==="series"){const c=e.slug||v(e.title||"");r=this._buildEntityUrl("series",e.id||"",c),s=C({series:{...e,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},timeZone:this._venueTimeZone},baseEventUrl:r}),o=e.title||"",l=e.description||"",a=e.eventSummary||"",u=e.image||""}else if(t==="collection"){const c=e.slug||v(e.collectionTitle||"");r=this._buildEntityUrl("collection",e.id||"",c),s=M({collection:e,baseEventUrl:r,defaultTimeZone:this._venueTimeZone}),o=e.collectionTitle||"",l=e.description||"",a=e.summary||"",u=e.coverImage||""}s&&this._injectJsonLd(s),r&&this._setCanonical(r),o&&this._setMeta("og:title",o);const d=y(l,160)||y(a,160);d?this._setMeta("og:description",d):this._restoreMetaProperty("og:description",this._originals?.ogDescription??null),u&&this._setMeta("og:image",u),r&&this._setMeta("og:url",r),this._setMeta("og:type","website"),this._setMeta("twitter:card","summary_large_image"),d?this._setMeta("description",d):this._restoreMetaName("description",this._originals?.metaDescription??null),o&&(document.title=`${o} | ${this._venueName}`),this._state="entity"}onBackToListing(){if(!(typeof document>"u")&&this._state!=="destroyed"){if(this._restoreOriginals(),this._removeAllInjected(),this._events.length>0){const t=this._buildItemList(this._events);this._injectJsonLd(t)}this._saveOriginals(),this._state="listing"}}destroy(){typeof document>"u"||this._state!=="destroyed"&&(this._removeAllInjected(),this._restoreOriginals(),f._activeInstance===this&&(f._activeInstance=null),this._state="destroyed")}};f._activeInstance=null;let A=f;exports.HostSeoController=A;exports.buildCollectionJsonLd=M;exports.buildEventJsonLd=$;exports.buildOffers=P;exports.buildPerformers=D;exports.buildPostalAddress=N;exports.buildSeriesJsonLd=C;exports.escapeJsonLdForScript=F;exports.formatDateTimeWithOffset=_;exports.getEventStatus=T;exports.getTicketAvailability=O;exports.parseAddressToPostal=L;
2
- //# sourceMappingURL=seo.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seo.cjs","sources":["../../node_modules/@getmicdrop/svelte-components/dist/utils/timezones.js","../../node_modules/@getmicdrop/svelte-components/dist/richtext/index.js","../../node_modules/@getmicdrop/svelte-components/dist/datetime/local.js","../../src/lib/seo/helpers.ts","../../src/lib/seo/buildEventJsonLd.ts","../../src/lib/seo/buildSeriesJsonLd.ts","../../src/lib/seo/buildCollectionJsonLd.ts","../../node_modules/@getmicdrop/svelte-components/dist/routing/slug.js","../../src/lib/utils/textUtils.ts","../../src/lib/seo/HostSeoController.ts"],"sourcesContent":["/**\n * Timezone utility helpers.\n * Canonical source for timezone defaults and validation.\n */\n/**\n * Returns the default timezone for Micdrop, branded as `IANATimezone`.\n * Used when no explicit timezone is provided to date formatters. Bypass\n * call sites that pass `'America/Los_Angeles'` literally are red-squiggle\n * type errors at canonicals that take `IANATimezone` — the fix is to\n * thread `getDefaultTimezone()` through.\n *\n * @returns Branded IANA timezone (`'America/Los_Angeles'`)\n *\n * @example\n * formatDate(new Date(), {}, 'en-US', getDefaultTimezone())\n *\n * @deprecated Duplicate of the canonical default. Use `getDefaultTimezone`\n * (or the `DEFAULT_TIMEZONE` constant) from `$lib/datetime`\n * (re-exported via `datetime/constants`) — the single source of truth.\n */\nexport function getDefaultTimezone() {\n return 'America/Los_Angeles';\n}\n/**\n * Validates an IANA timezone string.\n * Uses Intl.DateTimeFormat to test if the timezone is recognized.\n *\n * @param tz - Timezone string to validate\n * @returns true if valid IANA timezone, false otherwise\n *\n * @example\n * isValidTimezone('America/Los_Angeles') // true\n * isValidTimezone('Invalid/Zone') // false\n *\n * @deprecated Lenient: `Intl.DateTimeFormat` accepts non-canonical inputs.\n * Use `isValidTimezone` from `$lib/datetime` (stricter — rejects\n * abbreviations like `'PST'`), or `toIANATimezone` from `$lib/types/brands`\n * when you need a branded value.\n */\nexport function isValidTimezone(tz) {\n try {\n new Intl.DateTimeFormat('en-US', { timeZone: tz });\n return true;\n }\n catch {\n return false;\n }\n}\n","/**\n * Rich-text helpers for event / series descriptions.\n *\n * Pure string utilities — NO DOM access and NO external dependencies — so they\n * run safely during SSR (e.g. a `<svelte:head>` meta-description) as well as in\n * the browser. The companion {@link RichTextEditor} produces HTML that already\n * passes through an Eventbrite-parity allowlist; these helpers:\n *\n * - {@link normalizeEventDescriptionHtml} — promote legacy plain-text\n * descriptions to paragraph HTML so they don't render as a single line.\n * - {@link isEventDescriptionEqual} — compare two descriptions\n * whitespace-insensitively, so cosmetic edits don't trip dirty-checking.\n * - {@link stripEventDescriptionHtml} — flatten HTML to plain text (optionally\n * truncated) for meta tags / previews.\n *\n * @module richtext\n */\n/** Block-level closers that should read as a space when flattened to text. */\nconst BLOCK_CLOSE = /<\\/(?:p|div|h[1-6]|li|ul|ol|blockquote|tr)>/gi;\nconst LINE_BREAK = /<br\\s*\\/?>/gi;\nconst ANY_TAG = /<[^>]*>/g;\n/** A leading `<tag>` is a reliable \"this is already HTML\" signal. */\nconst LOOKS_LIKE_HTML = /<[a-z][\\s\\S]*>/i;\nconst NAMED_ENTITIES = {\n \"&amp;\": \"&\",\n \"&lt;\": \"<\",\n \"&gt;\": \">\",\n \"&quot;\": '\"',\n \"&#39;\": \"'\",\n \"&apos;\": \"'\",\n \"&nbsp;\": \" \",\n};\nfunction decodeEntities(input) {\n return input\n .replace(/&#x([0-9a-f]+);/gi, (_, hex) => codePointOrEmpty(parseInt(hex, 16)))\n .replace(/&#(\\d+);/g, (_, dec) => codePointOrEmpty(Number(dec)))\n .replace(/&[a-z0-9]+;/gi, (m) => NAMED_ENTITIES[m.toLowerCase()] ?? m);\n}\nfunction codePointOrEmpty(code) {\n return Number.isFinite(code) && code > 0 && code <= 0x10ffff\n ? String.fromCodePoint(code)\n : \"\";\n}\nfunction escapeHtml(input) {\n return input\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\");\n}\n/**\n * Flatten a (possibly HTML) description to a single line of plain text.\n * When `maxLength` is given the result is truncated on a word boundary and an\n * ellipsis appended. Returns `''` for empty/missing input. SSR-safe.\n */\nexport function stripEventDescriptionHtml(html, maxLength) {\n if (!html)\n return \"\";\n let text = String(html)\n .replace(LINE_BREAK, \" \")\n .replace(BLOCK_CLOSE, \" \")\n .replace(ANY_TAG, \"\");\n text = decodeEntities(text).replace(/\\s+/g, \" \").trim();\n if (maxLength && maxLength > 0 && text.length > maxLength) {\n const clipped = text.slice(0, maxLength);\n const lastSpace = clipped.lastIndexOf(\" \");\n text =\n (lastSpace > 40 ? clipped.slice(0, lastSpace) : clipped).trimEnd() + \"…\";\n }\n return text;\n}\n/**\n * Normalize a stored description for the rich-text editor. Existing HTML is\n * returned as-is (trimmed); legacy plain text is escaped and promoted to\n * paragraphs (blank lines → `<p>`, single newlines → `<br>`) so it renders with\n * its original line structure instead of collapsing to one line. SSR-safe.\n */\nexport function normalizeEventDescriptionHtml(html) {\n if (!html)\n return \"\";\n const value = String(html);\n if (LOOKS_LIKE_HTML.test(value))\n return value.trim();\n return value\n .replace(/\\r\\n/g, \"\\n\")\n .split(/\\n{2,}/)\n .map((block) => block.trim())\n .filter(Boolean)\n .map((block) => `<p>${escapeHtml(block).replace(/\\n/g, \"<br>\")}</p>`)\n .join(\"\");\n}\n/** Collapse a description to a canonical form for equality comparison. */\nfunction canonicalize(html) {\n if (!html)\n return \"\";\n const collapsed = String(html)\n .replace(/>\\s+</g, \"><\")\n .replace(/\\s+/g, \" \")\n .trim();\n // An \"empty\" editor value (stray empty paragraphs / breaks) === no value.\n return /^(?:<p>(?:\\s|&nbsp;|<br\\s*\\/?>)*<\\/p>|<br\\s*\\/?>)*$/i.test(collapsed)\n ? \"\"\n : collapsed;\n}\n/**\n * True when two descriptions are equal ignoring cosmetic whitespace and\n * empty-paragraph noise — used for Save/dirty checking so a no-op edit doesn't\n * keep the form dirty. SSR-safe.\n */\nexport function isEventDescriptionEqual(a, b) {\n return canonicalize(a) === canonicalize(b);\n}\n// Sanitizer + shared allowlist — the security boundary for rendering stored\n// description HTML (which can arrive via CSV import / Eventbrite sync) on the\n// public event page + embed. `RichTextContent` calls this on render; callers\n// rendering description HTML directly with `{@html}` MUST sanitize here first.\nexport { sanitizeEventDescriptionHtml } from \"./sanitize.js\";\nexport { EVENT_DESCRIPTION_TAGS, EVENT_DESCRIPTION_ATTRS, EVENT_DESCRIPTION_LINK_PROTOCOLS, EVENT_DESCRIPTION_WHITELIST, } from \"./allowlist.js\";\n","/**\n * Browser-local date helpers — calendar chrome & `<input type=\"datetime-local\">`.\n *\n * These are the ONE exception to the module's golden rule (\"timezone is always\n * required\"). They operate on a JavaScript `Date` in the **browser's own local\n * timezone**, with NO IANA timezone argument and NO UTC conversion. They exist\n * for the cases where browser-local IS the correct semantic:\n *\n * - Scheduling / calendar-grid chrome that reflects the operator's own clock.\n * - Producing the `YYYY-MM-DD` / `YYYY-MM-DDTHH:mm` strings that native\n * `<input type=\"date\">` / `<input type=\"datetime-local\">` require (those\n * inputs are defined to read/write **local** wall-clock time, never UTC).\n *\n * The distinction from the venue-timezone formatters in `./format.ts` is\n * deliberate and load-bearing — keep it unmistakable:\n *\n * | Concern | Use | From |\n * |---------------------------------|-----------------------------------|---------------|\n * | Venue/event display time | `formatDayOfWeek(utcIso, tz)` | `./format.ts` |\n * | Operator's own clock / inputs | `formatLocalDayOfWeek(date)` | this file |\n *\n * Name-collision resolution (Atlas AUDIT #17): the venue-tz `formatDayOfWeek`\n * (UTC ISO + IANA tz) keeps the canonical name in `format.ts`; the browser-local\n * variant (a `Date`, no tz) is named `formatLocalDayOfWeek` here so the two can\n * never be confused at a call site.\n *\n * @module datetime/local\n */\nimport { getUserLocale } from './timezone.js';\n/**\n * Pads a number to two digits (e.g. `5` -> `\"05\"`).\n */\nfunction pad2(n) {\n return n < 10 ? `0${n}` : String(n);\n}\n/**\n * Current instant, as a `Date` in the **browser's own local clock** — the\n * named-intent replacement for a bare `new Date()` \"now\".\n *\n * Returns the present moment for viewer-local UI: calendar-grid chrome,\n * optimistic timestamps, \"is this in the past?\" checks against the operator's\n * own clock. It is the honest name for the many bare `new Date()` calls that\n * mean \"now, for the browser\" — NOT \"now, for the API\". Anything sent to or\n * reconciled against the backend must go through the venue-timezone helpers in\n * `./format.ts` / `./parse.ts`; this is strictly the local-chrome \"now\".\n *\n * (A `Date` is an absolute epoch instant with no stored zone — \"browser clock\"\n * describes how you read it back: via local wall-clock parts / local\n * formatters.)\n *\n * **Client-only for visible \"now\".** Under SSR / a SvelteKit `load`, this reads\n * the *server* clock — using it for a rendered \"now\" can hydrate to a different\n * value on the client. Call it in browser/`onMount` context (or accept that a\n * server render is a server-time snapshot) for anything the user sees tick.\n *\n * @returns A `Date` for the current instant.\n *\n * @example\n * const stampedAt = browserNow(); // optimistic UI timestamp\n * // event is in the past on the operator's own clock:\n * compareInstants(event.localStart, browserNow()) < 0\n */\nexport function browserNow() {\n return new Date();\n}\n/**\n * Current local date+time as an HTML `<input type=\"datetime-local\">` value.\n *\n * Format: `YYYY-MM-DDTHH:mm` (no seconds, no timezone) — exactly the value\n * format the native control reads and writes. Uses the browser's local clock;\n * does NOT convert to/from UTC.\n *\n * @returns Local-time string in `YYYY-MM-DDTHH:mm` form.\n *\n * @example\n * getCurrentDateTimeLocalFormat() // \"2026-06-09T14:30\" (in the viewer's tz)\n */\nexport function getCurrentDateTimeLocalFormat() {\n const now = browserNow();\n return (`${now.getFullYear()}-${pad2(now.getMonth() + 1)}-${pad2(now.getDate())}` +\n `T${pad2(now.getHours())}:${pad2(now.getMinutes())}`);\n}\n/**\n * Formats a `Date` as a `YYYY-MM-DD` string in the **browser's local timezone**.\n *\n * This is the value format for `<input type=\"date\">`. It reads the local\n * wall-clock parts (`getFullYear`/`getMonth`/`getDate`) — it does NOT use\n * `toISOString()` (which would shift to UTC and can roll the date across\n * midnight). Use this when \"the day on the operator's calendar\" is what matters.\n *\n * @param date - The date to format (interpreted in browser-local time).\n * @returns Local date string in `YYYY-MM-DD` form.\n *\n * @example\n * formatLocalDate(new Date(2026, 5, 9)) // \"2026-06-09\"\n */\nexport function formatLocalDate(date) {\n return (`${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`);\n}\n/**\n * The **host-local calendar-day anchor** for a date — local midnight\n * (`00:00:00.000`) of the calendar day the input falls on, in the browser's own\n * timezone.\n *\n * This is the anchor for grid / recurrence / \"same day\" math that starts from\n * the operator's own calendar and re-resolves to the venue timezone downstream.\n * It normalizes away the time-of-day so two instants on the same local day\n * collapse to one comparable anchor — pair it with\n * {@link import('./instant.js').compareInstants} /\n * {@link import('./instant.js').epochEquals} for ordering and same-day checks.\n *\n * It reads local wall-clock parts (`getFullYear` / `getMonth` / `getDate`) — it\n * does NOT use `toISOString()` (which would shift to UTC and can roll the anchor\n * across midnight under a non-UTC offset). Use this when \"the day on the\n * operator's calendar\" is the reference; use the venue-tz helpers in\n * `./format.ts` when the venue's calendar day is what matters.\n *\n * @param date - The date to anchor (interpreted in browser-local time).\n * Defaults to {@link browserNow} (today's local calendar day).\n * @returns A new `Date` at local midnight of that calendar day.\n *\n * @example\n * localCalendarDay(new Date(2026, 5, 9, 23, 30)) // 2026-06-09 00:00 local\n * localCalendarDay() // today at local midnight\n * // are two instants on the same local calendar day?\n * epochEquals(localCalendarDay(a), localCalendarDay(b))\n */\nexport function localCalendarDay(date = browserNow()) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}\n/**\n * Formats a `Date`'s weekday in the **browser's local timezone**.\n *\n * The browser-local sibling of the venue-timezone {@link import('./format.js').formatDayOfWeek}\n * (which takes a UTC ISO string + IANA timezone). This one takes a plain `Date`\n * and renders its weekday in local time — for calendar chrome where the\n * operator's own clock is the reference.\n *\n * @param date - The date whose weekday to format (browser-local).\n * @param full - If `true` (default), returns the full name (\"Monday\");\n * if `false`, the short name (\"Mon\").\n * @param locale - BCP-47 locale tag. Defaults to the viewer's resolved locale\n * via {@link import('./timezone.js').getUserLocale}. An app with its own i18n\n * locale should pass it explicitly.\n * @returns Localized weekday name in browser-local time.\n *\n * @example\n * formatLocalDayOfWeek(new Date(2026, 5, 8)) // \"Monday\"\n * formatLocalDayOfWeek(new Date(2026, 5, 8), false) // \"Mon\"\n */\nexport function formatLocalDayOfWeek(date, full = true, locale = getUserLocale()) {\n return new Intl.DateTimeFormat(locale, {\n weekday: full ? 'long' : 'short',\n }).format(date);\n}\n/**\n * Formats a `Date` in the **browser's local timezone** with caller-supplied\n * Intl options — the generic display-label formatter for viewer-local picker\n * chrome (single/range date pickers, month-year headers, day cells).\n *\n * Browser-local sibling of the venue-timezone formatters in `./format.ts`: it\n * renders the Date's local wall-clock parts (NO IANA timezone argument, NO UTC\n * conversion) via `Intl.DateTimeFormat`. This is the honest canonical home for\n * the labels the deprecated `formatDate` in `utils/formatters` used to produce\n * for viewer-local pickers — but it injects NO default field set: the caller's\n * `options` are authoritative (the pickers already pass fully-specified option\n * objects). The `'en-US'` locale default preserves the historical picker output.\n *\n * @param date - The date to format (interpreted in browser-local time).\n * @param options - Intl formatting options (authoritative; no defaults merged).\n * @param locale - BCP-47 locale tag. Defaults to `'en-US'` to match the\n * historical picker label output.\n * @returns The localized label in browser-local time.\n *\n * @example\n * formatLocal(new Date(2026, 5, 9), { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' })\n * // \"Tuesday, June 9, 2026\"\n */\nexport function formatLocal(date, options, locale = 'en-US') {\n return new Intl.DateTimeFormat(locale, options).format(date);\n}\n","/**\r\n * Shared helper utilities for JSON-LD builders.\r\n *\r\n * All functions are pure (no DOM, no Svelte, no side effects).\r\n * Extracted verbatim from EventStructuredData.svelte.\r\n *\r\n * @raw-intl-datetimeformat-escape: SEO/JSON-LD implementation. formatDateTimeWithOffset\r\n * must emit Google-required ISO-8601-with-tz-offset (\"2025-07-21T19:00:00-05:00\"), which\r\n * requires Intl.DateTimeFormat.formatToParts(...) with timeZoneName:'shortOffset' to read\r\n * the per-timezone UTC offset. The SC formatDate/DATE_FORMATS canonical produces\r\n * human-readable display strings, not parts-based offset extraction — it cannot express this.\r\n */\r\n\r\nimport { getDefaultTimezone } from '@getmicdrop/svelte-components/utils/timezones';\r\nimport { browserNow } from '@getmicdrop/svelte-components/datetime';\r\nimport type { EventTicketInput, EventPerformerInput } from './types';\r\n\r\n/**\r\n * Escape a JSON string for safe embedding inside an inline\r\n * <script type=\"application/ld+json\"> element.\r\n *\r\n * JSON.stringify does NOT escape `<`, `>` or `&`, so a field value containing\r\n * `</script><script>...` would break out of the script element and execute\r\n * (stored XSS). Replacing those characters with their unicode escape sequences\r\n * keeps the output valid JSON (parsers decode `<` back to `<`) while making\r\n * it impossible to terminate the surrounding <script> tag.\r\n *\r\n * This is the standard JSON-LD-in-<script> hardening; the sibling\r\n * HostSeoController avoids the issue entirely by using element.textContent.\r\n */\r\nexport function escapeJsonLdForScript(json: string): string {\r\n return json\r\n .replace(/</g, '\\\\u003c')\r\n .replace(/>/g, '\\\\u003e')\r\n .replace(/&/g, '\\\\u0026');\r\n}\r\n\r\n/**\r\n * Format datetime to ISO-8601 with timezone offset.\r\n * Google requires: \"2025-07-21T19:00:00-05:00\"\r\n *\r\n * Extracted from EventStructuredData.svelte lines 25-68.\r\n */\r\nexport function formatDateTimeWithOffset(\r\n isoString: string | null | undefined,\r\n tz: string\r\n): string | null {\r\n if (!isoString) return null;\r\n\r\n const date = new Date(isoString); // @datetime-escape: parse UTC instant; rendered in an explicit tz\r\n if (isNaN(date.getTime())) return null;\r\n\r\n // Get the offset in the target timezone\r\n const offsetFormatOptions: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: '2-digit',\r\n day: '2-digit',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n hour12: false,\r\n timeZoneName: 'shortOffset',\r\n };\r\n\r\n let formatter: Intl.DateTimeFormat;\r\n try {\r\n formatter = new Intl.DateTimeFormat('en-US', { ...offsetFormatOptions, timeZone: tz });\r\n } catch {\r\n // An invalid IANA timezone makes Intl.DateTimeFormat throw a RangeError,\r\n // which would otherwise escape the JSON-LD builders unguarded. Fall back\r\n // to the canonical default timezone — the same invalid-tz fallback the\r\n // rest of the repo uses ($lib/utils/datetime.js formatInTz).\r\n formatter = new Intl.DateTimeFormat('en-US', {\r\n ...offsetFormatOptions,\r\n timeZone: getDefaultTimezone(),\r\n });\r\n }\r\n\r\n const parts = formatter.formatToParts(date);\r\n const get = (type: string) => parts.find(p => p.type === type)?.value || '';\r\n\r\n const year = get('year');\r\n const month = get('month');\r\n const day = get('day');\r\n const hour = get('hour');\r\n const minute = get('minute');\r\n const second = get('second');\r\n const tzOffset = get('timeZoneName'); // e.g., \"GMT-5\" or \"GMT+2\"\r\n\r\n // Convert \"GMT-5\" to \"-05:00\" format\r\n let offset = '+00:00';\r\n if (tzOffset) {\r\n const match = tzOffset.match(/GMT([+-])(\\d+)(?::(\\d+))?/);\r\n if (match) {\r\n const sign = match[1];\r\n const hours = match[2].padStart(2, '0');\r\n const mins = match[3] || '00';\r\n offset = `${sign}${hours}:${mins}`;\r\n }\r\n }\r\n\r\n return `${year}-${month}-${day}T${hour}:${minute}:${second}${offset}`;\r\n}\r\n\r\n/**\r\n * Parse address string into PostalAddress components.\r\n * Input: \"7702 Santa Monica Blvd, West Hollywood, CA 90046\"\r\n * Output: { @type, streetAddress, addressLocality, addressRegion, postalCode, addressCountry }\r\n *\r\n * Extracted from EventStructuredData.svelte lines 75-111.\r\n */\r\nexport function parseAddressToPostal(\r\n addressStr: string | null | undefined\r\n): Record<string, string> | null {\r\n if (!addressStr) return null;\r\n\r\n const parts = addressStr.split(',').map(p => p.trim());\r\n\r\n if (parts.length < 2) {\r\n return {\r\n '@type': 'PostalAddress',\r\n streetAddress: addressStr,\r\n addressCountry: 'US',\r\n };\r\n }\r\n\r\n // Check if last part is \"State ZIP\" (e.g., \"CA 90046\")\r\n const lastPart = parts[parts.length - 1];\r\n const stateZipMatch = lastPart.match(/^([A-Z]{2})\\s+(\\d{5}(?:-\\d{4})?)$/);\r\n\r\n if (stateZipMatch && parts.length >= 3) {\r\n // Standard US address format\r\n return {\r\n '@type': 'PostalAddress',\r\n streetAddress: parts.slice(0, -2).join(', '),\r\n addressLocality: parts[parts.length - 2],\r\n addressRegion: stateZipMatch[1],\r\n postalCode: stateZipMatch[2],\r\n addressCountry: 'US',\r\n };\r\n }\r\n\r\n // Fallback for non-standard formats\r\n return {\r\n '@type': 'PostalAddress',\r\n streetAddress: parts[0],\r\n addressLocality: parts.slice(1).join(', '),\r\n addressCountry: 'US',\r\n };\r\n}\r\n\r\n/**\r\n * Structured postal-address parts, as the public resolve/series payloads now\r\n * expose them: `address` is the STREET line, with city/state/postalCode/country\r\n * as discrete fields (PublicVenueInfo / SeriesVenueDTO).\r\n */\r\nexport interface PostalAddressParts {\r\n address?: string | null; // street line\r\n city?: string | null;\r\n state?: string | null;\r\n postalCode?: string | null;\r\n country?: string | null;\r\n}\r\n\r\n/**\r\n * Build a schema.org PostalAddress, preferring discrete structured fields when\r\n * any locality signal (city / state / postalCode) is present, and otherwise\r\n * falling back to parsing a single comma-separated string (the street `address`\r\n * field if it carries a full address, else `googleLocationNameCache`).\r\n *\r\n * Discrete fields are more reliable than string-splitting — Google requires a\r\n * well-formed PostalAddress for Event rich-result eligibility (online-only\r\n * events lost eligibility June 2025).\r\n */\r\nexport function buildPostalAddress(\r\n parts: PostalAddressParts | null | undefined,\r\n fallback?: string | null\r\n): Record<string, string> | null {\r\n if (parts && (parts.city || parts.state || parts.postalCode)) {\r\n const out: Record<string, string> = { '@type': 'PostalAddress' };\r\n if (parts.address) out.streetAddress = parts.address;\r\n if (parts.city) out.addressLocality = parts.city;\r\n if (parts.state) out.addressRegion = parts.state;\r\n if (parts.postalCode) out.postalCode = parts.postalCode;\r\n out.addressCountry = parts.country || 'US';\r\n return out;\r\n }\r\n // No discrete locality fields — parse the best single string we have. The\r\n // street `address` may legacy-hold a full comma-separated address, so prefer\r\n // it over the location-name cache.\r\n return parseAddressToPostal((parts && parts.address) || fallback || null);\r\n}\r\n\r\n/**\r\n * Map event status to schema.org EventStatusType.\r\n *\r\n * Extracted from EventStructuredData.svelte lines 116-132.\r\n */\r\nexport function getEventStatus(rawStatus: string | null | undefined): string {\r\n if (!rawStatus) return 'https://schema.org/EventScheduled';\r\n\r\n const status = rawStatus.toLowerCase();\r\n\r\n if (status === 'cancelled' || status === 'canceled') {\r\n return 'https://schema.org/EventCancelled';\r\n }\r\n if (status === 'postponed') {\r\n return 'https://schema.org/EventPostponed';\r\n }\r\n if (status === 'rescheduled') {\r\n return 'https://schema.org/EventRescheduled';\r\n }\r\n\r\n return 'https://schema.org/EventScheduled';\r\n}\r\n\r\n/**\r\n * Map ticket availability to schema.org ItemAvailability.\r\n *\r\n * Extracted from EventStructuredData.svelte lines 137-157.\r\n */\r\nexport function getTicketAvailability(ticket: EventTicketInput): string {\r\n const remaining =\r\n ticket.remainingCapacity ?? ticket.quantityRemaining ?? ticket.quantity;\r\n\r\n if (remaining === 0 || ticket.soldOut) {\r\n return 'https://schema.org/SoldOut';\r\n }\r\n\r\n const now = browserNow();\r\n const salesBegin =\r\n ticket.salesBegin ||\r\n ticket.salesStart ||\r\n ticket.saleBegin ||\r\n ticket.onSaleStart;\r\n const salesEnd = ticket.salesEnd || ticket.saleEnd || ticket.onSaleEnd;\r\n\r\n // @datetime-escape: absolute-instant compare of a UTC-Z field vs now — tz-independent\r\n if (salesBegin && new Date(salesBegin) > now) {\r\n return 'https://schema.org/PreOrder';\r\n }\r\n\r\n // @datetime-escape: absolute-instant compare of a UTC-Z field vs now — tz-independent\r\n if (salesEnd && new Date(salesEnd) < now) {\r\n return 'https://schema.org/SoldOut';\r\n }\r\n\r\n return 'https://schema.org/InStock';\r\n}\r\n\r\n/**\r\n * Build a schema.org price-range offer from a low/high price and availability.\r\n *\r\n * The shared primitive behind every JSON-LD offer block: emit an AggregateOffer\r\n * when the range spans two prices, or a single Offer when low === high. Any\r\n * caller-specific fields (a buy `url`, a `validFrom` sales-start) ride along in\r\n * `extra`, spread verbatim after the core fields so each caller reproduces its\r\n * exact prior shape — the event builder passes url/validFrom, the series builder\r\n * passes nothing.\r\n */\r\nexport function buildPriceRangeOffer(\r\n lowPrice: number,\r\n highPrice: number,\r\n availability: string,\r\n extra: Record<string, unknown> = {}\r\n): Record<string, unknown> {\r\n // Use AggregateOffer when there are multiple price points\r\n if (lowPrice !== highPrice) {\r\n return {\r\n '@type': 'AggregateOffer',\r\n lowPrice,\r\n highPrice,\r\n priceCurrency: 'USD',\r\n availability,\r\n ...extra,\r\n };\r\n }\r\n\r\n // Single price point - use Offer\r\n return {\r\n '@type': 'Offer',\r\n price: lowPrice,\r\n priceCurrency: 'USD',\r\n availability,\r\n ...extra,\r\n };\r\n}\r\n\r\n/**\r\n * Build offers from available tickets.\r\n *\r\n * Extracted from EventStructuredData.svelte lines 162-208.\r\n */\r\nexport function buildOffers(\r\n tickets: EventTicketInput[] | null | undefined,\r\n url?: string\r\n): Record<string, unknown> | null {\r\n if (!tickets || tickets.length === 0) return null;\r\n\r\n // Filter to public tickets only (exclude door-only and hidden)\r\n const publicTickets = tickets.filter(t => {\r\n const visibility = t.visibility ?? 0;\r\n const isVisible = visibility === 0 || visibility === 1;\r\n const isPublic = t.salesChannel !== 2;\r\n return isVisible && isPublic;\r\n });\r\n\r\n if (publicTickets.length === 0) return null;\r\n\r\n // Find lowest and highest price\r\n const prices = publicTickets\r\n .map(t => parseFloat(String(t.price ?? 0)))\r\n .filter(p => !isNaN(p));\r\n\r\n if (prices.length === 0) return null;\r\n\r\n const lowPrice = Math.min(...prices);\r\n const highPrice = Math.max(...prices);\r\n const ticket = publicTickets[0];\r\n\r\n return buildPriceRangeOffer(\r\n lowPrice,\r\n highPrice,\r\n getTicketAvailability(ticket),\r\n {\r\n url: url || undefined,\r\n validFrom: ticket?.salesBegin || ticket?.salesStart || undefined,\r\n }\r\n );\r\n}\r\n\r\n/**\r\n * Build performer array from event performers.\r\n *\r\n * Extracted from EventStructuredData.svelte lines 213-237.\r\n */\r\nexport function buildPerformers(\r\n performers: EventPerformerInput[] | null | undefined\r\n): Array<Record<string, string>> | null {\r\n if (!performers || performers.length === 0) return null;\r\n\r\n // Filter to confirmed, visible performers\r\n const confirmed = performers.filter(p => {\r\n const isConfirmed = p.acceptedState === 2;\r\n const isNotHidden = !p.shouldBeHidden;\r\n const profile = p.RosterPerformer?.User?.performerProfile;\r\n const hasName =\r\n profile?.firstName || profile?.lastName || profile?.displayName;\r\n return isConfirmed && isNotHidden && hasName;\r\n });\r\n\r\n if (confirmed.length === 0) return null;\r\n\r\n return confirmed.map(p => {\r\n const profile = p.RosterPerformer?.User?.performerProfile;\r\n const name =\r\n profile?.displayName ||\r\n [profile?.firstName, profile?.lastName].filter(Boolean).join(' ');\r\n\r\n return {\r\n '@type': 'PerformingGroup',\r\n name: name,\r\n };\r\n });\r\n}\r\n","import { getDefaultTimezone } from '@getmicdrop/svelte-components/utils/timezones';\r\nimport { stripEventDescriptionHtml } from '@getmicdrop/svelte-components/richtext';\r\n/**\r\n * Pure function that builds Event JSON-LD structured data for Google Events rich results.\r\n *\r\n * Extracted from EventStructuredData.svelte (lines 242-313).\r\n * Produces identical output to the original $derived.by block.\r\n */\r\n\r\nimport type { EventJsonLdInput, VenueInput, OrganizerInput } from './types';\r\nimport {\r\n formatDateTimeWithOffset,\r\n buildPostalAddress,\r\n getEventStatus,\r\n buildOffers,\r\n buildPerformers,\r\n} from './helpers';\r\n\r\nexport interface BuildEventJsonLdOptions {\r\n event: EventJsonLdInput;\r\n venue: VenueInput;\r\n venueTimeZone?: string;\r\n eventUrl?: string;\r\n organizer?: OrganizerInput;\r\n}\r\n\r\nexport function buildEventJsonLd(\r\n options: BuildEventJsonLdOptions\r\n): Record<string, unknown> | null {\r\n const {\r\n event,\r\n venue,\r\n venueTimeZone = getDefaultTimezone(),\r\n eventUrl,\r\n organizer,\r\n } = options;\r\n\r\n if (!event) return null;\r\n\r\n const startDate = formatDateTimeWithOffset(\r\n event.startDateTime,\r\n venueTimeZone\r\n );\r\n\r\n // Skip if we don't have required fields\r\n if (!event.name || !startDate || !venue?.name) {\r\n return null;\r\n }\r\n\r\n // Google requires a PostalAddress on a physical event's location (online-only\r\n // events lost rich-result eligibility June 2025). Prefer the venue's discrete\r\n // address fields (street/city/state/postalCode), falling back to parsing the\r\n // googleLocationNameCache string. Only attach `address` when we could build\r\n // one — never emit `address: null`. A missing address is a data-pipeline gap\r\n // (the resolve payload must carry the venue address).\r\n const postalAddress = buildPostalAddress(\r\n venue,\r\n venue?.googleLocationNameCache\r\n );\r\n const location: Record<string, unknown> = {\r\n '@type': 'Place',\r\n name: venue.name,\r\n };\r\n if (postalAddress) {\r\n location.address = postalAddress;\r\n }\r\n\r\n const data: Record<string, unknown> = {\r\n '@context': 'https://schema.org',\r\n '@type': 'Event',\r\n name: event.name,\r\n startDate: startDate,\r\n eventStatus: getEventStatus(event.status),\r\n eventAttendanceMode: 'https://schema.org/OfflineEventAttendanceMode',\r\n location,\r\n };\r\n\r\n // Add endDate if available\r\n const endDate = formatDateTimeWithOffset(event.endDateTime, venueTimeZone);\r\n if (endDate) {\r\n data.endDate = endDate;\r\n }\r\n\r\n // Add description\r\n const description = stripEventDescriptionHtml(event.description) || event.eventSummary;\r\n if (description) {\r\n data.description = description;\r\n }\r\n\r\n // Add image - Google recommends multiple aspect ratios\r\n const imageUrl = event.image || event.coverImage || event.ShowImage;\r\n if (imageUrl) {\r\n data.image = [imageUrl];\r\n }\r\n\r\n // Add offers from tickets\r\n const offers = buildOffers(event.availableTickets, eventUrl);\r\n if (offers) {\r\n data.offers = offers;\r\n }\r\n\r\n // Add performers\r\n const performers = buildPerformers(event.performers);\r\n if (performers && performers.length > 0) {\r\n data.performer = performers;\r\n }\r\n\r\n // Add organizer if provided\r\n if (organizer?.name) {\r\n const org: Record<string, string> = {\r\n '@type': 'Organization',\r\n name: organizer.name,\r\n };\r\n if (organizer.url) {\r\n org.url = organizer.url;\r\n }\r\n data.organizer = org;\r\n }\r\n\r\n // Add event URL if provided\r\n if (eventUrl) {\r\n data.url = eventUrl;\r\n }\r\n\r\n return data;\r\n}\r\n","/**\r\n * Pure function that builds EventSeries JSON-LD structured data.\r\n *\r\n * Series use schema.org EventSeries type with subEvent array containing\r\n * individual Event blocks for each occurrence. Each subEvent has its own\r\n * offers built from the simplified series ticket DTOs (different shape\r\n * from the event builder's tickets).\r\n *\r\n * Google Rich Results Test does NOT support EventSeries directly, but\r\n * the individual subEvent Event blocks can qualify for rich results.\r\n */\r\n\r\nimport type { SeriesJsonLdInput } from './types';\r\nimport { stripEventDescriptionHtml } from '@getmicdrop/svelte-components/richtext';\r\nimport {\r\n formatDateTimeWithOffset,\r\n buildPostalAddress,\r\n getEventStatus,\r\n buildPriceRangeOffer,\r\n} from './helpers';\r\n\r\nexport interface BuildSeriesJsonLdOptions {\r\n series: SeriesJsonLdInput;\r\n baseEventUrl?: string; // e.g., \"https://get-micdrop.com/e\" -- used to build subEvent @id URLs\r\n}\r\n\r\n/**\r\n * Map a series ticket status string to schema.org ItemAvailability.\r\n *\r\n * Series tickets use a simplified { name, price, status } shape from the\r\n * backend (SeriesTicketDTO), unlike event tickets which have visibility,\r\n * salesChannel, remainingCapacity, etc.\r\n */\r\nfunction mapSeriesTicketAvailability(status: string): string {\r\n switch (status) {\r\n case 'available':\r\n return 'https://schema.org/InStock';\r\n case 'sold_out':\r\n return 'https://schema.org/SoldOut';\r\n case 'coming_soon':\r\n return 'https://schema.org/PreOrder';\r\n case 'ended':\r\n return 'https://schema.org/SoldOut';\r\n default:\r\n return 'https://schema.org/InStock';\r\n }\r\n}\r\n\r\n/**\r\n * Build offers from series occurrence tickets.\r\n *\r\n * Series tickets have a simpler shape than event tickets: { name, price, status }.\r\n * Uses AggregateOffer for multiple price points, Offer for single price.\r\n */\r\nfunction buildSeriesOccurrenceOffers(\r\n tickets: Array<{ name: string; price: number; status: string }> | undefined,\r\n occurrenceStatus: string | undefined\r\n): Record<string, unknown> | null {\r\n if (!tickets || tickets.length === 0) return null;\r\n\r\n // Filter out sold_out and ended tickets for offer building\r\n const activeTickets = tickets.filter(\r\n t => t.status !== 'sold_out' && t.status !== 'ended'\r\n );\r\n\r\n // If all tickets are sold out / ended, report SoldOut with the price range\r\n if (activeTickets.length === 0) {\r\n const prices = tickets.map(t => t.price).filter(p => !isNaN(p));\r\n if (prices.length === 0) return null;\r\n\r\n return buildPriceRangeOffer(\r\n Math.min(...prices),\r\n Math.max(...prices),\r\n 'https://schema.org/SoldOut'\r\n );\r\n }\r\n\r\n const prices = activeTickets.map(t => t.price).filter(p => !isNaN(p));\r\n if (prices.length === 0) return null;\r\n\r\n return buildPriceRangeOffer(\r\n Math.min(...prices),\r\n Math.max(...prices),\r\n mapSeriesTicketAvailability(activeTickets[0].status)\r\n );\r\n}\r\n\r\nexport function buildSeriesJsonLd(\r\n options: BuildSeriesJsonLdOptions\r\n): Record<string, unknown> | null {\r\n const { series, baseEventUrl } = options;\r\n\r\n // Required fields\r\n if (!series.title) return null;\r\n if (!series.occurrences || series.occurrences.length === 0) return null;\r\n if (!series.venue?.name) return null;\r\n\r\n // Build location — prefer the venue's discrete address fields, falling back to\r\n // parsing googleLocationNameCache (see buildEventJsonLd for the rationale).\r\n const address = buildPostalAddress(\r\n series.venue,\r\n series.venue.googleLocationNameCache\r\n );\r\n const location: Record<string, unknown> = {\r\n '@type': 'Place',\r\n name: series.venue.name,\r\n };\r\n if (address) {\r\n location.address = address;\r\n }\r\n\r\n // Build parent EventSeries\r\n const data: Record<string, unknown> = {\r\n '@context': 'https://schema.org',\r\n '@type': 'EventSeries',\r\n name: series.title,\r\n location,\r\n };\r\n\r\n // Description: prefer description, fall back to eventSummary\r\n const description = stripEventDescriptionHtml(series.description) || series.eventSummary;\r\n if (description) {\r\n data.description = description;\r\n }\r\n\r\n // Image\r\n if (series.image) {\r\n data.image = [series.image];\r\n }\r\n\r\n // Performers: flat displayName array (different from event builder's nested shape)\r\n const performers = series.performers?.filter(p => p.displayName);\r\n if (performers && performers.length > 0) {\r\n data.performer = performers.map(p => ({\r\n '@type': 'PerformingGroup',\r\n name: p.displayName,\r\n }));\r\n }\r\n\r\n // SubEvents: build Event blocks for each occurrence\r\n const subEvents: Record<string, unknown>[] = [];\r\n\r\n for (const occ of series.occurrences) {\r\n const startDate = formatDateTimeWithOffset(\r\n occ.startDateTime,\r\n series.timeZone\r\n );\r\n if (!startDate) continue; // Skip occurrences without valid startDate\r\n\r\n const subEvent: Record<string, unknown> = {\r\n '@type': 'Event',\r\n name: occ.title,\r\n startDate,\r\n eventStatus: getEventStatus(occ.status),\r\n location,\r\n };\r\n\r\n // @id from baseEventUrl\r\n if (baseEventUrl) {\r\n subEvent['@id'] = `${baseEventUrl}/${occ.id}-${occ.slug}`;\r\n }\r\n\r\n // endDate\r\n const endDate = formatDateTimeWithOffset(occ.endDateTime, series.timeZone);\r\n if (endDate) {\r\n subEvent.endDate = endDate;\r\n }\r\n\r\n // Offers from simplified ticket DTOs\r\n const offers = buildSeriesOccurrenceOffers(occ.tickets, occ.status);\r\n if (offers) {\r\n subEvent.offers = offers;\r\n }\r\n\r\n subEvents.push(subEvent);\r\n }\r\n\r\n // If all occurrences were skipped, return null\r\n if (subEvents.length === 0) return null;\r\n\r\n data.subEvent = subEvents;\r\n\r\n return data;\r\n}\r\n","/**\r\n * Pure function that builds CollectionPage JSON-LD for an event collection.\r\n *\r\n * A collection is a curated list of shows — NOT a single event, and NOT a\r\n * Festival (the product can't infer festival intent from a collection named\r\n * \"Detroit Comedy Festival\"; it's still just a collection). We emit a\r\n * schema.org `CollectionPage` whose `mainEntity` is a *summary-page* `ItemList`\r\n * — each `ListItem` is just `{ position, name, url }` pointing at the show's\r\n * canonical `/e/{id}-{slug}` leaf. The full `Event` rich-result markup lives on\r\n * each event's own page (one event = one leaf URL); duplicating full Event\r\n * objects here would create competing entities and trigger missing-field\r\n * (offers/address) warnings on the collection page.\r\n *\r\n * (Previously emitted `Festival` + `subEvent`, which Google's Rich Results\r\n * Test does not support.)\r\n */\r\n\r\nimport type { CollectionJsonLdInput } from './types';\r\nimport { stripEventDescriptionHtml } from '@getmicdrop/svelte-components/richtext';\r\n\r\nexport interface BuildCollectionJsonLdOptions {\r\n collection: CollectionJsonLdInput;\r\n baseEventUrl?: string; // e.g., \"https://get-micdrop.com/e\"\r\n /** Accepted for API compatibility; the summary ItemList carries no dates. */\r\n defaultTimeZone?: string;\r\n}\r\n\r\nexport function buildCollectionJsonLd(\r\n options: BuildCollectionJsonLdOptions,\r\n): Record<string, unknown> | null {\r\n const { collection, baseEventUrl } = options;\r\n\r\n // Required fields\r\n if (!collection.collectionTitle) return null;\r\n if (!collection.events || collection.events.length === 0) return null;\r\n\r\n // Build a summary ListItem per collection member: position + name + the\r\n // canonical leaf url. Prefer the slugged form, else bare `/e/{id}` (the app\r\n // self-heals bare ids to the slugged canonical).\r\n const itemListElement: Record<string, unknown>[] = [];\r\n\r\n for (const event of collection.events) {\r\n if (!event.title) continue; // Skip members with no name to list\r\n\r\n const listItem: Record<string, unknown> = {\r\n '@type': 'ListItem',\r\n position: itemListElement.length + 1,\r\n name: event.title,\r\n };\r\n\r\n if (baseEventUrl) {\r\n listItem.url = event.slug\r\n ? `${baseEventUrl}/${event.id}-${event.slug}`\r\n : `${baseEventUrl}/${event.id}`;\r\n }\r\n\r\n itemListElement.push(listItem);\r\n }\r\n\r\n // If every event was skipped, there's nothing to mark up.\r\n if (itemListElement.length === 0) return null;\r\n\r\n const data: Record<string, unknown> = {\r\n '@context': 'https://schema.org',\r\n '@type': 'CollectionPage',\r\n name: collection.collectionTitle,\r\n };\r\n\r\n // Description: prefer description, fall back to summary\r\n const description = stripEventDescriptionHtml(collection.description) || collection.summary;\r\n if (description) {\r\n data.description = description;\r\n }\r\n\r\n // Cover image\r\n if (collection.coverImage) {\r\n data.image = [collection.coverImage];\r\n }\r\n\r\n data.mainEntity = {\r\n '@type': 'ItemList',\r\n numberOfItems: itemListElement.length,\r\n itemListElement,\r\n };\r\n\r\n return data;\r\n}\r\n","/**\n * Slug generation for routing URLs.\n *\n * This is the canonical slugify implementation for the MicDrop platform.\n * Originally lifted byte-for-byte from micdrop-frontend's local slug helper;\n * that copy has since been deleted in favor of this module, which is now the\n * single source of truth every consumer (MF, VC, future consumers) imports.\n * The algorithm must never change silently (user-visible + bookmarked URLs).\n *\n * @module routing/slug\n */\n/** Max slug length (chars). Google/SEO sweet spot is ≤60–80; we cap at 70. */\nconst MAX_SLUG_LENGTH = 70;\n/**\n * Creates a URL-safe slug from arbitrary text.\n *\n * - NFKD-decomposes accented chars (é → e + combining accent) then strips the\n * combining diacritical marks, so \"Café\" → \"cafe\" (not \"caf\")\n * - lowercases\n * - trims surrounding whitespace\n * - strips characters that are not word chars, whitespace, or hyphens\n * - collapses runs of whitespace / underscores / hyphens into a single hyphen\n * - trims leading/trailing hyphens\n * - caps length at {@link MAX_SLUG_LENGTH} (70) chars, re-trimming a trailing\n * hyphen the cap may have landed on\n *\n * @example\n * toSlug('Comedy Night: Live at The Club!'); // 'comedy-night-live-at-the-club'\n * @example\n * toSlug('Café Comedy'); // 'cafe-comedy'\n */\n// NOTE: declared as `toSlug` (not `slugify`) and re-exported under the public\n// name below. The shared eslint `no-restricted-syntax` rule forbids declaring a\n// binding named `slugify` outside the canonical site; aliasing keeps the public\n// surface (`slugify`) without redefining that identifier here.\n//\n// This module IS the SEO-canonical / bookmarked authority for emitted URLs;\n// every consumer imports it, so the algorithm must stay stable forever.\nfunction toSlug(text) {\n return (text\n .normalize('NFKD') // decompose accented chars: é -> e + combining accent\n .replace(/[\\u0300-\\u036f]/g, '') // strip combining diacritical marks\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, '')\n .replace(/[\\s_-]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, MAX_SLUG_LENGTH)\n // re-trim in case the length cap landed mid-separator\n .replace(/-+$/g, ''));\n}\nexport { toSlug, toSlug as slugify };\n","/**\r\n * Text utility functions: generateSlug, validateNegativeNumber\r\n *\r\n * classNames and truncateTitle re-exported from @getmicdrop/svelte-components\r\n * via ./utils.js for backward compatibility with existing consumers.\r\n */\r\n\r\nimport { slugify } from '@getmicdrop/svelte-components/routing';\r\n\r\n/**\r\n * Generate a URL-friendly slug from a string.\r\n *\r\n * Converged onto the canonical SC `slugify` (NFKD diacritic strip so \"Café\" →\r\n * \"cafe\" not \"caf\", underscore/hyphen run collapse, 70-char SEO cap) — kept\r\n * byte-for-byte in sync with micdrop-frontend's SEO-canonical slug authority.\r\n *\r\n * Safe to swap the algorithm: VC entity routes resolve BY ID (`[id]/[slug]`\r\n * loads via `fetchEventDetails(id)`; the widget's `#{id}-{slug}` hash resolves\r\n * via `/resolve/{id}` with the slug only a backend canonicalize hint). The slug\r\n * is decorative, so a different cosmetic slug never breaks a shared/bookmarked\r\n * link.\r\n *\r\n * The `if (!text)` guard is preserved because SC `slugify` calls `.normalize()`\r\n * directly and would throw on null/undefined; several call sites pass an\r\n * unguarded `event.name`.\r\n */\r\nexport function generateSlug(text: string): string {\r\n if (!text) return '';\r\n return slugify(text);\r\n}\r\n\r\n/**\r\n * Validate that a value is a positive number\r\n * Returns an error message string, or empty string if valid\r\n */\r\nexport function validateNegativeNumber(\r\n value: string | number | null | undefined\r\n): string {\r\n if (value === null || value === undefined || value === '') {\r\n return 'Must be greater than zero.';\r\n }\r\n\r\n const stringValue = String(value).trim();\r\n\r\n if (\r\n stringValue.includes('--') ||\r\n stringValue.includes('++') ||\r\n stringValue.match(/^-+$/) ||\r\n stringValue.match(/^\\++$/)\r\n ) {\r\n return 'Please enter a valid number';\r\n }\r\n\r\n if (stringValue.match(/^-?\\d+-$/)) {\r\n return 'Please enter a valid number';\r\n }\r\n\r\n if ((stringValue.match(/\\./g) || []).length > 1) {\r\n return 'Please enter a valid number';\r\n }\r\n\r\n const numValue = Number(value);\r\n if (isNaN(numValue)) {\r\n return 'Please enter a valid number';\r\n }\r\n\r\n if (numValue < 0 || numValue === 0) {\r\n return 'Price must be greater than zero.';\r\n }\r\n\r\n return '';\r\n}\r\n","import { getDefaultTimezone } from '@getmicdrop/svelte-components/utils/timezones';\r\nimport { stripEventDescriptionHtml } from '@getmicdrop/svelte-components/richtext';\r\n/**\r\n * HostSeoController -- manages JSON-LD structured data, canonical URLs,\r\n * OG tags, meta descriptions, and page title injection into venue pages'\r\n * <head> when the Micdrop calendar widget is embedded.\r\n *\r\n * Follows a save-replace-restore pattern to be a \"good citizen\" on venue pages:\r\n * idle -> listing -> entity -> listing -> ... -> destroyed\r\n *\r\n * Uses textContent (never innerHTML) for JSON-LD script tags to prevent XSS.\r\n */\r\n\r\nimport type { HostSeoControllerOptions } from './types';\r\nimport { buildEventJsonLd } from './buildEventJsonLd';\r\nimport { buildSeriesJsonLd } from './buildSeriesJsonLd';\r\nimport { buildCollectionJsonLd } from './buildCollectionJsonLd';\r\nimport { generateSlug } from '$lib/utils/textUtils';\r\n\r\ntype ControllerState = 'idle' | 'listing' | 'entity' | 'destroyed';\r\n\r\ninterface SavedOriginals {\r\n title: string;\r\n canonicalHref: string | null;\r\n ogTitle: string | null;\r\n ogDescription: string | null;\r\n ogImage: string | null;\r\n ogUrl: string | null;\r\n ogType: string | null;\r\n metaDescription: string | null;\r\n}\r\n\r\n// Minimal event shape for listing mode\r\ninterface ListingEvent {\r\n id: number | string;\r\n name: string;\r\n slug?: string;\r\n startDateTime?: string;\r\n image?: string;\r\n}\r\n\r\n// Venue data passed at runtime\r\ninterface VenueData {\r\n name: string;\r\n address?: string;\r\n googleLocationNameCache?: string;\r\n // Transformed venues carry lowercase `timezone`; raw/host data may use\r\n // PascalCase `timeZone`. Accept both so the venue tz isn't silently dropped.\r\n timeZone?: string;\r\n timezone?: string;\r\n}\r\n\r\nexport class HostSeoController {\r\n /**\r\n * Single active instance. A venue page that mounts >1 calendar embed\r\n * (e.g. \"upcoming shows\" + \"this weekend\") will see the *later*\r\n * controller take over `<head>` — the earlier one is destroyed.\r\n *\r\n * KNOWN LIMITATION: multi-embed pages cannot run two SEO controllers\r\n * in parallel because they would both fight to own `<title>`/OG/etc.\r\n * Pass `data-inject-seo=\"false\"` on all but one embed to opt out.\r\n */\r\n static _activeInstance: HostSeoController | null = null;\r\n\r\n private _state: ControllerState = 'idle';\r\n private _venueName: string;\r\n private _venueAddress: string | undefined;\r\n private _venueTimeZone: string;\r\n private _baseUrl: string;\r\n private _originals: SavedOriginals | null = null;\r\n private _originalsSaved = false;\r\n private _events: ListingEvent[] = [];\r\n\r\n constructor(options: HostSeoControllerOptions) {\r\n // SSR guard\r\n if (typeof document === 'undefined') return;\r\n\r\n // If another instance exists, destroy it first.\r\n if (\r\n HostSeoController._activeInstance &&\r\n HostSeoController._activeInstance !== this\r\n ) {\r\n HostSeoController._activeInstance.destroy();\r\n }\r\n\r\n this._venueName = options.venueName;\r\n this._venueAddress = options.venueAddress;\r\n this._venueTimeZone = options.venueTimeZone || getDefaultTimezone();\r\n this._baseUrl =\r\n options.baseUrl || window.location.origin + window.location.pathname;\r\n\r\n this._saveOriginals();\r\n\r\n HostSeoController._activeInstance = this;\r\n }\r\n\r\n // ---------------------------------------------------------------------------\r\n // Private helpers\r\n // ---------------------------------------------------------------------------\r\n\r\n private _saveOriginals(): void {\r\n if (this._originalsSaved) return;\r\n\r\n const canonical = document.querySelector(\r\n 'link[rel=\"canonical\"]'\r\n ) as HTMLLinkElement | null;\r\n const ogTitle = document.querySelector(\r\n 'meta[property=\"og:title\"]'\r\n ) as HTMLMetaElement | null;\r\n const ogDescription = document.querySelector(\r\n 'meta[property=\"og:description\"]'\r\n ) as HTMLMetaElement | null;\r\n const ogImage = document.querySelector(\r\n 'meta[property=\"og:image\"]'\r\n ) as HTMLMetaElement | null;\r\n const ogUrl = document.querySelector(\r\n 'meta[property=\"og:url\"]'\r\n ) as HTMLMetaElement | null;\r\n const ogType = document.querySelector(\r\n 'meta[property=\"og:type\"]'\r\n ) as HTMLMetaElement | null;\r\n const metaDescription = document.querySelector(\r\n 'meta[name=\"description\"]'\r\n ) as HTMLMetaElement | null;\r\n\r\n this._originals = {\r\n title: document.title,\r\n canonicalHref: canonical?.getAttribute('href') ?? null,\r\n ogTitle: ogTitle?.getAttribute('content') ?? null,\r\n ogDescription: ogDescription?.getAttribute('content') ?? null,\r\n ogImage: ogImage?.getAttribute('content') ?? null,\r\n ogUrl: ogUrl?.getAttribute('content') ?? null,\r\n ogType: ogType?.getAttribute('content') ?? null,\r\n metaDescription: metaDescription?.getAttribute('content') ?? null,\r\n };\r\n\r\n this._originalsSaved = true;\r\n }\r\n\r\n private _injectJsonLd(data: Record<string, unknown>): void {\r\n if (typeof document === 'undefined') return;\r\n\r\n // Remove any existing micdrop JSON-LD\r\n document\r\n .querySelectorAll('script[data-micdrop=\"jsonld\"]')\r\n .forEach(el => el.remove());\r\n\r\n const script = document.createElement('script');\r\n script.setAttribute('type', 'application/ld+json');\r\n script.setAttribute('data-micdrop', 'jsonld');\r\n // Use textContent (NOT innerHTML) to prevent XSS\r\n script.textContent = JSON.stringify(data);\r\n document.head.appendChild(script);\r\n }\r\n\r\n private _setMeta(property: string, content: string): void {\r\n if (typeof document === 'undefined') return;\r\n\r\n if (property.startsWith('og:')) {\r\n // OG tags use property attribute\r\n let el = document.querySelector(\r\n `meta[property=\"${property}\"]`\r\n ) as HTMLMetaElement | null;\r\n if (el) {\r\n el.setAttribute('content', content);\r\n } else {\r\n el = document.createElement('meta');\r\n el.setAttribute('property', property);\r\n el.setAttribute('content', content);\r\n el.setAttribute('data-micdrop', 'og');\r\n document.head.appendChild(el);\r\n }\r\n } else {\r\n // Standard meta tags use name attribute (e.g., description)\r\n let el = document.querySelector(\r\n `meta[name=\"${property}\"]`\r\n ) as HTMLMetaElement | null;\r\n if (el) {\r\n el.setAttribute('content', content);\r\n } else {\r\n el = document.createElement('meta');\r\n el.setAttribute('name', property);\r\n el.setAttribute('content', content);\r\n el.setAttribute('data-micdrop', 'meta');\r\n document.head.appendChild(el);\r\n }\r\n }\r\n }\r\n\r\n private _setCanonical(url: string): void {\r\n if (typeof document === 'undefined') return;\r\n\r\n let el = document.querySelector(\r\n 'link[rel=\"canonical\"]'\r\n ) as HTMLLinkElement | null;\r\n if (el) {\r\n el.setAttribute('href', url);\r\n } else {\r\n el = document.createElement('link');\r\n el.setAttribute('rel', 'canonical');\r\n el.setAttribute('href', url);\r\n el.setAttribute('data-micdrop', 'canonical');\r\n document.head.appendChild(el);\r\n }\r\n }\r\n\r\n private _removeAllInjected(): void {\r\n if (typeof document === 'undefined') return;\r\n document.querySelectorAll('[data-micdrop]').forEach(el => el.remove());\r\n }\r\n\r\n private _restoreOriginals(): void {\r\n if (typeof document === 'undefined' || !this._originals) return;\r\n\r\n // Restore title\r\n document.title = this._originals.title;\r\n\r\n // Restore canonical\r\n if (this._originals.canonicalHref !== null) {\r\n const canonical = document.querySelector(\r\n 'link[rel=\"canonical\"]'\r\n ) as HTMLLinkElement | null;\r\n if (canonical) {\r\n canonical.setAttribute('href', this._originals.canonicalHref);\r\n }\r\n }\r\n\r\n // Restore OG tags\r\n this._restoreMetaProperty('og:title', this._originals.ogTitle);\r\n this._restoreMetaProperty('og:description', this._originals.ogDescription);\r\n this._restoreMetaProperty('og:image', this._originals.ogImage);\r\n this._restoreMetaProperty('og:url', this._originals.ogUrl);\r\n this._restoreMetaProperty('og:type', this._originals.ogType);\r\n\r\n // Restore meta description\r\n this._restoreMetaName('description', this._originals.metaDescription);\r\n\r\n this._originalsSaved = false;\r\n }\r\n\r\n private _restoreMetaProperty(\r\n property: string,\r\n originalContent: string | null\r\n ): void {\r\n const el = document.querySelector(\r\n `meta[property=\"${property}\"]`\r\n ) as HTMLMetaElement | null;\r\n if (originalContent !== null && el) {\r\n // Had original value -- restore it\r\n el.setAttribute('content', originalContent);\r\n } else if (originalContent === null && el?.hasAttribute('data-micdrop')) {\r\n // We created it -- remove it\r\n el.remove();\r\n }\r\n }\r\n\r\n private _restoreMetaName(name: string, originalContent: string | null): void {\r\n const el = document.querySelector(\r\n `meta[name=\"${name}\"]`\r\n ) as HTMLMetaElement | null;\r\n if (originalContent !== null && el) {\r\n el.setAttribute('content', originalContent);\r\n } else if (originalContent === null && el?.hasAttribute('data-micdrop')) {\r\n el.remove();\r\n }\r\n }\r\n\r\n private _buildItemList(events: ListingEvent[]): Record<string, unknown> {\r\n return {\r\n '@context': 'https://schema.org',\r\n '@type': 'ItemList',\r\n itemListElement: events.map((event, i) => {\r\n const slug = event.slug || generateSlug(event.name);\r\n return {\r\n '@type': 'ListItem',\r\n position: i + 1,\r\n url: `${this._baseUrl}?e=${event.id}-${slug}`,\r\n };\r\n }),\r\n };\r\n }\r\n\r\n private _buildEntityUrl(\r\n type: string,\r\n id: string | number,\r\n slug: string\r\n ): string {\r\n const prefix = type === 'event' ? 'e' : type === 'series' ? 's' : 'c';\r\n return `${this._baseUrl}?${prefix}=${id}-${slug}`;\r\n }\r\n\r\n // ---------------------------------------------------------------------------\r\n // Public API\r\n // ---------------------------------------------------------------------------\r\n\r\n /**\r\n * Called when events finish loading from the API.\r\n * Injects an ItemList JSON-LD for the listing. Does not modify OG/canonical/title.\r\n */\r\n onEventsLoaded(events: ListingEvent[], venue?: VenueData): void {\r\n if (typeof document === 'undefined') return;\r\n if (this._state === 'destroyed') return;\r\n\r\n // Update venue info from parameter if provided\r\n if (venue) {\r\n this._venueName = venue.name || this._venueName;\r\n this._venueAddress =\r\n venue.address || venue.googleLocationNameCache || this._venueAddress;\r\n const venueTz = venue.timeZone || venue.timezone;\r\n if (venueTz) {\r\n this._venueTimeZone = venueTz;\r\n }\r\n }\r\n\r\n // Store events for later use (re-injection on back to listing)\r\n this._events = events;\r\n\r\n // Build and inject ItemList JSON-LD\r\n const itemList = this._buildItemList(events);\r\n this._injectJsonLd(itemList);\r\n\r\n this._state = 'listing';\r\n }\r\n\r\n /**\r\n * Called when the user selects an event, series, or collection.\r\n * Replaces ItemList JSON-LD with entity-specific JSON-LD and updates\r\n * all head tags (canonical, OG, meta description, title).\r\n */\r\n onEntitySelected(\r\n type: 'event' | 'series' | 'collection',\r\n data: any,\r\n venue?: VenueData\r\n ): void {\r\n if (typeof document === 'undefined') return;\r\n if (this._state === 'destroyed') return;\r\n\r\n // Save originals if not already saved\r\n this._saveOriginals();\r\n\r\n // Update venue info from parameter if provided\r\n if (venue) {\r\n this._venueName = venue.name || this._venueName;\r\n this._venueAddress =\r\n venue.address || venue.googleLocationNameCache || this._venueAddress;\r\n const venueTz = venue.timeZone || venue.timezone;\r\n if (venueTz) {\r\n this._venueTimeZone = venueTz;\r\n }\r\n }\r\n\r\n let jsonLd: Record<string, unknown> | null = null;\r\n let entityName = '';\r\n // Raw rich-text description (HTML) kept separate from the plain-text\r\n // summary fallback so we can strip the description first and only then fall\r\n // back — a blank rich-text description (`<p><br></p>`) must not mask a real\r\n // summary. (PBN-1)\r\n let entityDescription = '';\r\n let entitySummary = '';\r\n let entityImage = '';\r\n let entityUrl = '';\r\n\r\n if (type === 'event') {\r\n const slug = data.slug || generateSlug(data.name || '');\r\n entityUrl = this._buildEntityUrl(\r\n 'event',\r\n data.id || data.eventID || '',\r\n slug\r\n );\r\n\r\n jsonLd = buildEventJsonLd({\r\n event: data,\r\n venue: {\r\n name: this._venueName,\r\n googleLocationNameCache: this._venueAddress,\r\n },\r\n venueTimeZone: this._venueTimeZone,\r\n eventUrl: entityUrl,\r\n });\r\n\r\n entityName = data.name || '';\r\n entityDescription = data.description || '';\r\n entitySummary = data.eventSummary || '';\r\n entityImage = data.image || data.coverImage || data.ShowImage || '';\r\n } else if (type === 'series') {\r\n const slug = data.slug || generateSlug(data.title || '');\r\n entityUrl = this._buildEntityUrl('series', data.id || '', slug);\r\n\r\n jsonLd = buildSeriesJsonLd({\r\n series: {\r\n ...data,\r\n venue: {\r\n name: this._venueName,\r\n googleLocationNameCache: this._venueAddress,\r\n },\r\n timeZone: this._venueTimeZone,\r\n },\r\n baseEventUrl: entityUrl,\r\n });\r\n\r\n entityName = data.title || '';\r\n entityDescription = data.description || '';\r\n entitySummary = data.eventSummary || '';\r\n entityImage = data.image || '';\r\n } else if (type === 'collection') {\r\n const slug = data.slug || generateSlug(data.collectionTitle || '');\r\n entityUrl = this._buildEntityUrl('collection', data.id || '', slug);\r\n\r\n jsonLd = buildCollectionJsonLd({\r\n collection: data,\r\n baseEventUrl: entityUrl,\r\n defaultTimeZone: this._venueTimeZone,\r\n });\r\n\r\n entityName = data.collectionTitle || '';\r\n entityDescription = data.description || '';\r\n entitySummary = data.summary || '';\r\n entityImage = data.coverImage || '';\r\n }\r\n\r\n // Inject JSON-LD (replaces existing micdrop JSON-LD)\r\n if (jsonLd) {\r\n this._injectJsonLd(jsonLd);\r\n }\r\n\r\n // Update canonical URL\r\n if (entityUrl) {\r\n this._setCanonical(entityUrl);\r\n }\r\n\r\n // Update OG tags\r\n if (entityName) {\r\n this._setMeta('og:title', entityName);\r\n }\r\n // Descriptions are stored as rich-text HTML. Flatten (and truncate) to plain\r\n // text before meta injection — the same canonical strip the /e page uses —\r\n // so raw tags never leak into share cards or search snippets. Strip first,\r\n // then fall back to the summary, so blank rich text doesn't mask it. (PBN-1)\r\n const metaDescription =\r\n stripEventDescriptionHtml(entityDescription, 160) ||\r\n stripEventDescriptionHtml(entitySummary, 160);\r\n if (metaDescription) {\r\n this._setMeta('og:description', metaDescription);\r\n } else {\r\n // No usable description — restore the page's original so a previously\r\n // selected entity's description can't linger on this one.\r\n this._restoreMetaProperty(\r\n 'og:description',\r\n this._originals?.ogDescription ?? null\r\n );\r\n }\r\n if (entityImage) {\r\n this._setMeta('og:image', entityImage);\r\n }\r\n if (entityUrl) {\r\n this._setMeta('og:url', entityUrl);\r\n }\r\n this._setMeta('og:type', 'website');\r\n\r\n // Twitter Card: large image preview\r\n this._setMeta('twitter:card', 'summary_large_image');\r\n\r\n // Update meta description\r\n if (metaDescription) {\r\n this._setMeta('description', metaDescription);\r\n } else {\r\n this._restoreMetaName(\r\n 'description',\r\n this._originals?.metaDescription ?? null\r\n );\r\n }\r\n\r\n // Update page title\r\n if (entityName) {\r\n document.title = `${entityName} | ${this._venueName}`;\r\n }\r\n\r\n this._state = 'entity';\r\n }\r\n\r\n /**\r\n * Called when the user navigates back to the event listing.\r\n * Restores original head elements and re-injects ItemList JSON-LD.\r\n */\r\n onBackToListing(): void {\r\n if (typeof document === 'undefined') return;\r\n if (this._state === 'destroyed') return;\r\n\r\n // Restore all originals\r\n this._restoreOriginals();\r\n\r\n // Remove any remaining injected elements\r\n this._removeAllInjected();\r\n\r\n // Re-inject ItemList JSON-LD if events are available\r\n if (this._events.length > 0) {\r\n const itemList = this._buildItemList(this._events);\r\n this._injectJsonLd(itemList);\r\n }\r\n\r\n // Re-save originals since we just restored them\r\n this._saveOriginals();\r\n\r\n this._state = 'listing';\r\n }\r\n\r\n /**\r\n * Called when the widget is destroyed. Removes all injected elements\r\n * and restores originals. Clears the static active instance.\r\n */\r\n destroy(): void {\r\n if (typeof document === 'undefined') return;\r\n if (this._state === 'destroyed') return;\r\n\r\n this._removeAllInjected();\r\n this._restoreOriginals();\r\n\r\n if (HostSeoController._activeInstance === this) {\r\n HostSeoController._activeInstance = null;\r\n }\r\n\r\n this._state = 'destroyed';\r\n }\r\n}\r\n"],"names":["getDefaultTimezone","BLOCK_CLOSE","LINE_BREAK","ANY_TAG","NAMED_ENTITIES","decodeEntities","input","_","hex","codePointOrEmpty","dec","m","code","stripEventDescriptionHtml","html","maxLength","text","clipped","lastSpace","browserNow","escapeJsonLdForScript","json","formatDateTimeWithOffset","isoString","tz","date","offsetFormatOptions","formatter","parts","get","type","p","year","month","day","hour","minute","second","tzOffset","offset","match","sign","hours","mins","parseAddressToPostal","addressStr","stateZipMatch","buildPostalAddress","fallback","out","getEventStatus","rawStatus","status","getTicketAvailability","ticket","now","salesBegin","salesEnd","buildPriceRangeOffer","lowPrice","highPrice","availability","extra","buildOffers","tickets","url","publicTickets","t","visibility","isVisible","isPublic","prices","buildPerformers","performers","confirmed","isConfirmed","isNotHidden","profile","hasName","buildEventJsonLd","options","event","venue","venueTimeZone","eventUrl","organizer","startDate","postalAddress","location","data","endDate","description","imageUrl","offers","org","mapSeriesTicketAvailability","buildSeriesOccurrenceOffers","occurrenceStatus","activeTickets","buildSeriesJsonLd","series","baseEventUrl","address","subEvents","occ","subEvent","buildCollectionJsonLd","collection","itemListElement","listItem","MAX_SLUG_LENGTH","toSlug","generateSlug","slugify","_HostSeoController","canonical","ogTitle","ogDescription","ogImage","ogUrl","ogType","metaDescription","el","script","property","content","originalContent","name","events","i","slug","id","prefix","venueTz","itemList","jsonLd","entityName","entityDescription","entitySummary","entityImage","entityUrl","HostSeoController"],"mappings":"gFAoBO,SAASA,GAAqB,CACjC,MAAO,qBACX,CCJA,MAAMC,EAAc,gDACdC,EAAa,eACbC,EAAU,WAGVC,EAAiB,CACnB,QAAS,IACT,OAAQ,IACR,OAAQ,IACR,SAAU,IACV,QAAS,IACT,SAAU,IACV,SAAU,GACd,EACA,SAASC,EAAeC,EAAO,CAC3B,OAAOA,EACF,QAAQ,oBAAqB,CAACC,EAAGC,IAAQC,EAAiB,SAASD,EAAK,EAAE,CAAC,CAAC,EAC5E,QAAQ,YAAa,CAACD,EAAGG,IAAQD,EAAiB,OAAOC,CAAG,CAAC,CAAC,EAC9D,QAAQ,gBAAkBC,GAAMP,EAAeO,EAAE,YAAW,CAAE,GAAKA,CAAC,CAC7E,CACA,SAASF,EAAiBG,EAAM,CAC5B,OAAO,OAAO,SAASA,CAAI,GAAKA,EAAO,GAAKA,GAAQ,QAC9C,OAAO,cAAcA,CAAI,EACzB,EACV,CAYO,SAASC,EAA0BC,EAAMC,EAAW,CACvD,GAAI,CAACD,EACD,MAAO,GACX,IAAIE,EAAO,OAAOF,CAAI,EACjB,QAAQZ,EAAY,GAAG,EACvB,QAAQD,EAAa,GAAG,EACxB,QAAQE,EAAS,E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