@seatlayer/core 0.90.0 → 0.92.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.
Files changed (79) hide show
  1. package/dist/{categoryInventory-DxHnIyza.d.ts → categoryInventory-4XH7dMDH.d.ts} +1 -1
  2. package/dist/{categoryInventory-6qAQffC9.d.cts → categoryInventory-C-bfH2av.d.cts} +1 -1
  3. package/dist/chunk-4N5CHKHD.js +1 -0
  4. package/dist/{chunk-GISLORLL.js → chunk-6FTHCEJW.js} +1 -1
  5. package/dist/chunk-D5ZLXZYU.js +1 -0
  6. package/dist/chunk-F45ZMLCU.js +1 -0
  7. package/dist/chunk-HC3U5BWH.js +1 -0
  8. package/dist/{chunk-YAWJTFYK.js → chunk-K42NW62J.js} +1 -1
  9. package/dist/{chunk-EH47GKSO.js → chunk-LQKUHEL6.js} +1 -1
  10. package/dist/{chunk-GI7ZTQ7C.js → chunk-LVIAHZ4N.js} +1 -1
  11. package/dist/{chunk-77QFA3F4.js → chunk-NKJS7MLW.js} +1 -1
  12. package/dist/chunk-NRZY5UXV.js +1 -0
  13. package/dist/chunk-S4H34KCG.js +1 -0
  14. package/dist/{chunk-OYKT5CCU.js → chunk-TXF2XAK4.js} +1 -1
  15. package/dist/core/chart-ops/index.cjs +1 -1
  16. package/dist/core/chart-ops/index.d.cts +17 -9
  17. package/dist/core/chart-ops/index.d.ts +17 -9
  18. package/dist/core/chart-ops/index.js +1 -1
  19. package/dist/core/inventory/index.cjs +1 -1
  20. package/dist/core/inventory/index.d.cts +4 -4
  21. package/dist/core/inventory/index.d.ts +4 -4
  22. package/dist/core/inventory/index.js +1 -1
  23. package/dist/core/layout/index.cjs +1 -1
  24. package/dist/core/layout/index.d.cts +5 -5
  25. package/dist/core/layout/index.d.ts +5 -5
  26. package/dist/core/layout/index.js +1 -1
  27. package/dist/core/quality/index.cjs +1 -1
  28. package/dist/core/quality/index.d.cts +31 -5
  29. package/dist/core/quality/index.d.ts +31 -5
  30. package/dist/core/quality/index.js +1 -1
  31. package/dist/core/render-assets/index.cjs +1 -1
  32. package/dist/core/render-assets/index.d.cts +27 -3
  33. package/dist/core/render-assets/index.d.ts +27 -3
  34. package/dist/core/render-assets/index.js +1 -1
  35. package/dist/core/seatConfidence.d.cts +1 -1
  36. package/dist/core/seatConfidence.d.ts +1 -1
  37. package/dist/core/sections/index.cjs +1 -1
  38. package/dist/core/sections/index.d.cts +5 -5
  39. package/dist/core/sections/index.d.ts +5 -5
  40. package/dist/core/sections/index.js +1 -1
  41. package/dist/{eventConfigurations-CMnIbVqZ.d.cts → eventConfigurations-BE0rFmbQ.d.cts} +1 -1
  42. package/dist/{eventConfigurations-uEwzNRzt.d.ts → eventConfigurations-BEyHDxBT.d.ts} +1 -1
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.d.cts +107 -20
  45. package/dist/index.d.ts +107 -20
  46. package/dist/index.js +1 -1
  47. package/dist/{labeling-CCORxGjk.d.ts → labeling-HWSKKrX8.d.ts} +1 -1
  48. package/dist/{labeling--sSzNon3.d.cts → labeling-SURRJh5u.d.cts} +1 -1
  49. package/dist/{renderedQuality-CHm4mIjB.d.ts → renderedQuality-D5G1fHtR.d.ts} +1 -1
  50. package/dist/{renderedQuality-x1_lUJYV.d.cts → renderedQuality-DThBK6x4.d.cts} +1 -1
  51. package/dist/{renderer-DN1yCX7-.d.ts → renderer-B7IrAGHP.d.ts} +24 -2
  52. package/dist/{renderer-DLTYfHV2.d.cts → renderer-BePADdjE.d.cts} +24 -2
  53. package/dist/{seatTypeIcons-GlskmXH9.d.cts → seatTypeIcons-BAyWebjw.d.cts} +1 -1
  54. package/dist/{seatTypeIcons-8folIM2Q.d.ts → seatTypeIcons-CqLiEH9C.d.ts} +1 -1
  55. package/dist/{sections-BlBo6siI.d.ts → sections-BlCiPWJJ.d.cts} +63 -7
  56. package/dist/{sections-BFR0_Zeq.d.cts → sections-DOk8zxm5.d.ts} +63 -7
  57. package/dist/{segmentedRowModel-DR7Xz6mb.d.cts → segmentedRowModel-BbHdWqJy.d.cts} +1 -1
  58. package/dist/{segmentedRowModel-CfVeZaOw.d.ts → segmentedRowModel-oVUtwW87.d.ts} +1 -1
  59. package/dist/{tableSizing-oDI0D8c2.d.ts → tableSizing-D7dXthik.d.ts} +3 -3
  60. package/dist/{tableSizing-f-hh6kCg.d.cts → tableSizing-DUSD6Ksr.d.cts} +3 -3
  61. package/dist/{ticketRestrictions-Bc08-Hip.d.cts → ticketRestrictions-5qEU-1eK.d.cts} +25 -4
  62. package/dist/{ticketRestrictions-BXtFOUqJ.d.ts → ticketRestrictions-rrajqzOB.d.ts} +25 -4
  63. package/dist/{types-D91PAu7c.d.ts → types-BbqhOJ5L.d.cts} +1 -1
  64. package/dist/{types-D91PAu7c.d.cts → types-BbqhOJ5L.d.ts} +1 -1
  65. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  66. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  67. package/dist/view3d/index.cjs +8 -8
  68. package/dist/view3d/index.d.cts +3 -3
  69. package/dist/view3d/index.d.ts +3 -3
  70. package/dist/view3d/index.js +1 -1
  71. package/dist/view3d/scene/scene.worker.cjs +1 -1
  72. package/dist/view3d/scene/scene.worker.js +1 -1
  73. package/package.json +1 -1
  74. package/dist/chunk-52CBK5HX.js +0 -1
  75. package/dist/chunk-FMPQZEXD.js +0 -1
  76. package/dist/chunk-K4TZQOTG.js +0 -1
  77. package/dist/chunk-UL5OIGIF.js +0 -1
  78. package/dist/chunk-W4RS6OW7.js +0 -1
  79. package/dist/chunk-W53J4FJS.js +0 -1
@@ -1,7 +1,7 @@
1
- import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-D91PAu7c.cjs';
2
- import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-DLTYfHV2.cjs';
3
- export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-6qAQffC9.cjs';
4
- export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as gaAreasOf, n as gaInventorySegments, o as gaUnitLabel, p as gaUnitLabels, q as groupedTableInventory, r as growJoinedGAInventory, s as isFullChartDoc, t as isGaUnitLabel, u as resolveTicketTierForSeat, v as ticketOptionNotApplicableIssue, w as ticketSelectionIssue, x as ticketTierAppliesToSeat, y as validGAInventorySegments } from '../../ticketRestrictions-Bc08-Hip.cjs';
1
+ import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-BbqhOJ5L.cjs';
2
+ import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-BePADdjE.cjs';
3
+ export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-C-bfH2av.cjs';
4
+ export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as eventInventoryLimitFor, n as gaAreasOf, o as gaInventorySegments, p as gaUnitLabel, q as gaUnitLabels, r as groupedTableInventory, s as growJoinedGAInventory, t as isFullChartDoc, u as isGaUnitLabel, v as resolveTicketTierForSeat, w as ticketOptionNotApplicableIssue, x as ticketSelectionIssue, y as ticketTierAppliesToSeat, z as validGAInventorySegments } from '../../ticketRestrictions-5qEU-1eK.cjs';
5
5
 
