@seatlayer/core 0.36.3 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -507,7 +507,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
507
507
  /** Category order from the doc — the stable index into the CB palette. */
508
508
  private catOrder;
509
509
  private selection;
510
- /** Whole-seat/block selection markers: outline + non-colour check cue. */
510
+ /** Seat-contained selection markers: outline + non-colour check cue. */
511
511
  private selectionMarkers;
512
512
  /** Held by this picker instance, not by another buyer. */
513
513
  private ownedHold;
@@ -1868,8 +1868,12 @@ declare function generateSeatThumb(seat: ExpandedSeat, focalPoint: Point, _neigh
1868
1868
 
1869
1869
  /**
1870
1870
  * i18n core — deliberately tiny and framework-free so the embed SDK can share
1871
- * it without dragging in a runtime library (the 150KB-gzipped complete CDN budget is a
1872
- * product contract).
1871
+ * it without dragging in a runtime library every KB here lands in the complete
1872
+ * CDN bundle every buyer downloads, which is ~207 KB gzipped as of 0.37.0+.
1873
+ * (This used to cite a "150 KB product contract". That number was never true of
1874
+ * any shipped bundle — the dashboard advertised it while the artifact measured
1875
+ * 215 KB — so it is stated as the measured figure now, not as a budget nobody
1876
+ * was holding. See docs/hosted-checkout-programme-2026-08-03.md §W4.)
1873
1877
  *
1874
1878
  * Scope: the buyer surface (picker, public event
1875
1879
  * page, SDK) ships fully translated in en/es/de/fr; dashboard pages route
@@ -1899,8 +1903,10 @@ declare function formatDate(value: number | Date, opts?: Intl.DateTimeFormatOpti
1899
1903
 
1900
1904
  /**
1901
1905
  * Locale bundle loader — keeps non-English translations OUT of the initial
1902
- * bundle (the 150 KB complete CDN budget is a product contract) and code-splits each
1903
- * locale so a page/SDK only downloads the language it actually uses.
1906
+ * bundle they are ~2.5 KB gzipped of the complete CDN artifact and
1907
+ * code-splits each locale so a page/SDK only downloads the language it actually
1908
+ * uses. (The "150 KB product contract" this used to cite was never true of a
1909
+ * shipped bundle; see docs/hosted-checkout-programme-2026-08-03.md §W4.)
1904
1910
  *
1905
1911
  * `loadLocale('de')` dynamic-imports the German dictionary, registers it via
1906
1912
  * setLocale(), and resolves once it's active. English is built in, so
@@ -1935,7 +1941,31 @@ declare function setMoneyLocale(locale: string | undefined): void;
1935
1941
  * `fractionDigits` for fixed precision (e.g. 3 for "$0.045 / credit").
1936
1942
  */
1937
1943
  declare function formatMoney(amount: number, currency?: string, fractionDigits?: number): string;
1944
+ /**
1945
+ * How many decimal places a currency has — 2 for USD/EUR, 0 for JPY/KRW/VND,
1946
+ * 3 for KWD/BHD/JOD.
1947
+ *
1948
+ * Derived from Intl rather than from a table, because ICU already carries ISO
1949
+ * 4217's exponents and a second hand-maintained list is a second thing to get
1950
+ * wrong. (`workers/api/src/payments/money.ts` DOES keep a table, on purpose: it
1951
+ * must THROW for a currency checkout cannot transact. Display has no such duty
1952
+ * — it renders whatever the ledger already recorded, including a currency
1953
+ * checkout would refuse.)
1954
+ *
1955
+ * Falls back to 2 for a code Intl rejects, so a bad row cannot blank a chart.
1956
+ */
1957
+ declare function currencyExponent(currency?: string): number;
1958
+ /**
1959
+ * Minor units → major units. `9000` USD cents is `90`; `9000` JPY is `9000`.
1960
+ *
1961
+ * Every money field the API returns is an integer in the currency's smallest
1962
+ * unit (`grossMinor`, `total_minor`). Dividing by 100 at a call site is right
1963
+ * for most currencies and silently wrong for the rest — 100x wrong for yen.
1964
+ */
1965
+ declare function fromMinorUnits(minor: number, currency?: string): number;
1966
+ /** "$90" / "¥9,000" — a minor-unit integer rendered for display. */
1967
+ declare function formatMinor(minor: number, currency?: string): string;
1938
1968
  /** Bare symbol for input adornments ("€", "$", "₹"). */
1939
1969
  declare function currencySymbol(currency?: string): string;
1940
1970
 
1941
- export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
1971
+ export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencyExponent, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMinor, formatMoney, fromMinorUnits, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
package/dist/index.d.ts CHANGED
@@ -507,7 +507,7 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
507
507
  /** Category order from the doc — the stable index into the CB palette. */
508
508
  private catOrder;
509
509
  private selection;
510
- /** Whole-seat/block selection markers: outline + non-colour check cue. */
510
+ /** Seat-contained selection markers: outline + non-colour check cue. */
511
511
  private selectionMarkers;
512
512
  /** Held by this picker instance, not by another buyer. */
513
513
  private ownedHold;
@@ -1868,8 +1868,12 @@ declare function generateSeatThumb(seat: ExpandedSeat, focalPoint: Point, _neigh
1868
1868
 
1869
1869
  /**
1870
1870
  * i18n core — deliberately tiny and framework-free so the embed SDK can share
1871
- * it without dragging in a runtime library (the 150KB-gzipped complete CDN budget is a
1872
- * product contract).
1871
+ * it without dragging in a runtime library every KB here lands in the complete
1872
+ * CDN bundle every buyer downloads, which is ~207 KB gzipped as of 0.37.0+.
1873
+ * (This used to cite a "150 KB product contract". That number was never true of
1874
+ * any shipped bundle — the dashboard advertised it while the artifact measured
1875
+ * 215 KB — so it is stated as the measured figure now, not as a budget nobody
1876
+ * was holding. See docs/hosted-checkout-programme-2026-08-03.md §W4.)
1873
1877
  *
1874
1878
  * Scope: the buyer surface (picker, public event
1875
1879
  * page, SDK) ships fully translated in en/es/de/fr; dashboard pages route
@@ -1899,8 +1903,10 @@ declare function formatDate(value: number | Date, opts?: Intl.DateTimeFormatOpti
1899
1903
 
1900
1904
  /**
1901
1905
  * Locale bundle loader — keeps non-English translations OUT of the initial
1902
- * bundle (the 150 KB complete CDN budget is a product contract) and code-splits each
1903
- * locale so a page/SDK only downloads the language it actually uses.
1906
+ * bundle they are ~2.5 KB gzipped of the complete CDN artifact and
1907
+ * code-splits each locale so a page/SDK only downloads the language it actually
1908
+ * uses. (The "150 KB product contract" this used to cite was never true of a
1909
+ * shipped bundle; see docs/hosted-checkout-programme-2026-08-03.md §W4.)
1904
1910
  *
1905
1911
  * `loadLocale('de')` dynamic-imports the German dictionary, registers it via
1906
1912
  * setLocale(), and resolves once it's active. English is built in, so
@@ -1935,7 +1941,31 @@ declare function setMoneyLocale(locale: string | undefined): void;
1935
1941
  * `fractionDigits` for fixed precision (e.g. 3 for "$0.045 / credit").
1936
1942
  */
1937
1943
  declare function formatMoney(amount: number, currency?: string, fractionDigits?: number): string;
1944
+ /**
1945
+ * How many decimal places a currency has — 2 for USD/EUR, 0 for JPY/KRW/VND,
1946
+ * 3 for KWD/BHD/JOD.
1947
+ *
1948
+ * Derived from Intl rather than from a table, because ICU already carries ISO
1949
+ * 4217's exponents and a second hand-maintained list is a second thing to get
1950
+ * wrong. (`workers/api/src/payments/money.ts` DOES keep a table, on purpose: it
1951
+ * must THROW for a currency checkout cannot transact. Display has no such duty
1952
+ * — it renders whatever the ledger already recorded, including a currency
1953
+ * checkout would refuse.)
1954
+ *
1955
+ * Falls back to 2 for a code Intl rejects, so a bad row cannot blank a chart.
1956
+ */
1957
+ declare function currencyExponent(currency?: string): number;
1958
+ /**
1959
+ * Minor units → major units. `9000` USD cents is `90`; `9000` JPY is `9000`.
1960
+ *
1961
+ * Every money field the API returns is an integer in the currency's smallest
1962
+ * unit (`grossMinor`, `total_minor`). Dividing by 100 at a call site is right
1963
+ * for most currencies and silently wrong for the rest — 100x wrong for yen.
1964
+ */
1965
+ declare function fromMinorUnits(minor: number, currency?: string): number;
1966
+ /** "$90" / "¥9,000" — a minor-unit integer rendered for display. */
1967
+ declare function formatMinor(minor: number, currency?: string): string;
1938
1968
  /** Bare symbol for input adornments ("€", "$", "₹"). */
1939
1969
  declare function currencySymbol(currency?: string): string;
1940
1970
 
1941
- export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
1971
+ export { AccessibilityType, type AvailabilityRule, BoothObject, CategoryTier, ChartDoc, ChartObject, DEFAULT_CURRENCY, type Dict, type ExpandChartOptions, ExpandedSeat, Floor, GAAreaObject, GAInventorySegment, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, ISeatmapRenderer, LabelStyle, type Locale, LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerGAArea, type PickerOptions, type PickerSeat, type PickerTransport, Point, RENDERED_QUALITY_REPORT_VERSION, RectTableSeatCounts, RectTableSide, type RenderedEvidenceState, RenderedFreeTextEvidence, type RenderedQualityFinding, type RenderedQualityFindingCode, type RenderedQualityReport, type RenderedQualitySample, RendererCallbacks, RendererOptions, RendererQualityEvidence, RendererViewMode, RowObject, type RowSeatSlot, SUPPORTED_LOCALES, SeatCommercialAttributes, type SeatHoverDetails, SeatOverride, SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, SectionObject, type SectionSummary, TIER_HEIGHT_M, TableObject, type TableSeatSlot, type TableSelectionDetails, UNGROUPED_ID, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencyExponent, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, expandTableSlots, floorObjects, floorsOf, formatDate, formatMinor, formatMoney, fromMinorUnits, gaAreasOf, gaInventorySegments, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, growJoinedGAInventory, hiddenObjectIds, inspectRenderedQualityEvidence, isGaUnitLabel, isSectionHidden, loadLocale, objectCenter, owningSectionForObject, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, rowInventoryCount, rowSeatPositions, sectionGeometry, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount, tableInventoryCount, tableSeatCountsBySide, validGAInventorySegments };
package/dist/index.js CHANGED
@@ -1255,6 +1255,19 @@ function formatMoney(amount, currency = DEFAULT_CURRENCY, fractionDigits) {
1255
1255
  const digits = fractionDigits ?? (Number.isInteger(amount) ? 0 : void 0);
1256
1256
  return formatter(currency, digits).format(amount);
1257
1257
  }
1258
+ function currencyExponent(currency = DEFAULT_CURRENCY) {
1259
+ try {
1260
+ return formatter(currency, void 0).resolvedOptions().maximumFractionDigits ?? 2;
1261
+ } catch {
1262
+ return 2;
1263
+ }
1264
+ }
1265
+ function fromMinorUnits(minor, currency = DEFAULT_CURRENCY) {
1266
+ return minor / 10 ** currencyExponent(currency);
1267
+ }
1268
+ function formatMinor(minor, currency = DEFAULT_CURRENCY) {
1269
+ return formatMoney(fromMinorUnits(minor, currency), currency);
1270
+ }
1258
1271
  function currencySymbol(currency = DEFAULT_CURRENCY) {
1259
1272
  const part = formatter(currency, 0).formatToParts(0).find((p) => p.type === "currency");
1260
1273
  return part?.value ?? currency;
@@ -1821,7 +1834,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
1821
1834
  /** Category order from the doc — the stable index into the CB palette. */
1822
1835
  this.catOrder = [];
1823
1836
  this.selection = /* @__PURE__ */ new Set();
1824
- /** Whole-seat/block selection markers: outline + non-colour check cue. */
1837
+ /** Seat-contained selection markers: outline + non-colour check cue. */
1825
1838
  this.selectionMarkers = /* @__PURE__ */ new Map();
1826
1839
  /** Held by this picker instance, not by another buyer. */
1827
1840
  this.ownedHold = /* @__PURE__ */ new Set();
@@ -5162,11 +5175,15 @@ var _SeatmapRenderer = class _SeatmapRenderer {
5162
5175
  }));
5163
5176
  }
