@seatlayer/core 0.101.0 → 0.102.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 (175) hide show
  1. package/dist/ar-TGXEBJUB.js +1 -0
  2. package/dist/be-JIDOHWF6.js +1 -0
  3. package/dist/bg-ODVJNCC2.js +1 -0
  4. package/dist/ca-3I7TMWYU.js +1 -0
  5. package/dist/{categoryInventory-H77A_8pF.d.cts → categoryInventory-7gSFTu0l.d.cts} +1 -1
  6. package/dist/{categoryInventory-DZ5IcDOy.d.ts → categoryInventory-hJxuFF9L.d.ts} +1 -1
  7. package/dist/chunk-254ABRJF.js +1 -0
  8. package/dist/{chunk-5HXTEMRE.js → chunk-4DYJCT62.js} +1 -1
  9. package/dist/chunk-4R6TXHY2.js +1 -0
  10. package/dist/{chunk-D723OZEY.js → chunk-66T4EAUA.js} +1 -1
  11. package/dist/{chunk-GLGXP5I7.js → chunk-AFJWTB7L.js} +1 -1
  12. package/dist/chunk-COECA63Q.js +1 -0
  13. package/dist/chunk-EIV3CAGV.js +1 -0
  14. package/dist/chunk-FOIYJ5NT.js +1 -0
  15. package/dist/chunk-FUFRWRPM.js +1 -0
  16. package/dist/{chunk-2RNZOV5I.js → chunk-GPZFVQXV.js} +1 -1
  17. package/dist/{chunk-L34T3APU.js → chunk-GTRYL7YV.js} +1 -1
  18. package/dist/chunk-JRZHC75P.js +1 -0
  19. package/dist/chunk-KTMZ3QAO.js +1 -0
  20. package/dist/chunk-PHV2U54Y.js +1 -0
  21. package/dist/chunk-TAMY7HTV.js +1 -0
  22. package/dist/chunk-UEDS3HJ3.js +1 -0
  23. package/dist/{chunk-P4J57TK6.js → chunk-YPVYZYMH.js} +1 -1
  24. package/dist/chunk-ZS5YFXSE.js +1 -0
  25. package/dist/core/chart-ops/index.cjs +1 -1
  26. package/dist/core/chart-ops/index.d.cts +30 -9
  27. package/dist/core/chart-ops/index.d.ts +30 -9
  28. package/dist/core/chart-ops/index.js +1 -1
  29. package/dist/core/inventory/index.cjs +1 -1
  30. package/dist/core/inventory/index.d.cts +72 -5
  31. package/dist/core/inventory/index.d.ts +72 -5
  32. package/dist/core/inventory/index.js +1 -1
  33. package/dist/core/layout/index.cjs +1 -1
  34. package/dist/core/layout/index.d.cts +63 -6
  35. package/dist/core/layout/index.d.ts +63 -6
  36. package/dist/core/layout/index.js +1 -1
  37. package/dist/core/quality/index.cjs +1 -1
  38. package/dist/core/quality/index.d.cts +18 -4
  39. package/dist/core/quality/index.d.ts +18 -4
  40. package/dist/core/quality/index.js +1 -1
  41. package/dist/core/render-assets/index.cjs +1 -1
  42. package/dist/core/render-assets/index.d.cts +2 -2
  43. package/dist/core/render-assets/index.d.ts +2 -2
  44. package/dist/core/render-assets/index.js +1 -1
  45. package/dist/core/seatConfidence.d.cts +1 -1
  46. package/dist/core/seatConfidence.d.ts +1 -1
  47. package/dist/core/sections/index.cjs +1 -1
  48. package/dist/core/sections/index.d.cts +5 -5
  49. package/dist/core/sections/index.d.ts +5 -5
  50. package/dist/core/sections/index.js +1 -1
  51. package/dist/cs-XXB624Z3.js +1 -0
  52. package/dist/cy-W2QNU2GO.js +1 -0
  53. package/dist/da-Q47YPK2E.js +1 -0
  54. package/dist/de-TS3DPLM5.js +1 -0
  55. package/dist/{el-ZPFVDCWA.js → el-3JQUH6DB.js} +1 -1
  56. package/dist/es-GP7VOX7S.js +1 -0
  57. package/dist/et-A22OMZ6V.js +1 -0
  58. package/dist/{eventConfigurations-ClFqXQi9.d.cts → eventConfigurations-BHIfPJJJ.d.cts} +1 -1
  59. package/dist/{eventConfigurations-B6aS6c-_.d.ts → eventConfigurations-I5UBS6r9.d.ts} +1 -1
  60. package/dist/fa-5MS3C6YX.js +1 -0
  61. package/dist/fi-OJLAOJO2.js +1 -0
  62. package/dist/fr-7ATOYJCF.js +1 -0
  63. package/dist/he-37LKRY5W.js +1 -0
  64. package/dist/hi-YXZ5EWK7.js +1 -0
  65. package/dist/hr-QFOPGLMR.js +1 -0
  66. package/dist/hu-RHRBK46E.js +1 -0
  67. package/dist/id-A5Q3MLSX.js +1 -0
  68. package/dist/index.cjs +1 -1
  69. package/dist/index.d.cts +57 -16
  70. package/dist/index.d.ts +57 -16
  71. package/dist/index.js +1 -1
  72. package/dist/it-KG53QPQF.js +1 -0
  73. package/dist/ja-CC6EPUSN.js +1 -0
  74. package/dist/ko-7H4RGYFK.js +1 -0
  75. package/dist/ku-HFYWPSS4.js +1 -0
  76. package/dist/{labeling-ByEZkLee.d.cts → labeling-2A31f781.d.cts} +11 -3
  77. package/dist/{labeling-CP3GhUrf.d.ts → labeling-CDKZ9TO1.d.ts} +11 -3
  78. package/dist/localeLoaders-4YMC7FIZ.js +1 -0
  79. package/dist/lt-HQXE7W47.js +1 -0
  80. package/dist/lv-AN25XXPB.js +1 -0
  81. package/dist/ms-CWAYSF6E.js +1 -0
  82. package/dist/nl-63QBRZSZ.js +1 -0
  83. package/dist/no-RAPQMKWU.js +1 -0
  84. package/dist/pl-ILSTD4ZV.js +1 -0
  85. package/dist/pt-WF3US5D7.js +1 -0
  86. package/dist/{renderedQuality--H0toc-2.d.cts → renderedQuality-CwZ8hY-5.d.cts} +1 -1
  87. package/dist/{renderedQuality-Bo4k99GE.d.ts → renderedQuality-wDIiUId3.d.ts} +1 -1
  88. package/dist/{renderer-CWbam_zr.d.ts → renderer-CdJx5l3B.d.ts} +8 -1
  89. package/dist/{renderer-BPhSZUGh.d.cts → renderer-D6ggv3bV.d.cts} +8 -1
  90. package/dist/ro-XR3HT6DE.js +1 -0
  91. package/dist/ru-TLJEWDPA.js +1 -0
  92. package/dist/{seatTypeIcons-CSt1isBY.d.ts → seatTypeIcons-DMJX4rVN.d.cts} +2 -2
  93. package/dist/{seatTypeIcons-B2tvcQ0H.d.cts → seatTypeIcons-UpUTD8Xf.d.ts} +2 -2
  94. package/dist/{sections-JHox6Lsw.d.ts → sections-CempT5a0.d.cts} +5 -2
  95. package/dist/{sections-C_AKwOIh.d.cts → sections-lpdfwSdO.d.ts} +5 -2
  96. package/dist/{segmentedRowModel-CZ0Ciea-.d.cts → segmentedRowModel-Ddx5ol8T.d.cts} +1 -1
  97. package/dist/{segmentedRowModel-DQO0vHR1.d.ts → segmentedRowModel-HwY4XuYa.d.ts} +1 -1
  98. package/dist/sk-OJC2EL3Z.js +1 -0
  99. package/dist/sl-7RGTVXCV.js +1 -0
  100. package/dist/sr-NHDJ54BS.js +1 -0
  101. package/dist/sv-ZODCCBCU.js +1 -0
  102. package/dist/{tableSizing-Cp5T_6Lw.d.cts → tableSizing-BJqAuJDg.d.cts} +3 -3
  103. package/dist/{tableSizing-ClgbhNks.d.ts → tableSizing-C0zx97eg.d.ts} +3 -3
  104. package/dist/th-VCZA4MP5.js +1 -0
  105. package/dist/{ticketRestrictions-BHNbxzFT.d.cts → ticketRestrictions-AU8UUmdL.d.ts} +39 -3
  106. package/dist/{ticketRestrictions-DUdzkp4F.d.ts → ticketRestrictions-DDQHiKF-.d.cts} +39 -3
  107. package/dist/tr-ROKZO3HC.js +1 -0
  108. package/dist/{types-5AlKCD4j.d.cts → types-DL7qIUrD.d.cts} +68 -2
  109. package/dist/{types-5AlKCD4j.d.ts → types-DL7qIUrD.d.ts} +68 -2
  110. package/dist/uk-LP2DPUHC.js +1 -0
  111. package/dist/vi-JDK3JRJR.js +1 -0
  112. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  113. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  114. package/dist/view3d/index.cjs +54 -54
  115. package/dist/view3d/index.d.cts +9 -3
  116. package/dist/view3d/index.d.ts +9 -3
  117. package/dist/view3d/index.js +10 -10
  118. package/dist/view3d/scene/scene.worker.cjs +1 -1
  119. package/dist/view3d/scene/scene.worker.js +1 -1
  120. package/dist/zh-Hans-P3GB3FAZ.js +1 -0
  121. package/dist/zh-Hant-YU4OKSFZ.js +1 -0
  122. package/package.json +1 -1
  123. package/dist/ar-Q44JP5JY.js +0 -1
  124. package/dist/be-CGFFSIQL.js +0 -1
  125. package/dist/bg-WOYK6OLH.js +0 -1
  126. package/dist/ca-77ZVI3X5.js +0 -1
  127. package/dist/chunk-52XO3LA7.js +0 -1
  128. package/dist/chunk-5BMXWOE7.js +0 -1
  129. package/dist/chunk-5ITK5236.js +0 -1
  130. package/dist/chunk-5PFYIYM5.js +0 -1
  131. package/dist/chunk-CTIGUXXK.js +0 -1
  132. package/dist/chunk-FLZKBXHA.js +0 -1
  133. package/dist/chunk-HO4MFTVX.js +0 -1
  134. package/dist/chunk-JK3DUFRX.js +0 -1
  135. package/dist/chunk-N4J4CT6P.js +0 -1
  136. package/dist/chunk-NO6OLVTT.js +0 -1
  137. package/dist/chunk-UISTXRO5.js +0 -1
  138. package/dist/cs-OSBZYCSR.js +0 -1
  139. package/dist/cy-ZCOJW2WH.js +0 -1
  140. package/dist/da-2PDK6JTR.js +0 -1
  141. package/dist/de-R5LLVFUU.js +0 -1
  142. package/dist/es-7YASJP32.js +0 -1
  143. package/dist/et-J4TV6KQL.js +0 -1
  144. package/dist/fa-4TEO7UGM.js +0 -1
  145. package/dist/fi-GIUDDKMH.js +0 -1
  146. package/dist/fr-J5J2XJLA.js +0 -1
  147. package/dist/he-OCEHSVUJ.js +0 -1
  148. package/dist/hi-EK5CTBW5.js +0 -1
  149. package/dist/hr-SLDTQOYC.js +0 -1
  150. package/dist/hu-2QNE77NO.js +0 -1
  151. package/dist/id-LGDAFQJK.js +0 -1
  152. package/dist/it-DT4Y3IYB.js +0 -1
  153. package/dist/ja-D5EY2XCQ.js +0 -1
  154. package/dist/ko-DD2NV45Q.js +0 -1
  155. package/dist/ku-KZCMVLBE.js +0 -1
  156. package/dist/localeLoaders-GGAKX22E.js +0 -1
  157. package/dist/lt-QWGTJ47Y.js +0 -1
  158. package/dist/lv-LYAIG3VK.js +0 -1
  159. package/dist/ms-XTF4KNGD.js +0 -1
  160. package/dist/nl-QEXY6XHS.js +0 -1
  161. package/dist/no-HCOXN2CN.js +0 -1
  162. package/dist/pl-BWY53TSD.js +0 -1
  163. package/dist/pt-2UJUBCPL.js +0 -1
  164. package/dist/ro-GGXOLTED.js +0 -1
  165. package/dist/ru-ZTFK3WCU.js +0 -1
  166. package/dist/sk-KU543Y2U.js +0 -1
  167. package/dist/sl-FT576R7A.js +0 -1
  168. package/dist/sr-WE3J46JE.js +0 -1
  169. package/dist/sv-YEAOPSEB.js +0 -1
  170. package/dist/th-BEBRDHJA.js +0 -1
  171. package/dist/tr-LOAHUPSH.js +0 -1
  172. package/dist/uk-2GMICSHN.js +0 -1
  173. package/dist/vi-TC5B6AUR.js +0 -1
  174. package/dist/zh-Hans-TSZWTZQY.js +0 -1
  175. package/dist/zh-Hant-TLB4FZYM.js +0 -1
