@seatlayer/js 0.97.0 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1275,6 +1275,11 @@ interface SeatManagerArea {
1275
1275
  /** The buyer-facing name (`displayLabel`, else `label`). */
1276
1276
  name: string;
1277
1277
  }
1278
+ /** One category's price on the map's hover: an amount, or a from–to range. */
1279
+ type SeatManagerCategoryPrice = number | {
1280
+ min: number;
1281
+ max: number;
1282
+ };
1278
1283
  interface SeatManagerOptions {
1279
1284
  /** CSS selector or element to mount into. */
1280
1285
  container: string | HTMLElement;
@@ -1316,6 +1321,35 @@ interface SeatManagerOptions {
1316
1321
  selectableObjects?: string[];
1317
1322
  /** Allow held, booked, and blocked objects in Select mode. Default true. */
1318
1323
  unavailableObjectsSelectable?: boolean;
1324
+ /**
1325
+ * Public labels the host wants shown as unavailable although the event's
1326
+ * inventory has them free (a seat kept back for a reason this event does
1327
+ * not record). A listed seat the event has free is painted as held, and no
1328
+ * listed seat can be chosen by a tap, a row label, a box, a chooser or
1329
+ * `selectObjects` — `unavailableObjectsSelectable`, `selectableObjects` and
1330
+ * `isObjectSelectable` do not make it selectable. A listed seat the event
1331
+ * already holds, books or blocks keeps its own paint.
1332
+ *
1333
+ * Display only: nothing is sent to the server, and tallies still count the
1334
+ * event's own inventory. Replace the list with `setUnavailableObjects()`.
1335
+ */
1336
+ unavailableObjects?: readonly string[];
1337
+ /**
1338
+ * The status word the map's hover card shows for a seat in
1339
+ * `unavailableObjects`, e.g. `'Kept for renewal'`. Default `'Unavailable'`.
1340
+ */
1341
+ unavailableObjectsReason?: string;
1342
+ /**
1343
+ * The price the map's seat and section hover show, per category key, in the
1344
+ * same units as the chart's category prices. For a host that sells at a
1345
+ * price the chart does not carry (a season sold at a package price).
1346
+ *
1347
+ * Absent: the chart's own category prices, as before. A map: each listed
1348
+ * category shows its amount or its from–to range, and a category the map
1349
+ * leaves out keeps its chart price. `null`: the hover shows no price at all.
1350
+ * Display only. Replace it with `setCategoryPrices()`.
1351
+ */
1352
+ categoryPrices?: Record<string, SeatManagerCategoryPrice> | null;
1319
1353
  /** Maximum objects selectable in the custom Select tool. */
1320
1354
  maxSelectedObjects?: number;
1321
1355
  /** Require exactly this many objects and cap selection at that count. */
@@ -1493,6 +1527,8 @@ declare class SeatManager {
1493
1527
  private mode;
1494
1528
  private inventoryModelVersion;
1495
1529
  private selectableObjectLabels;
1530
+ /** Host-listed labels painted as held while the event has them free. */
1531
+ private unavailableLabels;
1496
1532
  private lastSelectionLabels;
1497
1533
  private selectionWasValid;
1498
1534
  private initialSelectionApplied;
@@ -1841,6 +1877,20 @@ declare class SeatManager {
1841
1877
  deselectCategories(keys: string[]): ExpandedSeat[];
1842
1878
  /** Replace the unavailable-object exception list without remounting. */
1843
1879
  setSelectableObjects(labels: string[]): void;
1880
+ /**
1881
+ * Replace the labels shown as unavailable, and optionally the hover word for
1882
+ * them, without remounting. Seats leaving the list repaint as the event has
1883
+ * them; seats joining it repaint as held and leave the selection.
1884
+ */
1885
+ setUnavailableObjects(labels: readonly string[], reason?: string): void;
1886
+ /**
1887
+ * Replace the prices the map's seat and section hover show, without
1888
+ * remounting: a map overrides those categories, `null` hides the price, and
1889
+ * `undefined` returns to the chart's own prices.
1890
+ */
1891
+ setCategoryPrices(prices: Record<string, SeatManagerCategoryPrice> | null | undefined): void;
1892
+ /** The host's category prices in the renderer's shape: every amount is a range. */
1893
+ private hoverPriceRanges;
1844
1894
  /** Change whether unavailable inventory participates in custom selection. */
1845
1895
  setUnavailableObjectsSelectable(enabled: boolean): void;
1846
1896
  /** Replace the final per-object selection predicate. */
@@ -2055,6 +2105,10 @@ declare class SeatManager {
2055
2105
  private seedFeed;
2056
2106
  private startFeedClock;
2057
2107
  private selectionCap;
2108
+ /** A seat the host listed in `unavailableObjects`: never chosen on this map. */
2109
+ private isHostUnavailable;
2110
+ /** What the canvas paints for a label: a listed seat the event has free reads as held. */
2111
+ private renderStatusOf;
2058
2112
  private canSelectObject;
2059
2113
  private applyInitialSelection;
2060
2114
  private trimSelectionToCap;
@@ -2821,4 +2875,4 @@ declare class ChannelsMode {
2821
2875
  handleBack(): boolean;
2822
2876
  }
2823
2877
 
2824
- export { ManageApiError as $, type AccessIntentForbidsDetails as A, type BucketRow as B, type ChannelAccessIntent as C, type ChannelsClient as D, ChannelsMode as E, type ChannelsModeHost as F, type ChannelsRowView as G, type ChannelsSeatView as H, type ControlRoomActivityEntry as I, type ControlRoomSectionMetric as J, type ControlRoomSnapshot as K, type EventCategoryAssignmentResult as L, type EventScopedManageToken as M, type EventTableBookingMode as N, type EventTableBookingResult as O, type IntentSwitchBlockedDetails as P, type InventoryBooking as Q, type InventoryBookingActivity as R, type InventoryBookingDetail as S, type ThemeMode as T, type InventoryBookingObject as U, type InventoryBookingState as V, type InventoryBookingsPage as W, type InventoryBookingsQuery as X, type LogEntry as Y, type LogPage as Z, ManageApi as _, type AccessLinkRecord as a, type ReportByStatus as a0, type ReportCategoryMeta as a1, type ReportCategoryRow as a2, type ReportResult as a3, SeatManager as a4, type SeatManagerActionResult as a5, type SeatManagerActivity as a6, type SeatManagerArea as a7, type SeatManagerCapability as a8, type SeatManagerConnection as a9, retryAfterCopy as aA, selectionSources as aB, stateBadge as aC, suggestMarker as aD, type SeatManagerFilteredSection as aa, type SeatManagerMode as ab, type SeatManagerOptions as ac, type SeatManagerSelectionValidity as ad, type SeatManagerTallies as ae, type SelectionSourceRow as af, ACCESS_LINK_DEFAULTS as ag, PUBLIC_CHANNEL_ID as ah, PUBLIC_CHANNEL_NAME as ai, accessIntentDescription as aj, accessIntentLabel as ak, accessLine as al, accessLinkBadge as am, accessLinkErrorCopy as an, accessLinkIsLive as ao, accessLinkPolicyLines as ap, bucketRows as aq, dropReviewRows as ar, intentForbidsCopy as as, intentSwitchBlockedCopy as at, isPublicChannelId as au, markerLetter as av, markerOf as aw, mutationCount as ax, needsMoveConfirmation as ay, planAssignment as az, type AccessLinkReveal as b, type AccessLinkState as c, type AccessLinkStatus as d, type AccessLinkStatusRecord as e, type ArchiveBlockedDetails as f, type AssignmentBuckets as g, type AssignmentDropDetails as h, type AssignmentResult as i, type ChannelAccessSummary as j, type ChannelAllocationPage as k, type ChannelAttribution as l, type ChannelAuditEntry as m, type ChannelAuditPage as n, type ChannelCounts as o, type ChannelListResult as p, type ChannelPreviewProjection as q, type ChannelRecord as r, type ChannelReport as s, type ChannelReportLinkRecord as t, type ChannelReportLinkReveal as u, type ChannelReportResult as v, type ChannelReportRow as w, type ChannelSeatStatus as x, type ChannelState as y, type ChannelsCapabilities as z };
2878
+ export { ManageApiError as $, type AccessIntentForbidsDetails as A, type BucketRow as B, type ChannelAccessIntent as C, type ChannelsClient as D, ChannelsMode as E, type ChannelsModeHost as F, type ChannelsRowView as G, type ChannelsSeatView as H, type ControlRoomActivityEntry as I, type ControlRoomSectionMetric as J, type ControlRoomSnapshot as K, type EventCategoryAssignmentResult as L, type EventScopedManageToken as M, type EventTableBookingMode as N, type EventTableBookingResult as O, type IntentSwitchBlockedDetails as P, type InventoryBooking as Q, type InventoryBookingActivity as R, type InventoryBookingDetail as S, type ThemeMode as T, type InventoryBookingObject as U, type InventoryBookingState as V, type InventoryBookingsPage as W, type InventoryBookingsQuery as X, type LogEntry as Y, type LogPage as Z, ManageApi as _, type AccessLinkRecord as a, type ReportByStatus as a0, type ReportCategoryMeta as a1, type ReportCategoryRow as a2, type ReportResult as a3, SeatManager as a4, type SeatManagerActionResult as a5, type SeatManagerActivity as a6, type SeatManagerArea as a7, type SeatManagerCapability as a8, type SeatManagerCategoryPrice as a9, planAssignment as aA, retryAfterCopy as aB, selectionSources as aC, stateBadge as aD, suggestMarker as aE, type SeatManagerConnection as aa, type SeatManagerFilteredSection as ab, type SeatManagerMode as ac, type SeatManagerOptions as ad, type SeatManagerSelectionValidity as ae, type SeatManagerTallies as af, type SelectionSourceRow as ag, ACCESS_LINK_DEFAULTS as ah, PUBLIC_CHANNEL_ID as ai, PUBLIC_CHANNEL_NAME as aj, accessIntentDescription as ak, accessIntentLabel as al, accessLine as am, accessLinkBadge as an, accessLinkErrorCopy as ao, accessLinkIsLive as ap, accessLinkPolicyLines as aq, bucketRows as ar, dropReviewRows as as, intentForbidsCopy as at, intentSwitchBlockedCopy as au, isPublicChannelId as av, markerLetter as aw, markerOf as ax, mutationCount as ay, needsMoveConfirmation as az, type AccessLinkReveal as b, type AccessLinkState as c, type AccessLinkStatus as d, type AccessLinkStatusRecord as e, type ArchiveBlockedDetails as f, type AssignmentBuckets as g, type AssignmentDropDetails as h, type AssignmentResult as i, type ChannelAccessSummary as j, type ChannelAllocationPage as k, type ChannelAttribution as l, type ChannelAuditEntry as m, type ChannelAuditPage as n, type ChannelCounts as o, type ChannelListResult as p, type ChannelPreviewProjection as q, type ChannelRecord as r, type ChannelReport as s, type ChannelReportLinkRecord as t, type ChannelReportLinkReveal as u, type ChannelReportResult as v, type ChannelReportRow as w, type ChannelSeatStatus as x, type ChannelState as y, type ChannelsCapabilities as z };
@@ -1275,6 +1275,11 @@ interface SeatManagerArea {
1275
1275
  /** The buyer-facing name (`displayLabel`, else `label`). */
1276
1276
  name: string;
1277
1277
  }
1278
+ /** One category's price on the map's hover: an amount, or a from–to range. */
1279
+ type SeatManagerCategoryPrice = number | {
1280
+ min: number;
1281
+ max: number;
1282
+ };
1278
1283
  interface SeatManagerOptions {
1279
1284
  /** CSS selector or element to mount into. */
1280
1285
  container: string | HTMLElement;
@@ -1316,6 +1321,35 @@ interface SeatManagerOptions {
1316
1321
  selectableObjects?: string[];
1317
1322
  /** Allow held, booked, and blocked objects in Select mode. Default true. */
1318
1323
  unavailableObjectsSelectable?: boolean;
1324
+ /**
1325
+ * Public labels the host wants shown as unavailable although the event's
1326
+ * inventory has them free (a seat kept back for a reason this event does
1327
+ * not record). A listed seat the event has free is painted as held, and no
1328
+ * listed seat can be chosen by a tap, a row label, a box, a chooser or
1329
+ * `selectObjects` — `unavailableObjectsSelectable`, `selectableObjects` and
1330
+ * `isObjectSelectable` do not make it selectable. A listed seat the event
1331
+ * already holds, books or blocks keeps its own paint.
1332
+ *
1333
+ * Display only: nothing is sent to the server, and tallies still count the
1334
+ * event's own inventory. Replace the list with `setUnavailableObjects()`.
1335
+ */
1336
+ unavailableObjects?: readonly string[];
1337
+ /**
1338
+ * The status word the map's hover card shows for a seat in
1339
+ * `unavailableObjects`, e.g. `'Kept for renewal'`. Default `'Unavailable'`.
1340
+ */
1341
+ unavailableObjectsReason?: string;
1342
+ /**
1343
+ * The price the map's seat and section hover show, per category key, in the
1344
+ * same units as the chart's category prices. For a host that sells at a
1345
+ * price the chart does not carry (a season sold at a package price).
1346
+ *
1347
+ * Absent: the chart's own category prices, as before. A map: each listed
1348
+ * category shows its amount or its from–to range, and a category the map
1349
+ * leaves out keeps its chart price. `null`: the hover shows no price at all.
1350
+ * Display only. Replace it with `setCategoryPrices()`.
1351
+ */
1352
+ categoryPrices?: Record<string, SeatManagerCategoryPrice> | null;
1319
1353
  /** Maximum objects selectable in the custom Select tool. */
1320
1354
  maxSelectedObjects?: number;
1321
1355
  /** Require exactly this many objects and cap selection at that count. */
@@ -1493,6 +1527,8 @@ declare class SeatManager {
1493
1527
  private mode;
1494
1528
  private inventoryModelVersion;
1495
1529
  private selectableObjectLabels;
1530
+ /** Host-listed labels painted as held while the event has them free. */
1531
+ private unavailableLabels;
1496
1532
  private lastSelectionLabels;
1497
1533
  private selectionWasValid;
1498
1534
  private initialSelectionApplied;
@@ -1841,6 +1877,20 @@ declare class SeatManager {
1841
1877
  deselectCategories(keys: string[]): ExpandedSeat[];
1842
1878
  /** Replace the unavailable-object exception list without remounting. */
1843
1879
  setSelectableObjects(labels: string[]): void;
1880
+ /**
1881
+ * Replace the labels shown as unavailable, and optionally the hover word for
1882
+ * them, without remounting. Seats leaving the list repaint as the event has
1883
+ * them; seats joining it repaint as held and leave the selection.
1884
+ */
1885
+ setUnavailableObjects(labels: readonly string[], reason?: string): void;
1886
+ /**
1887
+ * Replace the prices the map's seat and section hover show, without
1888
+ * remounting: a map overrides those categories, `null` hides the price, and
1889
+ * `undefined` returns to the chart's own prices.
1890
+ */
1891
+ setCategoryPrices(prices: Record<string, SeatManagerCategoryPrice> | null | undefined): void;
1892
+ /** The host's category prices in the renderer's shape: every amount is a range. */
1893
+ private hoverPriceRanges;
1844
1894
  /** Change whether unavailable inventory participates in custom selection. */
1845
1895
  setUnavailableObjectsSelectable(enabled: boolean): void;
1846
1896
  /** Replace the final per-object selection predicate. */
@@ -2055,6 +2105,10 @@ declare class SeatManager {
2055
2105
  private seedFeed;
2056
2106
  private startFeedClock;
2057
2107
  private selectionCap;
2108
+ /** A seat the host listed in `unavailableObjects`: never chosen on this map. */
2109
+ private isHostUnavailable;
2110
+ /** What the canvas paints for a label: a listed seat the event has free reads as held. */
2111
+ private renderStatusOf;
2058
2112
  private canSelectObject;
2059
2113
  private applyInitialSelection;
2060
2114
  private trimSelectionToCap;
@@ -2821,4 +2875,4 @@ declare class ChannelsMode {
2821
2875
  handleBack(): boolean;
2822
2876
  }
2823
2877
 
2824
- export { ManageApiError as $, type AccessIntentForbidsDetails as A, type BucketRow as B, type ChannelAccessIntent as C, type ChannelsClient as D, ChannelsMode as E, type ChannelsModeHost as F, type ChannelsRowView as G, type ChannelsSeatView as H, type ControlRoomActivityEntry as I, type ControlRoomSectionMetric as J, type ControlRoomSnapshot as K, type EventCategoryAssignmentResult as L, type EventScopedManageToken as M, type EventTableBookingMode as N, type EventTableBookingResult as O, type IntentSwitchBlockedDetails as P, type InventoryBooking as Q, type InventoryBookingActivity as R, type InventoryBookingDetail as S, type ThemeMode as T, type InventoryBookingObject as U, type InventoryBookingState as V, type InventoryBookingsPage as W, type InventoryBookingsQuery as X, type LogEntry as Y, type LogPage as Z, ManageApi as _, type AccessLinkRecord as a, type ReportByStatus as a0, type ReportCategoryMeta as a1, type ReportCategoryRow as a2, type ReportResult as a3, SeatManager as a4, type SeatManagerActionResult as a5, type SeatManagerActivity as a6, type SeatManagerArea as a7, type SeatManagerCapability as a8, type SeatManagerConnection as a9, retryAfterCopy as aA, selectionSources as aB, stateBadge as aC, suggestMarker as aD, type SeatManagerFilteredSection as aa, type SeatManagerMode as ab, type SeatManagerOptions as ac, type SeatManagerSelectionValidity as ad, type SeatManagerTallies as ae, type SelectionSourceRow as af, ACCESS_LINK_DEFAULTS as ag, PUBLIC_CHANNEL_ID as ah, PUBLIC_CHANNEL_NAME as ai, accessIntentDescription as aj, accessIntentLabel as ak, accessLine as al, accessLinkBadge as am, accessLinkErrorCopy as an, accessLinkIsLive as ao, accessLinkPolicyLines as ap, bucketRows as aq, dropReviewRows as ar, intentForbidsCopy as as, intentSwitchBlockedCopy as at, isPublicChannelId as au, markerLetter as av, markerOf as aw, mutationCount as ax, needsMoveConfirmation as ay, planAssignment as az, type AccessLinkReveal as b, type AccessLinkState as c, type AccessLinkStatus as d, type AccessLinkStatusRecord as e, type ArchiveBlockedDetails as f, type AssignmentBuckets as g, type AssignmentDropDetails as h, type AssignmentResult as i, type ChannelAccessSummary as j, type ChannelAllocationPage as k, type ChannelAttribution as l, type ChannelAuditEntry as m, type ChannelAuditPage as n, type ChannelCounts as o, type ChannelListResult as p, type ChannelPreviewProjection as q, type ChannelRecord as r, type ChannelReport as s, type ChannelReportLinkRecord as t, type ChannelReportLinkReveal as u, type ChannelReportResult as v, type ChannelReportRow as w, type ChannelSeatStatus as x, type ChannelState as y, type ChannelsCapabilities as z };
2878
+ export { ManageApiError as $, type AccessIntentForbidsDetails as A, type BucketRow as B, type ChannelAccessIntent as C, type ChannelsClient as D, ChannelsMode as E, type ChannelsModeHost as F, type ChannelsRowView as G, type ChannelsSeatView as H, type ControlRoomActivityEntry as I, type ControlRoomSectionMetric as J, type ControlRoomSnapshot as K, type EventCategoryAssignmentResult as L, type EventScopedManageToken as M, type EventTableBookingMode as N, type EventTableBookingResult as O, type IntentSwitchBlockedDetails as P, type InventoryBooking as Q, type InventoryBookingActivity as R, type InventoryBookingDetail as S, type ThemeMode as T, type InventoryBookingObject as U, type InventoryBookingState as V, type InventoryBookingsPage as W, type InventoryBookingsQuery as X, type LogEntry as Y, type LogPage as Z, ManageApi as _, type AccessLinkRecord as a, type ReportByStatus as a0, type ReportCategoryMeta as a1, type ReportCategoryRow as a2, type ReportResult as a3, SeatManager as a4, type SeatManagerActionResult as a5, type SeatManagerActivity as a6, type SeatManagerArea as a7, type SeatManagerCapability as a8, type SeatManagerCategoryPrice as a9, planAssignment as aA, retryAfterCopy as aB, selectionSources as aC, stateBadge as aD, suggestMarker as aE, type SeatManagerConnection as aa, type SeatManagerFilteredSection as ab, type SeatManagerMode as ac, type SeatManagerOptions as ad, type SeatManagerSelectionValidity as ae, type SeatManagerTallies as af, type SelectionSourceRow as ag, ACCESS_LINK_DEFAULTS as ah, PUBLIC_CHANNEL_ID as ai, PUBLIC_CHANNEL_NAME as aj, accessIntentDescription as ak, accessIntentLabel as al, accessLine as am, accessLinkBadge as an, accessLinkErrorCopy as ao, accessLinkIsLive as ap, accessLinkPolicyLines as aq, bucketRows as ar, dropReviewRows as as, intentForbidsCopy as at, intentSwitchBlockedCopy as au, isPublicChannelId as av, markerLetter as aw, markerOf as ax, mutationCount as ay, needsMoveConfirmation as az, type AccessLinkReveal as b, type AccessLinkState as c, type AccessLinkStatus as d, type AccessLinkStatusRecord as e, type ArchiveBlockedDetails as f, type AssignmentBuckets as g, type AssignmentDropDetails as h, type AssignmentResult as i, type ChannelAccessSummary as j, type ChannelAllocationPage as k, type ChannelAttribution as l, type ChannelAuditEntry as m, type ChannelAuditPage as n, type ChannelCounts as o, type ChannelListResult as p, type ChannelPreviewProjection as q, type ChannelRecord as r, type ChannelReport as s, type ChannelReportLinkRecord as t, type ChannelReportLinkReveal as u, type ChannelReportResult as v, type ChannelReportRow as w, type ChannelSeatStatus as x, type ChannelState as y, type ChannelsCapabilities as z };
@@ -0,0 +1 @@
1
+ import{T as a,U as b,V as c}from"./chunk-LLK5GY5O.js";import"./chunk-UBFNMA7U.js";import"./chunk-OSZ7DOEH.js";export{b as CHANNELS_CSS,c as ChannelsMode,a as bucketRowsHtml};
@@ -1,4 +1,4 @@
1
- import{c as ne}from"./chunk-RZ2VKZ44.js";function ge(i){i.querySelectorAll("select:not([data-themed])").forEach(e=>{e.dataset.themed="true";let t=document.createElement("details");t.className="slm-themed-picker";let n=document.createElement("summary"),s=document.createElement("div");s.className="slm-themed-options";let r=e.getAttribute("aria-label")||Array.from(e.labels??[]).map(a=>a.textContent).join(" ")||"Choose option";n.setAttribute("aria-label",r.trim()),t.append(n,s),e.after(t),e.hidden=!0;let o=()=>{n.textContent=e.selectedOptions[0]?.textContent??"Choose\u2026",n.setAttribute("aria-disabled",String(e.disabled)),s.replaceChildren(...Array.from(e.options).map(a=>{let l=document.createElement("button");return l.type="button",l.textContent=a.textContent,l.setAttribute("aria-label",a.textContent??""),l.disabled=e.disabled||a.disabled,l.setAttribute("aria-pressed",String(a.selected)),l.onclick=()=>{e.value=a.value,t.open=!1,o(),n.focus(),e.dispatchEvent(new Event("change",{bubbles:!0})),o()},l}))};o(),e.addEventListener("change",o),n.onclick=a=>{if(e.disabled){a.preventDefault();return}o(),i.querySelectorAll(".slm-themed-picker").forEach(l=>{l!==t&&(l.open=!1)})},t.addEventListener("focusout",a=>{t.contains(a.relatedTarget)||(t.open=!1)}),t.addEventListener("keydown",a=>{if(a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t.open=!1,n.focus()),a.key==="ArrowDown"||a.key==="ArrowUp"){if(e.disabled)return;a.preventDefault(),t.open=!0;let l=Array.from(s.querySelectorAll("button:not(:disabled)")),c=l.indexOf(document.activeElement);l[(c+(a.key==="ArrowDown"?1:l.length-1)+l.length)%l.length]?.focus()}})})}function yt(i){i.querySelectorAll('input[type="date"],input[type="datetime-local"],input[type="time"]').forEach(e=>{e.dataset.slmPicker!=="1"&&(e.dataset.slmPicker="1",e.addEventListener("click",()=>{if(!(e.disabled||e.readOnly))try{e.showPicker?.()}catch{}}))})}import{formatMoney as Ye}from"@seatlayer/core";function St(i){return i?i.mode:"open"}function Lt(i,e,t){switch(i){case"open":return null;case"hidden":return{mode:"hidden",labels:e};case"closed":return{mode:"closed",labels:e};case"timed":return{mode:"timed",revealAt:t?.revealAt??Date.now()+36e5,labels:e};case"threshold":return{mode:"threshold",thresholdPct:t?.thresholdPct??80,labels:e}}}function Ct(i){return new Date(i-new Date().getTimezoneOffset()*6e4).toISOString().slice(0,16)}function $t(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmanager: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmanager: container must be a CSS selector or an HTMLElement");return i}function Rt(i){if(!i.startsWith("mse_"))throw new Error("seatmanager: token must be a short-lived event-scoped mse_ grant minted by your backend; tenant secret keys are unsupported in browsers")}function At(i){return i==="blocked"?"not_for_sale":i}var Ke=["free","booked","held","blocked"],V={free:"#6e7bff",booked:"#9ca3af",held:"#f4b740",blocked:"#475569"},Y={free:"Free",booked:"Sold",held:"Held",blocked:"Blocked"},Et=[`<span class="slm-legmark" style="background:${V.free}"></span> Free = category colour`,`<span class="slm-legmark" style="background:${V.booked}"></span> ${Y.booked}`,`<span class="slm-legmark" style="background:${V.held}"></span> ${Y.held}`,`<span class="slm-legcross" style="color:${V.blocked}">\u2715</span> ${Y.blocked}`].join(" \xB7 "),It=Ke.map(i=>({key:i,label:Y[i],color:V[i]}));function Tt(i,e){let t=i??{},n=e?ne[e]:null,s=e==="light";return{"--slm-bg":t.background??n?.background??"#0e1017","--slm-surface":n?.surface??"#181b24","--slm-text":n?.text??"#eef1f7","--slm-muted":n?.muted??"#8b93a7","--slm-line":n?.line??"rgba(255,255,255,.09)","--slm-tint":s?"rgba(23,32,51,.05)":"rgba(255,255,255,.035)","--slm-tint-strong":s?"rgba(23,32,51,.09)":"rgba(255,255,255,.07)","--slm-accent":t.accent??(s?"#4654c8":"#6e7bff"),"--slm-accent-ink":t.accentInk??"#ffffff","--slm-font":"-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif","--slm-radius":"14px"}}function Pt(i){return i?ne[i].map:null}function Mt(i,e){let t=Math.max(0,Math.round((e-i)/1e3));if(t<5)return"just now";if(t<60)return`${t}s ago`;let n=Math.round(t/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}function Dt(i,e){return Ye(i,e,{maximumFractionDigits:0,fallback:(t,n)=>`${n} ${Math.round(t).toLocaleString()}`})}function w(i){return String(i??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}var K=300,Ge=200;function Xe(i,e){if(!i.labels.length)return"Nothing found";let t=[];i.sections&&t.push(`${i.sections.toLocaleString()} section${i.sections===1?"":"s"}`),i.rows&&t.push(`${i.rows.toLocaleString()} row${i.rows===1?"":"s"}`);let n=`${i.labels.length.toLocaleString()} seat${i.labels.length===1?"":"s"} found`,s=t.length?`${t.join(" \xB7 ")} \xB7 ${n}`:n;return e?`${s} \xB7 Enter to ${e==="frame"?"show":"select"}`:s}function We(i={}){return`
1
+ import{c as ne}from"./chunk-UBFNMA7U.js";function ge(i){i.querySelectorAll("select:not([data-themed])").forEach(e=>{e.dataset.themed="true";let t=document.createElement("details");t.className="slm-themed-picker";let n=document.createElement("summary"),s=document.createElement("div");s.className="slm-themed-options";let r=e.getAttribute("aria-label")||Array.from(e.labels??[]).map(a=>a.textContent).join(" ")||"Choose option";n.setAttribute("aria-label",r.trim()),t.append(n,s),e.after(t),e.hidden=!0;let o=()=>{n.textContent=e.selectedOptions[0]?.textContent??"Choose\u2026",n.setAttribute("aria-disabled",String(e.disabled)),s.replaceChildren(...Array.from(e.options).map(a=>{let l=document.createElement("button");return l.type="button",l.textContent=a.textContent,l.setAttribute("aria-label",a.textContent??""),l.disabled=e.disabled||a.disabled,l.setAttribute("aria-pressed",String(a.selected)),l.onclick=()=>{e.value=a.value,t.open=!1,o(),n.focus(),e.dispatchEvent(new Event("change",{bubbles:!0})),o()},l}))};o(),e.addEventListener("change",o),n.onclick=a=>{if(e.disabled){a.preventDefault();return}o(),i.querySelectorAll(".slm-themed-picker").forEach(l=>{l!==t&&(l.open=!1)})},t.addEventListener("focusout",a=>{t.contains(a.relatedTarget)||(t.open=!1)}),t.addEventListener("keydown",a=>{if(a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t.open=!1,n.focus()),a.key==="ArrowDown"||a.key==="ArrowUp"){if(e.disabled)return;a.preventDefault(),t.open=!0;let l=Array.from(s.querySelectorAll("button:not(:disabled)")),c=l.indexOf(document.activeElement);l[(c+(a.key==="ArrowDown"?1:l.length-1)+l.length)%l.length]?.focus()}})})}function yt(i){i.querySelectorAll('input[type="date"],input[type="datetime-local"],input[type="time"]').forEach(e=>{e.dataset.slmPicker!=="1"&&(e.dataset.slmPicker="1",e.addEventListener("click",()=>{if(!(e.disabled||e.readOnly))try{e.showPicker?.()}catch{}}))})}import{formatMoney as Ye}from"@seatlayer/core";function St(i){return i?i.mode:"open"}function Lt(i,e,t){switch(i){case"open":return null;case"hidden":return{mode:"hidden",labels:e};case"closed":return{mode:"closed",labels:e};case"timed":return{mode:"timed",revealAt:t?.revealAt??Date.now()+36e5,labels:e};case"threshold":return{mode:"threshold",thresholdPct:t?.thresholdPct??80,labels:e}}}function Ct(i){return new Date(i-new Date().getTimezoneOffset()*6e4).toISOString().slice(0,16)}function $t(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmanager: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmanager: container must be a CSS selector or an HTMLElement");return i}function Rt(i){if(!i.startsWith("mse_"))throw new Error("seatmanager: token must be a short-lived event-scoped mse_ grant minted by your backend; tenant secret keys are unsupported in browsers")}function At(i){return i==="blocked"?"not_for_sale":i}var Ke=["free","booked","held","blocked"],V={free:"#6e7bff",booked:"#9ca3af",held:"#f4b740",blocked:"#475569"},Y={free:"Free",booked:"Sold",held:"Held",blocked:"Blocked"},Et=[`<span class="slm-legmark" style="background:${V.free}"></span> Free = category colour`,`<span class="slm-legmark" style="background:${V.booked}"></span> ${Y.booked}`,`<span class="slm-legmark" style="background:${V.held}"></span> ${Y.held}`,`<span class="slm-legcross" style="color:${V.blocked}">\u2715</span> ${Y.blocked}`].join(" \xB7 "),It=Ke.map(i=>({key:i,label:Y[i],color:V[i]}));function Tt(i,e){let t=i??{},n=e?ne[e]:null,s=e==="light";return{"--slm-bg":t.background??n?.background??"#0e1017","--slm-surface":n?.surface??"#181b24","--slm-text":n?.text??"#eef1f7","--slm-muted":n?.muted??"#8b93a7","--slm-line":n?.line??"rgba(255,255,255,.09)","--slm-tint":s?"rgba(23,32,51,.05)":"rgba(255,255,255,.035)","--slm-tint-strong":s?"rgba(23,32,51,.09)":"rgba(255,255,255,.07)","--slm-accent":t.accent??(s?"#4654c8":"#6e7bff"),"--slm-accent-ink":t.accentInk??"#ffffff","--slm-font":"-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif","--slm-radius":"14px"}}function Pt(i){return i?ne[i].map:null}function Mt(i,e){let t=Math.max(0,Math.round((e-i)/1e3));if(t<5)return"just now";if(t<60)return`${t}s ago`;let n=Math.round(t/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}function Dt(i,e){return Ye(i,e,{maximumFractionDigits:0,fallback:(t,n)=>`${n} ${Math.round(t).toLocaleString()}`})}function w(i){return String(i??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}var K=300,Ge=200;function Xe(i,e){if(!i.labels.length)return"Nothing found";let t=[];i.sections&&t.push(`${i.sections.toLocaleString()} section${i.sections===1?"":"s"}`),i.rows&&t.push(`${i.rows.toLocaleString()} row${i.rows===1?"":"s"}`);let n=`${i.labels.length.toLocaleString()} seat${i.labels.length===1?"":"s"} found`,s=t.length?`${t.join(" \xB7 ")} \xB7 ${n}`:n;return e?`${s} \xB7 Enter to ${e==="frame"?"show":"select"}`:s}function We(i={}){return`
2
2
  <div class="slm-find${i.compact?" slm-find-bar":""}" data-ch-find>
3
3
  <input type="search" class="slm-input" data-ch-find-input placeholder="Find seat, row or section" aria-label="Find seat, row or section" autocomplete="off"${i.compact?' aria-keyshortcuts="/"':""}>
4
4
  <span class="slm-find-count" data-ch-find-count role="status"></span>
@@ -11,7 +11,7 @@ import{c as ne}from"./chunk-RZ2VKZ44.js";function ge(i){i.querySelectorAll("sele
11
11
  <div class="slm-ch-row2">${e.intents??""}${t}${n}</div>
12
12
  <div class="slm-ch-row2">${s}<button type="button" class="slm-btn ghost" data-ch-act="seatlist">Seat list \u2328</button></div>
13
13
  ${r}
14
- </div>`}wire(e,t={}){this.wireChips(e),this.wireFind(e,t)}wireChips(e){e.querySelectorAll("[data-ch-act]").forEach(t=>{let n=t.dataset.chAct;n==="pick-sections"?t.addEventListener("click",()=>this.openSections()):n==="pick-rows"?t.addEventListener("click",()=>this.openRows()):n==="pick-category"?t.addEventListener("click",()=>this.openCategory()):n==="seatlist"&&t.addEventListener("click",()=>this.openSeatList())})}handleAction(e){if(e==="pick-sections")this.openSections();else if(e==="pick-rows")this.openRows();else if(e==="pick-category")this.openCategory();else if(e==="seatlist")this.openSeatList();else return!1;return!0}wireFind(e,t={}){let n=e.querySelector("[data-ch-find-input]"),s=e.querySelector("[data-ch-find-count]");if(!n||!s)return;let r={labels:[],seats:0,rows:0,sections:0},o=()=>{let a=n.value.trim();r=this.find(n.value),s.textContent=a?Xe(r,t.enter??"select"):"",this.host.highlight?.(a?r.labels:null),t.onFind?.(r)};n.addEventListener("input",o),n.addEventListener("keydown",a=>{if(a.key==="Escape"&&n.value){a.preventDefault(),a.stopPropagation(),n.value="",o();return}if(a.key!=="Enter"||(a.preventDefault(),!r.labels.length))return;if(t.enter==="frame"){this.host.frame?.(r.labels),s.textContent=`${r.labels.length.toLocaleString()} on the map`;return}let l=new Set([...this.host.selectionLabels(),...r.labels]);if(this.host.cap!=null&&l.size>this.host.cap){s.textContent=`That would make ${l.size.toLocaleString()} selected seats \u2014 the limit is ${this.host.cap.toLocaleString()}.`;return}this.host.selectByLabels(r.labels),s.textContent=`${r.labels.length.toLocaleString()} selected`}),n.addEventListener("search",o)}find(e){return Qe(e,{sections:this.host.sections().map(t=>({...t,labels:this.host.labelsInSection(t.id)})),rows:this.rows(),seatLabels:this.host.seats().map(t=>t.label)})}openCategory(){let e=this.host.categories();if(!e.length)return;let t=this.host.cap??1/0,n=e.map(c=>({key:c.key,label:c.label,color:c.color,labels:this.host.labelsInCategory(c.key)})),s=new Map(n.map(c=>[c.key,c])),r=new Set,o=new Set(this.host.selectionLabels()),a=()=>{let c=new Set(o);for(let h of r)for(let m of s.get(h)?.labels??[])c.add(m);return c},l=n.map(c=>{let h=c.labels.filter(p=>o.has(p)).length,m=c.labels.length===0,C=m?"not on this map":h?`${h.toLocaleString()} of ${c.labels.length.toLocaleString()} selected`:`${c.labels.length.toLocaleString()} seat${c.labels.length===1?"":"s"}`;return`<button type="button" class="slm-ch-seatitem" role="checkbox" aria-checked="false"
14
+ </div>`}wire(e,t={}){this.wireChips(e),this.wireFind(e,t)}wireChips(e){e.querySelectorAll("[data-ch-act]").forEach(t=>{let n=t.dataset.chAct;n==="pick-sections"?t.addEventListener("click",()=>this.openSections()):n==="pick-rows"?t.addEventListener("click",()=>this.openRows()):n==="pick-category"?t.addEventListener("click",()=>this.openCategory()):n==="seatlist"&&t.addEventListener("click",()=>this.openSeatList())})}handleAction(e){if(e==="pick-sections")this.openSections();else if(e==="pick-rows")this.openRows();else if(e==="pick-category")this.openCategory();else if(e==="seatlist")this.openSeatList();else return!1;return!0}wireFind(e,t={}){let n=e.querySelector("[data-ch-find-input]"),s=e.querySelector("[data-ch-find-count]");if(!n||!s)return;let r={labels:[],seats:0,rows:0,sections:0},o=l=>{s.textContent=l,s.title=l},a=()=>{let l=n.value.trim();r=this.find(n.value),o(l?Xe(r,t.enter??"select"):""),this.host.highlight?.(l?r.labels:null),t.onFind?.(r)};n.addEventListener("input",a),n.addEventListener("keydown",l=>{if(l.key==="Escape"&&n.value){l.preventDefault(),l.stopPropagation(),n.value="",a();return}if(l.key!=="Enter"||(l.preventDefault(),!r.labels.length))return;if(t.enter==="frame"){this.host.frame?.(r.labels),o(`${r.labels.length.toLocaleString()} on the map`);return}let c=new Set([...this.host.selectionLabels(),...r.labels]);if(this.host.cap!=null&&c.size>this.host.cap){o(`That would make ${c.size.toLocaleString()} selected seats \u2014 the limit is ${this.host.cap.toLocaleString()}.`);return}this.host.selectByLabels(r.labels),o(`${r.labels.length.toLocaleString()} selected`)}),n.addEventListener("search",a)}find(e){return Qe(e,{sections:this.host.sections().map(t=>({...t,labels:this.host.labelsInSection(t.id)})),rows:this.rows(),seatLabels:this.host.seats().map(t=>t.label)})}openCategory(){let e=this.host.categories();if(!e.length)return;let t=this.host.cap??1/0,n=e.map(c=>({key:c.key,label:c.label,color:c.color,labels:this.host.labelsInCategory(c.key)})),s=new Map(n.map(c=>[c.key,c])),r=new Set,o=new Set(this.host.selectionLabels()),a=()=>{let c=new Set(o);for(let h of r)for(let m of s.get(h)?.labels??[])c.add(m);return c},l=n.map(c=>{let h=c.labels.filter(p=>o.has(p)).length,m=c.labels.length===0,C=m?"not on this map":h?`${h.toLocaleString()} of ${c.labels.length.toLocaleString()} selected`:`${c.labels.length.toLocaleString()} seat${c.labels.length===1?"":"s"}`;return`<button type="button" class="slm-ch-seatitem" role="checkbox" aria-checked="false"
15
15
  data-ch-category="${w(c.key)}"${m?" disabled":""}>
16
16
  <span class="box" aria-hidden="true">\u2713</span>
17
17
  <span class="dot" style="background:${w(c.color??"#6e7bff")}" aria-hidden="true"></span>
@@ -0,0 +1 @@
1
+ import{relativeLuminance255 as C,rgb255ToHex as v}from"@seatlayer/core/core/color";function a(e){if(!e)return null;let n=e.trim().toLowerCase();if(n==="white")return{r:255,g:255,b:255};if(n==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(n)?.[1];if(t){let s=t.length<=4?[...t].map(o=>`${o}${o}`).join(""):t;return{r:Number.parseInt(s.slice(0,2),16),g:Number.parseInt(s.slice(2,4),16),b:Number.parseInt(s.slice(4,6),16)}}let r=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(n);return r?{r:Math.max(0,Math.min(255,Number(r[1]))),g:Math.max(0,Math.min(255,Number(r[2]))),b:Math.max(0,Math.min(255,Number(r[3])))}:null}function d(e){return C([e.r,e.g,e.b])}function i(e,n){let t=a(e),r=a(n);if(!t||!r)return null;let s=Math.max(d(t),d(r)),o=Math.min(d(t),d(r));return(s+.05)/(o+.05)}function l(e,n="#172033",t="#eef1f8"){return(i(n,e)??0)>=(i(t,e)??0)?n:t}function y(e){return v(e.r,e.g,e.b)}function p(e,n,t){let r=a(e),s=a(n);if(!r||!s)return null;let o=Math.max(0,Math.min(1,t));return y({r:r.r*o+s.r*(1-o),g:r.g*o+s.g*(1-o),b:r.b*o+s.b*(1-o)})}var m="#d8a425",E=.18;function h(e,n){let t=p(m,n,E)??n;if((i(m,t)??0)>=4.5)return m;for(let r=.15;r<=1;r+=.05){let s=p(m,e,1-r);if(s&&(i(s,t)??0)>=4.5)return s}return l(t)}function x(e,n,t,r){if((i(e,t)??4.5)>=4.5&&(i(e,r)??4.5)>=4.5)return e;if(!a(e)||!a(n))return n;for(let s=.15;s<=1;s+=.05){let o=p(e,n,1-s);if(o&&(i(o,t)??0)>=4.5&&(i(o,r)??0)>=4.5)return o}return n}function M(e){return{"--sl-chrome":e?"#d6dce6":"#556278","--sl-chrome-line":e?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var _=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function w(e,n){let t=n??e["--sl-bg"],r=a(t)?l(t)==="#172033":!1,s=a(e["--sl-bg"])?l(e["--sl-bg"])==="#172033":!1;if(r===s)return null;let o=r?"#ffffff":"#1a2234",c=l(t),u=e["--sl-accent"];return{"--sl-bg":t,"--sl-surface":o,"--sl-text":c,"--sl-muted":r?"#667085":"#a5aec2","--sl-line":r?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":x(u,c,t,o),...M(r),"--sl-warn-text":h(c,o)}}var R="#f7f8fb",k={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function I(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function L(e){if(e)return e==="auto"?I()?"dark":"light":e}function P(e,n=e?.mode){if(e?.map)return e.map;let t=L(n);return t?{background:k[t].map}:null}function S(e){let n;try{n=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!n)return()=>{};let t=r=>e(r.matches);return typeof n.addEventListener=="function"?n.addEventListener("change",t):n.addListener?.(t),()=>{typeof n.removeEventListener=="function"?n.removeEventListener("change",t):n.removeListener?.(t)}}function A(e,n,t){let r=t?k[t]:null,s=n?.background??r?.background??e?.background??R,o=a(s)?l(s)==="#172033":!1,c=n?.surface??r?.surface??(o?"#ffffff":"#1a2234"),u=n?.accent??e?.accent??"#f4b740",g=e?.accentInk,T=n?.accentInk??(g&&(i(g,u)??4.5)>=4.5?g:l(u,"#1a1200","#ffffff")),f=r?void 0:e?.textColor,b=n?.text??r?.text??(f&&(i(f,s)??4.5)>=4.5&&(i(f,c)??4.5)>=4.5?f:l(s));return{"--sl-accent":u,"--sl-accent-ink":T,"--sl-accent-text":x(u,b,s,c),"--sl-warn-text":h(b,c),"--sl-bg":s,"--sl-surface":c,"--sl-text":b,"--sl-muted":n?.muted??r?.muted??(o?"#667085":"#a5aec2"),"--sl-line":n?.line??r?.line??(o?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...M(o),"--sl-scrim-ink":o?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":n?.fontFamily??e?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${n?.radius??14}px`}}export{_ as a,w as b,k as c,L as d,P as e,S as f,A as g};