6
6
  /**
7
7
  * Best-available seat selection — a PURE, fully unit-testable ranking function.
@@ -1,7 +1,7 @@
1
- import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-D91PAu7c.js';
2
- import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-DN1yCX7-.js';
3
- export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-DxHnIyza.js';
4
- export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as gaAreasOf, n as gaInventorySegments, o as gaUnitLabel, p as gaUnitLabels, q as groupedTableInventory, r as growJoinedGAInventory, s as isFullChartDoc, t as isGaUnitLabel, u as resolveTicketTierForSeat, v as ticketOptionNotApplicableIssue, w as ticketSelectionIssue, x as ticketTierAppliesToSeat, y as validGAInventorySegments } from '../../ticketRestrictions-BXtFOUqJ.js';
1
+ import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-BbqhOJ5L.js';
2
+ import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-B7IrAGHP.js';
3
+ export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-4XH7dMDH.js';
4
+ export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as eventInventoryLimitFor, n as gaAreasOf, o as gaInventorySegments, p as gaUnitLabel, q as gaUnitLabels, r as groupedTableInventory, s as growJoinedGAInventory, t as isFullChartDoc, u as isGaUnitLabel, v as resolveTicketTierForSeat, w as ticketOptionNotApplicableIssue, x as ticketSelectionIssue, y as ticketTierAppliesToSeat, z as validGAInventorySegments } from '../../ticketRestrictions-rrajqzOB.js';
5
5
 
6
6
  /**
7
7
  * Best-available seat selection — a PURE, fully unit-testable ranking function.
@@ -1 +1 @@
1
- import{a as st,b as ct,c as lt,d as ut,e as pt,f as ft,g as mt,h as yt,i as dt,j as ht,k as bt,l as xt}from"../../chunk-YAWJTFYK.js";import{a as Mt,b as gt,c as wt,d as Ct,e as vt,f as B,h as N}from"../../chunk-52CBK5HX.js";import"../../chunk-OYKT5CCU.js";import"../../chunk-W53J4FJS.js";import"../../chunk-TQN2VWQO.js";import"../../chunk-5BMXWOE7.js";import{a as H,b as V,c as Z,d as tt,e as et,f as ot,g as rt,h as nt,i as at,j as it}from"../../chunk-K4TZQOTG.js";import"../../chunk-77QFA3F4.js";import"../../chunk-4I2VWFJY.js";import{Aa as j,Ba as _,Ga as I,I as O,va as S,x as R,xa as v,ya as P}from"../../chunk-W4RS6OW7.js";import"../../chunk-5ITK5236.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";function g(t){return t.floors?.length?t.floors.flatMap(e=>e.objects):t.objects}function k(t){return g(t).reduce((e,r)=>r.type==="row"?e+S(r):r.type==="table"?e+j(r):r.type==="gaArea"?e+Math.max(0,Math.floor(r.capacity)):r.type==="booth"?e+1:e,0)}function jt(t){let e={};for(let o of t.categories??[])e[o.key]=0;let r=(o,n)=>{n>0&&(e[o]=(e[o]??0)+n)};for(let o of g(t))if(o.type==="row")for(let n of v(o))r(n.categoryKey,1);else if(o.type==="table")if(o.bookAsWhole||o.variableOccupancy)r(o.categoryKey,Math.max(0,Math.round(o.seatCount)));else for(let n of _(o))r(n.categoryKey,1);else o.type==="gaArea"?r(o.categoryKey,Math.max(0,Math.floor(o.capacity))):o.type==="booth"&&r(o.categoryKey,1);return e}function z(t){if(!t.template)return null;let e=g(t),r=e.filter(u=>u.type==="row"||u.type==="table"||u.type==="gaArea");if(!r.length)return null;let n=e.filter(u=>u.type==="booth").length+r.reduce((u,f)=>u+(f.type==="table"?2:1),0),i=k(t),c=Math.max(n+1,Math.min(5e4,i*4)),l=[.5,1,1.5,2].map(u=>O(Math.round(i*u),n,c));return{family:t.template.family,display:t.template.family.replace(/-/g," ").replace(/\b\w/g,u=>u.toUpperCase()),min:n,max:c,presets:["S","M","L","XL"].map((u,f)=>({size:u,seats:l[f]}))}}function A(t){let e=v(t);return e.length?R(e):{...t.origin}}function _t(t,e){let r=z(t);if(!r)return structuredClone(t);let o=structuredClone(t),n=g(o),i=n.filter(a=>a.type==="row"||a.type==="table"||a.type==="gaArea"),c=n.filter(a=>a.type==="booth").length,l=Math.max(r.min,Math.min(r.max,Math.round(e))),u=l-c,f=i.map((a,s)=>{let m=a.type==="gaArea"?Math.max(0,Math.floor(a.capacity)):a.seatCount,x=a.type==="table"?2:1;return{object:a,index:s,current:m,minimum:x,value:x,fraction:0}}),K=f.reduce((a,s)=>a+s.minimum,0),w=Math.max(0,u-K),L=f.reduce((a,s)=>a+Math.max(1,s.current-s.minimum),0);for(let a of f){let s=w*Math.max(1,a.current-a.minimum)/L,m=Math.floor(s);a.value+=m,a.fraction=s-m}w=u-f.reduce((a,s)=>a+s.value,0),f.sort((a,s)=>s.fraction-a.fraction||a.index-s.index);for(let a=0;a<w;a++)f[a%f.length].value++;f.sort((a,s)=>a.index-s.index);for(let a of f)if(a.object.type==="row"){let s=A(a.object);a.object.seatCount=a.value;let m=A(a.object);a.object.origin.x+=s.x-m.x,a.object.origin.y+=s.y-m.y}else if(a.object.type==="table"){let s=a.object;if(s.seatCountsBySide){let m=["top","bottom","left","right"],x=P(s),F=m.reduce((p,y)=>p+x[y],0)||1,d=m.map((p,y)=>{let C=a.value*x[p]/F;return{side:p,index:y,value:Math.floor(C),fraction:C-Math.floor(C)}}),X=a.value-d.reduce((p,y)=>p+y.value,0);d.sort((p,y)=>y.fraction-p.fraction||p.index-y.index);for(let p=0;p<X;p++)d[p%d.length].value+=1;d.sort((p,y)=>p.index-y.index),s.seatCountsBySide={top:d[0].value,bottom:d[1].value,left:d[2].value,right:d[3].value},s.sides=m.filter(p=>s.seatCountsBySide[p]>0)}s.seatCount=a.value,s.overrides&&(s.overrides=s.overrides.filter(m=>m.index<a.value),s.overrides.length||delete s.overrides)}else a.object.capacity=a.value;return o.floors?.length&&(o.objects=o.floors[0].objects),o.template={family:o.template.family,targetSeats:l},o=N(o).doc,o.template={family:t.template.family,targetSeats:k(o)},o}var W=1,T=100;function J(t,e){if(!Number.isInteger(e)||e<W||e>T)return null;let r=t.rotation*Math.PI/180,o={x:Math.cos(r),y:Math.sin(r)},n={x:-o.y,y:o.x};return Array.from({length:e},(i,c)=>{let l=t.style==="intertwined"&&c%2===1?t.seatSpacing/2:0;return{type:"row",id:`__block_preview_${c}`,label:"",origin:{x:t.origin.x+n.x*c*t.rowGap+o.x*l,y:t.origin.y+n.y*c*t.rowGap+o.y*l},rotation:t.rotation,curve:t.curve,seatCount:t.seatsPerRow,seatSpacing:t.seatSpacing,categoryKey:"__preview__"}})}function G(t,e=t.rowCount){let r=J(t,e);return r?.length?I(r[r.length-1]):null}function Nt(t,e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||t.rowGap<=0)return null;let r=G(t,1);if(!r)return null;let o=t.rotation*Math.PI/180,n={x:-Math.sin(o),y:Math.cos(o)},i=(e.x-r.x)*n.x+(e.y-r.y)*n.y,c=Math.max(W,Math.min(T,Math.round(i/t.rowGap)+1)),l=G(t,c);return l?{rowCount:c,edgePoint:l}:null}function At(t,e){return t.length!==e.rowCount?!1:[...t].sort((o,n)=>(o.rowBlockGeneration?.rowIndex??1/0)-(n.rowBlockGeneration?.rowIndex??1/0)).every((o,n)=>{let i=o.rowBlockGeneration;return i?.kind==="row-block-v1"&&i.groupId===e.groupId&&i.rowIndex===n&&i.signature===e.signature&&JSON.stringify(i)===JSON.stringify({...e,rowIndex:n})})}var h=1,b=300,D=330;function M(t){return t.seatCount>1?t.curve/(t.seatCount-1):0}function E(t,e){let r=t.rotation*Math.PI/180,o=M(t)*Math.PI/180,n,i;if(Math.abs(o)<1e-9)n=e*t.seatSpacing,i=0;else{let c=t.seatSpacing/(2*Math.sin(Math.abs(o)/2)),l=o*e;n=c*Math.sin(l),i=-c+c*Math.cos(l)}return{x:t.origin.x+n*Math.cos(r)-i*Math.sin(r),y:t.origin.y+n*Math.sin(r)+i*Math.cos(r)}}function Q(t,e,r){let o=(t??[]).map(n=>({...n,index:n.index+e})).filter(n=>n.index>=0&&n.index<r);return o.length?o:void 0}function U(t,e){if(t.path||!Number.isInteger(e)||e<h||e>b)return null;let r=M(t);return{...t,seatCount:e,curve:r*(e-1)}}function Y(t,e){if(t.path||!Number.isInteger(e)||e<h||e>b)return null;let r=M(t),o=t.seatCount-e,n=-o;return{...t,origin:E(t,o),rotation:B(t.rotation-r*o),seatCount:e,curve:r*(e-1),overrides:Q(t.overrides,n,e)}}function $(t,e=t.seatCount){let r=U(t,e);return r?E(r,e-1):null}function q(t,e=t.seatCount){return Y(t,e)?.origin??null}function Wt(t,e){if(t.path||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let r=M(t),o=Math.abs(r)<1e-9?b:Math.min(b,Math.floor(D/Math.abs(r))+1),n=null;for(let i=h;i<=Math.max(h,o);i+=1){let c=$(t,i);if(!c)continue;let l=Math.hypot(c.x-e.x,c.y-e.y),u=r*(i-1);(!n||l<n.distance||l===n.distance&&i<n.seatCount)&&(n={seatCount:i,curve:u,endpoint:c,distance:l})}return n}function Tt(t,e){if(t.path||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let r=M(t),o=Math.abs(r)<1e-9?b:Math.min(b,Math.floor(D/Math.abs(r))+1),n=null;for(let i=h;i<=Math.max(h,o);i+=1){let c=q(t,i);if(!c)continue;let l=Math.hypot(c.x-e.x,c.y-e.y),u=r*(i-1);(!n||l<n.distance||l===n.distance&&i<n.seatCount)&&(n={seatCount:i,curve:u,endpoint:c,distance:l})}return n}export{Mt as CATEGORY_INVENTORY_FAMILIES,H as GA_UNIT_LABEL_PREFIX,bt as GroupedTableProjectionError,D as MAX_DIRECT_ROW_SWEEP,tt as MAX_EVENT_INVENTORY,Z as MAX_GA_CAPACITY,T as MAX_ROW_BLOCK_ROWS,b as MAX_ROW_SEATS,W as MIN_ROW_BLOCK_ROWS,h as MIN_ROW_SEATS,pt as applicableTicketTiers,z as capacityControl,jt as categoryCapacity,k as chartCapacity,mt as companionSelectionIssue,Ct as describeCategoryInventoryConflict,gt as effectiveSeatOwnerCategoryCounts,it as gaAreasOf,rt as gaInventorySegments,et as gaUnitLabel,nt as gaUnitLabels,xt as groupedTableInventory,at as growJoinedGAInventory,wt as inspectCategoryInventoryConflicts,At as intactRowBlockMembers,ct as isFullChartDoc,V as isGaUnitLabel,dt as pickBestAvailable,ht as pickBestAvailableInventory,vt as remediateCategoryInventoryConflicts,_t as resizeChartCapacity,Nt as resolveRowBlockCount,Tt as resolveRowStartCapacity,Wt as resolveRowTerminalCapacity,ft as resolveTicketTierForSeat,G as rowBlockEdgePoint,J as rowBlockPreviewRows,q as rowStartEndpoint,$ as rowTerminalEndpoint,Y as rowWithStartCapacity,U as rowWithTerminalCapacity,st as strandedSingles,lt as ticketOptionNotApplicableIssue,yt as ticketSelectionIssue,ut as ticketTierAppliesToSeat,ot as validGAInventorySegments};
1
+ import{a as ut,b as pt,c as ft,d as mt,e as yt,f as dt,g as ht,h as bt,i as xt,j as Mt,k as gt,l as wt}from"../../chunk-K42NW62J.js";import{a as Ct,b as vt,c as Rt,d as Ot,e as St,f as B,h as N}from"../../chunk-D5ZLXZYU.js";import"../../chunk-TXF2XAK4.js";import"../../chunk-HC3U5BWH.js";import"../../chunk-TQN2VWQO.js";import"../../chunk-5BMXWOE7.js";import{a as et,b as ot,c as rt,d as nt,e as at,f as it,g as st,h as ct,i as lt}from"../../chunk-S4H34KCG.js";import"../../chunk-NKJS7MLW.js";import"../../chunk-4I2VWFJY.js";import{B as R,Ba as v,Ca as P,Ea as j,Fa as _,Ka as I,M as O,d as H,e as V,f as Z,g as tt,za as S}from"../../chunk-F45ZMLCU.js";import"../../chunk-5ITK5236.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";function g(t){return t.floors?.length?t.floors.flatMap(e=>e.objects):t.objects}function k(t){return g(t).reduce((e,r)=>r.type==="row"?e+S(r):r.type==="table"?e+j(r):r.type==="gaArea"?e+Math.max(0,Math.floor(r.capacity)):r.type==="booth"?e+1:e,0)}function Bt(t){let e={};for(let o of t.categories??[])e[o.key]=0;let r=(o,n)=>{n>0&&(e[o]=(e[o]??0)+n)};for(let o of g(t))if(o.type==="row")for(let n of v(o))r(n.categoryKey,1);else if(o.type==="table")if(o.bookAsWhole||o.variableOccupancy)r(o.categoryKey,Math.max(0,Math.round(o.seatCount)));else for(let n of _(o))r(n.categoryKey,1);else o.type==="gaArea"?r(o.categoryKey,Math.max(0,Math.floor(o.capacity))):o.type==="booth"&&r(o.categoryKey,1);return e}function z(t){if(!t.template)return null;let e=g(t),r=e.filter(u=>u.type==="row"||u.type==="table"||u.type==="gaArea");if(!r.length)return null;let n=e.filter(u=>u.type==="booth").length+r.reduce((u,f)=>u+(f.type==="table"?2:1),0),i=k(t),c=Math.max(n+1,Math.min(5e4,i*4)),l=[.5,1,1.5,2].map(u=>O(Math.round(i*u),n,c));return{family:t.template.family,display:t.template.family.replace(/-/g," ").replace(/\b\w/g,u=>u.toUpperCase()),min:n,max:c,presets:["S","M","L","XL"].map((u,f)=>({size:u,seats:l[f]}))}}function A(t){let e=v(t);return e.length?R(e):{...t.origin}}function Nt(t,e){let r=z(t);if(!r)return structuredClone(t);let o=structuredClone(t),n=g(o),i=n.filter(a=>a.type==="row"||a.type==="table"||a.type==="gaArea"),c=n.filter(a=>a.type==="booth").length,l=Math.max(r.min,Math.min(r.max,Math.round(e))),u=l-c,f=i.map((a,s)=>{let m=a.type==="gaArea"?Math.max(0,Math.floor(a.capacity)):a.seatCount,x=a.type==="table"?2:1;return{object:a,index:s,current:m,minimum:x,value:x,fraction:0}}),K=f.reduce((a,s)=>a+s.minimum,0),w=Math.max(0,u-K),L=f.reduce((a,s)=>a+Math.max(1,s.current-s.minimum),0);for(let a of f){let s=w*Math.max(1,a.current-a.minimum)/L,m=Math.floor(s);a.value+=m,a.fraction=s-m}w=u-f.reduce((a,s)=>a+s.value,0),f.sort((a,s)=>s.fraction-a.fraction||a.index-s.index);for(let a=0;a<w;a++)f[a%f.length].value++;f.sort((a,s)=>a.index-s.index);for(let a of f)if(a.object.type==="row"){let s=A(a.object);a.object.seatCount=a.value;let m=A(a.object);a.object.origin.x+=s.x-m.x,a.object.origin.y+=s.y-m.y}else if(a.object.type==="table"){let s=a.object;if(s.seatCountsBySide){let m=["top","bottom","left","right"],x=P(s),F=m.reduce((p,y)=>p+x[y],0)||1,d=m.map((p,y)=>{let C=a.value*x[p]/F;return{side:p,index:y,value:Math.floor(C),fraction:C-Math.floor(C)}}),X=a.value-d.reduce((p,y)=>p+y.value,0);d.sort((p,y)=>y.fraction-p.fraction||p.index-y.index);for(let p=0;p<X;p++)d[p%d.length].value+=1;d.sort((p,y)=>p.index-y.index),s.seatCountsBySide={top:d[0].value,bottom:d[1].value,left:d[2].value,right:d[3].value},s.sides=m.filter(p=>s.seatCountsBySide[p]>0)}s.seatCount=a.value,s.overrides&&(s.overrides=s.overrides.filter(m=>m.index<a.value),s.overrides.length||delete s.overrides)}else a.object.capacity=a.value;return o.floors?.length&&(o.objects=o.floors[0].objects),o.template={family:o.template.family,targetSeats:l},o=N(o).doc,o.template={family:t.template.family,targetSeats:k(o)},o}var W=1,T=100;function J(t,e){if(!Number.isInteger(e)||e<W||e>T)return null;let r=t.rotation*Math.PI/180,o={x:Math.cos(r),y:Math.sin(r)},n={x:-o.y,y:o.x};return Array.from({length:e},(i,c)=>{let l=t.style==="intertwined"&&c%2===1?t.seatSpacing/2:0;return{type:"row",id:`__block_preview_${c}`,label:"",origin:{x:t.origin.x+n.x*c*t.rowGap+o.x*l,y:t.origin.y+n.y*c*t.rowGap+o.y*l},rotation:t.rotation,curve:t.curve,seatCount:t.seatsPerRow,seatSpacing:t.seatSpacing,categoryKey:"__preview__"}})}function G(t,e=t.rowCount){let r=J(t,e);return r?.length?I(r[r.length-1]):null}function Gt(t,e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||t.rowGap<=0)return null;let r=G(t,1);if(!r)return null;let o=t.rotation*Math.PI/180,n={x:-Math.sin(o),y:Math.cos(o)},i=(e.x-r.x)*n.x+(e.y-r.y)*n.y,c=Math.max(W,Math.min(T,Math.round(i/t.rowGap)+1)),l=G(t,c);return l?{rowCount:c,edgePoint:l}:null}function Wt(t,e){return t.length!==e.rowCount?!1:[...t].sort((o,n)=>(o.rowBlockGeneration?.rowIndex??1/0)-(n.rowBlockGeneration?.rowIndex??1/0)).every((o,n)=>{let i=o.rowBlockGeneration;return i?.kind==="row-block-v1"&&i.groupId===e.groupId&&i.rowIndex===n&&i.signature===e.signature&&JSON.stringify(i)===JSON.stringify({...e,rowIndex:n})})}var h=1,b=300,D=330;function M(t){return t.seatCount>1?t.curve/(t.seatCount-1):0}function E(t,e){let r=t.rotation*Math.PI/180,o=M(t)*Math.PI/180,n,i;if(Math.abs(o)<1e-9)n=e*t.seatSpacing,i=0;else{let c=t.seatSpacing/(2*Math.sin(Math.abs(o)/2)),l=o*e;n=c*Math.sin(l),i=-c+c*Math.cos(l)}return{x:t.origin.x+n*Math.cos(r)-i*Math.sin(r),y:t.origin.y+n*Math.sin(r)+i*Math.cos(r)}}function Q(t,e,r){let o=(t??[]).map(n=>({...n,index:n.index+e})).filter(n=>n.index>=0&&n.index<r);return o.length?o:void 0}function U(t,e){if(t.path||!Number.isInteger(e)||e<h||e>b)return null;let r=M(t);return{...t,seatCount:e,curve:r*(e-1)}}function Y(t,e){if(t.path||!Number.isInteger(e)||e<h||e>b)return null;let r=M(t),o=t.seatCount-e,n=-o;return{...t,origin:E(t,o),rotation:B(t.rotation-r*o),seatCount:e,curve:r*(e-1),overrides:Q(t.overrides,n,e)}}function $(t,e=t.seatCount){let r=U(t,e);return r?E(r,e-1):null}function q(t,e=t.seatCount){return Y(t,e)?.origin??null}function Et(t,e){if(t.path||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let r=M(t),o=Math.abs(r)<1e-9?b:Math.min(b,Math.floor(D/Math.abs(r))+1),n=null;for(let i=h;i<=Math.max(h,o);i+=1){let c=$(t,i);if(!c)continue;let l=Math.hypot(c.x-e.x,c.y-e.y),u=r*(i-1);(!n||l<n.distance||l===n.distance&&i<n.seatCount)&&(n={seatCount:i,curve:u,endpoint:c,distance:l})}return n}function Kt(t,e){if(t.path||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let r=M(t),o=Math.abs(r)<1e-9?b:Math.min(b,Math.floor(D/Math.abs(r))+1),n=null;for(let i=h;i<=Math.max(h,o);i+=1){let c=q(t,i);if(!c)continue;let l=Math.hypot(c.x-e.x,c.y-e.y),u=r*(i-1);(!n||l<n.distance||l===n.distance&&i<n.seatCount)&&(n={seatCount:i,curve:u,endpoint:c,distance:l})}return n}export{Ct as CATEGORY_INVENTORY_FAMILIES,V as DEFAULT_EVENT_INVENTORY_LIMIT,et as GA_UNIT_LABEL_PREFIX,gt as GroupedTableProjectionError,Z as LARGE_VENUE_INVENTORY_MODULE,D as MAX_DIRECT_ROW_SWEEP,H as MAX_EVENT_INVENTORY,rt as MAX_GA_CAPACITY,T as MAX_ROW_BLOCK_ROWS,b as MAX_ROW_SEATS,W as MIN_ROW_BLOCK_ROWS,h as MIN_ROW_SEATS,yt as applicableTicketTiers,z as capacityControl,Bt as categoryCapacity,k as chartCapacity,ht as companionSelectionIssue,Ot as describeCategoryInventoryConflict,vt as effectiveSeatOwnerCategoryCounts,tt as eventInventoryLimitFor,lt as gaAreasOf,it as gaInventorySegments,nt as gaUnitLabel,st as gaUnitLabels,wt as groupedTableInventory,ct as growJoinedGAInventory,Rt as inspectCategoryInventoryConflicts,Wt as intactRowBlockMembers,pt as isFullChartDoc,ot as isGaUnitLabel,xt as pickBestAvailable,Mt as pickBestAvailableInventory,St as remediateCategoryInventoryConflicts,Nt as resizeChartCapacity,Gt as resolveRowBlockCount,Kt as resolveRowStartCapacity,Et as resolveRowTerminalCapacity,dt as resolveTicketTierForSeat,G as rowBlockEdgePoint,J as rowBlockPreviewRows,q as rowStartEndpoint,$ as rowTerminalEndpoint,Y as rowWithStartCapacity,U as rowWithTerminalCapacity,ut as strandedSingles,ft as ticketOptionNotApplicableIssue,bt as ticketSelectionIssue,mt as ticketTierAppliesToSeat,at as validGAInventorySegments};
@@ -1 +1 @@
1
- "use strict";var re=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var dt=Object.prototype.hasOwnProperty;var ht=(e,t)=>{for(var n in t)re(e,n,{get:t[n],enumerable:!0})},mt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ft(t))!dt.call(e,r)&&r!==n&&re(e,r,{get:()=>t[r],enumerable:!(o=ut(t,r))||o.enumerable});return e};var bt=e=>mt(re({},"__esModule",{value:!0}),e);var Gn={};ht(Gn,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>Ue,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>Xe,DEFAULT_SEAT_RADIUS:()=>lt,FLOOR_STACK_GAP_RATIO:()=>rt,FLOOR_STACK_MIN_SURFACE_PX:()=>at,TABLE_SEAT_OFFSET:()=>B,TEXT_BACKGROUND_PADDING_MAX:()=>oo,TEXT_BACKGROUND_RADIUS_MAX:()=>ro,TEXT_LETTER_SPACING_MAX:()=>to,TEXT_LETTER_SPACING_MIN:()=>eo,TEXT_LINE_HEIGHT_MAX:()=>Jn,TEXT_LINE_HEIGHT_MIN:()=>Zn,TEXT_OPACITY_MIN:()=>no,TEXT_WIDTH_MAX:()=>Qn,TEXT_WIDTH_MIN:()=>qn,allObjects:()=>nt,applyAffine:()=>Tn,automaticRoundTableRadius:()=>Zt,buildAisleHoles:()=>xt,buildSeatIndex:()=>Bn,buildSectionShell:()=>yt,chartBounds:()=>V,combinedFloorZoneId:()=>Pe,composeAffine:()=>_n,createPerspectiveCamera:()=>Rn,cubicPoint:()=>z,decomposeAffineLinear:()=>Ln,distanceToRings:()=>Re,distributeAlongCubic:()=>ie,expandBooth:()=>et,expandChart:()=>wn,expandRow:()=>Me,expandRowSlots:()=>Qe,expandTable:()=>Je,expandTableSlots:()=>Se,floorObjects:()=>Mn,floorStackPlacements:()=>st,floorsOf:()=>Q,gridStats:()=>Yn,hitTest:()=>Hn,initialFloorMode:()=>On,invertAffine:()=>An,layoutCombinedFloorPlan:()=>En,layoutFloorStack:()=>kn,mainFloorId:()=>ct,nearestWithin:()=>Xn,objectCenter:()=>we,owningSectionForObject:()=>tt,perspectiveTangentAffine:()=>Dn,pointInPolygon:()=>xe,pointInPolygonWithHoles:()=>K,polygonArea:()=>ae,polygonInscribedAnchor:()=>le,polygonLabelPoint:()=>xn,polygonNetArea:()=>wt,projectPerspectivePoint:()=>ne,queryRect:()=>Un,resolveSegmentedRowGroups:()=>ue,rowInventoryCount:()=>bn,rowSeatPositions:()=>ge,segmentedRowComponentSeats:()=>vt,segmentedRowComponents:()=>It,segmentedRowSeatTotal:()=>Ct,smoothCubicThroughMiddle:()=>pt,stackFloors:()=>Sn,tableInventoryCount:()=>pn,tableSeatCountsBySide:()=>Ze,textLayoutMetrics:()=>se,translateObject:()=>te});module.exports=bt(Gn);var Vn=Math.PI/180;function N(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function j(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function z(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function pt(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function ie(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[z(e,.5)];let o=Array.from({length:n+1},(c,u)=>z(e,u/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let u=o[c].x-o[c-1].x,l=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(u,l)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],a=1;for(let c=0;c<t;c+=1){let u=i*c/(t-1);for(;a<r.length-1&&r[a]<u;)a+=1;let l=r[a-1],d=r[a],m=d===l?0:(u-l)/(d-l);s.push({x:o[a-1].x+(o[a].x-o[a-1].x)*m,y:o[a-1].y+(o[a].y-o[a-1].y)*m})}return s}function A(e,t){return{x:e.x+t.x,y:e.y+t.y}}function G(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _(e,t){return{x:e.x*t,y:e.y*t}}function $(e,t=13){return Array.from({length:t},(n,o)=>z(e,o/(t-1)))}function Ie(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return j(e[o],e[o+1],n-o)}function ve(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[Ie(e,o)];for(let s=1;s<e.length-1;s+=1){let a=s/(e.length-1);a>o+1e-9&&a<r-1e-9&&i.push(e[s])}return i.push(Ie(e,r)),i}function Ce(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([m,y],b)=>{let h=N(j(e[m],e[y],.5),t);h<r&&(r=h,o=b)});let i=e[o],s=e[(o+1)%4],a=e[(o+2)%4],c=e[(o+3)%4],u=j(i,s,.5),l=G(t,u),d=Math.max(1e-9,Math.hypot(l.x,l.y));return{p0:i,p1:s,p2:a,p3:c,normal:_(l,1/d),depth:(N(i,c)+N(s,a))/2}}function ke(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:s}=e,a=G(n,t),c=G(o,r),u=s*.22,l=s*.12;return{nearPath:{start:t,control1:A(A(t,_(a,1/3)),_(i,u)),control2:A(A(t,_(a,2/3)),_(i,u)),end:n},farPath:{start:o,control1:A(A(r,_(c,2/3)),_(i,l)),control2:A(A(r,_(c,1/3)),_(i,l)),end:r}}}function yt(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((b,h)=>A(b,h),{x:0,y:0});o.x/=4,o.y/=4;let r=N(e[0],e[1]),i=N(e[0],e[3]),s=n==="auto"?r>i*1.25&&N(o,t)>i?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(b=>({...b}))};let a=Ce(e,t),{p0:c,p1:u,p2:l,p3:d}=a;if(s==="tapered")return{mode:s,outline:[A(c,_(G(u,c),.14)),A(c,_(G(u,c),1-.14)),l,d]};let{nearPath:m,farPath:y}=ke(a);return{mode:s,outline:[...$(m),...$(y).slice(1)]}}function xt(e,t,n,o){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let r=Ce(e,t),{p0:i,p1:s,p2:a,p3:c}=r,u=o==="bezier"?ke(r):null,l=u?$(u.nearPath):null,d=u?$(u.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(y,b)=>{let h=(b+1)/(n+1),f=h-m/2,p=h+m/2;return l&&d?[...ve(l,f,p),...ve(d,f,p).reverse()]:[j(i,s,f),j(i,s,p),j(c,a,p),j(c,a,f)]})}var qn=40,Qn=1200,Zn=.8,Jn=3,eo=-2,to=20,no=.1,oo=40,ro=40,Ee=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function gt(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/Ee(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let a of i.split(/\s+/)){let c=a.length;s&&s+1+c<=o?s+=1+c:(r+=Math.max(1,Math.ceil(c/o)),s=c%o)}}return Math.max(1,r)}function se(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(a=>a.length))*Ee(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=gt(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}function Mt(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))}function Re(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let s=Mt(e,o[i],o[r]);s<n&&(n=s)}return n}function Oe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,a=t[r].x,c=t[r].y;s>e.y!=c>e.y&&e.x<(a-i)*(e.y-s)/(c-s)+i&&(n=!n)}return n}function St(e,t,n){let o=Oe(e,t)&&!n.some(i=>Oe(e,i)),r=Re(e,[t,...n]);return o?r:-r}function H(e,t,n,o,r){let i=St({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var ce=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,s=i+1,a=r;if(i<t.length&&t[i].max>t[a].max&&(a=i),s<t.length&&t[s].max>t[a].max&&(a=s),a===r)break;[t[a],t[r]]=[t[r],t[a]],r=a}}return n}};function ae(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function wt(e,t){return Math.max(0,ae(e)-(t??[]).reduce((n,o)=>n+ae(o),0))}function le(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let h=e.reduce((p,g)=>p+g.x,0)/e.length,f=e.reduce((p,g)=>p+g.y,0)/e.length;return{point:{x:h,y:f},radius:0}}let o=1/0,r=1/0,i=-1/0,s=-1/0;for(let h of e)h.x<o&&(o=h.x),h.y<r&&(r=h.y),h.x>i&&(i=h.x),h.y>s&&(s=h.y);let a=i-o,c=s-r,u=Math.min(a,c);if(!(u>0))return{point:{x:(o+i)/2,y:(r+s)/2},radius:0};let l=Math.max(a,c)/150,d=new ce,m=u/2;for(let h=o;h<i;h+=u)for(let f=r;f<s;f+=u)d.push(H(h+m,f+m,m,e,n));let y=H(o+a/2,r+c/2,0,e,n),b=0;for(;d.size;){let h=d.pop();if(!h)break;h.d>y.d&&(y=h),!(h.max-y.d<=l)&&(b>=4e3||(b+=1,m=h.h/2,d.push(H(h.x-m,h.y-m,m,e,n)),d.push(H(h.x+m,h.y-m,m,e,n)),d.push(H(h.x-m,h.y+m,m,e,n)),d.push(H(h.x+m,h.y+m,m,e,n))))}return{point:{x:y.x,y:y.y},radius:Math.max(0,y.d)}}function W(e,t,n){return Math.max(t,Math.min(n,e))}function D(e,t,n){return e<t?t:e>n?n:e}var ao=Math.PI*2;function Te(e,t,n){return Pt(e,r=>({x:r.x+t,y:r.y+n}))}function Pt(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var lo=4/3;function It(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],s=e[r+1],a=Math.hypot(s.x-i.x,s.y-i.y);if(a<=0)continue;let c=Math.max(1,Math.round(a/n)),u=a/c,l=Math.atan2(s.y-i.y,s.x-i.x),d=r===0,y=(r>0?t[r-1]:void 0)==="break"?2:1,b=d?{...i}:{x:i.x+Math.cos(l)*u*y,y:i.y+Math.sin(l)*u*y},h=d?c+1:Math.max(1,c-(y-1));o.push({origin:b,rotation:l*180/Math.PI,seatCount:h,seatSpacing:u})}return o}function vt(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function Ct(e){return e.reduce((t,n)=>t+n.seatCount,0)}function ue(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((m,y)=>m.segmentedRow.componentIndex-y.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,a=i[0]?.segmentedRow;if(!a||!(s>=2&&i.length===s&&a?.boundaryBefore==="start"&&i.every((m,y)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===o&&m.segmentedRow.componentCount===s&&m.segmentedRow.componentIndex===y&&m.segmentedRow.repeatLabelOnComponents===a.repeatLabelOnComponents&&(y===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===a.displayLabel)))continue;let u=i.reduce((m,y)=>m+y.seatCount,0),l=0,d=0;for(let m of i)m.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(m.id,{groupId:o,adjacencyOffset:l,displayOffset:d,displayLabel:a.displayLabel,totalSeats:u,canonical:i[0],viewFromSeatUrl:a.viewFromSeatUrl,viewFromSeatMeta:a.viewFromSeatMeta,confidenceEvidence:a.confidenceEvidence}),l+=m.seatCount,d+=m.seatCount}return t}var kt="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Et="abcdefghijklmnopqrstuvwxyz";function Ot(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function fe(e,t=!1){let n=t?Et:kt;return Ot(Math.max(0,Math.floor(e)-1),n)}var Rt=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Ae(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Rt)for(;t>=o;)n+=r,t-=o;return n}function Tt(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function q(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",a=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let y=Math.ceil(c/2),b=i==="updown"?t<y?n+2*t:n-1+2*(c-t):t<y?n+2*(y-1-t):n+1+2*(t-y);return`${s}${b}`}let u=i==="odd"||i==="even"?2:r,l=a!=null&&Number.isFinite(a)?a-(c-1)*u:n,d=o==="center"?Tt(c)[t]:o==="rtl"?c-1-t:t,m;switch(i){case"odd":{let y=l%2===1?l:l+1;m=String(y+d*2);break}case"even":{let y=l%2===0?l:l+1;m=String(y+d*2);break}case"roman":m=Ae(l+d*r);break;case"letters-upper":m=fe(l+d*r,!1);break;case"letters-lower":m=fe(l+d*r,!0);break;default:m=String(l+d*r);break}return`${s}${m}`}function At(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function _e(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${q(e,t)}`}function de(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(e.seatDisplayLabelMode==="number")return q(e,t);if(!n)return`${e.displayLabel||e.label}-${q(e,t)}`;let r=At(n),i=n.displayOffset+t;return`${n.displayLabel}-${q(r,i)}`}var X=.02291666666666667,po=1/X,_t=58,Dt=_t*X;var Lt=3,De=0,he=120,Ft=0,jt=45,Nt=7,U=1.2;function me(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Bt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Nt?e:Lt}function Le(e,t={}){let n=me(t.floorBaseHeightM,De,he,0),o=Math.min(he,n+Bt(e.elevation)*Dt),r=e.height===void 0?o:me(e.height,De,he,o),i=me(e.rake,Ft,jt,0);return{height:r,rake:i}}function Fe(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function je(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],a=s.x-i.x,c=s.y-i.y,u=a*a+c*c,l=u>1e-12?((t-i.x)*a+(n-i.y)*c)/u:0;l<0?l=0:l>1&&(l=1);let d=Math.hypot(t-(i.x+l*a),n-(i.y+l*c));d<o&&(o=d)}return o}function Ht(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function Ne(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function be(e,t){let n=1/0;for(let o of Fe(e)){let r=je(t,o.x,o.y);r<n&&(n=r)}for(let o of Fe(t)){let r=je(e,o.x,o.y);r<n&&(n=r)}return n}function Xt(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let l of e)n+=l.x,o+=l.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let l of e){let d=Math.hypot(l.x-n,l.y-o);d>r&&(r=d,i=l)}let s=i.x-n,a=i.y-o,c=Math.hypot(s,a);c>1e-9?(s/=c,a/=c):(s=1,a=0);let u=e.map((l,d)=>({p:l,i:d,t:(l.x-n)*s+(l.y-o)*a})).sort((l,d)=>l.t-d.t);return{pts:u.map(l=>l.p),seatIndices:u.map(l=>t[l.i])}}function Ut(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let g of e)n+=g.x,o+=g.y;n/=t,o/=t;let r=0,i=0,s=0,a=0,c=0,u=0,l=0;for(let g of e){let x=g.x-n,M=g.y-o;r+=x*x,s+=M*M,i+=x*M,a+=x*x*x,c+=M*M*M,u+=x*M*M,l+=M*x*x}let d=r*s-i*i;if(Math.abs(d)<1e-9)return null;let m=(a+u)/2,y=(c+l)/2,b=(m*s-y*i)/d,h=(y*r-m*i)/d,f=b+n,p=h+o;return!Number.isFinite(f)||!Number.isFinite(p)?null:{cx:f,cy:p}}var Yt=.15;function Gt(e){if(e.length<2)return null;let t=e.map(g=>{let x=0,M=0;for(let P of g.pts)x+=P.x,M+=P.y;return{x:x/g.pts.length,y:M/g.pts.length}}),n=0,o=0;for(let g of t)n+=g.x,o+=g.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let g of t){let x=g.x-n,M=g.y-o;r+=x*x,i+=x*M,s+=M*M}let a=r+s,c=r*s-i*i,u=a/2+Math.sqrt(Math.max(0,a*a/4-c)),l,d;Math.abs(i)>1e-12?(l=u-s,d=i):r>=s?(l=1,d=0):(l=0,d=1);let m=Math.hypot(l,d);if(!(m>1e-12))return null;l/=m,d/=m;let y=1/0,b=-1/0,h=[];for(let g of e){let x=1/0,M=-1/0;for(let P of g.pts){let S=P.x*l+P.y*d;S<x&&(x=S),S>M&&(M=S),S<y&&(y=S),S>b&&(b=S)}h.push(M-x)}let f=b-y;return f>1e-9?(h.sort((g,x)=>g-x),h[Math.min(h.length-1,Math.floor(h.length*.9))]/f<=Kt?{x:l,y:d}:null):null}var Kt=.35;function Be(e,t,n,o){let r=new Map;for(let f of n){let p=t[f],g=p.rowId||`__seat-${f}`,x=r.get(g);x||(x={pts:[],idx:[]},r.set(g,x)),x.pts.push({x:p.x,y:p.y}),x.idx.push(f)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[f,p]of r){let g=Xt(p.pts,p.idx),x=0;for(let M of g.pts)x+=Math.hypot(M.x-o.x,M.y-o.y);i.push({id:f,pts:g.pts,seatIndices:g.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/g.pts.length})}let s=i.map(f=>Ht(f.pts)),a=[];for(let f=0;f<i.length;f++){let p=1/0;for(let g=0;g<i.length;g++){if(f===g||Ne(s[f],s[g])>=p)continue;let x=be(i[f].pts,i[g].pts);x<p&&(p=x)}Number.isFinite(p)&&a.push(p)}a.sort((f,p)=>f-p);let c=a.length?a[Math.floor(a.length/2)]:1,u=Math.max(c*1.8,1e-6),l=i.map(()=>[]);for(let f=0;f<i.length;f++)for(let p=f+1;p<i.length;p++)Ne(s[f],s[p])>u||be(i[f].pts,i[p].pts)<=u&&(l[f].push(p),l[p].push(f));let d=0;for(let f=0;f<i.length;f++){if(i[f].blockId!==-1)continue;let p=d++,g=[f];for(i[f].blockId=p;g.length;){let x=g.pop();for(let M of l[x])i[M].blockId===-1&&(i[M].blockId=p,g.push(M))}}let m=new Map;for(let f of i){let p=m.get(f.blockId)??[];p.push(f),m.set(f.blockId,p)}let y=[];for(let f of i){if(f.pts.length<4)continue;let p=Ut(f.pts);p&&(!Number.isFinite(p.cx)||!Number.isFinite(p.cy)||y.push({x:p.cx,y:p.cy}))}let b=y.length>=2?(()=>{let f=y.map(x=>x.x).sort((x,M)=>x-M),p=y.map(x=>x.y).sort((x,M)=>x-M),g=Math.floor(y.length/2);return{cx:f[g],cy:p[g]}})():null;if(b){let f=S=>Math.hypot(S.x-b.cx,S.y-b.cy),p=1/0,g=-1/0,x=[];for(let S of i){let w=1/0,I=-1/0;for(let v of S.pts){let C=f(v);C<w&&(w=C),C>I&&(I=C)}x.push(I-w),w<p&&(p=w),I>g&&(g=I)}let M=g-p;x.sort((S,w)=>S-w);let P=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(M>1e-9&&P/M<=Yt){let S=i.map(k=>{let L=0;for(let F of k.pts)L+=f(F);return{row:k,radius:L/k.pts.length}}),w=0,I=0;for(let k of S)w+=k.radius,I+=k.row.focalDistance;w/=S.length,I/=S.length;let v=0;for(let k of S)v+=(k.radius-w)*(k.row.focalDistance-I);if(v<0)for(let k of S)k.radius=-k.radius;let T=1/0;for(let k of S)k.radius<T&&(T=k.radius);S.sort((k,L)=>k.radius-L.radius);let R=-1,E=-1/0,O=M/Math.max(1,S.length)*.5,Y=[];for(let k of S)k.radius-E>O&&(R++,E=k.radius),k.row.ordinal=R,k.row.blockDepth=k.radius-T,Y.push(k.row);return{sectionId:e,rows:Y,blockCount:d}}}let h=[];for(let[,f]of m){let p=Gt(f);if(p){let g=M=>{let P=0;for(let S of M.pts)P+=S.x*p.x+S.y*p.y;return P/M.pts.length};f.sort((M,P)=>g(M)-g(P)),f.length>=2&&f[0].focalDistance>f[f.length-1].focalDistance&&f.reverse();let x=0;for(let M=0;M<f.length;M++)M>0&&(x+=be(f[M-1].pts,f[M].pts)),f[M].ordinal=M,f[M].blockDepth=x,h.push(f[M])}else{let g=1/0;for(let x of f)x.focalDistance<g&&(g=x.focalDistance);f.sort((x,M)=>x.focalDistance-M.focalDistance);for(let x=0;x<f.length;x++)f[x].ordinal=x,f[x].blockDepth=Math.max(0,f[x].focalDistance-g),h.push(f[x])}}return{sectionId:e,rows:h,blockCount:d}}var Vt=/^\d{4}-\d{2}-\d{2}$/;function zt(e){let t=Date.parse(e);return Number.isFinite(t)?Vt.test(e)?t+864e5:t:null}function $t(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=zt(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Wt(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function qt(e){return e.status!=="draft"&&e.status!=="retracted"}function Qt(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function He(e,t={}){return!!e&&qt(e)&&Wt(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Qt(e,t.activeBasisSha256)&&$t(e,t.now)}var Xe=36,Ue=160;function Zt(e,t=360){let n=W(Math.round(Number.isFinite(e)?e:1),1,40),o=W(Number.isFinite(t)?t:360,120,360);return Math.round(W(n*4*(360/o),Xe,Ue))}var wo=Math.PI*2;function Ye(e){return e==="pitch-football"||e==="rink-hockey"||e==="track-athletics"||e==="oval-cricket"}function Jt(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function en(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,a=e.y-t.y;return{x:t.x+s*r-a*i,y:t.y+s*i+a*r}}function Ge(e){let t=Jt(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>en(c,{x:t.reduce((u,l)=>u+l.x,0)/t.length,y:t.reduce((u,l)=>u+l.y,0)/t.length},n)),r=1/0,i=1/0,s=-1/0,a=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),s=Math.max(s,c.x),a=Math.max(a,c.y);return!Number.isFinite(r)||s-r<1e-6||a-i<1e-6?null:{minX:r,minY:i,maxX:s,maxY:a}}var tn=5,nn=3,on=.92,rn=1.9,sn=2,cn=.6,an=1,ln=.06;function un(e){return e.heightM!==void 0?e.heightM:Ye(e.stageKind)?ln:an}function Ke(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let s of Q(e)){let a=s.baseHeightM??0;for(let c of s.objects){if(c.type!=="shape"||c.role!=="stage")continue;let u=Ge(c);u&&(t=Math.min(t,u.minX),n=Math.min(n,u.minY),o=Math.max(o,u.maxX),r=Math.max(r,u.maxY),i=Math.max(i,a+un(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function fn(e,t,n,o){let r=1/0,i=1/0,s=-1/0,a=-1/0;for(let y of e)Number.isFinite(y.eyeHeightM)&&(r=Math.min(r,y.x),s=Math.max(s,y.x),i=Math.min(i,y.y),a=Math.max(a,y.y));if(!Number.isFinite(r))return null;let c=r*t,u=i*t,l=Math.max(1,Math.ceil((s-r)*t/n)+1),d=Math.max(1,Math.ceil((a-i)*t/n)+1),m=new Float64Array(l*d).fill(-1/0);for(let y of e){if(!Number.isFinite(y.eyeHeightM))continue;let b=y.eyeHeightM-U,h=Math.min(l-1,Math.max(0,Math.floor((y.x*t-c)/n))),p=Math.min(d-1,Math.max(0,Math.floor((y.y*t-u)/n)))*l+h,g=b+o;g>m[p]&&(m[p]=g)}return{cellM:n,minX:c,minY:u,cols:l,rows:d,top:m}}function dn(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function Ve(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??X,i=n.cellM??cn,s=n.chairBackM??on,a=n.selfRowSkipM??sn,c=n.clearThreshold??.9,u=n.partialThreshold??.25,l=Math.max(1,n.columns??tn),d=Math.max(1,n.rows??nn),m=fn(e,r,i,s);if(!m)return o;let y=(t.maxX-t.minX)*r,b=(t.maxY-t.minY)*r,h=y>=b,f=(t.minX+t.maxX)/2*r,p=(t.minY+t.maxY)/2*r,g=[];for(let M=0;M<l;M++){let P=(M+.5)/l-.5,S=h?f+P*y:f,w=h?p:p+P*b;for(let I=0;I<d;I++){let v=t.deckTopM+(d===1?0:I/(d-1)*rn);g.push({x:S,y:w,z:v})}}let x=i/2;for(let M of e){if(!Number.isFinite(M.eyeHeightM))continue;let P=M.x*r,S=M.y*r,w=M.eyeHeightM,I=0,v=1/0;for(let T of g){let R=T.x-P,E=T.y-S,O=Math.hypot(R,E);if(!(O>a)){I++;continue}let Y=R/O,k=E/O,L=0;for(let F=a;F<O;F+=x){let oe=dn(m,P+Y*F,S+k*F);if(!(!Number.isFinite(oe)||oe>=w)&&oe>w+(T.z-w)*F/O){L=F;break}}L?v=Math.min(v,L):I++}let C=I/g.length;C>=c||o.set(M.id,{seatId:M.id,mark:C<u?"obstructedView":"restrictedView",visibleFraction:C,totalRays:g.length,atDistanceM:Number.isFinite(v)?v:0})}return o}function ze(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function pe(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var ee=Math.PI/180,hn=9,B=16;function ye(e,t,n,o){let r=n*ee,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function ge(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return ie(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let u=0;u<t;u++)s.push(ye(u*n,0,r,i));return s}let a=o/(t-1)*ee,c=n/(2*Math.sin(Math.abs(a)/2));for(let u=0;u<t;u++){let l=u*a,d=c*Math.sin(l),m=-c+c*Math.cos(l);s.push(ye(d,m,r,i))}return s}function mn(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function bn(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function Qe(e,t){let n=mn(e);return ge(e).map((o,r)=>{let i=n.get(r),s=pe(i),a=_e(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:a,displayLabel:de(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(u=>u!==void 0&&u!==!1&&u!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function Me(e){let t=[];for(let n of Qe(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function Ze(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Se(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(l=>[l.index,l])),r=(l,d,m,y)=>{let b=o.get(l),h=pe(b),f=b?.label??`${e.label}-${l+1}`,p=e.displayLabel??e.label;return{index:l,label:f,displayLabel:b?.displayLabel??`${p}-${l+1}`,x:d+(b?.dx??0),y:m+(b?.dy??0),categoryKey:b?.categoryKey??e.categoryKey,skipped:!!b?.skip,accessible:h.length>0,accessibility:h,wheelchairSpaceType:b?.wheelchairSpaceType,commercial:b?.commercial,glyph:b?.glyph,viewUrl:b?.viewFromSeatUrl,viewMeta:b?.viewFromSeatUrl?b.viewFromSeatMeta:void 0,labelStyle:b?.labelStyle,...y?{side:y}:{}}};if(e.shape==="round"){let l=(e.radius??40)+B,d=e.rotation*ee,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let f=0;f<n;f++){let p=d+f/n*2*Math.PI;t.push(r(f,e.center.x+l*Math.cos(p),e.center.y+l*Math.sin(p)))}return t}let y=m*ee,b=(2*Math.PI-y)/2,h=d+b;for(let f=0;f<n;f++){let p=h+f/(n-1)*y;t.push(r(f,e.center.x+l*Math.cos(p),e.center.y+l*Math.sin(p)))}return t}let i=e.width??80,s=e.height??50,a=Ze(e),c=["top","bottom","left","right"],u=0;for(let l of c){let d=a[l];for(let m=0;m<d;m++){let y,b;l==="top"?(y=-i/2+(m+.5)*i/d,b=-s/2-B):l==="bottom"?(y=-i/2+(m+.5)*i/d,b=s/2+B):l==="left"?(y=-i/2-B,b=-s/2+(m+.5)*s/d):(y=i/2+B,b=-s/2+(m+.5)*s/d);let h=ye(y,b,e.rotation,e.center);t.push(r(u++,h.x,h.y,l))}}return t}function pn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Se(e).filter(t=>!t.skipped).length}function Je(e){return Se(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function et(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function xe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,a=t[r].x,c=t[r].y;s>e.y!=c>e.y&&e.x<(a-i)*(e.y-s)/(c-s)+i&&(n=!n)}return n}function yn(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),a=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=a+1e-7})}function K(e,t,n){return xe(e,t)&&!(n??[]).some(o=>xe(e,o)||yn(e,o))}function xn(e,t){return le(e,t).point}function J(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function we(e){switch(e.type){case"row":{let t=Me(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return J(e.points);case"section":return J(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?J(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function $e(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function gn(e,t){if(e.type!=="gaArea"||!$e(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>$e(r,o[i]))}function tt(e,t,n=e.filter(r=>r.type==="section"),o=we(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(gn(t,s)||K(o,s.outline,s.holes))):void 0)??n.find(s=>K(o,s.outline,s.holes))}function Q(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function Mn(e,t){let n=Q(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function nt(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function te(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:e.holes.map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:Te(e.outlinePath,t,n)}:{},...e.holes?{holes:e.holes.map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function Sn(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let s of o.objects)n.push(i===0?s:te(s,0,i))}),{...e,objects:n,floors:void 0}}function We(e,t,n,o,r,i,s,a,c){let u=[],l=e.filter(h=>h.type==="section"),d=ue(e),m=h=>!h?.eventConfigurationId||h.eventConfigurationId===o&&(h.eventConfigurationVersion===void 0||h.eventConfigurationVersion===c),y=h=>He(h,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:a}),b=(h,f)=>y(h)?{...h,coverage:f}:void 0;for(let h of e){let f=[];if(h.type==="row"?f=Me(h):h.type==="table"?f=Je(h):h.type==="booth"&&(f=et(h)),!f.length)continue;for(let P of f)P.viewUrl&&!m(P.viewMeta)&&(P.viewUrl=void 0,P.viewMeta=void 0);if(h.type==="row"){let P=d.get(h.id);if(P){let S=new Map((h.overrides??[]).map(w=>[w.index,w]));for(let w of f){let I=Number(w.id.slice(w.id.lastIndexOf(":")+1));if(!Number.isInteger(I))continue;w.logicalRowId=P.groupId,w.logicalSeatIndex=P.adjacencyOffset+I,S.get(I)?.displayLabel||(w.displayLabel=de(h,I,P)),!w.viewUrl&&P.viewFromSeatUrl&&m(P.viewFromSeatMeta)&&(w.viewUrl=P.viewFromSeatUrl,w.viewMeta=P.viewFromSeatMeta);let v=S.get(I)?.confidenceEvidence;w.confidenceEvidence=b(v,"exact-seat")??b(h.confidenceEvidence,"row-representative")??b(P.confidenceEvidence,"row-representative")}}}let p=tt(e,h,l,h.type==="row"?J(f):we(h)),g=p?.viewFromSeatUrl,M=(p?.zone?t?.find(P=>P.id===p.zone):void 0)?.focalPoint??n;for(let P of f){if(!P.confidenceEvidence){let S=Number(P.id.slice(P.id.lastIndexOf(":")+1)),w=(h.type==="row"||h.type==="table")&&Number.isInteger(S)?h.overrides?.find(I=>I.index===S)?.confidenceEvidence:void 0;P.confidenceEvidence=b(w,"exact-seat")??(h.type==="row"?b(h.confidenceEvidence,"row-representative"):void 0)}P.confidenceEvidence??=b(p?.confidenceEvidence,"section-representative")??(s?b(s.evidence,s.coverage):void 0),!P.viewUrl&&g&&m(p?.viewFromSeatMeta)&&(P.viewUrl=g,P.viewMeta=p?.viewFromSeatMeta),!P.viewUrl&&i&&m(i.meta)&&(P.viewUrl=i.url,P.viewMeta=i.meta),p&&(P.sectionId=p.logicalSectionId??p.id),p?.zone&&(P.zoneId=p.zone),M&&(P.focalPoint={...M})}u.push(...f)}return u}function wn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,a=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=We(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,a,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&qe(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let u of c)u.floorId=r.id;o.push(...c)}return o}let n=We(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&qe(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Pn(e,n,t)}function Pn(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||ze(t,Ve(t,Ke(e))),t}function qe(e,t,n,o){let r=e.filter(d=>d.type==="section"),i=n>0||r.some(d=>d.height!==void 0||d.rake!==void 0||(d.elevation??0)>0);if(!r.length||!i||!t){for(let d of o)d.eyeHeightM=n+U;return}let s=new Array(o.length),a=new Map;for(let d of r)a.has(d.id)||a.set(d.id,d);let c=new Map,u=new Map;for(let d=0;d<o.length;d++){let m=o[d],b=(m.sectionId?a.get(m.sectionId)??r.find(f=>f.logicalSectionId===m.sectionId&&K({x:m.x,y:m.y},f.outline,f.holes)):void 0)??r.find(f=>K({x:m.x,y:m.y},f.outline,f.holes))??null;if(s[d]=b,!b)continue;c.has(b.id)||c.set(b.id,Le(b,{floorBaseHeightM:n}));let h=u.get(b.id);h?h.push(d):u.set(b.id,[d])}let l=new Array(o.length).fill(void 0);for(let[d,m]of u){let y=c.get(d);if(!y)continue;let b=y.rake>0?Math.tan(y.rake*Math.PI/180):0,h=Be(d,o,m,t);for(let f of h.rows){let p=f.blockDepth*X*b,g=y.height+p;for(let x of f.seatIndices)l[x]=g}}for(let d=0;d<o.length;d++){let m=o[d],y=s[d];if(!y){m.eyeHeightM=n+U;continue}let b=c.get(y.id);m.eyeHeightM=(l[d]??b.height)+U}}var Z=40;function V(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,s=-1/0,a=(c,u)=>{c<o&&(o=c),u<r&&(r=u),c>i&&(i=c),u>s&&(s=u)};for(let c of nt(e))if(c.type==="row"){let u=new Map((c.overrides??[]).map(l=>[l.index,l]));ge(c).forEach((l,d)=>{let m=u.get(d);m?.skip||a(l.x+(m?.dx??0),l.y+(m?.dy??0))})}else if(c.type==="gaArea")for(let u of c.points)a(u.x,u.y);else if(c.type==="section")for(let u of c.outline)a(u.x,u.y);else if(c.type==="decorImage")a(c.x,c.y),a(c.x+c.width,c.y+c.height);else if(c.type==="shape")if(c.points&&c.points.length)for(let u of c.points)a(u.x,u.y);else c.x!=null&&c.y!=null&&c.width!=null&&c.height!=null&&(a(c.x,c.y),a(c.x+c.width,c.y+c.height));else if(c.type==="table"){let u=B+hn,l=c.shape==="round"?(c.radius??40)+u:Math.max((c.width??80)/2,(c.height??50)/2)+u;a(c.center.x-l,c.center.y-l),a(c.center.x+l,c.center.y+l)}else if(c.type==="booth"){let u=Math.max(c.width,c.height)/2;a(c.center.x-u,c.center.y-u),a(c.center.x+u,c.center.y+u)}else if(c.type==="text"){if(n)continue;let u=se(c);a(c.position.x,c.position.y),a(c.position.x+u.width,c.position.y+u.height)}for(let c of[e.referenceImage,e.backgroundImage]){if(!c)continue;let{center:u,width:l}=c,d=l*3/4;a(u.x-l/2,u.y-d/2),a(u.x+l/2,u.y+d/2)}if(!isFinite(o)){let c=e.focalPoint??{x:0,y:0};return{x:c.x-200,y:c.y-200,width:400,height:400}}return{x:o-Z,y:r-Z,width:i-o+Z*2,height:s-r+Z*2}}function ot(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var rt=.08,In=.045;function Pe(e){return`__floor__:${encodeURIComponent(e)}`}function it(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function vn(e,t,n){let o=e.focalPoint??t.focalPoint;return o?o.x:n.x+n.width/2}function st(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(s=>V(it(e,s.objects,s.focalPoint),{freeText:"exclude"})),r=Math.max(1,...n.map(s=>s.width))*rt,i=0;return t.map((s,a)=>{let c=n[a],u=i-(c.y+c.height);return i-=c.height+r,{floorId:s.id,label:s.name??s.id,level:a,levelBadge:a===0?"G":String(a),translation:{x:-vn(s,e,c),y:u},bounds:c}})}function Cn(e,t,n,o){let r=t==="name"?e.label:e.levelBadge;if(!r)return[];let i=Math.max(1,n*In),s=e.bounds.x+e.translation.x,a=e.bounds.y+e.translation.y+i*.4,c=`floor-level-${e.floorId}`,u={type:"text",id:`${c}-text`,text:r,position:{x:s,y:a},fontSize:i,rotation:0,color:o,bold:!0};if(t==="name")return[u];let l=i*.95;return[{type:"shape",id:`${c}-badge`,kind:"ellipse",x:s-l*.35,y:a-l*.3,width:l*2,height:l*2,fill:"transparent",stroke:{color:o,width:Math.max(1,i*.09)},opacity:.8},u]}function kn(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let o=st(e),r=[];n.forEach((u,l)=>{let{x:d,y:m}=o[l].translation;for(let y of u.objects)l>0&&y.type==="shape"&&y.role==="stage"||r.push(te(y,d,m))});let i={...e,objects:r,floors:void 0},s=V(i,{freeText:"exclude"}),a=Math.max(1,s.width,s.height),c=e.theme?.textColor??"#94a3b8";for(let u of o)r.push(...Cn(u,t.labelStyle??"number",a,c));return{...i,objects:r,referenceImage:void 0,backgroundImage:void 0}}function En(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,o=e.floors.flatMap(i=>i.objects.flatMap(s=>{if(s.type==="shape"&&s.role==="stage"){let a=JSON.stringify([s.kind,s.x,s.y,s.width,s.height,s.points,s.rotation??0,s.label,s.heightM,s.eventConfigurationIds]);if(n.has(a))return[];n.add(a)}return t&&s.type==="section"?[{...s,zone:Pe(i.id)}]:[s]})),r=t?e.floors.map(i=>({id:Pe(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:o,zones:r,floors:void 0,referenceImage:void 0,backgroundImage:ot(e)}}function ct(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(s=>s.type==="shape"&&s.role==="stage"));if(n)return n.id;let o=t[0],r=-1;for(let i of t){let s=V(it(e,i.objects,i.focalPoint),{freeText:"exclude"}),a=s.width*s.height;a>r&&(r=a,o=i)}return o.id}var at=640;function On(e,t){return(e.floors?.length??0)<2?null:e.floorOverview==="combined"||!Number.isFinite(t)||t<=0||t>=at?"all":ct(e)}function Rn(e,t=0){let n=Math.max(1,e.width,e.height),o={x:e.x+e.width/2,y:e.y+e.height/2},r=n*1.55,i=Math.max(n*.82,Math.max(0,t)+n*.45);return{target:o,distance:r,height:i,focalLength:Math.hypot(r,i),yawRad:-8*Math.PI/180}}function ne(e,t,n=0){let o=t.x-e.target.x,r=t.y-e.target.y,i=Math.cos(e.yawRad),s=Math.sin(e.yawRad),a=o*i-r*s,u=o*s+r*i-e.distance,l=n-e.height,d=Math.hypot(e.distance,e.height),m=(-e.distance*u-e.height*l)/d,y=(-e.height*u+e.distance*l)/d,b=Math.max(d*.08,m),h=e.focalLength/b;return{x:e.target.x+a*h,y:e.target.y-y*h,depth:b,scale:h}}function Tn(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function An(e){let t=e.a*e.d-e.b*e.c;if(!Number.isFinite(t)||Math.abs(t)<1e-9)throw new Error("perspective projection produced a singular affine");let n=e.d/t,o=-e.b/t,r=-e.c/t,i=e.a/t;return{a:n,b:o,c:r,d:i,e:-(n*e.e+r*e.f),f:-(o*e.e+i*e.f)}}function _n(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function Dn(e,t,n=()=>0){let o=ne(e,t,n(t)),r={x:t.x+1,y:t.y},i={x:t.x,y:t.y+1},s=ne(e,r,n(r)),a=ne(e,i,n(i)),c=s.x-o.x,u=s.y-o.y,l=a.x-o.x,d=a.y-o.y;return{a:c,b:u,c:l,d,e:o.x-c*t.x-l*t.y,f:o.y-u*t.x-d*t.y}}function Ln(e){let t=Math.hypot(e.a,e.b),n=e.a*e.d-e.b*e.c;return{rotationDeg:Math.atan2(e.b,e.a)*180/Math.PI,scaleX:t,scaleY:n/Math.max(t,1e-9),skewX:(e.a*e.c+e.b*e.d)/Math.max(n,1e-9)}}var lt=9;function Fn(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,o=e.rotation??0;if(!o)return{hx:t,hy:n};let r=o*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r));return{hx:t*i+n*s,hy:t*s+n*i}}function jn(e,t,n){let o=t-e.seat.x,r=n-e.seat.y;if(e.shape.kind==="circle")return o*o+r*r<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,s=o,a=r;if(i){let c=-i*Math.PI/180,u=Math.cos(c),l=Math.sin(c);s=o*u-r*l,a=o*l+r*u}return Math.abs(s)<=e.shape.width/2&&Math.abs(a)<=e.shape.height/2}function Nn(e,t,n,o,r){if(e.shape.kind==="circle"){let b=Math.min(Math.max(e.seat.x,t),o),h=Math.min(Math.max(e.seat.y,n),r),f=e.seat.x-b,p=e.seat.y-h;return f*f+p*p<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=o&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=r&&e.seat.y+e.hy>=n;let s=i*Math.PI/180,a=Math.cos(s),c=Math.sin(s),u=e.shape.width/2,l=e.shape.height/2,d=[[-u,-l],[u,-l],[u,l],[-u,l]].map(([b,h])=>[e.seat.x+b*a-h*c,e.seat.y+b*c+h*a]),m=[[t,n],[o,n],[o,r],[t,r]],y=[[1,0],[0,1],[a,c],[-c,a]];for(let[b,h]of y){let f=1/0,p=-1/0;for(let[M,P]of d){let S=M*b+P*h;S<f&&(f=S),S>p&&(p=S)}let g=1/0,x=-1/0;for(let[M,P]of m){let S=M*b+P*h;S<g&&(g=S),S>x&&(x=S)}if(p<g||x<f)return!1}return!0}function Bn(e,t={}){let n=t.seatRadius??lt,o=e.length,r=new Array(o),i=1/0,s=1/0,a=-1/0,c=-1/0,u=0;for(let S=0;S<o;S++){let w=e[S],I=t.shapeOf?.(w)??{kind:"circle",r:n},{hx:v,hy:C}=Fn(I);r[S]={seat:w,shape:I,hx:v,hy:C},w.x-v<i&&(i=w.x-v),w.y-C<s&&(s=w.y-C),w.x+v>a&&(a=w.x+v),w.y+C>c&&(c=w.y+C),v>u&&(u=v),C>u&&(u=C)}o===0&&(i=0,s=0,a=0,c=0);let l=u>0?u*4:1,d=Math.max(a-i,0),m=Math.max(c-s,0),y=Math.max(64,t.maxCells??o*4),b=l,h=Math.max(1,Math.ceil(d/b)||1),f=Math.max(1,Math.ceil(m/b)||1);for(;h*f>y&&(h>1||f>1);)b*=2,h=Math.max(1,Math.ceil(d/b)||1),f=Math.max(1,Math.ceil(m/b)||1);let p=h*f,g=new Int32Array(p+1),x=0;for(let S=0;S<o;S++){let w=r[S],I=D(Math.floor((w.seat.x-w.hx-i)/b),0,h-1),v=D(Math.floor((w.seat.x+w.hx-i)/b),0,h-1),C=D(Math.floor((w.seat.y-w.hy-s)/b),0,f-1),T=D(Math.floor((w.seat.y+w.hy-s)/b),0,f-1);for(let R=C;R<=T;R++)for(let E=I;E<=v;E++)g[R*h+E+1]++,x++}for(let S=0;S<p;S++)g[S+1]+=g[S];let M=new Int32Array(x),P=g.slice(0,p);for(let S=0;S<o;S++){let w=r[S],I=D(Math.floor((w.seat.x-w.hx-i)/b),0,h-1),v=D(Math.floor((w.seat.x+w.hx-i)/b),0,h-1),C=D(Math.floor((w.seat.y-w.hy-s)/b),0,f-1),T=D(Math.floor((w.seat.y+w.hy-s)/b),0,f-1);for(let R=C;R<=T;R++)for(let E=I;E<=v;E++){let O=R*h+E;M[P[O]++]=S}}return{seats:e,entries:r,minX:i,minY:s,cell:b,cols:h,rows:f,cellStart:g,items:M,stamp:new Int32Array(o),epoch:0}}function Hn(e,t,n={}){let{cols:o,rows:r,cell:i,minX:s,minY:a,cellStart:c,items:u,entries:l}=e,d=Math.floor((t.x-s)/i),m=Math.floor((t.y-a)/i);if(d<0||m<0||d>=o||m>=r)return null;let y=m*o+d,b=c[y+1],h=-1,f=1/0;for(let p=c[y];p<b;p++){let g=u[p],x=l[g];if(n.filter&&!n.filter(x.seat.id,x.seat)||!jn(x,t.x,t.y))continue;let M=t.x-x.seat.x,P=t.y-x.seat.y,S=M*M+P*P;(S<f||S===f&&g<h)&&(f=S,h=g)}return h<0?null:l[h].seat.id}function Xn(e,t,n,o={}){if(!(n>0))return null;let{cols:r,rows:i,cell:s,minX:a,minY:c,cellStart:u,items:l,entries:d}=e,m=Math.max(0,Math.floor((t.x-n-a)/s)),y=Math.min(r-1,Math.floor((t.x+n-a)/s)),b=Math.max(0,Math.floor((t.y-n-c)/s)),h=Math.min(i-1,Math.floor((t.y+n-c)/s));if(m>y||b>h)return null;let f=-1,p=n*n,g=e.stamp,x=++e.epoch;for(let M=b;M<=h;M++){let P=M*r;for(let S=m;S<=y;S++){let w=P+S,I=u[w+1];for(let v=u[w];v<I;v++){let C=l[v];if(g[C]===x)continue;g[C]=x;let T=d[C];if(o.filter&&!o.filter(T.seat.id,T.seat))continue;let R=t.x-T.seat.x,E=t.y-T.seat.y,O=R*R+E*E;(O<p||O===p&&C<f)&&(p=O,f=C)}}}return f<0?null:d[f].seat.id}function Un(e,t,n={}){let o=Math.min(t.x,t.x+t.width),r=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),s=Math.max(t.y,t.y+t.height),a=n.mode??"center",{cols:c,rows:u,cell:l,minX:d,minY:m,cellStart:y,items:b,entries:h}=e,f=Math.max(0,Math.floor((o-d)/l)),p=Math.min(c-1,Math.floor((r-d)/l)),g=Math.max(0,Math.floor((i-m)/l)),x=Math.min(u-1,Math.floor((s-m)/l));if(f>p||g>x)return[];let M=[],P=e.stamp,S=++e.epoch;for(let w=g;w<=x;w++){let I=w*c;for(let v=f;v<=p;v++){let C=I+v,T=y[C+1];for(let R=y[C];R<T;R++){let E=b[R];if(P[E]===S)continue;P[E]=S;let O=h[E];if(n.filter&&!n.filter(O.seat.id,O.seat))continue;(a==="center"?O.seat.x>=o&&O.seat.x<=r&&O.seat.y>=i&&O.seat.y<=s:Nn(O,o,i,r,s))&&M.push(E)}}}return M.sort((w,I)=>w-I),M.map(w=>h[w].seat.id)}function Yn(e){let t=e.cols*e.rows,n=0,o=0;for(let i=0;i<t;i++){let s=e.cellStart[i+1]-e.cellStart[i];s>0&&n++,s>o&&(o=s)}let r=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:r,maxPerCell:o,meanPerOccupiedCell:n?r/n:0}}0&&(module.exports={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,DEFAULT_SEAT_RADIUS,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,TABLE_SEAT_OFFSET,TEXT_BACKGROUND_PADDING_MAX,TEXT_BACKGROUND_RADIUS_MAX,TEXT_LETTER_SPACING_MAX,TEXT_LETTER_SPACING_MIN,TEXT_LINE_HEIGHT_MAX,TEXT_LINE_HEIGHT_MIN,TEXT_OPACITY_MIN,TEXT_WIDTH_MAX,TEXT_WIDTH_MIN,allObjects,applyAffine,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chartBounds,combinedFloorZoneId,composeAffine,createPerspectiveCamera,cubicPoint,decomposeAffineLinear,distanceToRings,distributeAlongCubic,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,invertAffine,layoutCombinedFloorPlan,layoutFloorStack,mainFloorId,nearestWithin,objectCenter,owningSectionForObject,perspectiveTangentAffine,pointInPolygon,pointInPolygonWithHoles,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,projectPerspectivePoint,queryRect,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,stackFloors,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject});
1
+ "use strict";var ce=Object.defineProperty;var pt=Object.getOwnPropertyDescriptor;var yt=Object.getOwnPropertyNames;var xt=Object.prototype.hasOwnProperty;var gt=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},Mt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of yt(t))!xt.call(e,r)&&r!==n&&ce(e,r,{get:()=>t[r],enumerable:!(o=pt(t,r))||o.enumerable});return e};var St=e=>Mt(ce({},"__esModule",{value:!0}),e);var Wn={};gt(Wn,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>Ge,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>Ye,DEFAULT_SEAT_RADIUS:()=>ht,FLOOR_STACK_GAP_RATIO:()=>at,FLOOR_STACK_MIN_SURFACE_PX:()=>dt,TABLE_SEAT_OFFSET:()=>X,TEXT_BACKGROUND_PADDING_MAX:()=>ao,TEXT_BACKGROUND_RADIUS_MAX:()=>lo,TEXT_LETTER_SPACING_MAX:()=>so,TEXT_LETTER_SPACING_MIN:()=>io,TEXT_LINE_HEIGHT_MAX:()=>ro,TEXT_LINE_HEIGHT_MIN:()=>oo,TEXT_OPACITY_MIN:()=>co,TEXT_WIDTH_MAX:()=>no,TEXT_WIDTH_MIN:()=>to,allObjects:()=>st,applyAffine:()=>Fn,automaticRoundTableRadius:()=>rn,buildAisleHoles:()=>It,buildSeatIndex:()=>Gn,buildSectionShell:()=>Pt,chartBounds:()=>$,combinedFloorZoneId:()=>Ie,composeAffine:()=>jn,createPerspectiveCamera:()=>Ln,cubicPoint:()=>q,decomposeAffineLinear:()=>Hn,distanceToRings:()=>Ae,distributeAlongCubic:()=>ae,expandBooth:()=>rt,expandChart:()=>kn,expandRow:()=>tt,expandRowSlots:()=>et,expandTable:()=>ot,expandTableSlots:()=>we,floorObjects:()=>vn,floorStackPlacements:()=>ut,floorsOf:()=>ee,gridStats:()=>$n,hitTest:()=>Kn,initialFloorMode:()=>Dn,invertAffine:()=>Nn,layoutCombinedFloorPlan:()=>_n,layoutFloorStack:()=>An,mainFloorId:()=>ft,nearestWithin:()=>Vn,objectCenter:()=>Pe,owningSectionForObject:()=>it,perspectiveTangentAffine:()=>Bn,pointInPolygon:()=>Se,pointInPolygonWithHoles:()=>z,polygonArea:()=>fe,polygonInscribedAnchor:()=>de,polygonLabelPoint:()=>Pn,polygonNetArea:()=>Et,projectPerspectivePoint:()=>se,queryRect:()=>zn,resolveSegmentedRowGroups:()=>he,rowInventoryCount:()=>Mn,rowSeatPositions:()=>re,segmentedRowComponentSeats:()=>Tt,segmentedRowComponents:()=>Rt,segmentedRowSeatTotal:()=>At,smoothCubicThroughMiddle:()=>wt,stackFloors:()=>Cn,tableInventoryCount:()=>Sn,tableSeatCountsBySide:()=>nt,textLayoutMetrics:()=>le,translateObject:()=>ie});module.exports=St(Wn);var Qn=Math.PI/180;function H(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function F(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function q(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function wt(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function ae(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[q(e,.5)];let o=Array.from({length:n+1},(c,u)=>q(e,u/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let u=o[c].x-o[c-1].x,l=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(u,l)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],a=1;for(let c=0;c<t;c+=1){let u=i*c/(t-1);for(;a<r.length-1&&r[a]<u;)a+=1;let l=r[a-1],d=r[a],m=d===l?0:(u-l)/(d-l);s.push({x:o[a-1].x+(o[a].x-o[a-1].x)*m,y:o[a-1].y+(o[a].y-o[a-1].y)*m})}return s}function A(e,t){return{x:e.x+t.x,y:e.y+t.y}}function V(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _(e,t){return{x:e.x*t,y:e.y*t}}function Q(e,t=13){return Array.from({length:t},(n,o)=>q(e,o/(t-1)))}function Ce(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return F(e[o],e[o+1],n-o)}function ke(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[Ce(e,o)];for(let s=1;s<e.length-1;s+=1){let a=s/(e.length-1);a>o+1e-9&&a<r-1e-9&&i.push(e[s])}return i.push(Ce(e,r)),i}function Ee(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([m,y],p)=>{let h=H(F(e[m],e[y],.5),t);h<r&&(r=h,o=p)});let i=e[o],s=e[(o+1)%4],a=e[(o+2)%4],c=e[(o+3)%4],u=F(i,s,.5),l=V(t,u),d=Math.max(1e-9,Math.hypot(l.x,l.y));return{p0:i,p1:s,p2:a,p3:c,normal:_(l,1/d),depth:(H(i,c)+H(s,a))/2}}function Oe(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:s}=e,a=V(n,t),c=V(o,r),u=s*.22,l=s*.12;return{nearPath:{start:t,control1:A(A(t,_(a,1/3)),_(i,u)),control2:A(A(t,_(a,2/3)),_(i,u)),end:n},farPath:{start:o,control1:A(A(r,_(c,2/3)),_(i,l)),control2:A(A(r,_(c,1/3)),_(i,l)),end:r}}}function Pt(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((p,h)=>A(p,h),{x:0,y:0});o.x/=4,o.y/=4;let r=H(e[0],e[1]),i=H(e[0],e[3]),s=n==="auto"?r>i*1.25&&H(o,t)>i?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(p=>({...p}))};let a=Ee(e,t),{p0:c,p1:u,p2:l,p3:d}=a;if(s==="tapered")return{mode:s,outline:[A(c,_(V(u,c),.14)),A(c,_(V(u,c),1-.14)),l,d]};let{nearPath:m,farPath:y}=Oe(a);return{mode:s,outline:[...Q(m),...Q(y).slice(1)]}}function It(e,t,n,o){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let r=Ee(e,t),{p0:i,p1:s,p2:a,p3:c}=r,u=o==="bezier"?Oe(r):null,l=u?Q(u.nearPath):null,d=u?Q(u.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(y,p)=>{let h=(p+1)/(n+1),x=h-m/2,M=h+m/2;return l&&d?[...ke(l,x,M),...ke(d,x,M).reverse()]:[F(i,s,x),F(i,s,M),F(c,a,M),F(c,a,x)]})}var to=40,no=1200,oo=.8,ro=3,io=-2,so=20,co=.1,ao=40,lo=40,Re=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function vt(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/Re(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let a of i.split(/\s+/)){let c=a.length;s&&s+1+c<=o?s+=1+c:(r+=Math.max(1,Math.ceil(c/o)),s=c%o)}}return Math.max(1,r)}function le(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(a=>a.length))*Re(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=vt(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}function Ct(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))}function Ae(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let s=Ct(e,o[i],o[r]);s<n&&(n=s)}return n}function Te(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,a=t[r].x,c=t[r].y;s>e.y!=c>e.y&&e.x<(a-i)*(e.y-s)/(c-s)+i&&(n=!n)}return n}function kt(e,t,n){let o=Te(e,t)&&!n.some(i=>Te(e,i)),r=Ae(e,[t,...n]);return o?r:-r}function Y(e,t,n,o,r){let i=kt({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var ue=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,s=i+1,a=r;if(i<t.length&&t[i].max>t[a].max&&(a=i),s<t.length&&t[s].max>t[a].max&&(a=s),a===r)break;[t[a],t[r]]=[t[r],t[a]],r=a}}return n}};function fe(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function Et(e,t){return Math.max(0,fe(e)-(t??[]).reduce((n,o)=>n+fe(o),0))}function de(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let h=e.reduce((M,P)=>M+P.x,0)/e.length,x=e.reduce((M,P)=>M+P.y,0)/e.length;return{point:{x:h,y:x},radius:0}}let o=1/0,r=1/0,i=-1/0,s=-1/0;for(let h of e)h.x<o&&(o=h.x),h.y<r&&(r=h.y),h.x>i&&(i=h.x),h.y>s&&(s=h.y);let a=i-o,c=s-r,u=Math.min(a,c);if(!(u>0))return{point:{x:(o+i)/2,y:(r+s)/2},radius:0};let l=Math.max(a,c)/150,d=new ue,m=u/2;for(let h=o;h<i;h+=u)for(let x=r;x<s;x+=u)d.push(Y(h+m,x+m,m,e,n));let y=Y(o+a/2,r+c/2,0,e,n),p=0;for(;d.size;){let h=d.pop();if(!h)break;h.d>y.d&&(y=h),!(h.max-y.d<=l)&&(p>=4e3||(p+=1,m=h.h/2,d.push(Y(h.x-m,h.y-m,m,e,n)),d.push(Y(h.x+m,h.y-m,m,e,n)),d.push(Y(h.x-m,h.y+m,m,e,n)),d.push(Y(h.x+m,h.y+m,m,e,n))))}return{point:{x:y.x,y:y.y},radius:Math.max(0,y.d)}}function Z(e,t,n){return Math.max(t,Math.min(n,e))}function L(e,t,n){return e<t?t:e>n?n:e}var mo=Math.PI*2;function _e(e,t,n){return Ot(e,r=>({x:r.x+t,y:r.y+n}))}function Ot(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var bo=4/3;function Rt(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],s=e[r+1],a=Math.hypot(s.x-i.x,s.y-i.y);if(a<=0)continue;let c=Math.max(1,Math.round(a/n)),u=a/c,l=Math.atan2(s.y-i.y,s.x-i.x),d=r===0,y=(r>0?t[r-1]:void 0)==="break"?2:1,p=d?{...i}:{x:i.x+Math.cos(l)*u*y,y:i.y+Math.sin(l)*u*y},h=d?c+1:Math.max(1,c-(y-1));o.push({origin:p,rotation:l*180/Math.PI,seatCount:h,seatSpacing:u})}return o}function Tt(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function At(e){return e.reduce((t,n)=>t+n.seatCount,0)}function he(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((m,y)=>m.segmentedRow.componentIndex-y.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,a=i[0]?.segmentedRow;if(!a||!(s>=2&&i.length===s&&a?.boundaryBefore==="start"&&i.every((m,y)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===o&&m.segmentedRow.componentCount===s&&m.segmentedRow.componentIndex===y&&m.segmentedRow.repeatLabelOnComponents===a.repeatLabelOnComponents&&(y===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===a.displayLabel)))continue;let u=i.reduce((m,y)=>m+y.seatCount,0),l=0,d=0;for(let m of i)m.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(m.id,{groupId:o,adjacencyOffset:l,displayOffset:d,displayLabel:a.displayLabel,totalSeats:u,canonical:i[0],viewFromSeatUrl:a.viewFromSeatUrl,viewFromSeatMeta:a.viewFromSeatMeta,confidenceEvidence:a.confidenceEvidence}),l+=m.seatCount,d+=m.seatCount}return t}var _t="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Dt="abcdefghijklmnopqrstuvwxyz";function Lt(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function me(e,t=!1){let n=t?Dt:_t;return Lt(Math.max(0,Math.floor(e)-1),n)}var Ft=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function De(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Ft)for(;t>=o;)n+=r,t-=o;return n}function Nt(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function J(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",a=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let y=Math.ceil(c/2),p=i==="updown"?t<y?n+2*t:n-1+2*(c-t):t<y?n+2*(y-1-t):n+1+2*(t-y);return`${s}${p}`}let u=i==="odd"||i==="even"?2:r,l=a!=null&&Number.isFinite(a)?a-(c-1)*u:n,d=o==="center"?Nt(c)[t]:o==="rtl"?c-1-t:t,m;switch(i){case"odd":{let y=l%2===1?l:l+1;m=String(y+d*2);break}case"even":{let y=l%2===0?l:l+1;m=String(y+d*2);break}case"roman":m=De(l+d*r);break;case"letters-upper":m=me(l+d*r,!1);break;case"letters-lower":m=me(l+d*r,!0);break;default:m=String(l+d*r);break}return`${s}${m}`}function jt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Le(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${J(e,t)}`}function be(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(e.seatDisplayLabelMode==="number")return J(e,t);if(!n)return`${e.displayLabel||e.label}-${J(e,t)}`;let r=jt(n),i=n.displayOffset+t;return`${n.displayLabel}-${J(r,i)}`}var G=.02291666666666667,So=1/G,Bt=58,Ht=Bt*G;var Xt=3,Fe=0,pe=120,Ut=0,Yt=45,Gt=7,K=1.2;function ye(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Kt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Gt?e:Xt}function Ne(e,t={}){let n=ye(t.floorBaseHeightM,Fe,pe,0),o=Math.min(pe,n+Kt(e.elevation)*Ht),r=e.height===void 0?o:ye(e.height,Fe,pe,o),i=ye(e.rake,Ut,Yt,0);return{height:r,rake:i}}function je(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function Be(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],a=s.x-i.x,c=s.y-i.y,u=a*a+c*c,l=u>1e-12?((t-i.x)*a+(n-i.y)*c)/u:0;l<0?l=0:l>1&&(l=1);let d=t-(i.x+l*a),m=n-(i.y+l*c);if(Math.abs(d)>=o||Math.abs(m)>=o)continue;let y=Math.hypot(d,m);y<o&&(o=y)}return o}function Vt(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function He(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function xe(e,t){let n=1/0;for(let o of je(e)){let r=Be(t,o.x,o.y);r<n&&(n=r)}for(let o of je(t)){let r=Be(e,o.x,o.y);r<n&&(n=r)}return n}function zt(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let l of e)n+=l.x,o+=l.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let l of e){let d=Math.hypot(l.x-n,l.y-o);d>r&&(r=d,i=l)}let s=i.x-n,a=i.y-o,c=Math.hypot(s,a);c>1e-9?(s/=c,a/=c):(s=1,a=0);let u=e.map((l,d)=>({p:l,i:d,t:(l.x-n)*s+(l.y-o)*a})).sort((l,d)=>l.t-d.t);return{pts:u.map(l=>l.p),seatIndices:u.map(l=>t[l.i])}}function $t(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let P of e)n+=P.x,o+=P.y;n/=t,o/=t;let r=0,i=0,s=0,a=0,c=0,u=0,l=0;for(let P of e){let C=P.x-n,v=P.y-o;r+=C*C,s+=v*v,i+=C*v,a+=C*C*C,c+=v*v*v,u+=C*v*v,l+=v*C*C}let d=r*s-i*i;if(Math.abs(d)<1e-9)return null;let m=(a+u)/2,y=(c+l)/2,p=(m*s-y*i)/d,h=(y*r-m*i)/d,x=p+n,M=h+o;return!Number.isFinite(x)||!Number.isFinite(M)?null:{cx:x,cy:M}}var Wt=.15;function qt(e){if(e.length<2)return null;let t=e.map(P=>{let C=0,v=0;for(let w of P.pts)C+=w.x,v+=w.y;return{x:C/P.pts.length,y:v/P.pts.length}}),n=0,o=0;for(let P of t)n+=P.x,o+=P.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let P of t){let C=P.x-n,v=P.y-o;r+=C*C,i+=C*v,s+=v*v}let a=r+s,c=r*s-i*i,u=a/2+Math.sqrt(Math.max(0,a*a/4-c)),l,d;Math.abs(i)>1e-12?(l=u-s,d=i):r>=s?(l=1,d=0):(l=0,d=1);let m=Math.hypot(l,d);if(!(m>1e-12))return null;l/=m,d/=m;let y=1/0,p=-1/0,h=[];for(let P of e){let C=1/0,v=-1/0;for(let w of P.pts){let f=w.x*l+w.y*d;f<C&&(C=f),f>v&&(v=f),f<y&&(y=f),f>p&&(p=f)}h.push(v-C)}let x=p-y;return x>1e-9?(h.sort((P,C)=>P-C),h[Math.min(h.length-1,Math.floor(h.length*.9))]/x<=Qt?{x:l,y:d}:null):null}var Qt=.35;function Xe(e,t,n,o){let r=new Map;for(let f of n){let b=t[f],S=b.rowId||`__seat-${f}`,g=r.get(S);g||(g={pts:[],idx:[]},r.set(S,g)),g.pts.push({x:b.x,y:b.y}),g.idx.push(f)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[f,b]of r){let S=zt(b.pts,b.idx),g=0;for(let I of S.pts)g+=Math.hypot(I.x-o.x,I.y-o.y);i.push({id:f,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:g/S.pts.length})}let s=i.map(f=>Vt(f.pts)),a=i.length<=256?i.length*(i.length-1)/2:0,c=a?new Float64Array(a):null;c?.fill(Number.NaN);let u=c?new Map(i.map((f,b)=>[f,b])):null,l=(f,b)=>(f>b&&([f,b]=[b,f]),f*(2*i.length-f-1)/2+(b-f-1)),d=(f,b)=>{if(!c)return xe(i[f].pts,i[b].pts);let S=l(f,b),g=c[S];if(!Number.isNaN(g))return g;let I=xe(i[f].pts,i[b].pts);return c[S]=I,I},m=(f,b)=>u?d(u.get(f),u.get(b)):xe(f.pts,b.pts),y=[];for(let f=0;f<i.length;f++){let b=1/0;for(let S=0;S<i.length;S++){if(f===S||He(s[f],s[S])>=b)continue;let g=d(f,S);g<b&&(b=g)}Number.isFinite(b)&&y.push(b)}y.sort((f,b)=>f-b);let p=y.length?y[Math.floor(y.length/2)]:1,h=Math.max(p*1.8,1e-6),x=i.map(()=>[]);for(let f=0;f<i.length;f++)for(let b=f+1;b<i.length;b++)He(s[f],s[b])>h||d(f,b)<=h&&(x[f].push(b),x[b].push(f));let M=0;for(let f=0;f<i.length;f++){if(i[f].blockId!==-1)continue;let b=M++,S=[f];for(i[f].blockId=b;S.length;){let g=S.pop();for(let I of x[g])i[I].blockId===-1&&(i[I].blockId=b,S.push(I))}}let P=new Map;for(let f of i){let b=P.get(f.blockId)??[];b.push(f),P.set(f.blockId,b)}let C=[];for(let f of i){if(f.pts.length<4)continue;let b=$t(f.pts);b&&(!Number.isFinite(b.cx)||!Number.isFinite(b.cy)||C.push({x:b.cx,y:b.cy}))}let v=C.length>=2?(()=>{let f=C.map(g=>g.x).sort((g,I)=>g-I),b=C.map(g=>g.y).sort((g,I)=>g-I),S=Math.floor(C.length/2);return{cx:f[S],cy:b[S]}})():null;if(v){let f=k=>Math.hypot(k.x-v.cx,k.y-v.cy),b=1/0,S=-1/0,g=[];for(let k of i){let E=1/0,O=-1/0;for(let N of k.pts){let j=f(N);j<E&&(E=j),j>O&&(O=j)}g.push(O-E),E<b&&(b=E),O>S&&(S=O)}let I=S-b;g.sort((k,E)=>k-E);let T=g[Math.min(g.length-1,Math.floor(g.length*.9))];if(I>1e-9&&T/I<=Wt){let k=i.map(R=>{let W=0;for(let bt of R.pts)W+=f(bt);return{row:R,radius:W/R.pts.length}}),E=0,O=0;for(let R of k)E+=R.radius,O+=R.row.focalDistance;E/=k.length,O/=k.length;let N=0;for(let R of k)N+=(R.radius-E)*(R.row.focalDistance-O);if(N<0)for(let R of k)R.radius=-R.radius;let B=1/0;for(let R of k)R.radius<B&&(B=R.radius);k.sort((R,W)=>R.radius-W.radius);let D=-1,U=-1/0,mt=I/Math.max(1,k.length)*.5,ve=[];for(let R of k)R.radius-U>mt&&(D++,U=R.radius),R.row.ordinal=D,R.row.blockDepth=R.radius-B,ve.push(R.row);return{sectionId:e,rows:ve,blockCount:M}}}let w=[];for(let[,f]of P){let b=qt(f);if(b){let S=I=>{let T=0;for(let k of I.pts)T+=k.x*b.x+k.y*b.y;return T/I.pts.length};f.sort((I,T)=>S(I)-S(T)),f.length>=2&&f[0].focalDistance>f[f.length-1].focalDistance&&f.reverse();let g=0;for(let I=0;I<f.length;I++)I>0&&(g+=m(f[I-1],f[I])),f[I].ordinal=I,f[I].blockDepth=g,w.push(f[I])}else{let S=1/0;for(let g of f)g.focalDistance<S&&(S=g.focalDistance);f.sort((g,I)=>g.focalDistance-I.focalDistance);for(let g=0;g<f.length;g++)f[g].ordinal=g,f[g].blockDepth=Math.max(0,f[g].focalDistance-S),w.push(f[g])}}return{sectionId:e,rows:w,blockCount:M}}var Zt=/^\d{4}-\d{2}-\d{2}$/;function Jt(e){let t=Date.parse(e);return Number.isFinite(t)?Zt.test(e)?t+864e5:t:null}function en(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Jt(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function tn(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function nn(e){return e.status!=="draft"&&e.status!=="retracted"}function on(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function Ue(e,t={}){return!!e&&nn(e)&&tn(e,t.activeConfigurationId,t.activeConfigurationVersion)&&on(e,t.activeBasisSha256)&&en(e,t.now)}var Ye=36,Ge=160;function rn(e,t=360){let n=Z(Math.round(Number.isFinite(e)?e:1),1,40),o=Z(Number.isFinite(t)?t:360,120,360);return Math.round(Z(n*4*(360/o),Ye,Ge))}var ko=Math.PI*2;function Ke(e){return e==="pitch-football"||e==="rink-hockey"||e==="track-athletics"||e==="oval-cricket"}function sn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function cn(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,a=e.y-t.y;return{x:t.x+s*r-a*i,y:t.y+s*i+a*r}}function Ve(e){let t=sn(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>cn(c,{x:t.reduce((u,l)=>u+l.x,0)/t.length,y:t.reduce((u,l)=>u+l.y,0)/t.length},n)),r=1/0,i=1/0,s=-1/0,a=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),s=Math.max(s,c.x),a=Math.max(a,c.y);return!Number.isFinite(r)||s-r<1e-6||a-i<1e-6?null:{minX:r,minY:i,maxX:s,maxY:a}}var an=5,ln=3,un=.92,fn=1.9,dn=2,hn=.6,mn=1,bn=.06;function pn(e){return e.heightM!==void 0?e.heightM:Ke(e.stageKind)?bn:mn}function ze(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let s of ee(e)){let a=s.baseHeightM??0;for(let c of s.objects){if(c.type!=="shape"||c.role!=="stage")continue;let u=Ve(c);u&&(t=Math.min(t,u.minX),n=Math.min(n,u.minY),o=Math.max(o,u.maxX),r=Math.max(r,u.maxY),i=Math.max(i,a+pn(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function yn(e,t,n,o){let r=1/0,i=1/0,s=-1/0,a=-1/0;for(let y of e)Number.isFinite(y.eyeHeightM)&&(r=Math.min(r,y.x),s=Math.max(s,y.x),i=Math.min(i,y.y),a=Math.max(a,y.y));if(!Number.isFinite(r))return null;let c=r*t,u=i*t,l=Math.max(1,Math.ceil((s-r)*t/n)+1),d=Math.max(1,Math.ceil((a-i)*t/n)+1),m=new Float64Array(l*d).fill(-1/0);for(let y of e){if(!Number.isFinite(y.eyeHeightM))continue;let p=y.eyeHeightM-K,h=Math.min(l-1,Math.max(0,Math.floor((y.x*t-c)/n))),M=Math.min(d-1,Math.max(0,Math.floor((y.y*t-u)/n)))*l+h,P=p+o;P>m[M]&&(m[M]=P)}return{cellM:n,minX:c,minY:u,cols:l,rows:d,top:m}}function xn(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function $e(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??G,i=n.cellM??hn,s=n.chairBackM??un,a=n.selfRowSkipM??dn,c=n.clearThreshold??.9,u=n.partialThreshold??.25,l=Math.max(1,n.columns??an),d=Math.max(1,n.rows??ln),m=yn(e,r,i,s);if(!m)return o;let y=(t.maxX-t.minX)*r,p=(t.maxY-t.minY)*r,h=y>=p,x=(t.minX+t.maxX)/2*r,M=(t.minY+t.maxY)/2*r,P=[];for(let v=0;v<l;v++){let w=(v+.5)/l-.5,f=h?x+w*y:x,b=h?M:M+w*p;for(let S=0;S<d;S++){let g=t.deckTopM+(d===1?0:S/(d-1)*fn);P.push({x:f,y:b,z:g})}}let C=i/2;for(let v of e){if(!Number.isFinite(v.eyeHeightM))continue;let w=v.x*r,f=v.y*r,b=v.eyeHeightM,S=0,g=1/0;for(let T of P){let k=T.x-w,E=T.y-f,O=Math.hypot(k,E);if(!(O>a)){S++;continue}let N=k/O,j=E/O,B=0;for(let D=a;D<O;D+=C){let U=xn(m,w+N*D,f+j*D);if(!(!Number.isFinite(U)||U>=b)&&U>b+(T.z-b)*D/O){B=D;break}}B?g=Math.min(g,B):S++}let I=S/P.length;I>=c||o.set(v.id,{seatId:v.id,mark:I<u?"obstructedView":"restrictedView",visibleFraction:I,totalRays:P.length,atDistanceM:Number.isFinite(g)?g:0})}return o}function We(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function ge(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var oe=Math.PI/180,gn=9,X=16;function Me(e,t,n,o){let r=n*oe,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function re(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return ae(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let u=0;u<t;u++)s.push(Me(u*n,0,r,i));return s}let a=o/(t-1)*oe,c=n/(2*Math.sin(Math.abs(a)/2));for(let u=0;u<t;u++){let l=u*a,d=c*Math.sin(l),m=-c+c*Math.cos(l);s.push(Me(d,m,r,i))}return s}function Je(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Mn(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function et(e,t){let n=Je(e);return re(e).map((o,r)=>{let i=n.get(r),s=ge(i),a=Le(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:a,displayLabel:be(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(u=>u!==void 0&&u!==!1&&u!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function tt(e){let t=[];for(let n of et(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function nt(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function we(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(l=>[l.index,l])),r=(l,d,m,y)=>{let p=o.get(l),h=ge(p),x=p?.label??`${e.label}-${l+1}`,M=e.displayLabel??e.label;return{index:l,label:x,displayLabel:p?.displayLabel??`${M}-${l+1}`,x:d+(p?.dx??0),y:m+(p?.dy??0),categoryKey:p?.categoryKey??e.categoryKey,skipped:!!p?.skip,accessible:h.length>0,accessibility:h,wheelchairSpaceType:p?.wheelchairSpaceType,commercial:p?.commercial,glyph:p?.glyph,viewUrl:p?.viewFromSeatUrl,viewMeta:p?.viewFromSeatUrl?p.viewFromSeatMeta:void 0,labelStyle:p?.labelStyle,...y?{side:y}:{}}};if(e.shape==="round"){let l=(e.radius??40)+X,d=e.rotation*oe,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let x=0;x<n;x++){let M=d+x/n*2*Math.PI;t.push(r(x,e.center.x+l*Math.cos(M),e.center.y+l*Math.sin(M)))}return t}let y=m*oe,p=(2*Math.PI-y)/2,h=d+p;for(let x=0;x<n;x++){let M=h+x/(n-1)*y;t.push(r(x,e.center.x+l*Math.cos(M),e.center.y+l*Math.sin(M)))}return t}let i=e.width??80,s=e.height??50,a=nt(e),c=["top","bottom","left","right"],u=0;for(let l of c){let d=a[l];for(let m=0;m<d;m++){let y,p;l==="top"?(y=-i/2+(m+.5)*i/d,p=-s/2-X):l==="bottom"?(y=-i/2+(m+.5)*i/d,p=s/2+X):l==="left"?(y=-i/2-X,p=-s/2+(m+.5)*s/d):(y=i/2+X,p=-s/2+(m+.5)*s/d);let h=Me(y,p,e.rotation,e.center);t.push(r(u++,h.x,h.y,l))}}return t}function Sn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):we(e).filter(t=>!t.skipped).length}function ot(e){return we(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function rt(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function Se(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,a=t[r].x,c=t[r].y;s>e.y!=c>e.y&&e.x<(a-i)*(e.y-s)/(c-s)+i&&(n=!n)}return n}function wn(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),a=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=a+1e-7})}function z(e,t,n){return Se(e,t)&&!(n??[]).some(o=>Se(e,o)||wn(e,o))}function Pn(e,t){return de(e,t).point}function ne(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Pe(e){switch(e.type){case"row":{let t=re(e),n=Je(e),o=0,r=0,i=0;for(let s=0;s<t.length;s++){let a=n.get(s);a?.skip||(o+=t[s].x+(a?.dx??0),r+=t[s].y+(a?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ne(e.points);case"section":return ne(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ne(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function qe(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function In(e,t){if(e.type!=="gaArea"||!qe(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>qe(r,o[i]))}function it(e,t,n=e.filter(r=>r.type==="section"),o=Pe(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(In(t,s)||z(o,s.outline,s.holes))):void 0)??n.find(s=>z(o,s.outline,s.holes))}function ee(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function vn(e,t){let n=ee(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function st(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function ie(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:e.holes.map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:_e(e.outlinePath,t,n)}:{},...e.holes?{holes:e.holes.map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function Cn(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let s of o.objects)n.push(i===0?s:ie(s,0,i))}),{...e,objects:n,floors:void 0}}function Qe(e,t,n,o,r,i,s,a,c){let u=[],l=e.filter(h=>h.type==="section"),d=he(e),m=h=>!h?.eventConfigurationId||h.eventConfigurationId===o&&(h.eventConfigurationVersion===void 0||h.eventConfigurationVersion===c),y=h=>Ue(h,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:a}),p=(h,x)=>y(h)?{...h,coverage:x}:void 0;for(let h of e){let x=[];if(h.type==="row"?x=tt(h):h.type==="table"?x=ot(h):h.type==="booth"&&(x=rt(h)),!x.length)continue;for(let w of x)w.viewUrl&&!m(w.viewMeta)&&(w.viewUrl=void 0,w.viewMeta=void 0);if(h.type==="row"){let w=d.get(h.id);if(w){let f=new Map((h.overrides??[]).map(b=>[b.index,b]));for(let b of x){let S=Number(b.id.slice(b.id.lastIndexOf(":")+1));if(!Number.isInteger(S))continue;b.logicalRowId=w.groupId,b.logicalSeatIndex=w.adjacencyOffset+S,f.get(S)?.displayLabel||(b.displayLabel=be(h,S,w)),!b.viewUrl&&w.viewFromSeatUrl&&m(w.viewFromSeatMeta)&&(b.viewUrl=w.viewFromSeatUrl,b.viewMeta=w.viewFromSeatMeta);let g=f.get(S)?.confidenceEvidence;b.confidenceEvidence=p(g,"exact-seat")??p(h.confidenceEvidence,"row-representative")??p(w.confidenceEvidence,"row-representative")}}}let M=it(e,h,l,h.type==="row"?ne(x):Pe(h)),P=M?.viewFromSeatUrl,v=(M?.zone?t?.find(w=>w.id===M.zone):void 0)?.focalPoint??n;for(let w of x){if(!w.confidenceEvidence){let f=Number(w.id.slice(w.id.lastIndexOf(":")+1)),b=(h.type==="row"||h.type==="table")&&Number.isInteger(f)?h.overrides?.find(S=>S.index===f)?.confidenceEvidence:void 0;w.confidenceEvidence=p(b,"exact-seat")??(h.type==="row"?p(h.confidenceEvidence,"row-representative"):void 0)}w.confidenceEvidence??=p(M?.confidenceEvidence,"section-representative")??(s?p(s.evidence,s.coverage):void 0),!w.viewUrl&&P&&m(M?.viewFromSeatMeta)&&(w.viewUrl=P,w.viewMeta=M?.viewFromSeatMeta),!w.viewUrl&&i&&m(i.meta)&&(w.viewUrl=i.url,w.viewMeta=i.meta),M&&(w.sectionId=M.logicalSectionId??M.id),M?.zone&&(w.zoneId=M.zone),v&&(w.focalPoint={...v})}u.push(...x)}return u}function kn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,a=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=Qe(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,a,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Ze(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let u of c)u.floorId=r.id;for(let u of c)o.push(u)}return o}let n=Qe(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&Ze(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),En(e,n,t)}function En(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||We(t,$e(t,ze(e))),t}function Ze(e,t,n,o){let r=e.filter(d=>d.type==="section"),i=n>0||r.some(d=>d.height!==void 0||d.rake!==void 0||(d.elevation??0)>0);if(!r.length||!i||!t){for(let d of o)d.eyeHeightM=n+K;return}let s=new Array(o.length),a=new Map;for(let d of r)a.has(d.id)||a.set(d.id,d);let c=new Map,u=new Map;for(let d=0;d<o.length;d++){let m=o[d],p=(m.sectionId?a.get(m.sectionId)??r.find(x=>x.logicalSectionId===m.sectionId&&z({x:m.x,y:m.y},x.outline,x.holes)):void 0)??r.find(x=>z({x:m.x,y:m.y},x.outline,x.holes))??null;if(s[d]=p,!p)continue;c.has(p.id)||c.set(p.id,Ne(p,{floorBaseHeightM:n}));let h=u.get(p.id);h?h.push(d):u.set(p.id,[d])}let l=new Array(o.length).fill(void 0);for(let[d,m]of u){let y=c.get(d);if(!y)continue;let p=y.rake>0?Math.tan(y.rake*Math.PI/180):0,h=Xe(d,o,m,t);for(let x of h.rows){let M=x.blockDepth*G*p,P=y.height+M;for(let C of x.seatIndices)l[C]=P}}for(let d=0;d<o.length;d++){let m=o[d],y=s[d];if(!y){m.eyeHeightM=n+K;continue}let p=c.get(y.id);m.eyeHeightM=(l[d]??p.height)+K}}var te=40;function $(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,s=-1/0,a=(c,u)=>{c<o&&(o=c),u<r&&(r=u),c>i&&(i=c),u>s&&(s=u)};for(let c of st(e))if(c.type==="row"){let u=new Map((c.overrides??[]).map(l=>[l.index,l]));re(c).forEach((l,d)=>{let m=u.get(d);m?.skip||a(l.x+(m?.dx??0),l.y+(m?.dy??0))})}else if(c.type==="gaArea")for(let u of c.points)a(u.x,u.y);else if(c.type==="section")for(let u of c.outline)a(u.x,u.y);else if(c.type==="decorImage")a(c.x,c.y),a(c.x+c.width,c.y+c.height);else if(c.type==="shape")if(c.points&&c.points.length)for(let u of c.points)a(u.x,u.y);else c.x!=null&&c.y!=null&&c.width!=null&&c.height!=null&&(a(c.x,c.y),a(c.x+c.width,c.y+c.height));else if(c.type==="table"){let u=X+gn,l=c.shape==="round"?(c.radius??40)+u:Math.max((c.width??80)/2,(c.height??50)/2)+u;a(c.center.x-l,c.center.y-l),a(c.center.x+l,c.center.y+l)}else if(c.type==="booth"){let u=Math.max(c.width,c.height)/2;a(c.center.x-u,c.center.y-u),a(c.center.x+u,c.center.y+u)}else if(c.type==="text"){if(n)continue;let u=le(c);a(c.position.x,c.position.y),a(c.position.x+u.width,c.position.y+u.height)}for(let c of[e.referenceImage,e.backgroundImage]){if(!c)continue;let{center:u,width:l}=c,d=l*3/4;a(u.x-l/2,u.y-d/2),a(u.x+l/2,u.y+d/2)}if(!isFinite(o)){let c=e.focalPoint??{x:0,y:0};return{x:c.x-200,y:c.y-200,width:400,height:400}}return{x:o-te,y:r-te,width:i-o+te*2,height:s-r+te*2}}function ct(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var at=.08,On=.045;function Ie(e){return`__floor__:${encodeURIComponent(e)}`}function lt(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function Rn(e,t,n){let o=e.focalPoint??t.focalPoint;return o?o.x:n.x+n.width/2}function ut(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(s=>$(lt(e,s.objects,s.focalPoint),{freeText:"exclude"})),r=Math.max(1,...n.map(s=>s.width))*at,i=0;return t.map((s,a)=>{let c=n[a],u=i-(c.y+c.height);return i-=c.height+r,{floorId:s.id,label:s.name??s.id,level:a,levelBadge:a===0?"G":String(a),translation:{x:-Rn(s,e,c),y:u},bounds:c}})}function Tn(e,t,n,o){let r=t==="name"?e.label:e.levelBadge;if(!r)return[];let i=Math.max(1,n*On),s=e.bounds.x+e.translation.x,a=e.bounds.y+e.translation.y+i*.4,c=`floor-level-${e.floorId}`,u={type:"text",id:`${c}-text`,text:r,position:{x:s,y:a},fontSize:i,rotation:0,color:o,bold:!0};if(t==="name")return[u];let l=i*.95;return[{type:"shape",id:`${c}-badge`,kind:"ellipse",x:s-l*.35,y:a-l*.3,width:l*2,height:l*2,fill:"transparent",stroke:{color:o,width:Math.max(1,i*.09)},opacity:.8},u]}function An(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let o=ut(e),r=[];n.forEach((u,l)=>{let{x:d,y:m}=o[l].translation;for(let y of u.objects)l>0&&y.type==="shape"&&y.role==="stage"||r.push(ie(y,d,m))});let i={...e,objects:r,floors:void 0},s=$(i,{freeText:"exclude"}),a=Math.max(1,s.width,s.height),c=e.theme?.textColor??"#94a3b8";for(let u of o)r.push(...Tn(u,t.labelStyle??"number",a,c));return{...i,objects:r,referenceImage:void 0,backgroundImage:void 0}}function _n(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,o=e.floors.flatMap(i=>i.objects.flatMap(s=>{if(s.type==="shape"&&s.role==="stage"){let a=JSON.stringify([s.kind,s.x,s.y,s.width,s.height,s.points,s.rotation??0,s.label,s.heightM,s.eventConfigurationIds]);if(n.has(a))return[];n.add(a)}return t&&s.type==="section"?[{...s,zone:Ie(i.id)}]:[s]})),r=t?e.floors.map(i=>({id:Ie(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:o,zones:r,floors:void 0,referenceImage:void 0,backgroundImage:ct(e)}}function ft(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(s=>s.type==="shape"&&s.role==="stage"));if(n)return n.id;let o=t[0],r=-1;for(let i of t){let s=$(lt(e,i.objects,i.focalPoint),{freeText:"exclude"}),a=s.width*s.height;a>r&&(r=a,o=i)}return o.id}var dt=640;function Dn(e,t){return(e.floors?.length??0)<2?null:e.floorOverview==="combined"||!Number.isFinite(t)||t<=0||t>=dt?"all":ft(e)}function Ln(e,t=0){let n=Math.max(1,e.width,e.height),o={x:e.x+e.width/2,y:e.y+e.height/2},r=n*1.55,i=Math.max(n*.82,Math.max(0,t)+n*.45);return{target:o,distance:r,height:i,focalLength:Math.hypot(r,i),yawRad:-8*Math.PI/180}}function se(e,t,n=0){let o=t.x-e.target.x,r=t.y-e.target.y,i=Math.cos(e.yawRad),s=Math.sin(e.yawRad),a=o*i-r*s,u=o*s+r*i-e.distance,l=n-e.height,d=Math.hypot(e.distance,e.height),m=(-e.distance*u-e.height*l)/d,y=(-e.height*u+e.distance*l)/d,p=Math.max(d*.08,m),h=e.focalLength/p;return{x:e.target.x+a*h,y:e.target.y-y*h,depth:p,scale:h}}function Fn(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function Nn(e){let t=e.a*e.d-e.b*e.c;if(!Number.isFinite(t)||Math.abs(t)<1e-9)throw new Error("perspective projection produced a singular affine");let n=e.d/t,o=-e.b/t,r=-e.c/t,i=e.a/t;return{a:n,b:o,c:r,d:i,e:-(n*e.e+r*e.f),f:-(o*e.e+i*e.f)}}function jn(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function Bn(e,t,n=()=>0){let o=se(e,t,n(t)),r={x:t.x+1,y:t.y},i={x:t.x,y:t.y+1},s=se(e,r,n(r)),a=se(e,i,n(i)),c=s.x-o.x,u=s.y-o.y,l=a.x-o.x,d=a.y-o.y;return{a:c,b:u,c:l,d,e:o.x-c*t.x-l*t.y,f:o.y-u*t.x-d*t.y}}function Hn(e){let t=Math.hypot(e.a,e.b),n=e.a*e.d-e.b*e.c;return{rotationDeg:Math.atan2(e.b,e.a)*180/Math.PI,scaleX:t,scaleY:n/Math.max(t,1e-9),skewX:(e.a*e.c+e.b*e.d)/Math.max(n,1e-9)}}var ht=9;function Xn(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,o=e.rotation??0;if(!o)return{hx:t,hy:n};let r=o*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r));return{hx:t*i+n*s,hy:t*s+n*i}}function Un(e,t,n){let o=t-e.seat.x,r=n-e.seat.y;if(e.shape.kind==="circle")return o*o+r*r<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,s=o,a=r;if(i){let c=-i*Math.PI/180,u=Math.cos(c),l=Math.sin(c);s=o*u-r*l,a=o*l+r*u}return Math.abs(s)<=e.shape.width/2&&Math.abs(a)<=e.shape.height/2}function Yn(e,t,n,o,r){if(e.shape.kind==="circle"){let p=Math.min(Math.max(e.seat.x,t),o),h=Math.min(Math.max(e.seat.y,n),r),x=e.seat.x-p,M=e.seat.y-h;return x*x+M*M<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=o&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=r&&e.seat.y+e.hy>=n;let s=i*Math.PI/180,a=Math.cos(s),c=Math.sin(s),u=e.shape.width/2,l=e.shape.height/2,d=[[-u,-l],[u,-l],[u,l],[-u,l]].map(([p,h])=>[e.seat.x+p*a-h*c,e.seat.y+p*c+h*a]),m=[[t,n],[o,n],[o,r],[t,r]],y=[[1,0],[0,1],[a,c],[-c,a]];for(let[p,h]of y){let x=1/0,M=-1/0;for(let[v,w]of d){let f=v*p+w*h;f<x&&(x=f),f>M&&(M=f)}let P=1/0,C=-1/0;for(let[v,w]of m){let f=v*p+w*h;f<P&&(P=f),f>C&&(C=f)}if(M<P||C<x)return!1}return!0}function Gn(e,t={}){let n=t.seatRadius??ht,o=e.length,r=new Array(o),i=1/0,s=1/0,a=-1/0,c=-1/0,u=0;for(let f=0;f<o;f++){let b=e[f],S=t.shapeOf?.(b)??{kind:"circle",r:n},{hx:g,hy:I}=Xn(S);r[f]={seat:b,shape:S,hx:g,hy:I},b.x-g<i&&(i=b.x-g),b.y-I<s&&(s=b.y-I),b.x+g>a&&(a=b.x+g),b.y+I>c&&(c=b.y+I),g>u&&(u=g),I>u&&(u=I)}o===0&&(i=0,s=0,a=0,c=0);let l=u>0?u*4:1,d=Math.max(a-i,0),m=Math.max(c-s,0),y=Math.max(64,t.maxCells??o*4),p=l,h=Math.max(1,Math.ceil(d/p)||1),x=Math.max(1,Math.ceil(m/p)||1);for(;h*x>y&&(h>1||x>1);)p*=2,h=Math.max(1,Math.ceil(d/p)||1),x=Math.max(1,Math.ceil(m/p)||1);let M=h*x,P=new Int32Array(M+1),C=0;for(let f=0;f<o;f++){let b=r[f],S=L(Math.floor((b.seat.x-b.hx-i)/p),0,h-1),g=L(Math.floor((b.seat.x+b.hx-i)/p),0,h-1),I=L(Math.floor((b.seat.y-b.hy-s)/p),0,x-1),T=L(Math.floor((b.seat.y+b.hy-s)/p),0,x-1);for(let k=I;k<=T;k++)for(let E=S;E<=g;E++)P[k*h+E+1]++,C++}for(let f=0;f<M;f++)P[f+1]+=P[f];let v=new Int32Array(C),w=P.slice(0,M);for(let f=0;f<o;f++){let b=r[f],S=L(Math.floor((b.seat.x-b.hx-i)/p),0,h-1),g=L(Math.floor((b.seat.x+b.hx-i)/p),0,h-1),I=L(Math.floor((b.seat.y-b.hy-s)/p),0,x-1),T=L(Math.floor((b.seat.y+b.hy-s)/p),0,x-1);for(let k=I;k<=T;k++)for(let E=S;E<=g;E++){let O=k*h+E;v[w[O]++]=f}}return{seats:e,entries:r,minX:i,minY:s,cell:p,cols:h,rows:x,cellStart:P,items:v,stamp:new Int32Array(o),epoch:0}}function Kn(e,t,n={}){let{cols:o,rows:r,cell:i,minX:s,minY:a,cellStart:c,items:u,entries:l}=e,d=Math.floor((t.x-s)/i),m=Math.floor((t.y-a)/i);if(d<0||m<0||d>=o||m>=r)return null;let y=m*o+d,p=c[y+1],h=-1,x=1/0;for(let M=c[y];M<p;M++){let P=u[M],C=l[P];if(n.filter&&!n.filter(C.seat.id,C.seat)||!Un(C,t.x,t.y))continue;let v=t.x-C.seat.x,w=t.y-C.seat.y,f=v*v+w*w;(f<x||f===x&&P<h)&&(x=f,h=P)}return h<0?null:l[h].seat.id}function Vn(e,t,n,o={}){if(!(n>0))return null;let{cols:r,rows:i,cell:s,minX:a,minY:c,cellStart:u,items:l,entries:d}=e,m=Math.max(0,Math.floor((t.x-n-a)/s)),y=Math.min(r-1,Math.floor((t.x+n-a)/s)),p=Math.max(0,Math.floor((t.y-n-c)/s)),h=Math.min(i-1,Math.floor((t.y+n-c)/s));if(m>y||p>h)return null;let x=-1,M=n*n,P=e.stamp,C=++e.epoch;for(let v=p;v<=h;v++){let w=v*r;for(let f=m;f<=y;f++){let b=w+f,S=u[b+1];for(let g=u[b];g<S;g++){let I=l[g];if(P[I]===C)continue;P[I]=C;let T=d[I];if(o.filter&&!o.filter(T.seat.id,T.seat))continue;let k=t.x-T.seat.x,E=t.y-T.seat.y,O=k*k+E*E;(O<M||O===M&&I<x)&&(M=O,x=I)}}}return x<0?null:d[x].seat.id}function zn(e,t,n={}){let o=Math.min(t.x,t.x+t.width),r=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),s=Math.max(t.y,t.y+t.height),a=n.mode??"center",{cols:c,rows:u,cell:l,minX:d,minY:m,cellStart:y,items:p,entries:h}=e,x=Math.max(0,Math.floor((o-d)/l)),M=Math.min(c-1,Math.floor((r-d)/l)),P=Math.max(0,Math.floor((i-m)/l)),C=Math.min(u-1,Math.floor((s-m)/l));if(x>M||P>C)return[];let v=[],w=e.stamp,f=++e.epoch;for(let b=P;b<=C;b++){let S=b*c;for(let g=x;g<=M;g++){let I=S+g,T=y[I+1];for(let k=y[I];k<T;k++){let E=p[k];if(w[E]===f)continue;w[E]=f;let O=h[E];if(n.filter&&!n.filter(O.seat.id,O.seat))continue;(a==="center"?O.seat.x>=o&&O.seat.x<=r&&O.seat.y>=i&&O.seat.y<=s:Yn(O,o,i,r,s))&&v.push(E)}}}return v.sort((b,S)=>b-S),v.map(b=>h[b].seat.id)}function $n(e){let t=e.cols*e.rows,n=0,o=0;for(let i=0;i<t;i++){let s=e.cellStart[i+1]-e.cellStart[i];s>0&&n++,s>o&&(o=s)}let r=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:r,maxPerCell:o,meanPerOccupiedCell:n?r/n:0}}0&&(module.exports={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,DEFAULT_SEAT_RADIUS,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,TABLE_SEAT_OFFSET,TEXT_BACKGROUND_PADDING_MAX,TEXT_BACKGROUND_RADIUS_MAX,TEXT_LETTER_SPACING_MAX,TEXT_LETTER_SPACING_MIN,TEXT_LINE_HEIGHT_MAX,TEXT_LINE_HEIGHT_MIN,TEXT_OPACITY_MIN,TEXT_WIDTH_MAX,TEXT_WIDTH_MIN,allObjects,applyAffine,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chartBounds,combinedFloorZoneId,composeAffine,createPerspectiveCamera,cubicPoint,decomposeAffineLinear,distanceToRings,distributeAlongCubic,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,invertAffine,layoutCombinedFloorPlan,layoutFloorStack,mainFloorId,nearestWithin,objectCenter,owningSectionForObject,perspectiveTangentAffine,pointInPolygon,pointInPolygonWithHoles,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,projectPerspectivePoint,queryRect,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,stackFloors,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject});
@@ -1,8 +1,8 @@
1
- import { P as Point, v as CubicPath, w as TextObject } from '../../types-D91PAu7c.cjs';
2
- export { F as FloorLabelStyle } from '../../types-D91PAu7c.cjs';
3
- export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject } from '../../tableSizing-f-hh6kCg.cjs';
4
- export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-DR7Xz6mb.cjs';
5
- import { E as ExpandedSeat } from '../../renderer-DLTYfHV2.cjs';
1
+ import { P as Point, t as CubicPath, u as TextObject } from '../../types-BbqhOJ5L.cjs';
2
+ export { F as FloorLabelStyle } from '../../types-BbqhOJ5L.cjs';
3
+ export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject } from '../../tableSizing-DUSD6Ksr.cjs';
4
+ export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-BbHdWqJy.cjs';
5
+ import { E as ExpandedSeat } from '../../renderer-BePADdjE.cjs';
6
6
 
7
7
  type SectionShellMode = 'auto' | 'rectangle' | 'tapered' | 'bezier';
8
8
  declare function cubicPoint(path: CubicPath, t: number): Point;
@@ -1,8 +1,8 @@
1
- import { P as Point, v as CubicPath, w as TextObject } from '../../types-D91PAu7c.js';
2
- export { F as FloorLabelStyle } from '../../types-D91PAu7c.js';
3
- export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject } from '../../tableSizing-oDI0D8c2.js';
4
- export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-CfVeZaOw.js';
5
- import { E as ExpandedSeat } from '../../renderer-DN1yCX7-.js';
1
+ import { P as Point, t as CubicPath, u as TextObject } from '../../types-BbqhOJ5L.js';
2
+ export { F as FloorLabelStyle } from '../../types-BbqhOJ5L.js';
3
+ export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject } from '../../tableSizing-D7dXthik.js';
4
+ export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-oVUtwW87.js';
5
+ import { E as ExpandedSeat } from '../../renderer-B7IrAGHP.js';
6
6
 
7
7
  type SectionShellMode = 'auto' | 'rectangle' | 'tapered' | 'bezier';
8
8
  declare function cubicPoint(path: CubicPath, t: number): Point;
@@ -1 +1 @@
1
- import{a as T,b as U,c as V,d as W,e as X,f as Y,g as Z,h as _,i as eo,j as fo,k as mo,l as po,m as to,n as xo,o as ao,p as bo,q as co,r as go,s as ho,t as io,u as jo}from"../../chunk-GISLORLL.js";import{a as $,b as oo,c as ro}from"../../chunk-OYKT5CCU.js";import"../../chunk-5BMXWOE7.js";import{A as d,Aa as E,B as g,Ba as F,C as h,Ca as G,D as i,Da as H,E as j,Ea as I,F as k,Fa as J,G as l,Ga as K,H as n,Ha as L,Ia as M,Ja as N,Ka as O,La as P,Ma as Q,Na as R,Oa as S,V as q,W as s,X as u,Y as v,m as o,n as r,o as e,p as f,q as m,r as p,s as t,t as x,ta as w,u as a,ua as y,v as b,va as z,wa as A,xa as B,ya as C,z as c,za as D}from"../../chunk-W4RS6OW7.js";import"../../chunk-5ITK5236.js";import"../../chunk-CRCGO52K.js";export{oo as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,$ as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,eo as DEFAULT_SEAT_RADIUS,T as FLOOR_STACK_GAP_RATIO,Z as FLOOR_STACK_MIN_SURFACE_PX,w as TABLE_SEAT_OFFSET,x as TEXT_BACKGROUND_PADDING_MAX,a as TEXT_BACKGROUND_RADIUS_MAX,p as TEXT_LETTER_SPACING_MAX,m as TEXT_LETTER_SPACING_MIN,f as TEXT_LINE_HEIGHT_MAX,e as TEXT_LINE_HEIGHT_MIN,t as TEXT_OPACITY_MIN,r as TEXT_WIDTH_MAX,o as TEXT_WIDTH_MIN,O as allObjects,co as applyAffine,ro as automaticRoundTableRadius,i as buildAisleHoles,fo as buildSeatIndex,h as buildSectionShell,S as chartBounds,U as combinedFloorZoneId,ho as composeAffine,ao as createPerspectiveCamera,c as cubicPoint,jo as decomposeAffineLinear,j as distanceToRings,g as distributeAlongCubic,G as expandBooth,R as expandChart,B as expandRow,A as expandRowSlots,F as expandTable,D as expandTableSlots,N as floorObjects,V as floorStackPlacements,M as floorsOf,xo as gridStats,mo as hitTest,_ as initialFloorMode,go as invertAffine,X as layoutCombinedFloorPlan,W as layoutFloorStack,Y as mainFloorId,po as nearestWithin,K as objectCenter,L as owningSectionForObject,io as perspectiveTangentAffine,H as pointInPolygon,I as pointInPolygonWithHoles,k as polygonArea,n as polygonInscribedAnchor,J as polygonLabelPoint,l as polygonNetArea,bo as projectPerspectivePoint,to as queryRect,v as resolveSegmentedRowGroups,z as rowInventoryCount,y as rowSeatPositions,s as segmentedRowComponentSeats,q as segmentedRowComponents,u as segmentedRowSeatTotal,d as smoothCubicThroughMiddle,Q as stackFloors,E as tableInventoryCount,C as tableSeatCountsBySide,b as textLayoutMetrics,P as translateObject};
1
+ import{a as T,b as U,c as V,d as W,e as X,f as Y,g as Z,h as _,i as eo,j as fo,k as mo,l as po,m as to,n as xo,o as ao,p as bo,q as co,r as go,s as ho,t as io,u as jo}from"../../chunk-6FTHCEJW.js";import{a as $,b as oo,c as ro}from"../../chunk-TXF2XAK4.js";import"../../chunk-5BMXWOE7.js";import{$ as u,Aa as A,Ba as B,Ca as C,D as c,Da as D,E as d,Ea as E,F as g,Fa as F,G as h,Ga as G,H as i,Ha as H,I as j,Ia as I,J as k,Ja as J,K as l,Ka as K,L as n,La as L,Ma as M,Na as N,Oa as O,Pa as P,Qa as Q,Ra as R,Sa as S,Z as q,_ as s,aa as v,q as o,r,s as e,t as f,u as m,v as p,w as t,x,xa as w,y as a,ya as y,z as b,za as z}from"../../chunk-F45ZMLCU.js";import"../../chunk-5ITK5236.js";import"../../chunk-CRCGO52K.js";export{oo as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,$ as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,eo as DEFAULT_SEAT_RADIUS,T as FLOOR_STACK_GAP_RATIO,Z as FLOOR_STACK_MIN_SURFACE_PX,w as TABLE_SEAT_OFFSET,x as TEXT_BACKGROUND_PADDING_MAX,a as TEXT_BACKGROUND_RADIUS_MAX,p as TEXT_LETTER_SPACING_MAX,m as TEXT_LETTER_SPACING_MIN,f as TEXT_LINE_HEIGHT_MAX,e as TEXT_LINE_HEIGHT_MIN,t as TEXT_OPACITY_MIN,r as TEXT_WIDTH_MAX,o as TEXT_WIDTH_MIN,O as allObjects,co as applyAffine,ro as automaticRoundTableRadius,i as buildAisleHoles,fo as buildSeatIndex,h as buildSectionShell,S as chartBounds,U as combinedFloorZoneId,ho as composeAffine,ao as createPerspectiveCamera,c as cubicPoint,jo as decomposeAffineLinear,j as distanceToRings,g as distributeAlongCubic,G as expandBooth,R as expandChart,B as expandRow,A as expandRowSlots,F as expandTable,D as expandTableSlots,N as floorObjects,V as floorStackPlacements,M as floorsOf,xo as gridStats,mo as hitTest,_ as initialFloorMode,go as invertAffine,X as layoutCombinedFloorPlan,W as layoutFloorStack,Y as mainFloorId,po as nearestWithin,K as objectCenter,L as owningSectionForObject,io as perspectiveTangentAffine,H as pointInPolygon,I as pointInPolygonWithHoles,k as polygonArea,n as polygonInscribedAnchor,J as polygonLabelPoint,l as polygonNetArea,bo as projectPerspectivePoint,to as queryRect,v as resolveSegmentedRowGroups,z as rowInventoryCount,y as rowSeatPositions,s as segmentedRowComponentSeats,q as segmentedRowComponents,u as segmentedRowSeatTotal,d as smoothCubicThroughMiddle,Q as stackFloors,E as tableInventoryCount,C as tableSeatCountsBySide,b as textLayoutMetrics,P as translateObject};
@@ -1 +1 @@
1
- "use strict";var Z=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var we=Object.prototype.hasOwnProperty;var Ie=(t,r)=>{for(var i in r)Z(t,i,{get:r[i],enumerable:!0})},Re=(t,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Se(r))!we.call(t,l)&&l!==i&&Z(t,l,{get:()=>r[l],enumerable:!(a=Le(r,l))||a.enumerable});return t};var Ce=t=>Re(Z({},"__esModule",{value:!0}),t);var it={};Ie(it,{ACCESS_GLYPH_PATH:()=>He,ACCESS_GLYPH_VIEWBOX:()=>Ke,ACCESS_TYPE_GLYPH_PATHS:()=>$,AUTHORED_LABEL_MIN_CONTRAST:()=>Xe,BOOTH_LABEL_FONT_SIZE:()=>Oe,DARK_BOOKABLE_LABEL_INK:()=>f,DARK_NEUTRAL_SECTION_FILL:()=>ge,GA_CAPACITY_LABEL_FONT_SIZE:()=>Ve,GA_FILL_OPACITY:()=>ze,GA_LABEL_FONT_SIZE:()=>Fe,LARGE_TEXT_CONTRAST:()=>le,LIGHT_BOOKABLE_LABEL_INK:()=>y,LIGHT_NEUTRAL_SECTION_FILL:()=>be,MIN_POINTER_TARGET_PX:()=>Y,MIN_VISIBLE_BOOKABLE_LABEL_PX:()=>A,RENDERED_QUALITY_REPORT_VERSION:()=>pe,ROW_LABEL_FONT_SIZE:()=>_e,SEAT_LABEL_FONT_SIZE:()=>Be,SECTION_NAME_CONTRAST:()=>U,SMALL_TEXT_CONTRAST:()=>L,accessGlyphInk:()=>qe,accessGlyphPath:()=>Ze,accessibilityRingInk:()=>Qe,bookableMarkerLabel:()=>Ue,categoryBandInk:()=>Ye,compositeHexOver:()=>$e,explicitOrStateAwareLabelInk:()=>We,inspectRenderedQualityEvidence:()=>nt,isBookableLabelLegibleAtScale:()=>je,isLightFill:()=>de,mapSeparatingInk:()=>ue,minimumTextContrast:()=>Ge,neutralSectionFill:()=>et,renderedTextContrast:()=>d,stateAwareBookableLabelInk:()=>X,summarizeLabelInkContrast:()=>tt});module.exports=Ce(it);var ke=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],at=new Map(ke.map(t=>[t.key,t]));var Ae={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function ae(t){let r=t?.[0];return r&&Ae[r]||"#3b82f6"}var Te=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],st=new Map(Te.map(t=>[t.key,t]));var Ee=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],ct=new Set(Ee);var Me=/^#?([\da-f]{3}|[\da-f]{6})$/i;function v(t){let r=Me.exec((t??"").trim());if(!r)return null;let i=r[1].length===3?r[1].split("").map(l=>l+l).join(""):r[1],a=parseInt(i,16);return[a>>16&255,a>>8&255,a&255]}function Q(t){let r=t/255;return r<=.04045?r/12.92:((r+.055)/1.055)**2.4}function V(t){return .2126*Q(t[0])+.7152*Q(t[1])+.0722*Q(t[2])}function se(t,r){let i=v(t),a=v(r);if(!i||!a)return null;let l=V(i),u=V(a);return(Math.max(l,u)+.05)/(Math.min(l,u)+.05)}function Pe(t){let r=t.trim();if(r.startsWith("#")){let a=v(r);return a?(.2126*a[0]+.7152*a[1]+.0722*a[2])/255:NaN}let i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(r);return i?(.2126*+i[1]+.7152*+i[2]+.0722*+i[3])/255:NaN}function z(t,r=.6){let i=Pe(t);return!Number.isNaN(i)&&i>r}var Be=7,_e=10,Oe=10,Fe=15,Ve=11,ze=.85,A=12,L=4.5,U=3,le=3,f="#000000",y="#ffffff",Ne=24,De=18.67;function Ge(t,r=400){return t>=Ne||r>=700&&t>=De?le:L}function je(t,r){return t*r>=A}var Ke=24,$={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},He=$.wheelchair;function Ze(t){if(!t?.length)return null;let r=t.includes("wheelchair")?"wheelchair":t[0];return $[r]??null}function Qe(t,r){return r.colorblind?ue(r.canvasBackground):ae(t)}function Ue(t){return/-(\d{1,5})$/.exec(t)?.[1]??t}var d=se;function $e(t,r,i){let a=v(t),l=v(r);if(!a||!l)return r;let u=Math.max(0,Math.min(1,i));return`#${a.map((p,M)=>Math.round(p*u+l[M]*(1-u))).map(p=>p.toString(16).padStart(2,"0")).join("")}`}var Xe=3;function Ye(t){let r=d(y,t)??0,i=d(f,t)??0;return r>=L?y:i>=L&&z(t)||z(t)?f:y}function ue(t){return z(t)?f:y}function X(t,r,i=L){let a=d(r,t);if(a!=null&&a>=i)return r;let l=d(f,t)??0,u=d(y,t)??0;return l===0&&u===0?r:l>=u?f:y}function We(t,r,i,a=L){return r??X(t,i,a)}var Je=3;function qe(t){let r=d("#ffffff",t);if(r!=null&&r>=Je)return"#ffffff";let i=d(f,t)??0,a=d(y,t)??0;return i===0&&a===0?"#ffffff":i>=a?f:y}var ce=/^#[0-9a-f]{6}$/i;function de(t){let r=v(t);return r!=null&&V(r)>.5}var be="#e5e7eb",ge="#273142";function et(t){return de(t)?be:ge}function tt(t,r,i=L){let a=ce.test(t.trim()),l=t.trim().toLowerCase(),u=0,m=0,p=null;for(let P of r){if(!a||!ce.test(P.trim()))continue;u+=1;let B=X(P,t,i);B.toLowerCase()!==l&&(m+=1,p=B)}return{total:u,overridden:m,status:u===0?"none":m===0?"applies":m===u?"overridden":"mixed",overrideInk:p}}var pe=3,T=4.5,N=3,Y=24,rt=20;function D(t){return t.filter(r=>r.visible&&!!r.screenBox)}function S(t,r){return t.x<r.x+r.width&&t.x+t.width>r.x&&t.y<r.y+r.height&&t.y+t.height>r.y}function h(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function c(t,r,i){return i.length?{code:t,message:r,count:i.length,samples:i.slice(0,rt)}:null}function E(t,r,i){return{primaryId:t.seatId,primaryLabel:t.label,...r==null?{}:{measured:Math.round(r*100)/100},...i==null?{}:{minimum:i}}}function G(t,r,i){return{primaryId:t.id,primaryLabel:t.label,...r==null?{}:{measured:Math.round(r*100)/100},...i==null?{}:{minimum:i}}}function me(t,r,i){return{primaryId:t.objectId,primaryLabel:t.text,...r==null?{}:{measured:Math.round(r*100)/100},...i==null?{}:{minimum:i}}}function w(t,r,i,a){return{primaryId:t,primaryLabel:r,secondaryId:i,secondaryLabel:a}}function nt(t,r="overview",i=null){let a=D(t.labels),l=D(t.hierarchyLabels),u=D(t.freeTextLabels),m=D(t.rowLabels),p=t.gaAreas.filter(e=>e.visible),M=a.map(e=>d(e.ink,e.fill)??0),P=l.map(e=>d(e.ink,e.fill)??0),B=u.map(e=>d(e.ink,e.background)??0),fe=p.map(e=>d(e.effectiveBackground,t.canvasBackground)??0),b=i?t.labels.filter(e=>e.categoryKey===i):t.labels,I=i?t.gaAreas.filter(e=>e.categoryKey===i):t.gaAreas,x=b.filter(e=>e.selected),R=b.filter(e=>e.status==="held"),C=b.filter(e=>e.status==="booked"),_=b.filter(e=>e.pointerTarget.active),W=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),O=x.length?h(x.map(e=>d(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,s=[],k=(e,n)=>Array.from({length:e},(g,F)=>({primaryId:`overview:${F+1}`,primaryLabel:n}));r==="overview"&&t.rung==="sections"&&(s.push(c("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",k(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),s.push(c("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",k(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),s.push(c("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",k(t.overviewStyle.visibleSectionRowHints,"section row hint"))),s.push(c("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),s.push(c("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),s.push(c("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",a.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>E(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),s.push(c("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",r==="interaction"?a.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>E(e)):[])),s.push(c("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",r==="interaction"?m.flatMap((e,n)=>{let g=e.screenBox;return g.x<0||g.y<0||g.x+g.width>t.viewport.width||g.y+g.height>t.viewport.height?[{primaryId:`row-label-${n}`,primaryLabel:e.text}]:[]}):[]));let J=[];if(r==="interaction")for(let e=0;e<m.length;e+=1)for(let n=0;n<e;n+=1)S(m[e].screenBox,m[n].screenBox)&&J.push(w(`row-label-${n}`,m[n].text,`row-label-${e}`,m[e].text));if(s.push(c("row-label-collision","Visible interaction row labels must not overlap",J)),r==="interaction"){let e=b.length>0,n=I.length>0,g=e||n,F=I.filter(o=>o.visible),ye=new Set([...b.flatMap(o=>o.sectionId?[o.sectionId]:[]),...I.flatMap(o=>o.sectionId?[o.sectionId]:[])]),he=new Set([...t.labels.map(o=>o.categoryKey),...t.gaAreas.map(o=>o.categoryKey)]),j=o=>o.screenCenter.x>=0&&o.screenCenter.x<=t.viewport.width&&o.screenCenter.y>=0&&o.screenCenter.y<=t.viewport.height;s.push(c("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",g&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),s.push(c("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",g&&!b.some(j)&&!F.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),s.push(c("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!_.some(j)||!e&&n&&!F.some(o=>o.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),s.push(c("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",_.filter(o=>j(o)&&o.pointerTarget.effectiveMinimumPx<Y).map(o=>E(o,o.pointerTarget.effectiveMinimumPx,Y)))),s.push(c("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!x.length||!x.some(o=>t.selectionRingSeatIds.includes(o.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),s.push(c("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",x.length&&(O??0)<N?[{primaryId:x[0].seatId,primaryLabel:x[0].label,measured:Math.round((O??0)*100)/100,minimum:N}]:[])),s.push(c("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",b.length>=2&&!R.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),s.push(c("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",b.length>=3&&!C.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let xe=new Set(R.map(o=>`${o.fill.toLowerCase()}:${o.opacity}`)),ve=new Set(C.map(o=>`${o.fill.toLowerCase()}:${o.opacity}`));s.push(c("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",R.length&&C.length&&[...xe].some(o=>ve.has(o))?[{primaryId:R[0].seatId,primaryLabel:R[0].label,secondaryId:C[0].seatId,secondaryLabel:C[0].label}]:[])),s.push(c("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",ye.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),s.push(c("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",he.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let K=t.labels.filter(o=>o.status==="free"&&!o.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(o.categoryKey)),H=t.gaAreas.filter(o=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(o.categoryKey));s.push(c("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(K.length||H.length)&&!K.some(o=>o.opacity<=.25)&&!H.some(o=>o.opacity<=.1)?[...K.map(o=>E(o,o.opacity)),...H.map(o=>({primaryId:o.areaId,primaryLabel:o.label,measured:o.opacity}))]:[])),s.push(c("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",i&&!W.has(i)?[{primaryId:i,primaryLabel:i}]:[])),s.push(c("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",i&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==i)?[{primaryId:i,primaryLabel:i}]:[]))}s.push(c("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",a.flatMap(e=>{let n=d(e.ink,e.fill)??0;return n<T?[E(e,n,T)]:[]})));let q=[];for(let e=0;e<a.length;e+=1)for(let n=0;n<e;n+=1)S(a[e].screenBox,a[n].screenBox)&&q.push(w(a[n].seatId,a[n].label,a[e].seatId,a[e].label));s.push(c("bookable-label-collision","Visible bookable labels must not overlap",q)),s.push(c("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<(e.sizeFloorPx??A)).map(e=>G(e,e.renderedFontPx,e.sizeFloorPx??A)))),s.push(c("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",l.flatMap(e=>{let n=d(e.ink,e.fill)??0,g=e.kind==="section"&&e.role==="name"?U:T;return n<g?[G(e,n,g)]:[]}))),s.push(c("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",r==="overview"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>G(e)):[])),s.push(c("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",l.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>G(e))));let ee=[];for(let e=0;e<l.length;e+=1)for(let n=0;n<e;n+=1)S(l[e].screenBox,l[n].screenBox)&&ee.push(w(l[n].id,l[n].label,l[e].id,l[e].label));s.push(c("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",ee));let te=[];for(let e of l)for(let n of a)S(e.screenBox,n.screenBox)&&te.push(w(e.id,e.label,n.seatId,n.label));s.push(c("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",te)),s.push(c("free-text-undersized","Visible chart text must meet the rendered small-text size floor",u.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>me(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),s.push(c("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",u.flatMap(e=>{let n=d(e.ink,e.background)??0;return n<T?[me(e,n,T)]:[]})));let re=[];for(let e=0;e<u.length;e+=1)for(let n=0;n<e;n+=1)S(u[e].screenBox,u[n].screenBox)&&re.push(w(u[n].objectId,u[n].text,u[e].objectId,u[e].text));s.push(c("free-text-collision","Visible chart text labels must not overlap each other",re));let ne=[];for(let e of u)for(let n of a)S(e.screenBox,n.screenBox)&&ne.push(w(e.objectId,e.text,n.seatId,n.label));s.push(c("free-text-bookable-collision","Visible chart text must not overlap bookable labels",ne));let ie=[];for(let e of u)for(let n of l)S(e.screenBox,n.screenBox)&&ie.push(w(e.objectId,e.text,n.id,n.label));s.push(c("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",ie)),s.push(c("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",p.flatMap(e=>{let n=d(e.effectiveBackground,t.canvasBackground)??0;return n<N?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(n*100)/100,minimum:N}]:[]})));let oe=s.filter(e=>!!e);return{version:pe,passed:oe.length===0,state:r,targetCategoryKey:i,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...r==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:a.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:l.length,visibleFreeTextLabels:u.length,visibleGAAreas:p.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,n)=>e.kind.localeCompare(n.kind)||e.id.localeCompare(n.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,n)=>e.objectId.localeCompare(n.objectId)||e.kind.localeCompare(n.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,n)=>e.areaId.localeCompare(n.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...W].sort()},metrics:{minimumRenderedBookableLabelPx:h(a.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:h(M),minimumRenderedHierarchyLabelPx:h(l.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:h(P),minimumRenderedFreeTextPx:h(u.map(e=>e.renderedFontPx)),minimumFreeTextContrast:h(B),minimumGAContrast:h(fe),minimumEffectivePointerTargetPx:h(_.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:O==null?null:Math.round(O*100)/100},interaction:{applicable:{detail:b.length>0||I.length>0,pointer:b.length>0||I.length>0,held:b.length>=2,booked:b.length>=3,sectionFocus:b.some(e=>!!e.sectionId)||I.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:x.length,heldUnits:R.length,bookedUnits:C.length,activePointerTargets:_.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:oe}}0&&(module.exports={ACCESS_GLYPH_PATH,ACCESS_GLYPH_VIEWBOX,ACCESS_TYPE_GLYPH_PATHS,AUTHORED_LABEL_MIN_CONTRAST,BOOTH_LABEL_FONT_SIZE,DARK_BOOKABLE_LABEL_INK,DARK_NEUTRAL_SECTION_FILL,GA_CAPACITY_LABEL_FONT_SIZE,GA_FILL_OPACITY,GA_LABEL_FONT_SIZE,LARGE_TEXT_CONTRAST,LIGHT_BOOKABLE_LABEL_INK,LIGHT_NEUTRAL_SECTION_FILL,MIN_POINTER_TARGET_PX,MIN_VISIBLE_BOOKABLE_LABEL_PX,RENDERED_QUALITY_REPORT_VERSION,ROW_LABEL_FONT_SIZE,SEAT_LABEL_FONT_SIZE,SECTION_NAME_CONTRAST,SMALL_TEXT_CONTRAST,accessGlyphInk,accessGlyphPath,accessibilityRingInk,bookableMarkerLabel,categoryBandInk,compositeHexOver,explicitOrStateAwareLabelInk,inspectRenderedQualityEvidence,isBookableLabelLegibleAtScale,isLightFill,mapSeparatingInk,minimumTextContrast,neutralSectionFill,renderedTextContrast,stateAwareBookableLabelInk,summarizeLabelInkContrast});
1
+ "use strict";var Z=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Re=Object.prototype.hasOwnProperty;var Ce=(t,r)=>{for(var n in r)Z(t,n,{get:r[n],enumerable:!0})},ke=(t,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Ie(r))!Re.call(t,l)&&l!==n&&Z(t,l,{get:()=>r[l],enumerable:!(a=we(r,l))||a.enumerable});return t};var Ae=t=>ke(Z({},"__esModule",{value:!0}),t);var ct={};Ce(ct,{ACCESS_GLYPH_PATH:()=>$e,ACCESS_GLYPH_VIEWBOX:()=>Ue,ACCESS_TYPE_GLYPH_PATHS:()=>X,AUTHORED_LABEL_MIN_CONTRAST:()=>qe,BLOCK_LABEL_FILL_RATIO:()=>ue,BOOTH_LABEL_FONT_SIZE:()=>U,DARK_BOOKABLE_LABEL_INK:()=>f,DARK_NEUTRAL_SECTION_FILL:()=>pe,GA_CAPACITY_LABEL_FONT_SIZE:()=>Ge,GA_FILL_OPACITY:()=>je,GA_LABEL_FONT_SIZE:()=>De,LARGE_TEXT_CONTRAST:()=>de,LIGHT_BOOKABLE_LABEL_INK:()=>h,LIGHT_NEUTRAL_SECTION_FILL:()=>me,MIN_POINTER_TARGET_PX:()=>W,MIN_VISIBLE_BOOKABLE_LABEL_PX:()=>A,RENDERED_QUALITY_REPORT_VERSION:()=>he,ROW_LABEL_FONT_SIZE:()=>Fe,SEAT_LABEL_FONT_SIZE:()=>Oe,SECTION_NAME_CONTRAST:()=>$,SMALL_TEXT_CONTRAST:()=>v,accessGlyphInk:()=>nt,accessGlyphPath:()=>Xe,accessibilityRingInk:()=>Ye,blockLabelFontSize:()=>Ne,bookableMarkerLabel:()=>We,categoryBandInk:()=>et,compositeHexOver:()=>Je,explicitOrStateAwareLabelInk:()=>tt,inspectRenderedQualityEvidence:()=>st,isBookableLabelLegibleAtScale:()=>Qe,isLightFill:()=>ge,mapSeparatingInk:()=>be,minimumTextContrast:()=>Ze,neutralSectionFill:()=>it,renderedTextContrast:()=>d,stateAwareBookableLabelInk:()=>Y,summarizeLabelInkContrast:()=>ot});module.exports=Ae(ct);var Te=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],ut=new Map(Te.map(t=>[t.key,t]));var Ee={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function se(t){let r=t?.[0];return r&&Ee[r]||"#3b82f6"}var Me=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],dt=new Map(Me.map(t=>[t.key,t]));var Be=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],bt=new Set(Be);var Pe=/^#?([\da-f]{3}|[\da-f]{6})$/i;function L(t){let r=Pe.exec((t??"").trim());if(!r)return null;let n=r[1].length===3?r[1].split("").map(l=>l+l).join(""):r[1],a=parseInt(n,16);return[a>>16&255,a>>8&255,a&255]}function Q(t){let r=t/255;return r<=.04045?r/12.92:((r+.055)/1.055)**2.4}function z(t){return .2126*Q(t[0])+.7152*Q(t[1])+.0722*Q(t[2])}function ce(t,r){let n=L(t),a=L(r);if(!n||!a)return null;let l=z(n),u=z(a);return(Math.max(l,u)+.05)/(Math.min(l,u)+.05)}function _e(t){let r=t.trim();if(r.startsWith("#")){let a=L(r);return a?(.2126*a[0]+.7152*a[1]+.0722*a[2])/255:NaN}let n=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(r);return n?(.2126*+n[1]+.7152*+n[2]+.0722*+n[3])/255:NaN}function V(t,r=.6){let n=_e(t);return!Number.isNaN(n)&&n>r}var Oe=7,Fe=10,U=10,ue=.39,ze=.8,Ve=.62;function Ne(t){let r=Math.min(Math.abs(t.width),Math.abs(t.height));if(!(r>0))return U;let n=Math.max(1,t.text.length),a=Math.abs(t.width)*ze/(n*Ve);return Math.max(U,Math.min(r*ue,a))}var De=15,Ge=11,je=.85,A=12,v=4.5,$=3,de=3,f="#000000",h="#ffffff",Ke=24,He=18.67;function Ze(t,r=400){return t>=Ke||r>=700&&t>=He?de:v}function Qe(t,r){return t*r>=A}var Ue=24,X={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},$e=X.wheelchair;function Xe(t){if(!t?.length)return null;let r=t.includes("wheelchair")?"wheelchair":t[0];return X[r]??null}function Ye(t,r){return r.colorblind?be(r.canvasBackground):se(t)}function We(t){return/-(\d{1,5})$/.exec(t)?.[1]??t}var d=ce;function Je(t,r,n){let a=L(t),l=L(r);if(!a||!l)return r;let u=Math.max(0,Math.min(1,n));return`#${a.map((p,M)=>Math.round(p*u+l[M]*(1-u))).map(p=>p.toString(16).padStart(2,"0")).join("")}`}var qe=3;function et(t){let r=d(h,t)??0,n=d(f,t)??0;return r>=v?h:n>=v&&V(t)||V(t)?f:h}function be(t){return V(t)?f:h}function Y(t,r,n=v){let a=d(r,t);if(a!=null&&a>=n)return r;let l=d(f,t)??0,u=d(h,t)??0;return l===0&&u===0?r:l>=u?f:h}function tt(t,r,n,a=v){return r??Y(t,n,a)}var rt=3;function nt(t){let r=d("#ffffff",t);if(r!=null&&r>=rt)return"#ffffff";let n=d(f,t)??0,a=d(h,t)??0;return n===0&&a===0?"#ffffff":n>=a?f:h}var le=/^#[0-9a-f]{6}$/i;function ge(t){let r=L(t);return r!=null&&z(r)>.5}var me="#e5e7eb",pe="#273142";function it(t){return ge(t)?me:pe}function ot(t,r,n=v){let a=le.test(t.trim()),l=t.trim().toLowerCase(),u=0,m=0,p=null;for(let B of r){if(!a||!le.test(B.trim()))continue;u+=1;let P=Y(B,t,n);P.toLowerCase()!==l&&(m+=1,p=P)}return{total:u,overridden:m,status:u===0?"none":m===0?"applies":m===u?"overridden":"mixed",overrideInk:p}}var he=3,T=4.5,N=3,W=24,at=20;function D(t){return t.filter(r=>r.visible&&!!r.screenBox)}function S(t,r){return t.x<r.x+r.width&&t.x+t.width>r.x&&t.y<r.y+r.height&&t.y+t.height>r.y}function y(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function c(t,r,n){return n.length?{code:t,message:r,count:n.length,samples:n.slice(0,at)}:null}function E(t,r,n){return{primaryId:t.seatId,primaryLabel:t.label,...r==null?{}:{measured:Math.round(r*100)/100},...n==null?{}:{minimum:n}}}function G(t,r,n){return{primaryId:t.id,primaryLabel:t.label,...r==null?{}:{measured:Math.round(r*100)/100},...n==null?{}:{minimum:n}}}function fe(t,r,n){return{primaryId:t.objectId,primaryLabel:t.text,...r==null?{}:{measured:Math.round(r*100)/100},...n==null?{}:{minimum:n}}}function w(t,r,n,a){return{primaryId:t,primaryLabel:r,secondaryId:n,secondaryLabel:a}}function st(t,r="overview",n=null){let a=D(t.labels),l=D(t.hierarchyLabels),u=D(t.freeTextLabels),m=D(t.rowLabels),p=t.gaAreas.filter(e=>e.visible),M=a.map(e=>d(e.ink,e.fill)??0),B=l.map(e=>d(e.ink,e.fill)??0),P=u.map(e=>d(e.ink,e.background)??0),ye=p.map(e=>d(e.effectiveBackground,t.canvasBackground)??0),b=n?t.labels.filter(e=>e.categoryKey===n):t.labels,I=n?t.gaAreas.filter(e=>e.categoryKey===n):t.gaAreas,x=b.filter(e=>e.selected),R=b.filter(e=>e.status==="held"),C=b.filter(e=>e.status==="booked"),_=b.filter(e=>e.pointerTarget.active),J=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),O=x.length?y(x.map(e=>d(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,s=[],k=(e,i)=>Array.from({length:e},(g,F)=>({primaryId:`overview:${F+1}`,primaryLabel:i}));r==="overview"&&t.rung==="sections"&&(s.push(c("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",k(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),s.push(c("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",k(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),s.push(c("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",k(t.overviewStyle.visibleSectionRowHints,"section row hint"))),s.push(c("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),s.push(c("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),s.push(c("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",a.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>E(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),s.push(c("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",r==="interaction"?a.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>E(e)):[])),s.push(c("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",r==="interaction"?m.flatMap((e,i)=>{let g=e.screenBox;return g.x<0||g.y<0||g.x+g.width>t.viewport.width||g.y+g.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let q=[];if(r==="interaction")for(let e=0;e<m.length;e+=1)for(let i=0;i<e;i+=1)S(m[e].screenBox,m[i].screenBox)&&q.push(w(`row-label-${i}`,m[i].text,`row-label-${e}`,m[e].text));if(s.push(c("row-label-collision","Visible interaction row labels must not overlap",q)),r==="interaction"){let e=b.length>0,i=I.length>0,g=e||i,F=I.filter(o=>o.visible),xe=new Set([...b.flatMap(o=>o.sectionId?[o.sectionId]:[]),...I.flatMap(o=>o.sectionId?[o.sectionId]:[])]),Le=new Set([...t.labels.map(o=>o.categoryKey),...t.gaAreas.map(o=>o.categoryKey)]),j=o=>o.screenCenter.x>=0&&o.screenCenter.x<=t.viewport.width&&o.screenCenter.y>=0&&o.screenCenter.y<=t.viewport.height;s.push(c("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",g&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),s.push(c("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",g&&!b.some(j)&&!F.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),s.push(c("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!_.some(j)||!e&&i&&!F.some(o=>o.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),s.push(c("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",_.filter(o=>j(o)&&o.pointerTarget.effectiveMinimumPx<W).map(o=>E(o,o.pointerTarget.effectiveMinimumPx,W)))),s.push(c("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!x.length||!x.some(o=>t.selectionRingSeatIds.includes(o.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),s.push(c("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",x.length&&(O??0)<N?[{primaryId:x[0].seatId,primaryLabel:x[0].label,measured:Math.round((O??0)*100)/100,minimum:N}]:[])),s.push(c("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",b.length>=2&&!R.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),s.push(c("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",b.length>=3&&!C.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let ve=new Set(R.map(o=>`${o.fill.toLowerCase()}:${o.opacity}`)),Se=new Set(C.map(o=>`${o.fill.toLowerCase()}:${o.opacity}`));s.push(c("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",R.length&&C.length&&[...ve].some(o=>Se.has(o))?[{primaryId:R[0].seatId,primaryLabel:R[0].label,secondaryId:C[0].seatId,secondaryLabel:C[0].label}]:[])),s.push(c("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",xe.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),s.push(c("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Le.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let K=t.labels.filter(o=>o.status==="free"&&!o.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(o.categoryKey)),H=t.gaAreas.filter(o=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(o.categoryKey));s.push(c("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(K.length||H.length)&&!K.some(o=>o.opacity<=.25)&&!H.some(o=>o.opacity<=.1)?[...K.map(o=>E(o,o.opacity)),...H.map(o=>({primaryId:o.areaId,primaryLabel:o.label,measured:o.opacity}))]:[])),s.push(c("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",n&&!J.has(n)?[{primaryId:n,primaryLabel:n}]:[])),s.push(c("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",n&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==n)?[{primaryId:n,primaryLabel:n}]:[]))}s.push(c("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",a.flatMap(e=>{let i=d(e.ink,e.fill)??0;return i<T?[E(e,i,T)]:[]})));let ee=[];for(let e=0;e<a.length;e+=1)for(let i=0;i<e;i+=1)S(a[e].screenBox,a[i].screenBox)&&ee.push(w(a[i].seatId,a[i].label,a[e].seatId,a[e].label));s.push(c("bookable-label-collision","Visible bookable labels must not overlap",ee)),s.push(c("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<(e.sizeFloorPx??A)).map(e=>G(e,e.renderedFontPx,e.sizeFloorPx??A)))),s.push(c("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",l.flatMap(e=>{let i=d(e.ink,e.fill)??0,g=e.kind==="section"&&e.role==="name"?$:T;return i<g?[G(e,i,g)]:[]}))),s.push(c("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",r==="overview"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>G(e)):[])),s.push(c("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",l.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>G(e))));let te=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)S(l[e].screenBox,l[i].screenBox)&&te.push(w(l[i].id,l[i].label,l[e].id,l[e].label));s.push(c("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",te));let re=[];for(let e of l)for(let i of a)S(e.screenBox,i.screenBox)&&re.push(w(e.id,e.label,i.seatId,i.label));s.push(c("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",re)),s.push(c("free-text-undersized","Visible chart text must meet the rendered small-text size floor",u.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>fe(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),s.push(c("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",u.flatMap(e=>{let i=d(e.ink,e.background)??0;return i<T?[fe(e,i,T)]:[]})));let ne=[];for(let e=0;e<u.length;e+=1)for(let i=0;i<e;i+=1)S(u[e].screenBox,u[i].screenBox)&&ne.push(w(u[i].objectId,u[i].text,u[e].objectId,u[e].text));s.push(c("free-text-collision","Visible chart text labels must not overlap each other",ne));let ie=[];for(let e of u)for(let i of a)S(e.screenBox,i.screenBox)&&ie.push(w(e.objectId,e.text,i.seatId,i.label));s.push(c("free-text-bookable-collision","Visible chart text must not overlap bookable labels",ie));let oe=[];for(let e of u)for(let i of l)S(e.screenBox,i.screenBox)&&oe.push(w(e.objectId,e.text,i.id,i.label));s.push(c("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",oe)),s.push(c("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",p.flatMap(e=>{let i=d(e.effectiveBackground,t.canvasBackground)??0;return i<N?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:N}]:[]})));let ae=s.filter(e=>!!e);return{version:he,passed:ae.length===0,state:r,targetCategoryKey:n,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...r==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:a.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:l.length,visibleFreeTextLabels:u.length,visibleGAAreas:p.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...J].sort()},metrics:{minimumRenderedBookableLabelPx:y(a.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:y(M),minimumRenderedHierarchyLabelPx:y(l.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:y(B),minimumRenderedFreeTextPx:y(u.map(e=>e.renderedFontPx)),minimumFreeTextContrast:y(P),minimumGAContrast:y(ye),minimumEffectivePointerTargetPx:y(_.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:O==null?null:Math.round(O*100)/100},interaction:{applicable:{detail:b.length>0||I.length>0,pointer:b.length>0||I.length>0,held:b.length>=2,booked:b.length>=3,sectionFocus:b.some(e=>!!e.sectionId)||I.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:x.length,heldUnits:R.length,bookedUnits:C.length,activePointerTargets:_.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:ae}}0&&(module.exports={ACCESS_GLYPH_PATH,ACCESS_GLYPH_VIEWBOX,ACCESS_TYPE_GLYPH_PATHS,AUTHORED_LABEL_MIN_CONTRAST,BLOCK_LABEL_FILL_RATIO,BOOTH_LABEL_FONT_SIZE,DARK_BOOKABLE_LABEL_INK,DARK_NEUTRAL_SECTION_FILL,GA_CAPACITY_LABEL_FONT_SIZE,GA_FILL_OPACITY,GA_LABEL_FONT_SIZE,LARGE_TEXT_CONTRAST,LIGHT_BOOKABLE_LABEL_INK,LIGHT_NEUTRAL_SECTION_FILL,MIN_POINTER_TARGET_PX,MIN_VISIBLE_BOOKABLE_LABEL_PX,RENDERED_QUALITY_REPORT_VERSION,ROW_LABEL_FONT_SIZE,SEAT_LABEL_FONT_SIZE,SECTION_NAME_CONTRAST,SMALL_TEXT_CONTRAST,accessGlyphInk,accessGlyphPath,accessibilityRingInk,blockLabelFontSize,bookableMarkerLabel,categoryBandInk,compositeHexOver,explicitOrStateAwareLabelInk,inspectRenderedQualityEvidence,isBookableLabelLegibleAtScale,isLightFill,mapSeparatingInk,minimumTextContrast,neutralSectionFill,renderedTextContrast,stateAwareBookableLabelInk,summarizeLabelInkContrast});
@@ -1,7 +1,7 @@
1
- import { A as AccessibilityType } from '../../types-D91PAu7c.cjs';
1
+ import { A as AccessibilityType } from '../../types-BbqhOJ5L.cjs';
2
2
  import { contrastRatioOrNull } from '../color.cjs';
3
- export { M as MIN_POINTER_TARGET_PX, R as RENDERED_QUALITY_REPORT_VERSION, a as RenderedEvidenceState, b as RenderedQualityFinding, c as RenderedQualityFindingCode, d as RenderedQualityReport, e as RenderedQualitySample, i as inspectRenderedQualityEvidence } from '../../renderedQuality-x1_lUJYV.cjs';
4
- import '../../renderer-DLTYfHV2.cjs';
3
+ export { M as MIN_POINTER_TARGET_PX, R as RENDERED_QUALITY_REPORT_VERSION, a as RenderedEvidenceState, b as RenderedQualityFinding, c as RenderedQualityFindingCode, d as RenderedQualityReport, e as RenderedQualitySample, i as inspectRenderedQualityEvidence } from '../../renderedQuality-DThBK6x4.cjs';
4
+ import '../../renderer-BePADdjE.cjs';
5
5
 
6
6
  /**
7
7
  * Rendering constants that quality inspection must agree with.
@@ -19,8 +19,34 @@ declare const SEAT_LABEL_FONT_SIZE = 7;
19
19
  * by the designer and the buyer renderer so the two stay WYSIWYG.
20
20
  * 12 → 10 on 2026-08-19 (owner): the letter out-weighed the seats it named. */