@@ -1 +1 @@
1
- "use strict";var He=Object.defineProperty;var ho=Object.getOwnPropertyDescriptor;var xo=Object.getOwnPropertyNames;var vo=Object.prototype.hasOwnProperty;var Io=(e,t)=>{for(var o in t)He(e,o,{get:t[o],enumerable:!0})},So=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xo(t))!vo.call(e,r)&&r!==o&&He(e,r,{get:()=>t[r],enumerable:!(n=ho(t,r))||n.enumerable});return e};var wo=e=>So(He({},"__esModule",{value:!0}),e);var $i={};Io($i,{CATEGORY_INVENTORY_FAMILIES:()=>Be,DEFAULT_EVENT_INVENTORY_LIMIT:()=>Te,GA_UNIT_LABEL_PREFIX:()=>De,GroupedTableProjectionError:()=>pe,LARGE_VENUE_INVENTORY_MODULE:()=>ot,MAX_DIRECT_ROW_SWEEP:()=>Et,MAX_EVENT_INVENTORY:()=>Wt,MAX_GA_CAPACITY:()=>q,MAX_ROW_BLOCK_ROWS:()=>kt,MAX_ROW_SEATS:()=>ee,MIN_ROW_BLOCK_ROWS:()=>Ct,MIN_ROW_SEATS:()=>J,applicableTicketTiers:()=>ji,capacityControl:()=>oo,categoryCapacity:()=>Ci,chartCapacity:()=>wt,companionSelectionIssue:()=>go,describeCategoryInventoryConflict:()=>bt,effectiveSeatOwnerCategoryCounts:()=>Se,eventInventoryLimitFor:()=>Zt,gaAreasOf:()=>Cr,gaInventorySegments:()=>st,gaUnitLabel:()=>dn,gaUnitLabels:()=>ct,groupedTableInventory:()=>_i,growJoinedGAInventory:()=>Mr,inspectCategoryInventoryConflicts:()=>Ie,intactRowBlockMembers:()=>Li,isFullChartDoc:()=>po,isGaUnitLabel:()=>ie,pickBestAvailable:()=>Pt,pickBestAvailableInventory:()=>Mo,remediateCategoryInventoryConflicts:()=>mt,resizeChartCapacity:()=>ki,resolveRowBlockCount:()=>Ri,resolveRowStartCapacity:()=>Ai,resolveRowTerminalCapacity:()=>Oi,resolveTicketTierForSeat:()=>Rt,rowBlockEdgePoint:()=>Mt,rowBlockPreviewRows:()=>ro,rowStartEndpoint:()=>uo,rowTerminalEndpoint:()=>lo,rowWithStartCapacity:()=>co,rowWithTerminalCapacity:()=>so,strandedSingles:()=>Ei,ticketOptionNotApplicableIssue:()=>mo,ticketSelectionIssue:()=>Di,ticketTierAppliesToSeat:()=>Ve,validGAInventorySegments:()=>$e});module.exports=wo($i);function ze(e,t){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let o=e.id.lastIndexOf(":");if(o<0)return t;let n=Number(e.id.slice(o+1));return Number.isFinite(n)?n:t}function be(e,t){let o=e.x-t.x,n=e.y-t.y;return o*o+n*n}function Ye(e){let t=0,o=0;for(let n of e)t+=n.x,o+=n.y;return{x:t/e.length,y:o/e.length}}function Lt(e,t){return e.find(o=>o.focalPoint)?.focalPoint??t}function Xe(e){return e.commercial?.premium===!0}function Pt(e,t,o){let n=Math.floor(o.qty);if(!Number.isFinite(n)||n<=0)return{labels:[],reason:"sold_out"};let{categoryKey:r,zoneId:a,focal:s,preferPremium:l,preferNearest:u,preferredRowIds:c,accessibility:d,requireContiguous:f}=o,m=new Map,b=[];if(e.forEach((M,w)=>{let x=t.has(M.label)&&(!r||M.categoryKey===r)&&(!a||M.zoneId===a)&&(!d||d.some(E=>M.accessibility?.includes(E))),v=M.logicalRowId??M.rowId,k=m.get(v);k||(k=[],m.set(v,k)),k.push({seat:M,index:ze(M,w),elig:x}),x&&b.push(M)}),b.length===0)return{labels:[],reason:"sold_out"};let y=new Map([...m].map(([M,w])=>[M,Ye(w.map(x=>x.seat))])),S=(c??[]).map(M=>y.get(M)).filter(M=>!!M),I=M=>{let w=y.get(M);return!w||!S.length?0:Math.min(...S.map(x=>be(w,x)))},C=null,L=M=>{if(!C)return!0;if(l&&M.nonPremium!==C.nonPremium)return M.nonPremium<C.nonPremium;if(u&&M.rowD2!==C.rowD2)return M.rowD2<C.rowD2;if(u&&M.d2!==C.d2)return M.d2<C.d2;if(M.orphan!==C.orphan)return M.orphan<C.orphan;if(M.d2!==C.d2)return M.d2<C.d2;let w=M.rowId.localeCompare(C.rowId);return w!==0?w<0:M.startIndex<C.startIndex};for(let[M,w]of m){let x=[...w].sort((k,E)=>k.index-E.index),v=0;for(;v<x.length;){if(!x[v].elig){v++;continue}let k=v;for(;k<x.length&&x[k].elig&&(k===v||x[k].index===x[k-1].index+1);)k++;let E=k-v;for(let i=0;i+n<=E;i++){let A=i,p=E-(i+n),g=A===1||p===1?1:0,h=x.slice(v+i,v+i+n).map(R=>R.seat),P={labels:h.map(R=>R.label),seats:h,rowId:M,startIndex:x[v+i].index,orphan:g,nonPremium:l?h.reduce((R,T)=>R+(Xe(T)?0:1),0):0,rowD2:I(M),d2:be(Ye(h),u?s:Lt(h,s))};L(P)&&(C=P)}v=k}}return C?{labels:C.labels}:f?{labels:[],reason:b.length?"not_enough_together":"sold_out"}:b.length<n?{labels:[],reason:"not_enough_together"}:{labels:b.map((M,w)=>({seat:M,i:w,rowD2:I(M.logicalRowId??M.rowId),d2:be(M,u?s:M.focalPoint??s)})).sort((M,w)=>{if(l){let v=Xe(M.seat)?0:1,k=Xe(w.seat)?0:1;if(v!==k)return v-k}if(u&&M.rowD2!==w.rowD2)return M.rowD2-w.rowD2;if(M.d2!==w.d2)return M.d2-w.d2;let x=(M.seat.logicalRowId??M.seat.rowId).localeCompare(w.seat.logicalRowId??w.seat.rowId);return x!==0?x:ze(M.seat,M.i)-ze(w.seat,w.i)}).slice(0,n).map(M=>M.seat.label)}}function Mo(e,t,o,n){let r=Math.floor(n.qty),a=Pt(e,o,n),l=t.filter(f=>f.bookingMode==="whole"&&f.capacity===r&&o.has(f.label)&&(!n.categoryKey||f.categoryKey===n.categoryKey)&&(!n.zoneId||f.zoneId===n.zoneId)&&!n.accessibility).map(f=>({table:f,d2:be(f.center,n.preferNearest?n.focal:f.focalPoint??n.focal)})).sort((f,m)=>f.d2-m.d2||f.table.label.localeCompare(m.table.label))[0];if(!l)return a;if(!a.labels.length)return{labels:[l.table.label]};let u=new Map(e.map(f=>[f.label,f])),c=a.labels.map(f=>u.get(f)).filter(f=>!!f),d=c.length?be(Ye(c),Lt(c,n.focal)):Number.POSITIVE_INFINITY;return l.d2<d?{labels:[l.table.label]}:a}var Ot=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Co(e,t){let o=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,o.length);let n=Math.max(1,Math.floor(t/Ot(e))),r=0;for(let a of o){if(!a.length){r+=1;continue}let s=0;for(let l of a.split(/\s+/)){let u=l.length;s&&s+1+u<=n?s+=1+u:(r+=Math.max(1,Math.ceil(u/n)),s=u%n)}}return Math.max(1,r)}function At(e){let t=e.background?.padding??0,o=e.text.split(/\r?\n/),n=Math.max(1,...o.map(l=>l.length))*Ot(e),r=e.width??n+t*2,a=Math.max(1,r-t*2),s=Co(e,a);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var ko=Math.PI/180;function V(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Eo(e,t,o){let n=Math.cos(o),r=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*n-s*r,y:t.y+a*r+s*n}}function Tt(e,t){return Eo(e,{x:0,y:0},t*ko)}function me(e){let t=0,o=0;for(let r of e)t+=r.x,o+=r.y;let n=e.length||1;return{x:t/n,y:o/n}}function _t(e,t){let o=1-t,n=o*o*o,r=3*o*o*t,a=3*o*t*t,s=t*t*t;return{x:n*e.start.x+r*e.control1.x+a*e.control2.x+s*e.end.x,y:n*e.start.y+r*e.control1.y+a*e.control2.y+s*e.end.y}}function jt(e,t,o=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[_t(e,.5)];let n=Array.from({length:o+1},(u,c)=>_t(e,c/o)),r=new Float64Array(n.length);for(let u=1;u<n.length;u+=1){let c=n[u].x-n[u-1].x,d=n[u].y-n[u-1].y;r[u]=r[u-1]+Math.hypot(c,d)}let a=r[r.length-1];if(a<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let u=0;u<t;u+=1){let c=a*u/(t-1);for(;l<r.length-1&&r[l]<c;)l+=1;let d=r[l-1],f=r[l],m=f===d?0:(c-d)/(f-d);s.push({x:n[l-1].x+(n[l].x-n[l-1].x)*m,y:n[l-1].y+(n[l].y-n[l-1].y)*m})}return s}function K(e,t,o){return Math.max(t,Math.min(o,e))}var te=Math.PI*2;function ge(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Ro(e,t,o){let n=t-e;if(o){for(;n<0;)n+=te;for(;n>=te;)n-=te}else{for(;n>0;)n-=te;for(;n<=-te;)n+=te}return n}function We(e){if(e.version!==1||e.closed!==!0||!ge(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let o of e.segments){if(!o||!ge(o.end))return!1;if(o.kind==="line"){if(V(t,o.end)<=1e-9)return!1}else if(o.kind==="bezier"){if(!ge(o.control1)||!ge(o.control2)||V(t,o.end)<=1e-9)return!1}else if(o.kind==="arc"){if(!ge(o.center)||!Number.isFinite(o.radius)||o.radius<=1e-6||Math.abs(V(t,o.center)-o.radius)>Math.max(1e-4,o.radius*1e-4)||Math.abs(V(o.end,o.center)-o.radius)>Math.max(1e-4,o.radius*1e-4)||V(t,o.end)<=1e-9)return!1}else return!1;t=o.end}return V(t,e.start)<=1e-4}function Lo(e,t,o){let n=1-o;return{x:n**3*e.x+3*n**2*o*t.control1.x+3*n*o**2*t.control2.x+o**3*t.end.x,y:n**3*e.y+3*n**2*o*t.control1.y+3*n*o**2*t.control2.y+o**3*t.end.y}}function Nt(e,t=2){if(!We(e))throw new Error("Section outline path is invalid");let o=Math.max(.25,t),n=[{...e.start}],r=e.start;for(let a of e.segments){if(a.kind==="line")n.push({...a.end});else if(a.kind==="arc"){let s=Math.atan2(r.y-a.center.y,r.x-a.center.x),l=Math.atan2(a.end.y-a.center.y,a.end.x-a.center.x),u=Ro(s,l,a.clockwise),c=Math.max(2,Math.ceil(Math.abs(u)*a.radius/o));for(let d=1;d<=c;d+=1){let f=s+u*d/c;n.push({x:a.center.x+Math.cos(f)*a.radius,y:a.center.y+Math.sin(f)*a.radius})}}else{let s=V(r,a.control1)+V(a.control1,a.control2)+V(a.control2,a.end),l=Math.max(2,Math.ceil(s/o));for(let u=1;u<=l;u+=1)n.push(Lo(r,a,u/l))}r=a.end}return V(n[n.length-1],n[0])<=1e-4&&n.pop(),n}var Yi=4/3;function Ft(e){let t=new Map,o=new Map;for(let n of e){if(n.type!=="row"||!n.segmentedRow)continue;let r=o.get(n.segmentedRow.groupId)??[];r.push(n),o.set(n.segmentedRow.groupId,r)}for(let[n,r]of o){let a=r.slice().sort((m,b)=>m.segmentedRow.componentIndex-b.segmentedRow.componentIndex),s=a[0]?.segmentedRow?.componentCount??0,l=a[0]?.segmentedRow;if(!l||!(s>=2&&a.length===s&&l?.boundaryBefore==="start"&&a.every((m,b)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===n&&m.segmentedRow.componentCount===s&&m.segmentedRow.componentIndex===b&&m.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(b===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===l.displayLabel)))continue;let c=a.reduce((m,b)=>m+b.seatCount,0),d=0,f=0;for(let m of a)m.segmentedRow.boundaryBefore==="break"&&(d+=1),t.set(m.id,{groupId:n,adjacencyOffset:d,displayOffset:f,displayLabel:l.displayLabel,totalSeats:c,canonical:a[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),d+=m.seatCount,f+=m.seatCount}return t}var Po="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Oo="abcdefghijklmnopqrstuvwxyz";function Ao(e,t){let o=t.length,n=e+1,r="";for(;n>0;){n-=1;let a=n%o;r=t[a]+r,n=Math.floor(n/o)}return r}function Ze(e,t=!1){let o=t?Oo:Po;return Ao(Math.max(0,Math.floor(e)-1),o)}var To=[[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 Dt(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),o="";for(let[n,r]of To)for(;t>=n;)o+=r,t-=n;return o}function _o(e){let t=new Array(e);return Array.from({length:e},(o,n)=>n).sort((o,n)=>Math.abs(2*o-(e-1))-Math.abs(2*n-(e-1))||o-n).forEach((o,n)=>t[o]=n),t}function Le(e,t){let o=e.seatLabelStart??1,n=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,a=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",l=e.seatNumbering?.endAt,u=e.seatCount;if(a==="updown"||a==="updown-descending"){let b=Math.ceil(u/2),y=a==="updown"?t<b?o+2*t:o-1+2*(u-t):t<b?o+2*(b-1-t):o+1+2*(t-b);return`${s}${y}`}let c=a==="odd"||a==="even"?2:r,d=l!=null&&Number.isFinite(l)?l-(u-1)*c:o,f=n==="center"?_o(u)[t]:n==="rtl"?u-1-t:t,m;switch(a){case"odd":{let b=d%2===1?d:d+1;m=String(b+f*2);break}case"even":{let b=d%2===0?d:d+1;m=String(b+f*2);break}case"roman":m=Dt(d+f*r);break;case"letters-upper":m=Ze(d+f*r,!1);break;case"letters-lower":m=Ze(d+f*r,!0);break;default:m=String(d+f*r);break}return`${s}${m}`}function jo(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Pe(e,t,o){return o?.label??`${e.seatLabelBase??e.label}-${Le(e,t)}`}function qe(e,t,o,n){if(n?.displayLabel)return n.displayLabel;if(e.seatDisplayLabelMode==="number")return Le(e,t);if(!o)return`${e.displayLabel||e.label}-${Le(e,t)}`;let r=jo(o),a=o.displayOffset+t;return`${o.displayLabel}-${Le(r,a)}`}var ne=.02291666666666667,ea=1/ne,No=58,$t=No*ne,Je=0,oe=3,Z=0,X=120,Oe=0,Ae=45,et=7,re=1.2;function Qe(e,t,o,n){return Number.isFinite(e)?Math.max(t,Math.min(o,e)):n}function Fo(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=et?e:oe}function ye(e,t={}){let o=Qe(t.floorBaseHeightM,Z,X,0),n=Math.min(X,o+Fo(e.elevation)*$t),r=e.height===void 0?n:Qe(e.height,Z,X,n),a=Qe(e.rake,Oe,Ae,0);return{height:r,rake:a}}function Bt(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 Kt(e,t,o){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,o-e[0].y);let n=1/0;for(let r=0;r+1<e.length;r++){let a=e[r],s=e[r+1],l=s.x-a.x,u=s.y-a.y,c=l*l+u*u,d=c>1e-12?((t-a.x)*l+(o-a.y)*u)/c:0;d<0?d=0:d>1&&(d=1);let f=t-(a.x+d*l),m=o-(a.y+d*u);if(Math.abs(f)>=n||Math.abs(m)>=n)continue;let b=Math.hypot(f,m);b<n&&(n=b)}return n}function Do(e){let t=0,o=0;for(let a of e)t+=a.x,o+=a.y;let n=e.length||1;t/=n,o/=n;let r=0;for(let a of e){let s=Math.hypot(a.x-t,a.y-o);s>r&&(r=s)}return{cx:t,cy:o,r}}function Gt(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function tt(e,t){let o=1/0;for(let n of Bt(e)){let r=Kt(t,n.x,n.y);r<o&&(o=r)}for(let n of Bt(t)){let r=Kt(e,n.x,n.y);r<o&&(o=r)}return o}function $o(e,t){if(e.length<3)return{pts:e,seatIndices:t};let o=0,n=0;for(let d of e)o+=d.x,n+=d.y;o/=e.length,n/=e.length;let r=-1,a=e[0];for(let d of e){let f=Math.hypot(d.x-o,d.y-n);f>r&&(r=f,a=d)}let s=a.x-o,l=a.y-n,u=Math.hypot(s,l);u>1e-9?(s/=u,l/=u):(s=1,l=0);let c=e.map((d,f)=>({p:d,i:f,t:(d.x-o)*s+(d.y-n)*l})).sort((d,f)=>d.t-f.t);return{pts:c.map(d=>d.p),seatIndices:c.map(d=>t[d.i])}}function Bo(e){let t=e.length;if(t<3)return null;let o=0,n=0;for(let L of e)o+=L.x,n+=L.y;o/=t,n/=t;let r=0,a=0,s=0,l=0,u=0,c=0,d=0;for(let L of e){let O=L.x-o,M=L.y-n;r+=O*O,s+=M*M,a+=O*M,l+=O*O*O,u+=M*M*M,c+=O*M*M,d+=M*O*O}let f=r*s-a*a;if(Math.abs(f)<1e-9)return null;let m=(l+c)/2,b=(u+d)/2,y=(m*s-b*a)/f,S=(b*r-m*a)/f,I=y+o,C=S+n;return!Number.isFinite(I)||!Number.isFinite(C)?null:{cx:I,cy:C}}var Ko=.15;function Go(e){if(e.length<2)return null;let t=e.map(w=>{let x=0,v=0;for(let k of w.pts)x+=k.x,v+=k.y;return{x:x/w.pts.length,y:v/w.pts.length}}),o=0,n=0;for(let w of t)o+=w.x,n+=w.y;o/=t.length,n/=t.length;let r=0,a=0,s=0;for(let w of t){let x=w.x-o,v=w.y-n;r+=x*x,a+=x*v,s+=v*v}let l=r+s,u=r*s-a*a,c=l/2+Math.sqrt(Math.max(0,l*l/4-u)),d,f;Math.abs(a)>1e-12?(d=c-s,f=a):r>=s?(d=1,f=0):(d=0,f=1);let m=Math.hypot(d,f);if(!(m>1e-12))return null;d/=m,f/=m;let b=0,y=0,S=0;for(let w of e){if(w.pts.length<2)continue;let x=w.pts[0],v=w.pts[w.pts.length-1],k=v.x-x.x,E=v.y-x.y,i=Math.hypot(k,E);if(!(i>1e-9))continue;let A=k/i,p=E/i;b+=(A*A-p*p)*i,y+=2*A*p*i,S+=i}if(S>0&&Math.hypot(b,y)>=Vo*S){let w=Math.atan2(y,b)/2,x=Math.cos(w),v=Math.sin(w);Math.abs(d*x+f*v)>Ho&&(d=-v,f=x)}let I=1/0,C=-1/0,L=[];for(let w of e){let x=1/0,v=-1/0;for(let k of w.pts){let E=k.x*d+k.y*f;E<x&&(x=E),E>v&&(v=E),E<I&&(I=E),E>C&&(C=E)}L.push(v-x)}let O=C-I;return O>1e-9?(L.sort((w,x)=>w-x),L[Math.min(L.length-1,Math.floor(L.length*.9))]/O<=Uo?{x:d,y:f}:null):null}var Uo=.35,Vo=.8,Ho=.7;function Ut(e,t,o,n){let r=new Map;for(let x of o){let v=t[x],k=v.rowId||`__seat-${x}`,E=r.get(k);E||(E={pts:[],idx:[]},r.set(k,E)),E.pts.push({x:v.x,y:v.y}),E.idx.push(x)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let a=[];for(let[x,v]of r){let k=$o(v.pts,v.idx),E=0;for(let i of k.pts)E+=Math.hypot(i.x-n.x,i.y-n.y);a.push({id:x,pts:k.pts,seatIndices:k.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:E/k.pts.length})}let s=a.map(x=>Do(x.pts)),l=a.length<=256?a.length*(a.length-1)/2:0,u=l?new Float64Array(l):null;u?.fill(Number.NaN);let c=u?new Map(a.map((x,v)=>[x,v])):null,d=(x,v)=>(x>v&&([x,v]=[v,x]),x*(2*a.length-x-1)/2+(v-x-1)),f=(x,v)=>{if(!u)return tt(a[x].pts,a[v].pts);let k=d(x,v),E=u[k];if(!Number.isNaN(E))return E;let i=tt(a[x].pts,a[v].pts);return u[k]=i,i},m=(x,v)=>c?f(c.get(x),c.get(v)):tt(x.pts,v.pts),b=[];for(let x=0;x<a.length;x++){let v=1/0;for(let k=0;k<a.length;k++){if(x===k||Gt(s[x],s[k])>=v)continue;let E=f(x,k);E<v&&(v=E)}Number.isFinite(v)&&b.push(v)}b.sort((x,v)=>x-v);let y=b.length?b[Math.floor(b.length/2)]:1,S=Math.max(y*1.8,1e-6),I=a.map(()=>[]);for(let x=0;x<a.length;x++)for(let v=x+1;v<a.length;v++)Gt(s[x],s[v])>S||f(x,v)<=S&&(I[x].push(v),I[v].push(x));let C=0;for(let x=0;x<a.length;x++){if(a[x].blockId!==-1)continue;let v=C++,k=[x];for(a[x].blockId=v;k.length;){let E=k.pop();for(let i of I[E])a[i].blockId===-1&&(a[i].blockId=v,k.push(i))}}let L=new Map;for(let x of a){let v=L.get(x.blockId)??[];v.push(x),L.set(x.blockId,v)}let O=[];for(let x of a){if(x.pts.length<4)continue;let v=Bo(x.pts);v&&(!Number.isFinite(v.cx)||!Number.isFinite(v.cy)||O.push({x:v.cx,y:v.cy}))}let M=O.length>=2?(()=>{let x=O.map(E=>E.x).sort((E,i)=>E-i),v=O.map(E=>E.y).sort((E,i)=>E-i),k=Math.floor(O.length/2);return{cx:x[k],cy:v[k]}})():null;if(M){let x=p=>Math.hypot(p.x-M.cx,p.y-M.cy),v=1/0,k=-1/0,E=[];for(let p of a){let g=1/0,h=-1/0;for(let P of p.pts){let R=x(P);R<g&&(g=R),R>h&&(h=R)}E.push(h-g),g<v&&(v=g),h>k&&(k=h)}let i=k-v;E.sort((p,g)=>p-g);let A=E[Math.min(E.length-1,Math.floor(E.length*.9))];if(i>1e-9&&A/i<=Ko){let p=a.map(F=>{let Re=0;for(let yo of F.pts)Re+=x(yo);return{row:F,radius:Re/F.pts.length}}),g=0,h=0;for(let F of p)g+=F.radius,h+=F.row.focalDistance;g/=p.length,h/=p.length;let P=0;for(let F of p)P+=(F.radius-g)*(F.row.focalDistance-h);if(P<0)for(let F of p)F.radius=-F.radius;let T=1/0;for(let F of p)F.radius<T&&(T=F.radius);p.sort((F,Re)=>F.radius-Re.radius);let _=-1,j=-1/0,U=i/Math.max(1,p.length)*.5,Ee=[];for(let F of p)F.radius-j>U&&(_++,j=F.radius),F.row.ordinal=_,F.row.blockDepth=F.radius-T,Ee.push(F.row);return{sectionId:e,rows:Ee,blockCount:C}}}let w=[];for(let[,x]of L){let v=Go(x);if(v){let k=p=>{let g=0;for(let h of p.pts)g+=h.x*v.x+h.y*v.y;return g/p.pts.length};x.sort((p,g)=>k(p)-k(g)),x.length>=2&&x[0].focalDistance>x[x.length-1].focalDistance&&x.reverse();let E=[],i=y*.5;for(let p of x){let g=E[E.length-1];g&&Math.abs(k(p)-k(g[0]))<i?g.push(p):E.push([p])}let A=0;for(let p=0;p<E.length;p++){if(p>0){let g=1/0;for(let h of E[p-1])for(let P of E[p])g=Math.min(g,m(h,P));A+=g}for(let g of E[p])g.ordinal=p,g.blockDepth=A,w.push(g)}}else{let k=1/0;for(let E of x)E.focalDistance<k&&(k=E.focalDistance);x.sort((E,i)=>E.focalDistance-i.focalDistance);for(let E=0;E<x.length;E++)x[E].ordinal=E,x[E].blockDepth=Math.max(0,x[E].focalDistance-k),w.push(x[E])}}return{sectionId:e,rows:w,blockCount:C}}var zo=/^\d{4}-\d{2}-\d{2}$/;function Xo(e){let t=Date.parse(e);return Number.isFinite(t)?zo.test(e)?t+864e5:t:null}function Yo(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let n=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(n)&&(t instanceof Date?t.getTime():t)<=n+366*864e5}let o=Xo(e.validUntil);return o===null?!1:(t instanceof Date?t.getTime():t)<o}function Wo(e,t,o){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==o)}function Zo(e){return e.status!=="draft"&&e.status!=="retracted"}function qo(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 Vt(e,t={}){return!!e&&Zo(e)&&Wo(e,t.activeConfigurationId,t.activeConfigurationVersion)&&qo(e,t.activeBasisSha256)&&Yo(e,t.now)}function Ht(e){return!!e.referenceImage?.assetId&&!!e.backgroundImage?.assetId&&e.referenceImage.assetId!==e.backgroundImage.assetId}var Qo=36,Jo=160;function zt(e,t=360){let o=K(Math.round(Number.isFinite(e)?e:1),1,40),n=K(Number.isFinite(t)?t:360,120,360);return Math.round(K(o*4*(360/n),Qo,Jo))}var er=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function tr(e){return!!e&&er.has(e)}var Xt=1.1;var sa=Math.PI*2;var ca=(()=>{let t={x:0,y:52},o=25,n={x:70,y:t.y-70},r=(n.x*n.x+n.y*n.y-4900)/(2*(n.y+70)),a=r+70,s=[],l=Math.atan2(n.y-r,n.x),u=Math.atan2(n.y-r,-n.x);for(let c=0;c<=24;c++){let d=l+(u-l)*c/24;s.push({x:a*Math.cos(d),y:r+a*Math.sin(d)})}return{half:70,home:t,backstop:o,fence:s}})();function Yt(e){return tr(e)}var nr=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,or=/[\s"'<>`\\]/;function nt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return nr.test(e);if(or.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}var Wt=2e5,Te=1e5,ot="large_venue_inventory";function Zt(e){return e?.includes(ot)?2e5:1e5}function rr(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,o=e.y,n=e.width,r=e.height;return[{x:t,y:o},{x:t+n,y:o},{x:t+n,y:o+r},{x:t,y:o+r}]}function ir(e,t,o){let n=o*Math.PI/180,r=Math.cos(n),a=Math.sin(n),s=e.x-t.x,l=e.y-t.y;return{x:t.x+s*r-l*a,y:t.y+s*a+l*r}}function qt(e){let t=rr(e);if(!t||t.length<2)return null;let o=e.rotation??0,n=Math.abs(o)<1e-6?t:t.map(u=>ir(u,{x:t.reduce((c,d)=>c+d.x,0)/t.length,y:t.reduce((c,d)=>c+d.y,0)/t.length},o)),r=1/0,a=1/0,s=-1/0,l=-1/0;for(let u of n)r=Math.min(r,u.x),a=Math.min(a,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return!Number.isFinite(r)||s-r<1e-6||l-a<1e-6?null:{minX:r,minY:a,maxX:s,maxY:l}}var ar=5,sr=3,cr=.92,lr=1.9,ur=2,dr=.6,fr=1,pr=.06;function br(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?Xt:Yt(e.stageKind)?pr:fr}function Qt(e){let t=1/0,o=1/0,n=-1/0,r=-1/0,a=-1/0;for(let s of he(e)){let l=s.baseHeightM??0;for(let u of s.objects){if(u.type!=="shape"||u.role!=="stage")continue;let c=qt(u);c&&(t=Math.min(t,c.minX),o=Math.min(o,c.minY),n=Math.max(n,c.maxX),r=Math.max(r,c.maxY),a=Math.max(a,l+br(u)))}}return!Number.isFinite(t)||!Number.isFinite(a)?null:{minX:t,minY:o,maxX:n,maxY:r,deckTopM:a}}function mr(e,t,o,n){let r=1/0,a=1/0,s=-1/0,l=-1/0;for(let b of e)Number.isFinite(b.eyeHeightM)&&(r=Math.min(r,b.x),s=Math.max(s,b.x),a=Math.min(a,b.y),l=Math.max(l,b.y));if(!Number.isFinite(r))return null;let u=r*t,c=a*t,d=Math.max(1,Math.ceil((s-r)*t/o)+1),f=Math.max(1,Math.ceil((l-a)*t/o)+1),m=new Float64Array(d*f).fill(-1/0);for(let b of e){if(!Number.isFinite(b.eyeHeightM))continue;let y=b.eyeHeightM-re,S=Math.min(d-1,Math.max(0,Math.floor((b.x*t-u)/o))),C=Math.min(f-1,Math.max(0,Math.floor((b.y*t-c)/o)))*d+S,L=y+n;L>m[C]&&(m[C]=L)}return{cellM:o,minX:u,minY:c,cols:d,rows:f,top:m}}function gr(e,t,o){let n=Math.floor((t-e.minX)/e.cellM),r=Math.floor((o-e.minY)/e.cellM);return n<0||r<0||n>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+n]}function Jt(e,t,o={}){let n=new Map;if(!t||!e.length)return n;let r=o.metresPerChartUnit??ne,a=o.cellM??dr,s=o.chairBackM??cr,l=o.selfRowSkipM??ur,u=o.clearThreshold??.9,c=o.partialThreshold??.25,d=Math.max(1,o.columns??ar),f=Math.max(1,o.rows??sr),m=mr(e,r,a,s);if(!m)return n;let b=(t.maxX-t.minX)*r,y=(t.maxY-t.minY)*r,S=b>=y,I=(t.minX+t.maxX)/2*r,C=(t.minY+t.maxY)/2*r,L=[];for(let M=0;M<d;M++){let w=(M+.5)/d-.5,x=S?I+w*b:I,v=S?C:C+w*y;for(let k=0;k<f;k++){let E=t.deckTopM+(f===1?0:k/(f-1)*lr);L.push({x,y:v,z:E})}}let O=a/2;for(let M of e){if(!Number.isFinite(M.eyeHeightM))continue;let w=M.x*r,x=M.y*r,v=M.eyeHeightM,k=0,E=1/0;for(let A of L){let p=A.x-w,g=A.y-x,h=Math.hypot(p,g);if(!(h>l)){k++;continue}let P=p/h,R=g/h,T=0;for(let _=l;_<h;_+=O){let j=gr(m,w+P*_,x+R*_);if(!(!Number.isFinite(j)||j>=v)&&j>v+(A.z-v)*_/h){T=_;break}}T?E=Math.min(E,T):k++}let i=k/L.length;i>=u||n.set(M.id,{seatId:M.id,mark:i<c?"obstructedView":"restrictedView",visibleFraction:i,totalRays:L.length,atDistanceM:Number.isFinite(E)?E:0})}return n}function en(e,t){if(!t.size)return 0;let o=0;for(let n of e){let r=t.get(n.id);if(!r)continue;let a=n.commercial;a?.restrictedView!==void 0||a?.obstructedView!==void 0||(n.commercial={...a,[r.mark]:!0},o++)}return o}function rt(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var je=Math.PI/180;var xe=16;function it(e,t,o,n){let r=o*je,a=Math.cos(r),s=Math.sin(r);return{x:n.x+e*a-t*s,y:n.y+e*s+t*a}}function an(e){let{seatCount:t,seatSpacing:o,curve:n,rotation:r,origin:a}=e,s=[];if(e.path)return jt(e.path,t);if(t<=1)return t===1&&s.push({x:a.x,y:a.y}),s;if(n===0){for(let c=0;c<t;c++)s.push(it(c*o,0,r,a));return s}let l=n/(t-1)*je,u=o/(2*Math.sin(Math.abs(l)/2));for(let c=0;c<t;c++){let d=c*l,f=u*Math.sin(d),m=-u+u*Math.cos(d);s.push(it(f,m,r,a))}return s}function sn(e){let t=new Map;if(e.overrides)for(let o of e.overrides)t.set(o.index,o);return t}function Ne(e){let t=new Set((e.overrides??[]).filter(o=>o.skip&&Number.isInteger(o.index)&&o.index>=0&&o.index<e.seatCount).map(o=>o.index));return Math.max(0,e.seatCount-t.size)}function yr(e,t){let o=sn(e);return an(e).map((n,r)=>{let a=o.get(r),s=rt(a),l=Pe(e,r,a),u={...e.commercial,...a?.commercial};return{index:r,x:n.x+(a?.dx??0),y:n.y+(a?.dy??0),label:l,displayLabel:qe(e,r,t,a),categoryKey:a?.categoryKey??e.categoryKey,skipped:!!a?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:a?.wheelchairSpaceType,commercial:Object.values(u).some(c=>c!==void 0&&c!==!1&&c!=="")?u:void 0,glyph:a?.glyph,viewUrl:a?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:a?.viewFromSeatUrl?a.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:a?.labelStyle??e.seatLabelStyle}})}function G(e){let t=[];for(let o of yr(e))o.skipped||t.push({id:`${e.id}:${o.index}`,label:o.label,displayLabel:o.displayLabel===o.label?void 0:o.displayLabel,x:o.x,y:o.y,rowId:e.id,categoryKey:o.categoryKey,accessible:o.accessible||void 0,accessibility:o.accessibility.length?o.accessibility:void 0,wheelchairSpaceType:o.wheelchairSpaceType,commercial:o.commercial,glyph:o.glyph,viewUrl:o.viewUrl,viewMeta:o.viewMeta,labelStyle:o.labelStyle});return t}function ve(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],o=["top","bottom","left","right"].filter(a=>t.includes(a)),n={top:0,bottom:0,left:0,right:0};if(!o.length)return n;let r=Math.max(0,Math.round(e.seatCount));for(let a=0;a<r;a++)n[o[a%o.length]]+=1;return n}function cn(e){let t=[],o=Math.max(0,Math.round(e.seatCount));if(o===0)return t;let n=new Map((e.overrides??[]).map(d=>[d.index,d])),r=(d,f,m,b)=>{let y=n.get(d),S=rt(y),I=y?.label??`${e.label}-${d+1}`,C=e.displayLabel??e.label;return{index:d,label:I,displayLabel:y?.displayLabel??`${C}-${d+1}`,x:f+(y?.dx??0),y:m+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:S.length>0,accessibility:S,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...b?{side:b}:{}}};if(e.shape==="round"){let d=(e.radius??40)+xe,f=e.rotation*je,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||o===1){for(let I=0;I<o;I++){let C=f+I/o*2*Math.PI;t.push(r(I,e.center.x+d*Math.cos(C),e.center.y+d*Math.sin(C)))}return t}let b=m*je,y=(2*Math.PI-b)/2,S=f+y;for(let I=0;I<o;I++){let C=S+I/(o-1)*b;t.push(r(I,e.center.x+d*Math.cos(C),e.center.y+d*Math.sin(C)))}return t}let a=e.width??80,s=e.height??50,l=ve(e),u=["top","bottom","left","right"],c=0;for(let d of u){let f=l[d];for(let m=0;m<f;m++){let b,y;d==="top"?(b=-a/2+(m+.5)*a/f,y=-s/2-xe):d==="bottom"?(b=-a/2+(m+.5)*a/f,y=s/2+xe):d==="left"?(b=-a/2-xe,y=-s/2+(m+.5)*s/f):(b=a/2+xe,y=-s/2+(m+.5)*s/f);let S=it(b,y,e.rotation,e.center);t.push(r(c++,S.x,S.y,d))}}return t}function ln(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):cn(e).filter(t=>!t.skipped).length}function H(e){return cn(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 hr(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 tn(e,t){let o=!1;for(let n=0,r=t.length-1;n<t.length;r=n++){let a=t[n].x,s=t[n].y,l=t[r].x,u=t[r].y;s>e.y!=u>e.y&&e.x<(l-a)*(e.y-s)/(u-s)+a&&(o=!o)}return o}function xr(e,t){return t.some((o,n)=>{let r=t[(n+1)%t.length],a=(e.y-o.y)*(r.x-o.x)-(e.x-o.x)*(r.y-o.y);if(Math.abs(a)>1e-7)return!1;let s=(e.x-o.x)*(r.x-o.x)+(e.y-o.y)*(r.y-o.y),l=(r.x-o.x)**2+(r.y-o.y)**2;return s>=-1e-7&&s<=l+1e-7})}function at(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function z(e,t,o){return tn(e,t)&&!at(o).some(n=>tn(e,n)||xr(e,n))}function _e(e){if(!e.length)return{x:0,y:0};let t=0,o=0;for(let n of e)t+=n.x,o+=n.y;return{x:t/e.length,y:o/e.length}}function Y(e){switch(e.type){case"row":{let t=an(e),o=sn(e),n=0,r=0,a=0;for(let s=0;s<t.length;s++){let l=o.get(s);l?.skip||(n+=t[s].x+(l?.dx??0),r+=t[s].y+(l?.dy??0),a++)}return a?{x:n/a,y:r/a}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return _e(e.points);case"section":return _e(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?_e(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 nn(e,t){return e.length===t.length&&e.every((o,n)=>o.x===t[n].x&&o.y===t[n].y)}function vr(e,t){if(e.type!=="gaArea"||!nn(e.points,t.outline))return!1;let o=at(e.holes),n=at(t.holes);return o.length===n.length&&o.every((r,a)=>nn(r,n[a]))}function Ir(e,t,o=e.filter(r=>r.type==="section"),n=Y(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?o.find(s=>(s.logicalSectionId??s.id)===r&&(vr(t,s)||z(n,s.outline,s.holes))):void 0)??o.find(s=>z(n,s.outline,s.holes))}function he(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 Fe(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function on(e,t,o,n,r,a,s,l,u){let c=[],d=e.filter(S=>S.type==="section"),f=Ft(e),m=S=>!S?.eventConfigurationId||S.eventConfigurationId===n&&(S.eventConfigurationVersion===void 0||S.eventConfigurationVersion===u),b=S=>Vt(S,{activeConfigurationId:n,activeConfigurationVersion:u,activeBasisSha256:r,now:l}),y=(S,I)=>b(S)?{...S,coverage:I}:void 0;for(let S of e){let I=[];if(S.type==="row"?I=G(S):S.type==="table"?I=H(S):S.type==="booth"&&(I=hr(S)),!I.length)continue;for(let w of I)w.viewUrl&&!m(w.viewMeta)&&(w.viewUrl=void 0,w.viewMeta=void 0);if(S.type==="row"){let w=f.get(S.id);if(w){let x=new Map((S.overrides??[]).map(v=>[v.index,v]));for(let v of I){let k=Number(v.id.slice(v.id.lastIndexOf(":")+1));if(!Number.isInteger(k))continue;v.logicalRowId=w.groupId,v.logicalSeatIndex=w.adjacencyOffset+k,x.get(k)?.displayLabel||(v.displayLabel=qe(S,k,w)),!v.viewUrl&&w.viewFromSeatUrl&&m(w.viewFromSeatMeta)&&(v.viewUrl=w.viewFromSeatUrl,v.viewMeta=w.viewFromSeatMeta);let E=x.get(k)?.confidenceEvidence;v.confidenceEvidence=y(E,"exact-seat")??y(S.confidenceEvidence,"row-representative")??y(w.confidenceEvidence,"row-representative")}}}let C=Ir(e,S,d,S.type==="row"?_e(I):Y(S)),L=C?.viewFromSeatUrl,M=(C?.zone?t?.find(w=>w.id===C.zone):void 0)?.focalPoint??o;for(let w of I){if(!w.confidenceEvidence){let x=Number(w.id.slice(w.id.lastIndexOf(":")+1)),v=(S.type==="row"||S.type==="table")&&Number.isInteger(x)?S.overrides?.find(k=>k.index===x)?.confidenceEvidence:void 0;w.confidenceEvidence=y(v,"exact-seat")??(S.type==="row"?y(S.confidenceEvidence,"row-representative"):void 0)}w.confidenceEvidence??=y(C?.confidenceEvidence,"section-representative")??(s?y(s.evidence,s.coverage):void 0),!w.viewUrl&&L&&m(C?.viewFromSeatMeta)&&(w.viewUrl=L,w.viewMeta=C?.viewFromSeatMeta),!w.viewUrl&&a&&m(a.meta)&&(w.viewUrl=a.url,w.viewMeta=a.meta),C&&(w.sectionId=C.logicalSectionId??C.id),C?.zone&&(w.zoneId=C.zone),M&&(w.focalPoint={...M})}c.push(...I)}return c}function un(e,t={}){if(e.floors?.length){let n=[];for(let r of e.floors){let a=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,l=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,u=on(r.objects,e.zones,a,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&rn(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,u);for(let c of u)c.floorId=r.id;for(let c of u)n.push(c)}return n}let o=on(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&&rn(e.objects,e.focalPoint,t.floorBaseHeightM??0,o),Sr(e,o,t)}function Sr(e,t,o){return!o.deriveRestrictedView||e.derivedRestrictedView===!1||o.resolveEyeHeights===!1||en(t,Jt(t,Qt(e))),t}function rn(e,t,o,n){let r=e.filter(f=>f.type==="section"),a=o>0||r.some(f=>f.height!==void 0||f.rake!==void 0||(f.elevation??0)>0);if(!r.length||!a||!t){for(let f of n)f.eyeHeightM=o+re;return}let s=new Array(n.length),l=new Map;for(let f of r)l.has(f.id)||l.set(f.id,f);let u=new Map,c=new Map;for(let f=0;f<n.length;f++){let m=n[f],y=(m.sectionId?l.get(m.sectionId)??r.find(I=>I.logicalSectionId===m.sectionId&&z({x:m.x,y:m.y},I.outline,I.holes)):void 0)??r.find(I=>z({x:m.x,y:m.y},I.outline,I.holes))??null;if(s[f]=y,!y)continue;u.has(y.id)||u.set(y.id,ye(y,{floorBaseHeightM:o}));let S=c.get(y.id);S?S.push(f):c.set(y.id,[f])}let d=new Array(n.length).fill(void 0);for(let[f,m]of c){let b=u.get(f);if(!b)continue;let y=b.rake>0?Math.tan(b.rake*Math.PI/180):0,S=Ut(f,n,m,t);for(let I of S.rows){let C=I.blockDepth*ne*y,L=b.height+C;for(let O of I.seatIndices)d[O]=L}}for(let f=0;f<n.length;f++){let m=n[f],b=s[f];if(!b){m.eyeHeightM=o+re;continue}let y=u.get(b.id);m.eyeHeightM=(d[f]??y.height)+re}}var De="__sl_ga__";function ie(e){return e.startsWith(De)}var wr=De,q=1e5;function dn(e,t){return`${wr}${encodeURIComponent(e)}__${t+1}`}function $e(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let o=0,n=new Map;for(let r of t){if(!r||typeof r.sourceAreaId!="string"||!r.sourceAreaId.trim()||r.sourceAreaId.length>160||!Number.isInteger(r.startIndex)||r.startIndex<0||!Number.isInteger(r.count)||r.count<1||r.startIndex+r.count>q||(o+=r.count,o>q))return!1;let a=n.get(r.sourceAreaId)??[],s=r.startIndex+r.count;if(a.some(l=>r.startIndex<l.end&&s>l.start))return!1;a.push({start:r.startIndex,end:s}),n.set(r.sourceAreaId,a)}return o===e.capacity}function st(e){let t=Math.min(q,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:$e(e)?e.inventorySegments.map(o=>({...o})):[]}function ct(e){return st(e).flatMap(t=>Array.from({length:t.count},(o,n)=>dn(t.sourceAreaId,t.startIndex+n)))}function Mr(e,t){if(e.inventorySegments===void 0||t===e.capacity)return e.inventorySegments;if(t<e.capacity)return;let o=st(e);if(!o.length)return;let n=t-e.capacity;if(!n)return o;let a=o.filter(l=>l.sourceAreaId===e.id).reduce((l,u)=>Math.max(l,u.startIndex+u.count),0),s=o[o.length-1];if(s?.sourceAreaId===e.id&&s.startIndex+s.count===a)s.count+=n;else{if(o.length>=256)return;o.push({sourceAreaId:e.id,startIndex:a,count:n})}return o}function Cr(e){return Fe(e).filter(t=>t.type==="gaArea")}var kr=.15,Er=1.6;function fn(e){return K(e??1,kr,Er)}var Rr=/^#[0-9a-fA-F]{6}$/,Lr=/^#?([\da-f]{3}|[\da-f]{6})$/i;function pn(e){return typeof e=="string"&&Rr.test(e)}function ae(e){let t=Lr.exec((e??"").trim());if(!t)return null;let o=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],n=parseInt(o,16);return[n>>16&255,n>>8&255,n&255]}function bn(e,t){let o=a=>{let s=ae(a);if(!s)return null;let l=L=>{let O=L/255;return O<=.04045?O/12.92:((O+.055)/1.055)**2.4},u=l(s[0]),c=l(s[1]),d=l(s[2]),f=(.4124*u+.3576*c+.1805*d)/.95047,m=.2126*u+.7152*c+.0722*d,b=(.0193*u+.1192*c+.9505*d)/1.08883,y=L=>L>.008856?Math.cbrt(L):7.787*L+16/116,S=y(f),I=y(m),C=y(b);return[116*I-16,500*(S-I),200*(I-C)]},n=o(e),r=o(t);return n&&r?Math.hypot(n[0]-r[0],n[1]-r[1],n[2]-r[2]):null}function lt(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function ut(e){return .2126*lt(e[0])+.7152*lt(e[1])+.0722*lt(e[2])}function B(e,t){let o=ae(e),n=ae(t);if(!o||!n)return null;let r=ut(o),a=ut(n);return(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function Pr(e){let t=1/0,o=1/0,n=-1/0,r=-1/0,a=!1;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(a=!0,s.x<t&&(t=s.x),s.y<o&&(o=s.y),s.x>n&&(n=s.x),s.y>r&&(r=s.y));return a?{minX:t,minY:o,maxX:n,maxY:r}:null}function mn(e){let t=Pr(e);return t?Or(t):null}function Or(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}var se=[{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"}],Ka=new Map(se.map(e=>[e.key,e]));var Ar=[{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"}],Ga=new Map(Ar.map(e=>[e.key,e]));var Tr=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],Ua=new Set(Tr);var hn=7;var xn=10;var ft=.85,vn=12,In=4.5;var _r=3,gn="#000000",yn="#ffffff",jr=24,Nr=18.67;function Sn(e,t=400){return e>=jr||t>=700&&e>=Nr?_r:In}var Fr={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"},Wa=Fr.wheelchair;var dt=B;function pt(e,t,o){let n=ae(e),r=ae(t);if(!n||!r)return t;let a=Math.max(0,Math.min(1,o));return`#${n.map((l,u)=>Math.round(l*a+r[u]*(1-a))).map(l=>l.toString(16).padStart(2,"0")).join("")}`}function wn(e,t,o=In){let n=dt(t,e);if(n!=null&&n>=o)return t;let r=dt(gn,e)??0,a=dt(yn,e)??0;return r===0&&a===0?t:r>=a?gn:yn}function Dr(e){let t=0;for(let o=0,n=e.length;o<n;o+=1){let r=e[o],a=e[(o+1)%n];t+=r.x*a.y-a.x*r.y}return t/2}function ce(e){return Dr(e)*2}var Be=[{key:"row-seats",label:"row seats",suffix:"rows",labelSuffix:"Rows",creationWord:"Seats",objectType:"row"},{key:"table-chairs",label:"table chairs",suffix:"tables",labelSuffix:"Tables",creationWord:"Tables",objectType:"table"},{key:"booth-units",label:"booth units",suffix:"booths",labelSuffix:"Booths",creationWord:"Booths",objectType:"booth"},{key:"ga-capacity",label:"GA capacity",suffix:"ga",labelSuffix:"GA",creationWord:"Standing",objectType:"gaArea"}];function Mn(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function $r(e){return Be.find(t=>t.key===e)}function Se(e){let t=new Map,o=Math.max(0,Math.floor(e.seatCount)),n=new Map((e.overrides??[]).filter(a=>Number.isInteger(a.index)&&a.index>=0&&a.index<e.seatCount).map(a=>[a.index,a])),r=(a,s=1)=>{a&&s>0&&t.set(a,(t.get(a)??0)+s)};r(e.categoryKey,o-n.size);for(let a of n.values())a.skip||r(a.categoryKey??e.categoryKey);return t}function Br(e){return e.type==="row"||e.type==="table"?[...Se(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function Cn(e){return Be.find(t=>t.objectType===e.type)??null}function kn(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function Ie(e){let t=new Map;for(let r of Mn(e))for(let a of r.objects){if(!kn(a))continue;let s=Cn(a);for(let l of Br(a)){let u=t.get(l)??new Map,c=u.get(s.key)??[];if(!c.some(d=>d.id===a.id)){let d=a.displayLabel||a.label||a.id;c.push({id:a.id,label:d,type:s.objectType,floorId:r.id})}u.set(s.key,c),t.set(l,u)}}let o=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...t.keys()].filter(r=>!o.has(r)).sort()].flatMap(r=>{let a=t.get(r);if(!a||a.size<2)return[];let s=Be.flatMap(l=>{let u=a.get(l.key);return u?.length?[{family:l.key,label:l.label,objectType:l.objectType,targets:u}]:[]});return[{categoryKey:r,categoryLabel:o.get(r)??r,families:s,objectIds:[...new Set(s.flatMap(l=>l.targets.map(u=>u.id)))]}]})}function bt(e){let t=e.families.map(o=>`${o.label} (${o.targets.map(n=>n.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${t}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function En(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function Kr(e,t,o){for(let n=1;n<=1e4;n+=1){let r=n===1?`--${t}`:`--${t}-${n}`,s=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!o.has(s))return o.add(s),s}throw new Error(`Unable to allocate a category key for ${e} (${t})`)}function Gr(e,t,o){for(let n=1;n<=1e4;n+=1){let r=n===1?` (${t})`:` (${t} ${n})`,s=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,l=En(s);if(!o.has(l))return o.add(l),s}throw new Error(`Unable to allocate a category label for ${e} (${t})`)}function Ur(e,t,o,n){let r=$r(t);return{...structuredClone(e),key:Kr(e.key,r.suffix,o),label:Gr(e.label,r.labelSuffix,n)}}function Vr(e,t,o){let n=[];for(let r of Mn(e))for(let a of r.objects){if(!kn(a))continue;let s=Cn(a),l=o.get(s.key);if(!(!l||l===t))if(a.type==="row"||a.type==="table"){let u=[];a.categoryKey===t&&(a.categoryKey=l);for(let c of a.overrides??[])c.categoryKey===t&&(c.categoryKey=l,u.push(c.index));(a.categoryKey===l||u.length)&&n.push({family:s.key,floorId:r.id,objectId:a.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:l,...u.length?{seatOverrideIndices:u.sort((c,d)=>c-d)}:{}})}else a.categoryKey===t&&(a.categoryKey=l,n.push({family:s.key,floorId:r.id,objectId:a.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:l}))}return n}function mt(e){let t=structuredClone(e),o=Ie(t);if(!o.length)return{doc:t,changed:!1,changes:[],before:o,after:o};let n=new Set(t.categories.map(l=>l.key)),r=new Set(t.categories.map(l=>En(l.label))),a=[];for(let l of o){let u=t.categories.findIndex(y=>y.key===l.categoryKey);if(u<0)continue;let c=t.categories[u],d=l.families[0].family,f=new Map([[d,c.key]]),m=l.families.slice(1).map(y=>{let S=Ur(c,y.family,n,r);return f.set(y.family,S.key),{family:y.family,key:S.key,label:S.label,category:S}});t.categories.splice(u+1,0,...m.map(y=>y.category));let b=Vr(t,c.key,f);a.push({categoryKey:c.key,categoryLabel:c.label,retainedFamily:d,clones:m.map(({family:y,key:S,label:I})=>({family:y,key:S,label:I})),reassignments:b})}t.floors?.length&&(t.objects=t.floors[0].objects);let s=Ie(t);return{doc:t,changed:a.length>0,changes:a,before:o,after:s}}function Hr(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function we(e,t,o){return(t.x-e.x)*(o.y-e.y)-(t.y-e.y)*(o.x-e.x)}function Ke(e,t,o){let n=we(t,o,e);return Math.abs(n)>1e-7?!1:e.x>=Math.min(t.x,o.x)-1e-7&&e.x<=Math.max(t.x,o.x)+1e-7&&e.y>=Math.min(t.y,o.y)-1e-7&&e.y<=Math.max(t.y,o.y)+1e-7}function zr(e,t,o,n){let r=we(e,t,o),a=we(e,t,n),s=we(o,n,e),l=we(o,n,t);return(r>1e-7&&a<-1e-7||r<-1e-7&&a>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)?!0:Math.abs(r)<=1e-7&&Ke(o,e,t)||Math.abs(a)<=1e-7&&Ke(n,e,t)||Math.abs(s)<=1e-7&&Ke(e,o,n)||Math.abs(l)<=1e-7&&Ke(t,o,n)}function Xr(e){return e.reduce((t,o,n)=>{let r=e[(n+1)%e.length];return t+o.x*r.y-r.x*o.y},0)}function Yr(e){for(let t=0;t<e.length;t+=1){let o=(t+1)%e.length;for(let n=t+1;n<e.length;n+=1){let r=(n+1)%e.length;if(!(t===n||o===n||r===t)&&zr(e[t],e[o],e[n],e[r]))return!0}}return!1}function Rn(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,o)=>Hr(t,e[(o+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Xr(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Yr(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var Ln="M13 4.6a1.6 1.6 0 1 0-3.2 0 1.6 1.6 0 0 0 3.2 0 M11 6.5V13h5l2.4 6 M15 16.4A5 5 0 1 1 9 11.3",Pn=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:"M16 7a4 4 0 1 0-8 0 4 4 0 0 0 8 0 M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:"M15 5a3 3 0 1 0-6 0 3 3 0 0 0 6 0 M12 8l-4 10h8l-4-10 M10 18v4 M14 18v4"},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:Ln},{key:"first-aid",label:"First aid",group:"facilities",path:"M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z M12 8v8 M8 12h8"},{key:"coat-check",label:"Coat check",group:"facilities",path:"M12 6a2 2 0 0 1 0-4 2 2 0 0 1 1.6 3.2L21 13H3l8.4-7.8 M3 13h18"},{key:"atm",label:"ATM / cash",group:"facilities",path:"M2 6h20v12H2V6Z M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0 M6 9h.01 M18 15h.01"},{key:"info",label:"Info point",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M12 11v5 M12 8h.01"},{key:"lost-found",label:"Lost & found",group:"facilities",path:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14 M16 16l5 5 M9 8.5a2 2 0 1 1 3 1.7c-.8.5-1 .8-1 1.8 M11 15h.01"},{key:"restrooms",label:"Restrooms",group:"facilities",path:"M6 3h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M9 18v-3.5a3 3 0 0 1 6 0V18"},{key:"charging",label:"Charging point",group:"facilities",path:"M3 8h13v8H3V8Z M16 10h3v4h-3 M9.6 9l-2 3.5h2.5l-1.5 3"},{key:"smoking",label:"Smoking area",group:"facilities",path:"M2 15h13v3H2v-3Z M18 16h2 M19 8c0 1 1 1.5 1 2.5S19 12 19 13"},{key:"no-smoking",label:"No smoking",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M5.6 5.6l12.8 12.8 M7 13h6v2H7v-2Z"},{key:"food",label:"Food",group:"food-drink",path:"M7 3v6a2 2 0 0 0 4 0V3 M9 11v10 M17 3c-1.6 1-2.2 3-2.2 6 0 2 .9 3.2 2.2 3.6V21"},{key:"bar",label:"Bar",group:"food-drink",path:"M4 5h16l-8 8-8-8Z M12 13v6 M8 20h8"},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 8h13v4a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V8Z M17 9h2a2 2 0 0 1 0 4h-2 M8 2v2 M11 2v2 M4 21h14"},{key:"water",label:"Water / drinks",group:"food-drink",path:"M12 22a7 7 0 0 1-7-7c0-5 7-12 7-12s7 7 7 12a7 7 0 0 1-7 7Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:"M6 8h12l-1 12H7L6 8Z M9 8V6a3 3 0 0 1 6 0v2"},{key:"screen",label:"Screen",group:"facilities",path:"M3 4h18v12H3V4Z M9 20h6 M12 16v4 M10 8l4 2-4 2V8Z"},{key:"sound-booth",label:"Sound booth",group:"facilities",path:"M6 4v16 M6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4 M12 4v16 M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M18 4v16 M18 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4"},{key:"entrance",label:"Entrance",group:"navigation",path:"M14 3h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-5 M3 12h11 M10 8l4 4-4 4"},{key:"exit",label:"Exit",group:"navigation",path:"M10 3H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h5 M14 12h7 M17 8l4 4-4 4"},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:"M14 4.6a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0 M12.5 8l-3.5 2 1.6 3.6-2 4.4 M12.5 10l3.5 1.5 M9 10.5l-3.5 1 M15 12h6 M18 9l3 3-3 3"},{key:"stairs",label:"Stairs",group:"navigation",path:"M3 20v-4h4v-4h4v-4h4V4h5"},{key:"elevator",label:"Elevator",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M8 11l1.5-2 1.5 2 M8 14l1.5 2 1.5-2 M15 8v8"},{key:"parking",label:"Parking",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M9 17V7h4a3 3 0 0 1 0 6H9"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:Ln},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:"M8 20a4 4 0 0 1-2-3c0-1 .5-2 .5-3a4.5 4.5 0 1 1 9 0c0 1.4-1 2-2 2.4-1.2.5-1.5 1-1.5 2.2 M17 6a5 5 0 0 1 1 6 M19.5 4a8 8 0 0 1 1.2 9"}];var Wr=new Map(Pn.map(e=>[e.key,e]));function On(e){return typeof e=="string"&&Wr.has(e)}var es=Pn.map(e=>e.key);var An=["butt","round","square"],Tn=["miter","round","bevel"],gt=["none","arrow"];function yt(e){return e==="line"||e==="polyline"}function Q(e){return e.length>=3&&e.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))}function le(e,t,o){let n=(e.y-t.y)*(o.x-t.x)-(e.x-t.x)*(o.y-t.y);if(Math.abs(n)>1e-7)return!1;let r=(e.x-t.x)*(o.x-t.x)+(e.y-t.y)*(o.y-t.y);if(r<-1e-7)return!1;let a=(o.x-t.x)**2+(o.y-t.y)**2;return r<=a+1e-7}function ue(e,t){let o=!1;for(let n=0,r=t.length-1;n<t.length;r=n++){let a=t[r],s=t[n];if(le(e,a,s))return!0;a.y>e.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}function W(e,t,o){return(t.x-e.x)*(o.y-e.y)-(t.y-e.y)*(o.x-e.x)}function jn(e,t,o,n){let r=W(e,t,o),a=W(e,t,n),s=W(o,n,e),l=W(o,n,t);return(r>1e-7&&a<-1e-7||r<-1e-7&&a>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)?!0:Math.abs(r)<=1e-7&&le(o,e,t)||Math.abs(a)<=1e-7&&le(n,e,t)||Math.abs(s)<=1e-7&&le(e,o,n)||Math.abs(l)<=1e-7&&le(t,o,n)}function de(e){for(let t=0;t<e.length;t+=1){let o=(t+1)%e.length;for(let n=t+1;n<e.length;n+=1){let r=(n+1)%e.length;if(!(t===n||o===n||r===t)&&jn(e[t],e[o],e[n],e[r]))return!0}}return!1}function Me(e,t){for(let o=0;o<e.length;o+=1)for(let n=0;n<t.length;n+=1)if(jn(e[o],e[(o+1)%e.length],t[n],t[(n+1)%t.length]))return!0;return ue(e[0],t)||ue(t[0],e)}function _n(e,t){return!t.some((o,n)=>le(e,o,t[(n+1)%t.length]))&&ue(e,t)}function Nn(e){let t=e.outlinePath;if(!t?.segments.length)return;let o=a=>Number.isFinite(a.x)&&Number.isFinite(a.y),n=(a,s)=>Math.hypot(a.x-s.x,a.y-s.y);if(!o(t.start))return 0;let r=t.start;for(let a=0;a<t.segments.length;a++){let s=t.segments[a];if(!s||!o(s.end)||n(r,s.end)<=1e-9||s.kind==="bezier"&&(!o(s.control1)||!o(s.control2)))return a;if(s.kind==="arc"){if(!o(s.center)||!Number.isFinite(s.radius)||s.radius<=1e-6)return a;let l=Math.max(1e-4,s.radius*1e-4);if(Math.abs(n(r,s.center)-s.radius)>l||Math.abs(n(s.end,s.center)-s.radius)>l)return a}r=s.end}return n(r,t.start)>1e-4,t.segments.length-1}function Zr(e,t,o,n){let r=W(e,t,o),a=W(e,t,n),s=W(o,n,e),l=W(o,n,t);return(r>1e-7&&a<-1e-7||r<-1e-7&&a>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)}function Fn(e,t){for(let o=0;o<e.length;o+=1)for(let n=0;n<t.length;n+=1)if(Zr(e[o],e[(o+1)%e.length],t[n],t[(n+1)%t.length]))return!0;return e.some(o=>_n(o,t))||t.some(o=>_n(o,e))}function Dn(e){return e.role!=="reference-focal"||!e.points||!Q(e.points)?null:e.points}function Bn(e,t){if(e.displayLabel!==void 0){let o=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!o||o!==e.displayLabel||o.length>80)&&t.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let o=e.displayType.normalize("NFKC").trim();(!o||o!==e.displayType||o.length>24)&&t.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}}function $n(e,t,o,n){let r=e.crop,a=r&&(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.x<0||r.y<0||r.width<=0||r.height<=0||r.x+r.width>1.000001||r.y+r.height>1.000001);(!Number.isFinite(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||a)&&o.push({severity:"error",code:"invalid-background-placement",message:`The ${t} image has an invalid position, size, opacity, rotation, or crop`,...n?{floorId:n}:{}})}function ht(e,t,o,n){let r=e.referenceImage,a=e.backgroundImage;r&&($n(r,"reference",t,n),!r.assetId&&!r.url&&t.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...n?{floorId:n}:{}})),a&&($n(a,a.assetId?"legacy reference":"buyer background",t,n),!a.assetId&&!a.url&&t.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...n?{floorId:n}:{}}),a.assetId&&o.push({severity:"warning",code:"legacy-reference-background",message:"This legacy asset-backed background is trace-only and will migrate to the private reference layer when edited",...n?{floorId:n}:{}})),Ht(e)&&t.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...n?{floorId:n}:{}})}function Ce(e){let t=new Set(se.map(o=>o.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(o=>!!o.trim()&&o.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=se.length&&new Set(e.accessibility.counts.map(o=>o.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(o=>t.has(o.type)&&Number.isInteger(o.count)&&o.count>0&&["user-confirmed","authoritative-source"].includes(o.evidence)&&!!o.sourceDescription.trim()&&o.sourceDescription.trim().length<=240))}function Kn(e){let t=e.referenceInventoryExclusion;return!t||typeof t.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&t.assetId===e.referenceSource?.assetId&&typeof t.logicalSectionId=="string"&&t.logicalSectionId===(e.logicalSectionId??e.id)&&typeof t.reason=="string"&&!!t.reason.trim()&&t.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(t.evidence)&&typeof t.sourceDescription=="string"&&!!t.sourceDescription.trim()&&t.sourceDescription.trim().length<=240}function Gn(e){let t=e.referenceCategorySource;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^#[0-9a-f]{6}$/i.test(t.sourceColor)&&(t.sourceColors===void 0||t.sourceColors.length>0&&t.sourceColors.includes(t.sourceColor)&&new Set(t.sourceColors).size===t.sourceColors.length&&t.sourceColors.every(o=>/^#[0-9a-f]{6}$/i.test(o)&&`${o[1]}${o[3]}${o[5]}`.toLowerCase()===`${t.sourceColor[1]}${t.sourceColor[3]}${t.sourceColor[5]}`.toLowerCase()))&&(t.logicalSectionIds===void 0||t.logicalSectionIds.length>0&&new Set(t.logicalSectionIds).size===t.logicalSectionIds.length&&t.logicalSectionIds.every(o=>!!o.trim()&&o.length<=160))&&(t.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(t.assignmentDerivation))&&t.assignmentEvidence===void 0==!t.assignmentSourceDescription?.trim()&&(t.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.assignmentEvidence))&&(t.assignmentSourceDescription?.trim().length??0)<=240&&(t.assignmentDerivation!=="confirmed-logical-sections"||t.assignmentEvidence!==void 0&&!!t.assignmentSourceDescription?.trim())&&t.sourcePaletteColor===void 0==(t.sourcePaletteColorEvidence===void 0)&&t.sourcePaletteColorEvidence===void 0==!t.sourcePaletteColorSourceDescription?.trim()&&(t.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(t.sourcePaletteColor))&&(t.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.sourcePaletteColorEvidence))&&(t.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(t.labelEvidence)&&!!t.labelSourceDescription.trim()&&t.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(t.priceEvidence)&&!!t.priceSourceDescription.trim()&&t.priceSourceDescription.trim().length<=240&&t.outputColorEvidence===void 0==!t.outputColorSourceDescription?.trim()&&(t.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))&&(t.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(t.sourcePaletteColor??t.sourceColor).toLowerCase()&&new Set((t.sourceColors??[t.sourceColor]).map(o=>`${o[1]}${o[3]}${o[5]}`.toLowerCase())).size===1||t.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))}function Un(e){let t=e.referenceDirectSeatImport;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(t.familyId)}function Vn(e,t){let o=e.floors?.length?e.floors.map(a=>({id:a.id,objects:a.objects})):[{id:"floor-0",objects:e.objects}],n=new Map,r=new Map;for(let a of o){let s=a.objects.filter(c=>c.type==="row"),l=new Map,u=new Map;for(let c of s){if(c.segmentedRow){let d=l.get(c.segmentedRow.groupId)??[];d.push(c),l.set(c.segmentedRow.groupId,d)}if(c.rowBlockGeneration){let d=u.get(c.rowBlockGeneration.groupId)??[];d.push(c),u.set(c.rowBlockGeneration.groupId,d)}c.segmentedRow&&c.rowBlockGeneration&&t.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${c.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:c.id,floorId:a.id})}for(let[c,d]of l){let f=n.get(c);f&&f!==a.id&&t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${c}" cannot span multiple floors`,objectId:d[0].id,floorId:a.id}),n.set(c,a.id);let m=d.slice().sort((C,L)=>C.segmentedRow.componentIndex-L.segmentedRow.componentIndex),b=m[0]?.segmentedRow,y=b?.componentCount??0,S=b?JSON.stringify({displayLabel:b.displayLabel,repeatLabelOnComponents:b.repeatLabelOnComponents,displayType:b.displayType,labelPresentation:b.labelPresentation,viewFromSeatUrl:b.viewFromSeatUrl,viewFromSeatMeta:b.viewFromSeatMeta,confidenceEvidence:b.confidenceEvidence,smoothing:b.smoothing}):"";b&&y>=2&&y<=64&&m.length===y&&b.boundaryBefore==="start"&&m.every((C,L)=>{let O=C.segmentedRow;return O.kind==="segmented-row-v1"&&O.groupId===c&&O.componentCount===y&&O.componentIndex===L&&(L===0?O.boundaryBefore==="start":O.boundaryBefore!=="start")&&O.displayLabel.normalize("NFKC").trim()===O.displayLabel&&O.displayLabel.length>0&&O.displayLabel.length<=80&&JSON.stringify({displayLabel:O.displayLabel,repeatLabelOnComponents:O.repeatLabelOnComponents,displayType:O.displayType,labelPresentation:O.labelPresentation,viewFromSeatUrl:O.viewFromSeatUrl,viewFromSeatMeta:O.viewFromSeatMeta,confidenceEvidence:O.confidenceEvidence,smoothing:O.smoothing})===S})||t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${c}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:d[0]?.id,floorId:a.id})}for(let[c,d]of u){let f=r.get(c);f&&f!==a.id&&t.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:d[0].id,floorId:a.id}),r.set(c,a.id)}}}function Qr(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Jr(e){let t=[],o=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let r=o.get(n);r?.skip||t.push({label:Pe(e,n,r),index:n})}return t}function Hn(e){let t=[],o=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let r=o.get(n);r?.skip||t.push({label:r?.label??`${e.label}-${n+1}`,index:n})}return t}function xt(e){return Array.isArray(e)&&e.every(t=>!!t&&typeof t=="object")}function zn(e){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.every(o=>!!o&&typeof o=="object"))}function Xn(e,t={}){let o=t.maxInventory??1e5,n=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&n.push({severity:"error",code:"invalid-floor-overview",message:"Whole venue view must be Combined plan or Separate levels"}),e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&n.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let r=[],a=new Set(e.categories.map(i=>i.key)),s=new Set(se.map(i=>i.key)),l=new Map(e.categories.map(i=>[i.key,i.price!=null||i.notForSale===!0])),u=new Set;ht(e,n,r),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&n.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!nt(e.theme.logoUrl)&&n.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let c=nt,d=(i,A,p,g={})=>{if(A===void 0)return;if(!A||typeof A!="object"||Array.isArray(A)){n.push({severity:"error",code:"invalid-seat-view-metadata",message:`${p} view metadata is invalid`,...g});return}let h=A;i||r.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${p} view metadata has no image`,...g});let P=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);h.projection!==void 0&&h.projection!=="equirectangular"&&n.push({severity:"error",code:"invalid-seat-view-projection",message:`${p} view projection must be equirectangular`,...g}),h.coverage!==void 0&&!P.has(h.coverage)&&n.push({severity:"error",code:"invalid-seat-view-coverage",message:`${p} view coverage is invalid`,...g});let R=(T,_,j)=>typeof T=="number"&&Number.isFinite(T)&&T>=_&&T<=j;if(h.initialBearingDeg!==void 0&&!R(h.initialBearingDeg,-360,360)&&n.push({severity:"error",code:"invalid-seat-view-bearing",message:`${p} view bearing must be between -360\xB0 and 360\xB0`,...g}),h.initialPitchDeg!==void 0&&!R(h.initialPitchDeg,-90,90)&&n.push({severity:"error",code:"invalid-seat-view-pitch",message:`${p} view pitch must be between -90\xB0 and 90\xB0`,...g}),h.capturedAt!==void 0&&(typeof h.capturedAt!="string"||h.capturedAt.length>40||!Number.isFinite(Date.parse(h.capturedAt)))&&n.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${p} view capture date is invalid`,...g}),h.sourceLabel!==void 0&&(typeof h.sourceLabel!="string"||h.sourceLabel.trim().length>100)&&n.push({severity:"error",code:"invalid-seat-view-source",message:`${p} view source label is invalid`,...g}),h.previewUrl!==void 0&&!c(h.previewUrl)&&n.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${p} view preview URL is invalid`,...g}),h.variants!==void 0){let T=Array.isArray(h.variants)?h.variants:[];if(!Array.isArray(h.variants)||T.length<1||T.length>4)n.push({severity:"error",code:"invalid-seat-view-variants",message:`${p} view variants must contain between 1 and 4 tiers`,...g});else{let _=new Set;for(let j of T){if(!j||typeof j!="object"||!c(j.url)||!Number.isInteger(j.width)||j.width<1||j.width>12e3||!Number.isInteger(j.height)||j.height<1||j.height>12e3||j.width!==j.height*2||typeof j.sha256!="string"||!/^[a-f0-9]{64}$/.test(j.sha256)||_.has(j.width)){n.push({severity:"error",code:"invalid-seat-view-variant",message:`${p} view variant is not a unique immutable 2:1 equirectangular tier`,...g});break}_.add(j.width)}}}for(let[T,_]of[["width",h.sourceWidth],["height",h.sourceHeight],["preview width",h.previewWidth],["preview height",h.previewHeight]])_!==void 0&&(!Number.isInteger(_)||_<1||_>32768)&&n.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${p} view source ${T} is invalid`,...g});h.captureEyeHeightM!==void 0&&!R(h.captureEyeHeightM,.5,3)&&n.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${p} capture eye height must be between 0.5 m and 3 m`,...g}),h.eventConfigurationId!==void 0&&(typeof h.eventConfigurationId!="string"||!h.eventConfigurationId.trim()||h.eventConfigurationId.length>100)&&n.push({severity:"error",code:"invalid-seat-view-configuration",message:`${p} event configuration id is invalid`,...g}),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&n.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${p} event configuration version is invalid`,...g}),h.eventConfigurationVersion!==void 0&&!h.eventConfigurationId&&n.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${p} event configuration version requires an id`,...g})},f=(i,A,p={})=>{if(i===void 0)return;let g=_=>{n.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${A} confidence evidence ${_}`,...p})};if(!i||typeof i!="object"||Array.isArray(i)){g("is invalid");return}let h=i;h.schema!=="seatlayer.seat-confidence/1"&&g("has an unsupported schema");let P=(_,j)=>typeof _=="string"&&_.normalize("NFKC").trim()===_&&_.length>0&&_.length<=j;P(h.evidenceId,120)||g("has an invalid evidence id"),P(h.modelVersion,120)||g("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(h.evidenceKind)||g("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(h.modelLevel)||g("has an invalid model level");let R=h.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(R)||g("has an invalid reality level"),h.eventConfigurationId!==void 0&&!P(h.eventConfigurationId,100)&&g("has an invalid event configuration id"),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&g("has an invalid event configuration version"),h.status!==void 0&&!new Set(["draft","approved","retracted"]).has(h.status)&&g("has an invalid publication status"),h.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(h.basisSha256)&&g("has an invalid venue basis SHA-256"),h.basisSha256!==void 0&&h.status!=="approved"&&g("can carry a venue basis SHA-256 only after approval");for(let[_,j]of[["assessment",h.assessedAt],["expiry",h.validUntil]])j!==void 0&&(!P(j,40)||!Number.isFinite(Date.parse(j)))&&g(`has an invalid ${_} date`);h.approvedByRole!==void 0&&!P(h.approvedByRole,100)&&g("has an invalid approving organization or role"),h.sourceLabel!==void 0&&!P(h.sourceLabel,120)&&g("has an invalid source label"),h.limitations!==void 0&&(!Array.isArray(h.limitations)||h.limitations.length>6||h.limitations.some(_=>!P(_,160)))&&g("has invalid limitations"),h.evidenceKind==="synthetic-model"&&(h.modelLevel!=="generated"||R!=="none")&&g("cannot describe synthetic data as verified or reality checked"),h.modelLevel!=="generated"&&(!h.assessedAt||!h.approvedByRole)&&g("requires an assessment date and approving organization or role for verified model levels"),h.modelLevel==="configuration-verified"&&!h.eventConfigurationId&&g("requires an event configuration id for configuration verification"),R!=="none"&&(!h.assessedAt||!h.sourceLabel)&&g("requires an assessment date and source for reality evidence"),R==="actual-build-checked"&&(h.modelLevel!=="configuration-verified"||!h.eventConfigurationId)&&g("requires a configuration-verified model and event configuration for an actual-build check");let T=h.modeledTarget;T!==void 0&&(!T||typeof T!="object"||Array.isArray(T)?g("has an invalid modeled target"):((!P(T.label,80)||!P(T.methodLabel,100))&&g("has invalid modeled-target labels"),(!Number.isInteger(T.totalRayCount)||T.totalRayCount<1||T.totalRayCount>1e3||!Number.isInteger(T.clearRayCount)||T.clearRayCount<0||T.clearRayCount>T.totalRayCount)&&g("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(T.classification)||g("has an invalid modeled-target classification"),T.occluderLabels!==void 0&&(!Array.isArray(T.occluderLabels)||T.occluderLabels.length>10||T.occluderLabels.some(_=>!P(_,100)))&&g("has invalid modeled-target occluders")))};d(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),f(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!c(e.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let i of e.floors??[])i.viewFromSeatUrl!==void 0&&!c(i.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${i.name}" has an invalid view-from-seat image URL`}),d(i.viewFromSeatUrl,i.viewFromSeatMeta,`Floor "${i.name}"`,{floorId:i.id}),f(i.confidenceEvidence,`Floor "${i.name}"`,{floorId:i.id});let m=e.floors?.length?e.floors.flatMap(i=>i.objects):e.objects;for(let i of m)if((i.type==="row"||i.type==="section")&&(i.viewFromSeatUrl!==void 0&&!c(i.viewFromSeatUrl)&&n.push({severity:"error",code:i.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${i.type==="row"?"Row":"Section"} "${i.label}" has an invalid view-from-seat image URL`,objectId:i.id}),d(i.viewFromSeatUrl,i.viewFromSeatMeta,`${i.type==="row"?"Row":"Section"} "${i.label}"`,{objectId:i.id}),f(i.confidenceEvidence,`${i.type==="row"?"Row":"Section"} "${i.label}"`,{objectId:i.id})),i.type==="row"&&i.segmentedRow&&(i.segmentedRow.viewFromSeatUrl!==void 0&&!c(i.segmentedRow.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${i.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:i.id}),d(i.segmentedRow.viewFromSeatUrl,i.segmentedRow.viewFromSeatMeta,`Segmented row "${i.segmentedRow.displayLabel}"`,{objectId:i.id}),f(i.segmentedRow.confidenceEvidence,`Segmented row "${i.segmentedRow.displayLabel}"`,{objectId:i.id})),i.type==="row"||i.type==="table")for(let A of i.overrides??[])A.viewFromSeatUrl!==void 0&&!c(A.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${A.index+1} has an invalid view-from-seat image URL`,objectId:i.id,seatIndices:[A.index]}),d(A.viewFromSeatUrl,A.viewFromSeatMeta,`Seat ${A.index+1}`,{objectId:i.id,seatIndices:[A.index]}),f(A.confidenceEvidence,`Seat ${A.index+1}`,{objectId:i.id,seatIndices:[A.index]});let b=new Set;for(let i of e.categories){b.has(i.key)&&n.push({severity:"error",code:"duplicate-category-key",message:`Category key "${i.key}" is used more than once`,categoryKey:i.key}),b.add(i.key);let A=new Set;for(let p of i.tiers??[]){if(A.has(p.id)&&n.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${p.id}" is used more than once in category "${i.key}"`,categoryKey:i.key}),p.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(p.restriction)&&n.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${p.name}" has an unknown restriction`,categoryKey:i.key}),p.buyerMessage!=null&&(!p.buyerMessage.trim()||p.buyerMessage.length>240)&&n.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${p.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:i.key}),p.currency!=null&&!/^[A-Z]{3}$/.test(p.currency)&&n.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${p.name}" must use a three-letter ISO currency`,categoryKey:i.key}),p.applicability!=null){let g=p.applicability.seatLabels,h=p.applicability.accessibility;(g!==void 0&&(!Array.isArray(g)||!g.length||g.length>1e4||g.some(P=>typeof P!="string"||!P.trim()||P.length>160)||new Set(g).size!==g.length)||h!==void 0&&(!Array.isArray(h)||!h.length||h.some(P=>!s.has(P))||new Set(h).size!==h.length))&&n.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${p.name}" has invalid seat applicability`,categoryKey:i.key})}p.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(p.evidence.provenance)||!p.evidence.sourceDescription.trim()||p.evidence.sourceDescription.length>240||p.evidence.capturedAt!==void 0&&(p.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(p.evidence.capturedAt))))&&n.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${p.name}" has invalid evidence provenance`,categoryKey:i.key}),A.add(p.id)}Gn(i)||n.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${i.label||i.key} has incomplete or invalid reference evidence`,categoryKey:i.key}),Un(i)||n.push({severity:"error",code:"invalid-reference-direct-seat-import",message:`Category ${i.label||i.key} has invalid direct-seat import provenance`,categoryKey:i.key})}let y=new Map,S=new Map,I=[],C=new Map,L=0,O=0,M=new Set;for(let i of e.floors??[])ht(i,n,r,i.id),M.has(i.id)&&n.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${i.id}" is used more than once`,floorId:i.id}),M.add(i.id),i.baseHeightM!==void 0&&(!Number.isFinite(i.baseHeightM)||i.baseHeightM<Z||i.baseHeightM>X)&&n.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${i.name}" base height must be between ${Z} and ${X} metres`,floorId:i.id});let w=e.floors&&e.floors.length?e.floors.flatMap(i=>i.objects):e.objects;Vn(e,n);let x=new Set;for(let i of w)x.has(i.id)&&n.push({severity:"error",code:"duplicate-object-id",message:`Object id "${i.id}" is used more than once`,objectId:i.id}),x.add(i.id);let v=new Set;for(let i of e.zones??[])v.has(i.id)&&n.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${i.id}" is used more than once`}),v.add(i.id),i.focalPoint!==void 0&&(!Number.isFinite(i.focalPoint.x)||!Number.isFinite(i.focalPoint.y))&&n.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${i.label}" must use a finite focal point`});let k=new Map;for(let i of w)if(!(i.type!=="section"||!i.zone)){if(e.zones?.length&&!v.has(i.zone)){n.push({severity:"error",code:"unknown-section-zone",message:`Section "${i.displayLabel??i.label}" references unknown zone "${i.zone}"`,objectId:i.id});continue}k.has(i.zone)||k.set(i.zone,i)}for(let[i,A]of k){let p=e.zones?.find(g=>g.id===i);p&&(p?.focalPoint||r.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${p?.label??i}" uses the legacy floor focal; set its own focal point before publishing`,objectId:A.id}))}for(let i of w)if((i.type==="row"||i.type==="table"||i.type==="booth"||i.type==="gaArea")&&Bn(i,n),Qr(i)){if(L++,O+=i.type==="booth"?1:i.type==="row"?Ne(i):i.bookAsWhole||i.variableOccupancy?i.seatCount:Hn(i).length,y.get(i.label)!==void 0?i.type!=="row"&&n.push({severity:"error",code:"duplicate-object-label",message:`Label "${i.label}" is used by more than one object`,objectId:i.id}):y.set(i.label,i.id),a.has(i.categoryKey)?u.add(i.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${i.label}" references unknown category "${i.categoryKey}"`,objectId:i.id,categoryKey:i.categoryKey}),i.type==="row"){Ce(i.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${i.label}" has invalid reference-inventory provenance`,objectId:i.id}),i.seatCount<1&&n.push({severity:"error",code:"empty-row",message:`Row "${i.label}" has no seats`,objectId:i.id});let p=new Set;for(let g of i.overrides??[]){(g.accessibility??[]).filter(T=>!s.has(T)).length&&n.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${i.label}" seat ${g.index+1} uses an unknown accessibility type`,objectId:i.id,seatIndices:[g.index]}),(!Number.isInteger(g.index)||g.index<0||g.index>=i.seatCount||p.has(g.index))&&n.push({severity:"error",code:"invalid-seat-override",message:`Row "${i.label}" has a duplicated or out-of-range seat override`,objectId:i.id,...Number.isInteger(g.index)?{seatIndices:[g.index]}:{}}),p.add(g.index);let P=g.wheelchairSpaceType,R=g.accessible===!0||g.accessibility?.includes("wheelchair");P!==void 0&&P!=="seat-present"&&P!=="no-seat"?n.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${i.label}" seat ${g.index+1} has an invalid wheelchair-space type`,objectId:i.id,seatIndices:[g.index]}):P&&(!R||g.skip)&&n.push({severity:"error",code:"invalid-wheelchair-space",message:g.skip?`Row "${i.label}" seat ${g.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${i.label}" seat ${g.index+1} must include wheelchair accessibility for its physical-space type`,objectId:i.id,seatIndices:[g.index]})}for(let g of Jr(i))ie(g.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${g.label}" uses SeatLayer's reserved GA namespace`,objectId:i.id,seatIndices:[g.index]}),S.get(g.label)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${g.label}" is used more than once`,objectId:i.id,seatIndices:[g.index]}):S.set(g.label,i.id)}else if(i.type==="table"){let p=i.bookAsWhole===!0||i.variableOccupancy===!0;if(i.fill!==void 0&&!pn(i.fill)&&n.push({severity:"error",code:"invalid-table-fill",message:`Table "${i.label}" has an invalid surface color`,objectId:i.id}),i.automaticRadius!==void 0&&typeof i.automaticRadius!="boolean"?n.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${i.label}" has an invalid automatic-radius setting`,objectId:i.id}):i.automaticRadius===!0&&(i.shape!=="round"||i.radius!==zt(i.seatCount,i.seatArc))&&n.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${i.label}" needs a radius that matches its automatic chair spacing`,objectId:i.id}),i.seatCountsBySide){let R=["top","bottom","left","right"],T=Object.keys(i.seatCountsBySide),_=R.every(U=>Number.isInteger(i.seatCountsBySide[U])&&i.seatCountsBySide[U]>=0&&i.seatCountsBySide[U]<=40),j=_?R.reduce((U,Ee)=>U+i.seatCountsBySide[Ee],0):Number.NaN;(i.shape!=="rect"||T.length!==R.length||T.some(U=>!R.includes(U))||!_||j!==i.seatCount||j<1||j>40)&&n.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${i.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${i.seatCount}-chair capacity`,objectId:i.id})}p&&i.overrides?.length&&n.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${i.label}" cannot carry individual-chair overrides`,objectId:i.id,seatIndices:i.overrides.map(R=>R.index)});let g=new Set;for(let R of i.overrides??[]){(R.accessibility??[]).filter(U=>!s.has(U)).length&&n.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${i.label}" chair ${R.index+1} uses an unknown accessibility type`,objectId:i.id,seatIndices:[R.index]}),(!Number.isInteger(R.index)||R.index<0||R.index>=i.seatCount||g.has(R.index))&&n.push({severity:"error",code:"invalid-seat-override",message:`Table "${i.label}" has a duplicated or out-of-range chair override`,objectId:i.id,...Number.isInteger(R.index)?{seatIndices:[R.index]}:{}}),g.add(R.index),R.categoryKey&&!a.has(R.categoryKey)?n.push({severity:"error",code:"unknown-category",message:`Table "${i.label}" chair ${R.index+1} references unknown category "${R.categoryKey}"`,objectId:i.id,seatIndices:[R.index],categoryKey:R.categoryKey}):R.categoryKey&&u.add(R.categoryKey);let _=R.wheelchairSpaceType,j=R.accessible===!0||R.accessibility?.includes("wheelchair");_!==void 0&&_!=="seat-present"&&_!=="no-seat"?n.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${i.label}" chair ${R.index+1} has an invalid wheelchair-space type`,objectId:i.id,seatIndices:[R.index]}):_&&(!j||R.skip)&&n.push({severity:"error",code:"invalid-wheelchair-space",message:R.skip?`Table "${i.label}" chair ${R.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${i.label}" chair ${R.index+1} must include wheelchair accessibility for its physical-space type`,objectId:i.id,seatIndices:[R.index]})}i.bookAsWhole&&i.variableOccupancy?n.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${i.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:i.id}):i.variableOccupancy?(!Number.isInteger(i.minOccupancy)||!Number.isInteger(i.maxOccupancy)||i.minOccupancy<1||i.maxOccupancy<i.minOccupancy||i.maxOccupancy>i.seatCount)&&n.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${i.label}" needs whole-number minimum and maximum guests from 1 to its ${i.seatCount}-chair capacity`,objectId:i.id}):(i.minOccupancy!=null||i.maxOccupancy!=null)&&n.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${i.label}" has guest bounds without variable-occupancy selling`,objectId:i.id}),Ce(i.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${i.label}" has invalid reference-inventory provenance`,objectId:i.id}),(i.shape==="round"&&i.radius==null||i.shape==="rect"&&(i.width==null||i.height==null)||i.seatCount<1)&&n.push({severity:"error",code:"bad-table",message:`Table "${i.label}" is missing required dimensions or seats`,objectId:i.id});let P=p?[{label:i.label,index:void 0}]:Hn(i);for(let R of P)ie(R.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${R.label}" uses SeatLayer's reserved GA namespace`,objectId:i.id}),S.get(R.label)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${R.label}" is used more than once; grouped table labels must be unique`,objectId:i.id,...R.index===void 0?{}:{seatIndices:[R.index]}}):S.set(R.label,i.id)}else if(i.type==="booth"){Ce(i.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${i.label}" has invalid reference-inventory provenance`,objectId:i.id});let p=i.label;ie(p)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${p}" uses SeatLayer's reserved GA namespace`,objectId:i.id}),S.get(p)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${p}" is used more than once`,objectId:i.id}):S.set(p,i.id)}}else if(i.type==="gaArea"){if(!$e(i))n.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${i.label}" has invalid joined-area inventory provenance`,objectId:i.id});else for(let g of ct(i))S.get(g)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${g}" is used more than once`,objectId:i.id}):S.set(g,i.id);if(Ce(i.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${i.label}" has invalid reference-inventory provenance`,objectId:i.id}),!xt(i.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${i.label}" outline must be a list of points`,objectId:i.id});continue}(!Q(i.points)||Math.abs(ce(i.points))<=1e-7||de(i.points))&&n.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${i.label}" must have a finite, non-self-intersecting polygon outline`,objectId:i.id});let p=i.holes??[];if(!zn(p))n.push({severity:"error",code:"invalid-hole-collection",message:`GA area "${i.label}" cutouts must be a list of point lists`,objectId:i.id});else{let g=p.length<=64?p.findIndex(h=>h.length>512||!Q(h)||Math.abs(ce(h))<=1e-7||de(h)?!0:!h.flatMap((R,T)=>{let _=h[(T+1)%h.length];return[R,{x:(R.x+_.x)/2,y:(R.y+_.y)/2}]}).every(R=>ue(R,i.points))):0;if(g>=0)n.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${i.label}" has a cutout outside its outline or with invalid geometry`,objectId:i.id,holeIndex:g});else if(p.some((h,P)=>p.slice(P+1).some(R=>Me(h,R)))){let h=p.findIndex((P,R)=>p.slice(R+1).some(T=>Me(P,T)));n.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${i.label}" has overlapping cutout polygons`,objectId:i.id,holeIndex:h})}}a.has(i.categoryKey)?u.add(i.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${i.label}" references unknown category "${i.categoryKey}"`,objectId:i.id,categoryKey:i.categoryKey}),i.capacity<1&&n.push({severity:"error",code:"empty-ga",message:`GA area "${i.label}" has zero capacity`,objectId:i.id}),(!Number.isInteger(i.capacity)||i.capacity>q)&&n.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${i.label}" capacity must be a whole number from 1 to ${q}`,objectId:i.id}),L++,O+=Math.max(0,Math.floor(i.capacity))}else if(i.type==="section"){if(i.displayLabel!==void 0){let g=i.displayLabel.normalize("NFKC").trim();g?(g!==i.displayLabel||g.length>80)&&n.push({severity:"error",code:"invalid-display-label",message:`Section "${i.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:i.id}):n.push({severity:"error",code:"unnamed-section",message:`Section "${i.label}" needs a buyer-facing name before seats are added`,objectId:i.id})}if(i.editor?.defaultCategoryKey&&!a.has(i.editor.defaultCategoryKey)&&n.push({severity:"error",code:"unknown-category",message:`Section "${i.label}" references unknown future-seat category "${i.editor.defaultCategoryKey}"`,objectId:i.id}),i.elevation!==void 0&&(!Number.isInteger(i.elevation)||i.elevation<Je||i.elevation>oe)){let g=Number.isInteger(i.elevation)&&i.elevation>oe&&i.elevation<=et;r.push({severity:"warning",code:g?"legacy-section-elevation":"invalid-section-elevation",message:g?`Section "${i.label}" uses legacy tier ${i.elevation}; set an exact height before normalizing it to tier ${oe}`:`Section "${i.label}" elevation must be a whole-number tier from ${Je} to ${oe}`,objectId:i.id})}if(i.height!==void 0&&(!Number.isFinite(i.height)||i.height<Z||i.height>X)&&n.push({severity:"error",code:"invalid-section-height",message:`Section "${i.label}" exact height must be between ${Z} and ${X} metres`,objectId:i.id}),i.rake!==void 0&&(!Number.isFinite(i.rake)||i.rake<Oe||i.rake>Ae)&&n.push({severity:"error",code:"invalid-section-rake",message:`Section "${i.label}" rake must be between ${Oe}\xB0 and ${Ae}\xB0`,objectId:i.id}),i.surfaceKind!==void 0&&i.surfaceKind!=="flat"&&i.surfaceKind!=="rakedRows"&&n.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${i.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:i.id}),!xt(i.outline)){n.push({severity:"error",code:"invalid-polygon-points",message:`Section "${i.label}" outline must be a list of points`,objectId:i.id});continue}if(!Q(i.outline)||Math.abs(ce(i.outline))<=1e-7||de(i.outline)){n.push({severity:"error",code:"invalid-section-outline",message:`Section "${i.label}" must have a finite, non-self-intersecting polygon outline`,objectId:i.id});continue}if(i.outlinePath){let g=[];try{g=Nt(i.outlinePath)}catch{}(!We(i.outlinePath)||!g.length||Math.hypot(i.outlinePath.start.x-i.outline[0].x,i.outlinePath.start.y-i.outline[0].y)>1e-4||!Q(g)||Math.abs(ce(g))<=1e-7||de(g))&&n.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${i.label}" has an invalid or inconsistent curved outline path`,objectId:i.id,edgeIndex:Nn(i)})}if(i.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(i.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(i.referenceSource.regionId))&&n.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${i.label}" has invalid opaque reference provenance`,objectId:i.id}),Kn(i)||n.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${i.label}" has incomplete or mismatched non-sellable evidence`,objectId:i.id}),i.logicalSectionId!==void 0&&!i.logicalSectionId.trim())n.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${i.label}" has an empty logical section id`,objectId:i.id});else if(i.logicalSectionId){let g=JSON.stringify({displayLabel:i.displayLabel??null,entrance:i.entrance??null,viewFromSeatUrl:i.viewFromSeatUrl??null,viewFromSeatMeta:i.viewFromSeatMeta??null,confidenceEvidence:i.confidenceEvidence??null,zone:i.zone??null,labelStyle:i.labelPresentation?.labelStyle??null,labelVisible:i.labelPresentation?.visible!==!1}),h=C.get(i.logicalSectionId);h&&(h.label!==i.label||h.semanticSignature!==g)?n.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${i.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:i.id}):h||C.set(i.logicalSectionId,{label:i.label,semanticSignature:g})}let A=i.holes??[];if(!zn(A)){n.push({severity:"error",code:"invalid-hole-collection",message:`Section "${i.label}" openings must be a list of point lists`,objectId:i.id});continue}if(A.length>64){n.push({severity:"error",code:"invalid-section-hole",message:`Section "${i.label}" has an invalid opening collection`,objectId:i.id});continue}let p=-1;for(let g=0;g<A.length;g++){let h=A[g];if(h.length>512||!Q(h)||Math.abs(ce(h))<=1e-7||de(h)){p=g;break}if(!h.flatMap((R,T)=>{let _=h[(T+1)%h.length];return[R,{x:(R.x+_.x)/2,y:(R.y+_.y)/2}]}).every(R=>ue(R,i.outline))){p=g;break}}if(p>=0)n.push({severity:"error",code:"invalid-section-hole",message:`Section "${i.label}" has an opening outside its outline or with an invalid shape`,objectId:i.id,holeIndex:p});else if(A.some((g,h)=>A.slice(h+1).some(P=>Me(g,P)))){let g=A.findIndex((h,P)=>A.slice(P+1).some(R=>Me(h,R)));n.push({severity:"error",code:"overlapping-section-holes",message:`Section "${i.label}" has overlapping openings`,objectId:i.id,holeIndex:g})}}let E=e.floors?.length?e.floors.map(i=>i.objects):[e.objects];for(let i of E){let A=i.filter(p=>p.type==="section");for(let p of i.filter(g=>g.type==="text")){let g=p.iconKey;g!==void 0&&!On(g)&&n.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${p.text||p.id}" references an unknown symbol`,objectId:p.id});let h=p.fontFamily;h!==void 0&&(typeof h!="string"||h.normalize("NFKC").trim()!==h||h.length<1||h.length>120)&&n.push({severity:"error",code:"invalid-text-font-family",message:`Text "${p.text||p.id}" font family must contain 1 to 120 normalized characters`,objectId:p.id});let P=p.background;(p.width!==void 0&&(!Number.isFinite(p.width)||p.width<40||p.width>1200)||p.align!==void 0&&!["left","center","right"].includes(p.align)||p.lineHeight!==void 0&&(!Number.isFinite(p.lineHeight)||p.lineHeight<.8||p.lineHeight>3)||p.letterSpacing!==void 0&&(!Number.isFinite(p.letterSpacing)||p.letterSpacing<-2||p.letterSpacing>20)||p.opacity!==void 0&&(!Number.isFinite(p.opacity)||p.opacity<.1||p.opacity>1)||P!==void 0&&(!/^#[0-9a-f]{6}$/i.test(P.color)||P.padding!==void 0&&(!Number.isFinite(P.padding)||P.padding<0||P.padding>40)||P.cornerRadius!==void 0&&(!Number.isFinite(P.cornerRadius)||P.cornerRadius<0||P.cornerRadius>40)||P.opacity!==void 0&&(!Number.isFinite(P.opacity)||P.opacity<.1||P.opacity>1)))&&n.push({severity:"error",code:"invalid-text-layout",message:`Text "${p.text||p.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:p.id})}for(let p of i.filter(g=>g.type==="shape")){if(p.eventConfigurationIds!==void 0){let P=p.eventConfigurationIds;Array.isArray(P)&&P.length>0&&P.length<=20&&P.every(T=>typeof T=="string"&&T.normalize("NFKC").trim()===T&&T.length>=1&&T.length<=100)&&new Set(P).size===P.length||n.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${p.label||p.id}" must reference 1 to 20 unique event configuration ids`,objectId:p.id})}if(p.heightM!==void 0&&(!Number.isFinite(p.heightM)||p.heightM<.05||p.heightM>50)&&n.push({severity:"error",code:"invalid-shape-height",message:`Shape "${p.label||p.id}" height must be between 0.05 m and 50 m`,objectId:p.id}),p.stroke!==void 0&&(!p.stroke||typeof p.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(p.stroke.color)||!Number.isFinite(p.stroke.width)||p.stroke.width<.5||p.stroke.width>40)&&n.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${p.label||p.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:p.id}),(p.lineCap!==void 0||p.lineJoin!==void 0||p.startEnding!==void 0||p.endEnding!==void 0)&&!yt(p.kind)?n.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${p.label||p.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:p.id}):yt(p.kind)&&(p.lineCap!==void 0&&!An.includes(p.lineCap)||p.lineJoin!==void 0&&!Tn.includes(p.lineJoin)||p.startEnding!==void 0&&!gt.includes(p.startEnding)||p.endEnding!==void 0&&!gt.includes(p.endEnding))&&n.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${p.label||p.id}" has an unsupported line cap, join, or ending`,objectId:p.id}),p.points!==void 0&&!xt(p.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${p.label||p.id}" points must be a list of points`,objectId:p.id});continue}if(p.kind==="polygon"){let P=Rn(p.points??[]);P.ok||n.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${p.label||p.id}" has invalid polygon geometry: ${P.message}`,objectId:p.id})}let h=Dn(p);if(h){for(let P of A)if(Fn(h,P.outline)){n.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${p.label??p.id}" overlaps section "${P.label}"`,objectId:p.id});break}}}}O>o&&n.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${O} bookable units; the maximum is ${o}`}),n.push(...I.slice(0,5)),I.length>5&&n.push({severity:"error",code:"duplicate-seat-label",message:`${I.length} seats share a label with another seat; the first 5 are listed above. Seat labels must be unique across the whole chart.`});for(let i of Ie(e)){let A=i.families[0]?.targets[0];r.push({severity:"warning",code:"category-inventory-family-conflict",message:bt(i),categoryKey:i.categoryKey,...A?{objectId:A.id,floorId:A.floorId}:{},relatedObjectIds:i.objectIds,categoryInventoryFamilies:i.families})}e.focalPoint||r.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),L===0&&r.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let i of u)if(l.get(i)===!1){let A=e.categories.find(p=>p.key===i);r.push({severity:"warning",code:"unpriced-category",message:`Category "${A?.label??i}" is used but has no price`,categoryKey:i})}return[...n,...r]}var ei=9,qn="#f7f8fb",ti="#f5f6f8",Qn="#8b93a7",ni="#0b1220",oi="#0b1220",ri="#ffffff",ii=100;function N(e,t=2){let o=10**t;return Math.round(e*o)/o}function D(e){return{source:"quality",...e}}function ai(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function St(e){return ei*fn(e.theme?.seatScale)}function Jn(e){let t=[];for(let o of e.objects)o.type==="row"?t.push(...G(o)):o.type==="table"&&t.push(...H(o));return t}function si(e){let t={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let o of e)for(let n of o.objects)n.type==="row"?t.rowSeats+=G(n).length:n.type==="table"?t.tableSeats+=H(n).length:n.type==="booth"?t.booths+=1:n.type==="gaArea"&&(t.gaCapacity+=Math.max(0,Math.floor(n.capacity)));return{inventoryByKind:t,bookableUnits:t.rowSeats+t.tableSeats+t.booths+t.gaCapacity}}function $(e,t){e.filter(o=>o.code===t.code).length<ii&&e.push(t)}function ci(e,t,o){let n=St(e),r=2*n,a=2.3*n,s=0,l=0,u=1/0;for(let c of t){let d=new Map(c.objects.filter(I=>I.type==="row").map(I=>[I.id,I])),f=I=>{let C=c.objects.find(x=>x.id===I);if(!C||C.type!=="row"&&C.type!=="table")return"another seating object";let L=C.type==="row"?G(C):H(C),O=L.length?{x:L.reduce((x,v)=>x+v.x,0)/L.length,y:L.reduce((x,v)=>x+v.y,0)/L.length}:C.type==="row"?C.origin:C.center,M=c.objects.find(x=>x.type==="section"&&z(O,x.outline,x.holes)),w=C.type==="row"?`Row \u201C${C.label}\u201D`:`Table \u201C${C.label}\u201D`;return M?.type==="section"?`${w} in \u201C${M.label}\u201D`:w},m=Jn(c);s+=m.length;let b=a,y=new Map,S=new Map;for(let I of m){let C=Math.floor(I.x/b),L=Math.floor(I.y/b);for(let w=-1;w<=1;w++)for(let x=-1;x<=1;x++){let v=y.get(`${C+w}:${L+x}`)??[];for(let k of v){l++;let E=Math.hypot(I.x-k.x,I.y-k.y);if(u=Math.min(u,E),E>=a)continue;let A=(I.rowId<k.rowId?[I.rowId,k.rowId]:[k.rowId,I.rowId]).join("|"),p=S.get(A);(!p||E<p.distance)&&S.set(A,{a:I,b:k,distance:E})}}let O=`${C}:${L}`,M=y.get(O)??[];M.push(I),y.set(O,M)}for(let I of S.values()){let C=I.a.rowId===I.b.rowId,L=d.get(I.a.rowId),O=d.get(I.b.rowId),M=!C&&L?.segmentedRow?.repeatLabelOnComponents===!0&&O?.segmentedRow?.repeatLabelOnComponents===!0&&L.segmentedRow.groupId===O.segmentedRow.groupId,w=!!L?.referenceScan&&!!O?.referenceScan&&L.referenceScan.assetId===O.referenceScan.assetId&&L.referenceScan.sectionId===O.referenceScan.sectionId,x=I.distance<r;if((M||w)&&!x)continue;let v=x?"seat-overlap":"seat-cramped",k=f(I.a.rowId),E=f(I.b.rowId),i=N(x?r:a);$(o,D({severity:"warning",code:v,dimension:"geometry",title:x?C?`${k} has overlapping seats`:`${k} and ${E} overlap`:C?`${k} has seats too close together`:`${k} and ${E} are too close together`,message:x?`The closest seats are ${N(I.distance)} chart units apart, so their markers overlap on the buyer map; at least ${i} keeps them apart.`:`The closest seats are ${N(I.distance)} chart units apart; at least ${i} are required.`,action:C?`Increase the seat spacing for ${k}, or use Review safe fixes.`:`Move ${k} or ${E} until they no longer overlap.`,objectId:I.a.rowId,relatedObjectIds:C?[I.a.rowId]:[I.a.rowId,I.b.rowId],floorId:c.id,measured:N(I.distance),minimum:i,autoFixable:C}))}}return{seats:s,checkedSeatPairs:l,minimumSeatDistance:Number.isFinite(u)?N(u):null}}function Ge(e){let{width:t,height:o}=At(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:t,height:o};let n=[{x:0,y:0},{x:t,y:0},{x:t,y:o},{x:0,y:o}].map(r=>{let a=Tt(r,e.rotation);return{x:e.position.x+a.x,y:e.position.y+a.y}});return mn(n)}function eo(e,t,o=0){return e.x<t.x+t.width+o&&e.x+e.width+o>t.x&&e.y<t.y+t.height+o&&e.y+e.height+o>t.y}function It(e,t,o){let n=K(t.x,e.x,e.x+e.width),r=K(t.y,e.y,e.y+e.height);return(t.x-n)**2+(t.y-r)**2<o**2}function li(e,t,o){let n=St(e),r=0;for(let a of t){let s=a.objects.filter(u=>u.type==="text"),l=Jn(a);r+=s.length;for(let u=0;u<s.length;u++){let c=s[u],d=Ge(c),f=l.find(m=>It(d,m,n));f&&$(o,D({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${c.text}\u201D overlaps seat ${f.label}`,objectId:c.id,relatedObjectIds:[c.id,f.rowId],floorId:a.id,autoFixable:!0}));for(let m=0;m<u;m++){let b=s[m];eo(d,Ge(b),2)&&$(o,D({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${c.text}\u201D overlaps text \u201C${b.text}\u201D`,objectId:c.id,relatedObjectIds:[c.id,b.id],floorId:a.id,autoFixable:!0}))}}}return r}function vt(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function ui(e,t,o){let n=new Map;for(let l of t)for(let u of l.objects){let c=u.type,d=c==="row"||c==="table"||c==="booth"||c==="gaArea",f=d||c==="section";if(d&&!u.categoryKey.trim()){let m=c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth";$(o,D({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${m} \u201C${u.label||u.id}\u201D has no category`,message:`${m} \u201C${u.label||u.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:u.id,floorId:l.id,autoFixable:!1}))}if(f){let m=(u.type==="section"?u.displayLabel??u.label:u.label)??"";if(m.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let b=vt(m),y=n.get(b);y&&y.raw!==m?$(o,D({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${m}\u201D and \u201C${y.raw}\u201D read as the same label`,message:`Labels \u201C${m}\u201D and \u201C${y.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:u.id,relatedObjectIds:[u.id,y.id],floorId:l.id,autoFixable:!1})):y||n.set(b,{id:u.id,raw:m})}}else{let b=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";$(o,D({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${b} has no label`,message:`${b} has an empty label; buyers rely on labels to identify what they are booking.`,action:"Give this object a short, unique label in the inspector.",objectId:u.id,floorId:l.id,autoFixable:!1}))}}}let r=[];for(let l of t){let u=l.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of l.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||u.some(f=>z(Y(f),c.outline,c.holes)))){if(c.referenceSource){r.push({id:c.id,floorId:l.id});continue}$(o,D({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.label}\u201D contains no rows, tables, booths, or GA areas.`,action:"Add seating inside this section (Fill with rows), or remove the empty section.",objectId:c.id,floorId:l.id,autoFixable:!1}))}}r.length&&$(o,D({severity:"warning",code:"empty-section",dimension:"structure",title:r.length===1?"1 traced section has no seating yet":`${r.length} traced sections have no seating yet`,message:`${r.length} section${r.length===1?"":"s"} traced from the reference image contain${r.length===1?"s":""} no rows, tables, booths, or GA areas.`,action:"Fill them with rows, or remove the ones the venue does not sell.",objectId:r[0].id,relatedObjectIds:r.map(l=>l.id),floorId:r[0].floorId,autoFixable:!1}));let a=new Map,s=new Map;for(let l of t){let u=[];for(let c of l.objects)c.type!=="section"||c.outline.length<3||u.push({id:c.logicalSectionId??c.id,outline:c.outline,...c.holes?{holes:c.holes}:{},bounds:mi(c.outline)});for(let c of l.objects){if(c.type!=="row")continue;let d=(c.segmentedRow?.displayLabel??c.displayLabel??c.label??"").trim(),f=(c.displayType??"").trim(),m=d&&f&&vt(f)!=="row"?`${f} ${d}`:d,b="";if(u.length){let C=Y(c),L=u.find(O=>C.x>=O.bounds.minX&&C.x<=O.bounds.maxX&&C.y>=O.bounds.minY&&C.y<=O.bounds.maxY&&z(C,O.outline,O.holes));L&&(b=L.id)}let y=`${l.id}\0${b}\0${vt(m)}`,S=c.segmentedRow?.groupId??c.id;if(!m){let C=`${l.id}\0${b}`,L=s.get(C);L?(L.ids.push(c.id),L.logical.set(S,[...L.logical.get(S)??[],c])):s.set(C,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id});continue}let I=a.get(y);I?(I.ids.push(c.id),I.logical.set(S,[...I.logical.get(S)??[],c])):a.set(y,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id,raw:m})}}for(let{ids:l,logical:u,floorId:c,raw:d}of a.values()){let f=u.size;f<2||Yn([...u.values()])&&$(o,D({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${f} rows share the name \u201C${d}\u201D`,message:`${f} rows share the label \u201C${d}\u201D, so buyers cannot tell which row a seat belongs to.`,action:"Rename them so each row reads differently: for example the section or box each belongs to.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}for(let{ids:l,logical:u,floorId:c}of s.values()){let d=u.size;d<2||Yn([...u.values()])&&$(o,D({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${d} rows have no name`,message:`${d} rows in the same area have no name and repeat each other\u2019s seat numbers, so buyers cannot tell which row a seat belongs to.`,action:"Give each of these rows a name, for example the box each belongs to, so a ticket can say which row a seat is in.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let l of e.floors)l.objects.length===0&&$(o,D({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${l.name}\u201D is empty`,message:`Floor \u201C${l.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:l.id,autoFixable:!1}))}var di=5,fi=16;function pi(e,t,o){for(let n of t){let r=n.focalPoint??e.focalPoint;if(r)for(let a of n.objects){if(a.type!=="section"||a.outline.length<3)continue;let{rake:s}=ye(a);if(s<di)continue;let l=a.outline.map(m=>Math.hypot(m.x-r.x,m.y-r.y)),u=Math.max(...l);if(u<=0)continue;let c=(u-Math.min(...l))/u;if(s*c<=fi)continue;let f=a.displayLabel??a.label;$(o,D({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${f}\u201D is too deep for a single rake`,message:`Section \u201C${f}\u201D spans ${Math.round(c*100)}% of its distance to the stage at a ${Math.round(s)}\xB0 rake, so one rake can't represent its sightlines faithfully: a real tier this deep changes slope at a cross-aisle.`,action:"Split this section at the cross-aisle into two sections, each with its own rake.",objectId:a.id,floorId:n.id,autoFixable:!1}))}}}function bi(e,t,o){let n=e.theme?.background??qn,r=ti,a=new Map;for(let c of t)for(let d of c.objects){if(d.type!=="gaArea")continue;let f=a.get(d.categoryKey)??[];f.push({id:d.id,floorId:c.id}),a.set(d.categoryKey,f)}for(let c of e.categories){let d=B(c.color,n),f=B(c.color,r);if(d==null||f==null){$(o,D({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${c.label}\u201D does not use a supported hex color`,categoryKey:c.key}));continue}let m=Math.min(d,f);m<3&&$(o,D({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${c.label}\u201D is hard to see`,message:`Category \u201C${c.label}\u201D reaches only ${N(m)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${c.label}\u201D until this warning clears.`,categoryKey:c.key,measured:N(m),minimum:3,autoFixable:!1}));let b=a.get(c.key)??[];if(b.length){let y=pt(c.color,n,ft),S=pt(c.color,r,ft),I=Math.min(B(y,n)??0,B(S,r)??0);I<3&&$(o,D({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${c.label}\u201D reaches only ${N(I)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:b[0].id,categoryKey:c.key,floorId:b[0].floorId,relatedObjectIds:b.map(C=>C.id),measured:N(I),minimum:3,autoFixable:!1}))}}for(let c=0;c<e.categories.length;c++)for(let d=0;d<c;d++){let f=e.categories[c],m=e.categories[d],b=bn(f.color,m.color);b!=null&&b<25&&$(o,D({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${f.label}\u201D and \u201C${m.label}\u201D look too similar`,message:`Categories \u201C${f.label}\u201D and \u201C${m.label}\u201D are only \u0394E ${N(b)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:f.key,measured:N(b),minimum:25,autoFixable:!1}))}for(let c of t){let d=c.objects.filter(f=>f.type==="text");for(let f of d){let m=f.color??e.theme?.textColor??Qn,b=B(m,n),y=f.fontSize>=18?3:4.5;(b==null||b<y)&&$(o,D({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${f.text}\u201D has ${N(b??0)}:1 contrast against the chart background; ${y}:1 is required`,objectId:f.id,floorId:c.id,measured:N(b??0),minimum:y,autoFixable:!0}))}}if(e.theme?.selectionColor){let c=B(e.theme.selectionColor,n);(c==null||c<3)&&$(o,D({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${N(c??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Selection color that stands out clearly from the Background color.",measured:N(c??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let c=B(e.theme.textColor,n);(c==null||c<3)&&$(o,D({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${N(c??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Text color with stronger contrast against the Background color.",measured:N(c??0),minimum:3,autoFixable:!1}))}let s=e.theme?.seatLabelColor??ni,l=new Map,u=(c,d,f)=>{let m=l.get(c)??new Map,b=m.get(d)??[];b.push(f),m.set(d,b),l.set(c,m)};for(let c of t)for(let d of c.objects)if(d.type==="row")for(let f of Se(d).keys())u(f,"seat",d.id);else if(d.type==="table")for(let f of Se(d).keys())u(f,"table seat",d.id);else d.type==="booth"&&u(d.categoryKey,"booth",d.id);for(let c of e.categories){let d=l.get(c.key);if(d)for(let[f,m]of d){let b=f==="booth"?xn:hn,y=Sn(vn,600),S=wn(c.color,s),I=B(S,c.color);(I==null||I<y)&&$(o,D({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${f==="booth"?"Booth":f==="seat"?"Seat":"Table-seat"} labels use ${b}u type and have ${N(I??0)}:1 contrast on category \u201C${c.label}\u201D; ${y}:1 is required for small text`,objectId:m[0],relatedObjectIds:m,measured:N(I??0),minimum:y,autoFixable:!0}))}}}function Yn(e){if(e.length>24)return!0;let t=new Set;for(let o of e){let n=new Set;for(let r of o)for(let a of G(r)){let s=a.label,l=s.lastIndexOf("-");n.add(l>=0?s.slice(l+1):s)}if(!n.size)return!0;for(let r of n)if(t.has(r))return!0;for(let r of n)t.add(r)}return!1}function mi(e){let t=1/0,o=1/0,n=-1/0,r=-1/0;for(let a of e)a.x<t&&(t=a.x),a.y<o&&(o=a.y),a.x>n&&(n=a.x),a.y>r&&(r=a.y);return{minX:t,minY:o,maxX:n,maxY:r}}function gi(e,t){for(let o of e){let n=o.objects.filter(r=>r.type==="section");if(!(n.length<2))for(let r of o.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let s=Y(r),l=n.filter(b=>z(s,b.outline,b.holes)),u=new Map;for(let b of l){let y=b.logicalSectionId??b.id,S=u.get(y)??[];S.push(b),u.set(y,S)}if(u.size<2)continue;let c=[...u.values()],d=c.map(b=>`Section \u201C${b[0].displayLabel??b[0].label}\u201D`),f=d.length===2?d.join(" and "):`${d.slice(0,-1).join(", ")}, and ${d[d.length-1]}`,m=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";$(t,D({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${m} \u201C${r.label}\u201D belongs to more than one section`,message:`${m} \u201C${r.label}\u201D has its center inside ${f}, so its buyer section is unclear.`,action:"Adjust the boundaries until this object sits in one Section. If the overlapping shapes are meant to form one Section, combine them first.",objectId:r.id,relatedObjectIds:[r.id,...c.flatMap(b=>b.map(y=>y.id))],floorId:o.id,autoFixable:!1}))}}}var yi={structure:20,geometry:30,contrast:25,labels:15,navigation:10},hi={"seat-overlap":15,"seat-cramped":4,"label-collision":4,"category-contrast-low":3,"ga-contrast-low":3,"category-colors-too-similar":3,"invalid-category-color":10,"text-contrast-low":4,"bookable-label-contrast-low":3,"selection-contrast-low":3,"theme-text-contrast-low":3,"missing-focal-point":10,"object-uncategorized":3,"object-unlabeled":3,"duplicate-object-label-normalized":2,"empty-section":2,"unused-floor":2,"ambiguous-section-ownership":4,"category-inventory-family-conflict":10};function xi(e){let t={...yi};for(let r of e){let a=r.severity==="error"?10:2;t[r.dimension]=Math.max(0,t[r.dimension]-(hi[r.code]??a))}let o=Object.values(t).reduce((r,a)=>r+a,0),n=o>=95?"A":o>=85?"B":o>=70?"C":o>=55?"D":"F";return{overall:o,dimensions:t,errorFree:e.every(r=>r.severity!=="error"),grade:n}}var vi=new Set(["unpriced-category","object-uncategorized"]);function Wn(e,t={}){let o=he(e),n=Xn(e,{maxInventory:t.maxInventory}).filter(d=>d.code!=="missing-zone-focal-point"||t.requireExplicitZoneFocals).map(d=>{let f=d.objectId?o.find(y=>y.objects.some(S=>S.id===d.objectId))?.id:void 0,m=d.code==="category-inventory-family-conflict",b=m?e.categories.find(y=>y.key===d.categoryKey):void 0;return D({...d,...m?{severity:"error",title:`Category \u201C${b?.label??d.categoryKey??"Unknown"}\u201D spans incompatible inventory types`,action:"Show the affected objects, then review the safe category split. The repair preserves price, ticket tiers, accessibility assignments, and source provenance."}:{},...t.requireExplicitZoneFocals&&d.code==="missing-zone-focal-point"?{severity:"error"}:{},...f?{floorId:f}:{},source:"structural",dimension:ai(d),autoFixable:m})}),r=ci(e,o,n),a=si(o),s=li(e,o,n);if(ui(e,o,n),gi(o,n),pi(e,o,n),bi(e,o,n),o.reduce((d,f)=>d+f.objects.filter(m=>m.type==="row"||m.type==="table"||m.type==="booth"||m.type==="gaArea").length,0)===0){let d=new Set(["missing-focal-point","no-bookables"]);for(let f=n.length-1;f>=0;f--)d.has(n[f].code)&&n.splice(f,1)}if(t.requirePricedInventory)for(let d=0;d<n.length;d++)vi.has(n[d].code)&&(n[d]={...n[d],severity:"error"});let u=n.filter(d=>d.severity==="error"),c=n.filter(d=>d.severity==="warning");return{issues:n,errors:u,warnings:c,metrics:{floors:o.length,objects:o.reduce((d,f)=>d+f.objects.length,0),seats:r.seats,bookableUnits:a.bookableUnits,inventoryByKind:a.inventoryByKind,categories:e.categories.length,freeTextLabels:s,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:xi(n),deferredRules:["rendered-row-label-decollision","rendered-bookable-state-contrast","section-focus-opacity-and-backdrop","24px-pointer-hit-target","reference-image-diff","sightline-blocked","ga-density-high"]}}function Ii(e,t){if(e.seatCount<2||e.seatSpacing>=t)return!1;let o=me(G(e));e.seatSpacing=N(t,3);let n=me(G(e));return e.origin.x=N(e.origin.x+o.x-n.x,3),e.origin.y=N(e.origin.y+o.y-n.y,3),!0}function Si(e,t){if(e.seatCount<2)return!1;let o=!1;if(e.shape==="round"){let n=K(e.seatArc??360,0,360),r=(n>=360?360/e.seatCount:n/(e.seatCount-1))*Math.PI/180;if(r>0){let a=t/(2*Math.sin(r/2)),s=Math.max(1,a-16);(e.radius??40)<s&&(e.radius=N(s,3),o=!0)}}else{let n=ve(e),r=Math.max(n.top,n.bottom),a=Math.max(n.left,n.right);r>1&&(e.width??80)/r<t&&(e.width=N(r*t,3),o=!0),a>1&&(e.height??50)/a<t&&(e.height=N(a*t,3),o=!0)}return o}function wi(e){return[oi,ri].map(o=>({color:o,minimum:Math.min(...e.map(n=>B(o,n)??0))})).sort((o,n)=>n.minimum-o.minimum)[0].color}function Zn(e,t,o){let n=Ge(e),r=0;for(let a of t)a.type==="row"?r+=G(a).filter(s=>It(n,s,o)).length:a.type==="table"?r+=H(a).filter(s=>It(n,s,o)).length:a.type==="text"&&a.id!==e.id&&eo(n,Ge(a),2)&&r++;return r}function Mi(e,t,o){if(Zn(e,t,o)===0)return!1;let r={...e.position},a=Math.max(12,e.fontSize*1.25),s=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let l=1;l<=12;l++)for(let[u,c]of s)if(e.position={x:N(r.x+u*a*l,3),y:N(r.y+c*a*l,3)},Zn(e,t,o)===0)return!0;return e.position=r,!1}function to(e,t={}){let o=JSON.parse(JSON.stringify(e)),n=Wn(o,t),r=[],a=mt(o);if(a.changed){o=a.doc;for(let f of a.changes){let m=a.before.find(y=>y.categoryKey===f.categoryKey),b=m?.families.map(y=>y.label).join(", ")??"inventory families";r.push({code:"category-inventory-family-conflict",objectId:m?.objectIds[0],message:`Split category \u201C${f.categoryLabel}\u201D across ${b}; preserved its commercial metadata and reassigned ${f.reassignments.length} affected object${f.reassignments.length===1?"":"s"}`})}}let s=St(o),l=2.5*s,u=he(o);for(let f of u)for(let m of f.objects)if(m.type==="row"){let b=m.seatSpacing;Ii(m,l)&&r.push({code:b<2*s?"seat-overlap":"seat-cramped",objectId:m.id,message:`Expanded ${m.id} to the ${N(l)}u target pitch while preserving its centre`})}else m.type==="table"&&Si(m,l)&&r.push({code:"seat-cramped",objectId:m.id,message:`Expanded ${m.id} so its perimeter seats meet the ${N(l)}u target pitch`});let c=o.theme?.background??qn;for(let f of u)for(let m of f.objects){if(m.type!=="text")continue;let b=m.color??o.theme?.textColor??Qn,y=m.fontSize>=18?3:4.5;(B(b,c)??0)<y&&(m.color=wi([c]),r.push({code:"text-contrast-low",objectId:m.id,message:`Changed ${m.id} to the highest-contrast black/white ink`}))}for(let f of u){let m=f.objects.filter(b=>b.type==="text");for(let b of m)Mi(b,f.objects,s)&&r.push({code:"label-collision",objectId:b.id,message:`Moved ${b.id} to the nearest collision-free deterministic label position`})}o.floors?.length&&(o.objects=o.floors[0].objects);let d=Wn(o,t);return{doc:o,changed:r.length>0,fixes:r,before:n,after:d}}function Ue(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function wt(e){return Ue(e).reduce((t,o)=>o.type==="row"?t+Ne(o):o.type==="table"?t+ln(o):o.type==="gaArea"?t+Math.max(0,Math.floor(o.capacity)):o.type==="booth"?t+1:t,0)}function Ci(e){let t={};for(let n of e.categories??[])t[n.key]=0;let o=(n,r)=>{r>0&&(t[n]=(t[n]??0)+r)};for(let n of Ue(e))if(n.type==="row")for(let r of G(n))o(r.categoryKey,1);else if(n.type==="table")if(n.bookAsWhole||n.variableOccupancy)o(n.categoryKey,Math.max(0,Math.round(n.seatCount)));else for(let r of H(n))o(r.categoryKey,1);else n.type==="gaArea"?o(n.categoryKey,Math.max(0,Math.floor(n.capacity))):n.type==="booth"&&o(n.categoryKey,1);return t}function oo(e){if(!e.template)return null;let t=Ue(e),o=t.filter(u=>u.type==="row"||u.type==="table"||u.type==="gaArea");if(!o.length)return null;let r=t.filter(u=>u.type==="booth").length+o.reduce((u,c)=>u+(c.type==="table"?2:1),0),a=wt(e),s=Math.max(r+1,Math.min(5e4,a*4)),l=[.5,1,1.5,2].map(u=>K(Math.round(a*u),r,s));return{family:e.template.family,display:e.template.family.replace(/-/g," ").replace(/\b\w/g,u=>u.toUpperCase()),min:r,max:s,presets:["S","M","L","XL"].map((u,c)=>({size:u,seats:l[c]}))}}function no(e){let t=G(e);return t.length?me(t):{...e.origin}}function ki(e,t){let o=oo(e);if(!o)return structuredClone(e);let n=structuredClone(e),r=Ue(n),a=r.filter(b=>b.type==="row"||b.type==="table"||b.type==="gaArea"),s=r.filter(b=>b.type==="booth").length,l=Math.max(o.min,Math.min(o.max,Math.round(t))),u=l-s,c=a.map((b,y)=>{let S=b.type==="gaArea"?Math.max(0,Math.floor(b.capacity)):b.seatCount,I=b.type==="table"?2:1;return{object:b,index:y,current:S,minimum:I,value:I,fraction:0}}),d=c.reduce((b,y)=>b+y.minimum,0),f=Math.max(0,u-d),m=c.reduce((b,y)=>b+Math.max(1,y.current-y.minimum),0);for(let b of c){let y=f*Math.max(1,b.current-b.minimum)/m,S=Math.floor(y);b.value+=S,b.fraction=y-S}f=u-c.reduce((b,y)=>b+y.value,0),c.sort((b,y)=>y.fraction-b.fraction||b.index-y.index);for(let b=0;b<f;b++)c[b%c.length].value++;c.sort((b,y)=>b.index-y.index);for(let b of c)if(b.object.type==="row"){let y=no(b.object);b.object.seatCount=b.value;let S=no(b.object);b.object.origin.x+=y.x-S.x,b.object.origin.y+=y.y-S.y}else if(b.object.type==="table"){let y=b.object;if(y.seatCountsBySide){let S=["top","bottom","left","right"],I=ve(y),C=S.reduce((M,w)=>M+I[w],0)||1,L=S.map((M,w)=>{let x=b.value*I[M]/C;return{side:M,index:w,value:Math.floor(x),fraction:x-Math.floor(x)}}),O=b.value-L.reduce((M,w)=>M+w.value,0);L.sort((M,w)=>w.fraction-M.fraction||M.index-w.index);for(let M=0;M<O;M++)L[M%L.length].value+=1;L.sort((M,w)=>M.index-w.index),y.seatCountsBySide={top:L[0].value,bottom:L[1].value,left:L[2].value,right:L[3].value},y.sides=S.filter(M=>y.seatCountsBySide[M]>0)}y.seatCount=b.value,y.overrides&&(y.overrides=y.overrides.filter(S=>S.index<b.value),y.overrides.length||delete y.overrides)}else b.object.capacity=b.value;return n.floors?.length&&(n.objects=n.floors[0].objects),n.template={family:n.template.family,targetSeats:l},n=to(n).doc,n.template={family:e.template.family,targetSeats:wt(n)},n}function fe(e){let t=Number(e.slice(e.lastIndexOf(":")+1));return Number.isFinite(t)?t:-1}function Ei(e,t,o){let n=new Map;for(let s of e){if(s.kind==="booth")continue;let l=n.get(s.rowId);l?l.push(s):n.set(s.rowId,[s])}let r=s=>o.has(s.id)||t(s.id)!=="free",a=[];for(let s of n.values())if(!(s.length<3)){s.sort((l,u)=>fe(l.id)-fe(u.id));for(let l=1;l<s.length-1;l++){let u=s[l];if(r(u))continue;let c=s[l-1],d=s[l+1];fe(u.id)-fe(c.id)!==1||fe(d.id)-fe(u.id)!==1||!r(c)||!r(d)||!o.has(c.id)&&!o.has(d.id)||a.push(u)}}return a}var Ct=1,kt=100;function ro(e,t){if(!Number.isInteger(t)||t<Ct||t>kt)return null;let o=e.rotation*Math.PI/180,n={x:Math.cos(o),y:Math.sin(o)},r={x:-n.y,y:n.x};return Array.from({length:t},(a,s)=>{let l=e.style==="intertwined"&&s%2===1?e.seatSpacing/2:0;return{type:"row",id:`__block_preview_${s}`,label:"",origin:{x:e.origin.x+r.x*s*e.rowGap+n.x*l,y:e.origin.y+r.y*s*e.rowGap+n.y*l},rotation:e.rotation,curve:e.curve,seatCount:e.seatsPerRow,seatSpacing:e.seatSpacing,categoryKey:"__preview__"}})}function Mt(e,t=e.rowCount){let o=ro(e,t);return o?.length?Y(o[o.length-1]):null}function Ri(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||e.rowGap<=0)return null;let o=Mt(e,1);if(!o)return null;let n=e.rotation*Math.PI/180,r={x:-Math.sin(n),y:Math.cos(n)},a=(t.x-o.x)*r.x+(t.y-o.y)*r.y,s=Math.max(Ct,Math.min(kt,Math.round(a/e.rowGap)+1)),l=Mt(e,s);return l?{rowCount:s,edgePoint:l}:null}function Li(e,t){return e.length!==t.rowCount?!1:[...e].sort((n,r)=>(n.rowBlockGeneration?.rowIndex??1/0)-(r.rowBlockGeneration?.rowIndex??1/0)).every((n,r)=>{let a=n.rowBlockGeneration;return a?.kind==="row-block-v1"&&a.groupId===t.groupId&&a.rowIndex===r&&a.signature===t.signature&&JSON.stringify(a)===JSON.stringify({...t,rowIndex:r})})}function io(e){let t=(e%360+360)%360,o=t>=180?t-360:t;return Object.is(o,-0)||Math.abs(o)<1e-9?0:o}var J=1,ee=300,Et=330;function ke(e){return e.seatCount>1?e.curve/(e.seatCount-1):0}function ao(e,t){let o=e.rotation*Math.PI/180,n=ke(e)*Math.PI/180,r,a;if(Math.abs(n)<1e-9)r=t*e.seatSpacing,a=0;else{let s=e.seatSpacing/(2*Math.sin(Math.abs(n)/2)),l=n*t;r=s*Math.sin(l),a=-s+s*Math.cos(l)}return{x:e.origin.x+r*Math.cos(o)-a*Math.sin(o),y:e.origin.y+r*Math.sin(o)+a*Math.cos(o)}}function Pi(e,t,o){let n=(e??[]).map(r=>({...r,index:r.index+t})).filter(r=>r.index>=0&&r.index<o);return n.length?n:void 0}function so(e,t){if(e.path||!Number.isInteger(t)||t<J||t>ee)return null;let o=ke(e);return{...e,seatCount:t,curve:o*(t-1)}}function co(e,t){if(e.path||!Number.isInteger(t)||t<J||t>ee)return null;let o=ke(e),n=e.seatCount-t,r=-n;return{...e,origin:ao(e,n),rotation:io(e.rotation-o*n),seatCount:t,curve:o*(t-1),overrides:Pi(e.overrides,r,t)}}function lo(e,t=e.seatCount){let o=so(e,t);return o?ao(o,t-1):null}function uo(e,t=e.seatCount){return co(e,t)?.origin??null}function Oi(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let o=ke(e),n=Math.abs(o)<1e-9?ee:Math.min(ee,Math.floor(Et/Math.abs(o))+1),r=null;for(let a=J;a<=Math.max(J,n);a+=1){let s=lo(e,a);if(!s)continue;let l=Math.hypot(s.x-t.x,s.y-t.y),u=o*(a-1);(!r||l<r.distance||l===r.distance&&a<r.seatCount)&&(r={seatCount:a,curve:u,endpoint:s,distance:l})}return r}function Ai(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let o=ke(e),n=Math.abs(o)<1e-9?ee:Math.min(ee,Math.floor(Et/Math.abs(o))+1),r=null;for(let a=J;a<=Math.max(J,n);a+=1){let s=uo(e,a);if(!s)continue;let l=Math.hypot(s.x-t.x,s.y-t.y),u=o*(a-1);(!r||l<r.distance||l===r.distance&&a<r.seatCount)&&(r={seatCount:a,curve:u,endpoint:s,distance:l})}return r}var pe=class extends Error{constructor(o,n){super(n);this.objectId=o;this.name="GroupedTableProjectionError"}};function Ti(e){let t=e.minOccupancy,o=e.maxOccupancy;if(!Number.isInteger(t)||!Number.isInteger(o)||t<1||o<t||o>e.seatCount)throw new pe(e.id,`Table "${e.label}" has invalid variable-occupancy bounds`);return{min:t,max:o}}function _i(e,t){if(t!==2)return[];let o=[];for(let n of Fe(e)){if(n.type!=="table"||!n.bookAsWhole&&!n.variableOccupancy)continue;if(n.bookAsWhole&&n.variableOccupancy)throw new pe(n.id,`Table "${n.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(n.seatCount)||n.seatCount<1||!n.label.trim())throw new pe(n.id,"Grouped tables require a label and at least one chair");let r=n.variableOccupancy?"variable":"whole",a=r==="variable"?Ti(n):{min:n.seatCount,max:n.seatCount};o.push({objectId:n.id,label:n.label,...n.displayLabel?{displayLabel:n.displayLabel}:{},...n.displayType?{displayType:n.displayType}:{},categoryKey:n.categoryKey,mode:r,capacity:n.seatCount,minOccupancy:a.min,maxOccupancy:a.max,chairs:H(n)})}return o}function po(e){return Array.isArray(e.objects)}function bo(e,t){if(t.seatsByLabel)return t.seatsByLabel;if(!po(e))throw new Error("ticketRestrictions: a categories-only chart document requires options.seatsByLabel");return new Map(un(e,{resolveEyeHeights:!1}).map(o=>[o.label,o]))}function mo(e){return{code:"ticket_option_not_applicable",labels:e,message:"That ticket choice is not available for the selected seat."}}function Ve(e,t){let o=e.applicability;return o?!(o.seatLabels?.length&&!o.seatLabels.includes(t.label)||o.accessibility?.length&&!o.accessibility.some(n=>t.accessibility?.includes(n))):!0}function ji(e,t){return(e.categories.find(o=>o.key===t.categoryKey)?.tiers??[]).filter(o=>Ve(o,t))}function Rt(e,t,o){let n=e.categories.find(a=>a.key===t.categoryKey)?.tiers;if(!n?.length)return{kind:"none"};let r=o==null?n.find(a=>Ve(a,t)):n.find(a=>a.id===o&&Ve(a,t));return r?{kind:"resolved",tier:r}:{kind:"invalid"}}function Ni(e,t){return(e.logicalRowId??e.rowId)===(t.logicalRowId??t.rowId)}function fo(e){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let t=e.id.slice(e.id.lastIndexOf(":")+1),o=Number(t);return Number.isInteger(o)?o:void 0}function Fi(e,t){if(!Ni(e,t))return!1;let o=fo(e),n=fo(t);return o!=null&&n!=null&&Math.abs(o-n)===1}function go(e,t,o={}){if(!t.length)return null;let n=bo(e,o),r=t.flatMap(l=>{let u=n.get(l.label);return u?[{selection:l,seat:u}]:[]}),a=r.map(({seat:l})=>l).filter(l=>l.accessibility?.includes("wheelchair")),s=[];for(let{selection:l,seat:u}of r){let c=Rt(e,u,l.tierId),d=c.kind==="resolved"?c.tier:void 0;(u.accessibility?.includes("companion")||d?.restriction==="companion")&&!a.some(m=>m.id!==u.id&&Fi(u,m))&&s.push(u.label)}return s.length?{code:"companion_pair_required",labels:s,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function Di(e,t,o={}){if(!t.length)return null;let n=bo(e,o),r=new Set(e.categories.filter(l=>l.notForSale).map(l=>l.key)),a=[],s=[];for(let l of t){let u=n.get(l.label);if(!u)continue;if(r.has(u.categoryKey)){a.push(u.label);continue}Rt(e,u,l.tierId).kind==="invalid"&&s.push(u.label)}return a.length?{code:"not_for_sale",labels:a,message:"These seats are not for sale."}:s.length?mo(s):go(e,t,{seatsByLabel:n})}0&&(module.exports={CATEGORY_INVENTORY_FAMILIES,DEFAULT_EVENT_INVENTORY_LIMIT,GA_UNIT_LABEL_PREFIX,GroupedTableProjectionError,LARGE_VENUE_INVENTORY_MODULE,MAX_DIRECT_ROW_SWEEP,MAX_EVENT_INVENTORY,MAX_GA_CAPACITY,MAX_ROW_BLOCK_ROWS,MAX_ROW_SEATS,MIN_ROW_BLOCK_ROWS,MIN_ROW_SEATS,applicableTicketTiers,capacityControl,categoryCapacity,chartCapacity,companionSelectionIssue,describeCategoryInventoryConflict,effectiveSeatOwnerCategoryCounts,eventInventoryLimitFor,gaAreasOf,gaInventorySegments,gaUnitLabel,gaUnitLabels,groupedTableInventory,growJoinedGAInventory,inspectCategoryInventoryConflicts,intactRowBlockMembers,isFullChartDoc,isGaUnitLabel,pickBestAvailable,pickBestAvailableInventory,remediateCategoryInventoryConflicts,resizeChartCapacity,resolveRowBlockCount,resolveRowStartCapacity,resolveRowTerminalCapacity,resolveTicketTierForSeat,rowBlockEdgePoint,rowBlockPreviewRows,rowStartEndpoint,rowTerminalEndpoint,rowWithStartCapacity,rowWithTerminalCapacity,strandedSingles,ticketOptionNotApplicableIssue,ticketSelectionIssue,ticketTierAppliesToSeat,validGAInventorySegments});
1
+ "use strict";var We=Object.defineProperty;var jo=Object.getOwnPropertyDescriptor;var No=Object.getOwnPropertyNames;var Fo=Object.prototype.hasOwnProperty;var Do=(e,t)=>{for(var o in t)We(e,o,{get:t[o],enumerable:!0})},$o=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of No(t))!Fo.call(e,i)&&i!==o&&We(e,i,{get:()=>t[i],enumerable:!(n=jo(t,i))||n.enumerable});return e};var Bo=e=>$o(We({},"__esModule",{value:!0}),e);var ua={};Do(ua,{CATEGORY_INVENTORY_FAMILIES:()=>Ve,DEFAULT_EVENT_INVENTORY_LIMIT:()=>Fe,GA_UNIT_LABEL_PREFIX:()=>Ke,GroupedTableProjectionError:()=>ge,LARGE_VENUE_INVENTORY_MODULE:()=>rt,MAX_DIRECT_ROW_SWEEP:()=>Pt,MAX_EVENT_INVENTORY:()=>sn,MAX_GA_CAPACITY:()=>J,MAX_ONE_PARTY_GUESTS:()=>ee,MAX_ROW_BLOCK_ROWS:()=>Lt,MAX_ROW_SEATS:()=>oe,MIN_ROW_BLOCK_ROWS:()=>Ot,MIN_ROW_SEATS:()=>ne,ONE_PARTY_LIMIT_MESSAGE:()=>zi,applicableTicketTiers:()=>aa,behindStageLabels:()=>jt,capacityControl:()=>So,categoryCapacity:()=>Zr,chartCapacity:()=>Rt,companionSelectionIssue:()=>To,describeCategoryInventoryConflict:()=>xt,effectiveSeatOwnerCategoryCounts:()=>ke,eventInventoryLimitFor:()=>cn,gaAreasOf:()=>Wi,gaBoxBounds:()=>Hi,gaBoxMode:()=>Z,gaInventorySegments:()=>lt,gaUnitLabel:()=>In,gaUnitLabels:()=>ut,gaUnitLabelsForModel:()=>dt,gaWheelchairPlaceCount:()=>wn,gaWheelchairUnitLabels:()=>Xi,groupedTableInventory:()=>ra,growJoinedGAInventory:()=>Yi,inspectCategoryInventoryConflicts:()=>Ce,intactRowBlockMembers:()=>ea,isFullChartDoc:()=>Oo,isGaUnitLabel:()=>W,pickBestAvailable:()=>Ft,pickBestAvailableInventory:()=>Go,remediateCategoryInventoryConflicts:()=>vt,resizeChartCapacity:()=>qr,resolveRowBlockCount:()=>Jr,resolveRowStartCapacity:()=>oa,resolveRowTerminalCapacity:()=>na,resolveTicketTierForSeat:()=>Tt,rowBlockEdgePoint:()=>Et,rowBlockPreviewRows:()=>Io,rowStartEndpoint:()=>Ro,rowTerminalEndpoint:()=>Ao,rowWithStartCapacity:()=>ko,rowWithTerminalCapacity:()=>Co,strandedSingles:()=>Qr,ticketOptionNotApplicableIssue:()=>Po,ticketSelectionIssue:()=>la,ticketTierAppliesToSeat:()=>Ye,validGAInventorySegments:()=>Ue});module.exports=Bo(ua);function _t(e){return e.sectionId?`s:${e.sectionId}`:`r:${e.logicalRowId??e.rowId}`}function jt(e,t){let o=new Set,n=new Map;for(let i of e){let r=i.focalPoint??t,s=`${r.x},${r.y}`,l=n.get(s);l||(l={focal:r,seats:[]},n.set(s,l)),l.seats.push(i)}for(let{focal:i,seats:r}of n.values()){let s=Pe(r),l=s.x-i.x,u=s.y-i.y,c=Math.hypot(l,u),d=0;for(let S of r)d=Math.max(d,Math.abs(S.x-i.x),Math.abs(S.y-i.y));let b=Math.max(d,1)*1e-6;if(!(c>b))continue;let p=0,m=new Set;for(let S of r)((S.x-i.x)*l+(S.y-i.y)*u)/c<-b&&(p+=1,m.add(_t(S)));if(!m.size||p*10>r.length)continue;let g=r.filter(S=>m.has(_t(S)));if(!(g.length*4>r.length))for(let S of g)o.add(S.label)}return o}function Ze(e,t){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let o=e.id.lastIndexOf(":");if(o<0)return t;let n=Number(e.id.slice(o+1));return Number.isFinite(n)?n:t}function ye(e,t){let o=e.x-t.x,n=e.y-t.y;return o*o+n*n}function Pe(e){let t=0,o=0;for(let n of e)t+=n.x,o+=n.y;return{x:t/e.length,y:o/e.length}}function Nt(e,t){return e.find(o=>o.focalPoint)?.focalPoint??t}function qe(e){return e.commercial?.premium===!0}function Ft(e,t,o){let n=Math.floor(o.qty);if(!Number.isFinite(n)||n<=0)return{labels:[],reason:"sold_out"};let{categoryKey:i,zoneId:r,focal:s,preferPremium:l,preferNearest:u,preferredRowIds:c,accessibility:d,requireContiguous:b}=o,p=o.preferAisle&&o.aisleLabels?.size?o.aisleLabels:null,m=x=>p&&!x.some(w=>p.has(w.label))?1:0,g=new Map,S=[];if(e.forEach((x,w)=>{let a=t.has(x.label)&&(!i||x.categoryKey===i)&&(!r||x.zoneId===r)&&(!d||d.some(y=>x.accessibility?.includes(y))),E=x.logicalRowId??x.rowId,f=g.get(E);f||(f=[],g.set(E,f)),f.push({seat:x,index:Ze(x,w),elig:a}),a&&S.push(x)}),S.length===0)return{labels:[],reason:"sold_out"};let I=!i&&!r&&!u?jt(e,s):new Set,A=x=>I.size?x.reduce((w,a)=>w+(I.has(a.label)?1:0),0):0,R=new Map([...g].map(([x,w])=>[x,Pe(w.map(a=>a.seat))])),O=(c??[]).map(x=>R.get(x)).filter(x=>!!x),P=x=>{let w=R.get(x);return!w||!O.length?0:Math.min(...O.map(a=>ye(w,a)))},M=null,v=x=>{if(!M)return!0;if(l&&x.nonPremium!==M.nonPremium)return x.nonPremium<M.nonPremium;if(u&&x.rowD2!==M.rowD2)return x.rowD2<M.rowD2;if(u&&x.d2!==M.d2)return x.d2<M.d2;if(x.behind!==M.behind)return x.behind<M.behind;if(x.noAisle!==M.noAisle)return x.noAisle<M.noAisle;if(x.orphan!==M.orphan)return x.orphan<M.orphan;if(x.d2!==M.d2)return x.d2<M.d2;let w=x.rowId.localeCompare(M.rowId);return w!==0?w<0:x.startIndex<M.startIndex};for(let[x,w]of g){let a=[...w].sort((f,y)=>f.index-y.index),E=0;for(;E<a.length;){if(!a[E].elig){E++;continue}let f=E;for(;f<a.length&&a[f].elig&&(f===E||a[f].index===a[f-1].index+1);)f++;let y=f-E;for(let h=0;h+n<=y;h++){let L=h,k=y-(h+n),T=L===1||k===1?1:0,_=a.slice(E+h,E+h+n).map(B=>B.seat),j={labels:_.map(B=>B.label),seats:_,rowId:x,startIndex:a[E+h].index,orphan:T,nonPremium:l?_.reduce((B,ie)=>B+(qe(ie)?0:1),0):0,behind:A(_),noAisle:m(_),rowD2:P(x),d2:ye(Pe(_),u?s:Nt(_,s))};v(j)&&(M=j)}E=f}}return M?{labels:M.labels}:b?{labels:[],reason:S.length?"not_enough_together":"sold_out"}:S.length<n?{labels:[],reason:"not_enough_together"}:{labels:S.map((x,w)=>({seat:x,i:w,rowD2:P(x.logicalRowId??x.rowId),d2:ye(x,u?s:x.focalPoint??s)})).sort((x,w)=>{if(l){let y=qe(x.seat)?0:1,h=qe(w.seat)?0:1;if(y!==h)return y-h}if(u&&x.rowD2!==w.rowD2)return x.rowD2-w.rowD2;let a=I.has(x.seat.label)?1:0,E=I.has(w.seat.label)?1:0;if(a!==E)return a-E;if(p){let y=p.has(x.seat.label)?0:1,h=p.has(w.seat.label)?0:1;if(y!==h)return y-h}if(x.d2!==w.d2)return x.d2-w.d2;let f=(x.seat.logicalRowId??x.seat.rowId).localeCompare(w.seat.logicalRowId??w.seat.rowId);return f!==0?f:Ze(x.seat,x.i)-Ze(w.seat,w.i)}).slice(0,n).map(x=>x.seat.label)}}function Go(e,t,o,n){let i=Math.floor(n.qty),r=Ft(e,o,n),l=t.filter(b=>b.bookingMode==="whole"&&b.capacity===i&&o.has(b.label)&&(!n.categoryKey||b.categoryKey===n.categoryKey)&&(!n.zoneId||b.zoneId===n.zoneId)&&!n.accessibility).map(b=>({table:b,d2:ye(b.center,n.preferNearest?n.focal:b.focalPoint??n.focal)})).sort((b,p)=>b.d2-p.d2||b.table.label.localeCompare(p.table.label))[0];if(!l)return r;if(!r.labels.length)return{labels:[l.table.label]};if(n.preferAisle&&n.aisleLabels&&r.labels.some(b=>n.aisleLabels.has(b)))return r;let u=new Map(e.map(b=>[b.label,b])),c=r.labels.map(b=>u.get(b)).filter(b=>!!b),d=c.length?ye(Pe(c),Nt(c,n.focal)):Number.POSITIVE_INFINITY;return l.d2<d?{labels:[l.table.label]}:r}var Dt=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Ko(e,t){let o=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,o.length);let n=Math.max(1,Math.floor(t/Dt(e))),i=0;for(let r of o){if(!r.length){i+=1;continue}let s=0;for(let l of r.split(/\s+/)){let u=l.length;s&&s+1+u<=n?s+=1+u:(i+=Math.max(1,Math.ceil(u/n)),s=u%n)}}return Math.max(1,i)}function $t(e){let t=e.background?.padding??0,o=e.text.split(/\r?\n/),n=Math.max(1,...o.map(l=>l.length))*Dt(e),i=e.width??n+t*2,r=Math.max(1,i-t*2),s=Ko(e,r);return{width:i,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var Uo=Math.PI/180;function V(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Vo(e,t,o){let n=Math.cos(o),i=Math.sin(o),r=e.x-t.x,s=e.y-t.y;return{x:t.x+r*n-s*i,y:t.y+r*i+s*n}}function Bt(e,t){return Vo(e,{x:0,y:0},t*Uo)}function he(e){let t=0,o=0;for(let i of e)t+=i.x,o+=i.y;let n=e.length||1;return{x:t/n,y:o/n}}function Gt(e,t){let o=1-t,n=o*o*o,i=3*o*o*t,r=3*o*t*t,s=t*t*t;return{x:n*e.start.x+i*e.control1.x+r*e.control2.x+s*e.end.x,y:n*e.start.y+i*e.control1.y+r*e.control2.y+s*e.end.y}}function Kt(e,t,o=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[Gt(e,.5)];let n=Array.from({length:o+1},(u,c)=>Gt(e,c/o)),i=new Float64Array(n.length);for(let u=1;u<n.length;u+=1){let c=n[u].x-n[u-1].x,d=n[u].y-n[u-1].y;i[u]=i[u-1]+Math.hypot(c,d)}let r=i[i.length-1];if(r<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let u=0;u<t;u+=1){let c=r*u/(t-1);for(;l<i.length-1&&i[l]<c;)l+=1;let d=i[l-1],b=i[l],p=b===d?0:(c-d)/(b-d);s.push({x:n[l-1].x+(n[l].x-n[l-1].x)*p,y:n[l-1].y+(n[l].y-n[l-1].y)*p})}return s}function K(e,t,o){return Math.max(t,Math.min(o,e))}var re=Math.PI*2;function xe(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function zo(e,t,o){let n=t-e;if(o){for(;n<0;)n+=re;for(;n>=re;)n-=re}else{for(;n>0;)n-=re;for(;n<=-re;)n+=re}return n}function Qe(e){if(e.version!==1||e.closed!==!0||!xe(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let o of e.segments){if(!o||!xe(o.end))return!1;if(o.kind==="line"){if(V(t,o.end)<=1e-9)return!1}else if(o.kind==="bezier"){if(!xe(o.control1)||!xe(o.control2)||V(t,o.end)<=1e-9)return!1}else if(o.kind==="arc"){if(!xe(o.center)||!Number.isFinite(o.radius)||o.radius<=1e-6||Math.abs(V(t,o.center)-o.radius)>Math.max(1e-4,o.radius*1e-4)||Math.abs(V(o.end,o.center)-o.radius)>Math.max(1e-4,o.radius*1e-4)||V(t,o.end)<=1e-9)return!1}else return!1;t=o.end}return V(t,e.start)<=1e-4}function Ho(e,t,o){let n=1-o;return{x:n**3*e.x+3*n**2*o*t.control1.x+3*n*o**2*t.control2.x+o**3*t.end.x,y:n**3*e.y+3*n**2*o*t.control1.y+3*n*o**2*t.control2.y+o**3*t.end.y}}function Ut(e,t=2){if(!Qe(e))throw new Error("Section outline path is invalid");let o=Math.max(.25,t),n=[{...e.start}],i=e.start;for(let r of e.segments){if(r.kind==="line")n.push({...r.end});else if(r.kind==="arc"){let s=Math.atan2(i.y-r.center.y,i.x-r.center.x),l=Math.atan2(r.end.y-r.center.y,r.end.x-r.center.x),u=zo(s,l,r.clockwise),c=Math.max(2,Math.ceil(Math.abs(u)*r.radius/o));for(let d=1;d<=c;d+=1){let b=s+u*d/c;n.push({x:r.center.x+Math.cos(b)*r.radius,y:r.center.y+Math.sin(b)*r.radius})}}else{let s=V(i,r.control1)+V(r.control1,r.control2)+V(r.control2,r.end),l=Math.max(2,Math.ceil(s/o));for(let u=1;u<=l;u+=1)n.push(Ho(i,r,u/l))}i=r.end}return V(n[n.length-1],n[0])<=1e-4&&n.pop(),n}var xa=4/3;function Vt(e){let t=new Map,o=new Map;for(let n of e){if(n.type!=="row"||!n.segmentedRow)continue;let i=o.get(n.segmentedRow.groupId)??[];i.push(n),o.set(n.segmentedRow.groupId,i)}for(let[n,i]of o){let r=i.slice().sort((p,m)=>p.segmentedRow.componentIndex-m.segmentedRow.componentIndex),s=r[0]?.segmentedRow?.componentCount??0,l=r[0]?.segmentedRow;if(!l||!(s>=2&&r.length===s&&l?.boundaryBefore==="start"&&r.every((p,m)=>p.segmentedRow?.kind==="segmented-row-v1"&&p.segmentedRow.groupId===n&&p.segmentedRow.componentCount===s&&p.segmentedRow.componentIndex===m&&p.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(m===0?p.segmentedRow.boundaryBefore==="start":p.segmentedRow.boundaryBefore!=="start")&&p.segmentedRow.displayLabel===l.displayLabel)))continue;let c=r.reduce((p,m)=>p+m.seatCount,0),d=0,b=0;for(let p of r)p.segmentedRow.boundaryBefore==="break"&&(d+=1),t.set(p.id,{groupId:n,adjacencyOffset:d,displayOffset:b,displayLabel:l.displayLabel,totalSeats:c,canonical:r[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),d+=p.seatCount,b+=p.seatCount}return t}var Xo="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Yo="abcdefghijklmnopqrstuvwxyz";function Wo(e,t){let o=t.length,n=e+1,i="";for(;n>0;){n-=1;let r=n%o;i=t[r]+i,n=Math.floor(n/o)}return i}function ve(e,t=!1){let o=t?Yo:Xo;return Wo(Math.max(0,Math.floor(e)-1),o)}var Zo=[[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 zt(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),o="";for(let[n,i]of Zo)for(;t>=n;)o+=i,t-=n;return o}function qo(e){let t=new Array(e);return Array.from({length:e},(o,n)=>n).sort((o,n)=>Math.abs(2*o-(e-1))-Math.abs(2*n-(e-1))||o-n).forEach((o,n)=>t[o]=n),t}function Te(e,t){let o=e.seatLabelStart??1,n=e.seatNumbering?.direction??"ltr",i=e.seatNumbering?.step??1,r=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",l=e.seatNumbering?.endAt,u=e.seatCount;if(r==="updown"||r==="updown-descending"){let m=Math.ceil(u/2),g=r==="updown"?t<m?o+2*t:o-1+2*(u-t):t<m?o+2*(m-1-t):o+1+2*(t-m);return`${s}${g}`}let c=r==="odd"||r==="even"?2:i,d=l!=null&&Number.isFinite(l)?l-(u-1)*c:o,b=n==="center"?qo(u)[t]:n==="rtl"?u-1-t:t,p;switch(r){case"odd":{let m=d%2===1?d:d+1;p=String(m+b*2);break}case"even":{let m=d%2===0?d:d+1;p=String(m+b*2);break}case"roman":p=zt(d+b*i);break;case"letters-upper":p=ve(d+b*i,!1);break;case"letters-lower":p=ve(d+b*i,!0);break;default:p=String(d+b*i);break}return`${s}${p}`}function Qo(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function _e(e,t,o){return o?.label??`${e.seatLabelBase??e.label}-${Te(e,t)}`}function Je(e,t,o,n){if(n?.displayLabel)return n.displayLabel;if(e.seatDisplayLabelMode==="number")return Te(e,t);if(!o)return`${e.displayLabel||e.label}-${Te(e,t)}`;let i=Qo(o),r=o.displayOffset+t;return`${o.displayLabel}-${Te(i,r)}`}var Ht=999,Jo=["clockwise","anticlockwise"],ei=["table-number","number","letter"];function Xt(e,t){return`${e.label}-${t+1}`}function ti(e,t,o){return e?.direction==="anticlockwise"?Math.max(0,t-1-o):o}function ni(e,t){let o=e.chairNumbering,n=o?.start??1,i=ti(o,Math.max(0,Math.round(e.seatCount)),t);return o?.format==="letter"?ve(Math.max(1,n)+i):String(n+i)}function Yt(e,t){let o=ni(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${o}`:o}function Wt(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,o=Object.keys(t).filter(n=>!["start","direction","format"].includes(n));return o.length?`chairNumbering has unsupported field(s): ${o.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>Ht)?`chairNumbering.start must be a whole number from 0 to ${Ht}`:t.direction!==void 0&&!Jo.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!ei.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}var ae=.02291666666666667,Aa=1/ae,oi=58,Zt=oi*ae,tt=0,se=3,Q=0,X=120,je=0,Ne=45,nt=7,ce=1.2;function et(e,t,o,n){return Number.isFinite(e)?Math.max(t,Math.min(o,e)):n}function ii(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=nt?e:se}function Se(e,t={}){let o=et(t.floorBaseHeightM,Q,X,0),n=Math.min(X,o+ii(e.elevation)*Zt),i=e.height===void 0?n:et(e.height,Q,X,n),r=et(e.rake,je,Ne,0);return{height:i,rake:r}}function qt(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 Qt(e,t,o){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,o-e[0].y);let n=1/0;for(let i=0;i+1<e.length;i++){let r=e[i],s=e[i+1],l=s.x-r.x,u=s.y-r.y,c=l*l+u*u,d=c>1e-12?((t-r.x)*l+(o-r.y)*u)/c:0;d<0?d=0:d>1&&(d=1);let b=t-(r.x+d*l),p=o-(r.y+d*u);if(Math.abs(b)>=n||Math.abs(p)>=n)continue;let m=Math.hypot(b,p);m<n&&(n=m)}return n}function ri(e){let t=0,o=0;for(let r of e)t+=r.x,o+=r.y;let n=e.length||1;t/=n,o/=n;let i=0;for(let r of e){let s=Math.hypot(r.x-t,r.y-o);s>i&&(i=s)}return{cx:t,cy:o,r:i}}function Jt(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ot(e,t){let o=1/0;for(let n of qt(e)){let i=Qt(t,n.x,n.y);i<o&&(o=i)}for(let n of qt(t)){let i=Qt(e,n.x,n.y);i<o&&(o=i)}return o}function ai(e,t){if(e.length<3)return{pts:e,seatIndices:t};let o=0,n=0;for(let d of e)o+=d.x,n+=d.y;o/=e.length,n/=e.length;let i=-1,r=e[0];for(let d of e){let b=Math.hypot(d.x-o,d.y-n);b>i&&(i=b,r=d)}let s=r.x-o,l=r.y-n,u=Math.hypot(s,l);u>1e-9?(s/=u,l/=u):(s=1,l=0);let c=e.map((d,b)=>({p:d,i:b,t:(d.x-o)*s+(d.y-n)*l})).sort((d,b)=>d.t-b.t);return{pts:c.map(d=>d.p),seatIndices:c.map(d=>t[d.i])}}function si(e){let t=e.length;if(t<3)return null;let o=0,n=0;for(let R of e)o+=R.x,n+=R.y;o/=t,n/=t;let i=0,r=0,s=0,l=0,u=0,c=0,d=0;for(let R of e){let O=R.x-o,P=R.y-n;i+=O*O,s+=P*P,r+=O*P,l+=O*O*O,u+=P*P*P,c+=O*P*P,d+=P*O*O}let b=i*s-r*r;if(Math.abs(b)<1e-9)return null;let p=(l+c)/2,m=(u+d)/2,g=(p*s-m*r)/b,S=(m*i-p*r)/b,I=g+o,A=S+n;return!Number.isFinite(I)||!Number.isFinite(A)?null:{cx:I,cy:A}}var ci=.15;function li(e){if(e.length<2)return null;let t=e.map(M=>{let v=0,C=0;for(let x of M.pts)v+=x.x,C+=x.y;return{x:v/M.pts.length,y:C/M.pts.length}}),o=0,n=0;for(let M of t)o+=M.x,n+=M.y;o/=t.length,n/=t.length;let i=0,r=0,s=0;for(let M of t){let v=M.x-o,C=M.y-n;i+=v*v,r+=v*C,s+=C*C}let l=i+s,u=i*s-r*r,c=l/2+Math.sqrt(Math.max(0,l*l/4-u)),d,b;Math.abs(r)>1e-12?(d=c-s,b=r):i>=s?(d=1,b=0):(d=0,b=1);let p=Math.hypot(d,b);if(!(p>1e-12))return null;d/=p,b/=p;let m=0,g=0,S=0;for(let M of e){if(M.pts.length<2)continue;let v=M.pts[0],C=M.pts[M.pts.length-1],x=C.x-v.x,w=C.y-v.y,a=Math.hypot(x,w);if(!(a>1e-9))continue;let E=x/a,f=w/a;m+=(E*E-f*f)*a,g+=2*E*f*a,S+=a}if(S>0&&Math.hypot(m,g)>=di*S){let M=Math.atan2(g,m)/2,v=Math.cos(M),C=Math.sin(M);Math.abs(d*v+b*C)>fi&&(d=-C,b=v)}let I=1/0,A=-1/0,R=[];for(let M of e){let v=1/0,C=-1/0;for(let x of M.pts){let w=x.x*d+x.y*b;w<v&&(v=w),w>C&&(C=w),w<I&&(I=w),w>A&&(A=w)}R.push(C-v)}let O=A-I;return O>1e-9?(R.sort((M,v)=>M-v),R[Math.min(R.length-1,Math.floor(R.length*.9))]/O<=ui?{x:d,y:b}:null):null}var ui=.35,di=.8,fi=.7;function en(e,t,o,n){let i=new Map;for(let v of o){let C=t[v],x=C.rowId||`__seat-${v}`,w=i.get(x);w||(w={pts:[],idx:[]},i.set(x,w)),w.pts.push({x:C.x,y:C.y}),w.idx.push(v)}if(!i.size)return{sectionId:e,rows:[],blockCount:0};let r=[];for(let[v,C]of i){let x=ai(C.pts,C.idx),w=0;for(let a of x.pts)w+=Math.hypot(a.x-n.x,a.y-n.y);r.push({id:v,pts:x.pts,seatIndices:x.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:w/x.pts.length})}let s=r.map(v=>ri(v.pts)),l=r.length<=256?r.length*(r.length-1)/2:0,u=l?new Float64Array(l):null;u?.fill(Number.NaN);let c=u?new Map(r.map((v,C)=>[v,C])):null,d=(v,C)=>(v>C&&([v,C]=[C,v]),v*(2*r.length-v-1)/2+(C-v-1)),b=(v,C)=>{if(!u)return ot(r[v].pts,r[C].pts);let x=d(v,C),w=u[x];if(!Number.isNaN(w))return w;let a=ot(r[v].pts,r[C].pts);return u[x]=a,a},p=(v,C)=>c?b(c.get(v),c.get(C)):ot(v.pts,C.pts),m=[];for(let v=0;v<r.length;v++){let C=1/0;for(let x=0;x<r.length;x++){if(v===x||Jt(s[v],s[x])>=C)continue;let w=b(v,x);w<C&&(C=w)}Number.isFinite(C)&&m.push(C)}m.sort((v,C)=>v-C);let g=m.length?m[Math.floor(m.length/2)]:1,S=Math.max(g*1.8,1e-6),I=r.map(()=>[]);for(let v=0;v<r.length;v++)for(let C=v+1;C<r.length;C++)Jt(s[v],s[C])>S||b(v,C)<=S&&(I[v].push(C),I[C].push(v));let A=0;for(let v=0;v<r.length;v++){if(r[v].blockId!==-1)continue;let C=A++,x=[v];for(r[v].blockId=C;x.length;){let w=x.pop();for(let a of I[w])r[a].blockId===-1&&(r[a].blockId=C,x.push(a))}}let R=new Map;for(let v of r){let C=R.get(v.blockId)??[];C.push(v),R.set(v.blockId,C)}let O=[];for(let v of r){if(v.pts.length<4)continue;let C=si(v.pts);C&&(!Number.isFinite(C.cx)||!Number.isFinite(C.cy)||O.push({x:C.cx,y:C.cy}))}let P=O.length>=2?(()=>{let v=O.map(w=>w.x).sort((w,a)=>w-a),C=O.map(w=>w.y).sort((w,a)=>w-a),x=Math.floor(O.length/2);return{cx:v[x],cy:C[x]}})():null;if(P){let v=f=>Math.hypot(f.x-P.cx,f.y-P.cy),C=1/0,x=-1/0,w=[];for(let f of r){let y=1/0,h=-1/0;for(let L of f.pts){let k=v(L);k<y&&(y=k),k>h&&(h=k)}w.push(h-y),y<C&&(C=y),h>x&&(x=h)}let a=x-C;w.sort((f,y)=>f-y);let E=w[Math.min(w.length-1,Math.floor(w.length*.9))];if(a>1e-9&&E/a<=ci){let f=r.map(F=>{let Le=0;for(let _o of F.pts)Le+=v(_o);return{row:F,radius:Le/F.pts.length}}),y=0,h=0;for(let F of f)y+=F.radius,h+=F.row.focalDistance;y/=f.length,h/=f.length;let L=0;for(let F of f)L+=(F.radius-y)*(F.row.focalDistance-h);if(L<0)for(let F of f)F.radius=-F.radius;let T=1/0;for(let F of f)F.radius<T&&(T=F.radius);f.sort((F,Le)=>F.radius-Le.radius);let _=-1,j=-1/0,B=a/Math.max(1,f.length)*.5,ie=[];for(let F of f)F.radius-j>B&&(_++,j=F.radius),F.row.ordinal=_,F.row.blockDepth=F.radius-T,ie.push(F.row);return{sectionId:e,rows:ie,blockCount:A}}}let M=[];for(let[,v]of R){let C=li(v);if(C){let x=f=>{let y=0;for(let h of f.pts)y+=h.x*C.x+h.y*C.y;return y/f.pts.length};v.sort((f,y)=>x(f)-x(y)),v.length>=2&&v[0].focalDistance>v[v.length-1].focalDistance&&v.reverse();let w=[],a=g*.5;for(let f of v){let y=w[w.length-1];y&&Math.abs(x(f)-x(y[0]))<a?y.push(f):w.push([f])}let E=0;for(let f=0;f<w.length;f++){if(f>0){let y=1/0;for(let h of w[f-1])for(let L of w[f])y=Math.min(y,p(h,L));E+=y}for(let y of w[f])y.ordinal=f,y.blockDepth=E,M.push(y)}}else{let x=1/0;for(let w of v)w.focalDistance<x&&(x=w.focalDistance);v.sort((w,a)=>w.focalDistance-a.focalDistance);for(let w=0;w<v.length;w++)v[w].ordinal=w,v[w].blockDepth=Math.max(0,v[w].focalDistance-x),M.push(v[w])}}return{sectionId:e,rows:M,blockCount:A}}var bi=/^\d{4}-\d{2}-\d{2}$/;function mi(e){let t=Date.parse(e);return Number.isFinite(t)?bi.test(e)?t+864e5:t:null}function pi(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let n=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(n)&&(t instanceof Date?t.getTime():t)<=n+366*864e5}let o=mi(e.validUntil);return o===null?!1:(t instanceof Date?t.getTime():t)<o}function gi(e,t,o){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==o)}function yi(e){return e.status!=="draft"&&e.status!=="retracted"}function hi(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 tn(e,t={}){return!!e&&yi(e)&&gi(e,t.activeConfigurationId,t.activeConfigurationVersion)&&hi(e,t.activeBasisSha256)&&pi(e,t.now)}function nn(e){return!!e.referenceImage?.assetId&&!!e.backgroundImage?.assetId&&e.referenceImage.assetId!==e.backgroundImage.assetId}var xi=36,vi=160;function on(e,t=360){let o=K(Math.round(Number.isFinite(e)?e:1),1,40),n=K(Number.isFinite(t)?t:360,120,360);return Math.round(K(o*4*(360/n),xi,vi))}var Si=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function Ii(e){return!!e&&Si.has(e)}var rn=1.1;var _a=Math.PI*2;var ja=(()=>{let t={x:0,y:52},o=25,n={x:70,y:t.y-70},i=(n.x*n.x+n.y*n.y-4900)/(2*(n.y+70)),r=i+70,s=[],l=Math.atan2(n.y-i,n.x),u=Math.atan2(n.y-i,-n.x);for(let c=0;c<=24;c++){let d=l+(u-l)*c/24;s.push({x:r*Math.cos(d),y:i+r*Math.sin(d)})}return{half:70,home:t,backstop:o,fence:s}})();function an(e){return Ii(e)}var wi=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Mi=/[\s"'<>`\\]/;function it(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return wi.test(e);if(Mi.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}var sn=2e5,Fe=1e5,rt="large_venue_inventory";function cn(e){return e?.includes(rt)?2e5:1e5}function Ci(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,o=e.y,n=e.width,i=e.height;return[{x:t,y:o},{x:t+n,y:o},{x:t+n,y:o+i},{x:t,y:o+i}]}function ki(e,t,o){let n=o*Math.PI/180,i=Math.cos(n),r=Math.sin(n),s=e.x-t.x,l=e.y-t.y;return{x:t.x+s*i-l*r,y:t.y+s*r+l*i}}function ln(e){let t=Ci(e);if(!t||t.length<2)return null;let o=e.rotation??0,n=Math.abs(o)<1e-6?t:t.map(u=>ki(u,{x:t.reduce((c,d)=>c+d.x,0)/t.length,y:t.reduce((c,d)=>c+d.y,0)/t.length},o)),i=1/0,r=1/0,s=-1/0,l=-1/0;for(let u of n)i=Math.min(i,u.x),r=Math.min(r,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return!Number.isFinite(i)||s-i<1e-6||l-r<1e-6?null:{minX:i,minY:r,maxX:s,maxY:l}}var Ai=5,Ri=3,Ei=.92,Oi=1.9,Li=2,Pi=.6,Ti=1,_i=.06;function ji(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?rn:an(e.stageKind)?_i:Ti}function un(e){let t=1/0,o=1/0,n=-1/0,i=-1/0,r=-1/0;for(let s of Ie(e)){let l=s.baseHeightM??0;for(let u of s.objects){if(u.type!=="shape"||u.role!=="stage")continue;let c=ln(u);c&&(t=Math.min(t,c.minX),o=Math.min(o,c.minY),n=Math.max(n,c.maxX),i=Math.max(i,c.maxY),r=Math.max(r,l+ji(u)))}}return!Number.isFinite(t)||!Number.isFinite(r)?null:{minX:t,minY:o,maxX:n,maxY:i,deckTopM:r}}function Ni(e,t,o,n){let i=1/0,r=1/0,s=-1/0,l=-1/0;for(let m of e)Number.isFinite(m.eyeHeightM)&&(i=Math.min(i,m.x),s=Math.max(s,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y));if(!Number.isFinite(i))return null;let u=i*t,c=r*t,d=Math.max(1,Math.ceil((s-i)*t/o)+1),b=Math.max(1,Math.ceil((l-r)*t/o)+1),p=new Float64Array(d*b).fill(-1/0);for(let m of e){if(!Number.isFinite(m.eyeHeightM))continue;let g=m.eyeHeightM-ce,S=Math.min(d-1,Math.max(0,Math.floor((m.x*t-u)/o))),A=Math.min(b-1,Math.max(0,Math.floor((m.y*t-c)/o)))*d+S,R=g+n;R>p[A]&&(p[A]=R)}return{cellM:o,minX:u,minY:c,cols:d,rows:b,top:p}}function Fi(e,t,o){let n=Math.floor((t-e.minX)/e.cellM),i=Math.floor((o-e.minY)/e.cellM);return n<0||i<0||n>=e.cols||i>=e.rows?-1/0:e.top[i*e.cols+n]}function dn(e,t,o={}){let n=new Map;if(!t||!e.length)return n;let i=o.metresPerChartUnit??ae,r=o.cellM??Pi,s=o.chairBackM??Ei,l=o.selfRowSkipM??Li,u=o.clearThreshold??.9,c=o.partialThreshold??.25,d=Math.max(1,o.columns??Ai),b=Math.max(1,o.rows??Ri),p=Ni(e,i,r,s);if(!p)return n;let m=(t.maxX-t.minX)*i,g=(t.maxY-t.minY)*i,S=m>=g,I=(t.minX+t.maxX)/2*i,A=(t.minY+t.maxY)/2*i,R=[];for(let P=0;P<d;P++){let M=(P+.5)/d-.5,v=S?I+M*m:I,C=S?A:A+M*g;for(let x=0;x<b;x++){let w=t.deckTopM+(b===1?0:x/(b-1)*Oi);R.push({x:v,y:C,z:w})}}let O=r/2;for(let P of e){if(!Number.isFinite(P.eyeHeightM))continue;let M=P.x*i,v=P.y*i,C=P.eyeHeightM,x=0,w=1/0;for(let E of R){let f=E.x-M,y=E.y-v,h=Math.hypot(f,y);if(!(h>l)){x++;continue}let L=f/h,k=y/h,T=0;for(let _=l;_<h;_+=O){let j=Fi(p,M+L*_,v+k*_);if(!(!Number.isFinite(j)||j>=C)&&j>C+(E.z-C)*_/h){T=_;break}}T?w=Math.min(w,T):x++}let a=x/R.length;a>=u||n.set(P.id,{seatId:P.id,mark:a<c?"obstructedView":"restrictedView",visibleFraction:a,totalRays:R.length,atDistanceM:Number.isFinite(w)?w:0})}return n}function fn(e,t){if(!t.size)return 0;let o=0;for(let n of e){let i=t.get(n.id);if(!i)continue;let r=n.commercial;r?.restrictedView!==void 0||r?.obstructedView!==void 0||(n.commercial={...r,[i.mark]:!0},o++)}return o}function at(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var $e=Math.PI/180;var we=16;function st(e,t,o,n){let i=o*$e,r=Math.cos(i),s=Math.sin(i);return{x:n.x+e*r-t*s,y:n.y+e*s+t*r}}function yn(e){let{seatCount:t,seatSpacing:o,curve:n,rotation:i,origin:r}=e,s=[];if(e.path)return Kt(e.path,t);if(t<=1)return t===1&&s.push({x:r.x,y:r.y}),s;if(n===0){for(let c=0;c<t;c++)s.push(st(c*o,0,i,r));return s}let l=n/(t-1)*$e,u=o/(2*Math.sin(Math.abs(l)/2));for(let c=0;c<t;c++){let d=c*l,b=u*Math.sin(d),p=-u+u*Math.cos(d);s.push(st(b,p,i,r))}return s}function hn(e){let t=new Map;if(e.overrides)for(let o of e.overrides)t.set(o.index,o);return t}function Be(e){let t=new Set((e.overrides??[]).filter(o=>o.skip&&Number.isInteger(o.index)&&o.index>=0&&o.index<e.seatCount).map(o=>o.index));return Math.max(0,e.seatCount-t.size)}function Di(e,t){let o=hn(e);return yn(e).map((n,i)=>{let r=o.get(i),s=at(r),l=_e(e,i,r),u={...e.commercial,...r?.commercial};return{index:i,x:n.x+(r?.dx??0),y:n.y+(r?.dy??0),label:l,displayLabel:Je(e,i,t,r),categoryKey:r?.categoryKey??e.categoryKey,skipped:!!r?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:r?.wheelchairSpaceType,commercial:Object.values(u).some(c=>c!==void 0&&c!==!1&&c!=="")?u:void 0,glyph:r?.glyph,viewUrl:r?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:r?.viewFromSeatUrl?r.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:r?.labelStyle??e.seatLabelStyle}})}function U(e){let t=[];for(let o of Di(e))o.skipped||t.push({id:`${e.id}:${o.index}`,label:o.label,displayLabel:o.displayLabel===o.label?void 0:o.displayLabel,x:o.x,y:o.y,rowId:e.id,categoryKey:o.categoryKey,accessible:o.accessible||void 0,accessibility:o.accessibility.length?o.accessibility:void 0,wheelchairSpaceType:o.wheelchairSpaceType,commercial:o.commercial,glyph:o.glyph,viewUrl:o.viewUrl,viewMeta:o.viewMeta,labelStyle:o.labelStyle});return t}function Me(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],o=["top","bottom","left","right"].filter(r=>t.includes(r)),n={top:0,bottom:0,left:0,right:0};if(!o.length)return n;let i=Math.max(0,Math.round(e.seatCount));for(let r=0;r<i;r++)n[o[r%o.length]]+=1;return n}function xn(e){let t=[],o=Math.max(0,Math.round(e.seatCount));if(o===0)return t;let n=new Map((e.overrides??[]).map(d=>[d.index,d])),i=(d,b,p,m)=>{let g=n.get(d),S=at(g),I=g?.label??Xt(e,d);return{index:d,label:I,displayLabel:g?.displayLabel??Yt(e,d),x:b+(g?.dx??0),y:p+(g?.dy??0),categoryKey:g?.categoryKey??e.categoryKey,skipped:!!g?.skip,accessible:S.length>0,accessibility:S,wheelchairSpaceType:g?.wheelchairSpaceType,commercial:g?.commercial,glyph:g?.glyph,viewUrl:g?.viewFromSeatUrl,viewMeta:g?.viewFromSeatUrl?g.viewFromSeatMeta:void 0,labelStyle:g?.labelStyle,...m?{side:m}:{}}};if(e.shape==="round"){let d=(e.radius??40)+we,b=e.rotation*$e,p=Math.max(0,Math.min(360,e.seatArc??360));if(p>=360||o===1){for(let I=0;I<o;I++){let A=b+I/o*2*Math.PI;t.push(i(I,e.center.x+d*Math.cos(A),e.center.y+d*Math.sin(A)))}return t}let m=p*$e,g=(2*Math.PI-m)/2,S=b+g;for(let I=0;I<o;I++){let A=S+I/(o-1)*m;t.push(i(I,e.center.x+d*Math.cos(A),e.center.y+d*Math.sin(A)))}return t}let r=e.width??80,s=e.height??50,l=Me(e),u=["top","bottom","left","right"],c=0;for(let d of u){let b=l[d];for(let p=0;p<b;p++){let m,g;d==="top"?(m=-r/2+(p+.5)*r/b,g=-s/2-we):d==="bottom"?(m=-r/2+(p+.5)*r/b,g=s/2+we):d==="left"?(m=-r/2-we,g=-s/2+(p+.5)*s/b):(m=r/2+we,g=-s/2+(p+.5)*s/b);let S=st(m,g,e.rotation,e.center);t.push(i(c++,S.x,S.y,d))}}return t}function vn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):xn(e).filter(t=>!t.skipped).length}function z(e){return xn(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 $i(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",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function bn(e,t){let o=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let r=t[n].x,s=t[n].y,l=t[i].x,u=t[i].y;s>e.y!=u>e.y&&e.x<(l-r)*(e.y-s)/(u-s)+r&&(o=!o)}return o}function Bi(e,t){return t.some((o,n)=>{let i=t[(n+1)%t.length],r=(e.y-o.y)*(i.x-o.x)-(e.x-o.x)*(i.y-o.y);if(Math.abs(r)>1e-7)return!1;let s=(e.x-o.x)*(i.x-o.x)+(e.y-o.y)*(i.y-o.y),l=(i.x-o.x)**2+(i.y-o.y)**2;return s>=-1e-7&&s<=l+1e-7})}function ct(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function H(e,t,o){return bn(e,t)&&!ct(o).some(n=>bn(e,n)||Bi(e,n))}function De(e){if(!e.length)return{x:0,y:0};let t=0,o=0;for(let n of e)t+=n.x,o+=n.y;return{x:t/e.length,y:o/e.length}}function Y(e){switch(e.type){case"row":{let t=yn(e),o=hn(e),n=0,i=0,r=0;for(let s=0;s<t.length;s++){let l=o.get(s);l?.skip||(n+=t[s].x+(l?.dx??0),i+=t[s].y+(l?.dy??0),r++)}return r?{x:n/r,y:i/r}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return De(e.points);case"section":return De(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?De(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 mn(e,t){return e.length===t.length&&e.every((o,n)=>o.x===t[n].x&&o.y===t[n].y)}function Gi(e,t){if(e.type!=="gaArea"||!mn(e.points,t.outline))return!1;let o=ct(e.holes),n=ct(t.holes);return o.length===n.length&&o.every((i,r)=>mn(i,n[r]))}function Ki(e,t,o=e.filter(i=>i.type==="section"),n=Y(t)){let i="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(i?o.find(s=>(s.logicalSectionId??s.id)===i&&(Gi(t,s)||H(n,s.outline,s.holes))):void 0)??o.find(s=>H(n,s.outline,s.holes))}function Ie(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 Ge(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function pn(e,t,o,n,i,r,s,l,u){let c=[],d=e.filter(S=>S.type==="section"),b=Vt(e),p=S=>!S?.eventConfigurationId||S.eventConfigurationId===n&&(S.eventConfigurationVersion===void 0||S.eventConfigurationVersion===u),m=S=>tn(S,{activeConfigurationId:n,activeConfigurationVersion:u,activeBasisSha256:i,now:l}),g=(S,I)=>m(S)?{...S,coverage:I}:void 0;for(let S of e){let I=[];if(S.type==="row"?I=U(S):S.type==="table"?I=z(S):S.type==="booth"&&(I=$i(S)),!I.length)continue;for(let M of I)M.viewUrl&&!p(M.viewMeta)&&(M.viewUrl=void 0,M.viewMeta=void 0);if(S.type==="row"){let M=b.get(S.id);if(M){let v=new Map((S.overrides??[]).map(C=>[C.index,C]));for(let C of I){let x=Number(C.id.slice(C.id.lastIndexOf(":")+1));if(!Number.isInteger(x))continue;C.logicalRowId=M.groupId,C.logicalSeatIndex=M.adjacencyOffset+x,v.get(x)?.displayLabel||(C.displayLabel=Je(S,x,M)),!C.viewUrl&&M.viewFromSeatUrl&&p(M.viewFromSeatMeta)&&(C.viewUrl=M.viewFromSeatUrl,C.viewMeta=M.viewFromSeatMeta);let w=v.get(x)?.confidenceEvidence;C.confidenceEvidence=g(w,"exact-seat")??g(S.confidenceEvidence,"row-representative")??g(M.confidenceEvidence,"row-representative")}}}let A=Ki(e,S,d,S.type==="row"?De(I):Y(S)),R=A?.viewFromSeatUrl,P=(A?.zone?t?.find(M=>M.id===A.zone):void 0)?.focalPoint??o;for(let M of I){if(!M.confidenceEvidence){let v=Number(M.id.slice(M.id.lastIndexOf(":")+1)),C=(S.type==="row"||S.type==="table")&&Number.isInteger(v)?S.overrides?.find(x=>x.index===v)?.confidenceEvidence:void 0;M.confidenceEvidence=g(C,"exact-seat")??(S.type==="row"?g(S.confidenceEvidence,"row-representative"):void 0)}M.confidenceEvidence??=g(A?.confidenceEvidence,"section-representative")??(s?g(s.evidence,s.coverage):void 0),!M.viewUrl&&R&&p(A?.viewFromSeatMeta)&&(M.viewUrl=R,M.viewMeta=A?.viewFromSeatMeta),!M.viewUrl&&r&&p(r.meta)&&(M.viewUrl=r.url,M.viewMeta=r.meta),A&&(M.sectionId=A.logicalSectionId??A.id),A?.zone&&(M.zoneId=A.zone),P&&(M.focalPoint={...P})}c.push(...I)}return c}function Sn(e,t={}){if(e.floors?.length){let n=[];for(let i of e.floors){let r=i.focalPoint??e.focalPoint,s=i.viewFromSeatUrl?{url:i.viewFromSeatUrl,meta:i.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,l=i.confidenceEvidence?{evidence:i.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,u=pn(i.objects,e.zones,r,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&gn(i.objects,i.focalPoint??e.focalPoint,i.baseHeightM??0,u);for(let c of u)c.floorId=i.id;for(let c of u)n.push(c)}return n}let o=pn(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&&gn(e.objects,e.focalPoint,t.floorBaseHeightM??0,o),Ui(e,o,t)}function Ui(e,t,o){return!o.deriveRestrictedView||e.derivedRestrictedView===!1||o.resolveEyeHeights===!1||fn(t,dn(t,un(e))),t}function gn(e,t,o,n){let i=e.filter(b=>b.type==="section"),r=o>0||i.some(b=>b.height!==void 0||b.rake!==void 0||(b.elevation??0)>0);if(!i.length||!r||!t){for(let b of n)b.eyeHeightM=o+ce;return}let s=new Array(n.length),l=new Map;for(let b of i)l.has(b.id)||l.set(b.id,b);let u=new Map,c=new Map;for(let b=0;b<n.length;b++){let p=n[b],g=(p.sectionId?l.get(p.sectionId)??i.find(I=>I.logicalSectionId===p.sectionId&&H({x:p.x,y:p.y},I.outline,I.holes)):void 0)??i.find(I=>H({x:p.x,y:p.y},I.outline,I.holes))??null;if(s[b]=g,!g)continue;u.has(g.id)||u.set(g.id,Se(g,{floorBaseHeightM:o}));let S=c.get(g.id);S?S.push(b):c.set(g.id,[b])}let d=new Array(n.length).fill(void 0);for(let[b,p]of c){let m=u.get(b);if(!m)continue;let g=m.rake>0?Math.tan(m.rake*Math.PI/180):0,S=en(b,n,p,t);for(let I of S.rows){let A=I.blockDepth*ae*g,R=m.height+A;for(let O of I.seatIndices)d[O]=R}}for(let b=0;b<n.length;b++){let p=n[b],m=s[b];if(!m){p.eyeHeightM=o+ce;continue}let g=u.get(m.id);p.eyeHeightM=(d[b]??g.height)+ce}}var Ke="__sl_ga__";function W(e){return e.startsWith(Ke)}var Vi=Ke,J=1e5;function In(e,t){return`${Vi}${encodeURIComponent(e)}__${t+1}`}function Ue(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let o=0,n=new Map;for(let i of t){if(!i||typeof i.sourceAreaId!="string"||!i.sourceAreaId.trim()||i.sourceAreaId.length>160||!Number.isInteger(i.startIndex)||i.startIndex<0||!Number.isInteger(i.count)||i.count<1||i.startIndex+i.count>J||(o+=i.count,o>J))return!1;let r=n.get(i.sourceAreaId)??[],s=i.startIndex+i.count;if(r.some(l=>i.startIndex<l.end&&s>l.start))return!1;r.push({start:i.startIndex,end:s}),n.set(i.sourceAreaId,r)}return o===e.capacity}function lt(e){let t=Math.min(J,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:Ue(e)?e.inventorySegments.map(o=>({...o})):[]}var ee=100,zi=`An area sold to one party holds at most ${ee} guests.`;function Z(e){return e.variableOccupancy?"variable":e.bookAsWhole?"whole":null}function Hi(e){return Z(e)==="variable"?{min:e.minOccupancy??1,max:e.maxOccupancy??e.capacity}:{min:e.capacity,max:e.capacity}}function ut(e){return dt(e,2)}function dt(e,t){return t===2&&Z(e)&&e.inventorySegments===void 0?e.label.trim()?[e.label]:[]:lt(e).flatMap(o=>Array.from({length:o.count},(n,i)=>In(o.sourceAreaId,o.startIndex+i)))}function wn(e){let t=e.wheelchairPlaces;return!Number.isInteger(t)||t<=0?0:Math.min(t,Math.max(0,Math.floor(e.capacity)))}function Xi(e,t=2){let o=wn(e);if(!o)return new Set;let n=dt(e,t);return n.length===1&&Z(e)&&t===2?new Set(n):new Set(n.slice(Math.max(0,n.length-o)))}function Yi(e,t){if(e.inventorySegments===void 0||t===e.capacity)return e.inventorySegments;if(t<e.capacity)return;let o=lt(e);if(!o.length)return;let n=t-e.capacity;if(!n)return o;let r=o.filter(l=>l.sourceAreaId===e.id).reduce((l,u)=>Math.max(l,u.startIndex+u.count),0),s=o[o.length-1];if(s?.sourceAreaId===e.id&&s.startIndex+s.count===r)s.count+=n;else{if(o.length>=256)return;o.push({sourceAreaId:e.id,startIndex:r,count:n})}return o}function Wi(e){return Ge(e).filter(t=>t.type==="gaArea")}var Zi=.15,qi=1.6;function Mn(e){return K(e??1,Zi,qi)}var Qi=/^#[0-9a-fA-F]{6}$/,Ji=/^#?([\da-f]{3}|[\da-f]{6})$/i;function Cn(e){return typeof e=="string"&&Qi.test(e)}function le(e){let t=Ji.exec((e??"").trim());if(!t)return null;let o=t[1].length===3?t[1].split("").map(i=>i+i).join(""):t[1],n=parseInt(o,16);return[n>>16&255,n>>8&255,n&255]}function kn(e,t){let o=r=>{let s=le(r);if(!s)return null;let l=R=>{let O=R/255;return O<=.04045?O/12.92:((O+.055)/1.055)**2.4},u=l(s[0]),c=l(s[1]),d=l(s[2]),b=(.4124*u+.3576*c+.1805*d)/.95047,p=.2126*u+.7152*c+.0722*d,m=(.0193*u+.1192*c+.9505*d)/1.08883,g=R=>R>.008856?Math.cbrt(R):7.787*R+16/116,S=g(b),I=g(p),A=g(m);return[116*I-16,500*(S-I),200*(I-A)]},n=o(e),i=o(t);return n&&i?Math.hypot(n[0]-i[0],n[1]-i[1],n[2]-i[2]):null}function ft(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function bt(e){return .2126*ft(e[0])+.7152*ft(e[1])+.0722*ft(e[2])}function G(e,t){let o=le(e),n=le(t);if(!o||!n)return null;let i=bt(o),r=bt(n);return(Math.max(i,r)+.05)/(Math.min(i,r)+.05)}function er(e){let t=1/0,o=1/0,n=-1/0,i=-1/0,r=!1;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(r=!0,s.x<t&&(t=s.x),s.y<o&&(o=s.y),s.x>n&&(n=s.x),s.y>i&&(i=s.y));return r?{minX:t,minY:o,maxX:n,maxY:i}:null}function An(e){let t=er(e);return t?tr(t):null}function tr(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}var ue=[{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"}],ps=new Map(ue.map(e=>[e.key,e]));var nr=[{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"}],gs=new Map(nr.map(e=>[e.key,e]));var mt=8,pt=24,Rn=["start","end","both","none"],En=["inline","corner","peninsula","island"],or=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],ys=new Set(or);var Pn=7;var Tn=10;var yt=.85,_n=12,jn=4.5;var ir=3,On="#000000",Ln="#ffffff",rr=24,ar=18.67;function Nn(e,t=400){return e>=rr||t>=700&&e>=ar?ir:jn}var sr={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"},ws=sr.wheelchair;var gt=G;function ht(e,t,o){let n=le(e),i=le(t);if(!n||!i)return t;let r=Math.max(0,Math.min(1,o));return`#${n.map((l,u)=>Math.round(l*r+i[u]*(1-r))).map(l=>l.toString(16).padStart(2,"0")).join("")}`}function Fn(e,t,o=jn){let n=gt(t,e);if(n!=null&&n>=o)return t;let i=gt(On,e)??0,r=gt(Ln,e)??0;return i===0&&r===0?t:i>=r?On:Ln}function cr(e){let t=0;for(let o=0,n=e.length;o<n;o+=1){let i=e[o],r=e[(o+1)%n];t+=i.x*r.y-r.x*i.y}return t/2}function de(e){return cr(e)*2}var Ve=[{key:"row-seats",label:"row seats",suffix:"rows",labelSuffix:"Rows",creationWord:"Seats",objectType:"row"},{key:"table-chairs",label:"table chairs",suffix:"tables",labelSuffix:"Tables",creationWord:"Tables",objectType:"table"},{key:"booth-units",label:"booth units",suffix:"booths",labelSuffix:"Booths",creationWord:"Booths",objectType:"booth"},{key:"ga-capacity",label:"GA capacity",suffix:"ga",labelSuffix:"GA",creationWord:"Standing",objectType:"gaArea"}];function Dn(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function lr(e){return Ve.find(t=>t.key===e)}function ke(e){let t=new Map,o=Math.max(0,Math.floor(e.seatCount)),n=new Map((e.overrides??[]).filter(r=>Number.isInteger(r.index)&&r.index>=0&&r.index<e.seatCount).map(r=>[r.index,r])),i=(r,s=1)=>{r&&s>0&&t.set(r,(t.get(r)??0)+s)};i(e.categoryKey,o-n.size);for(let r of n.values())r.skip||i(r.categoryKey??e.categoryKey);return t}function ur(e){return e.type==="row"||e.type==="table"?[...ke(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function $n(e){return Ve.find(t=>t.objectType===e.type)??null}function Bn(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function Ce(e){let t=new Map;for(let i of Dn(e))for(let r of i.objects){if(!Bn(r))continue;let s=$n(r);for(let l of ur(r)){let u=t.get(l)??new Map,c=u.get(s.key)??[];if(!c.some(d=>d.id===r.id)){let d=r.displayLabel||r.label||r.id;c.push({id:r.id,label:d,type:s.objectType,floorId:i.id})}u.set(s.key,c),t.set(l,u)}}let o=new Map(e.categories.map(i=>[i.key,i.label]));return[...e.categories.map(i=>i.key),...[...t.keys()].filter(i=>!o.has(i)).sort()].flatMap(i=>{let r=t.get(i);if(!r||r.size<2)return[];let s=Ve.flatMap(l=>{let u=r.get(l.key);return u?.length?[{family:l.key,label:l.label,objectType:l.objectType,targets:u}]:[]});return[{categoryKey:i,categoryLabel:o.get(i)??i,families:s,objectIds:[...new Set(s.flatMap(l=>l.targets.map(u=>u.id)))]}]})}function xt(e){let t=e.families.map(o=>`${o.label} (${o.targets.map(n=>n.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${t}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function Gn(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function dr(e,t,o){for(let n=1;n<=1e4;n+=1){let i=n===1?`--${t}`:`--${t}-${n}`,s=`${e.slice(0,Math.max(1,160-i.length))}${i}`;if(!o.has(s))return o.add(s),s}throw new Error(`Unable to allocate a category key for ${e} (${t})`)}function fr(e,t,o){for(let n=1;n<=1e4;n+=1){let i=n===1?` (${t})`:` (${t} ${n})`,s=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-i.length)).trimEnd()}${i}`,l=Gn(s);if(!o.has(l))return o.add(l),s}throw new Error(`Unable to allocate a category label for ${e} (${t})`)}function br(e,t,o,n){let i=lr(t);return{...structuredClone(e),key:dr(e.key,i.suffix,o),label:fr(e.label,i.labelSuffix,n)}}function mr(e,t,o){let n=[];for(let i of Dn(e))for(let r of i.objects){if(!Bn(r))continue;let s=$n(r),l=o.get(s.key);if(!(!l||l===t))if(r.type==="row"||r.type==="table"){let u=[];r.categoryKey===t&&(r.categoryKey=l);for(let c of r.overrides??[])c.categoryKey===t&&(c.categoryKey=l,u.push(c.index));(r.categoryKey===l||u.length)&&n.push({family:s.key,floorId:i.id,objectId:r.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:l,...u.length?{seatOverrideIndices:u.sort((c,d)=>c-d)}:{}})}else r.categoryKey===t&&(r.categoryKey=l,n.push({family:s.key,floorId:i.id,objectId:r.id,objectType:s.objectType,fromCategoryKey:t,toCategoryKey:l}))}return n}function vt(e){let t=structuredClone(e),o=Ce(t);if(!o.length)return{doc:t,changed:!1,changes:[],before:o,after:o};let n=new Set(t.categories.map(l=>l.key)),i=new Set(t.categories.map(l=>Gn(l.label))),r=[];for(let l of o){let u=t.categories.findIndex(g=>g.key===l.categoryKey);if(u<0)continue;let c=t.categories[u],d=l.families[0].family,b=new Map([[d,c.key]]),p=l.families.slice(1).map(g=>{let S=br(c,g.family,n,i);return b.set(g.family,S.key),{family:g.family,key:S.key,label:S.label,category:S}});t.categories.splice(u+1,0,...p.map(g=>g.category));let m=mr(t,c.key,b);r.push({categoryKey:c.key,categoryLabel:c.label,retainedFamily:d,clones:p.map(({family:g,key:S,label:I})=>({family:g,key:S,label:I})),reassignments:m})}t.floors?.length&&(t.objects=t.floors[0].objects);let s=Ce(t);return{doc:t,changed:r.length>0,changes:r,before:o,after:s}}function pr(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function Ae(e,t,o){return(t.x-e.x)*(o.y-e.y)-(t.y-e.y)*(o.x-e.x)}function ze(e,t,o){let n=Ae(t,o,e);return Math.abs(n)>1e-7?!1:e.x>=Math.min(t.x,o.x)-1e-7&&e.x<=Math.max(t.x,o.x)+1e-7&&e.y>=Math.min(t.y,o.y)-1e-7&&e.y<=Math.max(t.y,o.y)+1e-7}function gr(e,t,o,n){let i=Ae(e,t,o),r=Ae(e,t,n),s=Ae(o,n,e),l=Ae(o,n,t);return(i>1e-7&&r<-1e-7||i<-1e-7&&r>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)?!0:Math.abs(i)<=1e-7&&ze(o,e,t)||Math.abs(r)<=1e-7&&ze(n,e,t)||Math.abs(s)<=1e-7&&ze(e,o,n)||Math.abs(l)<=1e-7&&ze(t,o,n)}function yr(e){return e.reduce((t,o,n)=>{let i=e[(n+1)%e.length];return t+o.x*i.y-i.x*o.y},0)}function hr(e){for(let t=0;t<e.length;t+=1){let o=(t+1)%e.length;for(let n=t+1;n<e.length;n+=1){let i=(n+1)%e.length;if(!(t===n||o===n||i===t)&&gr(e[t],e[o],e[n],e[i]))return!0}}return!1}function Kn(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,o)=>pr(t,e[(o+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(yr(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:hr(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}function Un(e){return typeof e=="string"&&Rn.includes(e)}var Vn="M13 4.6a1.6 1.6 0 1 0-3.2 0 1.6 1.6 0 0 0 3.2 0 M11 6.5V13h5l2.4 6 M15 16.4A5 5 0 1 1 9 11.3",zn=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:"M16 7a4 4 0 1 0-8 0 4 4 0 0 0 8 0 M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:"M15 5a3 3 0 1 0-6 0 3 3 0 0 0 6 0 M12 8l-4 10h8l-4-10 M10 18v4 M14 18v4"},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:Vn},{key:"first-aid",label:"First aid",group:"facilities",path:"M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z M12 8v8 M8 12h8"},{key:"coat-check",label:"Coat check",group:"facilities",path:"M12 6a2 2 0 0 1 0-4 2 2 0 0 1 1.6 3.2L21 13H3l8.4-7.8 M3 13h18"},{key:"atm",label:"ATM / cash",group:"facilities",path:"M2 6h20v12H2V6Z M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0 M6 9h.01 M18 15h.01"},{key:"info",label:"Info point",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M12 11v5 M12 8h.01"},{key:"lost-found",label:"Lost & found",group:"facilities",path:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14 M16 16l5 5 M9 8.5a2 2 0 1 1 3 1.7c-.8.5-1 .8-1 1.8 M11 15h.01"},{key:"restrooms",label:"Restrooms",group:"facilities",path:"M6 3h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M9 18v-3.5a3 3 0 0 1 6 0V18"},{key:"charging",label:"Charging point",group:"facilities",path:"M3 8h13v8H3V8Z M16 10h3v4h-3 M9.6 9l-2 3.5h2.5l-1.5 3"},{key:"smoking",label:"Smoking area",group:"facilities",path:"M2 15h13v3H2v-3Z M18 16h2 M19 8c0 1 1 1.5 1 2.5S19 12 19 13"},{key:"no-smoking",label:"No smoking",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M5.6 5.6l12.8 12.8 M7 13h6v2H7v-2Z"},{key:"food",label:"Food",group:"food-drink",path:"M7 3v6a2 2 0 0 0 4 0V3 M9 11v10 M17 3c-1.6 1-2.2 3-2.2 6 0 2 .9 3.2 2.2 3.6V21"},{key:"bar",label:"Bar",group:"food-drink",path:"M4 5h16l-8 8-8-8Z M12 13v6 M8 20h8"},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 8h13v4a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V8Z M17 9h2a2 2 0 0 1 0 4h-2 M8 2v2 M11 2v2 M4 21h14"},{key:"water",label:"Water / drinks",group:"food-drink",path:"M12 22a7 7 0 0 1-7-7c0-5 7-12 7-12s7 7 7 12a7 7 0 0 1-7 7Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:"M6 8h12l-1 12H7L6 8Z M9 8V6a3 3 0 0 1 6 0v2"},{key:"screen",label:"Screen",group:"facilities",path:"M3 4h18v12H3V4Z M9 20h6 M12 16v4 M10 8l4 2-4 2V8Z"},{key:"sound-booth",label:"Sound booth",group:"facilities",path:"M6 4v16 M6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4 M12 4v16 M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M18 4v16 M18 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4"},{key:"entrance",label:"Entrance",group:"navigation",path:"M14 3h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-5 M3 12h11 M10 8l4 4-4 4"},{key:"exit",label:"Exit",group:"navigation",path:"M10 3H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h5 M14 12h7 M17 8l4 4-4 4"},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:"M14 4.6a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0 M12.5 8l-3.5 2 1.6 3.6-2 4.4 M12.5 10l3.5 1.5 M9 10.5l-3.5 1 M15 12h6 M18 9l3 3-3 3"},{key:"stairs",label:"Stairs",group:"navigation",path:"M3 20v-4h4v-4h4v-4h4V4h5"},{key:"elevator",label:"Elevator",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M8 11l1.5-2 1.5 2 M8 14l1.5 2 1.5-2 M15 8v8"},{key:"parking",label:"Parking",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M9 17V7h4a3 3 0 0 1 0 6H9"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:Vn},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:"M8 20a4 4 0 0 1-2-3c0-1 .5-2 .5-3a4.5 4.5 0 1 1 9 0c0 1.4-1 2-2 2.4-1.2.5-1.5 1-1.5 2.2 M17 6a5 5 0 0 1 1 6 M19.5 4a8 8 0 0 1 1.2 9"}];var xr=new Map(zn.map(e=>[e.key,e]));function Hn(e){return typeof e=="string"&&xr.has(e)}var Os=zn.map(e=>e.key);var Xn=["butt","round","square"],Yn=["miter","round","bevel"],St=["none","arrow"];function It(e){return e==="line"||e==="polyline"}function te(e){return e.length>=3&&e.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))}function fe(e,t,o){let n=(e.y-t.y)*(o.x-t.x)-(e.x-t.x)*(o.y-t.y);if(Math.abs(n)>1e-7)return!1;let i=(e.x-t.x)*(o.x-t.x)+(e.y-t.y)*(o.y-t.y);if(i<-1e-7)return!1;let r=(o.x-t.x)**2+(o.y-t.y)**2;return i<=r+1e-7}function be(e,t){let o=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let r=t[i],s=t[n];if(fe(e,r,s))return!0;r.y>e.y!=s.y>e.y&&e.x<(s.x-r.x)*(e.y-r.y)/(s.y-r.y)+r.x&&(o=!o)}return o}function q(e,t,o){return(t.x-e.x)*(o.y-e.y)-(t.y-e.y)*(o.x-e.x)}function Zn(e,t,o,n){let i=q(e,t,o),r=q(e,t,n),s=q(o,n,e),l=q(o,n,t);return(i>1e-7&&r<-1e-7||i<-1e-7&&r>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)?!0:Math.abs(i)<=1e-7&&fe(o,e,t)||Math.abs(r)<=1e-7&&fe(n,e,t)||Math.abs(s)<=1e-7&&fe(e,o,n)||Math.abs(l)<=1e-7&&fe(t,o,n)}function me(e){for(let t=0;t<e.length;t+=1){let o=(t+1)%e.length;for(let n=t+1;n<e.length;n+=1){let i=(n+1)%e.length;if(!(t===n||o===n||i===t)&&Zn(e[t],e[o],e[n],e[i]))return!0}}return!1}function Re(e,t){for(let o=0;o<e.length;o+=1)for(let n=0;n<t.length;n+=1)if(Zn(e[o],e[(o+1)%e.length],t[n],t[(n+1)%t.length]))return!0;return be(e[0],t)||be(t[0],e)}function Wn(e,t){return!t.some((o,n)=>fe(e,o,t[(n+1)%t.length]))&&be(e,t)}function qn(e){let t=e.outlinePath;if(!t?.segments.length)return;let o=r=>Number.isFinite(r.x)&&Number.isFinite(r.y),n=(r,s)=>Math.hypot(r.x-s.x,r.y-s.y);if(!o(t.start))return 0;let i=t.start;for(let r=0;r<t.segments.length;r++){let s=t.segments[r];if(!s||!o(s.end)||n(i,s.end)<=1e-9||s.kind==="bezier"&&(!o(s.control1)||!o(s.control2)))return r;if(s.kind==="arc"){if(!o(s.center)||!Number.isFinite(s.radius)||s.radius<=1e-6)return r;let l=Math.max(1e-4,s.radius*1e-4);if(Math.abs(n(i,s.center)-s.radius)>l||Math.abs(n(s.end,s.center)-s.radius)>l)return r}i=s.end}return n(i,t.start)>1e-4,t.segments.length-1}function vr(e,t,o,n){let i=q(e,t,o),r=q(e,t,n),s=q(o,n,e),l=q(o,n,t);return(i>1e-7&&r<-1e-7||i<-1e-7&&r>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)}function Qn(e,t){for(let o=0;o<e.length;o+=1)for(let n=0;n<t.length;n+=1)if(vr(e[o],e[(o+1)%e.length],t[n],t[(n+1)%t.length]))return!0;return e.some(o=>Wn(o,t))||t.some(o=>Wn(o,e))}function Jn(e){return e.role!=="reference-focal"||!e.points||!te(e.points)?null:e.points}function no(e,t){if(e.displayLabel!==void 0){let o=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!o||o!==e.displayLabel||o.length>80)&&t.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let o=e.displayType.normalize("NFKC").trim();(!o||o!==e.displayType||o.length>24)&&t.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}e.type!=="row"&&Sr(e,t)}var eo=(e,t)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=t;function Sr(e,t){let o=e.type==="gaArea"?"GA area":e.type==="table"?"Table":"Booth",n=(r,s)=>t.push({severity:"error",code:r,message:`${o} "${e.label}" ${s}`,objectId:e.id});e.entrance!==void 0&&!eo(e.entrance,40)&&n("invalid-entrance","must use a normalized entrance of 1 to 40 characters");let i=e.labelPresentation;if(i!==void 0){let r=i?.labelStyle?.size,s=r!==void 0&&(!Number.isFinite(r)||r<mt||r>pt);(!i||typeof i!="object"||i.visible!==void 0&&typeof i.visible!="boolean"||s)&&n("invalid-label-presentation",`has an invalid name-on-map setting (size ${mt}\u2013${pt})`)}if(e.type==="table"){let r=Wt(e.chairNumbering);r&&n("invalid-chair-numbering",`has invalid chair numbering: ${r}`)}e.type==="booth"&&(e.boothType!==void 0&&!En.includes(e.boothType)&&n("invalid-booth-type","must use inline, corner, peninsula or island as its booth type"),e.commercial!==void 0&&(!e.commercial||typeof e.commercial!="object"||Object.keys(e.commercial).some(r=>r!=="note")||e.commercial.note!==void 0&&!eo(e.commercial.note,160))&&n("invalid-booth-note","must use a normalized buyer note of 1 to 160 characters"))}function to(e,t,o,n){let i=e.crop,r=i&&(!Number.isFinite(i.x)||!Number.isFinite(i.y)||!Number.isFinite(i.width)||!Number.isFinite(i.height)||i.x<0||i.y<0||i.width<=0||i.height<=0||i.x+i.width>1.000001||i.y+i.height>1.000001);(!Number.isFinite(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||r)&&o.push({severity:"error",code:"invalid-background-placement",message:`The ${t} image has an invalid position, size, opacity, rotation, or crop`,...n?{floorId:n}:{}})}function wt(e,t,o,n){let i=e.referenceImage,r=e.backgroundImage;i&&(to(i,"reference",t,n),!i.assetId&&!i.url&&t.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...n?{floorId:n}:{}})),r&&(to(r,r.assetId?"legacy reference":"buyer background",t,n),!r.assetId&&!r.url&&t.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...n?{floorId:n}:{}}),r.assetId&&o.push({severity:"warning",code:"legacy-reference-background",message:"This legacy asset-backed background is trace-only and will migrate to the private reference layer when edited",...n?{floorId:n}:{}})),nn(e)&&t.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...n?{floorId:n}:{}})}function Ee(e){let t=new Set(ue.map(o=>o.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(o=>!!o.trim()&&o.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=ue.length&&new Set(e.accessibility.counts.map(o=>o.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(o=>t.has(o.type)&&Number.isInteger(o.count)&&o.count>0&&["user-confirmed","authoritative-source"].includes(o.evidence)&&!!o.sourceDescription.trim()&&o.sourceDescription.trim().length<=240))}function oo(e){let t=e.referenceInventoryExclusion;return!t||typeof t.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&t.assetId===e.referenceSource?.assetId&&typeof t.logicalSectionId=="string"&&t.logicalSectionId===(e.logicalSectionId??e.id)&&typeof t.reason=="string"&&!!t.reason.trim()&&t.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(t.evidence)&&typeof t.sourceDescription=="string"&&!!t.sourceDescription.trim()&&t.sourceDescription.trim().length<=240}function io(e){let t=e.referenceCategorySource;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^#[0-9a-f]{6}$/i.test(t.sourceColor)&&(t.sourceColors===void 0||t.sourceColors.length>0&&t.sourceColors.includes(t.sourceColor)&&new Set(t.sourceColors).size===t.sourceColors.length&&t.sourceColors.every(o=>/^#[0-9a-f]{6}$/i.test(o)&&`${o[1]}${o[3]}${o[5]}`.toLowerCase()===`${t.sourceColor[1]}${t.sourceColor[3]}${t.sourceColor[5]}`.toLowerCase()))&&(t.logicalSectionIds===void 0||t.logicalSectionIds.length>0&&new Set(t.logicalSectionIds).size===t.logicalSectionIds.length&&t.logicalSectionIds.every(o=>!!o.trim()&&o.length<=160))&&(t.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(t.assignmentDerivation))&&t.assignmentEvidence===void 0==!t.assignmentSourceDescription?.trim()&&(t.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.assignmentEvidence))&&(t.assignmentSourceDescription?.trim().length??0)<=240&&(t.assignmentDerivation!=="confirmed-logical-sections"||t.assignmentEvidence!==void 0&&!!t.assignmentSourceDescription?.trim())&&t.sourcePaletteColor===void 0==(t.sourcePaletteColorEvidence===void 0)&&t.sourcePaletteColorEvidence===void 0==!t.sourcePaletteColorSourceDescription?.trim()&&(t.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(t.sourcePaletteColor))&&(t.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.sourcePaletteColorEvidence))&&(t.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(t.labelEvidence)&&!!t.labelSourceDescription.trim()&&t.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(t.priceEvidence)&&!!t.priceSourceDescription.trim()&&t.priceSourceDescription.trim().length<=240&&t.outputColorEvidence===void 0==!t.outputColorSourceDescription?.trim()&&(t.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))&&(t.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(t.sourcePaletteColor??t.sourceColor).toLowerCase()&&new Set((t.sourceColors??[t.sourceColor]).map(o=>`${o[1]}${o[3]}${o[5]}`.toLowerCase())).size===1||t.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(t.outputColorEvidence))}function ro(e){let t=e.referenceDirectSeatImport;return!t||/^ref_[0-9a-f-]{36}$/.test(t.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(t.familyId)}function ao(e,t){let o=e.floors?.length?e.floors.map(r=>({id:r.id,objects:r.objects})):[{id:"floor-0",objects:e.objects}],n=new Map,i=new Map;for(let r of o){let s=r.objects.filter(c=>c.type==="row"),l=new Map,u=new Map;for(let c of s){if(c.segmentedRow){let d=l.get(c.segmentedRow.groupId)??[];d.push(c),l.set(c.segmentedRow.groupId,d)}if(c.rowBlockGeneration){let d=u.get(c.rowBlockGeneration.groupId)??[];d.push(c),u.set(c.rowBlockGeneration.groupId,d)}c.segmentedRow&&c.rowBlockGeneration&&t.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${c.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:c.id,floorId:r.id})}for(let[c,d]of l){let b=n.get(c);b&&b!==r.id&&t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${c}" cannot span multiple floors`,objectId:d[0].id,floorId:r.id}),n.set(c,r.id);let p=d.slice().sort((A,R)=>A.segmentedRow.componentIndex-R.segmentedRow.componentIndex),m=p[0]?.segmentedRow,g=m?.componentCount??0,S=m?JSON.stringify({displayLabel:m.displayLabel,repeatLabelOnComponents:m.repeatLabelOnComponents,displayType:m.displayType,labelPresentation:m.labelPresentation,viewFromSeatUrl:m.viewFromSeatUrl,viewFromSeatMeta:m.viewFromSeatMeta,confidenceEvidence:m.confidenceEvidence,smoothing:m.smoothing}):"";m&&g>=2&&g<=64&&p.length===g&&m.boundaryBefore==="start"&&p.every((A,R)=>{let O=A.segmentedRow;return O.kind==="segmented-row-v1"&&O.groupId===c&&O.componentCount===g&&O.componentIndex===R&&(R===0?O.boundaryBefore==="start":O.boundaryBefore!=="start")&&O.displayLabel.normalize("NFKC").trim()===O.displayLabel&&O.displayLabel.length>0&&O.displayLabel.length<=80&&JSON.stringify({displayLabel:O.displayLabel,repeatLabelOnComponents:O.repeatLabelOnComponents,displayType:O.displayType,labelPresentation:O.labelPresentation,viewFromSeatUrl:O.viewFromSeatUrl,viewFromSeatMeta:O.viewFromSeatMeta,confidenceEvidence:O.confidenceEvidence,smoothing:O.smoothing})===S})||t.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${c}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:d[0]?.id,floorId:r.id})}for(let[c,d]of u){let b=i.get(c);b&&b!==r.id&&t.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:d[0].id,floorId:r.id}),i.set(c,r.id)}}}function so(e,t){let o=(r,s)=>t.push({severity:"error",code:r,message:`GA area "${e.label}" ${s}`,objectId:e.id});e.bookAsWhole!==void 0&&typeof e.bookAsWhole!="boolean"&&o("invalid-ga-booking","has an invalid whole-area setting"),e.variableOccupancy!==void 0&&typeof e.variableOccupancy!="boolean"&&o("invalid-ga-booking","has an invalid party-size setting"),e.bookAsWhole===!0&&e.variableOccupancy===!0&&o("invalid-ga-booking","cannot be sold whole and by party size at the same time");let n=Z(e);if(n&&e.inventorySegments!==void 0&&o("invalid-ga-booking","was joined from other areas and must be sold per person, not as one box"),n&&e.capacity>ee&&o("invalid-ga-booking",`is sold to one party but holds ${e.capacity} guests; at most ${ee} can book in one go`),n&&W(e.label)&&o("reserved-seat-label",`uses SeatLayer's reserved GA namespace for its box label "${e.label}"`),n==="variable"){let r=e.minOccupancy,s=e.maxOccupancy;(!Number.isInteger(r)||!Number.isInteger(s)||r<1||s<r||s>e.capacity)&&o("invalid-ga-occupancy",`needs whole-number fewest and most guests from 1 to its ${e.capacity}-person capacity`)}else(e.minOccupancy!==void 0||e.maxOccupancy!==void 0)&&o("invalid-ga-occupancy","has guest bounds without party-size selling");let i=e.wheelchairPlaces;i!==void 0&&(!Number.isInteger(i)||i<0||i>e.capacity)&&o("invalid-ga-wheelchair-places",`must have from 0 to ${e.capacity} wheelchair places`)}function wr(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Mr(e){let t=[],o=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let i=o.get(n);i?.skip||t.push({label:_e(e,n,i),index:n})}return t}function co(e){let t=[],o=new Map((e.overrides??[]).map(n=>[n.index,n]));for(let n=0;n<e.seatCount;n++){let i=o.get(n);i?.skip||t.push({label:i?.label??`${e.label}-${n+1}`,index:n})}return t}function Mt(e){return Array.isArray(e)&&e.every(t=>!!t&&typeof t=="object")}function lo(e){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.every(o=>!!o&&typeof o=="object"))}function uo(e,t={}){let o=t.maxInventory??1e5,n=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&n.push({severity:"error",code:"invalid-floor-overview",message:"Whole venue view must be Combined plan or Separate levels"}),e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&n.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let i=[],r=new Set(e.categories.map(a=>a.key)),s=new Set(ue.map(a=>a.key)),l=new Map(e.categories.map(a=>[a.key,a.price!=null||a.notForSale===!0])),u=new Set;wt(e,n,i),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&n.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!it(e.theme.logoUrl)&&n.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let c=it,d=(a,E,f,y={})=>{if(E===void 0)return;if(!E||typeof E!="object"||Array.isArray(E)){n.push({severity:"error",code:"invalid-seat-view-metadata",message:`${f} view metadata is invalid`,...y});return}let h=E;a||i.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${f} view metadata has no image`,...y});let L=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);h.projection!==void 0&&h.projection!=="equirectangular"&&n.push({severity:"error",code:"invalid-seat-view-projection",message:`${f} view projection must be equirectangular`,...y}),h.coverage!==void 0&&!L.has(h.coverage)&&n.push({severity:"error",code:"invalid-seat-view-coverage",message:`${f} view coverage is invalid`,...y});let k=(T,_,j)=>typeof T=="number"&&Number.isFinite(T)&&T>=_&&T<=j;if(h.initialBearingDeg!==void 0&&!k(h.initialBearingDeg,-360,360)&&n.push({severity:"error",code:"invalid-seat-view-bearing",message:`${f} view bearing must be between -360\xB0 and 360\xB0`,...y}),h.initialPitchDeg!==void 0&&!k(h.initialPitchDeg,-90,90)&&n.push({severity:"error",code:"invalid-seat-view-pitch",message:`${f} view pitch must be between -90\xB0 and 90\xB0`,...y}),h.capturedAt!==void 0&&(typeof h.capturedAt!="string"||h.capturedAt.length>40||!Number.isFinite(Date.parse(h.capturedAt)))&&n.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${f} view capture date is invalid`,...y}),h.sourceLabel!==void 0&&(typeof h.sourceLabel!="string"||h.sourceLabel.trim().length>100)&&n.push({severity:"error",code:"invalid-seat-view-source",message:`${f} view source label is invalid`,...y}),h.previewUrl!==void 0&&!c(h.previewUrl)&&n.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${f} view preview URL is invalid`,...y}),h.variants!==void 0){let T=Array.isArray(h.variants)?h.variants:[];if(!Array.isArray(h.variants)||T.length<1||T.length>4)n.push({severity:"error",code:"invalid-seat-view-variants",message:`${f} view variants must contain between 1 and 4 tiers`,...y});else{let _=new Set;for(let j of T){if(!j||typeof j!="object"||!c(j.url)||!Number.isInteger(j.width)||j.width<1||j.width>12e3||!Number.isInteger(j.height)||j.height<1||j.height>12e3||j.width!==j.height*2||typeof j.sha256!="string"||!/^[a-f0-9]{64}$/.test(j.sha256)||_.has(j.width)){n.push({severity:"error",code:"invalid-seat-view-variant",message:`${f} view variant is not a unique immutable 2:1 equirectangular tier`,...y});break}_.add(j.width)}}}for(let[T,_]of[["width",h.sourceWidth],["height",h.sourceHeight],["preview width",h.previewWidth],["preview height",h.previewHeight]])_!==void 0&&(!Number.isInteger(_)||_<1||_>32768)&&n.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${f} view source ${T} is invalid`,...y});h.captureEyeHeightM!==void 0&&!k(h.captureEyeHeightM,.5,3)&&n.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${f} capture eye height must be between 0.5 m and 3 m`,...y}),h.eventConfigurationId!==void 0&&(typeof h.eventConfigurationId!="string"||!h.eventConfigurationId.trim()||h.eventConfigurationId.length>100)&&n.push({severity:"error",code:"invalid-seat-view-configuration",message:`${f} event configuration id is invalid`,...y}),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&n.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${f} event configuration version is invalid`,...y}),h.eventConfigurationVersion!==void 0&&!h.eventConfigurationId&&n.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${f} event configuration version requires an id`,...y})},b=(a,E,f={})=>{if(a===void 0)return;let y=_=>{n.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${E} confidence evidence ${_}`,...f})};if(!a||typeof a!="object"||Array.isArray(a)){y("is invalid");return}let h=a;h.schema!=="seatlayer.seat-confidence/1"&&y("has an unsupported schema");let L=(_,j)=>typeof _=="string"&&_.normalize("NFKC").trim()===_&&_.length>0&&_.length<=j;L(h.evidenceId,120)||y("has an invalid evidence id"),L(h.modelVersion,120)||y("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(h.evidenceKind)||y("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(h.modelLevel)||y("has an invalid model level");let k=h.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(k)||y("has an invalid reality level"),h.eventConfigurationId!==void 0&&!L(h.eventConfigurationId,100)&&y("has an invalid event configuration id"),h.eventConfigurationVersion!==void 0&&(!Number.isInteger(h.eventConfigurationVersion)||h.eventConfigurationVersion<1)&&y("has an invalid event configuration version"),h.status!==void 0&&!new Set(["draft","approved","retracted"]).has(h.status)&&y("has an invalid publication status"),h.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(h.basisSha256)&&y("has an invalid venue basis SHA-256"),h.basisSha256!==void 0&&h.status!=="approved"&&y("can carry a venue basis SHA-256 only after approval");for(let[_,j]of[["assessment",h.assessedAt],["expiry",h.validUntil]])j!==void 0&&(!L(j,40)||!Number.isFinite(Date.parse(j)))&&y(`has an invalid ${_} date`);h.approvedByRole!==void 0&&!L(h.approvedByRole,100)&&y("has an invalid approving organization or role"),h.sourceLabel!==void 0&&!L(h.sourceLabel,120)&&y("has an invalid source label"),h.limitations!==void 0&&(!Array.isArray(h.limitations)||h.limitations.length>6||h.limitations.some(_=>!L(_,160)))&&y("has invalid limitations"),h.evidenceKind==="synthetic-model"&&(h.modelLevel!=="generated"||k!=="none")&&y("cannot describe synthetic data as verified or reality checked"),h.modelLevel!=="generated"&&(!h.assessedAt||!h.approvedByRole)&&y("requires an assessment date and approving organization or role for verified model levels"),h.modelLevel==="configuration-verified"&&!h.eventConfigurationId&&y("requires an event configuration id for configuration verification"),k!=="none"&&(!h.assessedAt||!h.sourceLabel)&&y("requires an assessment date and source for reality evidence"),k==="actual-build-checked"&&(h.modelLevel!=="configuration-verified"||!h.eventConfigurationId)&&y("requires a configuration-verified model and event configuration for an actual-build check");let T=h.modeledTarget;T!==void 0&&(!T||typeof T!="object"||Array.isArray(T)?y("has an invalid modeled target"):((!L(T.label,80)||!L(T.methodLabel,100))&&y("has invalid modeled-target labels"),(!Number.isInteger(T.totalRayCount)||T.totalRayCount<1||T.totalRayCount>1e3||!Number.isInteger(T.clearRayCount)||T.clearRayCount<0||T.clearRayCount>T.totalRayCount)&&y("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(T.classification)||y("has an invalid modeled-target classification"),T.occluderLabels!==void 0&&(!Array.isArray(T.occluderLabels)||T.occluderLabels.length>10||T.occluderLabels.some(_=>!L(_,100)))&&y("has invalid modeled-target occluders")))};d(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),b(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!c(e.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let a of e.floors??[])a.viewFromSeatUrl!==void 0&&!c(a.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${a.name}" has an invalid view-from-seat image URL`}),d(a.viewFromSeatUrl,a.viewFromSeatMeta,`Floor "${a.name}"`,{floorId:a.id}),b(a.confidenceEvidence,`Floor "${a.name}"`,{floorId:a.id});let p=e.floors?.length?e.floors.flatMap(a=>a.objects):e.objects;for(let a of p)if((a.type==="row"||a.type==="section")&&(a.viewFromSeatUrl!==void 0&&!c(a.viewFromSeatUrl)&&n.push({severity:"error",code:a.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${a.type==="row"?"Row":"Section"} "${a.label}" has an invalid view-from-seat image URL`,objectId:a.id}),d(a.viewFromSeatUrl,a.viewFromSeatMeta,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id}),b(a.confidenceEvidence,`${a.type==="row"?"Row":"Section"} "${a.label}"`,{objectId:a.id})),a.type==="row"&&a.segmentedRow&&(a.segmentedRow.viewFromSeatUrl!==void 0&&!c(a.segmentedRow.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${a.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:a.id}),d(a.segmentedRow.viewFromSeatUrl,a.segmentedRow.viewFromSeatMeta,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id}),b(a.segmentedRow.confidenceEvidence,`Segmented row "${a.segmentedRow.displayLabel}"`,{objectId:a.id})),a.type==="row"||a.type==="table")for(let E of a.overrides??[])E.viewFromSeatUrl!==void 0&&!c(E.viewFromSeatUrl)&&n.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${E.index+1} has an invalid view-from-seat image URL`,objectId:a.id,seatIndices:[E.index]}),d(E.viewFromSeatUrl,E.viewFromSeatMeta,`Seat ${E.index+1}`,{objectId:a.id,seatIndices:[E.index]}),b(E.confidenceEvidence,`Seat ${E.index+1}`,{objectId:a.id,seatIndices:[E.index]});let m=new Set;for(let a of e.categories){m.has(a.key)&&n.push({severity:"error",code:"duplicate-category-key",message:`Category key "${a.key}" is used more than once`,categoryKey:a.key}),m.add(a.key);let E=new Set;for(let f of a.tiers??[]){if(E.has(f.id)&&n.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${f.id}" is used more than once in category "${a.key}"`,categoryKey:a.key}),f.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(f.restriction)&&n.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${f.name}" has an unknown restriction`,categoryKey:a.key}),f.buyerMessage!=null&&(!f.buyerMessage.trim()||f.buyerMessage.length>240)&&n.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${f.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:a.key}),f.currency!=null&&!/^[A-Z]{3}$/.test(f.currency)&&n.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${f.name}" must use a three-letter ISO currency`,categoryKey:a.key}),f.applicability!=null){let y=f.applicability.seatLabels,h=f.applicability.accessibility;(y!==void 0&&(!Array.isArray(y)||!y.length||y.length>1e4||y.some(L=>typeof L!="string"||!L.trim()||L.length>160)||new Set(y).size!==y.length)||h!==void 0&&(!Array.isArray(h)||!h.length||h.some(L=>!s.has(L))||new Set(h).size!==h.length))&&n.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${f.name}" has invalid seat applicability`,categoryKey:a.key})}f.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(f.evidence.provenance)||!f.evidence.sourceDescription.trim()||f.evidence.sourceDescription.length>240||f.evidence.capturedAt!==void 0&&(f.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(f.evidence.capturedAt))))&&n.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${f.name}" has invalid evidence provenance`,categoryKey:a.key}),E.add(f.id)}io(a)||n.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${a.label||a.key} has incomplete or invalid reference evidence`,categoryKey:a.key}),ro(a)||n.push({severity:"error",code:"invalid-reference-direct-seat-import",message:`Category ${a.label||a.key} has invalid direct-seat import provenance`,categoryKey:a.key})}let g=new Map,S=new Map,I=[],A=new Map,R=0,O=0,P=new Set;for(let a of e.floors??[])wt(a,n,i,a.id),P.has(a.id)&&n.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${a.id}" is used more than once`,floorId:a.id}),P.add(a.id),a.baseHeightM!==void 0&&(!Number.isFinite(a.baseHeightM)||a.baseHeightM<Q||a.baseHeightM>X)&&n.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${a.name}" base height must be between ${Q} and ${X} metres`,floorId:a.id});let M=e.floors&&e.floors.length?e.floors.flatMap(a=>a.objects):e.objects;ao(e,n);let v=new Set;for(let a of M)v.has(a.id)&&n.push({severity:"error",code:"duplicate-object-id",message:`Object id "${a.id}" is used more than once`,objectId:a.id}),v.add(a.id);let C=new Set;for(let a of e.zones??[])C.has(a.id)&&n.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${a.id}" is used more than once`}),C.add(a.id),a.focalPoint!==void 0&&(!Number.isFinite(a.focalPoint.x)||!Number.isFinite(a.focalPoint.y))&&n.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${a.label}" must use a finite focal point`});let x=new Map;for(let a of M)if(!(a.type!=="section"||!a.zone)){if(e.zones?.length&&!C.has(a.zone)){n.push({severity:"error",code:"unknown-section-zone",message:`Section "${a.displayLabel??a.label}" references unknown zone "${a.zone}"`,objectId:a.id});continue}x.has(a.zone)||x.set(a.zone,a)}for(let[a,E]of x){let f=e.zones?.find(y=>y.id===a);f&&(f?.focalPoint||i.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${f?.label??a}" uses the legacy floor focal; set its own focal point before publishing`,objectId:E.id}))}for(let a of M)if((a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea")&&no(a,n),wr(a)){if(R++,O+=a.type==="booth"?1:a.type==="row"?Be(a):a.bookAsWhole||a.variableOccupancy?a.seatCount:co(a).length,g.get(a.label)!==void 0?a.type!=="row"&&n.push({severity:"error",code:"duplicate-object-label",message:`Label "${a.label}" is used by more than one object`,objectId:a.id}):g.set(a.label,a.id),r.has(a.categoryKey)?u.add(a.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.type==="row"){Ee(a.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),a.seatCount<1&&n.push({severity:"error",code:"empty-row",message:`Row "${a.label}" has no seats`,objectId:a.id}),a.aisleSeats!==void 0&&!Un(a.aisleSeats)&&n.push({severity:"error",code:"invalid-row-aisle-seats",message:`Row "${a.label}" must mark its aisle seats at the start, end, both or none`,objectId:a.id});let f=new Set;for(let y of a.overrides??[]){(y.accessibility??[]).filter(T=>!s.has(T)).length&&n.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${a.label}" seat ${y.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[y.index]}),(!Number.isInteger(y.index)||y.index<0||y.index>=a.seatCount||f.has(y.index))&&n.push({severity:"error",code:"invalid-seat-override",message:`Row "${a.label}" has a duplicated or out-of-range seat override`,objectId:a.id,...Number.isInteger(y.index)?{seatIndices:[y.index]}:{}}),f.add(y.index);let L=y.wheelchairSpaceType,k=y.accessible===!0||y.accessibility?.includes("wheelchair");L!==void 0&&L!=="seat-present"&&L!=="no-seat"?n.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${a.label}" seat ${y.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[y.index]}):L&&(!k||y.skip)&&n.push({severity:"error",code:"invalid-wheelchair-space",message:y.skip?`Row "${a.label}" seat ${y.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${a.label}" seat ${y.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[y.index]})}for(let y of Mr(a))W(y.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${y.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id,seatIndices:[y.index]}),S.get(y.label)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${y.label}" is used more than once`,objectId:a.id,seatIndices:[y.index]}):S.set(y.label,a.id)}else if(a.type==="table"){let f=a.bookAsWhole===!0||a.variableOccupancy===!0;if(a.fill!==void 0&&!Cn(a.fill)&&n.push({severity:"error",code:"invalid-table-fill",message:`Table "${a.label}" has an invalid surface color`,objectId:a.id}),a.automaticRadius!==void 0&&typeof a.automaticRadius!="boolean"?n.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${a.label}" has an invalid automatic-radius setting`,objectId:a.id}):a.automaticRadius===!0&&(a.shape!=="round"||a.radius!==on(a.seatCount,a.seatArc))&&n.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${a.label}" needs a radius that matches its automatic chair spacing`,objectId:a.id}),a.seatCountsBySide){let k=["top","bottom","left","right"],T=Object.keys(a.seatCountsBySide),_=k.every(B=>Number.isInteger(a.seatCountsBySide[B])&&a.seatCountsBySide[B]>=0&&a.seatCountsBySide[B]<=40),j=_?k.reduce((B,ie)=>B+a.seatCountsBySide[ie],0):Number.NaN;(a.shape!=="rect"||T.length!==k.length||T.some(B=>!k.includes(B))||!_||j!==a.seatCount||j<1||j>40)&&n.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${a.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${a.seatCount}-chair capacity`,objectId:a.id})}f&&a.overrides?.length&&n.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${a.label}" cannot carry individual-chair overrides`,objectId:a.id,seatIndices:a.overrides.map(k=>k.index)});let y=new Set;for(let k of a.overrides??[]){(k.accessibility??[]).filter(B=>!s.has(B)).length&&n.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${a.label}" chair ${k.index+1} uses an unknown accessibility type`,objectId:a.id,seatIndices:[k.index]}),(!Number.isInteger(k.index)||k.index<0||k.index>=a.seatCount||y.has(k.index))&&n.push({severity:"error",code:"invalid-seat-override",message:`Table "${a.label}" has a duplicated or out-of-range chair override`,objectId:a.id,...Number.isInteger(k.index)?{seatIndices:[k.index]}:{}}),y.add(k.index),k.categoryKey&&!r.has(k.categoryKey)?n.push({severity:"error",code:"unknown-category",message:`Table "${a.label}" chair ${k.index+1} references unknown category "${k.categoryKey}"`,objectId:a.id,seatIndices:[k.index],categoryKey:k.categoryKey}):k.categoryKey&&u.add(k.categoryKey);let _=k.wheelchairSpaceType,j=k.accessible===!0||k.accessibility?.includes("wheelchair");_!==void 0&&_!=="seat-present"&&_!=="no-seat"?n.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${a.label}" chair ${k.index+1} has an invalid wheelchair-space type`,objectId:a.id,seatIndices:[k.index]}):_&&(!j||k.skip)&&n.push({severity:"error",code:"invalid-wheelchair-space",message:k.skip?`Table "${a.label}" chair ${k.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${a.label}" chair ${k.index+1} must include wheelchair accessibility for its physical-space type`,objectId:a.id,seatIndices:[k.index]})}a.bookAsWhole&&a.variableOccupancy?n.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${a.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:a.id}):a.variableOccupancy?(!Number.isInteger(a.minOccupancy)||!Number.isInteger(a.maxOccupancy)||a.minOccupancy<1||a.maxOccupancy<a.minOccupancy||a.maxOccupancy>a.seatCount)&&n.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" needs whole-number minimum and maximum guests from 1 to its ${a.seatCount}-chair capacity`,objectId:a.id}):(a.minOccupancy!=null||a.maxOccupancy!=null)&&n.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${a.label}" has guest bounds without variable-occupancy selling`,objectId:a.id}),Ee(a.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),(a.shape==="round"&&a.radius==null||a.shape==="rect"&&(a.width==null||a.height==null)||a.seatCount<1)&&n.push({severity:"error",code:"bad-table",message:`Table "${a.label}" is missing required dimensions or seats`,objectId:a.id});let L=f?[{label:a.label,index:void 0}]:co(a);for(let k of L)W(k.label)&&n.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${k.label}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),S.get(k.label)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${k.label}" is used more than once; grouped table labels must be unique`,objectId:a.id,...k.index===void 0?{}:{seatIndices:[k.index]}}):S.set(k.label,a.id)}else if(a.type==="booth"){Ee(a.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${a.label}" has invalid reference-inventory provenance`,objectId:a.id});let f=a.label;W(f)&&n.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${f}" uses SeatLayer's reserved GA namespace`,objectId:a.id}),S.get(f)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${f}" is used more than once`,objectId:a.id}):S.set(f,a.id)}}else if(a.type==="gaArea"){if(so(a,n),!Ue(a))n.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${a.label}" has invalid joined-area inventory provenance`,objectId:a.id});else for(let y of ut(a))S.get(y)!==void 0?I.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${y}" is used more than once`,objectId:a.id}):S.set(y,a.id);if(Ee(a.referenceInventorySource)||n.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${a.label}" has invalid reference-inventory provenance`,objectId:a.id}),!Mt(a.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${a.label}" outline must be a list of points`,objectId:a.id});continue}(!te(a.points)||Math.abs(de(a.points))<=1e-7||me(a.points))&&n.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});let f=a.holes??[];if(!lo(f))n.push({severity:"error",code:"invalid-hole-collection",message:`GA area "${a.label}" cutouts must be a list of point lists`,objectId:a.id});else{let y=f.length<=64?f.findIndex(h=>h.length>512||!te(h)||Math.abs(de(h))<=1e-7||me(h)?!0:!h.flatMap((k,T)=>{let _=h[(T+1)%h.length];return[k,{x:(k.x+_.x)/2,y:(k.y+_.y)/2}]}).every(k=>be(k,a.points))):0;if(y>=0)n.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${a.label}" has a cutout outside its outline or with invalid geometry`,objectId:a.id,holeIndex:y});else if(f.some((h,L)=>f.slice(L+1).some(k=>Re(h,k)))){let h=f.findIndex((L,k)=>f.slice(k+1).some(T=>Re(L,T)));n.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${a.label}" has overlapping cutout polygons`,objectId:a.id,holeIndex:h})}}r.has(a.categoryKey)?u.add(a.categoryKey):n.push({severity:"error",code:"unknown-category",message:`"${a.label}" references unknown category "${a.categoryKey}"`,objectId:a.id,categoryKey:a.categoryKey}),a.capacity<1&&n.push({severity:"error",code:"empty-ga",message:`GA area "${a.label}" has zero capacity`,objectId:a.id}),(!Number.isInteger(a.capacity)||a.capacity>J)&&n.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${a.label}" capacity must be a whole number from 1 to ${J}`,objectId:a.id}),R++,O+=Math.max(0,Math.floor(a.capacity))}else if(a.type==="section"){if(a.displayLabel!==void 0){let y=a.displayLabel.normalize("NFKC").trim();y?(y!==a.displayLabel||y.length>80)&&n.push({severity:"error",code:"invalid-display-label",message:`Section "${a.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:a.id}):n.push({severity:"error",code:"unnamed-section",message:`Section "${a.label}" needs a buyer-facing name before seats are added`,objectId:a.id})}if(a.editor?.defaultCategoryKey&&!r.has(a.editor.defaultCategoryKey)&&n.push({severity:"error",code:"unknown-category",message:`Section "${a.label}" references unknown future-seat category "${a.editor.defaultCategoryKey}"`,objectId:a.id}),a.elevation!==void 0&&(!Number.isInteger(a.elevation)||a.elevation<tt||a.elevation>se)){let y=Number.isInteger(a.elevation)&&a.elevation>se&&a.elevation<=nt;i.push({severity:"warning",code:y?"legacy-section-elevation":"invalid-section-elevation",message:y?`Section "${a.label}" uses legacy tier ${a.elevation}; set an exact height before normalizing it to tier ${se}`:`Section "${a.label}" elevation must be a whole-number tier from ${tt} to ${se}`,objectId:a.id})}if(a.height!==void 0&&(!Number.isFinite(a.height)||a.height<Q||a.height>X)&&n.push({severity:"error",code:"invalid-section-height",message:`Section "${a.label}" exact height must be between ${Q} and ${X} metres`,objectId:a.id}),a.rake!==void 0&&(!Number.isFinite(a.rake)||a.rake<je||a.rake>Ne)&&n.push({severity:"error",code:"invalid-section-rake",message:`Section "${a.label}" rake must be between ${je}\xB0 and ${Ne}\xB0`,objectId:a.id}),a.surfaceKind!==void 0&&a.surfaceKind!=="flat"&&a.surfaceKind!=="rakedRows"&&n.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${a.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:a.id}),!Mt(a.outline)){n.push({severity:"error",code:"invalid-polygon-points",message:`Section "${a.label}" outline must be a list of points`,objectId:a.id});continue}if(!te(a.outline)||Math.abs(de(a.outline))<=1e-7||me(a.outline)){n.push({severity:"error",code:"invalid-section-outline",message:`Section "${a.label}" must have a finite, non-self-intersecting polygon outline`,objectId:a.id});continue}if(a.outlinePath){let y=[];try{y=Ut(a.outlinePath)}catch{}(!Qe(a.outlinePath)||!y.length||Math.hypot(a.outlinePath.start.x-a.outline[0].x,a.outlinePath.start.y-a.outline[0].y)>1e-4||!te(y)||Math.abs(de(y))<=1e-7||me(y))&&n.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${a.label}" has an invalid or inconsistent curved outline path`,objectId:a.id,edgeIndex:qn(a)})}if(a.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(a.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(a.referenceSource.regionId))&&n.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${a.label}" has invalid opaque reference provenance`,objectId:a.id}),oo(a)||n.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${a.label}" has incomplete or mismatched non-sellable evidence`,objectId:a.id}),a.logicalSectionId!==void 0&&!a.logicalSectionId.trim())n.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${a.label}" has an empty logical section id`,objectId:a.id});else if(a.logicalSectionId){let y=JSON.stringify({displayLabel:a.displayLabel??null,entrance:a.entrance??null,viewFromSeatUrl:a.viewFromSeatUrl??null,viewFromSeatMeta:a.viewFromSeatMeta??null,confidenceEvidence:a.confidenceEvidence??null,zone:a.zone??null,labelStyle:a.labelPresentation?.labelStyle??null,labelVisible:a.labelPresentation?.visible!==!1}),h=A.get(a.logicalSectionId);h&&(h.label!==a.label||h.semanticSignature!==y)?n.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${a.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:a.id}):h||A.set(a.logicalSectionId,{label:a.label,semanticSignature:y})}let E=a.holes??[];if(!lo(E)){n.push({severity:"error",code:"invalid-hole-collection",message:`Section "${a.label}" openings must be a list of point lists`,objectId:a.id});continue}if(E.length>64){n.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an invalid opening collection`,objectId:a.id});continue}let f=-1;for(let y=0;y<E.length;y++){let h=E[y];if(h.length>512||!te(h)||Math.abs(de(h))<=1e-7||me(h)){f=y;break}if(!h.flatMap((k,T)=>{let _=h[(T+1)%h.length];return[k,{x:(k.x+_.x)/2,y:(k.y+_.y)/2}]}).every(k=>be(k,a.outline))){f=y;break}}if(f>=0)n.push({severity:"error",code:"invalid-section-hole",message:`Section "${a.label}" has an opening outside its outline or with an invalid shape`,objectId:a.id,holeIndex:f});else if(E.some((y,h)=>E.slice(h+1).some(L=>Re(y,L)))){let y=E.findIndex((h,L)=>E.slice(L+1).some(k=>Re(h,k)));n.push({severity:"error",code:"overlapping-section-holes",message:`Section "${a.label}" has overlapping openings`,objectId:a.id,holeIndex:y})}}let w=e.floors?.length?e.floors.map(a=>a.objects):[e.objects];for(let a of w){let E=a.filter(f=>f.type==="section");for(let f of a.filter(y=>y.type==="text")){let y=f.iconKey;y!==void 0&&!Hn(y)&&n.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${f.text||f.id}" references an unknown symbol`,objectId:f.id});let h=f.fontFamily;h!==void 0&&(typeof h!="string"||h.normalize("NFKC").trim()!==h||h.length<1||h.length>120)&&n.push({severity:"error",code:"invalid-text-font-family",message:`Text "${f.text||f.id}" font family must contain 1 to 120 normalized characters`,objectId:f.id});let L=f.background;(f.width!==void 0&&(!Number.isFinite(f.width)||f.width<40||f.width>1200)||f.align!==void 0&&!["left","center","right"].includes(f.align)||f.lineHeight!==void 0&&(!Number.isFinite(f.lineHeight)||f.lineHeight<.8||f.lineHeight>3)||f.letterSpacing!==void 0&&(!Number.isFinite(f.letterSpacing)||f.letterSpacing<-2||f.letterSpacing>20)||f.opacity!==void 0&&(!Number.isFinite(f.opacity)||f.opacity<.1||f.opacity>1)||L!==void 0&&(!/^#[0-9a-f]{6}$/i.test(L.color)||L.padding!==void 0&&(!Number.isFinite(L.padding)||L.padding<0||L.padding>40)||L.cornerRadius!==void 0&&(!Number.isFinite(L.cornerRadius)||L.cornerRadius<0||L.cornerRadius>40)||L.opacity!==void 0&&(!Number.isFinite(L.opacity)||L.opacity<.1||L.opacity>1)))&&n.push({severity:"error",code:"invalid-text-layout",message:`Text "${f.text||f.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:f.id})}for(let f of a.filter(y=>y.type==="shape")){if(f.eventConfigurationIds!==void 0){let L=f.eventConfigurationIds;Array.isArray(L)&&L.length>0&&L.length<=20&&L.every(T=>typeof T=="string"&&T.normalize("NFKC").trim()===T&&T.length>=1&&T.length<=100)&&new Set(L).size===L.length||n.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${f.label||f.id}" must reference 1 to 20 unique event configuration ids`,objectId:f.id})}if(f.heightM!==void 0&&(!Number.isFinite(f.heightM)||f.heightM<.05||f.heightM>50)&&n.push({severity:"error",code:"invalid-shape-height",message:`Shape "${f.label||f.id}" height must be between 0.05 m and 50 m`,objectId:f.id}),f.stroke!==void 0&&(!f.stroke||typeof f.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(f.stroke.color)||!Number.isFinite(f.stroke.width)||f.stroke.width<.5||f.stroke.width>40)&&n.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${f.label||f.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:f.id}),(f.lineCap!==void 0||f.lineJoin!==void 0||f.startEnding!==void 0||f.endEnding!==void 0)&&!It(f.kind)?n.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${f.label||f.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:f.id}):It(f.kind)&&(f.lineCap!==void 0&&!Xn.includes(f.lineCap)||f.lineJoin!==void 0&&!Yn.includes(f.lineJoin)||f.startEnding!==void 0&&!St.includes(f.startEnding)||f.endEnding!==void 0&&!St.includes(f.endEnding))&&n.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${f.label||f.id}" has an unsupported line cap, join, or ending`,objectId:f.id}),f.points!==void 0&&!Mt(f.points)){n.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${f.label||f.id}" points must be a list of points`,objectId:f.id});continue}if(f.kind==="polygon"){let L=Kn(f.points??[]);L.ok||n.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${f.label||f.id}" has invalid polygon geometry: ${L.message}`,objectId:f.id})}let h=Jn(f);if(h){for(let L of E)if(Qn(h,L.outline)){n.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${f.label??f.id}" overlaps section "${L.label}"`,objectId:f.id});break}}}}O>o&&n.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${O} bookable units; the maximum is ${o}`}),n.push(...I.slice(0,5)),I.length>5&&n.push({severity:"error",code:"duplicate-seat-label",message:`${I.length} seats share a label with another seat; the first 5 are listed above. Seat labels must be unique across the whole chart.`});for(let a of Ce(e)){let E=a.families[0]?.targets[0];i.push({severity:"warning",code:"category-inventory-family-conflict",message:xt(a),categoryKey:a.categoryKey,...E?{objectId:E.id,floorId:E.floorId}:{},relatedObjectIds:a.objectIds,categoryInventoryFamilies:a.families})}e.focalPoint||i.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),R===0&&i.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let a of u)if(l.get(a)===!1){let E=e.categories.find(f=>f.key===a);i.push({severity:"warning",code:"unpriced-category",message:`Category "${E?.label??a}" is used but has no price`,categoryKey:a})}return[...n,...i]}var Cr=9,po="#f7f8fb",kr="#f5f6f8",go="#8b93a7",Ar="#0b1220",Rr="#0b1220",Er="#ffffff",Or=100;function N(e,t=2){let o=10**t;return Math.round(e*o)/o}function D(e){return{source:"quality",...e}}function Lr(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function At(e){return Cr*Mn(e.theme?.seatScale)}function yo(e){let t=[];for(let o of e.objects)o.type==="row"?t.push(...U(o)):o.type==="table"&&t.push(...z(o));return t}function Pr(e){let t={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let o of e)for(let n of o.objects)n.type==="row"?t.rowSeats+=U(n).length:n.type==="table"?t.tableSeats+=z(n).length:n.type==="booth"?t.booths+=1:n.type==="gaArea"&&(t.gaCapacity+=Math.max(0,Math.floor(n.capacity)));return{inventoryByKind:t,bookableUnits:t.rowSeats+t.tableSeats+t.booths+t.gaCapacity}}function $(e,t){e.filter(o=>o.code===t.code).length<Or&&e.push(t)}function Tr(e,t,o){let n=At(e),i=2*n,r=2.3*n,s=0,l=0,u=1/0;for(let c of t){let d=new Map(c.objects.filter(I=>I.type==="row").map(I=>[I.id,I])),b=I=>{let A=c.objects.find(v=>v.id===I);if(!A||A.type!=="row"&&A.type!=="table")return"another seating object";let R=A.type==="row"?U(A):z(A),O=R.length?{x:R.reduce((v,C)=>v+C.x,0)/R.length,y:R.reduce((v,C)=>v+C.y,0)/R.length}:A.type==="row"?A.origin:A.center,P=c.objects.find(v=>v.type==="section"&&H(O,v.outline,v.holes)),M=A.type==="row"?`Row \u201C${A.label}\u201D`:`Table \u201C${A.label}\u201D`;return P?.type==="section"?`${M} in \u201C${P.label}\u201D`:M},p=yo(c);s+=p.length;let m=r,g=new Map,S=new Map;for(let I of p){let A=Math.floor(I.x/m),R=Math.floor(I.y/m);for(let M=-1;M<=1;M++)for(let v=-1;v<=1;v++){let C=g.get(`${A+M}:${R+v}`)??[];for(let x of C){l++;let w=Math.hypot(I.x-x.x,I.y-x.y);if(u=Math.min(u,w),w>=r)continue;let E=(I.rowId<x.rowId?[I.rowId,x.rowId]:[x.rowId,I.rowId]).join("|"),f=S.get(E);(!f||w<f.distance)&&S.set(E,{a:I,b:x,distance:w})}}let O=`${A}:${R}`,P=g.get(O)??[];P.push(I),g.set(O,P)}for(let I of S.values()){let A=I.a.rowId===I.b.rowId,R=d.get(I.a.rowId),O=d.get(I.b.rowId),P=!A&&R?.segmentedRow?.repeatLabelOnComponents===!0&&O?.segmentedRow?.repeatLabelOnComponents===!0&&R.segmentedRow.groupId===O.segmentedRow.groupId,M=!!R?.referenceScan&&!!O?.referenceScan&&R.referenceScan.assetId===O.referenceScan.assetId&&R.referenceScan.sectionId===O.referenceScan.sectionId,v=I.distance<i;if((P||M)&&!v)continue;let C=v?"seat-overlap":"seat-cramped",x=b(I.a.rowId),w=b(I.b.rowId),a=N(v?i:r);$(o,D({severity:"warning",code:C,dimension:"geometry",title:v?A?`${x} has overlapping seats`:`${x} and ${w} overlap`:A?`${x} has seats too close together`:`${x} and ${w} are too close together`,message:v?`The closest seats are ${N(I.distance)} chart units apart, so their markers overlap on the buyer map; at least ${a} keeps them apart.`:`The closest seats are ${N(I.distance)} chart units apart; at least ${a} are required.`,action:A?`Increase the seat spacing for ${x}, or use Review safe fixes.`:`Move ${x} or ${w} until they no longer overlap.`,objectId:I.a.rowId,relatedObjectIds:A?[I.a.rowId]:[I.a.rowId,I.b.rowId],floorId:c.id,measured:N(I.distance),minimum:a,autoFixable:A}))}}return{seats:s,checkedSeatPairs:l,minimumSeatDistance:Number.isFinite(u)?N(u):null}}function He(e){let{width:t,height:o}=$t(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:t,height:o};let n=[{x:0,y:0},{x:t,y:0},{x:t,y:o},{x:0,y:o}].map(i=>{let r=Bt(i,e.rotation);return{x:e.position.x+r.x,y:e.position.y+r.y}});return An(n)}function ho(e,t,o=0){return e.x<t.x+t.width+o&&e.x+e.width+o>t.x&&e.y<t.y+t.height+o&&e.y+e.height+o>t.y}function kt(e,t,o){let n=K(t.x,e.x,e.x+e.width),i=K(t.y,e.y,e.y+e.height);return(t.x-n)**2+(t.y-i)**2<o**2}function _r(e,t,o){let n=At(e),i=0;for(let r of t){let s=r.objects.filter(u=>u.type==="text"),l=yo(r);i+=s.length;for(let u=0;u<s.length;u++){let c=s[u],d=He(c),b=l.find(p=>kt(d,p,n));b&&$(o,D({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${c.text}\u201D overlaps seat ${b.label}`,objectId:c.id,relatedObjectIds:[c.id,b.rowId],floorId:r.id,autoFixable:!0}));for(let p=0;p<u;p++){let m=s[p];ho(d,He(m),2)&&$(o,D({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${c.text}\u201D overlaps text \u201C${m.text}\u201D`,objectId:c.id,relatedObjectIds:[c.id,m.id],floorId:r.id,autoFixable:!0}))}}}return i}function Ct(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function jr(e,t,o){let n=new Map;for(let l of t)for(let u of l.objects){let c=u.type,d=c==="row"||c==="table"||c==="booth"||c==="gaArea",b=d||c==="section";if(d&&!u.categoryKey.trim()){let p=c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth";$(o,D({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${p} \u201C${u.label||u.id}\u201D has no category`,message:`${p} \u201C${u.label||u.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:u.id,floorId:l.id,autoFixable:!1}))}if(b){let p=(u.type==="section"?u.displayLabel??u.label:u.label)??"";if(p.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let m=Ct(p),g=n.get(m);g&&g.raw!==p?$(o,D({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${p}\u201D and \u201C${g.raw}\u201D read as the same label`,message:`Labels \u201C${p}\u201D and \u201C${g.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:u.id,relatedObjectIds:[u.id,g.id],floorId:l.id,autoFixable:!1})):g||n.set(m,{id:u.id,raw:p})}}else{let m=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";$(o,D({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${m} has no label`,message:`${m} has an empty label; buyers rely on labels to identify what they are booking.`,action:"Give this object a short, unique label in the inspector.",objectId:u.id,floorId:l.id,autoFixable:!1}))}}}let i=[];for(let l of t){let u=l.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of l.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||u.some(b=>H(Y(b),c.outline,c.holes)))){if(c.referenceSource){i.push({id:c.id,floorId:l.id});continue}$(o,D({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.label}\u201D contains no rows, tables, booths, or GA areas.`,action:"Add seating inside this section (Fill with rows), or remove the empty section.",objectId:c.id,floorId:l.id,autoFixable:!1}))}}i.length&&$(o,D({severity:"warning",code:"empty-section",dimension:"structure",title:i.length===1?"1 traced section has no seating yet":`${i.length} traced sections have no seating yet`,message:`${i.length} section${i.length===1?"":"s"} traced from the reference image contain${i.length===1?"s":""} no rows, tables, booths, or GA areas.`,action:"Fill them with rows, or remove the ones the venue does not sell.",objectId:i[0].id,relatedObjectIds:i.map(l=>l.id),floorId:i[0].floorId,autoFixable:!1}));let r=new Map,s=new Map;for(let l of t){let u=[];for(let c of l.objects)c.type!=="section"||c.outline.length<3||u.push({id:c.logicalSectionId??c.id,outline:c.outline,...c.holes?{holes:c.holes}:{},bounds:Br(c.outline)});for(let c of l.objects){if(c.type!=="row")continue;let d=(c.segmentedRow?.displayLabel??c.displayLabel??c.label??"").trim(),b=(c.displayType??"").trim(),p=d&&b&&Ct(b)!=="row"?`${b} ${d}`:d,m="";if(u.length){let A=Y(c),R=u.find(O=>A.x>=O.bounds.minX&&A.x<=O.bounds.maxX&&A.y>=O.bounds.minY&&A.y<=O.bounds.maxY&&H(A,O.outline,O.holes));R&&(m=R.id)}let g=`${l.id}\0${m}\0${Ct(p)}`,S=c.segmentedRow?.groupId??c.id;if(!p){let A=`${l.id}\0${m}`,R=s.get(A);R?(R.ids.push(c.id),R.logical.set(S,[...R.logical.get(S)??[],c])):s.set(A,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id});continue}let I=r.get(g);I?(I.ids.push(c.id),I.logical.set(S,[...I.logical.get(S)??[],c])):r.set(g,{ids:[c.id],logical:new Map([[S,[c]]]),floorId:l.id,raw:p})}}for(let{ids:l,logical:u,floorId:c,raw:d}of r.values()){let b=u.size;b<2||fo([...u.values()])&&$(o,D({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${b} rows share the name \u201C${d}\u201D`,message:`${b} rows share the label \u201C${d}\u201D, so buyers cannot tell which row a seat belongs to.`,action:"Rename them so each row reads differently: for example the section or box each belongs to.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}for(let{ids:l,logical:u,floorId:c}of s.values()){let d=u.size;d<2||fo([...u.values()])&&$(o,D({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${d} rows have no name`,message:`${d} rows in the same area have no name and repeat each other\u2019s seat numbers, so buyers cannot tell which row a seat belongs to.`,action:"Give each of these rows a name, for example the box each belongs to, so a ticket can say which row a seat is in.",objectId:l[0],relatedObjectIds:l,floorId:c,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let l of e.floors)l.objects.length===0&&$(o,D({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${l.name}\u201D is empty`,message:`Floor \u201C${l.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:l.id,autoFixable:!1}))}var Nr=5,Fr=16;function Dr(e,t,o){for(let n of t){let i=n.focalPoint??e.focalPoint;if(i)for(let r of n.objects){if(r.type!=="section"||r.outline.length<3)continue;let{rake:s}=Se(r);if(s<Nr)continue;let l=r.outline.map(p=>Math.hypot(p.x-i.x,p.y-i.y)),u=Math.max(...l);if(u<=0)continue;let c=(u-Math.min(...l))/u;if(s*c<=Fr)continue;let b=r.displayLabel??r.label;$(o,D({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${b}\u201D is too deep for a single rake`,message:`Section \u201C${b}\u201D spans ${Math.round(c*100)}% of its distance to the stage at a ${Math.round(s)}\xB0 rake, so one rake can't represent its sightlines faithfully: a real tier this deep changes slope at a cross-aisle.`,action:"Split this section at the cross-aisle into two sections, each with its own rake.",objectId:r.id,floorId:n.id,autoFixable:!1}))}}}function $r(e,t,o){let n=e.theme?.background??po,i=kr,r=new Map;for(let c of t)for(let d of c.objects){if(d.type!=="gaArea")continue;let b=r.get(d.categoryKey)??[];b.push({id:d.id,floorId:c.id}),r.set(d.categoryKey,b)}for(let c of e.categories){let d=G(c.color,n),b=G(c.color,i);if(d==null||b==null){$(o,D({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${c.label}\u201D does not use a supported hex color`,categoryKey:c.key}));continue}let p=Math.min(d,b);p<3&&$(o,D({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${c.label}\u201D is hard to see`,message:`Category \u201C${c.label}\u201D reaches only ${N(p)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${c.label}\u201D until this warning clears.`,categoryKey:c.key,measured:N(p),minimum:3,autoFixable:!1}));let m=r.get(c.key)??[];if(m.length){let g=ht(c.color,n,yt),S=ht(c.color,i,yt),I=Math.min(G(g,n)??0,G(S,i)??0);I<3&&$(o,D({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${c.label}\u201D reaches only ${N(I)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:m[0].id,categoryKey:c.key,floorId:m[0].floorId,relatedObjectIds:m.map(A=>A.id),measured:N(I),minimum:3,autoFixable:!1}))}}for(let c=0;c<e.categories.length;c++)for(let d=0;d<c;d++){let b=e.categories[c],p=e.categories[d],m=kn(b.color,p.color);m!=null&&m<25&&$(o,D({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${b.label}\u201D and \u201C${p.label}\u201D look too similar`,message:`Categories \u201C${b.label}\u201D and \u201C${p.label}\u201D are only \u0394E ${N(m)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:b.key,measured:N(m),minimum:25,autoFixable:!1}))}for(let c of t){let d=c.objects.filter(b=>b.type==="text");for(let b of d){let p=b.color??e.theme?.textColor??go,m=G(p,n),g=b.fontSize>=18?3:4.5;(m==null||m<g)&&$(o,D({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${b.text}\u201D has ${N(m??0)}:1 contrast against the chart background; ${g}:1 is required`,objectId:b.id,floorId:c.id,measured:N(m??0),minimum:g,autoFixable:!0}))}}if(e.theme?.selectionColor){let c=G(e.theme.selectionColor,n);(c==null||c<3)&&$(o,D({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${N(c??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Selection color that stands out clearly from the Background color.",measured:N(c??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let c=G(e.theme.textColor,n);(c==null||c<3)&&$(o,D({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${N(c??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Text color with stronger contrast against the Background color.",measured:N(c??0),minimum:3,autoFixable:!1}))}let s=e.theme?.seatLabelColor??Ar,l=new Map,u=(c,d,b)=>{let p=l.get(c)??new Map,m=p.get(d)??[];m.push(b),p.set(d,m),l.set(c,p)};for(let c of t)for(let d of c.objects)if(d.type==="row")for(let b of ke(d).keys())u(b,"seat",d.id);else if(d.type==="table")for(let b of ke(d).keys())u(b,"table seat",d.id);else d.type==="booth"&&u(d.categoryKey,"booth",d.id);for(let c of e.categories){let d=l.get(c.key);if(d)for(let[b,p]of d){let m=b==="booth"?Tn:Pn,g=Nn(_n,600),S=Fn(c.color,s),I=G(S,c.color);(I==null||I<g)&&$(o,D({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${b==="booth"?"Booth":b==="seat"?"Seat":"Table-seat"} labels use ${m}u type and have ${N(I??0)}:1 contrast on category \u201C${c.label}\u201D; ${g}:1 is required for small text`,objectId:p[0],relatedObjectIds:p,measured:N(I??0),minimum:g,autoFixable:!0}))}}}function fo(e){if(e.length>24)return!0;let t=new Set;for(let o of e){let n=new Set;for(let i of o)for(let r of U(i)){let s=r.label,l=s.lastIndexOf("-");n.add(l>=0?s.slice(l+1):s)}if(!n.size)return!0;for(let i of n)if(t.has(i))return!0;for(let i of n)t.add(i)}return!1}function Br(e){let t=1/0,o=1/0,n=-1/0,i=-1/0;for(let r of e)r.x<t&&(t=r.x),r.y<o&&(o=r.y),r.x>n&&(n=r.x),r.y>i&&(i=r.y);return{minX:t,minY:o,maxX:n,maxY:i}}function Gr(e,t){for(let o of e){let n=o.objects.filter(i=>i.type==="section");if(!(n.length<2))for(let i of o.objects){if(!(i.type==="row"||i.type==="table"||i.type==="booth"||i.type==="gaArea"))continue;let s=Y(i),l=n.filter(m=>H(s,m.outline,m.holes)),u=new Map;for(let m of l){let g=m.logicalSectionId??m.id,S=u.get(g)??[];S.push(m),u.set(g,S)}if(u.size<2)continue;let c=[...u.values()],d=c.map(m=>`Section \u201C${m[0].displayLabel??m[0].label}\u201D`),b=d.length===2?d.join(" and "):`${d.slice(0,-1).join(", ")}, and ${d[d.length-1]}`,p=i.type==="gaArea"?"GA area":i.type==="row"?"Row":i.type==="table"?"Table":"Booth";$(t,D({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${p} \u201C${i.label}\u201D belongs to more than one section`,message:`${p} \u201C${i.label}\u201D has its center inside ${b}, so its buyer section is unclear.`,action:"Adjust the boundaries until this object sits in one Section. If the overlapping shapes are meant to form one Section, combine them first.",objectId:i.id,relatedObjectIds:[i.id,...c.flatMap(m=>m.map(g=>g.id))],floorId:o.id,autoFixable:!1}))}}}var Kr={structure:20,geometry:30,contrast:25,labels:15,navigation:10},Ur={"seat-overlap":15,"seat-cramped":4,"label-collision":4,"category-contrast-low":3,"ga-contrast-low":3,"category-colors-too-similar":3,"invalid-category-color":10,"text-contrast-low":4,"bookable-label-contrast-low":3,"selection-contrast-low":3,"theme-text-contrast-low":3,"missing-focal-point":10,"object-uncategorized":3,"object-unlabeled":3,"duplicate-object-label-normalized":2,"empty-section":2,"unused-floor":2,"ambiguous-section-ownership":4,"category-inventory-family-conflict":10};function Vr(e){let t={...Kr};for(let i of e){let r=i.severity==="error"?10:2;t[i.dimension]=Math.max(0,t[i.dimension]-(Ur[i.code]??r))}let o=Object.values(t).reduce((i,r)=>i+r,0),n=o>=95?"A":o>=85?"B":o>=70?"C":o>=55?"D":"F";return{overall:o,dimensions:t,errorFree:e.every(i=>i.severity!=="error"),grade:n}}var zr=new Set(["unpriced-category","object-uncategorized"]);function bo(e,t={}){let o=Ie(e),n=uo(e,{maxInventory:t.maxInventory}).filter(d=>d.code!=="missing-zone-focal-point"||t.requireExplicitZoneFocals).map(d=>{let b=d.objectId?o.find(g=>g.objects.some(S=>S.id===d.objectId))?.id:void 0,p=d.code==="category-inventory-family-conflict",m=p?e.categories.find(g=>g.key===d.categoryKey):void 0;return D({...d,...p?{severity:"error",title:`Category \u201C${m?.label??d.categoryKey??"Unknown"}\u201D spans incompatible inventory types`,action:"Show the affected objects, then review the safe category split. The repair preserves price, ticket tiers, accessibility assignments, and source provenance."}:{},...t.requireExplicitZoneFocals&&d.code==="missing-zone-focal-point"?{severity:"error"}:{},...b?{floorId:b}:{},source:"structural",dimension:Lr(d),autoFixable:p})}),i=Tr(e,o,n),r=Pr(o),s=_r(e,o,n);if(jr(e,o,n),Gr(o,n),Dr(e,o,n),$r(e,o,n),o.reduce((d,b)=>d+b.objects.filter(p=>p.type==="row"||p.type==="table"||p.type==="booth"||p.type==="gaArea").length,0)===0){let d=new Set(["missing-focal-point","no-bookables"]);for(let b=n.length-1;b>=0;b--)d.has(n[b].code)&&n.splice(b,1)}if(t.requirePricedInventory)for(let d=0;d<n.length;d++)zr.has(n[d].code)&&(n[d]={...n[d],severity:"error"});let u=n.filter(d=>d.severity==="error"),c=n.filter(d=>d.severity==="warning");return{issues:n,errors:u,warnings:c,metrics:{floors:o.length,objects:o.reduce((d,b)=>d+b.objects.length,0),seats:i.seats,bookableUnits:r.bookableUnits,inventoryByKind:r.inventoryByKind,categories:e.categories.length,freeTextLabels:s,checkedSeatPairs:i.checkedSeatPairs,minimumSeatDistance:i.minimumSeatDistance},score:Vr(n),deferredRules:["rendered-row-label-decollision","rendered-bookable-state-contrast","section-focus-opacity-and-backdrop","24px-pointer-hit-target","reference-image-diff","sightline-blocked","ga-density-high"]}}function Hr(e,t){if(e.seatCount<2||e.seatSpacing>=t)return!1;let o=he(U(e));e.seatSpacing=N(t,3);let n=he(U(e));return e.origin.x=N(e.origin.x+o.x-n.x,3),e.origin.y=N(e.origin.y+o.y-n.y,3),!0}function Xr(e,t){if(e.seatCount<2)return!1;let o=!1;if(e.shape==="round"){let n=K(e.seatArc??360,0,360),i=(n>=360?360/e.seatCount:n/(e.seatCount-1))*Math.PI/180;if(i>0){let r=t/(2*Math.sin(i/2)),s=Math.max(1,r-16);(e.radius??40)<s&&(e.radius=N(s,3),o=!0)}}else{let n=Me(e),i=Math.max(n.top,n.bottom),r=Math.max(n.left,n.right);i>1&&(e.width??80)/i<t&&(e.width=N(i*t,3),o=!0),r>1&&(e.height??50)/r<t&&(e.height=N(r*t,3),o=!0)}return o}function Yr(e){return[Rr,Er].map(o=>({color:o,minimum:Math.min(...e.map(n=>G(o,n)??0))})).sort((o,n)=>n.minimum-o.minimum)[0].color}function mo(e,t,o){let n=He(e),i=0;for(let r of t)r.type==="row"?i+=U(r).filter(s=>kt(n,s,o)).length:r.type==="table"?i+=z(r).filter(s=>kt(n,s,o)).length:r.type==="text"&&r.id!==e.id&&ho(n,He(r),2)&&i++;return i}function Wr(e,t,o){if(mo(e,t,o)===0)return!1;let i={...e.position},r=Math.max(12,e.fontSize*1.25),s=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let l=1;l<=12;l++)for(let[u,c]of s)if(e.position={x:N(i.x+u*r*l,3),y:N(i.y+c*r*l,3)},mo(e,t,o)===0)return!0;return e.position=i,!1}function xo(e,t={}){let o=JSON.parse(JSON.stringify(e)),n=bo(o,t),i=[],r=vt(o);if(r.changed){o=r.doc;for(let b of r.changes){let p=r.before.find(g=>g.categoryKey===b.categoryKey),m=p?.families.map(g=>g.label).join(", ")??"inventory families";i.push({code:"category-inventory-family-conflict",objectId:p?.objectIds[0],message:`Split category \u201C${b.categoryLabel}\u201D across ${m}; preserved its commercial metadata and reassigned ${b.reassignments.length} affected object${b.reassignments.length===1?"":"s"}`})}}let s=At(o),l=2.5*s,u=Ie(o);for(let b of u)for(let p of b.objects)if(p.type==="row"){let m=p.seatSpacing;Hr(p,l)&&i.push({code:m<2*s?"seat-overlap":"seat-cramped",objectId:p.id,message:`Expanded ${p.id} to the ${N(l)}u target pitch while preserving its centre`})}else p.type==="table"&&Xr(p,l)&&i.push({code:"seat-cramped",objectId:p.id,message:`Expanded ${p.id} so its perimeter seats meet the ${N(l)}u target pitch`});let c=o.theme?.background??po;for(let b of u)for(let p of b.objects){if(p.type!=="text")continue;let m=p.color??o.theme?.textColor??go,g=p.fontSize>=18?3:4.5;(G(m,c)??0)<g&&(p.color=Yr([c]),i.push({code:"text-contrast-low",objectId:p.id,message:`Changed ${p.id} to the highest-contrast black/white ink`}))}for(let b of u){let p=b.objects.filter(m=>m.type==="text");for(let m of p)Wr(m,b.objects,s)&&i.push({code:"label-collision",objectId:m.id,message:`Moved ${m.id} to the nearest collision-free deterministic label position`})}o.floors?.length&&(o.objects=o.floors[0].objects);let d=bo(o,t);return{doc:o,changed:i.length>0,fixes:i,before:n,after:d}}function Xe(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function Rt(e){return Xe(e).reduce((t,o)=>o.type==="row"?t+Be(o):o.type==="table"?t+vn(o):o.type==="gaArea"?t+Math.max(0,Math.floor(o.capacity)):o.type==="booth"?t+1:t,0)}function Zr(e){let t={};for(let n of e.categories??[])t[n.key]=0;let o=(n,i)=>{i>0&&(t[n]=(t[n]??0)+i)};for(let n of Xe(e))if(n.type==="row")for(let i of U(n))o(i.categoryKey,1);else if(n.type==="table")if(n.bookAsWhole||n.variableOccupancy)o(n.categoryKey,Math.max(0,Math.round(n.seatCount)));else for(let i of z(n))o(i.categoryKey,1);else n.type==="gaArea"?o(n.categoryKey,Math.max(0,Math.floor(n.capacity))):n.type==="booth"&&o(n.categoryKey,1);return t}function So(e){if(!e.template)return null;let t=Xe(e),o=t.filter(u=>u.type==="row"||u.type==="table"||u.type==="gaArea");if(!o.length)return null;let i=t.filter(u=>u.type==="booth").length+o.reduce((u,c)=>u+(c.type==="table"?2:1),0),r=Rt(e),s=Math.max(i+1,Math.min(5e4,r*4)),l=[.5,1,1.5,2].map(u=>K(Math.round(r*u),i,s));return{family:e.template.family,display:e.template.family.replace(/-/g," ").replace(/\b\w/g,u=>u.toUpperCase()),min:i,max:s,presets:["S","M","L","XL"].map((u,c)=>({size:u,seats:l[c]}))}}function vo(e){let t=U(e);return t.length?he(t):{...e.origin}}function qr(e,t){let o=So(e);if(!o)return structuredClone(e);let n=structuredClone(e),i=Xe(n),r=i.filter(m=>m.type==="row"||m.type==="table"||m.type==="gaArea"),s=i.filter(m=>m.type==="booth").length,l=Math.max(o.min,Math.min(o.max,Math.round(t))),u=l-s,c=r.map((m,g)=>{let S=m.type==="gaArea"?Math.max(0,Math.floor(m.capacity)):m.seatCount,I=m.type==="table"?2:1;return{object:m,index:g,current:S,minimum:I,value:I,fraction:0}}),d=c.reduce((m,g)=>m+g.minimum,0),b=Math.max(0,u-d),p=c.reduce((m,g)=>m+Math.max(1,g.current-g.minimum),0);for(let m of c){let g=b*Math.max(1,m.current-m.minimum)/p,S=Math.floor(g);m.value+=S,m.fraction=g-S}b=u-c.reduce((m,g)=>m+g.value,0),c.sort((m,g)=>g.fraction-m.fraction||m.index-g.index);for(let m=0;m<b;m++)c[m%c.length].value++;c.sort((m,g)=>m.index-g.index);for(let m of c)if(m.object.type==="row"){let g=vo(m.object);m.object.seatCount=m.value;let S=vo(m.object);m.object.origin.x+=g.x-S.x,m.object.origin.y+=g.y-S.y}else if(m.object.type==="table"){let g=m.object;if(g.seatCountsBySide){let S=["top","bottom","left","right"],I=Me(g),A=S.reduce((P,M)=>P+I[M],0)||1,R=S.map((P,M)=>{let v=m.value*I[P]/A;return{side:P,index:M,value:Math.floor(v),fraction:v-Math.floor(v)}}),O=m.value-R.reduce((P,M)=>P+M.value,0);R.sort((P,M)=>M.fraction-P.fraction||P.index-M.index);for(let P=0;P<O;P++)R[P%R.length].value+=1;R.sort((P,M)=>P.index-M.index),g.seatCountsBySide={top:R[0].value,bottom:R[1].value,left:R[2].value,right:R[3].value},g.sides=S.filter(P=>g.seatCountsBySide[P]>0)}g.seatCount=m.value,g.overrides&&(g.overrides=g.overrides.filter(S=>S.index<m.value),g.overrides.length||delete g.overrides)}else{let g=m.object;g.capacity=Z(g)?Math.min(m.value,ee):m.value,g.variableOccupancy&&(g.maxOccupancy=Math.min(g.maxOccupancy??g.capacity,g.capacity),g.minOccupancy=Math.min(g.minOccupancy??1,g.maxOccupancy)),g.wheelchairPlaces&&(g.wheelchairPlaces=Math.min(g.wheelchairPlaces,g.capacity))}return n.floors?.length&&(n.objects=n.floors[0].objects),n.template={family:n.template.family,targetSeats:l},n=xo(n).doc,n.template={family:e.template.family,targetSeats:Rt(n)},n}function pe(e){let t=Number(e.slice(e.lastIndexOf(":")+1));return Number.isFinite(t)?t:-1}function Qr(e,t,o){let n=new Map;for(let s of e){if(s.kind==="booth")continue;let l=n.get(s.rowId);l?l.push(s):n.set(s.rowId,[s])}let i=s=>o.has(s.id)||t(s.id)!=="free",r=[];for(let s of n.values())if(!(s.length<3)){s.sort((l,u)=>pe(l.id)-pe(u.id));for(let l=1;l<s.length-1;l++){let u=s[l];if(i(u))continue;let c=s[l-1],d=s[l+1];pe(u.id)-pe(c.id)!==1||pe(d.id)-pe(u.id)!==1||!i(c)||!i(d)||!o.has(c.id)&&!o.has(d.id)||r.push(u)}}return r}var Ot=1,Lt=100;function Io(e,t){if(!Number.isInteger(t)||t<Ot||t>Lt)return null;let o=e.rotation*Math.PI/180,n={x:Math.cos(o),y:Math.sin(o)},i={x:-n.y,y:n.x};return Array.from({length:t},(r,s)=>{let l=e.style==="intertwined"&&s%2===1?e.seatSpacing/2:0;return{type:"row",id:`__block_preview_${s}`,label:"",origin:{x:e.origin.x+i.x*s*e.rowGap+n.x*l,y:e.origin.y+i.y*s*e.rowGap+n.y*l},rotation:e.rotation,curve:e.curve,seatCount:e.seatsPerRow,seatSpacing:e.seatSpacing,categoryKey:"__preview__"}})}function Et(e,t=e.rowCount){let o=Io(e,t);return o?.length?Y(o[o.length-1]):null}function Jr(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||e.rowGap<=0)return null;let o=Et(e,1);if(!o)return null;let n=e.rotation*Math.PI/180,i={x:-Math.sin(n),y:Math.cos(n)},r=(t.x-o.x)*i.x+(t.y-o.y)*i.y,s=Math.max(Ot,Math.min(Lt,Math.round(r/e.rowGap)+1)),l=Et(e,s);return l?{rowCount:s,edgePoint:l}:null}function ea(e,t){return e.length!==t.rowCount?!1:[...e].sort((n,i)=>(n.rowBlockGeneration?.rowIndex??1/0)-(i.rowBlockGeneration?.rowIndex??1/0)).every((n,i)=>{let r=n.rowBlockGeneration;return r?.kind==="row-block-v1"&&r.groupId===t.groupId&&r.rowIndex===i&&r.signature===t.signature&&JSON.stringify(r)===JSON.stringify({...t,rowIndex:i})})}function wo(e){let t=(e%360+360)%360,o=t>=180?t-360:t;return Object.is(o,-0)||Math.abs(o)<1e-9?0:o}var ne=1,oe=300,Pt=330;function Oe(e){return e.seatCount>1?e.curve/(e.seatCount-1):0}function Mo(e,t){let o=e.rotation*Math.PI/180,n=Oe(e)*Math.PI/180,i,r;if(Math.abs(n)<1e-9)i=t*e.seatSpacing,r=0;else{let s=e.seatSpacing/(2*Math.sin(Math.abs(n)/2)),l=n*t;i=s*Math.sin(l),r=-s+s*Math.cos(l)}return{x:e.origin.x+i*Math.cos(o)-r*Math.sin(o),y:e.origin.y+i*Math.sin(o)+r*Math.cos(o)}}function ta(e,t,o){let n=(e??[]).map(i=>({...i,index:i.index+t})).filter(i=>i.index>=0&&i.index<o);return n.length?n:void 0}function Co(e,t){if(e.path||!Number.isInteger(t)||t<ne||t>oe)return null;let o=Oe(e);return{...e,seatCount:t,curve:o*(t-1)}}function ko(e,t){if(e.path||!Number.isInteger(t)||t<ne||t>oe)return null;let o=Oe(e),n=e.seatCount-t,i=-n;return{...e,origin:Mo(e,n),rotation:wo(e.rotation-o*n),seatCount:t,curve:o*(t-1),overrides:ta(e.overrides,i,t)}}function Ao(e,t=e.seatCount){let o=Co(e,t);return o?Mo(o,t-1):null}function Ro(e,t=e.seatCount){return ko(e,t)?.origin??null}function na(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let o=Oe(e),n=Math.abs(o)<1e-9?oe:Math.min(oe,Math.floor(Pt/Math.abs(o))+1),i=null;for(let r=ne;r<=Math.max(ne,n);r+=1){let s=Ao(e,r);if(!s)continue;let l=Math.hypot(s.x-t.x,s.y-t.y),u=o*(r-1);(!i||l<i.distance||l===i.distance&&r<i.seatCount)&&(i={seatCount:r,curve:u,endpoint:s,distance:l})}return i}function oa(e,t){if(e.path||!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let o=Oe(e),n=Math.abs(o)<1e-9?oe:Math.min(oe,Math.floor(Pt/Math.abs(o))+1),i=null;for(let r=ne;r<=Math.max(ne,n);r+=1){let s=Ro(e,r);if(!s)continue;let l=Math.hypot(s.x-t.x,s.y-t.y),u=o*(r-1);(!i||l<i.distance||l===i.distance&&r<i.seatCount)&&(i={seatCount:r,curve:u,endpoint:s,distance:l})}return i}var ge=class extends Error{constructor(o,n){super(n);this.objectId=o;this.name="GroupedTableProjectionError"}};function ia(e){let t=e.minOccupancy,o=e.maxOccupancy;if(!Number.isInteger(t)||!Number.isInteger(o)||t<1||o<t||o>e.seatCount)throw new ge(e.id,`Table "${e.label}" has invalid variable-occupancy bounds`);return{min:t,max:o}}function ra(e,t){if(t!==2)return[];let o=[];for(let n of Ge(e)){if(n.type!=="table"||!n.bookAsWhole&&!n.variableOccupancy)continue;if(n.bookAsWhole&&n.variableOccupancy)throw new ge(n.id,`Table "${n.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(n.seatCount)||n.seatCount<1||!n.label.trim())throw new ge(n.id,"Grouped tables require a label and at least one chair");let i=n.variableOccupancy?"variable":"whole",r=i==="variable"?ia(n):{min:n.seatCount,max:n.seatCount};o.push({objectId:n.id,label:n.label,...n.displayLabel?{displayLabel:n.displayLabel}:{},...n.displayType?{displayType:n.displayType}:{},categoryKey:n.categoryKey,mode:i,capacity:n.seatCount,minOccupancy:r.min,maxOccupancy:r.max,chairs:z(n)})}return o}function Oo(e){return Array.isArray(e.objects)}function Lo(e,t){if(t.seatsByLabel)return t.seatsByLabel;if(!Oo(e))throw new Error("ticketRestrictions: a categories-only chart document requires options.seatsByLabel");return new Map(Sn(e,{resolveEyeHeights:!1}).map(o=>[o.label,o]))}function Po(e){return{code:"ticket_option_not_applicable",labels:e,message:"That ticket choice is not available for the selected seat."}}function Ye(e,t){let o=e.applicability;return o?!(o.seatLabels?.length&&!o.seatLabels.includes(t.label)||o.accessibility?.length&&!o.accessibility.some(n=>t.accessibility?.includes(n))):!0}function aa(e,t){return(e.categories.find(o=>o.key===t.categoryKey)?.tiers??[]).filter(o=>Ye(o,t))}function Tt(e,t,o){let n=e.categories.find(r=>r.key===t.categoryKey)?.tiers;if(!n?.length)return{kind:"none"};let i=o==null?n.find(r=>Ye(r,t)):n.find(r=>r.id===o&&Ye(r,t));return i?{kind:"resolved",tier:i}:{kind:"invalid"}}function sa(e,t){return(e.logicalRowId??e.rowId)===(t.logicalRowId??t.rowId)}function Eo(e){if(Number.isInteger(e.logicalSeatIndex))return e.logicalSeatIndex;let t=e.id.slice(e.id.lastIndexOf(":")+1),o=Number(t);return Number.isInteger(o)?o:void 0}function ca(e,t){if(!sa(e,t))return!1;let o=Eo(e),n=Eo(t);return o!=null&&n!=null&&Math.abs(o-n)===1}function To(e,t,o={}){if(!t.length)return null;let n=Lo(e,o),i=t.flatMap(l=>{let u=n.get(l.label);return u?[{selection:l,seat:u}]:[]}),r=i.map(({seat:l})=>l).filter(l=>l.accessibility?.includes("wheelchair")),s=[];for(let{selection:l,seat:u}of i){let c=Tt(e,u,l.tierId),d=c.kind==="resolved"?c.tier:void 0;(u.accessibility?.includes("companion")||d?.restriction==="companion")&&!r.some(p=>p.id!==u.id&&ca(u,p))&&s.push(u.label)}return s.length?{code:"companion_pair_required",labels:s,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function la(e,t,o={}){if(!t.length)return null;let n=Lo(e,o),i=new Set(e.categories.filter(l=>l.notForSale).map(l=>l.key)),r=[],s=[];for(let l of t){let u=n.get(l.label);if(!u)continue;if(i.has(u.categoryKey)){r.push(u.label);continue}Tt(e,u,l.tierId).kind==="invalid"&&s.push(u.label)}return r.length?{code:"not_for_sale",labels:r,message:"These seats are not for sale."}:s.length?Po(s):To(e,t,{seatsByLabel:n})}0&&(module.exports={CATEGORY_INVENTORY_FAMILIES,DEFAULT_EVENT_INVENTORY_LIMIT,GA_UNIT_LABEL_PREFIX,GroupedTableProjectionError,LARGE_VENUE_INVENTORY_MODULE,MAX_DIRECT_ROW_SWEEP,MAX_EVENT_INVENTORY,MAX_GA_CAPACITY,MAX_ONE_PARTY_GUESTS,MAX_ROW_BLOCK_ROWS,MAX_ROW_SEATS,MIN_ROW_BLOCK_ROWS,MIN_ROW_SEATS,ONE_PARTY_LIMIT_MESSAGE,applicableTicketTiers,behindStageLabels,capacityControl,categoryCapacity,chartCapacity,companionSelectionIssue,describeCategoryInventoryConflict,effectiveSeatOwnerCategoryCounts,eventInventoryLimitFor,gaAreasOf,gaBoxBounds,gaBoxMode,gaInventorySegments,gaUnitLabel,gaUnitLabels,gaUnitLabelsForModel,gaWheelchairPlaceCount,gaWheelchairUnitLabels,groupedTableInventory,growJoinedGAInventory,inspectCategoryInventoryConflicts,intactRowBlockMembers,isFullChartDoc,isGaUnitLabel,pickBestAvailable,pickBestAvailableInventory,remediateCategoryInventoryConflicts,resizeChartCapacity,resolveRowBlockCount,resolveRowStartCapacity,resolveRowTerminalCapacity,resolveTicketTierForSeat,rowBlockEdgePoint,rowBlockPreviewRows,rowStartEndpoint,rowTerminalEndpoint,rowWithStartCapacity,rowWithTerminalCapacity,strandedSingles,ticketOptionNotApplicableIssue,ticketSelectionIssue,ticketTierAppliesToSeat,validGAInventorySegments});