5164
5177
  } else {
5165
- marker.add(new Circle({ ...common, radius: this.seatR + (candidate ? 4.5 : 2.5), strokeWidth: candidate ? 3.5 : 2.5 }));
5178
+ marker.add(new Circle({
5179
+ ...common,
5180
+ radius: Math.max(1, this.seatR - 1.25),
5181
+ strokeWidth: Math.min(2.5, Math.max(1.8, this.seatR * 0.22))
5182
+ }));
5166
5183
  if (candidate) {
5167
5184
  marker.add(new Circle({
5168
5185
  ...common,
5169
- radius: this.seatR + 8,
5186
+ radius: this.seatR + 2,
5170
5187
  strokeWidth: 2,
5171
5188
  opacity: 0.55
5172
5189
  }));
@@ -7873,8 +7890,8 @@ var PickerController = class {
7873
7890
  ["held", "booked", "not_for_sale"].forEach((st) => {
7874
7891
  if (byStatus[st].length) r.setStatus(byStatus[st], st);
7875
7892
  });
7876
- this.opts.onStatusChange?.();
7877
7893
  this.clearBookedHoldIfSettled();
7894
+ this.opts.onStatusChange?.();
7878
7895
  }
7879
7896
  clearBookedHoldIfSettled() {
7880
7897
  const hold = this.hold_;
@@ -9215,6 +9232,7 @@ export {
9215
9232
  chartBounds,
9216
9233
  computeSections,
9217
9234
  createRenderer,
9235
+ currencyExponent,
9218
9236
  currencySymbol,
9219
9237
  expandBooth,
9220
9238
  expandChart,
@@ -9225,7 +9243,9 @@ export {
9225
9243
  floorObjects,
9226
9244
  floorsOf,
9227
9245
  formatDate,
9246
+ formatMinor,
9228
9247
  formatMoney,
9248
+ fromMinorUnits,
9229
9249
  gaAreasOf,
9230
9250
  gaInventorySegments,
9231
9251
  gaUnitLabel,