21
21
  declare const ROW_LABEL_FONT_SIZE = 10;
22
- /** Booth labels are authored at this many chart units. */
22
+ /** Booth labels are authored at this many chart units — the FLOOR, never the
23
+ * whole rule: see {@link blockLabelFontSize}. */
23
24
  declare const BOOTH_LABEL_FONT_SIZE = 10;
25
+ /**
26
+ * How much of a BLOCK unit's short side its own name is allowed to fill.
27
+ *
28
+ * A seat carries its number at {@link SEAT_LABEL_FONT_SIZE} inside an 18-unit
29
+ * marker — 0.39 of the thing it names. A block unit (a booth, a VIP box) is
30
+ * authored at whatever size the floor plan drew it, so a flat 10 units is 0.39
31
+ * of a 25-unit box and 0.09 of a 114-unit expo stall: the same rule that makes
32
+ * a seat number appear as soon as the seat is big enough kept a stall number
33
+ * hidden until the stall was three hundred pixels across. The ratio is the
34
+ * rule; the authored constant is only its floor, so every unit already at or
35
+ * below seat size keeps exactly the label it has today.
36
+ */
37
+ declare const BLOCK_LABEL_FILL_RATIO = 0.39;
38
+ /**
39
+ * The world font a block unit's own name is painted at.
40
+ *
41
+ * Sized to the BLOCK — {@link BLOCK_LABEL_FILL_RATIO} of its short side, cut
42
+ * back when the text would overrun its width — and floored at the authored
43
+ * {@link BOOTH_LABEL_FONT_SIZE} so small blocks are pixel-identical to today.
44
+ */
45
+ declare function blockLabelFontSize(input: {
46
+ width: number;
47
+ height: number;
48
+ text: string;
49
+ }): number;
24
50
  /** GA area captions and their capacity sublabels. */
