@seatlayer/core 0.68.1 → 0.70.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 (135) hide show
  1. package/dist/ar-R52D47QC.js +1 -0
  2. package/dist/be-P34NRZPF.js +1 -0
  3. package/dist/bg-4TEE6DSQ.js +1 -0
  4. package/dist/ca-V4A6DRPR.js +1 -0
  5. package/dist/{categoryInventory-DLDU-RSw.d.ts → categoryInventory-BiUDSvBt.d.ts} +1 -1
  6. package/dist/{categoryInventory-DZapeGK6.d.cts → categoryInventory-DBqgM5in.d.cts} +1 -1
  7. package/dist/{chunk-6JWYLLWU.js → chunk-5AHUGRHH.js} +1 -1
  8. package/dist/{chunk-RMNTGICO.js → chunk-652LV66L.js} +1 -1
  9. package/dist/{chunk-BV6FHURE.js → chunk-7OJ6SB6V.js} +1 -1
  10. package/dist/{chunk-HZT2U5IY.js → chunk-A27USMF7.js} +1 -1
  11. package/dist/{chunk-YYRUKI7A.js → chunk-AWPHGLTU.js} +1 -1
  12. package/dist/{chunk-WZ6ZNPNT.js → chunk-UHPX2P7O.js} +1 -1
  13. package/dist/{chunk-QYZ3P5L6.js → chunk-WXWJZ5DO.js} +1 -1
  14. package/dist/chunk-X3K36XZM.js +1 -0
  15. package/dist/core/chart-ops/index.cjs +1 -1
  16. package/dist/core/chart-ops/index.d.cts +4 -4
  17. package/dist/core/chart-ops/index.d.ts +4 -4
  18. package/dist/core/chart-ops/index.js +1 -1
  19. package/dist/core/inventory/index.d.cts +4 -4
  20. package/dist/core/inventory/index.d.ts +4 -4
  21. package/dist/core/inventory/index.js +1 -1
  22. package/dist/core/layout/index.cjs +1 -1
  23. package/dist/core/layout/index.d.cts +4 -4
  24. package/dist/core/layout/index.d.ts +4 -4
  25. package/dist/core/layout/index.js +1 -1
  26. package/dist/core/quality/index.d.cts +3 -3
  27. package/dist/core/quality/index.d.ts +3 -3
  28. package/dist/core/render-assets/index.d.cts +1 -1
  29. package/dist/core/render-assets/index.d.ts +1 -1
  30. package/dist/core/render-assets/index.js +1 -1
  31. package/dist/core/seatConfidence.d.cts +1 -1
  32. package/dist/core/seatConfidence.d.ts +1 -1
  33. package/dist/core/sections/index.d.cts +5 -5
  34. package/dist/core/sections/index.d.ts +5 -5
  35. package/dist/core/sections/index.js +1 -1
  36. package/dist/cs-GR5H3ZRU.js +1 -0
  37. package/dist/cy-XWYNMRNE.js +1 -0
  38. package/dist/da-NOYMEVP6.js +1 -0
  39. package/dist/de-LFHFC2XO.js +1 -0
  40. package/dist/el-AS3436E6.js +1 -0
  41. package/dist/es-IWBWYUHH.js +1 -0
  42. package/dist/et-VV7YGFEV.js +1 -0
  43. package/dist/{eventConfigurations-kZpADDdx.d.ts → eventConfigurations-CA2XhDig.d.ts} +1 -1
  44. package/dist/{eventConfigurations-C_dst7Ro.d.cts → eventConfigurations-Csdxe89O.d.cts} +1 -1
  45. package/dist/fa-JYLN4BIM.js +1 -0
  46. package/dist/fi-TXRN726I.js +1 -0
  47. package/dist/fr-PKEU6NKI.js +1 -0
  48. package/dist/he-H53ZPEAF.js +1 -0
  49. package/dist/hr-AIG6RMUY.js +1 -0
  50. package/dist/hu-KE64252D.js +1 -0
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.cts +259 -94
  53. package/dist/index.d.ts +259 -94
  54. package/dist/index.js +1 -1
  55. package/dist/it-GVT7VIKV.js +1 -0
  56. package/dist/ja-WMRRUDVD.js +1 -0
  57. package/dist/ku-77V6NTW7.js +1 -0
  58. package/dist/{labeling-Br0U7E-5.d.ts → labeling-CxZWjZBN.d.ts} +1 -1
  59. package/dist/{labeling-B07AFOvn.d.cts → labeling-DG-Sc8VW.d.cts} +1 -1
  60. package/dist/{layout-BjkVhn52.d.cts → layout-BxJIZjPm.d.cts} +19 -5
  61. package/dist/{layout-BdeBpWf8.d.ts → layout-C6YaCOnZ.d.ts} +19 -5
  62. package/dist/localeLoaders-2KZHFEV7.js +1 -0
  63. package/dist/lt-7ICKT4ED.js +1 -0
  64. package/dist/lv-NTO2456Y.js +1 -0
  65. package/dist/nl-IYEEWC4A.js +1 -0
  66. package/dist/no-CKH6R5N2.js +1 -0
  67. package/dist/pl-ALK57HKB.js +1 -0
  68. package/dist/pt-EYFSXBVZ.js +1 -0
  69. package/dist/{renderedQuality-Dn6GyPPj.d.ts → renderedQuality-CWwy14lb.d.ts} +1 -1
  70. package/dist/{renderedQuality-C-L_RuPB.d.cts → renderedQuality-CgBQYezj.d.cts} +1 -1
  71. package/dist/{renderer-BGmZn_bq.d.ts → renderer-DIcDImOu.d.ts} +85 -4
  72. package/dist/{renderer-BHInJ52w.d.cts → renderer-DmG3C8vD.d.cts} +85 -4
  73. package/dist/ro-EUFVCBVY.js +1 -0
  74. package/dist/ru-XAIYWENX.js +1 -0
  75. package/dist/{sections-DCRfHaw4.d.ts → sections-87qiciyN.d.ts} +1 -1
  76. package/dist/{sections-BjzyfqGZ.d.cts → sections-Bb0L9lDT.d.cts} +1 -1
  77. package/dist/{segmentedRowModel-jfYcGWPd.d.cts → segmentedRowModel-BqiM0U65.d.cts} +1 -1
  78. package/dist/{segmentedRowModel-DQggl3UO.d.ts → segmentedRowModel-CEP6crcl.d.ts} +1 -1
  79. package/dist/sk-QIOFO4TV.js +1 -0
  80. package/dist/sl-37I57K2X.js +1 -0
  81. package/dist/sr-HE5DILFD.js +1 -0
  82. package/dist/sv-7SVBFLY3.js +1 -0
  83. package/dist/{ticketRestrictions-CtgOd-2p.d.ts → ticketRestrictions-B_qXQobd.d.ts} +2 -2
  84. package/dist/{ticketRestrictions-mnICaF5t.d.cts → ticketRestrictions-Bj8PBX_x.d.cts} +2 -2
  85. package/dist/tr-JNA4YJEJ.js +1 -0
  86. package/dist/{types-BjTzKc2D.d.cts → types-DNztpn7q.d.cts} +9 -0
  87. package/dist/{types-BjTzKc2D.d.ts → types-DNztpn7q.d.ts} +9 -0
  88. package/dist/uk-2723G7DI.js +1 -0
  89. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  90. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  91. package/dist/view3d/index.cjs +31 -31
  92. package/dist/view3d/index.d.cts +86 -4
  93. package/dist/view3d/index.d.ts +86 -4
  94. package/dist/view3d/index.js +29 -29
  95. package/dist/zh-Hans-ONBXTDHV.js +1 -0
  96. package/dist/zh-Hant-LVTMHA6P.js +1 -0
  97. package/package.json +1 -1
  98. package/dist/ar-QWMSVFMH.js +0 -1
  99. package/dist/be-3GMEVW5Q.js +0 -1
  100. package/dist/bg-W46PKTS7.js +0 -1
  101. package/dist/ca-FS3NR6VL.js +0 -1
  102. package/dist/chunk-I6DNJFRF.js +0 -1
  103. package/dist/cs-I4AKSFRV.js +0 -1
  104. package/dist/cy-ABRR65RX.js +0 -1
  105. package/dist/da-HNKK3PNG.js +0 -1
  106. package/dist/de-QUOPPJF7.js +0 -1
  107. package/dist/el-DUXSH2LY.js +0 -1
  108. package/dist/es-57EA3CTI.js +0 -1
  109. package/dist/et-RBSHG6OS.js +0 -1
  110. package/dist/fa-MJIJUBSS.js +0 -1
  111. package/dist/fi-HKF3AVOV.js +0 -1
  112. package/dist/fr-4U5K5VNS.js +0 -1
  113. package/dist/he-MIVDM6KS.js +0 -1
  114. package/dist/hr-G7RZP6DQ.js +0 -1
  115. package/dist/hu-QZE26B6N.js +0 -1
  116. package/dist/it-L2XL6VR7.js +0 -1
  117. package/dist/ja-Q64SRIIE.js +0 -1
  118. package/dist/ku-OG466MA5.js +0 -1
  119. package/dist/localeLoaders-V5HTIO2J.js +0 -1
  120. package/dist/lt-P2CZWZZL.js +0 -1
  121. package/dist/lv-IRHTS7ME.js +0 -1
  122. package/dist/nl-6WSAK5IB.js +0 -1
  123. package/dist/no-3G67YZZR.js +0 -1
  124. package/dist/pl-DUYWY7BZ.js +0 -1
  125. package/dist/pt-FNIRQMIZ.js +0 -1
  126. package/dist/ro-BBYEYZIK.js +0 -1
  127. package/dist/ru-NMG7W5QE.js +0 -1
  128. package/dist/sk-HI2H44DR.js +0 -1
  129. package/dist/sl-RBLBICUL.js +0 -1
  130. package/dist/sr-SNARC3RS.js +0 -1
  131. package/dist/sv-R7ZWBQIL.js +0 -1
  132. package/dist/tr-2JJXM4IM.js +0 -1
  133. package/dist/uk-GTBKSNLF.js +0 -1
  134. package/dist/zh-Hans-4V7ZG3GP.js +0 -1
  135. package/dist/zh-Hant-XWV277CF.js +0 -1