25
51
  declare const GA_LABEL_FONT_SIZE = 15;
26
52
  declare const GA_CAPACITY_LABEL_FONT_SIZE = 11;
@@ -207,4 +233,4 @@ interface LabelInkContrastSummary {
207
233
  */
208
234
  declare function summarizeLabelInkContrast(preferred: string, backgrounds: Iterable<string>, minContrast?: number): LabelInkContrastSummary;
209
235
 
210
- export { ACCESS_GLYPH_PATH, ACCESS_GLYPH_VIEWBOX, ACCESS_TYPE_GLYPH_PATHS, AUTHORED_LABEL_MIN_CONTRAST, type AccessibilityRingInkOptions, BOOTH_LABEL_FONT_SIZE, DARK_BOOKABLE_LABEL_INK, DARK_NEUTRAL_SECTION_FILL, GA_CAPACITY_LABEL_FONT_SIZE, GA_FILL_OPACITY, GA_LABEL_FONT_SIZE, LARGE_TEXT_CONTRAST, LIGHT_BOOKABLE_LABEL_INK, LIGHT_NEUTRAL_SECTION_FILL, type LabelInkContrastSummary, MIN_VISIBLE_BOOKABLE_LABEL_PX, ROW_LABEL_FONT_SIZE, SEAT_LABEL_FONT_SIZE, SECTION_NAME_CONTRAST, SMALL_TEXT_CONTRAST, accessGlyphInk, accessGlyphPath, accessibilityRingInk, bookableMarkerLabel, categoryBandInk, compositeHexOver, explicitOrStateAwareLabelInk, isBookableLabelLegibleAtScale, isLightFill, mapSeparatingInk, minimumTextContrast, neutralSectionFill, renderedTextContrast, stateAwareBookableLabelInk, summarizeLabelInkContrast };
236
+ export { ACCESS_GLYPH_PATH, ACCESS_GLYPH_VIEWBOX, ACCESS_TYPE_GLYPH_PATHS, AUTHORED_LABEL_MIN_CONTRAST, type AccessibilityRingInkOptions, BLOCK_LABEL_FILL_RATIO, BOOTH_LABEL_FONT_SIZE, DARK_BOOKABLE_LABEL_INK, DARK_NEUTRAL_SECTION_FILL, GA_CAPACITY_LABEL_FONT_SIZE, GA_FILL_OPACITY, GA_LABEL_FONT_SIZE, LARGE_TEXT_CONTRAST, LIGHT_BOOKABLE_LABEL_INK, LIGHT_NEUTRAL_SECTION_FILL, type LabelInkContrastSummary, MIN_VISIBLE_BOOKABLE_LABEL_PX, ROW_LABEL_FONT_SIZE, SEAT_LABEL_FONT_SIZE, SECTION_NAME_CONTRAST, SMALL_TEXT_CONTRAST, accessGlyphInk, accessGlyphPath, accessibilityRingInk, blockLabelFontSize, bookableMarkerLabel, categoryBandInk, compositeHexOver, explicitOrStateAwareLabelInk, isBookableLabelLegibleAtScale, isLightFill, mapSeparatingInk, minimumTextContrast, neutralSectionFill, renderedTextContrast, stateAwareBookableLabelInk, summarizeLabelInkContrast };