@@ -1 +1 @@
1
- var x="seatmap.chart";var c=[{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"}],l=new Map(c.map(e=>[e.key,e]));function w(e){return l.get(e)}var d={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 R(e){let t=e?.[0];return t&&d[t]||"#3b82f6"}var u=[{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"}],g=new Map(u.map(e=>[e.key,e]));function I(e){return g.get(e)}var A=8,E=24,b=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],m=new Set(b);function k(e){switch(e.type){case"row":case"table":case"gaArea":case"booth":case"section":return"interactive";case"decorImage":return e.layer==="foreground"?"foreground":"background";case"shape":return e.role&&m.has(e.role)?"surroundings":"background";case"text":return"background";default:return"interactive"}}var T=2e6,p=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,y=/[\s"'<>`\\]/;function f(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return p.test(e);if(y.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function O(e){let t=e.trim();return f(t)?t:null}function S(e){let t=0;for(let r=0,i=e.length;r<i;r+=1){let o=e[r],a=e[(r+1)%i];t+=o.x*a.y-a.x*o.y}return t/2}function V(e){return S(e)*2}function _(e,t,r){let i=!1;for(let o=0,a=e.length-1;o<e.length;a=o++){let n=e[o],s=e[a];n.y>r!=s.y>r&&t<(s.x-n.x)*(r-n.y)/(s.y-n.y)+n.x&&(i=!i)}return i}function v(e){let t=1/0,r=1/0,i=-1/0,o=-1/0,a=!1;for(let n of e)!Number.isFinite(n.x)||!Number.isFinite(n.y)||(a=!0,n.x<t&&(t=n.x),n.y<r&&(r=n.y),n.x>i&&(i=n.x),n.y>o&&(o=n.y));return a?{minX:t,minY:r,maxX:i,maxY:o}:null}function G(e){let t=v(e);return t?h(t):null}function h(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}function X(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}export{x as a,c as b,w as c,d,R as e,u as f,I as g,A as h,E as i,b as j,k,T as l,f as m,O as n,S as o,V as p,_ as q,v as r,G as s,X as t};
1
+ var x="seatmap.chart";var c=[{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"}],l=new Map(c.map(e=>[e.key,e]));function w(e){return l.get(e)}var d={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 R(e){let t=e?.[0];return t&&d[t]||"#3b82f6"}var u=[{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"}],g=new Map(u.map(e=>[e.key,e]));function I(e){return g.get(e)}var A=8,k=24,b=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],m=new Set(b);function E(e){switch(e.type){case"row":case"table":case"gaArea":case"booth":case"section":return"interactive";case"decorImage":return e.layer==="foreground"?"foreground":"background";case"shape":return e.role&&m.has(e.role)?"surroundings":"background";case"text":return"background";default:return"interactive"}}var T=2e6,p=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,y=/[\s"'<>`\\]/;function f(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return p.test(e);if(y.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function O(e){let t=e.trim();return f(t)?t:null}function S(e){let t=0;for(let r=0,i=e.length;r<i;r+=1){let o=e[r],a=e[(r+1)%i];t+=o.x*a.y-a.x*o.y}return t/2}function V(e){return S(e)*2}function _(e,t,r){let i=!1;for(let o=0,a=e.length-1;o<e.length;a=o++){let n=e[o],s=e[a];n.y>r!=s.y>r&&t<(s.x-n.x)*(r-n.y)/(s.y-n.y)+n.x&&(i=!i)}return i}function v(e){let t=1/0,r=1/0,i=-1/0,o=-1/0,a=!1;for(let n of e)!Number.isFinite(n.x)||!Number.isFinite(n.y)||(a=!0,n.x<t&&(t=n.x),n.y<r&&(r=n.y),n.x>i&&(i=n.x),n.y>o&&(o=n.y));return a?{minX:t,minY:r,maxX:i,maxY:o}:null}function G(e){let t=v(e);return t?h(t):null}function h(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}function X(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}export{x as a,c as b,w as c,d,R as e,u as f,I as g,A as h,k as i,b as j,E as k,T as l,f as m,O as n,v as o,G as p,X as q,S as r,V as s,_ as t};
@@ -1 +1 @@
1
- import{n as b}from"./chunk-YYRUKI7A.js";var l="seatlayer.event-configuration/1",p="seatlayer.event-configuration-export/1",c=100,_=120,S=1e5,k=1e4,y=/^[a-f0-9]{64}$/,x=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function d(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function u(e,n){return typeof e=="string"&&e.length>=1&&e.length<=n&&e.normalize("NFKC").trim()===e}function E(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function v(e){return!Array.isArray(e)||e.length>S||!e.every(n=>u(n,c))?null:[...new Set(e)].sort()}function C(e){return!d(e)||!u(e.chartId,c)||!u(e.version,c)||e.sha256!==void 0&&(typeof e.sha256!="string"||!y.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function m(e,n,t){return typeof e=="number"&&Number.isFinite(e)&&e>=n&&e<=t}function V(e){return d(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&m(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function j(e,n){if(e===void 0)return;if(!Array.isArray(e)||e.length>k)return null;let t=new Set(n),s=new Set,i=new Set,r=0,a=[];for(let o of e){if(!d(o)||!u(o.id,c)||!u(o.objectId,c)||!t.has(o.objectId)||!x.has(String(o.kind))||!m(o.heightM,.05,50)||o.baseElevationM!==void 0&&!m(o.baseElevationM,-10,100))return null;let f=V(o.occlusion);if(!f||s.has(o.id)||i.has(o.objectId))return null;let g=o.contentImageUrl===void 0?void 0:typeof o.contentImageUrl=="string"?b(o.contentImageUrl):null;if(o.contentImageUrl!==void 0&&(!g||o.kind!=="screen"||++r>1))return null;s.add(o.id),i.add(o.objectId),a.push({id:o.id,objectId:o.objectId,kind:o.kind,heightM:o.heightM,...o.baseElevationM!==void 0?{baseElevationM:o.baseElevationM}:{},occlusion:f,...g?{contentImageUrl:g}:{}})}return a.sort((o,f)=>o.id.localeCompare(f.id))}function I(e){let n=[];if(!d(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==l&&n.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${l}`}),u(e.id,c)||n.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),u(e.label,_)||n.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),E(e.version)||n.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let t=C(e.baseVenue);t||n.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let s=d(e.overlay)?e.overlay:null,i=v(s?.objectIds),r=v(s?.productionKillSeatIds),a=i?j(s?.productionElements,i):null;return(!s||!i||!r)&&n.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&n.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),n.length||!t||!i||!r||a===null?{issues:n}:{issues:n,value:{schema:l,id:e.id,label:e.label,version:e.version,baseVenue:t,overlay:{objectIds:i,productionKillSeatIds:r,...a!==void 0?{productionElements:a}:{}}}}}function R(e){let n=I(e);return n.value?{ok:!0,value:n.value}:{ok:!1,issues:n.issues}}function P(e){if(!d(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let n=[];e.schema!==p&&n.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${p}`}),(typeof e.contentSha256!="string"||!y.test(e.contentSha256))&&n.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let t=I(e.configuration);return n.push(...t.issues),n.length||!t.value||typeof e.contentSha256!="string"?{ok:!1,issues:n}:{ok:!0,value:{schema:p,configuration:t.value,contentSha256:e.contentSha256}}}function A(e){return JSON.stringify({schema:l,id:e.id,label:e.label,version:e.version,baseVenue:{chartId:e.baseVenue.chartId,version:e.baseVenue.version,...e.baseVenue.sha256?{sha256:e.baseVenue.sha256}:{}},overlay:{objectIds:[...new Set(e.overlay.objectIds)].sort(),productionKillSeatIds:[...new Set(e.overlay.productionKillSeatIds)].sort(),...e.overlay.productionElements!==void 0?{productionElements:[...e.overlay.productionElements].sort((n,t)=>n.id.localeCompare(t.id)).map(n=>({id:n.id,objectId:n.objectId,kind:n.kind,heightM:n.heightM,...n.baseElevationM!==void 0?{baseElevationM:n.baseElevationM}:{},occlusion:n.occlusion,...n.contentImageUrl?{contentImageUrl:n.contentImageUrl}:{}}))}:{}}})}function N(e,n){let t=[];e.baseVenue.chartId!==n.chartId&&t.push({code:"base_venue_mismatch",message:"Configuration belongs to a different base venue"}),e.baseVenue.version!==n.version&&t.push({code:"base_venue_version_mismatch",message:"Configuration was authored against a different venue version"}),e.baseVenue.sha256&&!n.sha256?t.push({code:"base_venue_checksum_missing",message:"Venue checksum is required for this configuration"}):e.baseVenue.sha256&&e.baseVenue.sha256!==n.sha256&&t.push({code:"base_venue_checksum_mismatch",message:"Venue bytes do not match the configuration base"});let s=new Set(n.objectIds);for(let r of e.overlay.objectIds)s.has(r)||t.push({code:"overlay_object_missing",message:`Production object ${r} is missing from the base venue`,targetId:r});if(n.objectTypes)for(let r of e.overlay.productionElements??[])n.objectTypes.get(r.objectId)!=="shape"&&t.push({code:"production_element_not_shape",message:`Production element ${r.id} must reference base-venue shape geometry`,targetId:r.objectId});let i=new Set(n.seatIds);for(let r of e.overlay.productionKillSeatIds)i.has(r)||t.push({code:"production_kill_seat_missing",message:`Production-kill seat ${r} is missing from the base venue`,targetId:r});return{compatible:t.length===0,issues:t}}var w={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function T(e,n){return e===n||w[e].has(n)}function L(e,n,t){return!E(t)||t>=n.version?null:e.find(s=>s.id===n.id&&s.version===t&&s.status==="published")??null}function O(e){return e.floors?.length?e.floors.flatMap(n=>n.objects):e.objects}function h(e,n,t){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let s of e)h(s,n,t);return}for(let[s,i]of Object.entries(e)){if(s==="eventConfigurationId"){u(i,c)?n.add(i):i!==void 0&&t.add(String(i));continue}if(s==="eventConfigurationIds"){if(!Array.isArray(i))t.add(String(i));else for(let r of i)u(r,c)?n.add(r):t.add(String(r));continue}h(i,n,t)}}}function U(e,n){let t=C(n);if(!t)return{ok:!1,invalidIds:["baseVenue"]};let s=new Set,i=new Set;if(h(e,s,i),i.size)return{ok:!1,invalidIds:[...i].sort()};let r=O(e);return{ok:!0,configurations:[...s].sort().map(a=>({schema:l,id:a,label:a,version:1,baseVenue:t,overlay:{objectIds:r.filter(o=>o.type==="shape"&&o.eventConfigurationIds?.includes(a)).map(o=>o.id).sort(),productionKillSeatIds:[]}}))}}export{l as a,p as b,R as c,P as d,A as e,N as f,T as g,L as h,U as i};
1
+ import{n as b}from"./chunk-AWPHGLTU.js";var l="seatlayer.event-configuration/1",p="seatlayer.event-configuration-export/1",c=100,_=120,S=1e5,k=1e4,y=/^[a-f0-9]{64}$/,x=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function d(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function u(e,n){return typeof e=="string"&&e.length>=1&&e.length<=n&&e.normalize("NFKC").trim()===e}function E(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function v(e){return!Array.isArray(e)||e.length>S||!e.every(n=>u(n,c))?null:[...new Set(e)].sort()}function C(e){return!d(e)||!u(e.chartId,c)||!u(e.version,c)||e.sha256!==void 0&&(typeof e.sha256!="string"||!y.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function m(e,n,t){return typeof e=="number"&&Number.isFinite(e)&&e>=n&&e<=t}function V(e){return d(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&m(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function j(e,n){if(e===void 0)return;if(!Array.isArray(e)||e.length>k)return null;let t=new Set(n),s=new Set,i=new Set,r=0,a=[];for(let o of e){if(!d(o)||!u(o.id,c)||!u(o.objectId,c)||!t.has(o.objectId)||!x.has(String(o.kind))||!m(o.heightM,.05,50)||o.baseElevationM!==void 0&&!m(o.baseElevationM,-10,100))return null;let f=V(o.occlusion);if(!f||s.has(o.id)||i.has(o.objectId))return null;let g=o.contentImageUrl===void 0?void 0:typeof o.contentImageUrl=="string"?b(o.contentImageUrl):null;if(o.contentImageUrl!==void 0&&(!g||o.kind!=="screen"||++r>1))return null;s.add(o.id),i.add(o.objectId),a.push({id:o.id,objectId:o.objectId,kind:o.kind,heightM:o.heightM,...o.baseElevationM!==void 0?{baseElevationM:o.baseElevationM}:{},occlusion:f,...g?{contentImageUrl:g}:{}})}return a.sort((o,f)=>o.id.localeCompare(f.id))}function I(e){let n=[];if(!d(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==l&&n.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${l}`}),u(e.id,c)||n.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),u(e.label,_)||n.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),E(e.version)||n.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let t=C(e.baseVenue);t||n.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let s=d(e.overlay)?e.overlay:null,i=v(s?.objectIds),r=v(s?.productionKillSeatIds),a=i?j(s?.productionElements,i):null;return(!s||!i||!r)&&n.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&n.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),n.length||!t||!i||!r||a===null?{issues:n}:{issues:n,value:{schema:l,id:e.id,label:e.label,version:e.version,baseVenue:t,overlay:{objectIds:i,productionKillSeatIds:r,...a!==void 0?{productionElements:a}:{}}}}}function R(e){let n=I(e);return n.value?{ok:!0,value:n.value}:{ok:!1,issues:n.issues}}function P(e){if(!d(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let n=[];e.schema!==p&&n.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${p}`}),(typeof e.contentSha256!="string"||!y.test(e.contentSha256))&&n.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let t=I(e.configuration);return n.push(...t.issues),n.length||!t.value||typeof e.contentSha256!="string"?{ok:!1,issues:n}:{ok:!0,value:{schema:p,configuration:t.value,contentSha256:e.contentSha256}}}function A(e){return JSON.stringify({schema:l,id:e.id,label:e.label,version:e.version,baseVenue:{chartId:e.baseVenue.chartId,version:e.baseVenue.version,...e.baseVenue.sha256?{sha256:e.baseVenue.sha256}:{}},overlay:{objectIds:[...new Set(e.overlay.objectIds)].sort(),productionKillSeatIds:[...new Set(e.overlay.productionKillSeatIds)].sort(),...e.overlay.productionElements!==void 0?{productionElements:[...e.overlay.productionElements].sort((n,t)=>n.id.localeCompare(t.id)).map(n=>({id:n.id,objectId:n.objectId,kind:n.kind,heightM:n.heightM,...n.baseElevationM!==void 0?{baseElevationM:n.baseElevationM}:{},occlusion:n.occlusion,...n.contentImageUrl?{contentImageUrl:n.contentImageUrl}:{}}))}:{}}})}function N(e,n){let t=[];e.baseVenue.chartId!==n.chartId&&t.push({code:"base_venue_mismatch",message:"Configuration belongs to a different base venue"}),e.baseVenue.version!==n.version&&t.push({code:"base_venue_version_mismatch",message:"Configuration was authored against a different venue version"}),e.baseVenue.sha256&&!n.sha256?t.push({code:"base_venue_checksum_missing",message:"Venue checksum is required for this configuration"}):e.baseVenue.sha256&&e.baseVenue.sha256!==n.sha256&&t.push({code:"base_venue_checksum_mismatch",message:"Venue bytes do not match the configuration base"});let s=new Set(n.objectIds);for(let r of e.overlay.objectIds)s.has(r)||t.push({code:"overlay_object_missing",message:`Production object ${r} is missing from the base venue`,targetId:r});if(n.objectTypes)for(let r of e.overlay.productionElements??[])n.objectTypes.get(r.objectId)!=="shape"&&t.push({code:"production_element_not_shape",message:`Production element ${r.id} must reference base-venue shape geometry`,targetId:r.objectId});let i=new Set(n.seatIds);for(let r of e.overlay.productionKillSeatIds)i.has(r)||t.push({code:"production_kill_seat_missing",message:`Production-kill seat ${r} is missing from the base venue`,targetId:r});return{compatible:t.length===0,issues:t}}var w={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function T(e,n){return e===n||w[e].has(n)}function L(e,n,t){return!E(t)||t>=n.version?null:e.find(s=>s.id===n.id&&s.version===t&&s.status==="published")??null}function O(e){return e.floors?.length?e.floors.flatMap(n=>n.objects):e.objects}function h(e,n,t){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let s of e)h(s,n,t);return}for(let[s,i]of Object.entries(e)){if(s==="eventConfigurationId"){u(i,c)?n.add(i):i!==void 0&&t.add(String(i));continue}if(s==="eventConfigurationIds"){if(!Array.isArray(i))t.add(String(i));else for(let r of i)u(r,c)?n.add(r):t.add(String(r));continue}h(i,n,t)}}}function U(e,n){let t=C(n);if(!t)return{ok:!1,invalidIds:["baseVenue"]};let s=new Set,i=new Set;if(h(e,s,i),i.size)return{ok:!1,invalidIds:[...i].sort()};let r=O(e);return{ok:!0,configurations:[...s].sort().map(a=>({schema:l,id:a,label:a,version:1,baseVenue:t,overlay:{objectIds:r.filter(o=>o.type==="shape"&&o.eventConfigurationIds?.includes(a)).map(o=>o.id).sort(),productionKillSeatIds:[]}}))}}export{l as a,p as b,R as c,P as d,A as e,N as f,T as g,L as h,U as i};
@@ -1 +1 @@
1
- import{x as X}from"./chunk-I6DNJFRF.js";var Y=9;function E(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let e=t.width/2,o=t.height/2,n=t.rotation??0;if(!n)return{hx:e,hy:o};let r=n*Math.PI/180,s=Math.abs(Math.cos(r)),c=Math.abs(Math.sin(r));return{hx:e*s+o*c,hy:e*c+o*s}}function B(t,e,o){let n=e-t.seat.x,r=o-t.seat.y;if(t.shape.kind==="circle")return n*n+r*r<=t.shape.r*t.shape.r;let s=t.shape.rotation??0,c=n,d=r;if(s){let u=-s*Math.PI/180,m=Math.cos(u),y=Math.sin(u);c=n*m-r*y,d=n*y+r*m}return Math.abs(c)<=t.shape.width/2&&Math.abs(d)<=t.shape.height/2}function L(t,e,o,n,r){if(t.shape.kind==="circle"){let h=Math.min(Math.max(t.seat.x,e),n),l=Math.min(Math.max(t.seat.y,o),r),x=t.seat.x-h,p=t.seat.y-l;return x*x+p*p<=t.shape.r*t.shape.r}let s=t.shape.rotation??0;if(!s)return t.seat.x-t.hx<=n&&t.seat.x+t.hx>=e&&t.seat.y-t.hy<=r&&t.seat.y+t.hy>=o;let c=s*Math.PI/180,d=Math.cos(c),u=Math.sin(c),m=t.shape.width/2,y=t.shape.height/2,f=[[-m,-y],[m,-y],[m,y],[-m,y]].map(([h,l])=>[t.seat.x+h*d-l*u,t.seat.y+h*u+l*d]),P=[[e,o],[n,o],[n,r],[e,r]],A=[[1,0],[0,1],[d,u],[-u,d]];for(let[h,l]of A){let x=1/0,p=-1/0;for(let[I,D]of f){let a=I*h+D*l;a<x&&(x=a),a>p&&(p=a)}let M=1/0,S=-1/0;for(let[I,D]of P){let a=I*h+D*l;a<M&&(M=a),a>S&&(S=a)}if(p<M||S<x)return!1}return!0}function j(t,e={}){let o=e.seatRadius??Y,n=t.length,r=new Array(n),s=1/0,c=1/0,d=-1/0,u=-1/0,m=0;for(let a=0;a<n;a++){let i=t[a],R=e.shapeOf?.(i)??{kind:"circle",r:o},{hx:w,hy:b}=E(R);r[a]={seat:i,shape:R,hx:w,hy:b},i.x-w<s&&(s=i.x-w),i.y-b<c&&(c=i.y-b),i.x+w>d&&(d=i.x+w),i.y+b>u&&(u=i.y+b),w>m&&(m=w),b>m&&(m=b)}n===0&&(s=0,c=0,d=0,u=0);let y=m>0?m*4:1,f=Math.max(d-s,0),P=Math.max(u-c,0),A=Math.max(64,e.maxCells??n*4),h=y,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);for(;l*x>A&&(l>1||x>1);)h*=2,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);let p=l*x,M=new Int32Array(p+1),S=0;for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++)M[C*l+g+1]++,S++}for(let a=0;a<p;a++)M[a+1]+=M[a];let I=new Int32Array(S),D=M.slice(0,p);for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++){let v=C*l+g;I[D[v]++]=a}}return{seats:t,entries:r,minX:s,minY:c,cell:h,cols:l,rows:x,cellStart:M,items:I,stamp:new Int32Array(n),epoch:0}}function q(t,e,o={}){let{cols:n,rows:r,cell:s,minX:c,minY:d,cellStart:u,items:m,entries:y}=t,f=Math.floor((e.x-c)/s),P=Math.floor((e.y-d)/s);if(f<0||P<0||f>=n||P>=r)return null;let A=P*n+f,h=u[A+1],l=-1,x=1/0;for(let p=u[A];p<h;p++){let M=m[p],S=y[M];if(o.filter&&!o.filter(S.seat.id,S.seat)||!B(S,e.x,e.y))continue;let I=e.x-S.seat.x,D=e.y-S.seat.y,a=I*I+D*D;(a<x||a===x&&M<l)&&(x=a,l=M)}return l<0?null:y[l].seat.id}function F(t,e,o,n={}){if(!(o>0))return null;let{cols:r,rows:s,cell:c,minX:d,minY:u,cellStart:m,items:y,entries:f}=t,P=Math.max(0,Math.floor((e.x-o-d)/c)),A=Math.min(r-1,Math.floor((e.x+o-d)/c)),h=Math.max(0,Math.floor((e.y-o-u)/c)),l=Math.min(s-1,Math.floor((e.y+o-u)/c));if(P>A||h>l)return null;let x=-1,p=o*o,M=t.stamp,S=++t.epoch;for(let I=h;I<=l;I++){let D=I*r;for(let a=P;a<=A;a++){let i=D+a,R=m[i+1];for(let w=m[i];w<R;w++){let b=y[w];if(M[b]===S)continue;M[b]=S;let k=f[b];if(n.filter&&!n.filter(k.seat.id,k.seat))continue;let C=e.x-k.seat.x,g=e.y-k.seat.y,v=C*C+g*g;(v<p||v===p&&b<x)&&(p=v,x=b)}}}return x<0?null:f[x].seat.id}function U(t,e,o={}){let n=Math.min(e.x,e.x+e.width),r=Math.max(e.x,e.x+e.width),s=Math.min(e.y,e.y+e.height),c=Math.max(e.y,e.y+e.height),d=o.mode??"center",{cols:u,rows:m,cell:y,minX:f,minY:P,cellStart:A,items:h,entries:l}=t,x=Math.max(0,Math.floor((n-f)/y)),p=Math.min(u-1,Math.floor((r-f)/y)),M=Math.max(0,Math.floor((s-P)/y)),S=Math.min(m-1,Math.floor((c-P)/y));if(x>p||M>S)return[];let I=[],D=t.stamp,a=++t.epoch;for(let i=M;i<=S;i++){let R=i*u;for(let w=x;w<=p;w++){let b=R+w,k=A[b+1];for(let C=A[b];C<k;C++){let g=h[C];if(D[g]===a)continue;D[g]=a;let v=l[g];if(o.filter&&!o.filter(v.seat.id,v.seat))continue;(d==="center"?v.seat.x>=n&&v.seat.x<=r&&v.seat.y>=s&&v.seat.y<=c:L(v,n,s,r,c))&&I.push(g)}}}return I.sort((i,R)=>i-R),I.map(i=>l[i].seat.id)}function _(t){let e=t.cols*t.rows,o=0,n=0;for(let s=0;s<e;s++){let c=t.cellStart[s+1]-t.cellStart[s];c>0&&o++,c>n&&(n=c)}let r=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:e,occupiedCells:o,refs:r,maxPerCell:n,meanPerOccupiedCell:o?r/o:0}}function N(t,e=0){let o=Math.max(1,t.width,t.height),n={x:t.x+t.width/2,y:t.y+t.height/2},r=o*1.55,s=Math.max(o*.82,Math.max(0,e)+o*.45);return{target:n,distance:r,height:s,focalLength:Math.hypot(r,s),yawRad:-8*Math.PI/180}}function O(t,e,o=0){let n=e.x-t.target.x,r=e.y-t.target.y,s=Math.cos(t.yawRad),c=Math.sin(t.yawRad),d=n*s-r*c,m=n*c+r*s-t.distance,y=o-t.height,f=Math.hypot(t.distance,t.height),P=(-t.distance*m-t.height*y)/f,A=(-t.height*m+t.distance*y)/f,h=Math.max(f*.08,P),l=t.focalLength/h;return{x:t.target.x+d*l,y:t.target.y-A*l,depth:h,scale:l}}function W(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function Z(t){let e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");let o=t.d/e,n=-t.b/e,r=-t.c/e,s=t.a/e;return{a:o,b:n,c:r,d:s,e:-(o*t.e+r*t.f),f:-(n*t.e+s*t.f)}}function z(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function G(t,e,o=()=>0){let n=O(t,e,o(e)),r={x:e.x+1,y:e.y},s={x:e.x,y:e.y+1},c=O(t,r,o(r)),d=O(t,s,o(s)),u=c.x-n.x,m=c.y-n.y,y=d.x-n.x,f=d.y-n.y;return{a:u,b:m,c:y,d:f,e:n.x-u*e.x-y*e.y,f:n.y-m*e.x-f*e.y}}function J(t){let e=Math.hypot(t.a,t.b),o=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:o/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(o,1e-9)}}export{Y as a,j as b,q as c,F as d,U as e,_ as f,N as g,O as h,W as i,Z as j,z as k,G as l,J as m};
1
+ import{x as X}from"./chunk-X3K36XZM.js";var Y=9;function E(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let e=t.width/2,o=t.height/2,n=t.rotation??0;if(!n)return{hx:e,hy:o};let r=n*Math.PI/180,s=Math.abs(Math.cos(r)),c=Math.abs(Math.sin(r));return{hx:e*s+o*c,hy:e*c+o*s}}function B(t,e,o){let n=e-t.seat.x,r=o-t.seat.y;if(t.shape.kind==="circle")return n*n+r*r<=t.shape.r*t.shape.r;let s=t.shape.rotation??0,c=n,d=r;if(s){let u=-s*Math.PI/180,m=Math.cos(u),y=Math.sin(u);c=n*m-r*y,d=n*y+r*m}return Math.abs(c)<=t.shape.width/2&&Math.abs(d)<=t.shape.height/2}function L(t,e,o,n,r){if(t.shape.kind==="circle"){let h=Math.min(Math.max(t.seat.x,e),n),l=Math.min(Math.max(t.seat.y,o),r),x=t.seat.x-h,p=t.seat.y-l;return x*x+p*p<=t.shape.r*t.shape.r}let s=t.shape.rotation??0;if(!s)return t.seat.x-t.hx<=n&&t.seat.x+t.hx>=e&&t.seat.y-t.hy<=r&&t.seat.y+t.hy>=o;let c=s*Math.PI/180,d=Math.cos(c),u=Math.sin(c),m=t.shape.width/2,y=t.shape.height/2,f=[[-m,-y],[m,-y],[m,y],[-m,y]].map(([h,l])=>[t.seat.x+h*d-l*u,t.seat.y+h*u+l*d]),P=[[e,o],[n,o],[n,r],[e,r]],A=[[1,0],[0,1],[d,u],[-u,d]];for(let[h,l]of A){let x=1/0,p=-1/0;for(let[I,D]of f){let a=I*h+D*l;a<x&&(x=a),a>p&&(p=a)}let M=1/0,S=-1/0;for(let[I,D]of P){let a=I*h+D*l;a<M&&(M=a),a>S&&(S=a)}if(p<M||S<x)return!1}return!0}function j(t,e={}){let o=e.seatRadius??Y,n=t.length,r=new Array(n),s=1/0,c=1/0,d=-1/0,u=-1/0,m=0;for(let a=0;a<n;a++){let i=t[a],R=e.shapeOf?.(i)??{kind:"circle",r:o},{hx:w,hy:b}=E(R);r[a]={seat:i,shape:R,hx:w,hy:b},i.x-w<s&&(s=i.x-w),i.y-b<c&&(c=i.y-b),i.x+w>d&&(d=i.x+w),i.y+b>u&&(u=i.y+b),w>m&&(m=w),b>m&&(m=b)}n===0&&(s=0,c=0,d=0,u=0);let y=m>0?m*4:1,f=Math.max(d-s,0),P=Math.max(u-c,0),A=Math.max(64,e.maxCells??n*4),h=y,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);for(;l*x>A&&(l>1||x>1);)h*=2,l=Math.max(1,Math.ceil(f/h)||1),x=Math.max(1,Math.ceil(P/h)||1);let p=l*x,M=new Int32Array(p+1),S=0;for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++)M[C*l+g+1]++,S++}for(let a=0;a<p;a++)M[a+1]+=M[a];let I=new Int32Array(S),D=M.slice(0,p);for(let a=0;a<n;a++){let i=r[a],R=X(Math.floor((i.seat.x-i.hx-s)/h),0,l-1),w=X(Math.floor((i.seat.x+i.hx-s)/h),0,l-1),b=X(Math.floor((i.seat.y-i.hy-c)/h),0,x-1),k=X(Math.floor((i.seat.y+i.hy-c)/h),0,x-1);for(let C=b;C<=k;C++)for(let g=R;g<=w;g++){let v=C*l+g;I[D[v]++]=a}}return{seats:t,entries:r,minX:s,minY:c,cell:h,cols:l,rows:x,cellStart:M,items:I,stamp:new Int32Array(n),epoch:0}}function q(t,e,o={}){let{cols:n,rows:r,cell:s,minX:c,minY:d,cellStart:u,items:m,entries:y}=t,f=Math.floor((e.x-c)/s),P=Math.floor((e.y-d)/s);if(f<0||P<0||f>=n||P>=r)return null;let A=P*n+f,h=u[A+1],l=-1,x=1/0;for(let p=u[A];p<h;p++){let M=m[p],S=y[M];if(o.filter&&!o.filter(S.seat.id,S.seat)||!B(S,e.x,e.y))continue;let I=e.x-S.seat.x,D=e.y-S.seat.y,a=I*I+D*D;(a<x||a===x&&M<l)&&(x=a,l=M)}return l<0?null:y[l].seat.id}function F(t,e,o,n={}){if(!(o>0))return null;let{cols:r,rows:s,cell:c,minX:d,minY:u,cellStart:m,items:y,entries:f}=t,P=Math.max(0,Math.floor((e.x-o-d)/c)),A=Math.min(r-1,Math.floor((e.x+o-d)/c)),h=Math.max(0,Math.floor((e.y-o-u)/c)),l=Math.min(s-1,Math.floor((e.y+o-u)/c));if(P>A||h>l)return null;let x=-1,p=o*o,M=t.stamp,S=++t.epoch;for(let I=h;I<=l;I++){let D=I*r;for(let a=P;a<=A;a++){let i=D+a,R=m[i+1];for(let w=m[i];w<R;w++){let b=y[w];if(M[b]===S)continue;M[b]=S;let k=f[b];if(n.filter&&!n.filter(k.seat.id,k.seat))continue;let C=e.x-k.seat.x,g=e.y-k.seat.y,v=C*C+g*g;(v<p||v===p&&b<x)&&(p=v,x=b)}}}return x<0?null:f[x].seat.id}function U(t,e,o={}){let n=Math.min(e.x,e.x+e.width),r=Math.max(e.x,e.x+e.width),s=Math.min(e.y,e.y+e.height),c=Math.max(e.y,e.y+e.height),d=o.mode??"center",{cols:u,rows:m,cell:y,minX:f,minY:P,cellStart:A,items:h,entries:l}=t,x=Math.max(0,Math.floor((n-f)/y)),p=Math.min(u-1,Math.floor((r-f)/y)),M=Math.max(0,Math.floor((s-P)/y)),S=Math.min(m-1,Math.floor((c-P)/y));if(x>p||M>S)return[];let I=[],D=t.stamp,a=++t.epoch;for(let i=M;i<=S;i++){let R=i*u;for(let w=x;w<=p;w++){let b=R+w,k=A[b+1];for(let C=A[b];C<k;C++){let g=h[C];if(D[g]===a)continue;D[g]=a;let v=l[g];if(o.filter&&!o.filter(v.seat.id,v.seat))continue;(d==="center"?v.seat.x>=n&&v.seat.x<=r&&v.seat.y>=s&&v.seat.y<=c:L(v,n,s,r,c))&&I.push(g)}}}return I.sort((i,R)=>i-R),I.map(i=>l[i].seat.id)}function _(t){let e=t.cols*t.rows,o=0,n=0;for(let s=0;s<e;s++){let c=t.cellStart[s+1]-t.cellStart[s];c>0&&o++,c>n&&(n=c)}let r=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:e,occupiedCells:o,refs:r,maxPerCell:n,meanPerOccupiedCell:o?r/o:0}}function N(t,e=0){let o=Math.max(1,t.width,t.height),n={x:t.x+t.width/2,y:t.y+t.height/2},r=o*1.55,s=Math.max(o*.82,Math.max(0,e)+o*.45);return{target:n,distance:r,height:s,focalLength:Math.hypot(r,s),yawRad:-8*Math.PI/180}}function O(t,e,o=0){let n=e.x-t.target.x,r=e.y-t.target.y,s=Math.cos(t.yawRad),c=Math.sin(t.yawRad),d=n*s-r*c,m=n*c+r*s-t.distance,y=o-t.height,f=Math.hypot(t.distance,t.height),P=(-t.distance*m-t.height*y)/f,A=(-t.height*m+t.distance*y)/f,h=Math.max(f*.08,P),l=t.focalLength/h;return{x:t.target.x+d*l,y:t.target.y-A*l,depth:h,scale:l}}function W(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function Z(t){let e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");let o=t.d/e,n=-t.b/e,r=-t.c/e,s=t.a/e;return{a:o,b:n,c:r,d:s,e:-(o*t.e+r*t.f),f:-(n*t.e+s*t.f)}}function z(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function G(t,e,o=()=>0){let n=O(t,e,o(e)),r={x:e.x+1,y:e.y},s={x:e.x,y:e.y+1},c=O(t,r,o(r)),d=O(t,s,o(s)),u=c.x-n.x,m=c.y-n.y,y=d.x-n.x,f=d.y-n.y;return{a:u,b:m,c:y,d:f,e:n.x-u*e.x-y*e.y,f:n.y-m*e.x-f*e.y}}function J(t){let e=Math.hypot(t.a,t.b),o=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:o/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(o,1e-9)}}export{Y as a,j as b,q as c,F as d,U as e,_ as f,N as g,O as h,W as i,Z as j,z as k,G as l,J as m};
@@ -0,0 +1 @@
1
+ import{c as le}from"./chunk-CRCGO52K.js";var Xt=40,zt=1200,Kt=.8,Vt=3,$t=-2,Wt=20,Yt=.1,qt=40,Jt=40,ue=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function $e(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/ue(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let c=0;for(let u of i.split(/\s+/)){let s=u.length;c&&c+1+s<=o?c+=1+s:(r+=Math.max(1,Math.ceil(s/o)),c=s%o)}}return Math.max(1,r)}function fe(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(u=>u.length))*ue(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),c=$e(e,i);return{width:r,height:c*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:c,padding:t}}var We=Math.PI/180;function I(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ye(e,t,n){let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,c=e.y-t.y;return{x:t.x+i*o-c*r,y:t.y+i*r+c*o}}function Zt(e,t){return Ye(e,{x:0,y:0},t*We)}function O(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qe(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function en(e){return e.length?qe(e):null}function Y(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,c=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+c*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+c*e.end.y}}function on(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 me(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[Y(e,.5)];let o=Array.from({length:n+1},(s,f)=>Y(e,f/n)),r=new Float64Array(o.length);for(let s=1;s<o.length;s+=1){let f=o[s].x-o[s-1].x,a=o[s].y-o[s-1].y;r[s]=r[s-1]+Math.hypot(f,a)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let c=[],u=1;for(let s=0;s<t;s+=1){let f=i*s/(t-1);for(;u<r.length-1&&r[u]<f;)u+=1;let a=r[u-1],m=r[u],d=m===a?0:(f-a)/(m-a);c.push({x:o[u-1].x+(o[u].x-o[u-1].x)*d,y:o[u-1].y+(o[u].y-o[u-1].y)*d})}return c}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function F(e,t){return{x:e.x-t.x,y:e.y-t.y}}function R(e,t){return{x:e.x*t,y:e.y*t}}function B(e,t=13){return Array.from({length:t},(n,o)=>Y(e,o/(t-1)))}function de(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return O(e[o],e[o+1],n-o)}function he(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[de(e,o)];for(let c=1;c<e.length-1;c+=1){let u=c/(e.length-1);u>o+1e-9&&u<r-1e-9&&i.push(e[c])}return i.push(de(e,r)),i}function pe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([d,x],p)=>{let y=I(O(e[d],e[x],.5),t);y<r&&(r=y,o=p)});let i=e[o],c=e[(o+1)%4],u=e[(o+2)%4],s=e[(o+3)%4],f=O(i,c,.5),a=F(t,f),m=Math.max(1e-9,Math.hypot(a.x,a.y));return{p0:i,p1:c,p2:u,p3:s,normal:R(a,1/m),depth:(I(i,s)+I(c,u))/2}}function ye(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:c}=e,u=F(n,t),s=F(o,r),f=c*.22,a=c*.12;return{nearPath:{start:t,control1:T(T(t,R(u,1/3)),R(i,f)),control2:T(T(t,R(u,2/3)),R(i,f)),end:n},farPath:{start:o,control1:T(T(r,R(s,2/3)),R(i,a)),control2:T(T(r,R(s,1/3)),R(i,a)),end:r}}}function rn(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((p,y)=>T(p,y),{x:0,y:0});o.x/=4,o.y/=4;let r=I(e[0],e[1]),i=I(e[0],e[3]),c=n==="auto"?r>i*1.25&&I(o,t)>i?"bezier":"tapered":n;if(c==="rectangle")return{mode:c,outline:e.map(p=>({...p}))};let u=pe(e,t),{p0:s,p1:f,p2:a,p3:m}=u;if(c==="tapered")return{mode:c,outline:[T(s,R(F(f,s),.14)),T(s,R(F(f,s),1-.14)),a,m]};let{nearPath:d,farPath:x}=ye(u);return{mode:c,outline:[...B(d),...B(x).slice(1)]}}function sn(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=pe(e,t),{p0:i,p1:c,p2:u,p3:s}=r,f=o==="bezier"?ye(r):null,a=f?B(f.nearPath):null,m=f?B(f.farPath).reverse():null,d=Math.min(.055,.18/(n+1));return Array.from({length:n},(x,p)=>{let y=(p+1)/(n+1),h=y-d/2,b=y+d/2;return a&&m?[...he(a,h,b),...he(m,h,b).reverse()]:[O(i,c,h),O(i,c,b),O(s,u,b),O(s,u,h)]})}function Je(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,c=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+c*o),e.y-(t.y+c*r))}function Qe(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 c=Je(e,o[i],o[r]);c<n&&(n=c)}return n}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,c=t[o].y,u=t[r].x,s=t[r].y;c>e.y!=s>e.y&&e.x<(u-i)*(e.y-c)/(s-c)+i&&(n=!n)}return n}function Ze(e,t,n){let o=xe(e,t)&&!n.some(i=>xe(e,i)),r=Qe(e,[t,...n]);return o?r:-r}function L(e,t,n,o,r){let i=Ze({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var q=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,c=i+1,u=r;if(i<t.length&&t[i].max>t[u].max&&(u=i),c<t.length&&t[c].max>t[u].max&&(u=c),u===r)break;[t[u],t[r]]=[t[r],t[u]],r=u}}return n}};function be(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 an(e,t){return Math.max(0,be(e)-(t??[]).reduce((n,o)=>n+be(o),0))}function ge(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let y=e.reduce((b,S)=>b+S.x,0)/e.length,h=e.reduce((b,S)=>b+S.y,0)/e.length;return{point:{x:y,y:h},radius:0}}let o=1/0,r=1/0,i=-1/0,c=-1/0;for(let y of e)y.x<o&&(o=y.x),y.y<r&&(r=y.y),y.x>i&&(i=y.x),y.y>c&&(c=y.y);let u=i-o,s=c-r,f=Math.min(u,s);if(!(f>0))return{point:{x:(o+i)/2,y:(r+c)/2},radius:0};let a=Math.max(u,s)/150,m=new q,d=f/2;for(let y=o;y<i;y+=f)for(let h=r;h<c;h+=f)m.push(L(y+d,h+d,d,e,n));let x=L(o+u/2,r+s/2,0,e,n),p=0;for(;m.size;){let y=m.pop();if(!y)break;y.d>x.d&&(x=y),!(y.max-x.d<=a)&&(p>=4e3||(p+=1,d=y.h/2,m.push(L(y.x-d,y.y-d,d,e,n)),m.push(L(y.x+d,y.y-d,d,e,n)),m.push(L(y.x-d,y.y+d,d,e,n)),m.push(L(y.x+d,y.y+d,d,e,n))))}return{point:{x:x.x,y:x.y},radius:Math.max(0,x.d)}}function et(e,t,n){return Math.max(t,Math.min(n,e))}function un(e,t,n){return e<t?t:e>n?n:e}function tt(e){return et(e,0,1)}function we(e){let t=tt(e);return t*t*(3-2*t)}var k=Math.PI*2;function j(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function nt(e,t,n){let o=t-e;if(n){for(;o<0;)o+=k;for(;o>=k;)o-=k}else{for(;o>0;)o-=k;for(;o<=-k;)o+=k}return o}function mn(e){return e.end}function Pe(e){if(e.version!==1||e.closed!==!0||!j(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!j(n.end))return!1;if(n.kind==="line"){if(I(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!j(n.control1)||!j(n.control2)||I(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!j(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(I(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(I(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||I(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return I(t,e.start)<=1e-4}function ot(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function pn(e,t=2){if(!Pe(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let c=Math.atan2(r.y-i.center.y,r.x-i.center.x),u=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),s=nt(c,u,i.clockwise),f=Math.max(2,Math.ceil(Math.abs(s)*i.radius/n));for(let a=1;a<=f;a+=1){let m=c+s*a/f;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let c=I(r,i.control1)+I(i.control1,i.control2)+I(i.control2,i.end),u=Math.max(2,Math.ceil(c/n));for(let s=1;s<=u;s+=1)o.push(ot(r,i,s/u))}r=i.end}return I(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function ve(e,t,n){return rt(e,r=>({x:r.x+t,y:r.y+n}))}function rt(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 it=45,J=150,st=60;function ct(e){let t=it/100;if(e<=t)return J;let n=Math.min(1,(e-t)/(1-t));return J-n*(J-st)}var Se=.5523;function Me(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function at(e){let t=[],n=[];for(e.forEach((o,r)=>{j(o)&&(t.length&&Me(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Me(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function yn(e,t,n){return dt(e,{cornerSmoothing:t,...n})}var lt=.5,ut=4/3;function ft(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let c=-r/i,u=o/i,s=n*ut;return{kind:"bezier",control1:{x:e.x+o/3+c*s,y:e.y+r/3+u*s},control2:{x:e.x+o*2/3+c*s,y:e.y+r*2/3+u*s},end:{...t}}}function dt(e,t){let{points:n,sourceIndex:o}=at(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,c=t.edgeCurvature,u=new Array(r).fill(0);if(c?.length)for(let l=0;l<r;l+=1){let M=c[o[l]];u[l]=Number.isFinite(M)?Math.min(100,Math.max(-100,M))/100:0}let s=u.some(l=>Math.abs(l)>1e-6);if(i<=0&&!s)return null;let f=t.wideAngleThresholdDeg??ct(i),a=[];for(let l=0;l<r;l+=1)a[l]=I(n[l],n[(l+1)%r]);let m=new Array(r).fill(0);for(let l=0;l<r;l+=1){let M=n[(l-1+r)%r],w=n[l],P=n[(l+1)%r],C={x:M.x-w.x,y:M.y-w.y},E={x:P.x-w.x,y:P.y-w.y},A=Math.hypot(C.x,C.y),_=Math.hypot(E.x,E.y);if(A<=1e-9||_<=1e-9)continue;let H=Math.min(1,Math.max(-1,(C.x*E.x+C.y*E.y)/(A*_))),N=Math.acos(H)*180/Math.PI;if(N<f)continue;let W=we((N-f)/(180-f));m[l]=i*W*.5*Math.min(A,_)}for(let l=0;l<r;l+=1){let M=(l+1)%r,w=m[l]+m[M];if(w>a[l]&&w>1e-9){let P=a[l]/w;m[l]*=P,m[M]*=P}}let d=new Array(r),x=new Array(r);for(let l=0;l<r;l+=1){let M=n[(l-1+r)%r],w=n[l],P=n[(l+1)%r];if(m[l]<=1e-6){d[l]={...w},x[l]={...w};continue}let C=I(w,M)||1,E=I(w,P)||1;d[l]={x:w.x+(M.x-w.x)/C*m[l],y:w.y+(M.y-w.y)/C*m[l]},x[l]={x:w.x+(P.x-w.x)/E*m[l],y:w.y+(P.y-w.y)/E*m[l]}}if(m.every(l=>l<=1e-6)&&!s)return null;let p=[],y={...x[0]},h=y,b=(l,M)=>{if(I(h,l)<=1e-9)return;let w=u[M];Math.abs(w)>1e-6?p.push(ft(h,l,w*lt*a[M])):p.push({kind:"line",end:{...l}}),h=l};for(let l=1;l<=r;l+=1){let M=l%r,w=n[M];b(d[M],(l-1)%r),m[M]>1e-6&&I(d[M],x[M])>1e-9&&(p.push({kind:"bezier",control1:O(d[M],w,Se),control2:O(x[M],w,Se),end:{...x[M]}}),h=x[M])}if(!p.length)return null;let S=p[p.length-1];I(S.end,y)>1e-9&&(S.kind==="line"?S.end={...y}:p.push({kind:"line",end:{...y}}));let g={version:1,closed:!0,start:y,segments:p};return Pe(g)?g:null}function xn(e){let t=[],n=e.start;for(let r of e.segments)t.push(n),n=r.end;let o=[];for(let r=e.segments.length-1;r>=0;r-=1){let i=e.segments[r],c=t[r];i.kind==="line"?o.push({kind:"line",end:{...c}}):i.kind==="arc"?o.push({kind:"arc",center:{...i.center},radius:i.radius,clockwise:!i.clockwise,end:{...c}}):o.push({kind:"bezier",control1:{...i.control2},control2:{...i.control1},end:{...c}})}return{version:1,closed:!0,start:{...e.start},segments:o}}function gn(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],c=e[r+1],u=Math.hypot(c.x-i.x,c.y-i.y);if(u<=0)continue;let s=Math.max(1,Math.round(u/n)),f=u/s,a=Math.atan2(c.y-i.y,c.x-i.x),m=r===0,x=(r>0?t[r-1]:void 0)==="break"?2:1,p=m?{...i}:{x:i.x+Math.cos(a)*f*x,y:i.y+Math.sin(a)*f*x},y=m?s+1:Math.max(1,s-(x-1));o.push({origin:p,rotation:a*180/Math.PI,seatCount:y,seatSpacing:f})}return o}function wn(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 Sn(e){return e.reduce((t,n)=>t+n.seatCount,0)}function Ie(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((d,x)=>d.segmentedRow.componentIndex-x.segmentedRow.componentIndex),c=i[0]?.segmentedRow?.componentCount??0,u=i[0]?.segmentedRow;if(!u||!(c>=2&&i.length===c&&u?.boundaryBefore==="start"&&i.every((d,x)=>d.segmentedRow?.kind==="segmented-row-v1"&&d.segmentedRow.groupId===o&&d.segmentedRow.componentCount===c&&d.segmentedRow.componentIndex===x&&d.segmentedRow.repeatLabelOnComponents===u.repeatLabelOnComponents&&(x===0?d.segmentedRow.boundaryBefore==="start":d.segmentedRow.boundaryBefore!=="start")&&d.segmentedRow.displayLabel===u.displayLabel)))continue;let f=i.reduce((d,x)=>d+x.seatCount,0),a=0,m=0;for(let d of i)d.segmentedRow.boundaryBefore==="break"&&(a+=1),t.set(d.id,{groupId:o,adjacencyOffset:a,displayOffset:m,displayLabel:u.displayLabel,totalSeats:f,canonical:i[0],viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence}),a+=d.seatCount,m+=d.seatCount}return t}var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZ",ht="ABCDEFGHJKLMNPQRSTUVWXYZ",mt="abcdefghijklmnopqrstuvwxyz";function Ee(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 pt(e,t){let n=t.startAt-1,o=e+n;if(t.scheme==="numbers")return String(o+1);let r=t.skipAmbiguous?ht:Ce;return Ee(o,r)}function Q(e,t=!1){let n=t?mt:Ce;return Ee(Math.max(0,Math.floor(e)-1),n)}var yt=[[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 Oe(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of yt)for(;t>=o;)n+=r,t-=o;return n}function Pn(e,t){let n=e.length;return e.map((o,r)=>{let i=t.reverse?n-1-r:r;return{...o,label:pt(i,t)}})}function xt(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 Z(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",c=e.seatNumbering?.prefix??"",u=e.seatNumbering?.endAt,s=e.seatCount;if(i==="updown"||i==="updown-descending"){let x=Math.ceil(s/2),p=i==="updown"?t<x?n+2*t:n-1+2*(s-t):t<x?n+2*(x-1-t):n+1+2*(t-x);return`${c}${p}`}let f=i==="odd"||i==="even"?2:r,a=u!=null&&Number.isFinite(u)?u-(s-1)*f:n,m=o==="center"?xt(s)[t]:o==="rtl"?s-1-t:t,d;switch(i){case"odd":{let x=a%2===1?a:a+1;d=String(x+m*2);break}case"even":{let x=a%2===0?a:a+1;d=String(x+m*2);break}case"roman":d=Oe(a+m*r);break;case"letters-upper":d=Q(a+m*r,!1);break;case"letters-lower":d=Q(a+m*r,!0);break;default:d=String(a+m*r);break}return`${c}${d}`}function bt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Te(e,t,n){return n?.label??`${e.label}-${Z(e,t)}`}function ee(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(!n)return`${e.displayLabel??e.label}-${Z(e,t)}`;let r=bt(n),i=n.displayOffset+t;return`${n.displayLabel}-${Z(r,i)}`}var G=.02291666666666667,En=1/G,gt=58,wt=gt*G,Re=0,_e=3,Ae=0,te=120,St=0,Mt=45,Pt=7,X=1.2;function ne(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function On(e){return Number.isFinite(e)?Math.max(Re,Math.min(_e,Math.round(e))):Re}function vt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Pt?e:_e}function Le(e,t={}){let n=ne(t.floorBaseHeightM,Ae,te,0),o=Math.min(te,n+vt(e.elevation)*wt),r=e.height===void 0?o:ne(e.height,Ae,te,o),i=ne(e.rake,St,Mt,0);return{height:r,rake:i}}function ke(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],c=e[r+1],u=c.x-i.x,s=c.y-i.y,f=u*u+s*s,a=f>1e-12?((t-i.x)*u+(n-i.y)*s)/f:0;a<0?a=0:a>1&&(a=1);let m=Math.hypot(t-(i.x+a*u),n-(i.y+a*s));m<o&&(o=m)}return o}function It(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 c=Math.hypot(i.x-t,i.y-n);c>r&&(r=c)}return{cx:t,cy:n,r}}function De(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function oe(e,t){let n=1/0;for(let o of ke(e)){let r=je(t,o.x,o.y);r<n&&(n=r)}for(let o of ke(t)){let r=je(e,o.x,o.y);r<n&&(n=r)}return n}function Ct(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let a of e)n+=a.x,o+=a.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let a of e){let m=Math.hypot(a.x-n,a.y-o);m>r&&(r=m,i=a)}let c=i.x-n,u=i.y-o,s=Math.hypot(c,u);s>1e-9?(c/=s,u/=s):(c=1,u=0);let f=e.map((a,m)=>({p:a,i:m,t:(a.x-n)*c+(a.y-o)*u})).sort((a,m)=>a.t-m.t);return{pts:f.map(a=>a.p),seatIndices:f.map(a=>t[a.i])}}function Et(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let S of e)n+=S.x,o+=S.y;n/=t,o/=t;let r=0,i=0,c=0,u=0,s=0,f=0,a=0;for(let S of e){let g=S.x-n,l=S.y-o;r+=g*g,c+=l*l,i+=g*l,u+=g*g*g,s+=l*l*l,f+=g*l*l,a+=l*g*g}let m=r*c-i*i;if(Math.abs(m)<1e-9)return null;let d=(u+f)/2,x=(s+a)/2,p=(d*c-x*i)/m,y=(x*r-d*i)/m,h=p+n,b=y+o;return!Number.isFinite(h)||!Number.isFinite(b)?null:{cx:h,cy:b}}var Ot=.15;function Tt(e){if(e.length<2)return null;let t=e.map(S=>{let g=0,l=0;for(let M of S.pts)g+=M.x,l+=M.y;return{x:g/S.pts.length,y:l/S.pts.length}}),n=0,o=0;for(let S of t)n+=S.x,o+=S.y;n/=t.length,o/=t.length;let r=0,i=0,c=0;for(let S of t){let g=S.x-n,l=S.y-o;r+=g*g,i+=g*l,c+=l*l}let u=r+c,s=r*c-i*i,f=u/2+Math.sqrt(Math.max(0,u*u/4-s)),a,m;Math.abs(i)>1e-12?(a=f-c,m=i):r>=c?(a=1,m=0):(a=0,m=1);let d=Math.hypot(a,m);if(!(d>1e-12))return null;a/=d,m/=d;let x=1/0,p=-1/0,y=[];for(let S of e){let g=1/0,l=-1/0;for(let M of S.pts){let w=M.x*a+M.y*m;w<g&&(g=w),w>l&&(l=w),w<x&&(x=w),w>p&&(p=w)}y.push(l-g)}let h=p-x;return h>1e-9?(y.sort((S,g)=>S-g),y[Math.min(y.length-1,Math.floor(y.length*.9))]/h<=Rt?{x:a,y:m}:null):null}var Rt=.35;function Ne(e,t,n,o){let r=new Map;for(let h of n){let b=t[h],S=b.rowId||`__seat-${h}`,g=r.get(S);g||(g={pts:[],idx:[]},r.set(S,g)),g.pts.push({x:b.x,y:b.y}),g.idx.push(h)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[h,b]of r){let S=Ct(b.pts,b.idx),g=0;for(let l of S.pts)g+=Math.hypot(l.x-o.x,l.y-o.y);i.push({id:h,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:g/S.pts.length})}let c=i.map(h=>It(h.pts)),u=[];for(let h=0;h<i.length;h++){let b=1/0;for(let S=0;S<i.length;S++){if(h===S||De(c[h],c[S])>=b)continue;let g=oe(i[h].pts,i[S].pts);g<b&&(b=g)}Number.isFinite(b)&&u.push(b)}u.sort((h,b)=>h-b);let s=u.length?u[Math.floor(u.length/2)]:1,f=Math.max(s*1.8,1e-6),a=i.map(()=>[]);for(let h=0;h<i.length;h++)for(let b=h+1;b<i.length;b++)De(c[h],c[b])>f||oe(i[h].pts,i[b].pts)<=f&&(a[h].push(b),a[b].push(h));let m=0;for(let h=0;h<i.length;h++){if(i[h].blockId!==-1)continue;let b=m++,S=[h];for(i[h].blockId=b;S.length;){let g=S.pop();for(let l of a[g])i[l].blockId===-1&&(i[l].blockId=b,S.push(l))}}let d=new Map;for(let h of i){let b=d.get(h.blockId)??[];b.push(h),d.set(h.blockId,b)}let x=[];for(let h of i){if(h.pts.length<4)continue;let b=Et(h.pts);b&&(!Number.isFinite(b.cx)||!Number.isFinite(b.cy)||x.push({x:b.cx,y:b.cy}))}let p=x.length>=2?(()=>{let h=x.map(g=>g.x).sort((g,l)=>g-l),b=x.map(g=>g.y).sort((g,l)=>g-l),S=Math.floor(x.length/2);return{cx:h[S],cy:b[S]}})():null;if(p){let h=w=>Math.hypot(w.x-p.cx,w.y-p.cy),b=1/0,S=-1/0,g=[];for(let w of i){let P=1/0,C=-1/0;for(let E of w.pts){let A=h(E);A<P&&(P=A),A>C&&(C=A)}g.push(C-P),P<b&&(b=P),C>S&&(S=C)}let l=S-b;g.sort((w,P)=>w-P);let M=g[Math.min(g.length-1,Math.floor(g.length*.9))];if(l>1e-9&&M/l<=Ot){let w=i.map(v=>{let U=0;for(let Ve of v.pts)U+=h(Ve);return{row:v,radius:U/v.pts.length}}),P=0,C=0;for(let v of w)P+=v.radius,C+=v.row.focalDistance;P/=w.length,C/=w.length;let E=0;for(let v of w)E+=(v.radius-P)*(v.row.focalDistance-C);if(E<0)for(let v of w)v.radius=-v.radius;let _=1/0;for(let v of w)v.radius<_&&(_=v.radius);w.sort((v,U)=>v.radius-U.radius);let H=-1,N=-1/0,W=l/Math.max(1,w.length)*.5,ae=[];for(let v of w)v.radius-N>W&&(H++,N=v.radius),v.row.ordinal=H,v.row.blockDepth=v.radius-_,ae.push(v.row);return{sectionId:e,rows:ae,blockCount:m}}}let y=[];for(let[,h]of d){let b=Tt(h);if(b){let S=l=>{let M=0;for(let w of l.pts)M+=w.x*b.x+w.y*b.y;return M/l.pts.length};h.sort((l,M)=>S(l)-S(M)),h.length>=2&&h[0].focalDistance>h[h.length-1].focalDistance&&h.reverse();let g=0;for(let l=0;l<h.length;l++)l>0&&(g+=oe(h[l-1].pts,h[l].pts)),h[l].ordinal=l,h[l].blockDepth=g,y.push(h[l])}else{let S=1/0;for(let g of h)g.focalDistance<S&&(S=g.focalDistance);h.sort((g,l)=>g.focalDistance-l.focalDistance);for(let g=0;g<h.length;g++)h[g].ordinal=g,h[g].blockDepth=Math.max(0,h[g].focalDistance-S),y.push(h[g])}}return{sectionId:e,rows:y,blockCount:m}}function Ge(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var K=Math.PI/180,At=9,D=16;function ie(e,t,n,o){let r=n*K,i=Math.cos(r),c=Math.sin(r);return{x:o.x+e*i-t*c,y:o.y+e*c+t*i}}function Xe(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,c=[];if(e.path)return me(e.path,t);if(t<=1)return t===1&&c.push({x:i.x,y:i.y}),c;if(o===0){for(let f=0;f<t;f++)c.push(ie(f*n,0,r,i));return c}let u=o/(t-1)*K,s=n/(2*Math.sin(Math.abs(u)/2));for(let f=0;f<t;f++){let a=f*u,m=s*Math.sin(a),d=-s+s*Math.cos(a);c.push(ie(m,d,r,i))}return c}function _t(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Un(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 Lt(e,t){let n=_t(e);return Xe(e).map((o,r)=>{let i=n.get(r),c=Ge(i),u=Te(e,r,i),s={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:u,displayLabel:ee(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:c.length>0,accessibility:c,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(s).some(f=>f!==void 0&&f!==!1&&f!=="")?s:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function ze(e){let t=[];for(let n of Lt(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 kt(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 Ke(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(a=>[a.index,a])),r=(a,m,d,x)=>{let p=o.get(a),y=Ge(p),h=p?.label??`${e.label}-${a+1}`,b=e.displayLabel??e.label;return{index:a,label:h,displayLabel:p?.displayLabel??`${b}-${a+1}`,x:m+(p?.dx??0),y:d+(p?.dy??0),categoryKey:p?.categoryKey??e.categoryKey,skipped:!!p?.skip,accessible:y.length>0,accessibility:y,wheelchairSpaceType:p?.wheelchairSpaceType,commercial:p?.commercial,glyph:p?.glyph,viewUrl:p?.viewFromSeatUrl,viewMeta:p?.viewFromSeatUrl?p.viewFromSeatMeta:void 0,labelStyle:p?.labelStyle,...x?{side:x}:{}}};if(e.shape==="round"){let a=(e.radius??40)+D,m=e.rotation*K,d=Math.max(0,Math.min(360,e.seatArc??360));if(d>=360||n===1){for(let h=0;h<n;h++){let b=m+h/n*2*Math.PI;t.push(r(h,e.center.x+a*Math.cos(b),e.center.y+a*Math.sin(b)))}return t}let x=d*K,p=(2*Math.PI-x)/2,y=m+p;for(let h=0;h<n;h++){let b=y+h/(n-1)*x;t.push(r(h,e.center.x+a*Math.cos(b),e.center.y+a*Math.sin(b)))}return t}let i=e.width??80,c=e.height??50,u=kt(e),s=["top","bottom","left","right"],f=0;for(let a of s){let m=u[a];for(let d=0;d<m;d++){let x,p;a==="top"?(x=-i/2+(d+.5)*i/m,p=-c/2-D):a==="bottom"?(x=-i/2+(d+.5)*i/m,p=c/2+D):a==="left"?(x=-i/2-D,p=-c/2+(d+.5)*c/m):(x=i/2+D,p=-c/2+(d+.5)*c/m);let y=ie(x,p,e.rotation,e.center);t.push(r(f++,y.x,y.y,a))}}return t}function Bn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Ke(e).filter(t=>!t.skipped).length}function jt(e){return Ke(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 Dt(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 Fe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,c=t[o].y,u=t[r].x,s=t[r].y;c>e.y!=s>e.y&&e.x<(u-i)*(e.y-c)/(s-c)+i&&(n=!n)}return n}function Nt(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 c=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),u=(r.x-n.x)**2+(r.y-n.y)**2;return c>=-1e-7&&c<=u+1e-7})}function V(e,t,n){return Fe(e,t)&&!(n??[]).some(o=>Fe(e,o)||Nt(e,o))}function Gn(e,t){return ge(e,t).point}function re(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 $(e){switch(e.type){case"row":{let t=ze(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 re(e.points);case"section":return re(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?re(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 He(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Ft(e,t){if(e.type!=="gaArea"||!He(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>He(r,o[i]))}function Ht(e,t){let n=e.filter(c=>c.type==="section"),o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,r=$(t);return(o?n.find(c=>(c.logicalSectionId??c.id)===o&&(Ft(t,c)||V(r,c.outline,c.holes))):void 0)??n.find(c=>V(r,c.outline,c.holes))}function Ut(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 Xn(e,t){let n=Ut(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function Bt(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function se(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:ve(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 zn(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 c of o.objects)n.push(i===0?c:se(c,0,i))}),{...e,objects:n,floors:void 0}}function Kn(e){let t=e.floors;if(!t||t.length<2)return e;let n=Gt(e),o=[];return t.forEach((r,i)=>{let{x:c,y:u}=n[i];for(let s of r.objects)o.push(se(s,c,u))}),{...e,objects:o,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function Vn(e){let t=e.floors;if(!t||t.length<2)return!1;let n=t.map(s=>ce({...e,objects:s.objects,floors:void 0,focalPoint:s.focalPoint,referenceImage:void 0,backgroundImage:void 0}));if(n.some(s=>s.width<=0||s.height<=0))return!1;let[o,...r]=n;if(!r.every(s=>{let f=Math.min(o.x+o.width,s.x+s.width)-Math.max(o.x,s.x),a=Math.min(o.y+o.height,s.y+s.height)-Math.max(o.y,s.y);return f<=0||a<=0?!1:f>=Math.min(o.width,s.width)*.7&&a>=Math.min(o.height,s.height)*.7}))return!1;let c={x:o.x+o.width/2,y:o.y+o.height/2},u=Math.hypot(o.width,o.height)/2;return t.every(s=>s.objects.length?s.objects.filter(a=>{let m=$(a);return Math.hypot(m.x-c.x,m.y-c.y)>=u*.25}).length>=s.objects.length*.6:!1)}function $n(e){let t=e.floors;if(!t||t.length<2)return e;let n=t.map((s,f)=>({floor:s,index:f,height:s.baseHeightM??0})).sort((s,f)=>s.height-f.height||s.index-f.index),o=ce({...e,objects:n[0].floor.objects,floors:void 0,focalPoint:n[0].floor.focalPoint,referenceImage:void 0,backgroundImage:void 0}),r={x:o.x+o.width/2,y:o.y+o.height/2},i=Math.max(48,Math.min(200,Math.max(o.width,o.height)*.06)),c=[],u=0;return n.forEach((s,f)=>{let a=s.floor.objects.map(y=>{let h=$(y);return Math.hypot(h.x-r.x,h.y-r.y)}),m=a.filter(y=>Number.isFinite(y)),d=m.length?Math.min(...m):0,x=m.length?Math.max(...m):0,p=f===0?0:Math.max(0,u+i-d);u=x+p,s.floor.objects.forEach((y,h)=>{if(f>0&&y.type==="shape"&&y.role==="stage")return;if(p===0){c.push(y);return}let b=a[h];if(!Number.isFinite(b)||b<1e-6){c.push(y);return}let S=$(y);c.push(se(y,(S.x-r.x)/b*p,(S.y-r.y)/b*p))})}),{...e,objects:c,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function Gt(e){let t=e.floors;if(!t?.length)return[{x:0,y:0}];if(t.length<2)return t.map(()=>({x:0,y:0}));let n=t.map(d=>ce({...e,objects:d.objects,floors:void 0,focalPoint:d.focalPoint,referenceImage:void 0,backgroundImage:void 0})),o=Math.max(1,...n.map(d=>Math.max(d.width,d.height))),r=Math.max(64,Math.min(240,o*.08)),i=16/10,c=null;for(let d=1;d<=t.length;d+=1){let x=Math.ceil(t.length/d),p=new Array(d).fill(0),y=new Array(x).fill(0);n.forEach((l,M)=>{let w=M%d,P=Math.floor(M/d);p[w]=Math.max(p[w],l.width),y[P]=Math.max(y[P],l.height)});let h=p.reduce((l,M)=>l+M,0)+r*(d-1),b=y.reduce((l,M)=>l+M,0)+r*(x-1),S=d*x-t.length,g=Math.abs(Math.log(h/Math.max(1,b)/i))+S*.04;(!c||g<c.score)&&(c={columns:d,columnWidths:p,rowHeights:y,score:g})}let{columns:u,columnWidths:s,rowHeights:f}=c,a=[],m=[];return s.reduce((d,x,p)=>(a[p]=d,d+x+r),0),f.reduce((d,x,p)=>(m[p]=d,d+x+r),0),t.map((d,x)=>{let p=n[x],y=x%u,h=Math.floor(x/u),b=a[y]+(s[y]-p.width)/2,S=m[h]+(f[h]-p.height)/2;return{x:b-p.x,y:S-p.y}})}function Ue(e,t,n,o,r,i,c,u,s){let f=[],a=Ie(e),m=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===s),d=p=>le(p,{activeConfigurationId:o,activeConfigurationVersion:s,activeBasisSha256:r,now:u}),x=(p,y)=>d(p)?{...p,coverage:y}:void 0;for(let p of e){let y=[];if(p.type==="row"?y=ze(p):p.type==="table"?y=jt(p):p.type==="booth"&&(y=Dt(p)),!y.length)continue;for(let l of y)l.viewUrl&&!m(l.viewMeta)&&(l.viewUrl=void 0,l.viewMeta=void 0);if(p.type==="row"){let l=a.get(p.id);if(l){let M=new Map((p.overrides??[]).map(w=>[w.index,w]));for(let w of y){let P=Number(w.id.slice(w.id.lastIndexOf(":")+1));if(!Number.isInteger(P))continue;w.logicalRowId=l.groupId,w.logicalSeatIndex=l.adjacencyOffset+P,M.get(P)?.displayLabel||(w.displayLabel=ee(p,P,l)),!w.viewUrl&&l.viewFromSeatUrl&&m(l.viewFromSeatMeta)&&(w.viewUrl=l.viewFromSeatUrl,w.viewMeta=l.viewFromSeatMeta);let C=M.get(P)?.confidenceEvidence;w.confidenceEvidence=x(C,"exact-seat")??x(p.confidenceEvidence,"row-representative")??x(l.confidenceEvidence,"row-representative")}}}let h=Ht(e,p),b=h?.viewFromSeatUrl,g=(h?.zone?t?.find(l=>l.id===h.zone):void 0)?.focalPoint??n;for(let l of y){if(!l.confidenceEvidence){let M=Number(l.id.slice(l.id.lastIndexOf(":")+1)),w=(p.type==="row"||p.type==="table")&&Number.isInteger(M)?p.overrides?.find(P=>P.index===M)?.confidenceEvidence:void 0;l.confidenceEvidence=x(w,"exact-seat")??(p.type==="row"?x(p.confidenceEvidence,"row-representative"):void 0)}l.confidenceEvidence??=x(h?.confidenceEvidence,"section-representative")??(c?x(c.evidence,c.coverage):void 0),!l.viewUrl&&b&&m(h?.viewFromSeatMeta)&&(l.viewUrl=b,l.viewMeta=h?.viewFromSeatMeta),!l.viewUrl&&i&&m(i.meta)&&(l.viewUrl=i.url,l.viewMeta=i.meta),h&&(l.sectionId=h.logicalSectionId??h.id),h?.zone&&(l.zoneId=h.zone),g&&(l.focalPoint={...g})}f.push(...y)}return f}function Wn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,c=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,u=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,s=Ue(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,c,u,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Be(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,s);for(let f of s)f.floorId=r.id;o.push(...s)}return o}let n=Ue(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&&Be(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),n}function Be(e,t,n,o){let r=e.filter(a=>a.type==="section"),i=n>0||r.some(a=>a.height!==void 0||a.rake!==void 0||(a.elevation??0)>0);if(!r.length||!i||!t){for(let a of o)a.eyeHeightM=n+X;return}let c=new Array(o.length),u=new Map,s=new Map;for(let a=0;a<o.length;a++){let m=o[a],x=(m.sectionId?r.find(y=>y.id===m.sectionId)??r.find(y=>y.logicalSectionId===m.sectionId&&V({x:m.x,y:m.y},y.outline,y.holes)):void 0)??r.find(y=>V({x:m.x,y:m.y},y.outline,y.holes))??null;if(c[a]=x,!x)continue;u.has(x.id)||u.set(x.id,Le(x,{floorBaseHeightM:n}));let p=s.get(x.id);p?p.push(a):s.set(x.id,[a])}let f=new Array(o.length).fill(void 0);for(let[a,m]of s){let d=u.get(a);if(!d)continue;let x=d.rake>0?Math.tan(d.rake*Math.PI/180):0,p=Ne(a,o,m,t);for(let y of p.rows){let h=y.blockDepth*G*x,b=d.height+h;for(let S of y.seatIndices)f[S]=b}}for(let a=0;a<o.length;a++){let m=o[a],d=c[a];if(!d){m.eyeHeightM=n+X;continue}let x=u.get(d.id);m.eyeHeightM=(f[a]??x.height)+X}}var z=40;function ce(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,c=-1/0,u=(s,f)=>{s<o&&(o=s),f<r&&(r=f),s>i&&(i=s),f>c&&(c=f)};for(let s of Bt(e))if(s.type==="row"){let f=new Map((s.overrides??[]).map(a=>[a.index,a]));Xe(s).forEach((a,m)=>{let d=f.get(m);d?.skip||u(a.x+(d?.dx??0),a.y+(d?.dy??0))})}else if(s.type==="gaArea")for(let f of s.points)u(f.x,f.y);else if(s.type==="section")for(let f of s.outline)u(f.x,f.y);else if(s.type==="decorImage")u(s.x,s.y),u(s.x+s.width,s.y+s.height);else if(s.type==="shape")if(s.points&&s.points.length)for(let f of s.points)u(f.x,f.y);else s.x!=null&&s.y!=null&&s.width!=null&&s.height!=null&&(u(s.x,s.y),u(s.x+s.width,s.y+s.height));else if(s.type==="table"){let f=D+At,a=s.shape==="round"?(s.radius??40)+f:Math.max((s.width??80)/2,(s.height??50)/2)+f;u(s.center.x-a,s.center.y-a),u(s.center.x+a,s.center.y+a)}else if(s.type==="booth"){let f=Math.max(s.width,s.height)/2;u(s.center.x-f,s.center.y-f),u(s.center.x+f,s.center.y+f)}else if(s.type==="text"){if(n)continue;let f=fe(s);u(s.position.x,s.position.y),u(s.position.x+f.width,s.position.y+f.height)}for(let s of[e.referenceImage,e.backgroundImage]){if(!s)continue;let{center:f,width:a}=s,m=a*3/4;u(f.x-a/2,f.y-m/2),u(f.x+a/2,f.y+m/2)}if(!isFinite(o)){let s=e.focalPoint??{x:0,y:0};return{x:s.x-200,y:s.y-200,width:400,height:400}}return{x:o-z,y:r-z,width:i-o+z*2,height:c-r+z*2}}export{Xt as a,zt as b,Kt as c,Vt as d,$t as e,Wt as f,Yt as g,qt as h,Jt as i,fe as j,Zt as k,qe as l,en as m,Y as n,on as o,me as p,rn as q,sn as r,Qe as s,be as t,an as u,ge as v,et as w,un as x,mn as y,Pe as z,pn as A,ve as B,rt as C,it as D,ct as E,yn as F,lt as G,dt as H,xn as I,gn as J,wn as K,Sn as L,Ie as M,Ee as N,pt as O,Q as P,Oe as Q,Pn as R,Z as S,bt as T,Te as U,ee as V,G as W,En as X,wt as Y,Re as Z,_e as _,Ae as $,te as aa,St as ba,Mt as ca,Pt as da,X as ea,On as fa,Le as ga,je as ha,Et as ia,Ne as ja,D as ka,Xe as la,Un as ma,Lt as na,ze as oa,kt as pa,Ke as qa,Bn as ra,jt as sa,Dt as ta,Fe as ua,V as va,Gn as wa,$ as xa,Ht as ya,Ut as za,Xn as Aa,Bt as Ba,se as Ca,zn as Da,Kn as Ea,Vn as Fa,$n as Ga,Gt as Ha,Wn as Ia,ce as Ja};