@seatlayer/core 0.106.2 → 0.108.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 (157) hide show
  1. package/dist/ar-4XB54QTY.js +1 -0
  2. package/dist/be-KLZHDRIH.js +1 -0
  3. package/dist/bg-XMPNFAE4.js +1 -0
  4. package/dist/ca-WYT6ZG2G.js +1 -0
  5. package/dist/{categoryInventory-QTVDRqNG.d.ts → categoryInventory-BfYSZRQ-.d.ts} +1 -1
  6. package/dist/{categoryInventory-DYcNVyxN.d.cts → categoryInventory-D8g-kaQ4.d.cts} +1 -1
  7. package/dist/chunk-2BF6BWPQ.js +1 -0
  8. package/dist/{chunk-45W3GKPP.js → chunk-2JFCDE27.js} +1 -1
  9. package/dist/chunk-AMCYMFES.js +1 -0
  10. package/dist/{chunk-T7DQX3MB.js → chunk-FBXZWNND.js} +1 -1
  11. package/dist/{chunk-QXJEN5LV.js → chunk-GN7YFZEE.js} +1 -1
  12. package/dist/{chunk-6DZ2EVH2.js → chunk-JJQHRGLB.js} +1 -1
  13. package/dist/{chunk-RI4LNRP4.js → chunk-MRLWH6RC.js} +1 -1
  14. package/dist/{chunk-N562FZPD.js → chunk-UUIZHJYL.js} +1 -1
  15. package/dist/chunk-WRAPI4MD.js +1 -0
  16. package/dist/chunk-YE4NP3XB.js +1 -0
  17. package/dist/chunk-ZYQXT5JP.js +1 -0
  18. package/dist/core/chart-ops/index.cjs +1 -1
  19. package/dist/core/chart-ops/index.d.cts +8 -6
  20. package/dist/core/chart-ops/index.d.ts +8 -6
  21. package/dist/core/chart-ops/index.js +1 -1
  22. package/dist/core/inventory/index.cjs +1 -1
  23. package/dist/core/inventory/index.d.cts +4 -4
  24. package/dist/core/inventory/index.d.ts +4 -4
  25. package/dist/core/inventory/index.js +1 -1
  26. package/dist/core/layout/index.cjs +1 -1
  27. package/dist/core/layout/index.d.cts +9 -10
  28. package/dist/core/layout/index.d.ts +9 -10
  29. package/dist/core/layout/index.js +1 -1
  30. package/dist/core/quality/index.d.cts +3 -3
  31. package/dist/core/quality/index.d.ts +3 -3
  32. package/dist/core/render-assets/index.d.cts +2 -2
  33. package/dist/core/render-assets/index.d.ts +2 -2
  34. package/dist/core/render-assets/index.js +1 -1
  35. package/dist/core/seatConfidence.d.cts +1 -1
  36. package/dist/core/seatConfidence.d.ts +1 -1
  37. package/dist/core/sections/index.cjs +1 -1
  38. package/dist/core/sections/index.d.cts +5 -5
  39. package/dist/core/sections/index.d.ts +5 -5
  40. package/dist/core/sections/index.js +1 -1
  41. package/dist/cs-VI6ZFW3W.js +1 -0
  42. package/dist/cy-SSKV6GSC.js +1 -0
  43. package/dist/da-JTUYTKF7.js +1 -0
  44. package/dist/de-PTLT7LEG.js +1 -0
  45. package/dist/el-ITGBSCWL.js +1 -0
  46. package/dist/es-KUQQWYJ5.js +1 -0
  47. package/dist/et-MZFLMK6L.js +1 -0
  48. package/dist/{eventConfigurations-1sMqxBpq.d.cts → eventConfigurations-Bw1zW-6G.d.cts} +1 -1
  49. package/dist/{eventConfigurations-B7vGmmD3.d.ts → eventConfigurations-DD1i6TSa.d.ts} +1 -1
  50. package/dist/fa-A7LBVFTD.js +1 -0
  51. package/dist/fi-OYLJTXQY.js +1 -0
  52. package/dist/fr-L33SPCCR.js +1 -0
  53. package/dist/he-QSX5SF57.js +1 -0
  54. package/dist/hi-5DKU347L.js +1 -0
  55. package/dist/hr-7SY5XRY6.js +1 -0
  56. package/dist/hu-AQB3JN6P.js +1 -0
  57. package/dist/id-4TY5ZAHI.js +1 -0
  58. package/dist/index.cjs +1 -1
  59. package/dist/index.d.cts +15 -14
  60. package/dist/index.d.ts +15 -14
  61. package/dist/index.js +1 -1
  62. package/dist/it-IUWZG4Z6.js +1 -0
  63. package/dist/ja-4PMRPBSH.js +1 -0
  64. package/dist/ko-H5D35A6L.js +1 -0
  65. package/dist/ku-7Y7VDNCB.js +1 -0
  66. package/dist/{labeling-B-FQz2d2.d.cts → labeling-Bho4KGut.d.cts} +1 -1
  67. package/dist/{labeling-DqyXzIgw.d.ts → labeling-DABtLO2e.d.ts} +1 -1
  68. package/dist/localeLoaders-KSTMCSWV.js +1 -0
  69. package/dist/lt-ZES4SCGW.js +1 -0
  70. package/dist/{lv-3ZE6IM47.js → lv-LXAQ22CA.js} +1 -1
  71. package/dist/ms-VPTERFXE.js +1 -0
  72. package/dist/{nl-D4FX7T7U.js → nl-O7UK52HY.js} +1 -1
  73. package/dist/no-L7OELSHF.js +1 -0
  74. package/dist/{pl-RUXCR6JV.js → pl-XNMMBKRN.js} +1 -1
  75. package/dist/pt-YRDKXE7N.js +1 -0
  76. package/dist/{renderedQuality-CAkqqUxs.d.cts → renderedQuality-BHQnbC9M.d.cts} +1 -1
  77. package/dist/{renderedQuality-C3Gz1Yyw.d.ts → renderedQuality-DFbFLsci.d.ts} +1 -1
  78. package/dist/{renderer-D-N5RoL3.d.cts → renderer-BDdsk9AZ.d.cts} +1 -1
  79. package/dist/{renderer-C5tLduz1.d.ts → renderer-DiMguwVt.d.ts} +1 -1
  80. package/dist/ro-EZU7TACJ.js +1 -0
  81. package/dist/ru-7RNK67OV.js +1 -0
  82. package/dist/{seatTypeIcons-qlLxwByo.d.ts → seatTypeIcons-C_4CKG9D.d.ts} +1 -1
  83. package/dist/{seatTypeIcons-BTw3K-yP.d.cts → seatTypeIcons-DyJDDsaT.d.cts} +1 -1
  84. package/dist/{sections-dqlb491l.d.ts → sections-BHPs1PT8.d.ts} +1 -1
  85. package/dist/{sections-Cr6f5csG.d.cts → sections-BVrNW7Ne.d.cts} +1 -1
  86. package/dist/{segmentedRowModel-BSXPftwU.d.ts → segmentedRowModel-2c46otTs.d.ts} +1 -1
  87. package/dist/{segmentedRowModel-Dy_zNI1E.d.cts → segmentedRowModel-DPZ8VAbP.d.cts} +1 -1
  88. package/dist/sk-GA3IE3XR.js +1 -0
  89. package/dist/sl-W37U4474.js +1 -0
  90. package/dist/sr-7SZMN6JH.js +1 -0
  91. package/dist/sv-JSKU4AOJ.js +1 -0
  92. package/dist/{tableSizing-DzaJ08RF.d.ts → tableSizing-C8A2XC6C.d.ts} +3 -3
  93. package/dist/{tableSizing-CV8W2tXI.d.cts → tableSizing-Dj5yxEn5.d.cts} +3 -3
  94. package/dist/th-TUL4LIOY.js +1 -0
  95. package/dist/{ticketRestrictions-CJkUTyPM.d.ts → ticketRestrictions-DE79a54T.d.ts} +2 -2
  96. package/dist/{ticketRestrictions-Be7bbWPi.d.cts → ticketRestrictions-DsAql5wr.d.cts} +2 -2
  97. package/dist/tr-4DTHZSPV.js +1 -0
  98. package/dist/{types-CB1llwVg.d.cts → types-BZQ35nwD.d.cts} +3 -3
  99. package/dist/{types-CB1llwVg.d.ts → types-BZQ35nwD.d.ts} +3 -3
  100. package/dist/uk-QWTYZDPU.js +1 -0
  101. package/dist/vi-ZWTCP44F.js +1 -0
  102. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  103. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  104. package/dist/view3d/index.cjs +65 -79
  105. package/dist/view3d/index.d.cts +6 -4
  106. package/dist/view3d/index.d.ts +6 -4
  107. package/dist/view3d/index.js +57 -71
  108. package/dist/view3d/scene/scene.worker.cjs +1 -1
  109. package/dist/view3d/scene/scene.worker.js +1 -1
  110. package/dist/zh-Hans-B4CBZXWY.js +1 -0
  111. package/dist/zh-Hant-WMYDTUYW.js +1 -0
  112. package/package.json +1 -1
  113. package/dist/ar-D6ASWQBI.js +0 -1
  114. package/dist/be-T23MSCFC.js +0 -1
  115. package/dist/bg-2MMSY43I.js +0 -1
  116. package/dist/ca-EXRTYE33.js +0 -1
  117. package/dist/chunk-IFQFHR6Q.js +0 -1
  118. package/dist/chunk-J33DNOMI.js +0 -1
  119. package/dist/chunk-NXZ2GLII.js +0 -1
  120. package/dist/chunk-WGRLTDLW.js +0 -1
  121. package/dist/chunk-YGRBCSUI.js +0 -1
  122. package/dist/cs-L5EG7LLR.js +0 -1
  123. package/dist/cy-AB2Q6XHI.js +0 -1
  124. package/dist/da-EGJO7W4Q.js +0 -1
  125. package/dist/de-VXWKGCBD.js +0 -1
  126. package/dist/el-JW2YADAL.js +0 -1
  127. package/dist/es-N35HVHMD.js +0 -1
  128. package/dist/et-53UYPQR7.js +0 -1
  129. package/dist/fa-JL3HW42Q.js +0 -1
  130. package/dist/fi-ZFWROLPU.js +0 -1
  131. package/dist/fr-6EKBGKIT.js +0 -1
  132. package/dist/he-KSOTIRJW.js +0 -1
  133. package/dist/hi-RWHSYCVV.js +0 -1
  134. package/dist/hr-ECH5LYKR.js +0 -1
  135. package/dist/hu-BAXHRRWC.js +0 -1
  136. package/dist/id-ECFNLK3G.js +0 -1
  137. package/dist/it-HT57FDFI.js +0 -1
  138. package/dist/ja-LHVHSM5J.js +0 -1
  139. package/dist/ko-G2HVHBKT.js +0 -1
  140. package/dist/ku-MNPV6BJJ.js +0 -1
  141. package/dist/localeLoaders-STMEO2AW.js +0 -1
  142. package/dist/lt-GB2GJDNS.js +0 -1
  143. package/dist/ms-YH2PYOHG.js +0 -1
  144. package/dist/no-5YNLYHN4.js +0 -1
  145. package/dist/pt-TKFGIUL6.js +0 -1
  146. package/dist/ro-UFIOIOVH.js +0 -1
  147. package/dist/ru-VMRD53B7.js +0 -1
  148. package/dist/sk-XIK2KO3F.js +0 -1
  149. package/dist/sl-CDZGH6C6.js +0 -1
  150. package/dist/sr-A3TESNV3.js +0 -1
  151. package/dist/sv-HKGKDGSG.js +0 -1
  152. package/dist/th-ZPGRIY7D.js +0 -1
  153. package/dist/tr-IUB54G3R.js +0 -1
  154. package/dist/uk-JQKEV42K.js +0 -1
  155. package/dist/vi-KRM5S2Q7.js +0 -1
  156. package/dist/zh-Hans-FEUYIOYS.js +0 -1
  157. package/dist/zh-Hant-PK2XOE2G.js +0 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as zb,b as rr,c as Kb,d as sr,e as ar,f as tt,g as Xb,h as Yb,i as Ub,j as lr,k as $b,l as qb,m as cr,o as Rr,r as rt}from"./chunk-RI4LNRP4.js";import{a as xn,c as Ln,e as Gr,f as fi,h as Wr,j as Vr,m as zr}from"./chunk-YGRBCSUI.js";import{a as gy,b as li,c as by}from"./chunk-WR6VXY5U.js";import{d as Kr}from"./chunk-TGHNVDWA.js";import{a as mn,b as dy,c as hr,d as hy}from"./chunk-YPVYZYMH.js";import{a as cy,b as dr,c as Rt,d as Fr,e as _r,f as Br,g as Or}from"./chunk-LWBTU56C.js";import{b as Pr,e as vn,i as hi,k as Hr}from"./chunk-T7DQX3MB.js";import{a as Zb,b as Qb,c as jb,f as di}from"./chunk-IFQFHR6Q.js";import{b as ci,f as Lr,h as ot,i as Cr,j as Tr,l as Ir}from"./chunk-4N5CHKHD.js";import{A as Nr,b as Mt,c as ui,d as wn,e as Mr,f as Er,g as kn,l as Ar,n as pi,z as Dr}from"./chunk-JXIX3PNI.js";import{b as nr,c as or,l as xt}from"./chunk-M4NGX5NM.js";import{A as xr,B as ze,C as Sn,D as si,E as X,F as de,G as ai,a as me,b as yr,c as Ge,e as ge,f as ni,g as oi,h as Sr,i as It,j as We,k as Ve,l as G,n as vr,p as wr,q as kr,s as be,t as ye,w as nt,x as Pt,y as ri}from"./chunk-MADX5HYP.js";import{b as eb,c as Ko,d as tb,e as Xo,f as ib,g as nb,h as ob,i as rb,j as sb,k as ab,l as lb,m as cb,n as db,o as hb,p as ub}from"./chunk-R6BN4HDQ.js";import{a as Jb,b as ey,c as ty,d as iy,e as ny,f as oy,g as ry,h as sy,i as hn,j as un,k as ay,l as pn,m as Lt,n as fn,o as ly,p as Ct,q as ur,r as uy,s as it,t as pr,u as fr,v as mr,w as py,x as fy,y as my,z as gr}from"./chunk-N562FZPD.js";import{$a as ei,Ga as jo,Ia as Jo,J as Yo,Ka as Pb,L as Uo,La as Rb,Ma as Mb,N as q,Na as Eb,Oa as Ab,Pa as Fb,Qa as _b,Ra as Bb,Sa as Ob,Ta as Db,Ua as jt,Va as Nb,Wa as er,Xa as te,Ya as Jt,Za as Hb,_a as Gb,ab as Wb,ba as $o,bb as ti,ca as qo,cb as Vb,d as pb,da as Zo,db as tr,e as fb,eb as He,f as mb,fb as ir,g as gb,h as bb,i as yb,j as Sb,k as vb,ka as Qo,l as wb,m as kb,ma as Tb,n as xb,o as Lb,p as Cb,ua as Ae,va as Ib}from"./chunk-J33DNOMI.js";import"./chunk-S3VH7IDA.js";import{C as D,c as gn,h as bn,m as Tt,o as br,t as O,u as se,v as Fe,w as j,x as ii,z as yn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var yy=1,Cn=90;function Tn(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Xr(t,e,i,n=1){if(!Number.isFinite(t))return i;let o=Math.max(0,n);return i?t>=e-o:t>=e+o}function In(t,e,i,n=1){if(!Number.isFinite(t)||!(i>0))return t;let o=Math.max(0,n)/i;return e?t*(1+o):t*(1-o)}function Sy(t){let{point:e,camera:i,scale:n,nextScale:o}=t;if(!Number.isFinite(n)||n<=0||!Number.isFinite(o))return{...i};let r=(e.x-i.x)/n,s=(e.y-i.y)/n;return{x:e.x-r*o,y:e.y-s*o}}import{Konva as ji}from"konva/lib/Core";import{Stage as gg}from"konva/lib/Stage";import{Layer as Mo}from"konva/lib/Layer";import{Group as $t}from"konva/lib/Group";import{Circle as Od}from"konva/lib/shapes/Circle";import{Group as Kn}from"konva/lib/Group";import{Circle as Oe}from"konva/lib/shapes/Circle";import{Line as Un}from"konva/lib/shapes/Line";import{Rect as Xn}from"konva/lib/shapes/Rect";import{Text as ua}from"konva/lib/shapes/Text";var J=9,Se=.9,Q=.55*Se,ie=G/me,st=4,ue=14,Yr=10;var Ur=14;var Le=.45*Se,ve=.9*Se,ae=(Le+ve)/2,$r=Math.max(Se*1.1,ve),we=8,qr=700,ee=2,Et=G,Bh=12,Oh=12;function Zr(t){return t<U?Oh:Bh}var mi=.85,Qr=G,At=64,Ke=.55*Le,jr=700,Jr=120,es=2500,ts=420,is=420,ns=1,Xe=1,os=2,at=16,_e=12,Pn=[.85,.72,.62],Dh=10,Nh=9;function gi(t){return t<U?Nh:Dh}var bi=13,yi=12,rs=0,ss="600",as="500",ls=8,cs=5,ds=10,hs=6,us=8,ps=.6,fs=.7,ms=[0,18,-18,36,-36,54,-54],Ce="600",gs="500",U=640,bs=Ce,ys="400",Be=0,Ss=14,vs=.34,ws=.92,ks=7,xs=3;function Si(t){return Math.min(1,Math.max(_e/at,t/900))}function lt(t,e){return Math.max(_e,t*Si(e))}var Hh=.5,Gh=1.15,Ls=2,Cs=3,Ts=22,Wh=8,Vh=6;function Ft(t){return t<U?Vh:Wh}var Rn=.08;function Mn(t,e,i,n,o=Hh,r=_e){let s=t*Si(e),a=Math.max(r*(1+Rn),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*Gh);return Math.min(c,a*l)}var Is=.1,_t=1.02;var vi=1.25;function Ps(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var zh="#e5e7eb",Kh="#c7cbd1",Xh="#6b7280",Yh=["#6b7280","#5b6470","#4b5563","#374151"],Uh=["#cbd5e1","#e2e8f0","#f8fafc"],$h="#d1d5db",qh="#b8bdc4",Zh="#273142",Qh="#526078",jh="#f1f5f9",Jh="#374151",eu="#64748b",tu="#111827",Rs="#6b7280",Ms="#374151";var Es="#4b5563",As=.4,Te=.16,Fs="rgba(244,246,248,0.06)",wi=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function _s(t,e,i){let n=new Map;for(let s of t){let a=e(s);!a||i(a)||n.set(a,(n.get(a)??0)+1)}let o=null,r=0;for(let[s,a]of n)(a>r||a===r&&o!=null&&s<o)&&(o=s,r=a);return o}function le(t){return O(t)?{sectionFill:zh,sectionStroke:Kh,sectionInk:Xh,focalFill:$h,focalStroke:qh}:{sectionFill:Zh,sectionStroke:Qh,sectionInk:jh,focalFill:Jh,focalStroke:eu}}function En(t,e){let i=t.sectionFill,n=O(i),o=n?se(i,.6):yn(Fe(i,.2),.85);switch(e){case"closed":return n?se(i,.4):Fe(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Bs=.28,Os=.42,iu=.55,nu=.7;function Ds(t,e,i){let n=le(t),o=En(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=O(t);return{fill:j(o,i,r?Os:Bs),stroke:D(i,r?nu:iu)}}var ou=.03;function Ns(t,e){let i=le(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>En(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&An(t,e)}function An(t,e){let i=gn(e);if(!i)return!1;let n=le(t),o=Math.max(Bs,Os)+ou;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=gn(En(n,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=o:!1})}var ru="#f8fafc",su="#f4f6fb",au="#111827",lu=.72;function Hs(t){let e=O(t),i=e?ru:tu,n=e?au:su,o=j(n,i,1-lu);return{plate:i,ink:n,subInk:Tt(o,i)>=br?o:n}}function Gs(t,e,i,n){if(e)return e;let o=O(i)?Uh:Yh;for(let r of[i,...o])if(Tt(r,t)>=n)return r;return de(t,e,i,n)}var cu=.45,du=.3,hu=.1,uu=5;function Ws(t,e,i){let n=O(e)?Fe:se,o=yn(n(t,cu),du);for(let r=0;r<uu;r+=1){if(Tt(o,e)>=i)return o;o=n(o,hu)}return Tt(o,e)>=i?o:de(e,null,o,i)}import{Shape as fu}from"konva/lib/Shape";import{Circle as mu}from"konva/lib/shapes/Circle";import{Rect as gu}from"konva/lib/shapes/Rect";var pu={M:2,L:2,Q:4,C:6,Z:0},Fn=new Map;function _n(t){let e=Fn.get(t);if(e)return e;let i=ot(t);if(!i)return Fn.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=pu[s];if(a===void 0||r+a>n.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=n.slice(r,r+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${t}".`);r+=a,s==="M"||s==="L"?o.push({command:s,points:l}):s==="Q"?o.push({command:s,points:l}):s==="C"?o.push({command:s,points:l}):o.push({command:"Z",points:[]})}return Fn.set(t,o),o}function Vs(t,e,i,n=0,o=0){let r=_n(e),s=Lr(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=Cr(s,i);t.save(),t.translate(n,o),t.scale(a.scale,a.scale),t.translate(-a.centreX,-a.centreY);for(let l of r)l.command==="M"?t.moveTo(l.points[0],l.points[1]):l.command==="L"?t.lineTo(l.points[0],l.points[1]):l.command==="Q"?t.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?t.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):t.closePath();return t.restore(),!0}function zs(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ye=class extends fu{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=_n(n),r=this.attrs.seatGlyphDetail,s;if(r===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;s=i*2*c>=16}else s=r;if(!o.length||!s){zs(e,i),e.fillStrokeShape(this);return}e.beginPath(),Vs(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){zs(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function Bn(t,e){return t==="circle"||!ot(t)?null:new Ye({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:t,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Ks(t){let{x:e,y:i,radius:n}=t;return t.wheelchairBay?new gu({x:e,y:i,width:n*2,height:n*2,offsetX:n,offsetY:n,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Bn(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new mu({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function bu(t,e){return t*2*e>=16}function Xs(t,e,i,n){let o=bu(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function ki(t){return t?.35:.3}function $s(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let n=t/.45;return 1+e*(1-(1-n)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function On(t){let e=t<=0?0:t>=1?1:t,i=1-(1-e)**3;return{radiusScale:1+(2.5-1)*i,opacity:.55*(1-e)}}var qs=700,yu=2400,Dn=12,Zs=30,Ys=1,Su=1.16,Us=.5,vu=1;function Nn(t){return t*.61803398875%1}function Qs(t,e){let n=((t/yu+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:Ys+(Su-Ys)*o,opacity:Us+(vu-Us)*o}}var Js;function ea(t){Js=t}function wu(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var js=new Map;function ku(t,e){let i=t??Js,n=`${i??""}|${JSON.stringify(e)}`,o=js.get(n);return o||(o=new Intl.DateTimeFormat(i,e),js.set(n,o)),o}var xu={dateStyle:"medium",timeStyle:"short"};function ta(t,e={}){let{locale:i,...n}=e,o=wu(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:xu;return ku(i,r).format(o)}var Oy="USD";function Dy(t,e){return t?.trim()||e?.trim()||"USD"}var Ny=["USD","EUR","GBP","CAD","AUD","INR","AED","SAR","KWD","QAR","BHD","OMR","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL","ARS","CLP","COP","PEN","UYU","IDR","PHP","THB","VND","MYR","NGN","GHS","KES","UGX","TZS","RWF","XAF","XOF","EGP"],Gn;function na(t){Gn=t}function Hy(){return Gn??"en"}var ia=new Map;function Hn(t,e,i,n){let o=n??Gn,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=ia.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),ia.set(r,s)),s}function Ue(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return Hn(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let o=i??(Number.isInteger(t)?0:void 0);return Hn(e,o,o,n).format(t)}var Lu={BIF:0,CLP:0,DJF:0,GNF:0,JPY:0,KMF:0,KRW:0,MGA:0,PYG:0,RWF:0,UGX:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,BHD:3,IQD:3,JOD:3,KWD:3,LYD:3,OMR:3,TND:3};function Cu(t="USD"){return Lu[t.toUpperCase()]??2}function Tu(t,e="USD"){return t/10**Cu(e)}function Gy(t,e="USD",i){return Ue(Tu(t,e),e,void 0,i)}function Wy(t="USD"){return Hn(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Bt={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired and the seats were released. Pick again.","picker.holdExpiredTitle":"Your seats were released","picker.holdExpiredBody":"Your hold time ran out and the seats went back on sale.","picker.holdExpiredRestart":"Choose seats again","picker.holdExpiredPickAgain":"Pick your seats again to continue. They may already be taken.","picker.releasedPair":"{first} \xB7 {second}","picker.releasedSeatPlace":"Section {section}, Row {row}, Seat {seat}","picker.releasedSeatRange":"Section {section}, Row {row}, Seats {from}\u2013{to}","picker.releasedInSection":"{seats} in Section {section}","picker.releasedInSections":"{seats} in Sections {sections}","picker.releasedGa":"{quantity} \xD7 {area}","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.testModeExplained":"Bookings here are not real and no card is charged","picker.findClosestSeatsTogether":"Find the closest seats together","picker.findSeatsTogether":"Find seats together","picker.addSeat":"Add seat","picker.removeSeat":"Remove seat","picker.added":"Added","picker.findSeats":"Find seats","picker.findBestSeats":"Find best seats","picker.displayOptions":"Display options","picker.closeVenueNavigation":"Close venue navigation","picker.orphanHint":"This leaves a single seat stranded. Consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.noWheelchairSpace":"NO WHEELCHAIR SPACE","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview: groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks: sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats: blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.aisleSeat":"Aisle seat","picker.boothType.inline":"Inline booth \xB7 1 open side","picker.boothType.corner":"Corner booth \xB7 2 open sides","picker.boothType.peninsula":"Peninsula booth \xB7 3 open sides","picker.boothType.island":"Island booth \xB7 4 open sides","picker.gaBookWholeArea":"Book the whole area","picker.gaBook":"Book","picker.noWheelchairSpace":"No wheelchair space","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count}. Showing best overall","picker.loading3d":"Building the 3D venue\u2026","picker.unavailable3d":"3D could not start. The seat map is still available.","picker.jumpToSection":"Jump to section","picker.salesClosedPill":"Sales are closed","picker.salesClosedCopy":"Ticket sales for this event have ended.","picker.salesNotOpenPill":"Sales haven\u2019t opened yet","picker.salesNotOpenCopy":"Tickets for this event aren\u2019t on sale yet.","picker.salesPausedPill":"Sales are paused","picker.salesPausedCopy":"Ticket sales are paused for now.","picker.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total}. You won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types. Tap one below to show just those seats.","picker.aboutTicketPrices":"About ticket prices","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now.","picker.accessExpiredTitle":"The seat map timed out","picker.accessInvalidBody":"You can still book anything shown as available. Contact whoever sent you here for access to the rest.","picker.accessInvalidTitle":"We couldn\u2019t verify your access","picker.accessPausedBody":"The organizer has paused this selection. Try again in a few minutes.","picker.accessPausedTitle":"These seats are on hold right now","picker.accessRefresh":"Refresh","picker.accessRetry":"Try again","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.idlePausedBody":"You were away for a while. Refresh to see which seats are free now.","picker.idlePausedTitle":"Your session expired","picker.idleRefresh":"Show latest seats","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addMinutes":"+{count} min","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Areas","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held. Please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.aboutBestSeats":"About finding seats together","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessSpreadHint":"{count} accessible spaces in {sections} sections \xB7 tap a highlighted section","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time. Please head to checkout now.","picker.savedSeatsNotRestored":"Your earlier seats could not be restored. Please choose again.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.dragToLookTouch":"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close","picker.dragToLookMouse":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party \xB7 {typeWord}","picker.fullScreen":"Full screen","picker.generalAdmission":"General admission","picker.guestCountCouldNotBeSecured":"That guest count could not be secured. Your current table hold is unchanged.","picker.guestCountNoLongerAvailable":"That guest count is no longer available. Your current hold is unchanged.","picker.guests":"Guests","picker.guestsCount":"{count} guests","picker.guestsCountEdit":"{count} guests \xB7 Edit","picker.held":"Held","picker.heldByOther":"Held by another buyer, may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.hidePanel":"Hide panel","picker.hideTicketPanel":"Hide the ticket panel","picker.holdSeatsAndCheckout":"Hold seats & checkout","picker.howOfferWorks":"How the {name} offer works","picker.interactive3dVenueView":"Interactive 3D venue view","picker.keepMine":"Keep mine","picker.labelNoLongerAvailable":"{label} is no longer available.","picker.labelRemoved":"{label} removed.","picker.labelRemovedFromHold":"{label} removed from your hold.","picker.labelRestored":"{label} restored.","picker.labelsNoLongerAvailable.one":"{labels} is no longer available. Choose another seat.","picker.labelsNoLongerAvailable.other":"{labels} are no longer available. Choose another group.","picker.leftCount.one":"{count} left","picker.leftCount.other":"{count} left","picker.levelNumber":"Level {number}","picker.levels":"Levels","picker.loadingSeatMap":"Loading seat map\u2026","picker.lookAroundLive3d":"Look around in live 3D","picker.manualTicketsRemovedNote":"Your manually selected tickets will be removed only after a new group is secured.","picker.map":"Map","picker.mapDidNotLoad":"The seat map didn\u2019t load","picker.eventUnavailableTitle":"This event isn\u2019t available","picker.eventUnavailable":"Tickets can\u2019t be booked here right now.","picker.maxTicketsForOrder":"You can select up to {count} tickets for this order.","picker.selectExactMore":"Select {count} more","picker.selectExactCount":"Select exactly {count} tickets","picker.selectMinimumMore":"Select {count} more","picker.adjustSeatSelection":"Adjust seat selection","picker.selectSeatsTogether":"Choose seats together in the same row and ticket category.","picker.minToMaxGuests":"{min} to {max} guests","picker.more":"More","picker.moreCount":"+{count} more","picker.showLess":"Show less","picker.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreTimeAdded":"More time added. Your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notForSale":"Not for sale","picker.notAvailable":"Not available","picker.notForSaleExplanation":"This seat is not included in the current sale.","picker.numberOfGuests":"Number of guests","picker.offerDetailActive":"This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over.","picker.offerDetailUpcoming":"Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts.","picker.offerRemainingAvailable":"{count} available","picker.offerStarts":"starts {time}","picker.offerUntil":"until {time}","picker.oneSeatSaved":"1 seat saved","picker.oneSeatSavedChooseAnother":"One seat saved; choose another to compare","picker.openAuthored360":"Open venue 360\xB0","picker.openComparison":"Open comparison","picker.openComparisonOfSeats":"Open comparison of {count} seats","picker.openTicketPanel":"Open ticket panel","picker.peekFromPrice":"From {price}","picker.peekTicketsTotal.one":"{count} ticket \xB7 {total}","picker.peekTicketsTotal.other":"{count} tickets \xB7 {total}","picker.perGuestPrice":"{price} per guest","picker.pickYourSeats":"Pick your seats","picker.preferredTicketType":"Preferred ticket type","picker.preferredVenueZone":"Preferred venue zone","picker.priceNotSupplied":"Price not supplied","picker.removeHeldTicketLabel":"Remove held ticket {label}","picker.removeSeatLabel":"Remove {label}","picker.removeTicketsUntilOrFewer":"Remove tickets until your order has {count} or fewer.","picker.replaceCurrentChoices":"Replace your current choices?","picker.review":"Review","picker.row":"Row","picker.rowLabel":"Row {label}","picker.saveToCompare":"Save to compare","picker.savedForComparison":"Saved for comparison","picker.savedSeatComparison":"Saved seat comparison","picker.scheduledOffer":"Scheduled offer","picker.seat":"Seat","picker.seatCount.one":"{count} seat","picker.seatCount.other":"{count} seats","picker.seatJustTakenByAnother":"Seat {label} was just taken by another buyer.","picker.seatLabel":"Seat {label}","picker.seatNoLongerAvailable":"That seat is no longer available.","picker.seatNoLongerYours":"Some seats are no longer available to you. They have been removed from your order.","picker.seatNumberLower":"seat {label}","picker.seatSalesClosedForEvent":"Seat sales have closed for this event.","picker.maintenancePaused.one":"Booking is paused for maintenance. Please try again in about {count} minute.","picker.maintenancePaused.other":"Booking is paused for maintenance. Please try again in about {count} minutes.","picker.maintenancePausedShortly":"Booking is paused for a few minutes for maintenance. Please try again shortly.","picker.seatSelection":"Seat selection","picker.seatStatusLegend":"Seat status legend","picker.seatTaken":"Someone else took a seat you had picked. It has been removed from your order.","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.seeItIn3d":"See it in 3D","picker.select":"Select","picker.selectSeats":"Select seats","picker.selectTable":"Select table","picker.selectWholeTable":"Select whole table","picker.selected":"Selected","picker.selectingEllipsis":"Selecting\u2026","picker.showAllSeats":"Show all seats","picker.showAllTicketTypes":"Show all {count} ticket types","picker.showFewer":"Show fewer","picker.showLabelSeatsOnMap":"Show {label} seats on the map","picker.showTicketPanel":"Show the ticket panel","picker.sold":"Sold","picker.soldOutCopy":"No reserved seats are currently available for this event.","picker.soldOutEyebrow":"This event","picker.soldOutTitle":"Sold out","picker.soldSeatExplanation":"This seat has already been booked.","picker.statusAvailable":"available","picker.statusOnHold":"on hold","picker.statusTaken2":"taken","picker.table":"Table","picker.tableCapacity":"Table capacity","picker.tableUpdatedForGuests":"{label} updated for {count} guests.","picker.temporarilyHeld":"Temporarily held","picker.ticketPrices":"Ticket prices","picker.ticketTypeNotChanged":"That ticket type is not available for this seat. Your hold is unchanged.","picker.ticketTypeSoldOut":"That ticket type is sold out. Try another ticket type.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} ticket","picker.ticketsCount.other":"{count} tickets","picker.toggleColorblindColors":"Toggle colorblind-friendly colors","picker.total":"Total","picker.trayHintTapOrBest":"Tap a seat on the map, or let us pick the best available for you.","picker.aboutYourSeats":"How to choose seats","picker.trayHintTapOrStanding":"Tap a seat on the map or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating\u2026","picker.venueView":"Venue view","picker.recentreOnStage":"Recentre on the stage","picker.stopYourSeat":"Your seat","picker.stopYourRow":"Your row","picker.stopYourSection":"Your section","picker.stopWholeVenue":"Whole venue","picker.viewFromHere":"View from here","picker.viewFromYourSeat":"view from your seat","picker.fromYourSeat":"from your seat","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We\u2019ll choose the closest available group for you.","picker.willFindSeatsTogether":"We\u2019ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.fitWholeVenue":"Show whole venue","picker.dragToRotateVenue":"Drag to rotate the venue","picker.dragToMoveVenue":"Drag to move the venue","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & areas","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances","checkout.free":"Free","checkout.confirmBooking":"Confirm booking","checkout.price":"Price","checkout.freeNote":"This event is free. Nothing is charged.","checkout.confirmingBooking":"Confirming your booking\u2026","checkout.confirmingSeats":"Confirming your seats\u2026","checkout.busyRetryingBooking":"Busy right now. Still confirming your booking\u2026","checkout.busyRetryingPayment":"Busy right now. Still opening secure payment\u2026","checkout.busyFailedBooking":"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.busyFailedPayment":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.seatsUnavailable":"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.","checkout.title":"Checkout","checkout.back":"Back to seats","checkout.heldFor":"Seats held for {time}","checkout.yourOrder":"Your order","checkout.row":"Row {row}","checkout.seat":"Seat {seat}","checkout.quantity":"{label} \xD7 {count}","checkout.showAll":"Show all {count} seats","checkout.yourDetails":"Your details","checkout.email":"Email","checkout.emailHint":"Your tickets are sent here.","checkout.name":"Name","checkout.namePlaceholder":"Your name","checkout.optional":"Optional","checkout.forSomeoneElse":"Ticket for someone else?","checkout.holderYou":"You \xB7 {name}","checkout.holderYouPlain":"You","checkout.change":"Change","checkout.changeHolder":"Change the holder of {ticket}","checkout.addNames":"Add names for each ticket","checkout.questions":"A few questions","checkout.payWith":"Pay with","checkout.continue":"Continue to payment","checkout.continueTest":"Continue to test payment","checkout.tryAgain":"Try again","checkout.trust":"Secure payment on the organizer\u2019s payment page. We never see your card.","checkout.freeTrust":"Free booking. Nothing is charged.","checkout.testStrip":"No real charge \xB7 tickets not valid for entry","checkout.testStripFree":"Test booking \xB7 tickets not valid for entry","checkout.privacy":"The organizer and SeatLayer use your details to issue and manage your tickets.","checkout.privacyLink":"Privacy Policy","checkout.expiringSoon":"Your seats are held for {time}. Finish soon to keep them.","checkout.opening":"Opening secure payment\u2026","checkout.redirectTitle":"Taking you to secure payment","checkout.redirectBody":"You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.","checkout.waitingPayment":"Waiting for payment\u2026","checkout.dontClose":"Don\u2019t close this tab.","checkout.confirmingTitle":"Confirming your seats","checkout.paymentReceived":"Payment received. This usually takes a few seconds.","checkout.noNeedPayAgain":"You don\u2019t need to pay again.","checkout.stillConfirmingTitle":"Still confirming","checkout.stillConfirming":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.","checkout.nothingCharged":"Nothing was charged.","checkout.expiredTitle":"Your seats were released","checkout.expiredBody":"The hold on {seats} ran out before payment started.","checkout.chooseAgain":"Choose seats again","checkout.takenTitle":"Those seats were just taken","checkout.takenBody":"Someone booked {seats} while you were filling this in.","checkout.chooseOther":"Choose other seats","checkout.networkTitle":"Couldn\u2019t reach checkout.","checkout.networkBody":"Check your connection and try again. Nothing was charged, and your seats are still held.","checkout.error.email":"Enter an email like name@example.com.","checkout.error.notTakingPayments":"This event is not taking online payments yet. Contact the organizer to buy these seats.","checkout.error.accessEnded":"Your access to this private sale has ended. Nothing was charged. Ask whoever sent you the link for a new one.","checkout.error.holdReleased":"Your seats were released before checkout started. Nothing was charged. Please pick again.","checkout.error.releasedBeforePayment":"Your seats were released before payment completed. Nothing was charged. Please pick again.","checkout.error.paymentFailed":"The payment did not complete. If you were charged, it has been refunded automatically.","checkout.error.alreadyStarted":"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.","checkout.error.eventClosed":"Sales for this event have closed.","checkout.error.salesPaused":"Ticket sales are paused for a moment while the organizer updates their account. Nothing was charged. Please try again later or contact the organizer.","checkout.error.pricing":"These seats can\u2019t be checked out right now because of a pricing setup problem. Nothing was charged. Please contact the organizer.","checkout.error.providerRefused":"The organizer\u2019s payment setup refused this payment. Nothing was charged. Please contact the organizer.","checkout.error.rateLimited":"Too many attempts. Wait a moment and try again.","checkout.error.generic":"We couldn\u2019t start the payment. Nothing was charged. Please try again.","checkout.goingTo":"You\u2019re going to {event}","checkout.confirmedTitle":"Your tickets are confirmed","checkout.sentTo":"Your tickets and QR codes are on their way to {email}, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.sentToYourEmail":"Your tickets and QR codes are on their way to your email, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.viewTickets":"View tickets & QR codes","checkout.paid":"Paid","checkout.order":"Order","checkout.keepLink":"Keep this link. It opens your tickets any time: no login, and it does not expire.","checkout.copy":"Copy","checkout.copied":"Copied","checkout.selectCopy":"Select & copy","checkout.linkCopied":"Link copied.","checkout.clipboardBlocked":"Your browser blocked the clipboard. The link is selected, press \u2318C / Ctrl+C.","bookingForm.ticketHolders":"Ticket holders","bookingForm.bookingQuestions":"About your booking","bookingForm.ticketNumber":"Ticket {number}","bookingForm.guestOf":"{area} \xB7 Guest {index} of {total}","bookingForm.useMyDetails":"Use my details","bookingForm.syncedHint":"Filled in from your details above.","bookingForm.name":"Name","bookingForm.email":"Email","bookingForm.phone":"Phone","bookingForm.optional":"(optional)","bookingForm.fixErrors":"Some details need attention before you continue.","bookingForm.error.required":"{field} is required.","bookingForm.error.tooLong":"{field} must be {max} characters or fewer.","bookingForm.error.email":"{field} must be a valid email address.","bookingForm.error.phone":"{field} must be 6\u201320 characters: digits, spaces, + - ( ).","bookingForm.error.number":"{field} must be a number.","bookingForm.error.date":"{field} must be a date.","bookingForm.error.choice":"Choose a valid option for {field}.","bookingForm.error.invalid":"Check {field}.","tickets.editNames":"Edit names","tickets.editNamesHint":"You can correct names until the event starts.","tickets.saveNames":"Save names","tickets.savingNames":"Saving\u2026","tickets.cancel":"Cancel","tickets.namesSaved":"Names updated.","tickets.editClosed":"Names can\u2019t be changed after the event starts.","tickets.editUnavailable":"Names can\u2019t be changed on this order.","tickets.saveFailed":"Couldn\u2019t save the names. Check your connection and try again.","picker.bookingForm.ticket":"Ticket {number}","picker.bookingForm.useMyDetails":"Use my details","picker.bookingForm.name":"Name","picker.bookingForm.email":"Email","picker.bookingForm.phone":"Phone","picker.bookingForm.optional":"{label} (optional)","picker.bookingForm.choose":"Choose\u2026","picker.bookingForm.required":"This is required.","picker.bookingForm.invalid":"Check this answer.","picker.bookingForm.invalidEmail":"Enter a valid email address.","picker.bookingForm.invalidPhone":"Enter a valid phone number.","picker.bookingForm.tooLong":"This is too long.","picker.bookingForm.fix":"Some details need attention.","picker.bookingForm.unsupported":"This event needs details for each ticket holder that this checkout can\u2019t collect. Your seats are still held and nothing was charged.","picker.bookingForm.continueOnEventPage":"Continue on the event page","picker.bookingForm.guestOfCount":"{label} \xB7 Guest {index} of {total}","buyer.testBookingStrip":"Test booking: no real charge, tickets not valid for entry","buyer.testTicketNotValid":"Test ticket: not valid for entry"};var Iu=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],Uy={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",cy:"Cymraeg",da:"Dansk",de:"Deutsch",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",en:"English",es:"Espa\xF1ol",et:"Eesti",fa:"\u0641\u0627\u0631\u0633\u06CC",fi:"Suomi",fr:"Fran\xE7ais",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hi:"\u0939\u093F\u0928\u094D\u0926\u0940",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",ms:"Bahasa Melayu",nl:"Nederlands",no:"Norsk",pl:"Polski",pt:"Portugu\xEAs",ro:"Rom\xE2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sl:"Sloven\u0161\u010Dina",sr:"\u0421\u0440\u043F\u0441\u043A\u0438",sv:"Svenska",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},oa=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],Pu=new Set(["ar","fa","he"]),Wn={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",in:"id",zsm:"ms",zh:"zh-Hans","zh-cn":"zh-Hans","zh-sg":"zh-Hans","zh-my":"zh-Hans","zh-tw":"zh-Hant","zh-hk":"zh-Hant","zh-mo":"zh-Hant"},Vn=new Map(Iu.map(t=>[t.toLowerCase(),t]));function Ru(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=Vn.get(e)??Wn[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=Vn.get(o)??Wn[o];if(r)return r}return Vn.get(n[0])??Wn[n[0]]}var $e={en:Bt},xi={},pe="en";function ra(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let n of[t,e,...i]){if(!n)continue;let o=Ru(n);if(o)return o}return"en"}function $y(){return pe}function qy(t=pe){return Pu.has(t)?"rtl":"ltr"}function Zy(t){return!!$e[t]}var zn=new Set;function Qy(t){return zn.add(t),()=>{zn.delete(t)}}function ct(t,e){e&&($e[t]={...$e[t],...e}),pe=$e[t]?t:"en",na(pe),ea(pe),typeof document<"u"&&(document.documentElement.lang=pe);for(let i of zn)i()}function jy(t){xi=t}var sa=/\{(\w+)\}/g;function F(t,e){let i=xi[t]??$e[pe]?.[t]??Bt[t]??t;return e?i.replace(sa,(n,o)=>String(e[o]??`{${o}}`)):i}function aa(t,e,i){let n=new Intl.PluralRules(pe).select(e);return(xi[`${t}.${n}`]??$e[pe]?.[`${t}.${n}`]??Bt[`${t}.${n}`]??xi[`${t}.other`]??$e[pe]?.[`${t}.other`]??Bt[`${t}.other`]??t).replace(sa,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function Jy(t,e){return ta(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:pe})}function ca(t,e,i,n=!1){let o=t.displayLabel?.trim()||t.label;return n?{title:o,detail:F("map.statusTaken"),sellable:!1}:e==="booked"?{title:o,detail:F("map.statusTaken"),sellable:!1}:e==="held"?{title:o,detail:F("map.statusHeld"),sellable:!1}:{title:o,detail:i()??"",sellable:!0}}var dt=32,la=70;function da(t,e){let i=dt+6,n=t.y-la;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+la,e.height-i)}}var Yn=.8,Fu=Math.hypot(.46,.36),_u=.26,Bu=1.6,Ou=2*(1-Fu),ma="#0b1220",pa="#ffffff";function fa(t,e,i,n,o){let r=Math.min(Math.max(Bu,i*_u),i*Ou);return new Un({x:t,y:e,points:[-i*.42,i*.02,-i*.1,i*.34,i*.46,-i*.36],stroke:n,strokeWidth:r,lineCap:"round",lineJoin:"round",...o?{shadowColor:ma,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function Du(t){if(!(t instanceof Ye)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&ot(e)?e:null}var Nu=220,Hu=.08,Li=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,n){let o=n.get(e);if(n.delete(e),!i){this.retire(o);return}o?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=X(typeof a=="string"?a:"",r.selectionColor(),ze),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:Du(r.seatShape(e)),h=r.seatRadius(),p=new Kn({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});p.setAttrs({seatId:e,ringColor:l});let m={name:"selection-halo",stroke:D(r.categoryColor(s.categoryKey),ki(O(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let f=h*1.2;p.add(new Xn({...m,width:d.width+f*2,height:d.height+f*2,offsetX:(d.width+f*2)/2,offsetY:(d.height+f*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else p.add(new Oe({...m,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let b={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(p.add(new Xn({...b,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)p.add(new Xn({...b,stroke:si(r.canvasBackground()),width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2.5,opacity:Yn}));else{let f=Math.max(0,d.width/2-14),g=-Math.max(0,d.height/2-14);p.add(new Oe({x:f,y:g,radius:10,fill:l,listening:!1})),p.add(new Un({x:f,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:O(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(p,u,h,c,b);else{let f=Math.max(1,h-1.25),g=Math.min(2.5,Math.max(1.8,h*.22));if(p.add(new Oe({...b,radius:f,strokeWidth:g})),c)p.add(new Oe({...b,stroke:si(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Yn}));else{let y=Math.max(0,f-g/2);p.add(fa(0,0,y,pa,!0))}}n.set(e,p),this.host.overlayLayer.add(p)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new Oe({...r,stroke:si(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:Yn}));return}let l=X(a,s.selectionColor(),ze),c=Bn(i,{x:0,y:0,radius:n,fill:l,detail:!0});if(!c)return;c.name("selection-body"),c.listening(!1),e.add(c);let d=Tr(i,n);if(!d)return;let u=O(l)?ma:pa;e.add(fa(d.x,d.y,d.radius,u,!1))}resyncMarkers(e,i){if(e.size){for(let n of[...e.keys()])this.syncMarker(n,!0,e);i()}}retire(e){let i=this.host;if(!e)return;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let n=performance.now(),o=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-n)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(o):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(o)}play(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden||!i.seat(e))return;this.emitPulse(e,!0);let n=this.echoTimers.get(e);n&&clearTimeout(n),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},qs))}emitPulse(e,i){let n=this.host,o=n.seat(e);if(!o)return;let r=n.seatRadius();this.pulses.get(e)?.destroy();let s=new Oe({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:On(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,s),this.pulseHome().add(s);let a=i&&!n.isCached()?n.seatShape(e):void 0,l=performance.now(),c=()=>{a?.scale({x:1,y:1}),s.destroy(),this.pulses.get(e)===s&&this.pulses.delete(e),n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw()},d=u=>{if(n.isDestroyed()){c();return}s.getLayer()||this.pulseHome().add(s);let h=u-l,p=On(h/420);if(s.radius(r*p.radiusScale),s.opacity(p.opacity),a){let m=$s(h/320);a.scale({x:m,y:m})}n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw(),h<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{n.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(d)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let n=i.seatShape(e);if(!n)return;let o=performance.now(),r=()=>{n.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!n.getLayer()){r();return}let l=a-o,c=Math.min(1,l/Nu),d=1+Hu*Math.sin(Math.PI*c);n.scale({x:d,y:d}),i.seatLayer.batchDraw(),c<1?requestAnimationFrame(s):r()};requestAnimationFrame(s)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Kn({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let i=this.host;if(i.isExportMode()||i.isDestroyed())return;let n=i.nearestSeat(e,ue),o=n?i.seat(n):void 0;if(!o){this.hideLoupe();return}let r=ca(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id)),s=da(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=o.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(o.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),n=X(i,le(i).sectionInk),o=new Kn({name:"touch-loupe",listening:!1,visible:!1});o.add(new Un({points:[-7,dt-4,0,dt+12,7,dt-4],closed:!0,fill:i,stroke:D(n,.25),strokeWidth:1,listening:!1})),o.add(new Oe({radius:dt,fill:i,stroke:D(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new Oe({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new ua({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new ua({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:D(n,.72),listening:!1,perfectDrawEnabled:!1});return o.add(r),o.add(s),o.add(a),e.overlayLayer.add(o),o.moveToTop(),this.loupe={group:o,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as Gu}from"konva/lib/Animation";var Wu=1e3/Zs;function ga(t){return t.findOne(".selection-halo")??null}var Ci=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let n=[],o=0;for(let[s,a]of this.markers){let l=ga(a);if(l){if(this.paintHalo(s,l),o>=Dn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:Nn(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Dn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:Nn(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new Gu(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let n=this.host,o=ki(O(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(D(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=ga(n);o&&(this.paintHalo(i,o),o.scale({x:1,y:1}),o.opacity(1),e=!0)}for(let i of this.beaconRings)i.scale({x:1,y:1}),i.opacity(1),e=!0;e&&!this.host.isDestroyed()&&this.host.overlayLayer.batchDraw()}frame(){if(this.host.isDestroyed()||!this.targets.length)return this.stop(),!1;let i=performance.now();if(i-this.lastFrameAt<Wu)return!1;this.lastFrameAt=i;let n=i-this.startedAt;for(let o of this.targets){let{scale:r,opacity:s}=Qs(n,o.phase);o.node.scale({x:r,y:r}),o.node.opacity(s)}return!0}pageVisible(){return typeof document>"u"?!0:document.visibilityState==="visible"}bindVisibility(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!0)}unbindVisibility(){!this.visibilityBound||typeof document>"u"||(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!1)}};import{Group as Vu}from"konva/lib/Group";import{Circle as $n}from"konva/lib/shapes/Circle";import{Text as zu}from"konva/lib/shapes/Text";var ba=28,Ku=12,Xu="800",Yu=44,ya=1.6,Sa=1.95;function va(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,n=new Map(t.zones.map(o=>[o.id,o.name]));for(let o of t.sections){let r=t.ownedSeatIds(o);if(!r.length)continue;let s=t.rung==="zones"&&o.zone!=null&&n.has(o.zone),a=s?o.zone:o.logicalId,l=e.get(a);if(l){l.count+=r.length,r.length>(i.get(a)??0)&&(i.set(a,r.length),l.seatId=r[0],l.anchor=t.sectionAnchor(o),l.toward=t.sectionCentre(o));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?n.get(o.zone):t.sectionName(o),count:r.length,seatId:r[0],anchor:t.sectionAnchor(o),toward:t.sectionCentre(o)})}return[...e.values()]}function Uu(t,e){return F("map.beaconAria",{seats:aa("picker.seatCount",t),name:e})}function $u(t,e){let i=e*Sa,n=t.toward.x-t.anchor.x,o=t.toward.y-t.anchor.y,r=Math.hypot(n,o);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+n/r*i,y:t.anchor.y+o/r*i}}var qu="selection-beacon-ring",Ti=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),n=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(n===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=n,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let o=ba/2/i,r=Math.max(Yu,Math.ceil(2*(o*Sa+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Vu({listening:!1,name:"selection-beacons"});for(let c of e){let d=$u(c,o);l.add(new $n({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*ya,fill:D(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new $n({name:qu,x:c.anchor.x,y:c.anchor.y,radius:o*ya,stroke:D(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new $n({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:D(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new zu({x:d.x,y:d.y,text:String(c.count),fontSize:Ku/i,fontStyle:Xu,fontFamily:this.host.labelFont(),fill:a,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2),l.add(h),this.rings.push(u),this.centres.push(c.anchor),this.buttons.push(this.buildButton(c,c.anchor,r))}this.host.overlayLayer.add(l),l.moveToTop(),this.group=l,this.host.overlayLayer.batchDraw()}raise(){this.group?.moveToTop()}clear(){this.group?.destroy(),this.group=null,this.rings=[],this.targets=[],this.centres=[],this.signature="";for(let e of this.buttons)e.remove();this.buttons=[]}repositionButtons(){for(let e=0;e<this.buttons.length;e+=1){let i=this.buttons[e],n=this.host.worldToScreen(this.centres[e]),o=i.offsetWidth||parseFloat(i.style.width)||ba;i.style.left=`${n.x-o/2}px`,i.style.top=`${n.y-o/2}px`}}buildButton(e,i,n){let o=this.host.worldToScreen(i),r=document.createElement("button");return r.type="button",r.className="sl-beacon",r.dataset.beacon=e.id,r.setAttribute("aria-label",Uu(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${o.x-n/2}px`,top:`${o.y-n/2}px`,width:`${n}px`,height:`${n}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function Ot(t,e,i){let n=t.width(),o=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=n*2,d=o*2;for(let u of e){let h=u.getClientRect();if(!(!(h.width>1)||!(h.height>1))){if(h.x<-c||h.y<-d||h.x+h.width>n+c||h.y+h.height>o+d)return null;h.x<r&&(r=h.x),h.y<s&&(s=h.y),h.x+h.width>a&&(a=h.x+h.width),h.y+h.height>l&&(l=h.y+h.height)}}if(i&&i.width>=0&&i.height>=0){let u=t.scaleX(),h=i.x*u+t.x(),p=i.y*u+t.y();h<r&&(r=h),p<s&&(s=p),h+i.width*u>a&&(a=h+i.width*u),p+i.height*u>l&&(l=p+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var Ii=8,Zu=.02,wa=1,ka=.5;function xa(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Ot(t,e,o);if(!s)return 0;qn(t,s,r);let a=Math.min((r.width-2*Ii)/s.width,(r.height-2*Ii)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>ka?a:Math.min(a,Qu(t.scaleX(),n));if(!(c>1+Zu)&&!(l>ka)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,u=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:u+(t.y()-u)*c});let h=Ot(t,e,o);return h&&qn(t,h,r),c}function Zn(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=Ot(t,e,n);return r?qn(t,r,o):!1}function Qu(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(wa,e):wa)/i}function qn(t,e,i){let n=i.x+i.width/2-(e.x+e.width/2),o=i.y+i.height/2-(e.y+e.height/2);return n===0&&o===0?!1:(t.position({x:t.x()+n,y:t.y()+o}),!0)}function qe(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as ju}from"konva/lib/Group";import{Circle as La}from"konva/lib/shapes/Circle";import{Line as Ju}from"konva/lib/shapes/Line";import{Text as ep}from"konva/lib/shapes/Text";var tp=6;function Dt(t){return O(t)?"#0b1220":"#ffffff"}function Ca(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",n=0,o=0;for(let r of e)n+=r.x,o+=r.y;return{count:e.length,centroid:{x:n/e.length,y:o/e.length},fill:i,ink:Dt(i)}}var Pi=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let n=Ca({points:this.host.ownedPoints(i),categoryColor:null});if(n)return n.centroid}return null}badgeAt(e){for(let i of this.badges)if(Math.hypot(e.x-i.centre.x,e.y-i.centre.y)<=i.radius)return i.id;return null}sync(e,i="seats"){if(this.group?.destroy(),this.group=null,this.badges=[],e>=ve){this.host.overlayLayer.batchDraw();return}let n=Math.max(this.host.stageScale(),1e-4),o=new ju({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Ca({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(tp/2/n,1);for(let b of a)o.add(new La({name:"owned-seat-dot",x:b.x,y:b.y,radius:c,fill:l.fill,stroke:D("#ffffff",.55),strokeWidth:Math.max(.5,c*.28),shadowColor:l.fill,shadowBlur:c*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(i!=="seats"||r.has(s.logicalId))continue;r.add(s.logicalId);let d=this.host.sections().filter(b=>b.logicalId===s.logicalId).reduce((b,f)=>b+this.host.ownedPoints(f).length,0),u=this.host.labelAnchor(s),h=11/n,p={x:u.x,y:u.y-h*2.1};o.add(new La({name:"owned-section-badge",x:p.x,y:p.y,radius:h,fill:l.fill,stroke:D(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new Ju({x:p.x-h*.62,y:p.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:l.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new ep({x:p.x+h*.12,y:p.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:s.logicalId,centre:p,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};import{Text as ip}from"konva/lib/shapes/Text";var np=4;function Nt(t){return O(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function op(t,e,i,n){let o=Math.max(0,Math.min(n,e/2,i/2));t.beginPath(),t.moveTo(o,0),t.arcTo(e,0,e,i,o),t.arcTo(e,i,0,i,o),t.arcTo(0,i,0,0,o),t.arcTo(0,0,e,0,o),t.closePath()}function Ta(t,e){t.padding(np),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),op(n,o,r,Math.min(r/2,8)),n.setAttr("fillStyle",e.plate),n.fill(),n.setAttr("strokeStyle",e.stroke),n.setAttr("lineWidth",1),n.stroke(),n.restore(),ip.prototype._sceneFunc.call(this,n)})}function Ia(t){return t?"seat":"section"}function Pa(t){let e=new Set,i=0;for(let o of t.memberIds){let r=t.categoryKey(o);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(o)&&(i+=1)}let n=[];for(let o of t.categoryOrder)e.has(o)&&n.push({key:o,name:t.categoryLabel(o)||o,price:t.categoryPrice(o),color:t.categoryColor(o)});return n.length?i?{mode:"section",title:t.name,fields:[],rows:n,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:F("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:F("picker.notForSale")}}function Ra(t){let e=t.place?.kind==="booth",i=e?"":sp(t.label,t.sectionLabel,t.rowLabel),n=t.place?{caption:t.place.typeWord?.trim()||F(e?"picker.booth":"picker.table"),value:t.place.name}:null,o=[t.sectionLabel,t.rowLabel?F("picker.rowLabel",{label:t.rowLabel}):null,n?n.value:null,i?F("picker.seatLabel",{label:i}):null].filter(Boolean).join(" \xB7 ")||t.label,r=[t.sectionLabel?{caption:F("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:F("picker.row"),value:t.rowLabel}:null,n,i?{caption:F("picker.seat"),value:i}:null].filter(c=>c!=null),s={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},a=dr(t).map(c=>{let d=F(c.titleKey);return{icon:c.icon,title:d===c.titleKey?c.titleFallback:d,tone:c.tone,...c.note?{note:c.note}:{}}}),l=t.facts??[];return{mode:"seat",title:o,fields:r,rows:[s],notes:a,facts:l,...l.length&&t.head?{head:t.head}:{},note:l.length?null:rp(t.status,t.closed)}}function rp(t,e){return e||t==="not_for_sale"?F("picker.notForSale"):t==="booked"?F("map.statusTaken"):t==="held"?F("map.statusHeld"):null}function sp(t,e,i){let n=t;for(let o of[e,i])!o||!n.startsWith(o)||n.length<=o.length||(n=n.slice(o.length).replace(/^[\s·\-/_]+/,""));return n}var ap=16,lp=8;function Ma(t,e,i,n=ap){let o=lp,r=t.x+n;r+e.width>i.width-o&&(r=t.x-n-e.width);let s=t.y+n;return s+e.height>i.height-o&&(s=t.y-n-e.height),{x:Math.max(o,Math.min(r,Math.max(o,i.width-o-e.width))),y:Math.max(o,Math.min(s,Math.max(o,i.height-o-e.height)))}}var Ea=16,Qn=14,Aa=10.5,cp=14,dp=12.5,Fa={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},hp={warn:"#d8a425",premium:"#e8c15a"},up=.1,pp=.06,_a={minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",boxShadow:"0 6px 20px rgba(2,6,23,0.22)",lineHeight:"1.35"},fp={minWidth:"",maxWidth:"",padding:"",overflow:"",borderRadius:"",boxShadow:"",lineHeight:"",background:"",backgroundColor:"",border:"",fontFamily:""},Ri=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.roomEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.presented=null;this.mount=null;this.presentedView=null;this.viewEl=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.aisleIds=new Set;this.aisleDoc=null;this.placeFacts=new Map;this.sectionEntrances=new Map;this.placeDoc=null;this.onPointerMove=e=>{if(this.fromPresenter(e))return;if(this.presented=null,this.mount=null,this.presentedView=null,e.pointerType!=="mouse"){this.hide();return}let i=this.host.container.getBoundingClientRect();this.cursor={x:e.clientX-i.left,y:e.clientY-i.top},this.schedule()};this.onPointerLeave=e=>{this.fromPresenter(e)||this.hide()};this.onPointerDown=e=>{e.pointerType!=="mouse"&&!this.fromPresenter(e)&&this.hide()};this.onWheel=e=>{this.cursor&&!this.fromPresenter(e)&&this.schedule()};this.host=e}attach(){this.attached||(this.attached=!0,this.host.container.addEventListener("pointermove",this.onPointerMove),this.host.container.addEventListener("pointerleave",this.onPointerLeave),this.host.container.addEventListener("pointerdown",this.onPointerDown),this.host.container.addEventListener("wheel",this.onWheel,{passive:!0}))}destroy(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0),this.host.container.removeEventListener("pointermove",this.onPointerMove),this.host.container.removeEventListener("pointerleave",this.onPointerLeave),this.host.container.removeEventListener("pointerdown",this.onPointerDown),this.host.container.removeEventListener("wheel",this.onWheel),this.attached=!1,this.cursor=null,this.root?.remove(),this.root=null,this.titleEl=null,this.rowsEl=null,this.notesEl=null,this.factsEl=null,this.noteEl=null,this.viewEl=null,this.signature=""}presentSeat(e,i,n,o){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),o!==void 0&&(this.presentedView=o),this.presented=e,this.mount=n,this.cursor=i,this.update()}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":e.head?[e.head.title,e.head.sub,...e.facts.map(i=>`${i.caption} ${i.value}`)].filter(Boolean).join(" | "):[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}fromPresenter(e){return!!this.mount&&e.target instanceof Node&&this.mount.contains(e.target)}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let n=this.host.hostCardOpen?.()?null:this.resolve(i);if(!n){this.hide(),this.lastUpdateMs=performance.now()-e;return}let o=this.ensureRoot(),r=`${n.mode}|${n.title}|${n.note??""}|${this.host.canvasBackground()}|`+n.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${n.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${n.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`+(n.head?`|${n.head.title}|${n.head.sub??""}|${n.head.tone??""}|${n.head.plate??""}`:"");r!==this.signature&&(this.signature=r,this.paint(n)),this.showView(this.presented?this.presentedView:null),this.model=n,o.style.display="block";let s=this.mount??this.host.container,a=Ma(i,{width:o.offsetWidth,height:o.offsetHeight},{width:s.clientWidth,height:s.clientHeight});o.style.left=`${a.x}px`,o.style.top=`${a.y}px`,this.lastUpdateMs=performance.now()-e}showView(e){let i=this.root;if(!i)return;if(!e){this.viewEl&&(this.viewEl.style.display="none");return}let n=this.viewEl;if(!n){n=document.createElement("div"),n.setAttribute("data-seat-view",""),Object.assign(n.style,{position:"relative",width:"100%",aspectRatio:"16 / 9",minWidth:"240px",backgroundSize:"cover",backgroundPosition:"center"});let r=document.createElement("span");r.textContent="View from this seat",Object.assign(r.style,{position:"absolute",left:"8px",bottom:"7px",padding:"2px 8px",borderRadius:"999px",font:"600 11px/1.4 inherit",color:"#ffffff",background:"rgba(8,12,24,0.62)"}),n.appendChild(r),this.viewEl=n}(n.parentElement!==i||i.firstChild!==n)&&i.insertBefore(n,i.firstChild);let o=`url("${e.replace(/"/g,"%22")}")`;n.style.backgroundImage!==o&&(n.style.backgroundImage=o),n.style.display="block"}resolve(e){if(this.presented)return this.seatModel(this.presented);if(Ia(this.host.seatsPickable())==="seat"){let a=this.host.hoveredSeatId()??this.host.nearestSeat(e);return a?this.seatModel(a):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;if(!i||n==null||this.host.sectionInteractive?.(i)===!1)return null;let o=this.host.sectionMembers(i),r=this.host.sectionCardHead?.(i,o)??null,s=Pa({name:n||i,memberIds:o,categoryOrder:this.host.categoryOrder(),categoryKey:a=>this.host.seat(a)?.categoryKey??null,categoryLabel:a=>this.host.categoryLabel(a),categoryPrice:a=>this.host.categoryPrice(a),categoryColor:a=>this.host.categoryColor(a),categorySellable:a=>this.host.categorySellable(a),seatSellable:a=>this.host.seatSellable(a)});return r?{...s,head:r,facts:s.rows.map(a=>({caption:a.name,value:a.price??""}))}:s}seatModel(e){let i=this.host.seat(e);if(!i)return null;let n=this.host.seatStatus(e),o=this.host.seatFacts?.(e)??null;if((n!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!o?.length)return null;let s=this.host.seatSectionLabel(e),a=o?.length?this.host.seatCardHead?.(e)??null:null;return Ra({label:i.displayLabel?.trim()||i.label,rowLabel:this.rowName(i,s),sectionLabel:s,categoryKey:i.categoryKey,categoryLabel:this.host.categoryLabel(i.categoryKey),categoryPrice:this.host.categoryPrice(i.categoryKey),categoryColor:this.host.categoryColor(i.categoryKey),status:this.host.seatStatus(e),closed:this.host.seatClosed(e),...i.accessibility?.length?{accessibility:i.accessibility}:{},...i.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{},...i.commercial?{commercial:i.commercial}:{},...this.isAisleSeat(e)?{aisle:!0}:{},...this.placeOf(i),...o?.length?{facts:o}:{},...a?{head:a}:{}})}placeOf(e){let i=this.host.chartDoc();if(!i)return{};if(this.placeDoc!==i){this.placeDoc=i,this.placeFacts.clear(),this.sectionEntrances=it(i);for(let r of ti(i))r.type!=="table"&&r.type!=="booth"||this.placeFacts.set(r.id,{kind:r.type,name:r.displayLabel?.trim()||r.label,...r.displayType?.trim()?{typeWord:r.displayType.trim()}:{},...r.type==="booth"&&r.boothType?{boothType:r.boothType}:{},...r.entrance?.trim()?{entrance:r.entrance.trim()}:{}})}let n=this.placeFacts.get(e.rowId);if(!n)return{};let o=n.entrance??(e.sectionId?this.sectionEntrances.get(e.sectionId):void 0);return{place:{kind:n.kind,name:n.name,...n.typeWord?{typeWord:n.typeWord}:{}},...n.boothType?{boothType:n.boothType}:{},...o?{entrance:o}:{}}}isAisleSeat(e){let i=this.host.chartDoc();return i?(this.aisleDoc!==i&&(this.aisleDoc=i,this.aisleIds=di(i)),this.aisleIds.has(e)):!1}rowName(e,i){let n=this.host.chartDoc();if(!n)return null;if(this.rowNamesDoc!==n){this.rowNamesDoc=n,this.rowNames.clear();for(let r of n.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let o=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return o?Rt(o,i??void 0)||o:null}ensureRoot(){let e=this.mount??this.host.container;if(this.root)return this.root.parentElement!==e&&e.appendChild(this.root),this.root;let i=Nt(this.host.canvasBackground()),n=document.createElement("div");n.className="sl-hover-card",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",..._a,background:i.plate,border:`1px solid ${i.stroke}`,fontFamily:this.host.labelFont(),zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Ea}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:X(i.plate,"#0b1220")});let r=document.createElement("div");Object.assign(r.style,{display:"flex",flexDirection:"column",gap:"0"});let s=document.createElement("div");Object.assign(s.style,{display:"none",flexDirection:"column",gap:"0"});let a=document.createElement("div");Object.assign(a.style,{fontSize:`${Qn}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:X(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),n.append(o,r,s,l,a),e.appendChild(n),this.root=n,this.titleEl=o,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,n}paint(e){let i=this.ensureRoot();if(e.head)return this.paintRoomCard(i,e,e.head);this.roomEl&&this.leaveRoomCard(i);let n=Nt(this.host.canvasBackground());i.style.background=n.plate,i.style.border=`1px solid ${n.stroke}`;let o=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=X(n.plate,"#0b1220");if(o.replaceChildren(),o.style.color=l,o.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;o.style.display="flex",o.style.padding="0";for(let[d,u]of e.fields.entries()){let h=document.createElement("div");Object.assign(h.style,{flex:u.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${n.stroke}`:"none"});let p=document.createElement("div");p.textContent=u.caption,Object.assign(p.style,{fontSize:`${Aa}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let m=document.createElement("div");m.textContent=u.value,Object.assign(m.style,{marginTop:"2px",fontSize:`${Ea}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(p,m),o.append(h)}}else o.style.display="block",o.style.padding="10px 15px 9px",o.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${Qn}px`,fontWeight:"700",background:c.color,color:Sn(c.color)});let u=document.createElement("span");u.textContent=c.name;let h=document.createElement("span");h.textContent=c.price??"",d.append(u,h),r.appendChild(d)}this.paintNotes(s,e,n,l),this.paintFacts(this.factsEl,e,n,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=X(n.plate,"#0b1220")}paintRoomCard(e,i,n){e.classList.add("room"),Object.assign(e.style,fp);for(let c of[this.titleEl,this.rowsEl,this.notesEl,this.factsEl,this.noteEl])c&&(c.style.display="none");let o=this.roomEl;o||(o=document.createElement("div"),e.appendChild(o),this.roomEl=o),o.style.display="block";let r=document.createElement("div");if(r.className="slhc-head",n.plate){let c=document.createElement("span");c.className="slhc-plate",c.innerHTML=n.plate,r.appendChild(c)}let s=document.createElement("div"),a=document.createElement("b");if(a.className="slhc-title",a.textContent=n.title,s.appendChild(a),n.sub){let c=document.createElement("span");c.className="slhc-sub",c.textContent=n.sub,n.tone&&(c.style.color=n.tone),s.appendChild(c)}r.appendChild(s);let l=i.facts.map(c=>{let d=document.createElement("div");d.className="slhc-row";let u=document.createElement("span");u.textContent=c.caption;let h=document.createElement("b");return h.textContent=c.value,d.append(u,h),d});o.replaceChildren(r,...l)}leaveRoomCard(e){e.classList.remove("room"),this.roomEl?.remove(),this.roomEl=null,this.rowsEl&&(this.rowsEl.style.display="flex"),Object.assign(e.style,{..._a,fontFamily:this.host.labelFont()})}paintFacts(e,i,n,o){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${n.stroke}`,color:o});for(let[r,s]of i.facts.entries()){let a=document.createElement("div");Object.assign(a.style,{flex:"1 1 auto",padding:"8px 12px 9px",textAlign:"center",borderLeft:r?`1px solid ${n.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${Aa}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let c=document.createElement("div");c.textContent=s.value,Object.assign(c.style,{marginTop:"2px",fontSize:`${Qn}px`,fontWeight:"700",whiteSpace:"nowrap"}),a.append(l,c),e.append(a)}}paintNotes(e,i,n,o){if(e.replaceChildren(),!i.notes.length){e.style.display="none";return}e.style.display="flex";for(let[r,s]of i.notes.entries()){let a=Sn(n.plate)==="#ffffff"?Fa.onDark:Fa.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,hp[s.tone],up):j(n.plate,o,pp),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${n.stroke}`:"none"});let u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("viewBox",`0 0 ${20} ${20}`),u.setAttribute("width","17"),u.setAttribute("height","17"),u.setAttribute("fill","none"),u.setAttribute("stroke",l),u.setAttribute("stroke-width","1.45"),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("aria-hidden","true"),u.innerHTML=hr(s.icon),Object.assign(u.style,{flex:"none",marginTop:"1px"});let h=document.createElement("div");Object.assign(h.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let p=document.createElement("div");if(p.textContent=s.title,Object.assign(p.style,{fontSize:`${cp}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(p),s.note){let m=document.createElement("div");m.textContent=s.note,Object.assign(m.style,{fontSize:`${dp}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(m)}d.append(u,h),e.appendChild(d)}}};var Ba="#1f9d6b";function mp(t,e){if(t===e)return!0;if(!t||!e||t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function Oa(t,e){let i=e?new Set(e):null;mp(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Da(t,e){let i=t.labelLayers(),n={...i,...e};n.seatLabels===i.seatLabels&&n.rowLabels===i.rowLabels||(t.setLabelLayersState(n),t.updateLabels(),t.draw())}function Na(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function z(t){let e=Pr(t);return e?{x:e.x,y:e.y,width:Math.max(1,e.width),height:Math.max(1,e.height)}:{x:0,y:0,width:1,height:1}}function ht(t,e,i,n){let o=n*Math.PI/180,r=Math.cos(o),s=Math.sin(o);return[{x:-e/2,y:-i/2},{x:e/2,y:-i/2},{x:e/2,y:i/2},{x:-e/2,y:i/2}].map(a=>({x:t.x+a.x*r-a.y*s,y:t.y+a.x*s+a.y*r}))}function ut(t,e,i,n,o,r){let s=n*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let u=e*(d/6-.5),h=i*(c/4-.5),p={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!te(p,o,r))return!1}return!0}function Ha(t,e,i){let n=z(t),o={x:n.x+n.width/2,y:n.y+n.height/2},r=te(o,t,e)?[o,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:n.x+n.width*c/12,y:n.y+n.height*l/12};te(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:Yo(l,a)})).sort((l,c)=>c.room-l.room).map(l=>l.point)].filter((l,c,d)=>c===d.findIndex(u=>Math.abs(u.x-l.x)<1e-6&&Math.abs(u.y-l.y)<1e-6))}function Ga(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return z(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function gp(t,e){let i=t.width*t.height;if(i<=0)return 0;let n=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),o=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return n*o/i}function Wa(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=gp(a.bounds,i)*a.members;l<=0||n.set(a.logicalId,(n.get(a.logicalId)??0)+l)}if(!n.size)return e;let o=null,r=0;for(let[a,l]of n)l>r&&(r=l,o=a);if(!o||o===e)return e;let s=e!=null?n.get(e)??0:0;return r>s*1.35?o:e}import{Text as yp}from"konva/lib/shapes/Text";function bp(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}var fe=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let n=this.cells.get(i);n?n.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,n=0;for(let o of this.keys(e))for(let r of this.cells.get(o)??[])i.has(r)||(i.add(r),bp(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/At),n=Math.floor((e.x+Math.max(0,e.width))/At),o=Math.floor(e.y/At),r=Math.floor((e.y+Math.max(0,e.height))/At),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var jn=new WeakMap;function Ze(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=jn.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},jn.set(t,e);let i=()=>{let n=jn.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Va=new WeakMap,za=new WeakMap;function Ka(t){let e=new Map;return{get(i){let n=JSON.stringify([i.text,i.fontSize,i.rotation]),o=e.get(n);return o||(o=new yp({text:i.text,fontSize:i.fontSize,fontStyle:"700",fontFamily:t,rotation:i.rotation,listening:!1}),o.offsetX(o.width()/2),o.offsetY(o.height()/2),e.set(n,o)),o},destroy(){for(let i of e.values())i.destroy()}}}function Sp(t){let e=t.labelFont(),i=Ze(),n=za.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new fe,r=Ka(e);for(let s of t.rowLabelPlan){let a=r.get(s),l=t.rowLabelBox(a,{x:s.x,y:s.y}),c=s.automaticAway,d=c?Math.max(7,Math.min(16,s.fontSize*.75))*4*(Math.abs(c.x)+Math.abs(c.y)):0;o.insert({x:l.x-d,y:l.y-d,width:l.width+d*2,height:l.height+d*2})}return r.destroy(),za.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function vp(t){let e=Sp(t),i=[...t.freeTextById.values()].map(({node:l})=>{let c=l.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});return{x:c.x-ee,y:c.y-ee,width:c.width+ee*2,height:c.height+ee*2}}).filter(l=>e.collisionCount(l)>0),n=JSON.stringify([t.labelFont(),Ze(),t.seatR,i]),o=Va.get(t.rowLabelPlan);if(o?.key===n&&o.seats===t.seatById)return o.boxes;let r=new fe;for(let l of i)r.insert(l);let s=Ka(t.labelFont()),a=t.rowLabelPlan.map(l=>{let c=s.get(l),d=t.resolveAutomaticRowLabelPosition(c,l,r),u=t.rowLabelBox(c,d);return r.insert(u),u});return s.destroy(),Va.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function Xa(t,e){let i=t.sections.filter(m=>m.id===e||m.logicalId===e),n=i.map(m=>z(m.outline));if(!n.length)return null;let o=Math.min(...n.map(m=>m.x)),r=Math.min(...n.map(m=>m.y)),s=Math.max(...n.map(m=>m.x+m.width)),a=Math.max(...n.map(m=>m.y+m.height)),l=new Set(i.flatMap(m=>m.memberIds));for(let m of l){let b=t.seatById.get(m);b&&(o=Math.min(o,b.x-t.seatR),r=Math.min(r,b.y-t.seatR),s=Math.max(s,b.x+t.seatR),a=Math.max(a,b.y+t.seatR))}let c=m=>{[m.x,m.y,m.width,m.height].every(Number.isFinite)&&(o=Math.min(o,m.x),r=Math.min(r,m.y),s=Math.max(s,m.x+m.width),a=Math.max(a,m.y+m.height))},d=m=>{let b={x:m.x+m.width/2,y:m.y+m.height/2};return i.some(f=>te(b,f.outline,f.holes))};for(let{node:m,backdrop:b}of t.freeTextById.values()){let f=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(f)&&(c(f),b&&c(b.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:m}of t.iconNodeById.values()){let b=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(b)&&c(b)}let u=vp(t);t.rowLabelPlan.forEach((m,b)=>{(m.focusKeys??[]).some(g=>g===e||i.some(y=>g===y.id||g===y.logicalId))&&c(u[b])});let h=Math.max(s-o,a-r),p=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-p,y:r-p,width:Math.max(1,s-o+p*2),height:Math.max(1,a-r+p*2)}}import{Rect as wp}from"konva/lib/shapes/Rect";import{Text as Ya}from"konva/lib/shapes/Text";var Jn="\0";function kp(t){let e=0;for(let i=0;i<t.length;i++){let n=t[i],o=t[(i+1)%t.length];e+=n.x*o.y-o.x*n.y}return Math.abs(e)/2}function xp(t,e){let i=t.filter(p=>Number.isFinite(p.centroid.x)&&Number.isFinite(p.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let n=i.map(p=>({member:p,weight:Math.max(1,kp(p.outline))})),o=n.reduce((p,m)=>p+m.weight,0),r=n.reduce((p,m)=>({x:p.x+m.member.centroid.x*m.weight/o,y:p.y+m.member.centroid.y*m.weight/o}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(p=>{let m={x:p.centroid.x-e.x,y:p.centroid.y-e.y},b={x:p.centroid.x-r.x,y:p.centroid.y-r.y};return{member:p,depth:m.x*l.x+m.y*l.y,lateral:Math.abs(b.x*-l.y+b.y*l.x)}}).sort((p,m)=>m.depth-p.depth||p.member.id.localeCompare(m.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(p=>p.depth>=u);return h.sort((p,m)=>p.lateral-m.lateral||m.depth-p.depth||p.member.id.localeCompare(m.member.id)),h[0].member}function Lp(t){let i=[...F("map.fromPrice",{price:Jn}).toLocaleLowerCase()],n=i.findIndex(o=>o!==Jn&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(Jn).join(t)}function Cp(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function Tp(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>Cp(n.label,i))}function Ua(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Hs(t.canvasBackground),n=new Map;for(let o of t.sections)o.zone&&(n.get(o.zone)??n.set(o.zone,[]).get(o.zone)).push(o);for(let o of e.zones){let r=n.get(o.id);if(!r||!r.length||!t.derivedFloorGroups&&!Tp(o.label,r))continue;let s=r[0];for(let k of r)k.centroid.y<s.centroid.y&&(s=k);t.derivedFloorGroups&&(s=xp(r,o.focalPoint??e.focalPoint)??s);let a=1/0,l=-1/0,c=1/0,d=-1/0;for(let k of r)for(let w of k.outline)w.x<a&&(a=w.x),w.x>l&&(l=w.x),w.y<c&&(c=w.y),w.y>d&&(d=w.y);let u=isFinite(a)&&l>a?l-a:0,h=!t.derivedFloorGroups&&isFinite(c),p=h?(a+l)/2:s.centroid.x,m=h?c:s.centroid.y,b=1/0,f=1/0;for(let k of r)for(let w of k.memberIds){let v=t.seatById.get(w),x=v&&t.catPrice.get(v.categoryKey);!v||typeof x!="number"||(v.accessible||v.accessibility?.length?f=Math.min(f,x):b=Math.min(b,x))}isFinite(b)||(b=f);let g=new wp({x:p,y:m,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(g);let y=new Ya({x:p,y:m,text:o.label,fontSize:bi,fontStyle:ss,letterSpacing:0,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1});y.offsetX(y.width()/2),y.offsetY(y.height()/2),t.bgLayer.add(y);let S=null;isFinite(b)&&(S=new Ya({x:p,y:m,text:Lp(Ue(b,t.currency)),fontSize:yi,fontStyle:as,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),S.offsetX(S.width()/2),t.bgLayer.add(S)),t.zones.push({id:o.id,anchor:{x:p,y:m},back:g,background:t.canvasBackground,name:o.label,spanWorld:u,aboveZone:h,area:isFinite(a)?{x:a,y:c,width:l-a,height:d-c}:void 0,label:y,sub:S})}}function $a(t,e){let i=t.zones.find(({back:d})=>{if(!d.visible()||d.opacity()<.5)return!1;let u=d.getClientRect();return e.x>=u.x&&e.x<=u.x+u.width&&e.y>=u.y&&e.y<=u.y+u.height});if(!i)return!1;let n=t.doc,o=n&&tt(n)==="combined"&&!n.zones?.length?n.floors?.find(d=>rr(d.id)===i.id):void 0;if(o)return t.enterFloor(o.id),!0;let r=t.sections.filter(d=>d.zone===i.id).flatMap(d=>d.outline);if(!r.length)return!1;let s=Math.min(...r.map(d=>d.x)),a=Math.max(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.y));return t.frame({x:s,y:l,width:Math.max(1,a-s),height:Math.max(1,c-l)}),!0}var Ip=new Set,qa=16,Pp=5,Mi=class{constructor(e,i,n=8e3){this.chunks=e;this.host=i;this.warmSeats=n;this.wanted=new Set;this.built=new Map;this.loose=new Map;this.located=new Map;this.queue=[];this.pinQueue=[];this.frame=0;this.stepping=!1;this.stopped=!1}locate(e){let i=this.located.get(e);if(i===void 0){i=null;let n=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let o of n){let r=o===void 0?-1:this.chunks.get(o)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:o,seat:this.chunks.get(o)[r],index:r};break}}this.located.set(e,i)}return i??void 0}isResident(e){let i=this.locate(e);return!!i&&(this.loose.has(e)||(this.built.get(i.section)??0)>i.index)}sync(e,i=Ip){if(this.stopped)return;this.wanted=new Set(e),this.queue=e.filter(r=>(this.built.get(r)??0)<(this.chunks.get(r)?.length??0));for(let r of e)if(this.built.has(r)){let s=this.built.get(r);this.built.delete(r),this.built.set(r,s)}let n=0;for(let[r,s]of[...this.built].reverse()){if(this.wanted.has(r)||(n+=s,n<=this.warmSeats))continue;let a=[];this.chunks.get(r).slice(0,s).forEach((l,c)=>{i.has(l.id)?this.loose.set(l.id,{section:r,seat:l,index:c}):a.push(l)}),a.length&&this.host.remove(a),this.built.delete(r)}let o=[];for(let[r,s]of this.loose)i.has(r)||this.wanted.has(s.section)||(o.push(s.seat),this.loose.delete(r));o.length&&this.host.remove(o),this.pinQueue=[];for(let r of i)this.locate(r)&&!this.isResident(r)&&this.pinQueue.push(r);!this.frame&&!this.stepping&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}step(){if(this.frame=0,this.stopped)return;this.stepping=!0;let e=this.host.now(),i=!1,n=()=>!i||this.host.now()-e<Pp;for(;this.pinQueue.length&&n();){let o=[];for(let r of this.pinQueue.splice(0,qa)){let s=this.locate(r);s&&!this.isResident(r)&&(o.push(s.seat),this.loose.set(r,s))}o.length&&this.host.build(o),i=!0}for(;this.queue.length&&n();){let o=this.queue[0],r=this.chunks.get(o);if(!r){this.queue.shift();continue}let s=this.built.get(o)??0,a=Math.min(s+qa,r.length),l=[];for(let c=s;c<a;c++)this.loose.delete(r[c].id)||l.push(r[c]);l.length&&this.host.build(l),this.built.set(o,a),a===r.length&&this.queue.shift(),i=!0}this.host.draw(),this.stepping=!1,!this.stopped&&!this.frame&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}finish(){this.cancel();for(let[e,i]of this.chunks){let n=i.slice(this.built.get(e)??0).filter(o=>!this.loose.has(o.id));n.length&&this.host.build(n),this.built.set(e,i.length)}this.loose.clear(),this.queue=[],this.pinQueue=[],this.host.draw()}cancel(){this.stopped=!0,this.frame&&this.host.cancel(this.frame),this.frame=0}get pending(){return(this.queue.length>0||this.pinQueue.length>0)&&!this.stopped}get nodeCount(){return[...this.built.values()].reduce((e,i)=>e+i,0)+this.loose.size}};function Za(t,e,i,n=1e3){let o=new Set,r=s=>{for(let a of s){if(o.size>=n)return!1;a&&o.add(a)}return o.size<n};return r(t)&&r(e)&&r(i),o}import{Circle as Np}from"konva/lib/shapes/Circle";import{Line as Hp}from"konva/lib/shapes/Line";import{Rect as Gp}from"konva/lib/shapes/Rect";import{Text as Wp}from"konva/lib/shapes/Text";function Ie(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Pe(t,e){return Ie(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Qa=.35,ja=.7,Qe="#0b1220",pt="#ffffff",Ja="#0b1220",eo="#232c40",el="#8b93a7";function to(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var io="#f7f8fb";import{Text as il}from"konva/lib/shapes/Text";var tl="500",Rp=2.5;function Mp(t,e){return t>=ie||e&&t>=mi}function Ep(t){return t.effectiveScale<mi?!1:t.focusActive||t.stageWidth<U}function Ap(t,e,i){return i&&e>=mi?Math.max(t,Qr/Math.max(e,1e-4)):t}function Fp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=G/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(st,r),s)}function no(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function nl(t){let e=new Map;for(let o of t){let r=e.get(o.rowId);r?r.push(o):e.set(o.rowId,[o])}let i=[];for(let o of e.values())if(!(o.length<2))for(let r=1;r<o.length;r+=1){let s=Math.hypot(o[r].x-o[r-1].x,o[r].y-o[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((o,r)=>o-r);let n=Math.floor(i.length/2);return i.length%2?i[n]:(i[n-1]+i[n])/2}function ol(t,e){return e>0?Math.min(t,e/2):t}function rl(t){return Ei(oo(t))}function oo(t){let e=no(t,!1),i=no(J,!1),n=e>0?i/e:1;return me/Math.max(1,n)}function Ei(t){return G/Math.max(t,1e-4)/In(1,!1,G)}function sl(t){return Ei(t)*vi}function _p(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function al(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=Ep({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:In(e,t.labelsWereVisible(),G),o=t.labelLayers(),r=o.seatLabels&&Mp(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=g=>{let y=t.worldToScreen({x:g.x(),y:g.y()}),S=g.width()*e,k=g.height()*e;return y.x-S/2>=0&&y.y-k/2>=0&&y.x+S/2<=t.stage.width()&&y.y+k/2<=t.stage.height()};for(let[g,y]of t.boothLabelById){let S=t.circleById.get(g);y.visible(be(y.fontSize(),n)&&!!S?.isVisible()&&t.focusedSeatOpacity(g,S?.getAbsoluteOpacity()??1)>=.5&&s(y))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0,c=t.rowLabelDwell,d=t.gesturing?.()??!1,u=performance.now();if(c?.begin(),r)for(let g of t.visibleSeatCandidates()){if(g.kind==="booth")continue;let y=t.worldToScreen(g);if(y.x<-20||y.x>t.stage.width()+20||y.y<-20||y.y>t.stage.height()+20||t.accessGlyphById.has(g.id)&&t.accessGlyphShouldShow(g.id))continue;let S=t.circleById.get(g.id);if(!S?.isVisible()){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let k=t.statusById.get(g.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(g.id)&&(k==="booked"||k==="not_for_sale"||k==="held"&&!t.ownedHold.has(g.id))){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(g.id)){t.seatLabelDrops.set(g.id,"selection-tick");continue}if(S&&t.opts.organizerGlyph?.isPainted(S)){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.focusedSeatOpacity(g.id,S.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let x=Ap(me*t.seatLabelScale(g),e,i),T=ri(g.displayLabel??g.label),P=S?t.seatLabelInk(g,S):t.seatPreferredLabelInk(g),L=t.seatLabelPool.get(g.id);L?(L.position({x:g.x,y:g.y}),L.text(T),L.fontSize(x),L.fontFamily(t.labelFont()),L.fill(P),L.offset({x:0,y:0}),L.scale({x:1,y:1})):(L=new il({x:g.x,y:g.y,text:T,fontSize:x,fontStyle:tl,fontFamily:t.labelFont(),fill:P,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(g.id,L));let C=no(t.seatR,i);if(L.fontSize(Fp({authoredFontSize:x,measuredWidth:L.width(),maxWidth:C,effectiveScale:e})),L.width()>C+.01){t.seatLabelDrops.set(g.id,"label-overflows-marker");continue}if(!be(L.fontSize(),e)){t.seatLabelDrops.set(g.id,"below-minimum-size");continue}if(L.offsetX(L.width()/2),L.offsetY(L.height()/2),_p(t,g.id,L),!s(L)){t.seatLabelDrops.set(g.id,"outside-viewport");continue}if(!(c&&!c.admit(`seat:${g.id}`,u,d))&&(a.add(g.id),t.seatLabelById.set(g.id,L),++l>=jr))break}for(let[g,y]of t.seatLabelPool)a.has(g)||(y.destroy(),t.seatLabelPool.delete(g));let h=new fe;for(let{node:g}of t.freeTextById.values()){if(!g.isVisible())continue;let y=g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:y.x-ee,y:y.y-ee,width:y.width+ee*2,height:y.height+ee*2})}let p=new fe,m=null,b=()=>{if(m)return m;m=new fe;for(let g of t.seatLabelById.values()){if(!g.isVisible())continue;let y=g.getClientRect({skipShadow:!0,skipStroke:!0});m.insert({x:y.x,y:y.y,width:y.width,height:y.height})}return m},f=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Rp;if(o.rowLabels)for(let g of Bp(t.rowLabelPlan)){let y=t.rowLabelPlan[g],S=t.focusedSectionId!=null&&y.focusKeys?.includes(t.focusedSectionId),k=Math.max(e,1e-4),w=S?Math.max(y.fontSize,Et/k):y.fontSize,v=Math.max(Math.min(w,Zr(t.stage.width())/k),S?Et/k:0);if(!r&&(!S||!f)||!S&&!be(v,n))continue;let x=t.worldToScreen({x:y.x,y:y.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let T=new il({x:y.x,y:y.y,text:y.text,fontSize:v,fontStyle:tl,fontFamily:t.labelFont(),fill:y.ink,rotation:y.rotation,opacity:y.opacity,shadowColor:"#05070c",shadowBlur:y.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:y.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});y.pill&&Ta(T,y.pill),T.offsetX(T.width()/2),T.offsetY(T.height()/2);let P=t.resolveAutomaticRowLabelPosition(T,y,h);T.position(P),T.setAttr("rowLabel",!0),y.rowKey&&T.setAttr("rowKey",y.rowKey),T.setAttr("focusKeys",y.focusKeys??[]),t.rowLabelGroup.add(T);let L=T.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,I=L.x<C?C-L.x:L.x+L.width>t.stage.width()-C?t.stage.width()-C-L.x-L.width:0,R=L.y<C?C-L.y:L.y+L.height>t.stage.height()-C?t.stage.height()-C-L.y-L.height:0,M=P;if(I||R){let E=t.labelGroup.getAbsoluteTransform(),W=E.point(P);M=E.copy().invert().point({x:W.x+I,y:W.y+R}),T.position(M);let N=T.getClientRect({skipShadow:!0,skipStroke:!0});if(b().collisionCount({x:N.x,y:N.y,width:N.width,height:N.height})>0){T.destroy();continue}}let A=t.rowLabelBox(T,M);if(p.collisionCount(A)>0){T.destroy();continue}if(y.automaticAway&&h.collisionCount(A)>0){T.destroy();continue}if(c&&!c.admit(`row:${g}`,u,d)){T.destroy();continue}h.insert(A),p.insert(A)}c?.end(),t.overlayLayer.batchDraw()}function Bp(t){let e=o=>o.focusKeys?.length?o.focusKeys.join(" "):"",i=[],n=0;for(;n<t.length;){let o=e(t[n]),r=n;for(;r+1<t.length&&e(t[r+1])===o;)r++;if(o){i.push(n),r>n&&i.push(r);for(let s=n+1;s<r;s++)i.push(s)}else for(let s=n;s<=r;s++)i.push(s);n=r+1}return i}function ro(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:oo(e)}}function Op(t){let e=ft(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:J*2,labelFontSize:ge({width:e.width,height:e.height,text:t.label})}}function ft(t){let e=t.points;if(!e||e.length<3)return{width:Math.abs(t.width),height:Math.abs(t.height)};let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=Math.min(i,s.x),o=Math.max(o,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y));return Number.isFinite(i)?{width:o-i,height:r-n}:{width:Math.abs(t.width),height:Math.abs(t.height)}}function ll(t,e){let i=ro(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?Op({...e.blockDims.get(o.rowId)??{width:J*2,height:J*2},label:o.displayLabel??o.label}):i;(!n||r.labelFontSize<n.labelFontSize||r.labelFontSize===n.labelFontSize&&r.diameter<n.diameter)&&(n=r)}return n??i}function Dp(t){return sl(t.labelFontSize)}function cl(t){return Ei(t.labelFontSize)}function Ai(t){let e=Math.max(t.diameter,1e-4);return Math.max(ae,li/e)}function dl(t){return Math.max(Dp(t),Ai(t)*vi)}function hl(t){for(let e of t.seats){if(e.kind==="booth"){Vp(t,e);continue}let i=t.seatContainer(e.id),n=Ks({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:Ir(e.glyph,t.catByKey.get(e.categoryKey)),wheelchairBay:e.wheelchairSpaceType==="no-seat"});if(n instanceof Ye&&t.glyphMarkers.push(n),n.setAttr("seatId",e.id),t.circleById.set(e.id,n),t.paintSeat(n,e.id),i.add(n),e.accessible){if(e.wheelchairSpaceType!=="no-seat"){let o=new Np({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Pt(e.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(e.id,o),i.add(o)}if(nt(e.accessibility??[])){let o=t.buildAccessGlyph(e,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(e.id,o),i.add(o)}}}}function Vp(t,e){let i=t.seatContainer(e.id),n=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},o=e.x,r=e.y,s;if(n.points&&n.points.length>=3?(s=new Hp({x:e.x,y:e.y,points:n.points.flatMap(c=>[c.x,c.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),o=e.x+n.points.reduce((c,d)=>c+d.x,0)/n.points.length,r=e.y+n.points.reduce((c,d)=>c+d.y,0)/n.points.length):s=new Gp({x:e.x,y:e.y,width:n.width,height:n.height,offsetX:n.width/2,offsetY:n.height/2,rotation:n.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s),n.nameHidden){t.paintSeat(s,e.id);return}let a=e.displayLabel??e.label,l=new Wp({x:o,y:r,text:a,fontSize:n.nameSize??ge({...ft(n),text:a}),fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??Qe,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),t.boothLabelById.set(e.id,l),i.add(l),t.paintSeat(s,e.id)}function ul(t,e,i,n){let o=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!n?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.seatR*s+i,d=Math.hypot(l.x-e.x,l.y-e.y);d<=c&&d<r&&(r=d,o=a.id)}return o}function pl(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),n=null,o=1/0;for(let r of t.seats){let s=r.x-i.x,a=r.y-i.y,l=s*s+a*a;l<o&&(o=l,n=r.rowId)}return n?t.objectFloor.get(n)??null:null}import{Circle as uf}from"konva/lib/shapes/Circle";import{Group as Ol}from"konva/lib/Group";import{Rect as pf}from"konva/lib/shapes/Rect";import{Text as ff}from"konva/lib/shapes/Text";var Re=1.12;function mt(t,e,i,n){if(e.width<=0||e.height<=0)return t.scaleX();let o=n??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(o.width/(e.width*Re),o.height/(e.height*Re));return q(r,i.min,i.max)}var Ht=.55;function Gt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function so(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??_t,a=e.scaleX(),l=mt(e,i,n,o)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(o.x+o.width/2),d=r.y-(o.y+o.height/2);return Math.hypot(c,d)<=Math.min(o.width,o.height)*.02}function fl(t,e,i,n){let o=q(e,n.min,n.max),r=t.scaleX();if(o===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.setAttrs({scaleX:o,scaleY:o,x:i.x-s*o,y:i.y-a*o}),!0}function ml(t,e,i,n,o,r){let s=o??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Re),s.height/(e.height*Re)),l=n??i.min,c=q(Math.max(a,l),i.min,Math.max(l,Gt(i,r)));t.scale({x:c,y:c}),t.position({x:s.x+s.width/2-(e.x+e.width/2)*c,y:s.y+s.height/2-(e.y+e.height/2)*c})}function gl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function ao(t,e){let i=null;for(let n of t){let o=e.get(n)?.logicalId;if(!o||i!=null&&i!==o)return null;i=o}return i}function bl(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var zp="500",Kp=11;function Xp(t){let e=lt(Kp,t),i=gi(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var Yp=4;function Up(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let n=i[0];for(let o of i)o.length>=n.length&&(n=o);return n}return e}function yl(t,e,i){let n=t.numberLabel,o=Up(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.fontStyle(i<U?zp:Ce),n.visible(!0),n.rotation(0);let r=Yp/e;for(let s of Xp(i)){n.fontSize(s/e),n.offsetX(n.width()/2),n.offsetY(n.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(n.position(a),ut(a,n.width()+r,n.height()+r,0,t.outline,t.holes))return!0}return n.position(t.centroid),!1}function Sl(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let n=e.get(i.logicalId);n?n.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let n=i[0];for(let o of i)o.labelArea>n.labelArea&&(n=o);for(let o of i)o!==n&&o.numberLabel.opacity(0)}}function xl(t,e){let i=t.sectionHeat.get(e.id)??t.sectionHeat.get(e.logicalId)??(e.zone?t.sectionHeat.get(e.zone):void 0);if(i==null||i<=0){e.outlinePoly.stroke(D(e.outlineTint,.5)),e.outlinePoly.fill(D(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(D(n,.72+i*.25)),e.outlinePoly.fill(D(n,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(n),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function lo(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function Ll(t,e,i,n){if(!e)return 0;let o=0;for(let r of t){if(i(r)!=="free")continue;let s=n(r);s&&Ie(s,e)&&(o+=1)}return o}function Cl(t,e){return lo(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Is?"nearly-gone":"normal"}function Tl(t,e){let i=Cl(t,e),n=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,o=t.blockPaint?.({id:e.logicalId,label:e.label,free:e.free,total:e.total,state:i})??null;e.stateWord=o?.stateWord??null;let r=Ds(t.canvasBackground,i,n?null:o?o.tint??null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(i==="sold-out"?F("map.soldOut"):F("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Il(t,e){return j(e,O(t)?"#ffffff":"#000000",vs)}function co(t,e,i=0){let n=Ss-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function $p(t,e){return Pl(t,e)!=null}function Pl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function Rl(t,e,i){let n=co(t.label,e,i?i.length+1:0),o=t.stateWord?[`${n} \xB7 ${t.stateWord}`]:[];return i?[...o.map(r=>`${i} ${r}`),`${i} ${n}`,i]:[...o,n]}function qp(t,e,i){let n=Rl(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(ys),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Be:0)}function Zp(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var Qp=.05;function Ml(t){if(!t.seatCount)return!1;let e=0;for(let n of t.sections)e+=n.memberIds.length;return(t.seatCount-Math.min(e,t.seatCount))/t.seatCount<=Qp}function El(t,e){let i,n;t.reducedMotion?(i=e<=Le?1:0,n=e<=Ke?1:0):(i=q((ve-e)/(ve-Le),0,1),n=q((Le-e)/(Le-Ke),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Q;o&&(i=1),(!t.zones.length||t.sectionsPinned)&&(n=0),t.seatLayer.opacity(Ml(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>Rn);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<U,c=l&&o&&t.zones.length===0,d=le(t.canvasBackground),u=q((i-.2)/.8,0,1),h=new Set(t.zones.map(b=>b.id)),p=new Set;for(let b of t.sections){let f=t.hasFocusDimOverlay?1:a&&b.id!==a&&b.logicalId!==a&&b.zone!==a?Te:1,g=Pl(t,b);g&&b.zone&&p.add(b.zone);let y=Math.min(f,bl(b.memberCategoryKeys,t.categoryFilter)?Te:1,t.accessFilterActive&&!g?Te:1);b.outlinePoly.opacity(o?0:(1-i)*y),b.blockPoly.opacity(ns*i*y);let S=t.sectionIsOwned(b);b.blockPoly.stroke(S?t.selectionColor:b.shellStroke||d.sectionStroke),b.blockPoly.strokeWidth((S?os:Xe)/Math.max(r,1e-4));let k=b.blockPoly.fill(),w=typeof k=="string"?k:b.baseFill,v=!!b.shellCategoryColor&&!b.explicitInk&&["normal","nearly-gone"].includes(Cl(t,b)),x=v?Ws(b.shellCategoryColor,w,4.5):Gs(w,b.explicitInk,b.preferredInk,vr);b.nameLabel.fill(x),b.subLabel.fill(x),qp(b,l,g);let T=b.zone!=null&&h.has(b.zone);s&&(u>.01||b.externalLabel)&&tf(t,b,r,Rl(b,l,g),!T);let P=g||!T?1:1-n;b.nameLabel.opacity(b.nameLabelFits?(b.externalLabel?1:u)*P*y:0),b.subLabel.opacity(0);let L=c&&!b.nameLabelFits,C=T&&n>.01;s&&(b.numberLabelFits=(C||L)&&yl(b,r,t.stageWidth)),b.numberLabelFits&&b.numberLabel.fill(v?x:de(w,b.explicitInk,b.preferredInk)),b.numberLabel.opacity(b.numberLabelFits?(L?u:C?n:0)*y:0);let I=b.nameLabel.opacity(),R=b.numberLabel.opacity();if(I>.05&&R>.05){let M=Math.min(1*y,I+R);I>=R?(b.nameLabel.opacity(M),b.numberLabel.opacity(0)):(b.numberLabel.opacity(M),b.nameLabel.opacity(0))}}let m=n;for(let b of t.zones){let f=t.accessFilterActive&&!p.has(b.id)?Te:1,g=b.label.visible()?m*f:0;b.back.opacity(g),b.label.opacity(g),b.sub&&b.sub.opacity(vl(t,b)?0:g),s&&nf(t,b,r)}if(!t.glideInProgress&&(u>.01||m>.01)){Jp(t,r),jp(t.sections);for(let b of t.zones){let f=b.label.opacity();b.back.opacity(f),b.sub&&b.sub.opacity(vl(t,b)?0:f)}}(m>.01||c)&&Sl(t.sections);for(let b of t.sections)Zp(b);t.bgLayer.batchDraw()}function vl(t,e){return t.stageWidth<U||!e.sub||!e.sub.visible()}function jp(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let n=i.filter(o=>o.nameLabel.opacity()>.05).sort((o,r)=>{let s=z(o.outline),a=z(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function Jp(t,e){let n=[],o=u=>{let h=t.worldToScreen({x:u.x(),y:u.y()}),p=z(ht({x:0,y:0},u.width()*e,u.height()*e,u.rotation()));return{x:h.x-p.width/2,y:h.y-p.height/2,w:p.width,h:p.height}};for(let u of t.zones){if(u.label.opacity()<=.05)continue;let h=u.back.getAbsolutePosition(),p=u.back.width()*e,m=u.back.height()*e;n.push({node:u.label,tier:2,section:!1,zone:u,box:{x:h.x-p/2,y:h.y-m/2,w:p,h:m}})}for(let u of t.sections){if(u.nameLabel.opacity()>.05){let h=$p(t,u)?-1:1;n.push({node:u.nameLabel,tier:h,section:!0,area:u.labelArea,box:o(u.nameLabel)})}u.numberLabel.opacity()>.05&&n.push({node:u.numberLabel,tier:1,section:!1,area:u.labelArea,box:o(u.numberLabel)})}let r=t.landmarks.map(u=>{let h=t.worldToScreen({x:u.x,y:u.y}),p=t.worldToScreen({x:u.x+u.width,y:u.y+u.height});return{x:Math.min(h.x,p.x),y:Math.min(h.y,p.y),w:Math.abs(p.x-h.x),h:Math.abs(p.y-h.y)}});if(n.length<2&&!r.length)return;n.sort((u,h)=>u.tier-h.tier||(h.area??0)-(u.area??0)||u.box.y-h.box.y||u.box.x-h.box.x);let s=[...r],a=u=>s.some(h=>u.x<h.x+h.w+4&&h.x<u.x+u.w+4&&u.y<h.y+h.h+4&&h.y<u.y+u.h+4),l=n.some(u=>u.zone)?af(t):[],c=t.bgLayer.getStage()?.height()??1/0,d=u=>!a(u)&&!l.some(h=>sf(u,h,2))&&u.x>=6&&u.x+u.w<=t.stageWidth-6&&u.y>=Al&&u.y+u.h<=c-6;for(let u of n){if(u.zone){let p=lf(t,u.zone,u.box,d);p?s.push(p):u.node.opacity(0);continue}if(!a(u.box)){s.push(u.box);continue}let h=!1;if(u.section){let p=u.node.fontSize(),m=u.node.y(),b=u.node.letterSpacing()>0;for(let f of Pn){let g=p*f;if(g*e<Ft(t.stageWidth))break;Me(u.node,g,m),b&&(u.node.letterSpacing(u.node.fontSize()*Be),u.node.offsetX(u.node.width()/2));let y=o(u.node);if(!a(y)){s.push(y),h=!0;break}}h||(Me(u.node,p,m),b&&(u.node.letterSpacing(u.node.fontSize()*Be),u.node.offsetX(u.node.width()/2)))}h||u.node.opacity(0)}}function Me(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function ef(t,e,i){let n=z(t);return ge({width:n.width*i,height:n.height*i,text:e})}function tf(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<U,s=Ft(t.stageWidth),a=Mn(at*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&Ml(t)?Math.max(a,ef(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Me(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,p]of n.entries()){e.nameLabel.text(p);let m=z(e.outline),b=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:m.height>m.width*Cs?[0,-90]:[0];for(let f of b)for(let g of e.labelAnchors)for(let y=c;y>=s;y-=1){e.nameLabel.rotation(f),Me(e.nameLabel,y/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(g);let S=Ls/i;if(ut(g,e.nameLabel.width()+S,e.nameLabel.height()+S,f,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=h>0;return}}}e.nameLabel.text(n[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Me(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=z(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function wl(t,e,i){let n=o=>(t.text(o),t.width());if(!(n(e)<=i)){for(let o=e.length-1;o>=1;o-=1)if(n(`${e.slice(0,o).trimEnd()}\u2026`)<=i)return;n("\u2026")}}function nf(t,e,i){let n=Si(t.stageWidth),o=t.stageWidth<U,r=e.sub!=null&&!o,s=(o?ls:ds)*n/i,a=(o?cs:hs)*n/i,l=Mn(bi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Me(e.label,l/i,e.anchor.y),r&&(Me(e.sub,lt(yi,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*rs),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*ps/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*fs-s*2:1/0,u=Math.min(c,d),h=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&h()>u&&(r=!1),h()>u)for(let x of Pn){let T=Math.max(_e,l*x);if(T>=e.label.fontSize()*i-.001||(Me(e.label,T/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(wl(e.label,e.name,Math.max(u,1)),of(e.label.text())<rf(e.name)&&wl(e.label,e.name,Math.max(c,1)),Me(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){kl(e);return}e.label.visible(!0),e.back.visible(!0);let p=r?3*n/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let m=Math.max(e.label.width(),r?e.sub.width():0)+s*2,b=e.label.height()+(r?p+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(p+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+p)/2),e.back.position(e.anchor),e.back.size({width:m,height:b}),e.back.offset({x:m/2,y:b/2}),e.back.cornerRadius(us*n/i),e.back.strokeWidth(1/i),e.aboveZone&&Fi(e,0,-(b/2+4*n/i));let f=e.back.getAbsolutePosition(),g=6,y=m*i;if(y>t.stageWidth-g*2){kl(e);return}let S=y/2,w=(q(f.x,g+S,t.stageWidth-g-S)-f.x)/i;Math.abs(w)>.001&&Fi(e,w,0);let v=Al+b*i/2;f.y<v&&Fi(e,0,(v-f.y)/i)}function of(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function rf(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function kl(t){t.label.visible(!1),t.label.opacity(0),t.back.visible(!1),t.back.opacity(0),t.sub&&(t.sub.visible(!1),t.sub.opacity(0))}function Fi(t,e,i){t.label.x(t.label.x()+e),t.label.y(t.label.y()+i),t.sub&&(t.sub.x(t.sub.x()+e),t.sub.y(t.sub.y()+i)),t.back.x(t.back.x()+e),t.back.y(t.back.y()+i)}var Al=62;function sf(t,e,i){return t.x<e.x+e.w+i&&e.x<t.x+t.w+i&&t.y<e.y+e.h+i&&e.y<t.y+t.h+i}function af(t){return t.sections.map(e=>{let i=z(e.outline),n=t.worldToScreen({x:i.x,y:i.y}),o=t.worldToScreen({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(n.x,o.x),y:Math.min(n.y,o.y),w:Math.abs(o.x-n.x),h:Math.abs(o.y-n.y)}})}function lf(t,e,i,n){let o=[i];if(e.area){let a=t.worldToScreen({x:e.area.x,y:e.area.y}),l=t.worldToScreen({x:e.area.x+e.area.width,y:e.area.y+e.area.height}),c=(a.x+l.x)/2-i.w/2,d=(a.y+l.y)/2-i.h/2;o.push({...i,x:c,y:l.y+6},{...i,x:a.x-6-i.w,y:d},{...i,x:l.x+6,y:d})}for(let s of ms)s!==0&&o.push({...i,y:i.y+s});let r=t.stageScaleX||1;for(let s of o)if(n(s))return s!==i&&Fi(e,(s.x-i.x)/r,(s.y-i.y)/r),s;return null}function cf(t,e){if(!t.length)return null;let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of t)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(s.x<i&&(i=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(n)?null:{x:i-e,y:n-e,width:o-i+e*2,height:r-n+e*2}}function po(t,e=0){let i=new Map;for(let o of t){let r=`${o.rowId}|${o.categoryKey}`,s=i.get(r);s||(s={categoryKey:o.categoryKey,points:[]},i.set(r,s)),s.points.push({x:o.x,y:o.y})}let n=[];for(let[o,r]of i){let s=cf(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function ho(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),n=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,n)}function uo(t,e){let i=Math.min(t.x,e.x),n=Math.min(t.y,e.y);return{x:i,y:n,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-n}}function Fl(t){if(!t.length)return 0;let e=[...t].sort((n,o)=>n-o),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function df(t){if(!t.length)return 0;let e=Fl(t.map(n=>Math.min(n.bounds.width,n.bounds.height)));if(t.length<2)return e;let i=[];for(let n=0;n<t.length;n+=1){let o=1/0;for(let r=0;r<t.length;r+=1)n!==r&&(o=Math.min(o,ho(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return Fl(i)+e}function fo(t,e){if(!t.length)return[];let i=df(t)*(e?.gapRows??2),n=e?.minRows??2,o=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((h,p)=>h.bounds.y-p.bounds.y||h.bounds.x-p.bounds.x||h.id.localeCompare(p.id)),d=[];for(let h of c){let p=d.find(m=>ho(m.bounds,h.bounds)<=i);p?(p.bounds=uo(p.bounds,h.bounds),p.rowIds.push(h.id),p.seatCount+=h.seatCount):d.push({categoryKey:a,bounds:{...h.bounds},rowIds:[h.id],seatCount:h.seatCount})}let u=!0;for(;u&&d.length>1;){u=!1;e:for(let h=0;h<d.length;h+=1)for(let p=h+1;p<d.length;p+=1)if(!(ho(d[h].bounds,d[p].bounds)>i)){d[h].bounds=uo(d[h].bounds,d[p].bounds),d[h].rowIds.push(...d[p].rowIds),d[h].seatCount+=d[p].seatCount,d.splice(p,1),u=!0;break e}}for(let h of d)h.rowIds.length<n&&h.seatCount<o||(h.rowIds.sort(),s.push(h))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function _l(t){let e=null;for(let i of t)e=e?uo(e,i.bounds):{...i.bounds};return e}function Bl(t,e){let i=null,n=1/0;for(let o of t){let{x:r,y:s,width:a,height:l}=o.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<n&&(i=o,n=c)}return i}function Nl(t){return t*.3}function Dl(t){return Nl(t)*2+t*.42}var _i=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey="";this.pressOnChart=!0}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.pressOnChart=!0,this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=fo(po(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=le(i),o=Il(i,i),r=X(o,n.sectionInk),s=new Ol({listening:!1,opacity:0,visible:!1});for(let a of e){let l=this.host.categoryLabel(a.categoryKey);if(!l)continue;let c={x:a.bounds.x+a.bounds.width/2,y:a.bounds.y+a.bounds.height/2},d=new Ol({listening:!1}),u=new pf({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:Xe,opacity:ws,listening:!1,perfectDrawEnabled:!1}),h=new uf({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),p=new ff({...c,text:l,fontSize:at,fontStyle:Ce,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(p),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:p,label:l})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,n=this.host.exportMode||this.host.seatsPickable()&&e<ae||e>=this.host.readableScale();return this.revealed=n||Xr(Tn(i,e),Tn(i,ae),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.revealed||this.capOnePerCategory(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.host.screenToWorld(e),n=this.clusterAt(i);if(!n)return!1;let o=this.host.seatR()*2,r={x:n.bounds.x-o,y:n.bounds.y-o,width:n.bounds.width+o*2,height:n.bounds.height+o*2},s=this.host.stage;if(mt(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*_t)return!1;let l=this.diveTarget(r,null,i);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i,n){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),a=mt(o,e,s,r),l=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),s.max);if(a>=l)return e;let c=r.width/(l*Re),d=r.height/(l*Re);if(!(c>0)||!(d>0))return null;let u=i??{x:e.x+e.width/2,y:e.y+e.height/2},h={x:u.x-c/2,y:u.y-d/2,width:c,height:d};return n?gf(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=Ps(i,this.host.pickableScale());if(n==null||n<=i*_t)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Re),a=r.height/(n*Re);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:o.x-s/2,y:o.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.seatsPickable()?e?"pointer":"default":this.pressOnChart?"zoom-in":"default";for(let n of[this.host.stage.container(),this.host.stage.content])n&&n.style.cursor!==i&&(n.style.cursor=i)}clusterAt(e){let i=Bl(this.all,e);if(i)return i;if(!this.visible)return null;for(let n of this.labels){if(!n.pill.visible())continue;let o=n.plate.width()/2,r=n.plate.height()/2;if(Math.abs(e.x-n.text.x())<=o&&Math.abs(e.y-n.text.y())<=r)return n.cluster}return null}size(e,i){let n=Math.max(e,1e-4),o=i<U,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=lt(at,i),a=ks/n,l=xs/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:p}=c;d.text(co(c.label,o)),d.fontStyle(o?bs:Ce);let m=s,b=0;for(;d.fontSize(Math.max(1,m/n)),d.letterSpacing(d.fontSize()*Be),b=Dl(d.fontSize())+d.width()+a*2,!(b<=p.bounds.width||m<=_e);)m=Math.max(_e,m-1);let f={x:p.bounds.x+p.bounds.width/2,y:p.bounds.y+p.bounds.height/2},g=d.height()+l*2,y=b-a*2,S=f.x-y/2;h.radius(Nl(d.fontSize())),h.position({x:S+h.radius(),y:f.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Dl(d.fontSize()),y:f.y}),u.size({width:b,height:g}),u.offset({x:b/2,y:g/2}),u.cornerRadius(g/2),u.strokeWidth(Xe/n),u.position(f)}return!0}capOnePerCategory(){if(this.labels.length<2)return;let e=this.viewportWorldRect(),i={x:e.x+e.width/2,y:e.y+e.height/2},n=new Map;for(let r of this.labels){let s=r.cluster.bounds;if(s.x>e.x+e.width||s.x+s.width<e.x||s.y>e.y+e.height||s.y+s.height<e.y)continue;let a=Math.hypot(s.x+s.width/2-i.x,s.y+s.height/2-i.y),l=n.get(r.cluster.categoryKey);(!l||a<l.distance||a===l.distance&&r.cluster.seatCount>l.entry.cluster.seatCount)&&n.set(r.cluster.categoryKey,{entry:r,distance:a})}let o=!1;for(let r of this.labels){let s=n.get(r.cluster.categoryKey)?.entry===r;r.pill.visible()!==s&&(r.pill.visible(s),o=!0)}o&&this.host.labelLayer.batchDraw()}viewportWorldRect(){let e=this.host.framingViewport(),i=this.host.screenToWorld({x:e.x,y:e.y}),n=this.host.screenToWorld({x:e.x+e.width,y:e.y+e.height});return{x:i.x,y:i.y,width:n.x-i.x,height:n.y-i.y}}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let n of this.labels){let o=e&&!e.has(n.cluster.categoryKey)?.22:1;n.pill.opacity()!==o&&(n.pill.opacity(o),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let n=po(e,this.host.seatR()),o=fo(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=_l(o);if(!r)return null;let s=o.reduce((a,l)=>l.seatCount>a.seatCount?l:a,o[0]);return{bounds:{x:r.x-i,y:r.y-i,width:r.width+i*2,height:r.height+i*2},anchor:{x:s.bounds.x+s.bounds.width/2,y:s.bounds.y+s.bounds.height/2},singleBlock:o.length===1&&e.every(a=>a.x>=r.x&&a.x<=r.x+r.width&&a.y>=r.y&&a.y<=r.y+r.height)}}applyVisibility(e){let i=this.group;if(!i||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),i.visible(!0),this.host.reducedMotion()){i.opacity(e?1:0),i.visible(e),this.host.labelLayer.batchDraw();return}let n=i.opacity(),o=e?1:0,r=performance.now(),s=a=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let l=Math.min(1,(a-r)/90);i.opacity(n+(o-n)*l),l>=1&&i.visible(o>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}},mf=.18;function gf(t,e){let i=(n,o,r)=>{let s=o*mf;return r<n+s?r-s:r>n+o-s?r+s-o:n};return{...t,x:i(t.x,t.width,e.x),y:i(t.y,t.height,e.y)}}import{Circle as bf}from"konva/lib/shapes/Circle";import{Line as yf}from"konva/lib/shapes/Line";function Hl(t,e,i){let n=t.seatRadius(),o=new bf({x:e.x,y:e.y,radius:n,stroke:i,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.overlayLayer.add(o);let r=performance.now(),s=620,a=l=>{if(!o.getLayer())return;let c=Math.max(0,Math.min(1,(l-r)/s));o.radius(n*(1+c*1.8)),o.opacity(.9*(1-c)),t.overlayLayer.batchDraw(),c<1?requestAnimationFrame(a):(o.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(a)}function Gl(t,e,i){for(let n of e){let o=n.outline,r=o.reduce((u,h)=>({x:u.x+h.x,y:u.y+h.y}),{x:0,y:0});r.x/=o.length,r.y/=o.length;let s=new yf({x:r.x,y:r.y,points:o.flatMap(u=>[u.x-r.x,u.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=u=>{if(t.isDestroyed()||!s.getLayer())return;let h=Math.max(0,Math.min(1,(u-l)/c)),m=1+(1-Math.pow(1-h,3))*.04;s.scale({x:m,y:m}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Lf}from"konva/lib/Group";import{Shape as Cf}from"konva/lib/Shape";import{Group as Sf}from"konva/lib/Group";import{Shape as vf}from"konva/lib/Shape";function wf(t,e,i){let n=e.length,o={x:(e[n-1].x+e[0].x)/2,y:(e[n-1].y+e[0].y)/2};t.moveTo(o.x,o.y);for(let r=0;r<n;r+=1){let s=e[r],a=e[(r+1)%n],l=e[(r-1+n)%n],c=Math.min(Math.hypot(s.x-l.x,s.y-l.y)/2,Math.hypot(a.x-s.x,a.y-s.y)/2);t.arcTo(s.x,s.y,a.x,a.y,Math.max(0,Math.min(i,c)))}t.closePath()}function kf(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0,s=(a,l)=>{!Number.isFinite(a)||!Number.isFinite(l)||(a<i&&(i=a),l<n&&(n=l),a>o&&(o=a),l>r&&(r=l))};for(let a of t)s(a.x,a.y);if(e){let a=e.start;s(a.x,a.y);for(let l of e.segments){if(s(l.end.x,l.end.y),l.kind==="arc")for(let c of xf(l,a))s(c.x,c.y);else l.kind==="bezier"&&(s(l.control1.x,l.control1.y),s(l.control2.x,l.control2.y));a=l.end}}return!(o>=i)||!(r>=n)?{x:0,y:0,width:0,height:0}:{x:i,y:n,width:o-i,height:r-n}}function xf(t,e){let{center:i,radius:n}=t;if(!(n>0))return[];let o=Math.PI*2,r=d=>(d%o+o)%o,s=Math.atan2(e.y-i.y,e.x-i.x),a=Math.atan2(t.end.y-i.y,t.end.x-i.x),l=r(t.clockwise?a-s:s-a)||o,c=[];for(let d=0;d<4;d+=1){let u=d*(Math.PI/2);r(t.clockwise?u-s:s-u)<=l&&c.push({x:i.x+n*Math.cos(u),y:i.y+n*Math.sin(u)})}return c}function De(t,e,i,n){let o=vn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new vf({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return wf(l,h,r);l.moveTo(h[0].x,h[0].y);for(let p=1;p<h.length;p+=1)l.lineTo(h[p].x,h[p].y);l.closePath()}};n?(h=>{l.moveTo(h.start.x,h.start.y);let p=h.start;for(let m of h.segments)m.kind==="line"?l.lineTo(m.end.x,m.end.y):m.kind==="arc"?l.arc(m.center.x,m.center.y,m.radius,Math.atan2(p.y-m.center.y,p.x-m.center.x),Math.atan2(m.end.y-m.center.y,m.end.x-m.center.x),!m.clockwise):l.bezierCurveTo(m.control1.x,m.control1.y,m.control2.x,m.control2.y,m.end.x,m.end.y),p=m.end;l.closePath()})(n):d(t);for(let h of er(e)){let p=vn(h)>0;d(p===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=kf(t,n);return s.getSelfRect=()=>({...a}),s}var gt=class extends Sf{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(i){i!==this.viewportCulled&&(this.viewportCulled=i,i||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...i){return this.viewportCulled?this:super.drawScene(...i)}drawHit(...i){return this.viewportCulled?this:super.drawHit(...i)}_clearSelfAndDescendantCache(i){if(!this.viewportCulled){super._clearSelfAndDescendantCache(i);return}this._clearCache(i)}};function Wl(t,e){if(!e.length)return null;let i=new Lf({listening:!1});for(let n of e)i.add(De(n.outline,n.holes,{fill:Fs,stroke:D("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function Vl(t,e){let{bounds:i}=t,o=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-o,y:i.y-o},{x:i.x+i.width+o,y:i.y-o},{x:i.x+i.width+o,y:i.y+i.height+o},{x:i.x-o,y:i.y+i.height+o}],s=new Cf({fill:t.canvasBackground,opacity:1-Te,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=u=>{if(u.length){a.moveTo(u[0].x,u[0].y);for(let h=1;h<u.length;h++)a.lineTo(u[h].x,u[h].y);a.closePath()}};a.beginPath(),c(r);let d=[];for(let u of e)d.push(u.outline);d.push(...t.focusedRowLabelCutouts?.()??[]),a.save();for(let u of d)u.length<3||(a.beginPath(),c(r),c(u),a.clip("evenodd"));a.beginPath(),c(r),a.fillStrokeShape(l),a.restore()}});return t.overlayLayer.add(s),s.moveToTop(),s}var Tf=.2;function zl(t,e){return t.startsWith("#")?j(e,t,Tf):t}var $l=.5,$=Math.SQRT1_2,If="#f3f4f6",Kl=4;function Pf(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?$l:Math.min(1,Math.max(0,e))}function Rf(t){return t==="booked"||t==="not_for_sale"?Ms:Rs}function Xl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Yl(t){let e=t.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,i,n,o]=e.toLowerCase();return`#${i}${i}${n}${n}${o}${o}`}function Mf(t,e,i){let n=Yl(t),o=Yl(e);if(!n||!o)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(Xl(n,a)*(1-r)+Xl(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Ul(t,e,i,n){let o=i*4,r=e*$,s=-e*$,a=n*$*2*o,l=n*-$*2*o,c=r+o*$,d=s+o*$,u=r-o*$,h=s-o*$;t.beginPath(),t.moveTo(c,d),t.lineTo(u,h),t.lineTo(u+a,h+l),t.lineTo(c+a,d+l),t.closePath(),t.clip()}function Ef(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-Kl;o<=Kl;o++){let r=o*n*2,s=r+n,a=r*$,l=-r*$,c=s*$,d=-s*$;t.moveTo(a+i*$,l+i*$),t.lineTo(a-i*$,l-i*$),t.lineTo(c-i*$,d-i*$),t.lineTo(c+i*$,d+i*$),t.closePath()}t.clip()}function Bi(t,e){t._sceneFunc(e)}function ql(t){let e=this,i=e.attrs,n=i.markRadius||1,o=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(n*2*s<16){i.fill=i.markMidtone??o,Bi(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??$l))*n;t.save(),Ul(t,l,n,1),i.fill=i.markBase??o,Bi(e,t),t.restore(),t.save(),Ul(t,l,n,-1),i.fill=i.markFill??o,Bi(e,t),i.markHatch&&(Ef(t,n),i.fill=If,Bi(e,t)),t.restore(),i.fill=o}function Af(t,e,i,n,o,r){let s=Pf(e),a=Rf(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=Mf(n,a,1-s),l.markHatch=r,l.markRadius=o>0?o:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(ql)}function Ff(t){t.setAttr("sceneFunc",void 0)}function Di(t){return t.attrs.sceneFunc===ql}var Oi=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let n=new Set;for(let[o,r]of Object.entries(e))i.has(o)&&(r&&r.kind==="partial"?(this.marks.set(o,r),n.add(o)):this.marks.delete(o)&&n.add(o));return n}paint(e,i,n,o,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Di(e)&&Ff(e);return}Af(e,l,n,o,r,s)}};var Zl="#9ca3af";var _f="#f4b740",Bf="#854d0e",Of="#1a1200",Df="#f1f4f9",Nf="#1a2234",Hf="#475569",Gf="#c3cbdc";function Wf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Ql(t,e=!1,i=!1){if(!Wf(t))return null;if(e){if(t==="not_for_sale"){let n=i?Gf:Hf;return{fill:i?Nf:Df,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:Zl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:_f,stroke:Bf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:Of}}return{fill:Zl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function jl(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),n=t.sectionOf(e);if(n!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===n&&i.add(d)}return i}let o=t.seats.find(c=>t.seatId(c)===e);if(!o)return i;let r=t.seatPoint(o),s=t.seatPitch>0?t.seatPitch:t.seatRadius*2,a=6*(s>0?s:1),l=a*a;for(let c of t.seats){let d=t.seatPoint(c),u=d.x-r.x,h=d.y-r.y;u*u+h*h<=l&&i.add(t.seatId(c))}return i}function Jl(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Ni=Object.freeze([]),Vf=.18;function ec(t,e,i){let n=t.seat(i),o=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(n.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Ni),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=o==="held"&&t.isOwnedHold(i),u=t.organizer?.()??!1,h=d?null:Ql(o,u,u&&!O(l));if(h?(e.fill(h.fill),e.stroke(h.stroke),e.strokeWidth(h.strokeWidth),e.dash(h.dash),e.opacity(h.opacity),h.scale!==1&&e.scale({x:h.scale,y:h.scale})):d?(e.fill(se(s,c===pt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===pt?se(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Di(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(h?"":n.displayLabel??n.label);let L=t.boothExtent(n.rowId);a.fontSize(L?.nameSize??(L?ge({...L,text:n.displayLabel??n.label}):Ge)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Qe),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let p=o==="free"||o==="held"&&!t.isOwnedHold(i),m=()=>{let L=e.fill();typeof L=="string"&&e.fill(zl(L,l))},b=t.accessFilter();if(b&&p&&!r){let L=Pe(n,b);L==="other"?(m(),e.opacity(Math.min(e.opacity(),Qa))):L==="companion"&&e.opacity(Math.min(e.opacity(),ja))}let f=t.categoryHighlight();f&&o==="free"&&!r&&n.categoryKey!==f&&e.opacity(.25);let g=t.seatHighlight();g&&!r&&!g.has(i)&&e.opacity(Math.min(e.opacity(),Vf));let y=t.categoryFilter();y&&p&&!r&&!y.has(n.categoryKey)&&(m(),e.opacity(.22)),t.commercialLimitedFilter()&&o==="free"&&!r&&(n.commercial?.restrictedView||n.commercial?.obstructedView)&&e.opacity(.22);let S=t.dimmedSections();if(S.size){let L=t.seatSection(i);(L?S.has(L.id)||S.has(L.logicalId)||L.zone!=null&&S.has(L.zone):S.has(ur))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Es),e.stroke(""),e.strokeWidth(0),e.dash(Ni),e.opacity(As),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let k=t.boothLabel(i)??t.seatLabel(i);if(k){k.fill(t.seatLabelInk(n,e));let L=!a&&(r||d);k.visible(be(k.fontSize(),t.effScale())&&e.opacity()>=.5&&!L)}let w=t.organizerGlyph,v=h?.glyph??null,x=Di(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(w&&v&&!x){let L=a?t.boothExtent(n.rowId):void 0,C=L?Math.min(L.width,L.height)/2:t.seatRadius();w.apply(e,v,h.glyphInk??"",C),a||k?.visible(!1)}else w?.isPainted(e)&&w.clear(e);let T=t.accessGlyph(i);if(T){let L=e.fill();T.fill(ai(typeof L=="string"?L:"")),T.opacity(e.opacity()),T.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function Hi(t,e){let i=null,n=1/0;for(let[o,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),u=Math.abs(e.x-a),h=Math.abs(e.y-l);if(u>c||h>d)continue;let p=u*u+h*h;p<n&&(n=p,i=o)}return i}var zf=Math.log(1.15)/100,Kf=.01,Xf=220,Yf=50;function nc(){return{kind:null,at:-1/0}}function tc(t,e,i){return e===1?t*33:e===2?t*i:t}function oc(t,e,i,n=800){let o=tc(t.deltaX,t.deltaMode,n),r=tc(t.deltaY,t.deltaMode,n),s=i-e.at<Xf&&e.kind!==null,a,l=t.deltaX===0&&Number.isInteger(t.deltaY)&&Math.abs(t.deltaY)>=Yf;return(t.ctrlKey||t.metaKey)&&!(t.deltaMode!==0||l)?a="pinch":t.ctrlKey||t.metaKey?a="notch":s&&e.kind!=="pinch"?a=e.kind:t.deltaMode!==0||l?a="notch":a="pan",e.kind=a,e.at=i,a==="pan"?{kind:"pan",dx:o,dy:r}:a==="pinch"?{kind:"zoom",factor:ic(Math.exp(-r*Kf),.8,1.25),eased:!1}:{kind:"zoom",factor:ic(Math.exp(-r*zf),.5,2),eased:!0}}function ic(t,e,i){return Math.min(i,Math.max(e,t))}var bt=new WeakMap;function Wt(t){let e=bt.get(t);e&&(e.raf&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.raf),bt.delete(t))}function Gi(t,e,i){let{min:n,max:o}=t.bounds(),r=t.stage.scaleX(),s=bt.get(t.stage),a=s?.raf?s.target:r,l=Math.min(o,Math.max(n,a*e));if(t.reducedMotion()||typeof requestAnimationFrame!="function"){Wt(t.stage),t.apply(l,i);return}if(s?.raf){s.target=l,s.point=i;return}if(Math.abs(Math.log(l/r))<.002)return;let c={target:l,point:i,raf:0,last:performance.now()};bt.set(t.stage,c);let d=u=>{let h=bt.get(t.stage);if(h!==c)return;let p=Math.max(0,u-h.last);h.last=u;let m=t.stage.scaleX(),b=Math.log(h.target/m),f=1-Math.exp(-p/55),g=Math.abs(b*(1-f))<.002,y=g?h.target:m*Math.exp(b*f);t.apply(y,h.point);let S=Math.abs(y-m)>1e-9&&t.stage.scaleX()===m;if(g||S){bt.delete(t.stage);return}h.raf=requestAnimationFrame(d)};c.raf=requestAnimationFrame(d)}function Wi(t){return t?.getAttr?.("seatId")??void 0}var Vi=.85,Uf=.38,$f=Object.freeze([3,3]);function qf(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function rc(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function Zf(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(Vt(t)||(t.clusterLabels.setPressLandsOnChart(!rc(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}var Qf=Object.freeze([2,2]);function jf(t){let e=null,i=0,n=!1,o=null,r=()=>{o&&(o=null,t.hoverRing.visible(!1),t.overlayLayer.batchDraw())},s=()=>{if(i=0,!e||n||t.destroyed?.())return;if(!t.manageSeatHits()||t.cached()){r();return}let a=t.nearestSeatToScreen(e,ue),l=a?t.seat(a):void 0;if(!a||!l){r();return}a!==o&&(o=a,t.hoverRing.position(l),t.hoverRing.opacity(Vi),t.hoverRing.dash(Qf),t.hoverRing.visible(!0),t.overlayLayer.batchDraw())};return{move(a){e=a,i||(i=requestAnimationFrame(s))},hide(){e=null,r()},onSeat(a){n=a,a&&(o=null)}}}var Vt=t=>t.seatsPickable()||t.manageSeatHits();function sc(t){t.attachHoverCard();let e=Zf(t),i=jf(t);t.seatLayer.on("click tap",o=>{if(t.moved()>we||t.isGhostClick(o))return;let r=Wi(o.target);r&&Vt(t)&&t.handleSeatTap(r)}),t.seatLayer.on("mouseover",o=>{let r=Wi(o.target);if(!r)return;let s=t.seat(r);if(!s)return;i.onSeat(!0),t.setHoveredId(r);let a=Jf(t,r);t.hoverRing.position(s),t.hoverRing.opacity(a==="muted"?Uf:Vi),t.hoverRing.dash(a==="muted"?$f:Ni),t.hoverRing.visible(a!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(a==="full"),t.onHover?.(s,{mark:t.seatMark(r),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{i.onSeat(!1),t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let o=t.stage.getPointerPosition();o&&(e(o),i.move(o))}),t.stage.on("mouseleave",()=>i.hide());let n=nc();t.stage.on("wheel",o=>{o.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let r=t.container.getBoundingClientRect(),s={x:o.evt.clientX-r.left,y:o.evt.clientY-r.top},a=oc(o.evt,n,performance.now(),t.stage.height());a.kind==="pan"&&t.panBy?t.panBy(a.dx,a.dy):a.kind==="zoom"&&a.eased&&t.zoomBounds?Gi({stage:t.stage,reducedMotion:t.reducedMotion,bounds:t.zoomBounds,apply:(l,c)=>t.zoomAbout(l,c,"frame")},a.factor,s):a.kind==="zoom"&&t.zoomAbout(t.stage.scaleX()*a.factor,s,"frame"),e(s)}),t.stage.on("click tap",o=>{if(t.moved()>we||t.isGhostClick(o))return;let r=t.stage.getPointerPosition();if(!r)return;if(t.sectionCount()){let a=t.ownedBadgeAt(t.screenToWorld(r));if(a&&t.focusOwnedSeats(a))return}if(!(Wi(o.target)&&Vt(t))){let a=Hi(t.selectionMarkers(),r);if(a){t.focusSeats([a],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(r))return;if(t.rowLabelAt&&t.selectRow){let a=t.rowLabelAt(r);if(a){t.selectRow(a);return}}if(!t.cached()){if(Wi(o.target)&&Vt(t))return;if(Vt(t)){let a=t.focusedSectionId(),l=t.manageSeatHits(),c=t.nearestSeatToScreen(r,ue),d=c?t.seatSection(c):null;if(c&&(!a||l||d&&t.sectionMatchesFocus(d))){t.handleSeatTap(c);return}let u=c?null:t.nearestSeatToScreen(r,ue,!0),h=u?t.seatSection(u):null;if(u&&(!a||l||h&&t.sectionMatchesFocus(h))){t.handleSeatTap(u);return}if(a&&t.onBackdropTap&&!t.floorOverview()){let m=t.sectionAt(r);if(m&&t.sectionInteractive?.(m)===!1)return;if(m&&m!==a){let b=t.sectionTapAnchor(m,t.screenToWorld(r));t.onSectionTap?t.onSectionTap(m,b):t.focusSection(m,{anchor:b})}else m||t.onBackdropTap();return}if(a||l)return;let p=t.sectionCount()?qf(t,r):null;if(!p||t.effScale()>=ie||t.sectionFrameScale(p)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let a=t.floorOverview()?t.sectionAt(r):null,l=(a?t.objectFloor(a):null)??t.deckFloorAt();if(l){t.onDeckTap(l);return}}if(t.sectionCount()){let a=t.screenToWorld(r),l=t.ownedBadgeAt(a);if(l&&t.focusOwnedSeats(l)||!l&&rc(t,r))return;let c=l??t.sectionAt(r);if(c){let d=t.sectionTapAnchor(c,a);t.onSectionTap?t.onSectionTap(c,d):t.focusSection(c,{anchor:d});return}if(!t.pressLandsOnChart(r))return}if(!t.seatsPickable()){let a=t.tableAt?.(r);if(a?.length&&t.focusSeats(a,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(r)||t.clusterLabels.glideTowardTap(r))return;let s=Math.max(Se*1.2,t.stage.scaleX()*2.5);t.zoomAbout(s,r)})}function ac(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let n=t.objectFloor(t.seat(e)?.rowId??"");if(n){t.onDeckTap(n);return}}if(t.effScale()<ie&&t.sectionCount()&&!t.manageSeatHits()){let n=t.seatSection(e);if(n){let o=t.focusedSectionId()===n.logicalId,r=t.sectionFrameScale(n.logicalId)>t.stage.scaleX()*1.02;if(!o&&r){let s=t.seat(e),a=s?{x:s.x,y:s.y}:void 0;t.onSectionTap?t.onSectionTap(n.logicalId,a):t.focusSection(n.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let n=t.seat(e)??null,o=t.hiddenByAccessFilter(e);n&&(o||t.hasSeatMark(e))&&(t.onHover?.(n,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...o?{filteredOut:!0}:{}}),t.nudgeSeat(e));return}t.hasSeatMark(e)&&t.onHover?.(t.seat(e)??null,{mark:t.seatMark(e),interaction:"press"}),t.toggleSeat(e)}function Jf(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function lc(t,e){return!e.manageMode||!e.marqueeSelect?!1:t.pointerType!=="touch"&&t.button===0}var cc=450;function dc(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<ae}import{Path as bg}from"konva/lib/shapes/Path";import{Group as em}from"konva/lib/Group";import{Line as tm}from"konva/lib/shapes/Line";import{Text as im}from"konva/lib/shapes/Text";function hc(t,e,i,n){if(!e||!n)return;let o=lr(e,i);if(!o.length)return;let r=new em({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new tm({points:s.points.flatMap(a=>[a.x,a.y]),closed:!0,stroke:s.stroke?.color??"#8a93a6",strokeWidth:1.5,strokeScaleEnabled:!1,opacity:s.opacity??.35,listening:!1,perfectDrawEnabled:!1}));else if(s.type==="text"){let a=new im({x:s.position.x,y:s.position.y,text:s.text,fontSize:s.fontSize,fontFamily:"Inter, system-ui, sans-serif",fontStyle:"600",fill:s.color??"#8a93a6",opacity:s.opacity??.6,listening:!1});a.offset({x:a.width()/2,y:a.height()/2}),r.add(a)}t.add(r),r.moveToBottom()}var nm=10;function om(t){let e=t.framingViewport();if(t.stage.width()>=U||t.exportMode())return e;let i=nm;return{...e,x:e.x+i,y:e.y+i,width:Math.max(1,e.width-i*2),height:Math.max(1,e.height-i*2)}}function uc(t){Wt(t.stage);let e=om(t),i=t.revealWorldRect?.()??null,n=e.width,o=e.height,r=t.bounds();if(t.setFitScale(Math.min(n/r.width,o/r.height)||1),t.portraitFitCrop()&&!t.exportMode()){let l=n/r.width<=o/r.height,c=r.height*t.fitScale();l&&c<.55*o&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*o/r.height))}let s=sm(t);s&&t.setFitScale(rm);let a=t.fitScale();if(t.stage.scale({x:a,y:a}),t.stage.position({x:e.x+(n-r.width*a)/2-r.x*a,y:e.y+(o-r.height*a)/2-r.y*a}),t.settleView(),!t.exportMode()){let l=xa(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<ae?ae*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);l>0&&l!==1&&t.setFitScale(t.fitScale()*l),l>0&&(t.afterViewChange(),Zn(t.stage,[t.bgLayer,t.seatLayer],e,i)),am(t,e),t.setFitPose(qe(t.stage))}t.stage.batchDraw()}var rm=Q*(1-1e-6);function sm(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Q&&e<Se}function am(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=Ot(t.stage,[t.bgLayer,t.seatLayer],n);if(!o)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&o.x+o.width<=e.x+e.width-r)return;let s=e.height-i;if(o.height<=s){Zn(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+Ii-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function zt(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,Ke*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function pc(t,e,i,n="now"){let o=t.stage.position();fl(t.stage,e,i,zt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.gestureFrame?.(),t.updateSeatGroupVisibility(),mc(t)):t.afterViewChange(),t.stage.batchDraw())}function fc(t,e,i){let n=t.stage.position();t.stage.position(t.constrainPan({x:n.x-e,y:n.y-i},n)),t.gestureFrame?.(),t.updateSeatGroupVisibility(),mc(t),t.stage.batchDraw()}function mc(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function gc(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function lm(t,e,i,n,o=0){ml(t.stage,e,zt(t),i,Kt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function bc(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){lm(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Kt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=zt(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=q(Math.max(d,u),a,Math.max(u,Gt({min:a,max:l},i?.maxScale))),p=o.x+r/2-(n.x+n.width/2)*h,m=o.y+s/2-(n.y+n.height/2)*h,b=t.stage.scaleX(),f=t.stage.x(),g=t.stage.y();if(Math.abs(h-b)<1e-4&&Math.abs(p-f)<.5&&Math.abs(m-g)<.5){t.settleView();return}let y=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let k=w=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(w-y)/S),x=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,T=b+(h-b)*x;t.stage.setAttrs({scaleX:T,scaleY:T,x:f+(p-f)*x,y:g+(m-g)*x}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(k)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(k))}function Kt(t,e){let i=Math.max(0,Math.min(e,t.width/3,t.height/3));return i===0?t:{x:t.x+i,y:t.y+i,width:t.width-i*2,height:t.height-i*2}}import{Text as cm}from"konva/lib/shapes/Text";function yc(t){let e=new WeakMap;return()=>{let i=t(),n=i.labelFont(),o=Ze(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===n&&r.generation===o)return r.value;let s=dm(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function dm(t){let e=1/0,i=new cm({fontSize:me,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),n=t.seatR*2-3,o=new Map;for(let s of t.seats){if(s.kind==="booth"){let u=t.blockExtent?.(s);e=Math.min(e,u?ge({...u,text:s.displayLabel??s.label}):Ge);continue}let a=me*t.seatLabelScale(s),l=ri(s.displayLabel??s.label),c=o.get(a);c||o.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>n?Math.max(st,a*n/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=st)break}i.destroy();let r=Number.isFinite(e)?e:Ge;return G/Math.max(st,r)}function vc(t,e,i,n,o,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:Sc(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:Sc(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function Sc(t,e,i,n,o,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(r))return t;let l=n*e,c=Math.min(l,r*(1-s)),d=o+c-(i+n)*e,u=o+r-c-i*e;if(!(d<=u))return t;if(Number.isFinite(a)){let h=a;return Math.min(Math.max(t,Math.min(d,h)),Math.max(u,h))}return Math.min(Math.max(t,d),u)}var mo={top:0,right:0,bottom:0,left:0};function wc(t){let e=i=>typeof i=="number"&&Number.isFinite(i)&&i>0?i:0;return t?{top:e(t.top),right:e(t.right),bottom:e(t.bottom),left:e(t.left)}:{...mo}}var hm=.7;function kc(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,p,m)=>{let b=h+p,f=m*hm;if(b<=f||b<=0)return[h,p];let g=f/b;return[h*g,p*g]},[l,c]=a(s,o,t),[d,u]=a(n,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-u)}}function xc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function Lc(t,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(t.scale({x:e.scale,y:e.scale}),t.position({x:e.x,y:e.y}),!0)}function zi(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Cc(t,e){let i=e({x:t.x,y:t.y}),n=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,n.x),y:Math.min(i.y,n.y),width:Math.abs(n.x-i.x),height:Math.abs(n.y-i.y)}}function go(t,e,i,n,o,r,s){if(!e)return{box:{x:i,y:n,width:0,height:0},fitWidth:0,fitHeight:0,x:i,y:n,baseFontSize:o,insideInk:r,fill:s};let a=((t??0)%180+180)%180,l=a*Math.PI/180,c=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=e.x+e.width/2,h=e.y+e.height/2,p=e.width*c+e.height*d,m=e.width*d+e.height*c,b={x:u-p/2,y:h-m/2,width:p,height:m},f=a===0?[e.width,e.height]:a===90?[e.height,e.width]:[Math.min(e.width,e.height),Math.min(e.width,e.height)];return{box:b,fitWidth:f[0],fitHeight:f[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var Tc=G,um=3,pm=.5;function fm(t){return X(t,O(t)?"#475569":"#cbd5e1")}function Ic(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function mm(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=Tc){let u=t.measure(n.baseFontSize);return i.occupied.insert(Ic(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=Tc/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*pm)return{visible:!1,reason:"shape-too-small"};let a=um/o,l=s.width+a*2<=n.fitWidth&&s.height+a*2<=n.fitHeight,c=n.box.x+n.box.width/2,d=l?[{where:"inside",x:n.x,y:n.y}]:[{where:"below",x:c,y:n.box.y+n.box.height+a+s.height/2},{where:"above",x:c,y:n.box.y-a-s.height/2}];for(let u of d){let h=Ic(u.x,u.y,s);if(!(i.coversSeat(h)||i.occupied.collisionCount(h)>0))return i.occupied.insert(h),{visible:!0,where:u.where,fontSize:r,x:u.x,y:u.y}}return{visible:!1,reason:"no-clear-place"}}function Pc(t){let e=[],i=new fe,n=a=>{if(!a.isVisible())return;let l=a.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});i.insert(l)};for(let a of t.freeTextById.values())a.area?e.push({record:a,spec:a.area}):n(a.node);if(!e.length)return;for(let a of t.focalLabels)n(a);let o=t.seatIndex,r={coversSeat:a=>!!o&&rt(o,a,{mode:"overlap"}).length>0,occupied:i},s=fm(t.canvasBackground);e.sort((a,l)=>l.spec.box.width*l.spec.box.height-a.spec.box.width*a.spec.box.height);for(let{record:a,spec:l}of e){let{node:c}=a,d=mm({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);gm(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function gm(t,e,i,n){if(!i.visible){t.fontSize(e.baseFontSize),t.visible(!1);return}t.fontSize(i.fontSize),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.position({x:i.x,y:i.y}),t.fill(i.where==="inside"?e.insideInk:n),t.visible(!0)}function Rc(t){let e=[];for(let i of t)i.type==="table"&&e.push({id:i.id,centre:{x:i.center.x,y:i.center.y},radius:i.shape==="round"?i.radius??40:Math.max(Math.abs(i.width??80),Math.abs(i.height??50))/2});return e}function bo(t,e,i,n){let o=bm(t,i,n);if(!o)return null;let r=e.filter(s=>s.rowId===o.id).map(s=>s.id);return r.length?r:null}function bm(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,li/2/n),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!o||a<o.distance)&&(o={table:r,distance:a})}return o?.table??null}function Ec(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?is:ts}function Ac(t){return Math.max(t*1.05,$r,Q*1.3)}var ym=42;function Fc(t){return ym/(2*Math.max(t,1e-4))}function je(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t)i=Math.min(i,s.x),n=Math.max(n,s.x),o=Math.min(o,s.y),r=Math.max(r,s.y);return i-=e,n+=e,o-=e,r+=e,{x:i,y:o,width:Math.max(40,n-i),height:Math.max(40,r-o)}}function _c(t){let{stageWidth:e,stageHeight:i,fullBounds:n,visibleBounds:o,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(n.width*a),i/(n.height*a))>=s)return null;let c=t.tapAnchor??{x:o.x+o.width/2,y:o.y+o.height/2},d=r[0],u=1/0;for(let b of r){let f=(b.x-c.x)**2+(b.y-c.y)**2;f<u&&(d=b,u=f)}let h=e/(s*a),p=i/(s*a),m=je(r,0);return{bounds:{x:Mc(d.x,h,m.x,m.width),y:Mc(d.y,p,m.y,m.height),width:h,height:p},minScale:s}}function Mc(t,e,i,n){return n<=e?i+n/2-e/2:Math.min(Math.max(t-e/2,i),i+n-e)}import{Shape as vm}from"konva/lib/Shape";var Bc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},Sm=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function Oc(t,e){let i=new Map;for(let o of t){if(o.kind==="booth")continue;let r=e.get(o.rowId),s=Bc(o);if(!(r&&r>0)||s==null)continue;let a=Sm(o),l=i.get(a)??[];l.push({seat:o,index:s}),i.set(a,l)}let n=[];for(let o of i.values()){o.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(n.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of o){let l=r[r.length-1];if(l){let c=Bc(l),d=Math.hypot(a.seat.x-l.x,a.seat.y-l.y),u=e.get(a.seat.rowId),h=Math.max(1e-6,u*1e-6);(c==null||a.index!==c+1||d<=h||d>u*1.5)&&s()}r.push(a.seat)}s()}return n}var Xt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15;this.paints=new Map}get active(){return this.entries.length>0}paint(e,i){let n=`${e}|${i}`,o=this.paints.get(n);return o===void 0&&(this.paints.size>512&&this.paints.clear(),o=D(e,i),this.paints.set(n,o)),o}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,n,o,r,s,a,l,c=()=>1,d=()=>!1,u=()=>1/0){if(!l||!e||!n){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let m of[...e.objects,...(e.floors??[]).flatMap(b=>b.objects)])m.type==="row"&&this.spacing.set(m.id,m.seatSpacing)}if(this.focusKey!==n&&(this.focusKey=n,this.detailScale=Math.min(Math.max(1.15,c()*1.15),u()*.9)),o>=this.detailScale){this.clear();return}let h=i.filter(m=>m.id===n||m.logicalId===n||d(m)),p=h.map(m=>m.id).join("|");if(!(this.key===p&&this.active)){this.clear(),this.key=p;for(let m of h){if(m.memberIds.length>2e3||m.memberIds.some(g=>!a.has(g)||!this.spacing.has(s.get(g)?.rowId??"")))continue;let b=Oc(m.memberIds.map(g=>s.get(g)).filter(Boolean),this.spacing);if(!b.length||b.reduce((g,y)=>g+y.seats.length,0)!==m.memberIds.length)continue;let f=new vm({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:g=>{let y=g._context,S=f.getStage(),k=S&&S.width()<=U?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;y.save(),y.lineWidth=k*2,y.lineCap="round",y.lineJoin="round";let w=v=>{let x=a.get(v.id);return this.paint(String(x.fill()),x.opacity())};for(let v of b){let x=v.points;if(x.length===1){y.fillStyle=w(v.seats[0]),y.beginPath(),y.arc(x[0].x,x[0].y,k,0,Math.PI*2),y.fill();continue}let T=v.seats.map(w),P=(R,M)=>{let A=Math.hypot(M.x-R.x,M.y-R.y);return{x:-(M.y-R.y)/A,y:(M.x-R.x)/A}},L=x.map((R,M)=>{let A=x[Math.max(0,M-1)],E=x[Math.min(x.length-1,M+1)];return Math.hypot(E.x-A.x,E.y-A.y)>.001?P(A,E):P(x[M],x[M+1]??x[M-1])}),C=(R,M,A)=>({x:R.x+M.x*k*A,y:R.y+M.y*k*A}),I=0;for(;I<x.length;){let R=I;for(;R+1<x.length&&T[R+1]===T[I];)R++;let M=I===0?x[0]:{x:(x[I-1].x+x[I].x)/2,y:(x[I-1].y+x[I].y)/2},A=R===x.length-1?x[R]:{x:(x[R].x+x[R+1].x)/2,y:(x[R].y+x[R+1].y)/2},E=I===0?L[0]:P(x[I-1],x[I]),W=R===x.length-1?L[R]:P(x[R],x[R+1]),N=[M,...x.slice(I,R+1),A],Y=[E,...L.slice(I,R+1),W],re=N.map((_,V)=>C(_,Y[V],1)),H=N.map((_,V)=>C(_,Y[V],-1));y.fillStyle=T[I],y.beginPath(),y.moveTo(re[0].x,re[0].y);for(let _ of re.slice(1))y.lineTo(_.x,_.y);if(R===x.length-1){let _=Math.atan2(W.y,W.x);y.arc(A.x,A.y,k,_,_-Math.PI,!0)}else y.lineTo(H[H.length-1].x,H[H.length-1].y);for(let _ of H.slice(0,-1).reverse())y.lineTo(_.x,_.y);if(I===0){let _=Math.atan2(-E.y,-E.x);y.arc(M.x,M.y,k,_,_-Math.PI,!0)}y.closePath(),y.fill(),I=R+1}}y.restore()}});this.entries.push({section:m,shape:f,opacity:m.liftGroupSeat.opacity(),listening:m.liftGroupSeat.listening()}),m.liftGroupBg.add(f),m.liftGroupSeat.opacity(0),m.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as wm}from"konva/lib/shapes/Text";var Dc=new WeakMap,km=(t,e)=>{let i=new wm({text:t,fontSize:Et,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function Nc(t,e,i,n=km){let o=Dc.get(t);o||Dc.set(t,o=new Map);let r=`${e}\0${Ze()}`,s=o.get(r);s||o.set(r,s=new Map);let a=s.get(i);if(a!==void 0)return a;let l=0;for(let d of t){if(!d.focusKeys?.includes(i))continue;let u=n(d.text,e);l=Math.max(l,u.width,u.height)}let c=l>0?Math.ceil(l+G+ee*2+6):0;return s.set(i,c),c}function Hc(t){let e=t.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(t.offsetX(e.x+e.width/2),t.offsetY(e.y+e.height/2))}var yo=1e6;function xm(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function So(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Ki=class{constructor(e,i=xm()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.holdTimer=null;this.lastTapAt=0;this.rect=null;this.onLayoutChanged=()=>{this.rect=null};this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||(this.rect=null,this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button,e.shiftKey,e.altKey))};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let i=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,i)&&this.applyPointerMove(i)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId,e.type==="pointercancel")};this.onReleaseElsewhere=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId)||e.composedPath().includes(this.host.container))return;let i=e.type==="pointercancel";!i&&this.host.marqueeActive()&&this.host.updateMarquee(this.toLocal(e.clientX,e.clientY)),this.endPointer(e.pointerId,i)};this.onWindowBlur=()=>{this.abandonGesture()};this.onEscape=e=>{e.key!=="Escape"||this.pointers.size===0||!this.host.marqueeActive()||(e.preventDefault(),e.stopPropagation(),this.abandonGesture())};this.onTouchStart=e=>{if(!So(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.beginPointer(yo+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(So(e))return;e.preventDefault();let i=null;for(let n=0;n<e.changedTouches.length;n+=1){let o=e.changedTouches.item(n);if(!o)continue;let r=this.toLocal(o.clientX,o.clientY);this.updatePointer(yo+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!So(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(yo+n.identifier,e.type==="touchcancel")}}};this.host=e,this.useWebKitTouchEvents=i}get moved(){return this.movedPx}attach(){let{container:e}=this.host;this.rect=null,typeof window<"u"&&(window.addEventListener("scroll",this.onLayoutChanged,{capture:!0,passive:!0}),window.addEventListener("resize",this.onLayoutChanged,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onLayoutChanged),window.visualViewport?.addEventListener("scroll",this.onLayoutChanged),window.addEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("blur",this.onWindowBlur),window.addEventListener("keydown",this.onEscape,{capture:!0})),e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){this.clearHold();let{container:e}=this.host;typeof window<"u"&&(window.removeEventListener("scroll",this.onLayoutChanged,{capture:!0}),window.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("scroll",this.onLayoutChanged),window.removeEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("blur",this.onWindowBlur),window.removeEventListener("keydown",this.onEscape,{capture:!0})),e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<qr}invalidateRect(){this.rect=null}toLocal(e,i){let n=this.rect;if(!n){let o=this.host.container.getBoundingClientRect();n={left:o.left,top:o.top},this.rect=n}return{x:e-n.left,y:i-n.top}}beginPointer(e,i,n,o,r=!1,s=!1){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=n==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:n,button:o,local:i,shiftKey:r,altKey:s})?(this.host.beginMarquee(i,s),this.panLast=null):(this.panLast=i,n==="touch"&&this.host.marqueeShouldStart({pointerType:"touch-hold",button:o,local:i,shiftKey:r,altKey:s})&&(this.holdTimer=setTimeout(()=>{this.holdTimer=null,!(this.pointers.size!==1||this.panStarted||this.movedPx>we)&&(this.endTouchProbe(),this.panLast=null,this.host.beginMarquee(i,!1))},cc)));else if(this.pointers.size===2){this.clearHold(),this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[a,l]=[...this.pointers.values()],c={x:(a.x+l.x)/2,y:(a.y+l.y)/2},d=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(l.x-a.x,l.y-a.y),startScale:d,worldMid:{x:(c.x-this.host.stage.x())/d,y:(c.y-this.host.stage.y())/d}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+1}}updatePointer(e,i){return this.pointers.has(e)?(this.pointers.set(e,i),this.pointers.size===1&&this.panStart?(this.movedPx=Math.max(this.movedPx,Math.hypot(i.x-this.panStart.x,i.y-this.panStart.y)),this.movedPx>we&&this.clearHold()):this.pointers.size>=2&&(this.movedPx=we+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>we?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[i,n]=[...this.pointers.values()],o=Math.hypot(n.x-i.x,n.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+n.x)/2,y:(i.y+n.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=q(this.pinch.startScale*(o/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}let i={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.position(this.host.constrainPan({x:i.x+(e.x-this.panLast.x),y:i.y+(e.y-this.panLast.y)},i)),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}abandonGesture(){if(this.pointers.size===0)return;let e=this.host.marqueeActive();e&&this.host.cancelMarquee(),this.pointers.clear(),this.pinch=null,this.resetPan(),this.endTouchProbe(),e||this.host.afterViewChange()}clearHold(){this.holdTimer&&clearTimeout(this.holdTimer),this.holdTimer=null}endPointer(e,i=!1){if(this.pointers.has(e)){if(this.clearHold(),this.host.marqueeActive()){this.endTouchProbe(),i?this.host.cancelMarquee():this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as Lm}from"konva/lib/shapes/Circle";import{Group as Cm}from"konva/lib/Group";import{Line as Tm}from"konva/lib/shapes/Line";import{Text as Im}from"konva/lib/shapes/Text";var Pm=11,Rm=.3,Mm=.08;function zc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function Em(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?F("map.soldOut"):t.wheelchairFree!=null?t.wheelchairFree<=0?F("map.noWheelchairSpace"):F("map.seatsLeft",{count:t.wheelchairFree}):F("map.seatsLeft",{count:t.available})}function Kc(t,e){return e&&t.available!=null&&t.available<=0}function Am(t,e){return Kc(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function Xc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=Am(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?Ve*Mm:o?Ve*Rm:Ve),e.polygon.listening(!t.exportMode&&!n&&!i&&!Kc(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),Fm(t,e,o,r,n,t.dimmed(e.categoryKey))}}function Fm(t,e,i,n,o,r){if(e.capacityNode){let s=Em(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}_m(t,e,o||r),n>0&&!o?Hm(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var vo=9,Gc=.86;function _m(t,e,i){Bm(t,e,i),wo(e)}function wo(t){let e=t.wheelchairGlyph,i=t.capacityNode;if(!e)return;if(!i||!i.visible()||!i.text()){e.visible(!1);return}let n=i.fontSize(),o=n/ye;e.scale({x:o,y:o}),e.offset({x:ye/2,y:ye/2}),e.position({x:i.x()-i.width()/2-n*.7,y:i.y()-i.offsetY()+i.height()/2}),e.visible(!0)}function Bm(t,e,i){let{labelNode:n,capacityNode:o}=e;if(!n&&!o)return;let r=Math.max(t.effScale(),1e-4);if(i){n?.visible(!1),o?.visible(!1);return}if(!t.pickerMode){n?.visible(t.labelLegible(n.fontSize())),o?.visible(t.labelLegible(o.fontSize()));return}let s=Om(e,r),a=Wc(n,e.nameSize??ni,s.width*Gc,r),l=Wc(o,oi,s.width*Gc,r),c=a!=null,d=l!=null&&(n?c&&a+l+vo<=s.height:l<=s.height);Vc(n,c?a:null,e.labelPoint.y-vo/r,r),Vc(o,d?l:null,n?e.labelPoint.y+vo/r:e.labelPoint.y,r)}function Om(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>n&&(n=s.x),s.y<o&&(o=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(n-i)*e,height:(r-o)*e}:{width:0,height:0}}function Wc(t,e,i,n){if(!t||!t.text())return null;t.fontSize(e/n);let o=t.width()*n;if(o<=i||o<=0)return e;let r=e*(i/o);return r>=G?r:null}function Vc(t,e,i,n){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/n),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}var Dm=.72;function Nm(t,e,i){let n=-1/0,o=1/0;for(let s of t)s.x>n&&(n=s.x),s.y<o&&(o=s.y);if(!Number.isFinite(n)||!Number.isFinite(o))return e;let r=i*Dm;return{x:n+r,y:o-r}}function Hm(t,e,i,n){let o=Pm;if(!e.chip){let a=new Cm({listening:!1});a.add(new Lm({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new Tm({name:"ga-chip-tick",x:-o*.62,points:[-o*.22,0,-o*.02,o*.2,o*.34,-o*.26],strokeWidth:Math.max(.6,o*.16),lineCap:"round",lineJoin:"round",listening:!1}));let l=new Im({x:o*.12,y:-o*.5,text:String(i),fontSize:o,fontStyle:"800",fontFamily:t.labelFont(),listening:!1,perfectDrawEnabled:!1});a.add(l),t.bgLayer.add(a),e.chip=a,e.chipText=l}let r=Dt(t.selectionColor),s=e.chip.findOne(".ga-chip-disc");s?.fill(t.selectionColor),s?.stroke(D(r,.35)),e.chip.findOne(".ga-chip-tick")?.stroke(r),e.chipText&&(e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText.fill(r)),e.chip.position(Nm(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function Yc(t,e){let i=!1;for(let[n,o]of Object.entries(e)){let r=t.get(n);r&&(o.available!==void 0&&r.available!==o.available&&(r.available=o.available,i=!0),o.wheelchairFree!==void 0&&(r.wheelchairFree??null)!==o.wheelchairFree&&(r.wheelchairFree=o.wheelchairFree,i=!0),o.selected!==void 0&&r.selected!==o.selected&&(r.selected=o.selected,i=!0))}return i}function Uc(t){let{width:e,height:i}=t;return!(e>0)||!(i>0)?"hidden":e===t.stageWidth&&i===t.stageHeight?"unchanged":{width:e,height:i}}function Gm(t){let{sections:e,viewCentre:i,focusedSectionId:n}=t;if(n){let s=e.findIndex(a=>a.id===n||a.logicalId===n);if(s>=0)return s}let o=-1,r=1/0;return e.forEach((s,a)=>{if(s.outline.length<3)return;let l=z(s.outline),c=i.x>=l.x&&i.x<=l.x+l.width&&i.y>=l.y&&i.y<=l.y+l.height,d=l.x+l.width/2-i.x,u=l.y+l.height/2-i.y,h=(c?0:1e12)+d*d+u*u;h<r&&(o=a,r=h)}),o}function Wm(t){let{rung:e,viewCentre:i,target:n,width:o,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(p=>{let m=z(p.outline);return{x:m.x+m.width/2,y:m.y+m.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(p=>Math.abs(p.x-i.x)<=d&&Math.abs(p.y-i.y)<=u)){let p=c.reduce((m,b)=>{let f=(b.x-i.x)**2+(b.y-i.y)**2;return f<m.distance?{point:b,distance:f}:m},{point:c[0],distance:1/0});s=p.point.x,a=p.point.y}}let l=e==="seats"?t.seats.filter(c=>c.kind!=="booth"):[];if(l.length>0){let c=l[0],d=1/0;for(let u of l){let h=u.x-i.x,p=u.y-i.y,m=h*h+p*p;m<d&&(c=u,d=m)}s=c.x,a=c.y}return{x:s,y:a}}function $c(t){if(t.rung==="sections")return{bounds:t.bounds};let e=Gm(t);if(e>=0)return{bounds:z(t.sections[e].outline),minScale:t.seatFloor};let i=t.seatScale,{x:n,y:o}=Wm({...t,rung:"seats",target:i}),r=t.width/(i*1.12),s=t.height/(i*1.12);return{bounds:{x:n-r/2,y:o-s/2,width:r,height:s}}}var qc=["pointerdown","pointermove","mousedown","mousemove","touchstart","click"],Xi=class{constructor(e=()=>{}){this.onEnd=e;this.until=0;this.timer=null;this.holding=!1;this.stale=new Set;this.flushNow=()=>this.flush();this.container=null}get active(){return this.holding}listen(e){this.container=e;for(let i of qc)e.addEventListener(i,this.flushNow,{capture:!0,passive:!0})}wrap(e){let i=e.drawHit;e.drawHit=((n,o)=>this.active&&!n?(this.stale.add(e),e):i.call(e,n,o))}bump(){typeof setTimeout=="function"&&(this.holding=!0,this.until=performance.now()+120,this.timer||this.arm(120))}arm(e){this.timer=setTimeout(()=>{this.timer=null;let i=this.until-performance.now();if(i>1){this.arm(i);return}this.flush()},e)}flush(){let e=this.holding;if(this.holding=!1,this.timer&&(clearTimeout(this.timer),this.timer=null),this.stale.size){let i=[...this.stale];this.stale.clear();for(let n of i)n.getStage()&&n.drawHit()}e&&this.onEnd()}destroy(){if(this.timer&&clearTimeout(this.timer),this.timer=null,this.holding=!1,this.stale.clear(),this.container)for(let e of qc)this.container.removeEventListener(e,this.flushNow,{capture:!0});this.container=null}};var Yi=class{constructor(){this.since=new Map;this.shown=new Set;this.wanted=new Set}begin(){this.wanted=new Set}admit(e,i,n){this.wanted.add(e);let o=this.since.get(e);return o===void 0&&(o=i,this.since.set(e,i)),!n||this.shown.has(e)||i-o>=150?(this.shown.add(e),!0):!1}end(){for(let e of[...this.since.keys()])this.wanted.has(e)||(this.since.delete(e),this.shown.delete(e))}reset(){this.since.clear(),this.shown.clear(),this.wanted.clear()}};function Zc(t,e,i,n){if(t.length<3)return[];let o=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<o&&(o=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-o)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e)d.x<o||d.x>r||d.y<s||d.y>a||jt(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function Vm(t){return t.logicalRowId??t.rowId}function Qc(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(Vm(o)!==t||!i(o.id)||n.push(o.id));return n}function jc(t,e,i=4){for(let n of e){let{box:o}=n;if(t.x>=o.x-i&&t.x<=o.x+o.width+i&&t.y>=o.y-i&&t.y<=o.y+o.height+i)return n.rowKey}return null}import{Line as zm}from"konva/lib/shapes/Line";import{Rect as Km}from"konva/lib/shapes/Rect";var Ui=class{constructor(e){this.host=e;this.box=null;this.lasso=null;this.remove=!1}active(){return this.box!==null||this.lasso!==null}begin(e,i,n=!1){this.cancel(),this.remove=n;let o=this.host.screenToWorld(e),r=this.host.stageScale()||1,s={stroke:n?"#d64545":this.host.selectionColor(),strokeWidth:1.5/r,dash:[5/r,4/r],fill:n?"rgba(214,69,69,0.10)":"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let a=new zm({...s,points:[o.x,o.y],closed:!0,lineJoin:"round"});this.host.overlayLayer().add(a),this.lasso={points:[o],line:a}}else{let a=new Km({...s,x:o.x,y:o.y,width:0,height:0});this.host.overlayLayer().add(a),this.box={start:o,cur:o,rect:a}}this.host.overlayLayer().batchDraw()}update(e){let i=this.host.screenToWorld(e);if(this.lasso){let r=this.lasso.points[this.lasso.points.length-1];if(Math.hypot(i.x-r.x,i.y-r.y)*(this.host.stageScale()||1)<2)return;this.lasso.points.push(i),this.lasso.line.points(this.lasso.points.flatMap(s=>[s.x,s.y])),this.host.overlayLayer().batchDraw();return}if(!this.box)return;let{start:n,rect:o}=this.box;o.setAttrs({x:Math.min(n.x,i.x),y:Math.min(n.y,i.y),width:Math.abs(i.x-n.x),height:Math.abs(i.y-n.y)}),this.box.cur=i,this.host.overlayLayer().batchDraw()}cancel(){!this.box&&!this.lasso||(this.lasso?.line.destroy(),this.box?.rect.destroy(),this.lasso=null,this.box=null,this.host.overlayLayer().batchDraw())}finish(){let e=this.host.stageScale()||1;if(this.lasso){let{points:l,line:c}=this.lasso;this.lasso=null,c.destroy(),this.host.overlayLayer().batchDraw();let d=l.map(h=>h.x),u=l.map(h=>h.y);if(l.length<3||(Math.max(...d)-Math.min(...d))*e<4&&(Math.max(...u)-Math.min(...u))*e<4)return;this.apply(Zc(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)}),h=>jt(h,l));return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let n=Math.min(i.start.x,i.cur.x),o=Math.max(i.start.x,i.cur.x),r=Math.min(i.start.y,i.cur.y),s=Math.max(i.start.y,i.cur.y);if((o-n)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats())l.x<n||l.x>o||l.y<r||l.y>s||this.host.isSelectable(l.id)&&a.push(l.id);this.apply(a,l=>l.x>=n&&l.x<=o&&l.y>=r&&l.y<=s)}apply(e,i){this.host.applyBand(e,i,this.remove),this.host.selectionChanged()}};var $i=class{constructor(e){this.sync=e;this.depth=0;this.pending=!1}request(){if(this.depth>0){this.pending=!0;return}this.sync()}batch(e){this.depth+=1;try{return e()}finally{this.depth-=1,this.depth===0&&this.pending&&(this.pending=!1,this.sync())}}};import{Rect as Jc}from"konva/lib/shapes/Rect";import{Text as Xm}from"konva/lib/shapes/Text";function ed(t){let e=t.effScale(),i=t.stage.scaleX(),n={width:t.stage.width(),height:t.stage.height()},o=f=>Math.round(f*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(f=>[String(f.getAttr("seatId")??""),String(f.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(f=>{let g=t.circleById.get(f.id),y=t.boothLabelById.get(f.id)??t.seatLabelById.get(f.id),S=f.kind==="booth"?Ge:me*t.seatLabelScale(f),k=o((y?.fontSize()??S)*e),w=t.worldToScreen(f),v=y?y.width()*i:0,x=y?y.height()*e:0,T=w.x-v/2<0||w.x+v/2>n.width||w.y-x/2<0||w.y+x/2>n.height,P=t.focusedSeatOpacity(f.id,g?.getAbsoluteOpacity()??0),L=t.seatSection.get(f.id),C=!!y?.isVisible()&&P>=.5&&!T,I;C||(P<.5?I="dimmed-or-unavailable":k<G?I="below-minimum-size":T?I="outside-viewport":y?I="renderer-hidden":I=t.seatLabelDrops.get(f.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=g instanceof Jc?g.width()*i:t.seatR*2*e,M=g instanceof Jc?g.height()*e:t.seatR*2*e,A=2*(t.seatR*e+ue),E=g?.fill(),W=y?.fill(),N=t.accessGlyphById.get(f.id),Y=N?.getAbsoluteScale();return{seatId:f.id,label:f.label,kind:f.kind==="booth"?"booth":"seat",markerShape:f.kind==="booth"?"booth":f.wheelchairSpaceType==="no-seat"?"square":"circle",...f.wheelchairSpaceType?{wheelchairSpaceType:f.wheelchairSpaceType}:{},categoryKey:f.categoryKey,...L?{sectionId:L.id}:{},...L?.zone?{zoneId:L.zone}:{},status:t.statusById.get(f.id)??"free",selected:t.selection.has(f.id),visible:C,renderedFontPx:k,fill:typeof E=="string"?E:"",ink:typeof W=="string"?W:g?t.seatLabelInk(f,g):t.seatPreferredLabelInk(f),...r.has(f.id)?{selectionRingColor:r.get(f.id)}:{},opacity:o(P),...N?{accessibilityMarker:{glyphVisible:N.isVisible(),glyphWidthPx:o(ye*Math.abs(Y?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(f.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(f.id)&&!!g?.isVisible()&&!!g?.isListening()&&t.isSelectable(f.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),A))},screenCenter:{x:o(w.x),y:o(w.y)},...C?{screenBox:{x:o(w.x-v/2),y:o(w.y-x/2),width:o(v),height:o(x)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(f=>f.visible).length,l=(f,g,y,S,k,w,v)=>{let x=ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),T=z(x.map(M=>t.worldToScreen(M))),P=o(S.opacity()),L=S.fill(),C=T.x+T.width<0||T.x>n.width||T.y+T.height<0||T.y>n.height,I=S.isVisible()&&P>.05&&!C,R=w?ut({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:f,kind:g,role:y,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:P,fill:k,ink:typeof L=="string"?L:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(T.x),y:o(T.y),width:o(T.width),height:o(T.height)}}:{}}},c=f=>{let g=f.namePlate.fill();if(f.namePlate.opacity()>.05&&typeof g=="string"&&g)return g;let y=f.blockPoly.fill();return typeof y=="string"?y:f.baseFill},d=f=>{let g=f.blockPoly.fill();return typeof g=="string"?g:f.baseFill},u=[...t.sections.map(f=>l(f.id,"section","name",f.nameLabel,c(f),f,Ft(n.width))),...t.sections.map(f=>l(`${f.id}:availability`,"section","availability",f.subLabel,c(f),f)),...t.sections.map(f=>l(`${f.id}:number`,"section","number",f.numberLabel,d(f),f,gi(n.width))),...t.zones.flatMap(f=>[l(f.id,"zone","name",f.label,f.background),...f.sub?[l(`${f.id}:price`,"zone","price",f.sub,f.background)]:[]])],h=[...t.gaById].map(([f,g])=>{let y=g.points.map(C=>t.worldToScreen(C)),S=Math.min(...y.map(C=>C.x)),k=Math.min(...y.map(C=>C.y)),w=Math.max(...y.map(C=>C.x)),v=Math.max(...y.map(C=>C.y)),x=w<0||S>n.width||v<0||k>n.height,T=o(g.polygon.opacity()),P=T>=.1&&!x,L=g.polygon.fill();return{areaId:f,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:P,interactive:g.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:g.effectiveBackground,...P?{screenBox:{x:o(S),y:o(k),width:o(w-S),height:o(v-k)}}:{}}}),p=[...t.freeTextById].map(([f,g])=>{let{node:y,kind:S}=g,k=g.plate&&g.plate.opacity()>.05?g.plate.fill():null,w=typeof k=="string"&&k?k:g.background,v=t.worldToScreen({x:y.x(),y:y.y()}),x=y.width()*i,T=y.height()*e,P=v.x-y.offsetX()*i,L=v.y-y.offsetY()*e,C=o(y.fontSize()*e),I=P+x<0||P>n.width||L+T<0||L>n.height,R=y.isVisible()&&!I,M=y.fill(),A=o(y.getAbsoluteOpacity()),E;return R||(C<G?E="below-minimum-size":I?E="outside-viewport":E="renderer-hidden"),{objectId:g.objectId??f,kind:S,text:y.text(),visible:R,renderedFontPx:C,ink:typeof M=="string"?M:"",background:w,opacity:A,...R?{screenBox:{x:o(P),y:o(L),width:o(x),height:o(T)}}:{},...E?{hiddenReason:E}:{}}}),m=t.labelGroup.find(f=>f.getAttr("rowLabel")===!0).filter(f=>f instanceof Xm).map(f=>{let g=f.getClientRect({skipShadow:!0,skipStroke:!0}),y=g.x+g.width<0||g.x>n.width||g.y+g.height<0||g.y>n.height,S=f.fill();return{text:f.text(),visible:f.isVisible()&&!y,renderedFontPx:o(f.fontSize()*e),ink:typeof S=="string"?S:"",...y?{}:{screenBox:{x:o(g.x),y:o(g.y),width:o(g.width),height:o(g.height)}}}}),b=t.sections.filter(f=>f.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:G,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((f,g)=>f+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(f=>String(f.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:t.effSelection,focusedSectionId:t.focusedSectionId,focusBackdropVisible:!!t.focusBackdrop?.isVisible(),categoryFilterKeys:t.categoryFilter?[...t.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:b.length,categoryPaintedSectionShells:b.filter(f=>{let g=f.blockPoly.fill();return typeof g!="string"||!An(t.canvasBackground,g)}).length,tintedSectionShells:b.filter(f=>{let g=f.blockPoly.fill();return typeof g=="string"&&Ns(t.canvasBackground,g)}).length,visibleCategoryDetailOutlines:t.sections.filter(f=>f.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(f=>f.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(f=>f.sectionId!=null&&f.polygon.opacity()>.05).length},labels:s,gaAreas:h,hierarchyLabels:u,freeTextLabels:p,rowLabels:m}}import{Circle as tg}from"konva/lib/shapes/Circle";import{Ellipse as ig}from"konva/lib/shapes/Ellipse";import{Line as ng}from"konva/lib/shapes/Line";import{Arrow as og}from"konva/lib/shapes/Arrow";import{Path as rg}from"konva/lib/shapes/Path";import{Rect as Yt}from"konva/lib/shapes/Rect";import{Text as Lo}from"konva/lib/shapes/Text";import{Image as sd}from"konva/lib/shapes/Image";import{Group as td}from"konva/lib/Group";import{Circle as Ym}from"konva/lib/shapes/Circle";import{Path as Um}from"konva/lib/shapes/Path";function $m(t,e){let i=e?.trim();return i&&i.toLowerCase()!==Ar?i:Mt[t.group]}var id=new WeakMap;function qi(t){let{icon:e,size:i}=t,n=$m(e,t.color),o=O(n)&&n!==Mt[e.group]?wr:ui,r=O(t.background)?0:i*wn.ringRatio,s=t.listening??!1,a=new td({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new Ym({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:kr,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*wn.glyphScale,c=new Um({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/kn,scaleY:l/kn,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),id.set(a,{glyph:c,icon:e}),a}function ko(t,e,i){let n=t instanceof td?id.get(t):void 0;if(n?.icon.solidLarge){let o=Mr(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function nd(t,e,i){let n=pi("wheelchair"),o=Or(t);if(!n||!o)return null;let r=Br(e),s=qi({icon:n,x:o.x-r/2,y:o.y-r/2,size:r,background:i,listening:!1});return s.name("step-free-route-mark"),s}import{Group as qm}from"konva/lib/Group";import{Path as Zm}from"konva/lib/shapes/Path";import{Rect as Qm}from"konva/lib/shapes/Rect";import{Text as jm}from"konva/lib/shapes/Text";function Jm(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function eg(t,e,i={}){let n=t.height??40,o=t.width??n*3,r=(t.x??0)+o/2,s=(t.y??0)+n/2,a=n*.46,l=ui,c=new jm({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?Er("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,p=u+h+c.width(),m=Math.max(o,p+n),b=new qm({name:"gate-sign",x:r,y:s,rotation:Jm(t.rotation??0),listening:i.hitTarget===!0});b.add(new Qm({name:"gate-sign-pill",x:-m/2,y:-n/2,width:m,height:n,cornerRadius:n/2,fill:t.fill??Mt.navigation,stroke:l,strokeWidth:Math.max(1,n*.05),opacity:i.organizerOnly?.55:1,dash:i.organizerOnly?[n*.2,n*.12]:void 0,listening:i.hitTarget===!0,perfectDrawEnabled:!1}));let f=-p/2;return d&&(b.add(new Zm({name:"gate-sign-step-free",data:d,x:f,y:-u/2,scaleX:u/24,scaleY:u/24,fill:l,listening:!1,perfectDrawEnabled:!1})),f+=u+h),c.position({x:f,y:-c.height()/2}),b.add(c),b.setAttr("gateSignHeight",n),{group:b,fontSize:a,bounds:{x:r-m/2,y:s-n/2,width:m,height:n}}}function od(t,e){if(e.gate.hideFromBuyers)return;let i=eg(e,t.labelFont());i.group.setAttr("shapeObjectId",e.id),e.opacity!=null&&i.group.opacity(Math.min(1,Math.max(.1,e.opacity))),t.bgLayer.add(i.group),t.iconNodeById.set(e.id,{node:i.group,fontSize:i.fontSize}),t.landmarkBoxes.push(i.bounds)}function ad(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let n=i.naturalWidth||4,o=i.naturalHeight||3,r=e.crop??{x:0,y:0,width:1,height:1},s=Math.max(0,Math.min(.99,r.x)),a=Math.max(0,Math.min(.99,r.y)),l={x:s,y:a,width:Math.max(.01,Math.min(1-s,r.width)),height:Math.max(.01,Math.min(1-a,r.height))},c=e.width,d=c*(o*l.height/(n*l.width)),u=new sd({image:i,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:d/2,width:c,height:d,rotation:e.rotation??0,crop:{x:l.x*n,y:l.y*o,width:l.width*n,height:l.height*o},opacity:e.opacity,listening:!1}),h=e.layer==="above"?t.fgDecorGroup:t.bgLayer;h.add(u),u.moveToBottom(),h.getLayer()?.batchDraw()})}function ld(t,e){let i=new window.Image,n=new sd({image:i,x:e.x+e.width/2,y:e.y+e.height/2,offsetX:e.width/2,offsetY:e.height/2,width:e.width,height:e.height,rotation:e.rotation??0,opacity:q(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(n):t.bgLayer.add(n),e.role&&t.landmarkBoxes.push(z(ht({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),t.trackAssetImage(i,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let o=n.getLayer();o&&o.batchDraw()})}function cd(t,e){let i=e.fill??t.theme.decorFill??eo,n=se(i,.12);if(e.shape==="round")t.bgLayer.add(new tg({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:n,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Yt({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:n,strokeWidth:1.5,cornerRadius:4,listening:!1}))}if(!It(e))return;let o=Ut(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,X(i,t.theme.textColor??"#cbd5e1"),We(e)??Sr,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var sg=8,ag=6;function lg(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(sg,e*.35),o=Math.max(ag,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function dd(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??X(i,t.theme.textColor??el),o=e.semanticKind==="icon"?pi(e.iconKey):void 0;if(o){let d=qi({icon:o,x:e.position.x,y:e.position.y,size:e.fontSize,rotation:e.rotation,color:e.color,background:t.canvasBackground});t.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),t.bgLayer.add(d);return}let r=e.background?.padding??0,s=e.opacity??1,a=or(e),l=new Lo({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:to(e.bold,e.italic,"600"),fill:n,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;e.background&&(c=new Yt({x:e.position.x,y:e.position.y,...lg(l,e.fontSize),rotation:e.rotation,fill:e.background.color,opacity:s*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),t.bgLayer.add(c)),t.freeTextById.set(e.id,{node:l,backdrop:c,background:i,kind:a?"direct-landmark":"free-text",...e.labelImportance==="detail"?{showAt:"detail"}:{}}),t.bgLayer.add(l)}function hd(t,e){if(Hr(e)){od(t,e);return}let i=e.fill??t.theme.decorFill??eo,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=nr(e),a=le(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?se(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?q(e.opacity,.1,1):1,p=0,m=0,b=null;if(c&&e.points&&e.points.length>=2){p=e.points.reduce((w,v)=>w+v.x,0)/e.points.length,m=e.points.reduce((w,v)=>w+v.y,0)/e.points.length;let f=Dr(e),g=Nr(u),y=Fr(e),S=new og({points:e.points.flatMap(w=>[w.x,w.y]),closed:!1,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:u,opacity:h,lineCap:f.lineCap,lineJoin:f.lineJoin,pointerAtBeginning:f.startEnding==="arrow",pointerAtEnding:f.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path",...y?{dash:_r(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let k=y?nd(e,u,t.canvasBackground):null;k&&t.bgLayer.add(k)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let f=n?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l};p=e.x+e.width/2,m=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Yt({x:p,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...f,stroke:d,strokeWidth:u,cornerRadius:q(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){p=e.x+e.width/2,m=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height};let f=n?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l};t.bgLayer.add(new ig({x:p,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...f,stroke:d,strokeWidth:u,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let f=qo(e),g=z(f);p=e.points.reduce((k,w)=>k+w.x,0)/e.points.length,m=e.points.reduce((k,w)=>k+w.y,0)/e.points.length,b=g;let y=n?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l},S=De(f,Zo(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},$o(e)??void 0);S.setAttrs({x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,...y}),t.bgLayer.add(S)}b&&e.role&&t.landmarkBoxes.push(b);for(let f of Jo(e))t.bgLayer.add(new ng({points:f.points.flatMap(g=>[g.x,g.y]),closed:f.closed,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:f.ink??jo,fill:f.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(n){let{node:f,spec:g}=dg(t,p,m,e.label,l,b,e.labelStyle);t.primaryFocalLabels.set(f,g),t.freeTextById.set(e.id,{node:f,background:l,plate:g.plate,kind:"stage"})}else if(r){let f=o||s,g=X(l,f?"#e6e9f0":"#9aa3b5"),y=Ut(t,t.bgLayer,e.label,p,m,g,f?18:12,!1);f&&t.primaryFocalLabels.set(y,{targetPx:18,trackingRatio:0,ink:String(y.fill()??""),plateInk:String(y.fill()??""),plate:new Yt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:y,background:l,kind:"decor",...f?{}:{area:go(e.rotation,b,p,m,12,g,l)}})}else{let f=X(l,"#cbd5e1"),g=Ut(t,t.bgLayer,e.label,p,m,f,16,!0);t.freeTextById.set(e.id,{node:g,background:l,kind:"decor",area:go(e.rotation,b,p,m,16,f,l)})}}var xo=22,rd=G,Zi=6,cg=.5;function dg(t,e,i,n,o,r,s){let a=s?.size??xo,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??X(o,l),d=r?r.x+r.width/2:e,u=r?r.y+r.height/2:i,h=hg(t.canvasBackground,o),p=new Yt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(p);let m=new Lo({x:d,y:u,text:n,fontSize:a,fontStyle:to(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/xo),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return m.offsetX(m.width()/2),m.offsetY(m.height()/2),t.bgLayer.add(m),{node:m,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/xo,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??X(h,l),plate:p}}}function hg(t,e){return j(e,O(t)?"#ffffff":"#000000",.34)}function ud(t,e,i,n,o=0){let r=Math.max(i,1e-4),s=o>0&&r>o?r/o:1,l=Math.min(e.targetPx,Math.max(rd,e.targetPx*cg)*s)/r,c=g=>{t.letterSpacing(g*e.trackingRatio),n(t,g)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=Ko(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-Zi*2,height:(u?d.width:d.height)-Zi*2},p=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(p<1&&(l=Math.max(rd/r,l*p),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let b=(u?t.height():t.width())+Zi*2,f=(u?t.width():t.height())+Zi;e.plate.size({width:b,height:f}),e.plate.offset({x:b/2,y:f/2}),e.plate.opacity(1),t.fill(e.plateInk)}function pd(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=xr(i,n,Ve),r=t.theme.textColor??"#e6e9f0",s=X(o,r),a=De(e.points,e.holes,{fill:i,opacity:Ve,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",b=>{t.isGhostClick(b)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=Jt(e.points,e.holes),c=t.sections.find(b=>te(l,b.outline,b.holes)),d=We(e)??ni,u=It(e)?Ut(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Ut(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,oi,!1);u&&t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:u,background:o,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:o,kind:"ga-capacity",categoryKey:e.categoryKey});let p=Lt(e)>0?new rg({data:nt(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;p&&t.bgLayer.add(p);let m={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:i,labelPoint:l,labelNode:u,...We(e)!==void 0?{nameSize:d}:{},capacityNode:h,...p?{wheelchairGlyph:p}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,m),wo(m)}function Ut(t,e,i,n,o,r,s,a){let l=new Lo({x:n,y:o,text:i,fontSize:s,fontStyle:a?"700":"500",fontFamily:t.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function fd(t,e){let i=[],n=e.canvasBackground,o=new Map,r=(d,u)=>{let h=o.get(d)??[];h.push(u),o.set(d,h)};for(let d of e.seats){if(d.kind==="booth")continue;let u=d.logicalRowId??d.rowId;r(u,d),u!==d.rowId&&r(d.rowId,d)}let s=d=>d.logicalSeatIndex??Number(d.id.split(":").pop()??0);for(let d of t.objects){if(d.type!=="row")continue;let u=d.segmentedRow?.repeatLabelOnComponents===!0;if(d.segmentedRow&&!u&&d.segmentedRow.componentIndex!==0)continue;let h=u?d.labelPresentation:d.segmentedRow?.labelPresentation??d.labelPresentation;if(h?.visible===!1||h?.positionPreset==="none")continue;let p=d.segmentedRow&&!u?d.segmentedRow.groupId:d.id,m=(o.get(p)??[]).slice().sort((A,E)=>s(A)-s(E));if(!m.length)continue;let b=m[0],f=m[m.length-1],g=h?.labelStyle,y=h?.style==="pill"?Nt(n):null,S=y?y.plate:n,k=de(S,g?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",ze),w=g?.size??yr,v=h?.rotation??0,x=e.objectFilteredOut(d)?.15:1,T=m.reduce((A,E)=>A??e.seatSection.get(E.id),void 0),L=d.segmentedRow?.displayLabel??d.displayLabel??Rt(d.label,T?.label);if(!L)continue;let C=T?[...new Set([T.id,T.logicalId,T.zone].filter(A=>!!A))]:void 0,I=(A,E,W)=>i.push({text:L,x:A,y:E,rotation:v,fontSize:w,ink:k,opacity:x,rowKey:p,...y?{pill:y}:{},...C?.length?{focusKeys:C}:{},...W?{automaticAway:W}:{}});if(h?.position){I(h.position.x,h.position.y);continue}let R=e.seatR+12,M=h?.positionPreset??"start";if(M==="start"||M==="both"){let A=d.rotation*Math.PI/180,E={x:-Math.cos(A),y:-Math.sin(A)};I(b.x+E.x*R,b.y+E.y*R,E)}if(M==="end"||M==="both"){let A=(d.rotation+d.curve)*Math.PI/180,E={x:Math.cos(A),y:Math.sin(A)};I(f.x+E.x*R,f.y+E.y*R,E)}}let a=(e.seatR+12)*2.2,l=[],c=new Map;for(let d of i){let u=c.get(d.text),h=u?.find(p=>Math.hypot(p.x-d.x,p.y-d.y)<=a);if(h){h.x=(h.x+d.x)/2,h.y=(h.y+d.y)/2;continue}l.push(d),u?u.push(d):c.set(d.text,[d])}return l}function Co(t,e,i=ee){let n=t.rotation()*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=(t.width()*o+t.height()*r)/2+i,a=(t.width()*r+t.height()*o)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function md(t,e,i,n){let o={x:e.x,y:e.y},r=e.automaticAway;if(!r)return o;let s={x:-r.y,y:r.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let h=1;h<=4;h++){let p=a*h;l.push({x:s.x*p,y:s.y*p},{x:-s.x*p,y:-s.y*p},{x:r.x*p,y:r.y*p},{x:(r.x+s.x)*p,y:(r.y+s.y)*p},{x:(r.x-s.x)*p,y:(r.y-s.y)*p})}let c=o,d=1/0,u=1/0;for(let h of l){let p={x:o.x+h.x,y:o.y+h.y},m=Co(t,p),f=(n?rt(n,m,{mode:"overlap"}).length:0)+i.collisionCount(m),g=Math.hypot(h.x,h.y);if((f<d||f===d&&g<u)&&(c=p,d=f,u=g),f===0)break}return c}var Qi=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,n,o,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(u),l())},u=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(u),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&o(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&o()}).catch(()=>{s===this.generationCount&&this.errors.push(`${n} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${n} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function gd(t,e){let i=e,n=i._cache instanceof Map?i._cache:null,o=i._canvasCache??n?.get("canvas");if(!o){e.isCached?.()&&e.clearCache();return}let r=[o.scene,o.filter,o.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),n?.delete("canvas")}function bd(t){let e=t.drawScene;t.drawScene=((i,n,...o)=>!i&&t.opacity()===0?(t.getCanvas().getContext().clear(),t):e.call(t,i,n,...o))}function yd(t,e){let i=0,n=0,o=r=>{i||(i=r),n+=1;let s=r-i;s>=1e3&&(t(Math.round(n*1e3/s)),n=0,i=r),e(requestAnimationFrame(o))};e(requestAnimationFrame(o))}function ug(t){return t<0?0:t>1?1:t}function Sd(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,n=t.reducedMotion===!0,o=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},u=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},h=f=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,f()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,f()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,f()},16)}},p=()=>{a||s||(a=!0,u(),t.done())},m=f=>{for(let g=c.length-1;g>=0;g--){let y=c[g],S=n?1:ug((f-y.startedAt)/160);t.fade(y.work,S),S>=1&&c.splice(g,1)}return c.length>0},b=()=>{if(s)return;let f=e(),g=f;for(;r<t.chunks.length&&(r===0||e()-g<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,n?1:0),n||c.push({work:S.work,startedAt:f+(r-1)*o}),e()-g>=i)break}let y=m(f);t.draw(),r<t.chunks.length||y?h(b):p()};return h(b),{cancel(){if(!a){s=!0,u();for(let f of c)t.fade(f.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let f=t.chunks[r++];t.build(f.work)}for(let f of t.chunks)t.fade(f.work,1);c.length=0,t.draw(),p()}},get done(){return a}}}var pg={width:40,height:30,rotation:0};function vd(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??pg;if(l.points&&l.points.length>=3){for(let m of l.points)s.x+m.x<i&&(i=s.x+m.x),s.y+m.y<n&&(n=s.y+m.y),s.x+m.x>o&&(o=s.x+m.x),s.y+m.y>r&&(r=s.y+m.y);continue}let c=l.rotation*Math.PI/180,d=l.width/2,u=l.height/2,h=Math.abs(d*Math.cos(c))+Math.abs(u*Math.sin(c)),p=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-p<n&&(n=s.y-p),s.x+h>o&&(o=s.x+h),s.y+p>r&&(r=s.y+p);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<n&&(n=s.y-a),s.x+a>o&&(o=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:n,width:o-i,height:r-n}:null}function wd(t){let e=new Map,i=[];for(let o of t.seats){let r=t.sectionIdOf(o.id);if(r==null){i.push(o);continue}let s=e.get(r);s?s.push(o):e.set(r,[o])}let n=[...e.entries()].flatMap(([o,r])=>{let s=t.sections.find(a=>a.id===o);return s?[{chunk:{id:o,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((o,r)=>o.distance-r.distance).map(o=>o.chunk);return i.length&&t.looseGroup&&n.push({id:"",work:{seats:i,group:t.looseGroup}}),n}var kd=!1;function xd(t){return t&&t!=="flat"&&!kd&&(kd=!0,console.warn(`[seatlayer] view mode '${t}' was removed; the map shows the flat view. Pass 'flat', or use the Map | 3D control for the immersive venue view.`)),"flat"}var Ld=(t,e)=>t.length===e.length&&t.every(i=>e.some(n=>Math.abs(i.x-n.x)<.001&&Math.abs(i.y-n.y)<.001));function Cd(t,e){let n=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),o=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=n.find(c=>c.id===o),a=o!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>Ld(c,e.outline)),l=n.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>Ld(c,d.outline)))}}import{Group as Td}from"konva/lib/Group";import{Rect as fg}from"konva/lib/shapes/Rect";import{Text as To}from"konva/lib/shapes/Text";function Id(t,e){let i=Jt(e.outline,e.holes),n=le(t.canvasBackground),o=[],r=new Map,s=0,a=z(e.outline),l=t.seatIndex?rt(t.seatIndex,a).map(C=>t.seatById.get(C)).filter(C=>!!C):t.seats;for(let C of l)t.seatSection.has(C.id)||te(C,e.outline,e.holes)&&(o.push(C.id),r.set(C.categoryKey,(r.get(C.categoryKey)??0)+1),(t.statusById.get(C.id)??"free")==="free"&&s++);let c=e.color??ii([...r].map(([C,I])=>({hex:t.catColor.get(C)??"#6e7bff",w:I})),"#3a4358"),d=new Td({listening:!1});t.bgLayer.add(d);let u=new Td({listening:!1});d.add(u);let h=new gt({listening:!0});t.seatLayer.add(h);let p=u,m=Cd(t.chartDoc,e),b=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",f=De(e.outline,m.holes,{visible:!m.hidden,stroke:D(b,.5),strokeWidth:1,fill:D(b,.08),listening:!1},e.outlinePath);p.add(f);let g=De(e.outline,m.holes,{visible:!m.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:Xe,opacity:0,listening:!1},e.outlinePath);p.add(g);let y=e.labelPresentation?.labelStyle,S=y?.color,k=n.sectionInk,w=(y?.size??18)/18,v=new fg({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});p.add(v);let x=new To({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*w,fontStyle:Ce,fontFamily:t.labelFont(),fill:de(n.sectionFill,S,k),listening:!1,perfectDrawEnabled:!1});x.offsetX(x.width()/2),x.offsetY(x.height()/2),p.add(x);let T=new To({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Ce,fontFamily:t.labelFont(),fill:de(n.sectionFill,S,k),opacity:0,listening:!1,perfectDrawEnabled:!1});p.add(T);let P=new To({x:i.x,y:i.y,text:F("map.seatsLeft",{count:s}),fontSize:12,fontStyle:gs,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),p.add(P),{id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...Ha(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(C=>t.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(o),shellFill:n.sectionFill,shellStroke:n.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!te(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},...e.labelPresentation?.rotation?{authoredLabelRotation:e.labelPresentation.rotation}:{},labelArea:Uo(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:b,outlinePoly:f,blockPoly:g,namePlate:v,nameLabel:x,numberLabel:T,subLabel:P,preferredInk:k,...S?{explicitInk:S}:{},labelScale:w,authoredLabelSize:y?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function Rd(t,e,i){if(!e?.length)return;let n=new Set(e),o=t.seats.filter(d=>!n.has(d.categoryKey)||t.seatInClosedSection(d.id)?!1:(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id));if(!o.length)return;let r=ao(o.map(d=>d.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=t.clusterLabels.boundsForSeats(o,s),l=je(o,s);if(a?.singleBlock&&(!t.hasSections||r!=null)){let d=t.clusterLabels.diveTarget(a.bounds,a.anchor);if(d){t.focusRegion(d,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:yt(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};so({stage:t.stage,box:l,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(c)})||t.focusRegion(l,{animate:i?.animate,durationMs:t.cameraGlideMs})}function yt(t){let e=Fc(Math.max(t.seatR,t.markerR));return Math.max(e,rl(t.markerR))}var Pd=.25;function mg(t,e){if(e.length===0)return 1/0;let i=je([...e],t.sellableUnit.diameter/2),n=t.framingViewport();return Math.min(n.width*Pd/Math.max(i.width,1e-6),n.height*Pd/Math.max(i.height,1e-6))}function Md(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=Ed(t,i);if(!n.length)return!1;t.clearSectionFocus();let o=Math.max(24,t.seatR*3),r=je(n,o),s={x:r.x+r.width/2,y:r.y+r.height/2};return so({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:yt(t)}),!0}function Ed(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Pe(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function Ad(t,e,i){let n=i===void 0?t.accessFilter:i;if(!n||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let o=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Pe(s,n)==="match"});return o.length&&Io(t,o)||t.focusSection(e),!0}function Fd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Ed(t,i);if(!n.length)return null;let o=Math.max(24,t.seatR*3),r=je(n,o),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht;return{spaces:n.length,sections:Ro(t,i),wholeVenue:a}}function Io(t,e,i){let n=e.map(h=>t.seatById.get(h)).filter(h=>h!=null);if(!n.length)return!1;let o=t.seatPitch>0?t.seatPitch:t.seatR*2,r=je(n,Math.max(24,t.seatR*3,o*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht)return!1;let a=ao(n.map(h=>h.id),t.seatSection);a&&t.markSectionFocus(a,{x:r.x+r.width/2,y:r.y+r.height/2});let l=t.rowBandDetailScale()*1.08,c=t.zoomBounds(),d=Math.min(Math.max(Math.min(t.seatLabelTargetScale(),c.max),l),c.max),u=mg(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(yt(t),u),d)}),!0}function _d(t,e,i=!0,n){let o=t.sectionBounds(e);if(!o)return;let r=t.sectionMembers(e).map(d=>t.seatById.get(d)).filter(d=>d!=null),s=r.filter(d=>(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id)),a=s.length?s:r,l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,o,n,l);t.focusRegion(c?.bounds??o,{animate:i,minScale:c?.minScale,maxScale:yt(t),focusPaddingPx:l})}function Po(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let n=Bd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,n),n}function Bd(t,e,i){return Ll(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function Ro(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let n=i===t.accessFilter,o=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=n?Po(t,r):Bd(t,r,i);if(s<=0)continue;let a=o.get(r.logicalId);a?a.free+=s:o.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...o.values()]}var yg=1800,qt=class qt{constructor(e,i={}){this.seatLabelPool=new Map;this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.canonicalSeatIds=new Set;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=io;this.effSelection=pt;this.colorblind=!1;this.cbHueByKey=new Map;this.colourOverride=null;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.sectionRungPinned=!1;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Oi;this.seatPaintCache=null;this.selectionFocusId=null;this.selectionFocusKeep=null;this.hiddenPose=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.accessFreeBySection=new Map;this.categoryHighlight=null;this.seatHighlight=null;this.labelLayers={seatLabels:!0,rowLabels:!0};this.categoryColours=!0;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];this.landmarkBoxes=[];this.seatSection=new Map;this.unsectionedSeatGroup=null;this.catPrice=new Map;this.dimmedSections=new Set;this.sectionHeat=new Map;this.closedSections=new Set;this.focusedSectionId=null;this.focusMembership=new Map;this.focusMembershipKey=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.sectionFocusDim=null;this.cameraGestures=0;this.objectFloor=new Map;this.unsectionedSeatIds=null;this.tableFootprints=[];this.zoneColor=new Map;this.hasSections=!1;this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=Ec();this.fitScale=1;this.fitPose="";this.viewportInsets={...mo};this.fitClearance={bottom:0,width:0};this.seatR=J;this.markerR=J;this.seatPitch=0;this.sellableUnit=ro(J);this.bounds={x:0,y:0,width:1,height:1};this.cached=!1;this.dpr=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);this.assets=new Qi;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.viewportSeats=null;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.gestureHits=new Xi(()=>{!this.destroyed&&!this.exportMode&&this.updateLabels()});this.rowLabelDwell=new Yi;this.readingFocusedFrame=!1;this.marquee=new Ui({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,isSelectable:e=>this.isSelectable(e),applyBand:(e,i,n)=>{this.opts.onBand?.(e,i,n)||(n?this.deselect(e):this.selectMany(e))},selectionChanged:()=>{this.opts.onMarquee?.(this.getSelection())}});this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let n=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;n&&this.focusSeat(n);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let n=this.seatById.get(this.focusedId);n&&this.opts.onFocusSeat?.(n)}};this.focusRingLinger=null;this.cameraHostCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.selectionFollowUps=new $i(()=>{this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)});this.sectionBoundsMemo=new Map;this.interactionHostCache=null;this.seatLabelTargetScale=yc(()=>({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e),blockExtent:e=>{let i=this.boothDims.get(e.rowId);return i?ft(i):void 0}}));this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let n=ji.pixelRatio;if(this.exportMode&&(this.dpr=1),ji.pixelRatio=this.dpr,this.stage=new gg({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Ki(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",F("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Mo({listening:!this.exportMode}),this.seatLayer=new Mo({listening:!this.exportMode}),this.overlayLayer=new Mo({listening:!1}),this.exportMode||(this.gestureHits.wrap(this.bgLayer),this.gestureHits.wrap(this.seatLayer),this.gestureHits.listen(e),bd(this.seatLayer)),this.labelGroup=new $t({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new $t({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new $t({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new _i({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>cl(this.sellableUnit),pickableScale:()=>Ai(this.sellableUnit),categoryLabel:o=>this.catByKey.get(o)?.label??"",categoryColor:o=>this.categoryDisplayColor(o),categoryFilter:()=>this.categoryFilter,seatsPickable:()=>this.seatsPickable(),screenToWorld:o=>this.screenToWorld(o),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(o,r)=>this.focusRegion(o,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new Od({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:Vi,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Od({radius:J+3,stroke:"#38bdf8",strokeWidth:2.5,dash:[4,3],opacity:.95,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.focusRing),this.stage.add(this.bgLayer,this.seatLayer,this.overlayLayer),this.exportMode&&(ji.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&yd(o,r=>{this.rafId=r})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setRowBandPreview(e){this.rowBandPreview?.clear(),this.rowBandPreview=e?new Xt:null,this.rowBandZoomAnchor=null,this.hoverRing.visible(!1),this.updateLOD(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw()}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Li({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new Ci({overlayLayer:this.overlayLayer,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,categoryColor:e=>this.categoryDisplayColor(e),seatCategoryKey:e=>this.seatById.get(e)?.categoryKey??null,isOwnedHold:e=>this.ownedHold.has(e),reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed})),this.breathCache}presentSeatHover(e,i,n,o){this.hoverCard.presentSeat(e,i,n,o)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Ri({container:this.container,labelFont:()=>this.labelFont(),canvasBackground:()=>this.canvasBackground,seatsPickable:()=>this.seatsPickable(),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionLabel:e=>this.sections.find(i=>i.logicalId===e)?.label??null,sectionMembers:e=>this.sectionMembers(e),hoveredSeatId:()=>this.hoveredId,hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,nearestSeat:e=>this.nearestSeatToScreen(e,ue,!0),seat:e=>this.seatById.get(e),seatSectionLabel:e=>this.seatSection.get(e)?.label??null,seatStatus:e=>this.statusById.get(e)??"free",seatOwnedHold:e=>this.ownedHold.has(e),seatClosed:e=>this.seatInClosedSection(e),seatSellable:e=>this.opts.manageMode?!this.seatInClosedSection(e)&&(this.statusById.get(e)??"free")==="free":this.isSelectable(e),categoryOrder:()=>this.catOrder,categoryLabel:e=>this.catByKey.get(e)?.label??"",categoryPrice:e=>this.categoryPriceLabel(e),categoryColor:e=>this.categoryDisplayColor(e),categorySellable:e=>this.catByKey.get(e)?.notForSale!==!0,chartDoc:()=>this.chartDoc,seatFacts:e=>this.opts.hoverFacts?.(e)??null,seatCardHead:e=>this.opts.hoverCardHead?.(e)??null,sectionCardHead:(e,i)=>this.opts.hoverSectionHead?.(e,i)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Ti({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Dt(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let n=this.sectionTapAnchor(i,this.seatById.get(e.seatId)??{x:0,y:0});this.opts.onSectionTap?this.opts.onSectionTap(i,n):this.focusSection(i,{anchor:n})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(n=>n.id).filter(n=>{let o=this.seatSection.get(n);return!!o&&(o.logicalId===e||o.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(va({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null);if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let n=0,o=0;for(let r of i)n+=r.x,o+=r.y;return{x:n/i.length,y:o/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Pi({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let n of e.memberIds){if(!this.selection.has(n)&&!this.ownedHold.has(n))continue;let o=this.seatById.get(n);o&&i.push(o)}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>this.marquee.active(),marqueeShouldStart:e=>lc(e,{manageMode:this.opts.manageMode===!0,marqueeSelect:this.opts.marqueeSelect===!0}),beginMarquee:(e,i)=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box",i),updateMarquee:e=>this.marquee.update(e),finishMarquee:()=>this.marquee.finish(),cancelMarquee:()=>this.marquee.cancel(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,i){this.sectionBoundsMemo.clear(),this.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Xt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.sectionRungPinned=!1,this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??ei(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let a of e.floors)for(let l of a.objects)this.objectFloor.set(l.id,a.id),l.type==="section"&&l.logicalSectionId&&this.objectFloor.set(l.logicalSectionId,a.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new $t({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.focusMembership.clear(),this.focusMembershipKey=null,this.unsectionedSeatIds=null,this.primaryFocalLabels.clear(),this.gaById.clear();for(let a of this.selectionMarkers.values())a.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),n||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,n||this.statusById.clear(),this.accessFreeBySection.clear(),n||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,n||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.seatHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasSections=o.objects.some(a=>a.type==="section");for(let a of e.zones??[])a.color&&this.zoneColor.set(a.id,a.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=hi(this.theme.seatScale)*J,this.container.style.background="",this.canvasBackground=this.resolveCanvasBackground(),this.container.style.background=this.canvasBackground,this.effSelection=this.resolveSelectionColor(),this.hoverRing.stroke(this.effSelection),this.hoverRing.radius(this.seatR+2),this.catColor.clear(),this.catByKey.clear(),this.catPrice.clear(),this.catOrder=e.categories.map(a=>a.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((a,l)=>{this.cbHueByKey.set(a,wi[l%wi.length])});for(let a of e.categories){this.catColor.set(a.key,a.color),this.catByKey.set(a.key,a);let l=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[a.key]?.min??a.price;typeof l=="number"&&this.catPrice.set(a.key,l)}this.tableFootprints=Rc(o.objects);for(let a of o.objects)a.type==="booth"&&this.boothDims.set(a.id,{width:a.width,height:a.height,rotation:a.rotation,...a.points&&a.points.length>=3?{points:a.points.map(l=>({x:l.x,y:l.y}))}:{},...It(a)?{}:{nameHidden:!0},...We(a)?{nameSize:We(a)}:{}});if(this.seats=He(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===e?this.seats:He(e);this.canonicalSeatIds=new Set(a.map(l=>l.id))}for(let a of this.seats)this.seatById.set(a.id,a),this.statusById.has(a.id)||this.statusById.set(a.id,"free");this.seatIndex=Rr(this.seats,{seatRadius:this.seatR}),this.seatPitch=nl(this.seats),this.markerR=ol(this.seatR,this.seatPitch),this.sellableUnit=ll(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=ir(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new $t({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?vd(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,!s&&!r&&this.renderSeats(),this.buildRowLabelPlan(o),this.overlayLayer.add(this.labelGroup,this.fgDecorGroup),this.overlayLayer.add(this.hoverRing,this.focusRing),hc(this.overlayLayer,this.chartDoc,this.activeFloorId,!this.floorOverview&&!this.stacked&&!this.exportMode),this.mountCachePending=!s&&!r,this.zoomToFit(),s&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=wd({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Sd({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,n)=>i.group.opacity(n),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.afterViewChange(),this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){if(this.viewportSeats){let n=this.viewportSeats;this.viewportSeats=null,e?n.finish():n.cancel()}let i=this.seatReveal;this.seatRevealPending=!1,i&&(this.seatReveal=null,e?i.finishNow():i.cancel(),this.seats.length&&!this.destroyed&&this.updateLabels())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:xt(e)};if(this.floorOverview&&e.floors.length>=2)return tt(e)==="combined"?ar(e):sr(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...tr(e),referenceImage:void 0,backgroundImage:xt(e)};let i=e.floors.find(n=>n.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:xt(i),floors:void 0}}floorBaseHeightMFor(){let e=this.chartDoc?.floors;return e?.length?e.find(i=>i.id===this.activeFloorId)?.baseHeightM??0:0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&!!this.chartDoc&&tt(this.chartDoc)!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?ei(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let n=!1,o=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),n=!0),o){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),o.add(l))}}if(o&&o.size){for(let r of o)this.refreshSectionFill(r);this.bgLayer.batchDraw()}n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setSeatCategories(e){let i=!1,n=!1,o=new Set;for(let[s,a]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(a)||l.categoryKey===a)continue;l.categoryKey=a,i=!0;let c=this.circleById.get(s);c&&(this.paintSeat(c,s),n=!0);let d=this.seatSection.get(s);d&&o.add(d)}if(!i)return;let r=new Map((this.chartDoc?ei(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){if(!r.get(s.id)?.color){let l=new Map;for(let c of s.memberIds){let d=this.seatById.get(c)?.categoryKey;d&&l.set(d,(l.get(d)??0)+1)}s.baseFill=ii([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(o=>this.statusById.has(o))),n=new Set([...this.ownedHold,...i]);this.ownedHold=i,this.selectionFollowUps.batch(()=>{for(let o of n){let r=this.circleById.get(o);r&&this.paintSeat(r,o),this.syncSelectionMarker(o)}}),n.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let n=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=jl({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>s,sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=n!=null&&i!=null&&Jl(n,i,s=>this.seatSection.get(s)?.logicalId??null)?[n,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}n&&this.syncSelectionMarker(n),i&&this.syncSelectionMarker(i);for(let[s,a]of this.selectionMarkers)a.opacity(this.selectionFocusDims(s)?.2:1);this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.updateLabels(),this.overlayLayer.batchDraw()}setSeatMarks(e){let i=this.seatMarks.merge(e,this.statusById);for(let n of i){let o=this.circleById.get(n);o&&this.paintSeat(o,n)}i.size&&(this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}getSeatMark(e){return this.seatMarks.get(e)}getStatus(e){return this.statusById.get(e)??"free"}getSelection(){let e=[];for(let i of this.selection){let n=this.seatById.get(i)??this.selectedSeatById.get(i);n&&e.push(n)}return e}clearSelection(){let e=[...this.selection];this.selectionFollowUps.batch(()=>{for(let i of e)this.setSelected(i,!1,!0)}),this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let i=[];return this.selectionFollowUps.batch(()=>{for(let n of e){if(this.selection.has(n)||!this.isSelectable(n))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(n,!0,!0);let o=this.seatById.get(n);o&&i.push(o)}}),i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee.cancel(),this.gestures.resetPan();let i=e.organizerStatus!==!1,n=i!==this.organizerStatus;this.organizerStatus=i,this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.marqueeShape=e.marqueeShape??"box",this.opts.rowLabelSelect=e.rowLabelSelect===!0,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let o=[...this.selection].filter(r=>!this.isSelectable(r));o.length&&this.deselect(o),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),n&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,n]of Object.entries(e??{}))Number.isFinite(n)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,n)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;this.selectionFollowUps.batch(()=>{for(let n of e)this.selection.has(n)&&(this.setSelected(n,!1,!0),i=!0)}),i&&(this.overlayLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let i of this.seats)this.isSelectable(i.id)&&e.push(i.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let i=new Set(e),n=[];for(let o of this.seats)i.has(o.label)&&this.isSelectable(o.id)&&n.push(o.id);return this.selectMany(n)}setEvidenceSelection(e){return!this.seatById.has(e)||!this.isSelectable(e)?!1:(this.selection.size&&this.clearSelection(),this.setSelected(e,!0),this.overlayLayer.batchDraw(),this.selection.has(e))}getSelectableInSection(e){let i=[],n=new Set;for(let o of this.sections)if(!(o.id!==e&&o.logicalId!==e&&o.zone!==e))for(let r of o.memberIds){if(n.has(r)||(n.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(o=>!this.selection.has(o));if(!i.length)return this.getSelection();let n=this.selection.size+i.length<=es;return this.selectionFollowUps.batch(()=>{for(let o of i)if(n)this.setSelected(o,!0,!0);else{this.selection.add(o);let r=this.circleById.get(o);r&&this.paintSeat(r,o)}}),this.queueViewportPinSync(),this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}rowLabelAtScreen(e){if(!this.opts.manageMode||!this.opts.rowLabelSelect)return null;let i=[],n=this.rowLabelGroup.find(o=>o.getAttr("rowLabel")===!0);for(let o of n){let r=o.getAttr("rowKey");!r||!o.isVisible()||i.push({rowKey:r,box:o.getClientRect({skipShadow:!0,skipStroke:!0})})}return jc(e,i)}selectRow(e){let i=Qc(e,this.seats,n=>this.isSelectable(n));return i.length&&(this.selectMany(i),this.opts.onMarquee?.(this.getSelection())),this.getSelection()}flashSeat(e,i="#f43f5e"){let n=this.seatById.get(e);n&&Hl(this.flashHost,n,i)}flashSection(e,i="#22a06b"){Gl(this.flashHost,this.sections.filter(n=>n.id===e||n.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed}}nearestSeat(e,i){let n=this.seatById.get(e);if(!n)return null;let o=n,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=a,c=l.x-o.x,d=l.y-o.y,u=c*i.x+d*i.y;if(u<=.5)continue;let h=Math.abs(c*i.y-d*i.x),p=u+h*2.5;p<s&&(s=p,r=a.id)}return r}focusSeat(e,i){let n=this.seatById.get(e);n&&(this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(n),this.focusRing.scale({x:1,y:1}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},yg)),i?.move!==!1&&this.ensureVisible(n),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(n))}clearFocusRingLinger(){this.focusRingLinger&&clearTimeout(this.focusRingLinger),this.focusRingLinger=null}dismissFocusRing(){this.clearFocusRingLinger(),this.focusRing.visible()&&(this.focusRing.visible(!1),this.queueViewportPinSync(),this.overlayLayer.batchDraw())}ensureVisible(e){let i=this.stage.width(),n=this.stage.height(),o=Math.max(this.stage.scaleX(),Se*1.2),r=this.worldToScreen(e),s=70,a=r.x<s||r.x>i-s||r.y<s||r.y>n-s;if(this.stage.scaleX()<o||a){let l=e;this.stage.scale({x:o,y:o}),this.stage.position({x:i/2-l.x*o,y:n/2-l.y*o}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=wc(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e,i=0){let n={bottom:Math.max(0,e||0),width:Math.max(0,i||0)};n.bottom===this.fitClearance.bottom&&n.width===this.fitClearance.width||(this.fitClearance=n,this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return kc(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){return vc(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return Cc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){uc(this.cameraHost)}isSeatRevealPending(){return this.seatRevealPending||this.seatReveal!==null||!!this.viewportSeats?.pending}get cameraHost(){return this.cameraHostCache??={stage:this.stage,bgLayer:this.bgLayer,seatLayer:this.seatLayer,exportMode:()=>this.exportMode,destroyed:()=>this.destroyed,reducedMotion:()=>this.reducedMotion,cameraGlideMs:()=>this.cameraGlideMs,portraitFitCrop:()=>this.opts.portraitFitCrop,openAtSectionsWhenDense:()=>this.opts.openAtSectionsWhenDense===!0,hasSections:()=>this.hasSections,fitClearanceBottom:()=>this.fitClearance.bottom,fitClearanceWidth:()=>this.fitClearance.width,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),zones:()=>this.zones,markerR:()=>this.markerR,unitZoomCeiling:()=>Math.max(dl(this.sellableUnit),this.hasSections?ve:0),bounds:()=>this.bounds,fitScale:()=>this.fitScale,setFitScale:e=>{this.fitScale=e},setFitPose:e=>{this.fitPose=e},revealWorldRect:()=>this.viewportSeats||this.isSeatRevealPending()?this.revealWorldRect:null,glideRaf:()=>this.glideRaf,setGlideRaf:e=>{this.glideRaf=e},setGlideInProgress:e=>{this.glideInProgress=e},zoomSettleRaf:()=>this.zoomSettleRaf,setZoomSettleRaf:e=>{this.zoomSettleRaf=e},gestureFrame:()=>this.gestureHits.bump(),framingViewport:()=>this.framingViewport(),constrainPan:(e,i)=>this.constrainPan(e,i),sectionBounds:e=>this.sectionBounds(e),effScale:()=>this.effScale(),settleView:()=>this.settleView(),afterViewChange:()=>this.afterViewChange(),scheduleViewChange:()=>this.scheduleViewChange(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),updateLOD:()=>this.updateLOD(),cancelGlide:()=>this.cancelGlide()}}refitCurrentView(e=!1){if(e){this.settleView();return}if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return xc(this.stage)}setCameraPose(e){this.cancelGlide(),Lc(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.stepZoom(qt.ZOOM_STEP)}zoomOut(){this.stepZoom(1/qt.ZOOM_STEP)}stepZoom(e){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),Gi({stage:this.stage,reducedMotion:()=>this.reducedMotion,bounds:()=>this.zoomBounds(),apply:(i,n)=>this.zoomAbout(i,n)},e,zi(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX();return{x:e.x*i+this.stage.x(),y:e.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let n of this.sections)this.refreshSectionFill(n);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale()),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((n,o)=>n===e[o])}setCommercialLimitedFilter(e){this.commercialLimitedFilter!==e&&(this.commercialLimitedFilter=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setCategoryFilter(e){let i=e===null?null:new Set(e);gl(i,this.categoryFilter)||(this.categoryFilter=i,this.lodScale=0,this.updateLOD(),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}applyGAFilterState(){this.clusterLabels.applyFilterDim(),this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){Xc({gaById:this.gaById,bgLayer:this.bgLayer,exportMode:this.exportMode,pickerMode:!!this.opts.gaPickerMode,selectionColor:this.effSelection,labelFont:()=>this.labelFont(),filteredOut:e=>!!(this.categoryFilter&&!this.categoryFilter.has(e)),dimmed:e=>zc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Q,effScale:()=>this.effScale(),labelLegible:e=>be(e,this.effScale())})}setGAStates(e){Yc(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,i){this.setGAStates({[e]:i})}get focusFramingContext(){return{stage:this.stage,seats:this.seats,sections:this.sections,hasSections:this.hasSections,seatById:this.seatById,seatSection:this.seatSection,statusById:this.statusById,ownedHold:this.ownedHold,accessFilter:this.accessFilter,accessFreeBySection:this.accessFreeBySection,clusterLabels:this.clusterLabels,seatR:this.seatR,markerR:this.markerR,sellableUnit:this.sellableUnit,seatPitch:this.seatPitch,cameraGlideMs:this.cameraGlideMs,seatInClosedSection:e=>this.seatInClosedSection(e),isSectionClosed:e=>this.isSectionClosed(e),sectionMembers:e=>this.sectionMembers(e),sectionBounds:e=>this.sectionBounds(e),focusedRowLabelGutter:e=>this.focusedRowLabelGutter(e),seatLabelTargetScale:()=>this.seatLabelTargetScale(),zoomBounds:()=>this.zoomBounds(),rowBandDetailScale:()=>this.rowBandPreview?.active?this.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,n,o)=>this.narrowSeatDetailFocus(e,i,n,o),focusSection:(e,i)=>this.focusSection(e,i),markSectionFocus:(e,i)=>this.markSectionFocus(e,i),clearSectionFocus:()=>this.clearSectionFocus(),focusRegion:(e,i)=>this.focusRegion(e,i)}}focusCategories(e,i){Rd(this.focusFramingContext,e,i)}diveCeiling(){return yt(this.focusFramingContext)}focusAccessibleSeats(e){return Md(this.focusFramingContext,e)}focusAccessibleSection(e,i){return Ad(this.focusFramingContext,e,i)}accessibleSpread(e){return Fd(this.focusFramingContext,e)}setViewMode(e){xd(e),this.afterViewChange()}getViewMode(){return"flat"}effScale(){return this.stage.scaleX()}destroy(){this.movingLabelTimer&&(clearTimeout(this.movingLabelTimer),this.movingLabelTimer=null),this.rowBandPreview?.clear(),this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.rafId&&cancelAnimationFrame(this.rafId),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.gestureHits.destroy(),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let n=this.seatSection.get(e);return i*(n&&this.sectionMatchesFocus(n)?1:Te)}sectionScreenBounds(e){return Ga({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Q,i=[],n=96,o=this.stage.width(),r=this.stage.height();for(let s of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(s);a=c.x+c.width>=-n&&c.y+c.height>=-n&&c.x<=o+n&&c.y<=r+n}this.viewportSeats&&a&&(e||s.id===this.focusedSectionId||s.logicalId===this.focusedSectionId)&&i.push(s.id),s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0)}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let n of i.memberIds){let o=this.seatById.get(n);o&&e.push(o)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let n=this.seatById.get(i);n&&e.push(n)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let n=this.labelLiftGroups.get(i.id);return n||(n=new gt({listening:!1}),n.setViewportCulled(i.liftGroupSeat.isViewportCulled()),this.labelGroup.add(n),this.labelLiftGroups.set(i.id,n)),n}viewportPins(){return Za([this.focusRing.visible()?this.focusedId:null,this.hoveredId],this.ownedHold,this.selection)}queueViewportPinSync(){!this.viewportSeats||this.viewportPinSync||(this.viewportPinSync=!0,queueMicrotask(()=>{this.viewportPinSync=!1,this.viewportSeats?.sync(this.viewportWanted,this.viewportPins())}))}startViewportSeats(){let e=new Map;this.viewportWanted=["__loose"];for(let i of this.seats){let n=this.seatSection.get(i.id)?.id??"__loose",o=e.get(n);o||e.set(n,o=[]),o.push(i)}this.viewportSeats=new Mi(e,{build:i=>this.renderSeats(i),remove:i=>{for(let n of i)for(let o of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])o.get(n.id)?.destroy(),o.delete(n.id);this.glyphMarkers=this.glyphMarkers.filter(n=>!!n.getParent())},draw:()=>{this.updateLOD(),this.updateLabels(),this.seatLayer.batchDraw()},schedule:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i),now:()=>performance.now(),sectionOf:i=>this.seatById.has(i)?this.seatSection.get(i)?.id??"__loose":void 0})}renderSeats(e=this.seats){hl({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,n)=>this.buildAccessGlyph(i,n),paintSeat:(i,n)=>this.paintSeat(i,n),labelFont:()=>this.labelFont()}),this.selectionFollowUps.batch(()=>{for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)})}buildAccessGlyph(e,i){let n=this.seatR*1.5/ye,o=new bg({x:e.x,y:e.y,data:nt(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:ai(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Hc(o),o}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,n]of this.accessGlyphById){let o=this.seatR*1.5/ye,s=this.accessGlyphFilterEmphasized(i)?Ur:Yr,a=Math.max(o,s/(ye*Math.max(e,.001)));n.scale({x:a,y:a}),n.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),n=this.accessFilter;return!!i&&n!==null&&!!i.accessibility?.length&&Ie(i,n)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${Ue(i.min,this.currency)}\u2013${Ue(i.max,this.currency)}`;let n=this.catPrice.get(e);return typeof n=="number"?Ue(n,this.currency):null}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,n])=>[i,{min:n.min,max:n.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let n=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof n=="number"&&this.catPrice.set(i.key,n)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.categoryColours?this.colourOverride?.[e]?this.colourOverride[e]:this.colorblind?this.cbHueByKey.get(e)??wi[0]:this.catColor.get(e)??"#6e7bff":Ba}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Qe}seatLabelInk(e,i){let n=i.fill();return de(typeof n=="string"?n:"",e.labelStyle?.color,this.theme.seatLabelColor??Qe,ze)}get seatPaintContext(){return this.seatPaintCache||(this.seatPaintCache={organizer:()=>this.opts.manageMode===!0&&this.organizerStatus,organizerGlyph:this.opts.organizerGlyph,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",isSelected:e=>this.selection.has(e),isOwnedHold:e=>this.ownedHold.has(e),categoryColor:e=>this.categoryDisplayColor(e),boothLabel:e=>this.boothLabelById.get(e),boothExtent:e=>{let i=this.boothDims.get(e);return i?{...ft(i),...i.nameSize?{nameSize:i.nameSize}:{}}:void 0},seatLabel:e=>this.seatLabelById.get(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatMarks:this.seatMarks,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,colorblind:()=>this.colorblind,selectionColor:()=>this.effSelection,theme:()=>this.theme,effScale:()=>this.effScale(),seatInClosedSection:e=>this.seatInClosedSection(e),selectionFocusDims:e=>this.selectionFocusDims(e),accessFilter:()=>this.accessFilter,categoryHighlight:()=>this.categoryHighlight,seatHighlight:()=>this.seatHighlight,categoryFilter:()=>this.categoryFilter,commercialLimitedFilter:()=>this.commercialLimitedFilter,dimmedSections:()=>this.dimmedSections,closedSections:()=>this.closedSections,seatSection:e=>this.seatSection.get(e),accessGlyph:e=>this.accessGlyphById.get(e),accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),accessRing:e=>this.accessRingById.get(e),accessRingShouldShow:e=>this.accessRingShouldShow(e)}),this.seatPaintCache}paintSeat(e,i){ec(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}repaintSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){e!==this.colorblind&&(this.colorblind=e,this.recolourCategories())}setCategoryColourOverride(e){this.colourOverride=e,this.recolourCategories()}recolourCategories(){this.repaintSeats();for(let e of this.sections)e.shellCategoryColor=this.dominantSellableColor(e.memberIds),this.refreshSectionFill(e);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}setDimmedSections(e){let i=new Set(e??[]);i.size===this.dimmedSections.size&&[...i].every(n=>this.dimmedSections.has(n))||(this.dimmedSections=i,this.repaintSeats(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(n=>this.closedSections.has(n))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(n=>n.id===e||n.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return Io(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,n){if(this.rowBandPreview&&!this.exportMode){let o=this.sectionBounds(e);if(o){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(o,{animate:i,maxScale:r});return}}_d(this.focusFramingContext,e,i,n)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=U}setSectionFocusDim(e){let i=this.sectionDimEnabled();this.sectionFocusDim=e,i!==e&&(e||this.dropFocusDim())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=ae}atVenueFit(){return this.fitPose!==""&&qe(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active||this.viewportSeats&&this.seatLayer.opacity()===0?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=Ai(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(n=>n.id===e||n.logicalId===e);if(this.focusBackdrop=Wl(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Vl(this.focusBackdropHost,i);for(let n of this.selectionMarkers.values())n.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let n=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),o=2;return[{x:n.x-o,y:n.y-o},{x:n.x+n.width+o,y:n.y-o},{x:n.x+n.width+o,y:n.y+n.height+o},{x:n.x-o,y:n.y+n.height+o}]}):[]}}}repaintSectionsAndSeats(){this.repaintSeats();for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,n=-1/0,o=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>n&&(n=s),a>o&&(o=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,n-e),height:Math.max(1,o-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let n=this.isSectionClosed(i)||i.free<=0,o=i.memberIds.some(a=>this.selection.has(a)),r=o||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:o?"selected":n?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r,free:i.free,total:i.memberIds.length}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),n={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:n.x+this.stage.width()/2-i.x,y:n.y+this.stage.height()/2-i.y},n)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let n=this.stage.x(),o=this.stage.y(),r=this.constrainPan({x:n+e.x,y:o+e.y},{x:n,y:o}),s=r.x-n,a=r.y-o;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=u=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let h=Math.min(1,(u-l)/c),p=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:n+s*p,y:o+a*p}),this.scheduleViewChange(),this.stage.batchDraw(),h<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setSeatHighlight(e){Oa(this.readingAidsHost,e)}setLabelLayers(e){Da(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Na(this.readingAidsHost,e)}refreshBlockPaint(){this.repaintSectionsAndSeats(),this.updateLOD()}getCategoryColours(){return this.categoryColours}get readingAidsHost(){return{seatHighlight:()=>this.seatHighlight,setSeatHighlightState:e=>{this.seatHighlight=e},labelLayers:()=>this.labelLayers,setLabelLayersState:e=>{this.labelLayers=e},repaintSeats:()=>this.repaintSeats(),updateLabels:()=>this.updateLabels(),draw:()=>{this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()},categoryColours:()=>this.categoryColours,setCategoryColoursState:e=>{this.categoryColours=e},repaintSectionsAndSeats:()=>this.repaintSectionsAndSeats()}}setCategoryHighlight(e){this.categoryHighlight!==e&&(this.categoryHighlight=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}renderBackground(e){let i=xt(e);i&&this.renderBackgroundImage(i);for(let n of e.objects)n.type==="decorImage"&&this.renderDecorImage(n);for(let n of e.objects)n.type==="section"&&this.renderSection(n);for(let n of e.objects)n.type==="shape"?this.renderShape(n):n.type==="gaArea"?this.renderGA(n):n.type==="table"?this.renderTable(n):n.type==="text"&&this.renderText(n);this.renderZones(e)}trackAssetImage(e,i,n,o){this.assets.track(e,i,n,o,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){ad(this.objectDrawContext,e)}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,landmarkBoxes:this.landmarkBoxes,labelFont:()=>this.labelFont(),trackAssetImage:(e,i,n,o)=>this.trackAssetImage(e,i,n,o),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){ld(this.objectDrawContext,e)}renderTable(e){cd(this.objectDrawContext,e)}renderText(e){dd(this.objectDrawContext,e)}renderShape(e){hd(this.objectDrawContext,e)}renderGA(e){pd(this.objectDrawContext,e)}renderSection(e){let i=Id(this.sectionBuildContext,e);for(let n of i.memberIds)this.seatSection.set(n,i);this.unsectionedSeatIds=null,this.refreshSectionFill(i),this.refreshSectionHeat(i),this.sections.push(i)}get sectionBuildContext(){return{bgLayer:this.bgLayer,seatLayer:this.seatLayer,canvasBackground:this.canvasBackground,seats:this.seats,seatById:this.seatById,seatSection:this.seatSection,seatIndex:this.seatIndex,statusById:this.statusById,catColor:this.catColor,zoneColor:this.zoneColor,chartDoc:this.chartDoc,labelFont:()=>this.labelFont(),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){xl(this.sectionLodPaintContext,e)}refreshSectionFill(e){Tl(this.sectionLodPaintContext,e)}isSectionClosed(e){return lo(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=_s(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return Po(this.focusFramingContext,e)}accessibleSections(e){return Ro(this.focusFramingContext,e)}get sectionLodPaintContext(){let e=new Set([...this.selection,...this.ownedHold].map(i=>this.seatSection.get(i)));return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:i=>e.has(i),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:i=>this.sectionAccessibleFree(i),blockPaint:this.opts.blockPaint,selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,glideInProgress:this.glideInProgress,sectionsPinned:this.sectionRungPinned,reducedMotion:this.reducedMotion,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){this.opts.manageMode||Ua({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:!!this.chartDoc&&tt(this.chartDoc)==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX();return{x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i}}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),n=this.sections.find(o=>te(i,o.outline,o.holes));return n?n.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Hi(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let n of this.gaById.values())if(te(i,n.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||bo(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,ue,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(n=>n.id===e||n.logicalId===e||n.zone===e);return!i.length||this.opts.manageMode?!0:i.some(n=>!this.isSectionClosed(n)&&n.free>0?!0:n.memberIds.some(o=>this.selection.has(o)||this.ownedHold.has(o)))}sectionMembers(e){return[...new Set(this.sections.filter(i=>i.id===e||i.logicalId===e||i.zone===e).flatMap(i=>i.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)||!(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")?!1:!this.hiddenByAccessFilter(e)}hiddenByAccessFilter(e){if(!this.accessFilter||this.selection.has(e))return!1;let i=this.seatById.get(e);return i?Pe(i,this.accessFilter)==="other":!1}toggleSeat(e){if(this.ownedHold.has(e)){let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i);return}if(this.selection.has(e)){this.setSelected(e,!1),this.effScale()>ie&&this.updateLabels();let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i)}else{if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);return}this.setSelected(e,!0),this.playSeatPickMoment(e);let i=this.seatById.get(e);i&&this.opts.onSelect?.(i)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?bn(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let n=bn(getComputedStyle(i).backgroundColor);if(n)return n;i=i.parentElement}}return io}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:O(this.canvasBackground)?Ja:pt}setSelected(e,i,n=!1){let o=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());o&&(this.paintSeat(o,e),!n&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.queueViewportPinSync(),this.selectionFollowUps.request()}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){let i=this.sectionBoundsMemo;if(i.has(e))return i.get(e)??null;!i.size&&typeof queueMicrotask=="function"&&queueMicrotask(()=>i.clear());let n=this.measureSectionBounds(e);return typeof queueMicrotask=="function"&&i.set(e,n),n}measureSectionBounds(e){return Xa({sections:this.sections,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,n,o)=>this.resolveAutomaticRowLabelPosition(i,n,o),rowLabelBox:(i,n)=>this.rowLabelBox(i,n)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(mt(this.stage,i,this.zoomBounds(),Kt(this.framingViewport(),this.focusedRowLabelGutter(e))),Gt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return Nc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return pl(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return ul(this.screenPickingHost,e,i,{includeUnavailable:n})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,selection:this.selection,objectFloor:this.objectFloor,screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){sc(this.interactionHost)}handleSeatTap(e){ac(this.interactionHost,e)}get interactionHost(){return this.interactionHostCache??={stage:this.stage,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,hoverRing:this.hoverRing,clusterLabels:this.clusterLabels,container:this.container,attachHoverCard:()=>this.hoverCard.attach(),moved:()=>this.moved,isGhostClick:e=>this.isGhostClick(e),cached:()=>this.cached,reducedMotion:()=>this.reducedMotion,stacked:()=>this.stacked,floorOverview:()=>this.separatedFloorOverview,focusedSectionId:()=>this.focusedSectionId,sectionCount:()=>this.sections.length,selectionMarkers:()=>this.selectionMarkers,dismissFocusRing:()=>this.dismissFocusRing(),seat:e=>this.seatById.get(e),seatMark:e=>this.seatMarks.get(e),seatSection:e=>this.seatSection.get(e),objectFloor:e=>this.objectFloor.get(e),setHoveredId:e=>{this.hoveredId!==e&&(this.hoveredId=e,this.queueViewportPinSync())},seatsPickable:()=>this.seatsPickable(),manageSeatHits:()=>this.opts.manageMode===!0&&this.getRung()==="seats",handleSeatTap:e=>this.handleSeatTap(e),seatStatus:e=>this.statusById.get(e)??"free",hasSeatMark:e=>this.seatMarks.has(e),isOwnedHold:e=>this.ownedHold.has(e),isSelected:e=>this.selection.has(e),isSelectable:e=>this.isSelectable(e),hiddenByAccessFilter:e=>this.hiddenByAccessFilter(e),seatInClosedSection:e=>this.seatInClosedSection(e),toggleSeat:e=>this.toggleSeat(e),nudgeSeat:e=>this.moments.nudge(e),nearestSeatToScreen:(e,i,n)=>this.nearestSeatToScreen(e,i,n),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>$a({doc:this.chartDoc,zones:this.zones,sections:this.sections,enterFloor:i=>this.opts.onDeckTap?this.opts.onDeckTap(i):this.setActiveFloor(i),frame:i=>this.focusRegion(i)},e),sectionFrameScale:e=>this.sectionFrameScale(e),sectionTapAnchor:(e,i)=>this.sectionTapAnchor(e,i),rowLabelAt:e=>this.rowLabelAtScreen(e),selectRow:e=>{this.selectRow(e)},ownedBadgeAt:e=>this.owned.badgeAt(e),focusOwnedSeats:e=>this.focusOwnedSeatsIn(e),pressLandsOnChart:e=>this.pressLandsOnChart(e),tableAt:e=>bo(this.tableFootprints,this.seats,this.screenToWorld(e),this.effScale()),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,n)=>this.zoomAbout(e,i,n),panBy:(e,i)=>fc(this.cameraHost,e,i),zoomBounds:()=>this.zoomBounds(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):zi(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),n)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap??(this.opts.manageMode?()=>this.overview():void 0),onDeckTap:this.opts.onDeckTap}}zoomBounds(){return zt(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),pc(this.cameraHost,e,i,n)}cancelZoomSettle(){gc(this.cameraHost)}focusRegion(e,i){bc(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let n=performance.now();this.labelGroup.opacity(0);let o=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-n)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(o):0};this.labelFadeRaf=requestAnimationFrame(o)}cancelGlide(){Wt(this.stage),this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Q?"seats":this.sectionRungPinned?"sections":this.zones.length&&e<Ke?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),ed(this.renderedQualityContext)}setRung(e){let i=this.sectionRungPinned;if(this.sectionRungPinned=e==="sections",e==="zones")this.cancelGlide(),this.zoomToFit();else{let n=this.framingViewport(),o=$c({rung:e,bounds:this.bounds,sections:this.sections,seats:this.seats,focusedSectionId:this.focusedSectionId,viewCentre:zi(this.framingWorldRect()),width:n.width,height:n.height,seatScale:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),seatFloor:Math.min(this.rowBandPreview?this.rowBandPreview.detailScale*1.08:Q*1.1,this.zoomBounds().max)});this.focusRegion(o.bounds,o.minScale===void 0?void 0:{minScale:o.minScale})}(i||this.sectionRungPinned)&&this.updateLOD()}seatRungScale(){return Ac(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Kt(this.framingViewport(),o);return _c({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:n})}releaseFocusOnPullBack(){this.rowBandPreview&&this.focusedSectionId&&this.effScale()>=Math.min(Q,this.sectionFrameScale(this.focusedSectionId)*.85)||dc({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Q))return;let o=(i&&e?this.sectionAt(e):null)??Wa({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!o||o===this.focusedSectionId||(this.focusedSectionId=o,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(o))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ie||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},Jr))}sizeLabel(e,i,n){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(n)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),ve+.01,ie):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)ud(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(El(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Q,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Q),()=>this.sectionFrameScale(this.focusedSectionId),r=>{let s=r.outline.map(a=>this.worldToScreen(a));return Math.max(...s.map(a=>a.x))>=0&&Math.min(...s.map(a=>a.x))<=this.stage.width()&&Math.max(...s.map(a=>a.y))>=0&&Math.min(...s.map(a=>a.y))<=this.stage.height()},()=>this.zoomBounds().max),this.owned.sync(e,this.getRung()),this.syncBeacons()):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e);let n=this.seatGlyphDetail;if(this.seatGlyphDetail=Xs(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),n!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let r=this.seatLayer.opacity()>0;this.seatLayer.listening(r),!r&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let o=!this.exportMode&&!this.rowBandPreview?.active&&e<Q;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),o&&!this.cached&&this.seatLayer.opacity()===0){this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.seatLayer.listening(!1),this.hoveredId&&this.seatLayer.fire("mouseout");return}if(o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.viewportSeats||this.seatReveal||this.seatRevealPending||this.rowBandPreview?.active)return;if(this.seatLayer.opacity()===0){this.cached&&this.releaseSeatLayerBitmap(),this.cached=!1,this.seatLayer.listening(!1);return}this.updateSeatGroupVisibility();let e=q(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0,this.mountCachePending=!1}cacheSeatLayer(){this.destroyed||typeof document>"u"||(this.recacheTimer=null,this.rebuildSeatCache(),this.seatLayer.batchDraw())}releaseSeatLayerBitmap(){gd(ji,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.gestureHits.flush(),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Q?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),n=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:n,width:Math.max(1,o-i),height:Math.max(1,r-n)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),n=Math.max(12,Math.min(36,Math.min(e,i)*.025)),o=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-n*2),a=Math.max(1,i-n*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};o(),o()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(o){let r=o instanceof Error?o.message:String(o);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let n=i.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");n.fillStyle=this.canvasBackground,n.fillRect(0,0,i.width,i.height);try{n.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ie):this.effScale();for(let{node:i,backdrop:n,kind:o,showAt:r,area:s}of this.freeTextById.values()){if(o==="ga-label"||o==="ga-capacity"||s)continue;let a=o==="free-text"&&this.nodeBelongsToFocusedSection(i),l=o==="direct-landmark";if(l){let u=Number(i.getAttr("directLandmarkBaseFontSize"))||i.fontSize();i.setAttr("directLandmarkBaseFontSize",u),i.fontSize(Math.max(u,G/e))}let c=r==="detail"&&!this.exportMode&&e<Le,d=l||a||!c&&be(i.fontSize(),e);if(i.visible(d),n?.visible(d),!this.exportMode&&o==="free-text"){let u=Math.min(1,Ts/Math.max(i.fontSize()*e,1e-6));i.scale({x:u,y:u}),n?.scale({x:u,y:u})}}Pc({freeTextById:this.freeTextById,focalLabels:this.primaryFocalLabels.keys(),seatIndex:this.seatIndex,bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,scale:e});for(let{node:i,fontSize:n}of this.iconNodeById.values())i.visible(this.nodeBelongsToFocusedSection(i)||be(ko(i,n,e),e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let n=this.focusMembership.get(e);if(n!==void 0)return n;let o=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(o.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=o.some(l=>te(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.sectionBoundsMemo.clear(),this.rowLabelDwell.reset(),this.rowLabelPlan=fd(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,n=ee){return Co(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return md(e,i,n,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){al(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,labelLayers:()=>this.labelLayers,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),rowLabelDwell:this.rowLabelDwell,gesturing:()=>this.gestureHits.active,worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,n)=>this.resolveAutomaticRowLabelPosition(e,i,n),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Uc({width:this.container.clientWidth,height:this.container.clientHeight,stageWidth:this.stage.width(),stageHeight:this.stage.height()});if(e==="hidden"){this.hiddenPose??=this.getCameraPose();return}let i=this.hiddenPose;if(this.hiddenPose=null,e==="unchanged"){i&&this.setCameraPose(i);return}let n={width:this.stage.width(),height:this.stage.height()};this.stage.size(e),i&&this.setCameraPose(i);let r=!(this.fitPose===""||qe(this.stage)===this.fitPose)&&e.width===n.width;r&&this.stage.position({x:this.stage.x()+(e.width-n.width)/2,y:this.stage.y()+(e.height-n.height)/2}),this.refitCurrentView(r)}};qt.ZOOM_STEP=1.4;var Eo=qt;function Dd(t,e){return new Eo(t,e)}function Sg(t,e){return t*2*.6*e>=6}function vg(t,e){t._sceneFunc(e)}function Ao(t){let e=this,i=e.attrs;vg(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Sg(n,r))return;let s=n*.6;t.save(),t.setAttr("strokeStyle",i.organizerGlyphInk||"#000000"),t.setAttr("lineWidth",Math.max(n*.2,.75)),t.setAttr("lineCap","round"),t.setAttr("lineJoin","round"),t.beginPath(),i.organizerGlyph==="cross"?(t.moveTo(-s,-s),t.lineTo(s,s),t.moveTo(s,-s),t.lineTo(-s,s)):(t.moveTo(0,-s),t.lineTo(0,0),t.lineTo(s*.72,0)),t.stroke(),t.restore()}function Nd(t){return t.attrs.sceneFunc===Ao}function Hd(t){Nd(t)&&t.setAttr("sceneFunc",void 0)}function wg(t,e,i,n){if(!e){Hd(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==Ao&&t.setAttr("sceneFunc",Ao)}function Gd(t,e){t.accessFilter=e===null?null:[...e],t.renderer?.setAccessibilityFilter?.(e);let i=t.renderer?.getFocusedSection?.()??null;i&&t.emitSectionFocus(t.sectionSummary(i))}function Fo(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let n=e===void 0?t.accessFilter:e;if(!n)return!1;let o=Kd(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function Wd(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let n=e===void 0?t.accessFilter:e;return n?i.accessibleSpread(n):null}function Vd(t,e,i,n){let o=t.renderer;o&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&o.focusAccessibleSection?.(e,t.accessFilter)||(o.focusSection?o.focusSection(e,n?{anchor:n}:void 0):o.focusRegion?.(e)))}function zd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Kd(t,i);n&&t.setFloor(n);let o=t.renderer,r=o?.accessibleSections?.(i)??[];if(!r.length)return null;let s=t.accessStepAt?r.findIndex(l=>l.id===t.accessStepAt):-1,a=r[(s+1)%r.length];return t.accessStepAt=a.id,o?.focusAccessibleSection?.(a.id,i)||o?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function Kd(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=l=>n.size===0?!!l.accessible:!!l.accessibility?.some(c=>n.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(o)),s=t.getActiveFloorId(),a=i.floors.find(l=>l.id===s);return a&&r(a.objects)?null:i.floors.find(l=>r(l.objects))?.id??null}function Xd(t,e){return t.accessFilter?Pe(e,t.accessFilter)==="other":!1}function Yd(t,e){let i=t.renderer;if(!i)return;let n=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?n:null);let r=kg(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let o=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&Fo(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function kg(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=a=>a.some(l=>l.type==="row"&&(n.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&n.has(c.categoryKey)))||l.type==="gaArea"&&n.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&o(s.objects)?null:i.floors.find(a=>o(a.objects))?.id??null}function Ud(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(ti(t).map(h=>[h.id,h])),c=pr(t),d=it(t),u=di(t);for(let h of e){n.set(h.label,h.id),o.set(h.label,h),r.set(h.id,h),a.push(h.id);let p=l.get(h.rowId),m=p&&"label"in p&&typeof p.label=="string"?p.label:void 0,b=p?.type==="row"?p.segmentedRow:void 0,f=b?.displayLabel??(p&&"displayLabel"in p&&typeof p.displayLabel=="string"&&p.displayLabel?p.displayLabel:m),g=i.get(h.rowId),y=p?.type==="table"?"table":p?.type==="booth"?"booth":"seat",S=f,k=b?.displayType?.trim()||(p&&"displayType"in p&&typeof p.displayType=="string"&&p.displayType.trim()?p.displayType.trim():void 0),w=h.displayLabel??h.label,v=w.split("-"),x=g||h.kind==="booth"?void 0:f&&w.startsWith(`${f}-`)?w.slice(f.length+1):v[v.length-1]??w;s.set(h.id,{objectId:h.rowId,objectType:y,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:x,...k?{displayType:k,rowType:k}:{},...xg(p,h.sectionId?d.get(h.sectionId):void 0),...p?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function xg(t,e){if(t?.type!=="table"&&t?.type!=="booth")return{};let i=t.entrance?.trim()||e;return{...i?{entrance:i}:{},...t.type==="booth"&&t.boothType?{boothType:t.boothType}:{}}}function $d(t,e={}){let{baseMs:i=1e3,factor:n=2,maxMs:o=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*n**Math.max(0,t),o);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function qd(t,e,i,n=1){let o=fr(t),r=it(t);return Ct(t).map(s=>{let a=t.categories.find(d=>d.key===s.categoryKey),l=o.get(s.id),c=s.entrance?.trim()||(l?r.get(l):void 0);return{id:s.id,label:s.label,...s.displayLabel?{displayLabel:s.displayLabel}:{},...s.displayType?{displayType:s.displayType}:{},capacity:Math.max(0,Math.floor(s.capacity)),...Lg(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function Lg(t,e,i){let n=pn(t,i),o=fn(t,i),r=Lt(t),s=i===2&&n.length===1&&n[0]===t.label?hn(t):null;if(s){let{min:l,max:c}=un(t),d=e(t.label)==="free";return{available:d?c:0,bookingMode:s,minOccupancy:l,maxOccupancy:c,...r?{wheelchairPlaces:r,wheelchairAvailable:d?r:0}:{}}}let a=n.filter(l=>e(l)==="free");return{available:a.length,...r?{wheelchairPlaces:r,wheelchairAvailable:a.filter(l=>o.has(l)).length}:{}}}function Zd(t,e,i){let n=Math.floor(e),o=pn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?hn(t):null;if(r){let{min:d,max:u}=un(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!Lt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=fn(t,i.modelVersion),a=o.filter(d=>!i.alreadyHeld.has(d)&&i.statusOf(d)==="free"),c=(i.wheelchairOnly?a.filter(d=>s.has(d)):[...a.filter(d=>!s.has(d)),...a.filter(d=>s.has(d))]).slice(0,n);return c.length===n?c.map(d=>({label:d})):null}function Cg(t){return t.available<=0?0:t.bookingMode==="whole"||t.bookingMode==="variable"?t.wheelchairPlaces?t.wheelchairAvailable??t.wheelchairPlaces:0:Math.min(t.available,t.wheelchairAvailable??0)}function Qd(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?Cg(o):null;n[o.id]=e?{available:o.available,selected:e.get(o.id)??0,wheelchairFree:r}:{available:o.available,wheelchairFree:r}}return n}function jd(t){let e={};for(let[i,n]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[n.categoryKey]=(e[n.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(o=>t.closedMembers.has(o.id)))continue;let n=i.chairs[0];n&&(t.statusOf(n.id)??"free")==="free"&&(e[i.categoryKey]=(e[i.categoryKey]??0)+i.maxOccupancy)}for(let i of t.gaAreas??[])e[i.categoryKey]=(e[i.categoryKey]??0)+i.available;return e}function Tg(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function Jd(t,e,i=[]){let n=new Set,o=new Map;for(let r of i)n.add(r.need),o.set(r.need,(o.get(r.need)??0)+r.free);for(let r of t){let s=Tg(r);if(!s.length)continue;let a=e(r.id)==="free";for(let l of s)n.add(l),a&&o.set(l,(o.get(l)??0)+1)}return n.size?Xo.filter(r=>n.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var iT=5e3,nT={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Ig(t){if(!t.holdActive||t.holdLabels.length===0)return!1;let e=t.now??Date.now();return t.holdExpiresAt!=null&&e>=t.holdExpiresAt+5e3||t.serverHoldActive===!1?!0:!t.holdLabels.some(i=>t.statusOf(i)==="held")}function eh(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!Ig(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let n=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:n,recoverable:n.filter(o=>t.statusOf(o)==="free")}}function oT(t){return t.lost.length>0||t.holdLapsed}function rT(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function th(t,e,i=Date.now()){return e&&i<t+5e3}function ih(t){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&t()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function nh(t){if(!t?.zones?.length)return[];let e=new Set(mr(t).sections.filter(i=>i.seatCount>0&&!!i.zone).map(i=>i.zone));return t.zones.filter(i=>e.has(i.id)).map(i=>({id:i.id,label:i.label}))}function oh(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=He(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),o=new Set;for(let s of n)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Ie(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=Vr(n,o,{qty:t.qty,categoryKey:t.categoryKey,zoneId:t.zoneId,focal:i,preferPremium:!0});return r.labels.length!==t.qty?null:r.labels.every(s=>t.isPremium(s))?[...r.labels]:null}var _o=["background","rowLabelColor","textColor","selectionColor"];function rh(t,e){return!t||!e?!t&&!e:_o.every(i=>t[i]===e[i])}function St(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Ji(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function sh(t,e,i){let n=cr(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}var Ee=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function Bo(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function ah(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var en=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,i){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let n=this.ref;this.pending=e.eventConfiguration(i).then(o=>{if(o.reference.id!==n.id||o.reference.version!==n.version||o.configuration.id!==n.id||o.configuration.version!==n.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return o.configuration})}return this.pending}};async function lh(t,e,i){if(!t.renderer)return null;let o=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...o])];if(!s.length)return null;let a=t.ticketIssue(s);if(a)throw new Ee(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let u=r.find(m=>m.label===d);if(u&&(u.objectType==="ga"||u.quantity!=null||u.tierId!=null))return{label:d,tierId:u.tierId,...u.quantity!=null?{quantity:u.quantity}:{}};let h=t.labelToSeat.get(d),p=h?t.toSeat(h):null;return{label:d,...p?.tierId?{tierId:p.tierId}:{},...t.tableQuantityRequest(p)}}),c=await t.api.hold(t.key,l,i,t.hold_?.holdId);return t.setHold({holdId:c.holdId,labels:s,expiresAt:c.expiresAt,items:c.items}),t.hold_}catch(l){throw t.handle409Conflicts(l),l}}async function ch(t,e){if(t.closed||!e||!t.api.resume)return null;let i=await t.api.resume(t.key,e);if(t.closed)return null;let n=[...new Set(i.items.map(o=>o.label))];return n.length?(t.setHold({holdId:i.holdId,labels:n,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function dh(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let n=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:n.expiresAt,items:i.items}),t.hold_}catch{return null}}async function hh(t,e,i,n){let o=t.renderer;if(!o)return null;if(!t.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let r=i??t.getSelection().map(c=>c.label);if(!r.length)return null;let s=t.ticketIssue(r);if(s)throw new Ee(s);let a;try{if(t.hold_&&t.holdCovers(r))a=t.hold_.holdId;else{let c=t.hold_?.holdId,d=await t.api.hold(t.key,r.map(u=>{let h=t.labelToSeat.get(u),p=h?t.toSeat(h):null;return{label:u,...p?.tierId?{tierId:p.tierId}:{},...t.tableQuantityRequest(p)}}),n,c);a=d.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:d.expiresAt,items:d.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:u,reason:h}=St(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let p=new Set(u.map(f=>f.label)),m=t.idsForLabels(p);m.length&&(o.setStatus(m,"booked"),o.deselect(m),t.resetTableQuantitiesForLabels(p));let b=r.filter(f=>!p.has(f));b.length&&a&&t.api.release(t.key,b,a).catch(()=>{}),t.emitSelectionChange()}else a&&t.api.release(t.key,r,a).catch(()=>{});throw c}let l=t.idsForLabels(r);return l.length&&(o.setStatus(l,"booked"),o.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function uh(t){let e=t.hold_;if(!e)return!0;try{let n=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(n,e.labels))return await t.resnapshot(),!1}catch(n){return t.emitError(n),!1}if(t.hold_?.holdId!==e.holdId)return!0;t.clearHold(),t.resetTableQuantitiesForLabels(e.labels);let i=t.idsForLabels(e.labels);return i.length&&(t.renderer?.deselect(i),t.renderer?.setStatus(i,"free")),!0}async function ph(t,e){let i=t.hold_;if(!i)return!0;let n=e.filter(a=>i.labels.includes(a));if(!n.length)return!0;try{let a=await t.api.release(t.key,n,i.holdId);if(!t.releaseConfirmed(a,n))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let o=i.labels.filter(a=>!n.includes(a)),r=i.items?.filter(a=>!n.includes(a.label));o.length?t.setHold({...i,labels:o,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(n);let s=t.idsForLabels(n);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function fh(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function mh(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let n=new Map((i.items??[]).map(r=>[r.label,r.tierId])),o=new Map((i.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let s=t.labelToSeat.get(r),a=s?t.toSeat(s):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||t.confirmedVariableTables.has(r))&&(!o.has(r)||o.get(r)===a.quantity))&&(!n.has(r)||n.get(r)===l)})}function gh(t,e){let{status:i,conflicts:n}=St(e);if(i!==409||!n?.length)return;let o=t.renderer;if(!o)return;let r=t.idsForLabels(n.map(s=>s.label));r.length&&(o.deselect(r),o.setStatus(r,"held"),t.resetTableQuantitiesForLabels(n.map(s=>s.label))),t.emitSelectionChange()}function bh(t,e,i="created"){for(let r of e.items??[])t.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(t.tableQuantities.set(r.label,r.quantity),t.groupedTablesByLabel.get(r.label)?.mode==="variable"&&t.confirmedVariableTables.add(r.label));let n={...e,seats:t.seatsForLabels(e.labels)};t.hold_=n,t.renderer?.setOwnedHold?.(t.idsForLabels(n.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let o=Math.max(0,n.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},o),i==="restored"?t.opts.onHoldRestored?.(n):t.opts.onHold?.(n)}function yh(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function Sh(t){let e=t.hold_;if(e){try{let i=await t.api.objects(t.key);if(t.hold_?.holdId!==e.holdId)return;t.applySeatsMap(i.seats,i.default??"free")}catch{t.hold_?.holdId===e.holdId&&(t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},2e3));return}if(t.hold_?.holdId===e.holdId){if(th(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function vh(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function wh(t,e,i,n){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let o=[],r=0,s=!1,a=!1;for(let c of i??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");r=Math.max(r,Number(c.minimum))}else if(c?.type==="consecutiveSeats")s=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(r&&o.push({type:"minimumSelectedPlaces",minimum:r}),s&&o.push({type:"consecutiveSeats"}),a&&o.push({type:"noOrphanSeats"}),t!=null&&r>t)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??t??Math.max(n,r)));if(t!=null&&l<t)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<r)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:o,maxSelection:t??l}}function Rg(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Mg(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(o=>o.objectId!==e||o.categoryKey!==i))return!0;let n=t.map(o=>Rg(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function kh(t,e,i,n,o){let r=n.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,s=i??r,a=[];return i!=null&&e!==i&&a.push("numberOfPlacesToSelect"),r&&e<r&&a.push("minimumSelectedPlaces"),n.some(l=>l.type==="consecutiveSeats")&&Mg(t)&&a.push("consecutiveSeats"),n.some(l=>l.type==="noOrphanSeats")&&o()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function xh(t){let{id:e,doc:i,seatById:n,groupedTableBySeatId:o}=t,r=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,u=new Set,h=0,p=0;for(let v of l){let x=n.get(v);if(!x)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(x)&&(p+=1);let T=o.get(v);if(T){if(u.has(T.label))continue;u.add(T.label),c.set(T.categoryKey,(c.get(T.categoryKey)??0)+T.maxOccupancy),t.statusOf(T.chairs[0]?.id??v)==="free"&&(h+=T.maxOccupancy,d.set(T.categoryKey,(d.get(T.categoryKey)??0)+T.maxOccupancy))}else c.set(x.categoryKey,(c.get(x.categoryKey)??0)+1),t.statusOf(v)==="free"&&(h++,d.set(x.categoryKey,(d.get(x.categoryKey)??0)+1))}let m=[...c.entries()].map(([v,x])=>{let T=i.categories.find(R=>R.key===v),P=T?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],L=P.length?P:typeof T?.price=="number"&&Number.isFinite(T.price)?[T.price]:[],C=L.length?Math.min(...L):void 0,I=L.length?Math.max(...L):void 0;return{key:v,count:x,label:T?.label??v,color:T?.color??"#6e7bff",...C!==void 0?{price:C,priceMin:C,priceMax:I}:{}}}).sort((v,x)=>(v.priceMin??1/0)-(x.priceMin??1/0)||v.key.localeCompare(x.key)),b=m.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),f=m.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),g=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,y=v=>{let x=null,T=0;for(let[P,L]of v)(L>T||L===T&&x!=null&&P<x)&&(x=P,T=L);return x},S=y(d)??y(c),w=(S?m.find(v=>v.key===S)?.color:void 0)??g?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:p}:{},label:a.displayLabel??a.label,zoneLabel:g?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:w,seatsLeft:h,...b.length?{priceMin:Math.min(...b),priceMax:Math.max(...f)}:{},categories:m}}var tn=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,i=!1){if(!i){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let n=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===n&&(this.inFlight=null)});return this.inFlight=n,n}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function Lh(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function Ch(t,e){return t?.source==="socket"?t:e?{seats:e.seats,default:e.default,source:"http",...e.fetchedAt===void 0?{}:{fetchedAt:e.fetchedAt}}:t}var _g=!0,Bg=!0,Og=10,Dg=15e3,Th=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new en;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.inventoryModelVersion=1;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.connectFallback=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new tn;this.narrowLayout=!1;this.fitClearance=0;this.accessFilter=null;this.viewportInsets=null;this.accessStepAt=null;this.bandReturnPose=null;this.bandReturnSection=null;this.hintShown=!1;this.lastSnapshotAt=0;this.seatsBuilt=!1;this.pendingSnapshot=null;this.socketVersion=0;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=vh(e.numberOfPlacesToSelect);let i=wh(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Og);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(n=>typeof n=="string"&&!!n))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=gr(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let n of _o){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return rh(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),n=this.getActiveFloorId(),o=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),n?{floorId:n}:void 0),this.applyRowBandPreview(e),o&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(o=>typeof o=="string");if(i.length===this.hidden.size&&i.every(o=>this.hidden.has(o)))return!1;this.hidden=new Set(i);let n=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),n&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(n=>typeof n=="string");return i.length===this.closedSections.size&&i.every(n=>this.closedSections.has(n))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(o=>o.id);let n=this.labelToId.get(e);return n?[n]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let o=this.visibleDoc(),r=Ct(o).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let o=this.groupedTablesByLabel.get(e.label);return{...o?.displayLabel&&o.displayLabel!==o.label?{displayLabel:o.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}let i=this.labelToSeat.get(e.label),n=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),n={},o=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:o(r)}),C=>({ok:!1,error:C,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:o(a)}),()=>({ok:!1,elapsed:o(a)})),c=await s;if(n.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=ah(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let u=performance.now();try{this.inventoryModelVersion=d.event.inventoryModelVersion===2?2:1;let C=zr(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(C.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(C.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(C.flatMap(I=>I.chairs.map(R=>[R.id,I]))),this.tableQuantities=new Map(C.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=C.reduce((I,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(C){return this.emitError(C),null}this.expandedSeats=He(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=Ud(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=h.labelToId,this.labelToSeat=h.labelToSeat,this.seatById=h.seatById,this.seatContext=h.seatContext,this.allIds=h.allIds;for(let C of this.groupedTablesByLabel.values()){let I=C.chairs[0];I&&(this.labelToId.set(C.label,I.id),this.labelToSeat.set(C.label,I))}n.normalizeBuyerModel=o(u);let p=d.event.currency??this.opts.currency;this.currency=p??"USD";let m=performance.now(),b=Dd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:p,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(i),this.opts.onSeatsRevealed?.()},onSelect:C=>{this.handleRendererSelect(C)},onDeselect:C=>{this.handleRendererDeselect(C)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(C,I)=>{this.opts.onHover?.(C),this.opts.onSeatHover&&this.opts.onSeatHover(C?this.describeSeat(C,I):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(C,I)=>this.previewSection(C,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:C=>this.opts.onSectionFocus?.(C==null||this.isSectionClosed(C)?null:this.sectionSummary(C)),onDeckTap:C=>this.handleDeckTap(C),onFps:this.opts.onFps});if(n.createRenderer=o(m),this.closed)return b.destroy(),null;this.renderer=b,this.viewportInsets&&b.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&b.setFitClearance?.(this.fitClearance);let f=null,g="free",y=[],S,k=await l;if(k.ok){let C=k.objects;this.hidden=new Set(C.hidden??[]),y=(C.closed??[]).filter(I=>typeof I=="string"),f=C.seats,g=C.default??"free",S=typeof C.fetchedAt=="number"?C.fetchedAt:void 0}if(n.loadStatuses=k.elapsed,this.closed)return b.destroy(),this.renderer=null,null;let w=performance.now();this.opts.categoryPriceRanges&&b.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),b.setChart(this.visibleDoc()),this.applyRowBandPreview(b),sh(b,d.doc,e.clientWidth),this.opts.colorblindSafe&&b.setColorblindSafe?.(!0),n.buildScene=o(w),this.closedSections=new Set(y);let v=performance.now();y.length&&b.setClosedSections?.(y),this.seatsBuilt=!0;let x=this.pendingSnapshot;this.pendingSnapshot=null;let T=Ch(x,f?{seats:f,default:g,fetchedAt:S}:null);T&&this.applySeatsMap(T.seats,T.default,T.source,T.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(v);let P=performance.now();b.forceDraw(),n.firstPaint=o(P);let L=performance.now();return k.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(L),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Bo(d.event.status),eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:p,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:n}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let n of this.renderer.getSelection()){let o=this.groupedTableBySeatId.get(n.id);o?i.has(o.label)||(i.add(o.label),e.push(this.toTableSeat(o))):e.push(this.toSeat(n))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let n of e){let o=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(o)o.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(o.label)||(this.tableQuantities.set(o.label,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(o.label));else{let r=this.seatById.has(n)?n:this.labelToId.get(n);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),n=new Set,o=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?o.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&n.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?o.push(c.label):n.add(l)}}if(o.length&&this.emitError(new Ee(Ln(o))),!n.size)return[];if(this.renderer?.select?.([...n]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...n]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(s=>!i.has(s.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let i=new Set(e);return this.select([...this.seatById.values()].filter(n=>i.has(n.categoryKey)).map(n=>n.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(n=>i.has(n.categoryKey)).map(n=>n.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(n=>typeof n=="string"&&!!n))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(n=>!this.isSelectableByPolicy(n.id)).map(n=>n.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),n=e??i.reduce((o,r)=>o+(r.quantity??1),0);return kh(i,n,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(n=>n.id));return i.size>0&&xn(this.seatById.values(),n=>e.getStatus(n),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let n=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(n){n.chairs.forEach(r=>e.add(r.id));continue}let o=this.seatById.has(i)?i:this.labelToId.get(i);o&&e.add(o)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let n=this.groupedTablesByLabel.get(e);if(!n)return!1;let o=n.mode==="whole"?n.capacity:Math.floor(i);if(!Number.isInteger(o)||o<n.minOccupancy||o>n.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??n.minOccupancy;return this.tableQuantities.set(e,o),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(n.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,n){let o=this.groupedTablesByLabel.get(e),r=this.hold_;if(!o||o.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.maxOccupancy)return null;if((r.items??[]).filter(d=>d.label!==e).reduce((d,u)=>d+(u.quantity??1),0)+s>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?s:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,n,r.holdId);return this.tableQuantities.set(e,s),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}setNarrowLayout(e){this.narrowLayout!==e&&(this.narrowLayout=e,this.renderer&&this.applyRowBandPreview(this.renderer))}rowBandsWanted(){return _g&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(Bg||!this.narrowLayout)}applyRowBandPreview(e){if(!this.opts.sectionPreview)return;let i=this.rowBandsWanted();e.setRowBandPreview?.(i),i&&e.setSectionFocusDim?.(!1)}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,i)=>e+(i.quantity??1),0)}handleRendererSelect(e){let i=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(i?i.chairs.map(o=>o.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(o=>o.id):[e.id]),this.emitError(new Ee(Ln([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(o=>o.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(o=>o.id)),this.opts.onSelect?.(i.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(i)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let i=this.groupedTableBySeatId.get(e.id),n=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(n)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(n)){this.opts.onDeselect?.(i?{...e,label:n}:e);return}i?(this.renderer?.deselect(i.chairs.map(o=>o.id)),this.hold_?.labels.includes(i.label)||(this.tableQuantities.set(i.label,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(i.label)),this.opts.onDeselect?.(i.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let i of e){let n=this.groupedTablesByLabel.get(i);n&&(this.tableQuantities.set(i,n.mode==="whole"?n.capacity:n.minOccupancy),n.mode==="variable"&&this.confirmedVariableTables.delete(i))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}hold(e,i){return lh(this,e,i)}resumeHold(e){return ch(this,e)}extendHold(e){return dh(this,e)}categoryAvailability(){return jd({seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,groupedTablesByLabel:this.groupedTablesByLabel,closedMembers:this.closedMemberIds(),statusOf:e=>this.getStatus(e),gaAreas:this.getGAAreas()})}closedMemberIds(){let e=new Set,i=this.renderer;if(!i||!this.closedSections.size)return e;for(let n of this.closedSections)for(let o of i.sectionMembers?.(n)??[])e.add(o);return e}getGAAreas(){let e=this.visibleDoc();return e?qd(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Qd(this.getGAAreas(),this.gaSelected,{wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0}))}async holdGA(e,i,n={}){let o=this.visibleDoc();if(!o||!Number.isFinite(i)||i<1)return null;let r=Ct(o).find(d=>d.id===e);if(!r)return null;let s=Zd(r,i,{modelVersion:this.inventoryModelVersion,statusOf:d=>this.statusOf(d),alreadyHeld:new Set(this.hold_?.labels??[]),wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0});if(!s)return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of s)a.set(d.label,{...d,...n.tierId?{tierId:n.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,n.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return nh(this.visibleDoc())}pickPremiumBlock(e,i,n){return oh({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:n,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:o=>this.seatTierResolution(o).kind!=="invalid",statusOfLabel:o=>this.getStatus(this.labelToId.get(o)??"")??"free",isPremium:o=>!!this.labelToSeat.get(o)?.commercial?.premium})}async bestAvailable(e,i,n={}){let o=this.renderer;if(!o)return null;if(n.preferPremium){let r=this.pickPremiumBlock(e,i,n.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let s=r.map(d=>{let u=this.labelToSeat.get(d),h=u?this.toSeat(u):null;return{label:d,...h?.tierId?{tierId:h.tierId}:{}}}),a=await this.api.hold(this.key,s,n.ttlMs);o.clearSelection();let l=this.idsForLabels(r);l.length&&o.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...r],expiresAt:a.expiresAt,items:a.items});let c=r.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(s){let{status:a,reason:l}=St(s);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),s}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,i,n.zoneId,n.ttlMs);o.clearSelection();let s=this.idsForLabels(r.labels);s.length&&o.setStatus(s,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let a=r.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(r){let{status:s,reason:a}=St(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return hh(this,e,i,n)}release(){return uh(this)}releaseLabels(e){return ph(this,e)}releaseConfirmed(e,i){return fh(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(o=>o.notForSale).map(o=>o.key));if(!i.size)return[];let n=[];for(let[o,r]of this.seatById)i.has(r.categoryKey)&&n.push(o);return n}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return hi(this._doc?.theme?.seatScale)*J*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){Gd(this.pickerFocusContext,e),this.pushGAState()}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}get pickerFocusContext(){let e=this;return{renderer:e.renderer,doc:e._doc,get accessFilter(){return e.accessFilter},set accessFilter(i){e.accessFilter=i},get accessStepAt(){return e.accessStepAt},set accessStepAt(i){e.accessStepAt=i},get bandReturnPose(){return e.bandReturnPose},set bandReturnPose(i){e.bandReturnPose=i},get bandReturnSection(){return e.bandReturnSection},set bandReturnSection(i){e.bandReturnSection=i},getActiveFloorId:()=>e.getActiveFloorId(),setFloor:i=>e.setFloor(i),sectionSummary:i=>e.sectionSummary(i),emitSectionFocus:i=>{e.opts.onSectionFocus?.(i)}}}focusAccessibilityFilter(e){return Fo(this.pickerFocusContext,e)}accessibilitySpread(e){return Wd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return zd(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Xd(this.pickerFocusContext,e)}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let i=this.renderer;!i?.setActiveFloor||e===i.getActiveFloorId?.()&&!i.isFloorOverview?.()||(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let i=this.renderer;!i?.setStacked||e===i.isStacked?.()||(i.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let i=this.renderer;!i?.setFloorOverview||e===i.isFloorOverview?.()||(i.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let i=this.renderer;i&&(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor?.(e),this.resnapshot(),this.emitSelectionChange(),this.opts.onDeckTap?.(e))}setViewMode(e){this.renderer?.setViewMode?.(e)}getViewMode(){return this.renderer?.getViewMode?.()??"flat"}getRung(){return this.renderer?.getRung?.()??"seats"}getFocusedSection(){return this.renderer?.getFocusedSection?.()??null}seatsRevealed(){let e=this.renderer;return e?.seatsRevealed?e.seatsRevealed():this.getRung()==="seats"||!!this.getFocusedSection()}atVenueFit(){return this.renderer?.atVenueFit?.()}canZoomIn(){return this.renderer?.canZoomIn?.()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){Yd(this.pickerFocusContext,e)}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,i){this.handleSectionTap(e,i)}focusSeats(e,i){let n=this.renderer;if(!n?.focusSeats?.(e,i))return!1;let o=n.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(o?this.sectionSummary(o):null),!0}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}previewSection(e,i){this.handleSectionTap(e,i)}handleSectionTap(e,i){if(!this.renderer)return;let n=this.isSectionClosed(e)?null:this.sectionSummary(e);Vd(this.pickerFocusContext,e,n,i),this.opts.onSectionFocus?.(n)}sectionSummary(e){return!this.renderer||!this._doc?null:xh({id:e,doc:this._doc,sectionMembers:i=>this.renderer?.sectionMembers?.(i)??[],statusOf:i=>this.renderer?.getStatus(i)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:i=>Ie(i,this.accessFilter)}:{}})}clearConnectFallback(){this.connectFallback&&(clearTimeout(this.connectFallback),this.connectFallback=null)}destroy(){if(this.closed=!0,this.seatsBuilt=!1,this.pendingSnapshot=null,this.clearConnectFallback(),this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let i=this.groupedTableBySeatId.get(e.id);if(i)return this.toTableSeat(i);let n=e.commercial?{commercial:e.commercial}:void 0,o=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,s=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...n,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...n,...r,...s}}toTableSeat(e){let i=e.chairs[0],n=this.tiersFor(e.categoryKey)?.filter(s=>fi(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),o=this.tableTierResolution(e),r=o.kind==="resolved"?o.tier:void 0;return{id:i?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:i?this.seatContext.get(i.id)?.sectionLabel:void 0,...i&&this.seatContext.get(i.id)?.entrance?{entrance:this.seatContext.get(i.id).entrance}:{},rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...n?{tiers:n,tierId:r?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(s=>s.id)}}describeSeat(e,i){let n=this._doc?.categories.find(o=>o.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:n?.label??e.categoryKey,categoryColor:n?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...i?.interaction?{interaction:i.interaction}:{},...i?.unavailable?{unavailable:!0}:{},...i?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(i=>i.key===e)?.price??0}tiersFor(e){let i=this._doc?.categories.find(n=>n.key===e)?.tiers;return i&&i.length?i:void 0}tiersForSeat(e){if(!this._doc)return;let i=Gr(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?fi(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(i=>i.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let i=e.chairs[0]?.id??"";return fi(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let n=this.seatById.get(e);if(!n)return;let o=this.tiersForSeat(n);if(o){if(i==null)this.seatTiers.delete(e);else if(o.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let n of e){let o=this.labelToSeat.get(n);o&&i.push(this.toSeat(o))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return Wr(this._doc,i.map(n=>({label:n.label,...n.tierId?{tierId:n.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?F("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let n=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),o=new Set(e.getSelection().map(s=>s.id));(n&&o.size?xn(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(F("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return mh(this,e)}handle409Conflicts(e){gh(this,e)}setHold(e,i="created"){bh(this,e,i)}clearHold(){yh(this)}expireActiveHold(){return Sh(this)}applySeatsMap(e,i="free",n="http",o){n==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Lh(this.pendingSnapshot,{seats:e,default:i,source:n,...o===void 0?{}:{fetchedAt:o}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=o??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=Ji(i);this.allIds.length&&r.setStatus(this.allIds,a),r.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let l={free:[],held:[],booked:[],not_for_sale:[]};for(let[d,u]of Object.entries(e))l[Ji(u)].push(...this.idsForLabel(d));["free","held","booked","not_for_sale"].forEach(d=>{d!==a&&l[d].length&&r.setStatus(l[d],d)});let c=this.notForSaleCategorySeatIds();c.length&&r.setStatus(c,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:s})}snapshotIsFresh(e=5e3){return this.lastSnapshotAt>0&&Date.now()-this.lastSnapshotAt<e}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(i=>this.statusOf(i)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let i=this.socketVersion,n=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(n.seats,n.default??"free","http",n.fetchedAt)},e)}resync(e){return e?.reason==="connect"&&this.snapshotIsFresh()?Promise.resolve():this.resnapshot()}applyProjection(e){this.applySeatsMap(e.exceptions,e.default,"socket")}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,i=eh({selection:this.getSelection().map(n=>n.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:n=>this.statusOf(n)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let n=this.idsForLabels(i.lapsedLabels);n.length&&this.renderer?.deselect(n),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return Jd(this.seatById.values(),e=>this.getStatus(e)??"free",this.getGAAreas().filter(e=>e.wheelchairPlaces).map(e=>({need:"wheelchair",free:e.wheelchairAvailable??0})))}attachVisibility(){this.detachVisibility||(this.detachVisibility=ih(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applyProjection(e),resync:e=>this.resync(e),onSections:(e,i)=>{let n=this.syncHidden(e),o=this.syncClosed(i);n&&this.resnapshot(),(n||o)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let n=Object.entries(e);if(n.length!==this.liveStatuses.size)return!0;for(let[o,r]of n)if(this.liveStatuses.get(o)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let n=e.some(s=>this.liveStatuses.get(s.label)!==s.status),o=new Map;for(let s of e){this.liveStatuses.set(s.label,s.status);let a=this.idsForLabel(s.label);if(!a.length)continue;let l=Ji(s.status);this.opts.flashOnLiveChange&&l!=="free"&&a.some(c=>(o.get(c)??i.getStatus(c))==="free")&&!this.hold_?.labels.includes(s.label)&&a.forEach(c=>i.flashSeat(c,l==="held"?"#f4b740":"#f43f5e"));for(let c of a)o.set(c,l)}let r=new Map;for(let[s,a]of o){let l=r.get(a);l||r.set(a,l=[]),l.push(s)}for(let[s,a]of r)i.setStatus(a,s);this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&i.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:n})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let n=null;try{n=this.api.createRealtime(this.key,this.realtimeSink())}catch{n=null}if(n){this.realtime=n,n.start();return}}if(this.realtime)return;let i;try{let n=this.api.socketProtocols?.(this.key);i=n&&n.length?new WebSocket(e,n):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=i,i.onopen=()=>{if(this.attempt=0,!this.snapshotIsFresh()){this.resnapshot();return}this.clearConnectFallback(),this.connectFallback=setTimeout(()=>{this.connectFallback=null,this.resnapshot()},2500)},i.onmessage=n=>{this.clearConnectFallback();let o;try{o=JSON.parse(typeof n.data=="string"?n.data:"")}catch{return}if(!this.renderer||!o||typeof o!="object")return;let s=o;Array.isArray(s.hidden)&&this.syncHidden(s.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(s.closed)&&this.syncClosed(s.closed)&&this.opts.onStatusChange?.({changed:!0}),s.type!=="hidden"&&(s.seats&&typeof s.seats=="object"?this.applySeatsMap(s.seats):Array.isArray(s.changes)&&this.applyStatusChanges(s.changes))},i.onclose=()=>{this.ws===i&&(this.ws=null),this.scheduleReconnect()},i.onerror=()=>{try{i.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),i=$d(e,{baseMs:1e3,maxMs:Dg,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var Ng=5,Hg=-1.1,Oo=35;function Do(t,e){let i=t-Ae,n=Math.atan2(Ng-i,e)*180/Math.PI,o=Math.atan2(Hg-i,e)*180/Math.PI;return o<-Oo&&(n+=-Oo-o,o=-Oo),{topPitch:n,basePitch:o}}var ne=2048,ke=1024,Qt=Qo,B=Math.PI*2,Gg=ke/180,wt=t=>(t+180)/360*ne,Z=t=>(90-t)/180*ke;function Eh(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return e>>>0}function Ah(t){let e=t>>>0;return()=>{e|=0,e=e+1831565813|0;let i=Math.imul(e^e>>>15,1|e);return i=i+Math.imul(i^i>>>7,61|i)^i,((i^i>>>14)>>>0)/4294967296}}var nn=96,Go=360/nn,Wg=.6,No=[17,23,42];function Ho(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(No[0]-t[0])*n),r=Math.round(t[1]+(No[1]-t[1])*n),s=Math.round(t[2]+(No[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function Ih(t,e,i){return[Math.round(t[0]+(e[0]-t[0])*i),Math.round(t[1]+(e[1]-t[1])*i),Math.round(t[2]+(e[2]-t[2])*i)]}function ce(t,e,i){let n=(1-Math.abs(2*i-1))*e,o=(t%360+360)%360/60,r=n*(1-Math.abs(o%2-1)),s=0,a=0,l=0;o<1?[s,a,l]=[n,r,0]:o<2?[s,a,l]=[r,n,0]:o<3?[s,a,l]=[0,n,r]:o<4?[s,a,l]=[0,r,n]:o<5?[s,a,l]=[r,0,n]:[s,a,l]=[n,0,r];let c=i-n/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var Ph=new Map;function Rh(t){if(!t)return null;let e=Ph.get(t);if(e)return e;let i=2166136261;for(let r=0;r<t.length;r++)i^=t.charCodeAt(r),i=Math.imul(i,16777619);let n=(i>>>0)%360,o=ce(n,.3,.42);return Ph.set(t,o),o}function Vg(t,e,i,n){let o=new Array(nn).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,u=Math.hypot(c,d)*Qt;if(u<1.5||u>95)continue;let h=a.eyeHeightM??Ae,p=h-n;Math.abs(p)>r&&(r=Math.abs(p));let m=Math.atan2(p,u)*180/Math.PI,b=Math.atan2(h-Ae-n,u)*180/Math.PI,g=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,y=Math.min(nn-1,Math.max(0,Math.floor((g+180)/Go))),S=m>34&&u<16,k=o[y];k?(m>k.top&&(k.top=m),b<k.base&&(k.base=b),u<k.nearM&&(k.nearM=u,k.tint=Rh(a.categoryKey)),k.overhead=k.overhead||S):o[y]={top:m,base:b,nearM:u,overhead:S,tint:Rh(a.categoryKey)}}return{bins:o,maxDelta:r}}function zg(t,e,i,n){for(let o=0;o<nn;o++){let r=e[o];if(!r)continue;let s=-180+o*Go,a=i(s),l=i(s+Go);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),u=n(c),h=n(d);if(h<=u)continue;let p=r.nearM/95,m=r.tint,b=m?Ih([44,54,80],m,.34):[44,54,80],f=m?Ih([24,30,48],m,.28):[24,30,48],g=t.createLinearGradient(0,u,0,h);g.addColorStop(0,Ho(b,p)),g.addColorStop(.24,Ho(f,p)),g.addColorStop(1,Ho([10,13,22],p)),t.fillStyle=g,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-p*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,n(0))-u;if(S>8){let w=1-p*.4;for(let v=1;v<6;v++){let x=u+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*w})`,t.fillRect(a,x,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*w})`,t.fillRect(a,x+1.5,l-a+1,1.2)}}if(r.overhead){let k=n(Math.min(86,c+12)),w=t.createLinearGradient(0,k,0,u);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=w,t.fillRect(a,k,l-a+1,u-k),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function Kg(t,e,i){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let g of i){a++,g.sectionId&&s.add(g.sectionId);let y=g.x-e.x,S=g.y-e.y,k=Math.hypot(y,S)*Qt;if(k<.5)continue;let w=Math.atan2(y,-S),v=Math.floor((w+Math.PI)/B*72);v<0?v=0:v>=72&&(v=71),o[v]=!0,k<r[v]&&(r[v]=k)}let l=0,c=[];for(let g=0;g<72;g++)o[g]&&(l++,c.push(r[g]));let d=l/72*360;c.sort((g,y)=>g-y);let u=c.length?c[c.length>>1]:0,h=c.length?c[Math.floor(c.length*.15)]??u:0,p=c.length?c[Math.floor(c.length*.85)]??u:0,m=h>.5?p/h:1,b=Eh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),f;return d>=300&&u>11&&m>1.35?f="sport":d>=285?f="arena":f="proscenium",{mode:f,seed:b,voidRadiusM:u,aspect:m}}var Xg=5;function Yg(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,B),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,B),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,B),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,B),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,B),t.fill();break;default:break}}function Ug(t,e,i,n,o){let r=n*.44,s=n*o.shoulderK,a=n*.66,l=n*1.68,c=n*5.4,d=`rgba(${o.clothing[0]},${o.clothing[1]},${o.clothing[2]},${o.alpha})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;t.save(),t.translate(e,i);let h=o.lean*n;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-h-n*.6,-s,l-h),t.quadraticCurveTo(-s*1.05,l+n*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+n*1.2,s,l+h),t.quadraticCurveTo(r*1.18,l+h-n*.6,r,a),t.closePath(),t.fill(),t.fillStyle=u,t.fillRect(-r*.82,n*.5,r*1.64,n*.9),t.save(),t.rotate(o.tilt),t.translate(o.turn*n,0),t.fillStyle=u,n>=18?(t.beginPath(),t.moveTo(-n*.9,-n*.15),t.quadraticCurveTo(-n*.96,-n*1.12,0,-n*1.06),t.quadraticCurveTo(n*.96,-n*1.12,n*.9,-n*.15),t.quadraticCurveTo(n*.86,n*.55,n*.36,n*.98),t.quadraticCurveTo(0,n*1.14,-n*.36,n*.98),t.quadraticCurveTo(-n*.86,n*.55,-n*.9,-n*.15),t.closePath(),t.fill(),n>=22&&(t.beginPath(),t.ellipse(-n*.9,n*.18,n*.13,n*.22,0,0,B),t.ellipse(n*.9,n*.18,n*.13,n*.22,0,0,B),t.fill())):(t.beginPath(),t.ellipse(0,0,n*.9,n*1.06,0,0,B),t.fill()),Yg(t,n,o.hair),o.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.14),t.beginPath(),t.ellipse(0,-n*.06,n*.86,n*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),o.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.12),t.beginPath(),t.moveTo(-s*.8,l-n*.05),t.quadraticCurveTo(-r,l-n*.75,0,l-n*.82),t.quadraticCurveTo(r,l-n*.75,s*.8,l-n*.05),t.stroke()),t.restore()}function $g(t,e,i,n,o,r,s){t.fillStyle=`rgba(${o[0]},${o[1]},${o[2]},${s})`,t.beginPath(),t.moveTo(e-n*1.72,i+n*4),t.quadraticCurveTo(e-n*1.78,i+n*1.55,e-n*.46,i+n*1.02),t.lineTo(e-n*.4,i+n*.62),t.lineTo(e+n*.4,i+n*.62),t.lineTo(e+n*.46,i+n*1.02),t.quadraticCurveTo(e+n*1.78,i+n*1.55,e+n*1.72,i+n*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,n*.9,n*1.05,0,0,B),t.fill()}function Vo(t,e,i,n,o){let r=n*.1,s=i-n*.9,a=i-n*.74,l=i-n*.46,c=n*.13,d=n*.09,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,h=t.createRadialGradient(e,i,1,e,i,n*.24);h.addColorStop(0,"rgba(0,0,0,0.4)"),h.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=h,t.beginPath(),t.ellipse(e,i/.28,n*.24,n*.24,0,0,B),t.fill(),t.restore(),t.fillStyle=u,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+n*.02),t.lineTo(e+d*.1,l+n*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-n*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-n*.12,e+c,a),t.quadraticCurveTo(e,a-n*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=n*.055;let p=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,p),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,p),t.lineTo(e-d*.4,l-n*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-n*.04,n*.07,n*.09,-.5,0,B),t.fill()):o.pose===3?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,p),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=n*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-n*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,p),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,p),t.lineTo(e+c*.95,l+n*.02),t.stroke()),t.fillStyle=u,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,B),t.fill(),o.rimStrength>.01&&(t.strokeStyle=`rgba(${o.rim[0]},${o.rim[1]},${o.rim[2]},${(.6*o.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,n*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function on(t,e,i,n,o,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,o);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-r,i),t.lineTo(n-s,o),t.lineTo(n+s,o),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function zo(t,e,i,n,o){let r=t.createRadialGradient(e,i,0,e,i,n*3);r.addColorStop(0,`rgba(${o},0.9)`),r.addColorStop(.4,`rgba(${o},0.35)`),r.addColorStop(1,`rgba(${o},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,n*3,0,B),t.fill(),t.fillStyle=`rgba(${o},1)`,t.beginPath(),t.arc(e,i,n,0,B),t.fill()}function iI(t,e,i){let n=document.createElement("canvas");n.width=ne,n.height=ke;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.hypot(r,s),l=Math.max(2,a*Qt),c=t.eyeHeightM??Ae,d=Kg(t,e,i),u=Ah(d.seed),h=210+u()*150,p=ce(220+(u()-.5)*60,.55,.82),m=`${p[0]},${p[1]},${p[2]}`,b=o.createLinearGradient(0,0,0,ke);b.addColorStop(0,"#080b12"),b.addColorStop(.42,"#12182c"),b.addColorStop(.5,"#1c2440"),b.addColorStop(.56,"#151b2c"),b.addColorStop(.78,"#171e30"),b.addColorStop(1,"#131829"),o.fillStyle=b,o.fillRect(0,0,ne,ke);let f=o.createLinearGradient(0,Z(-6),0,ke);f.addColorStop(0,"rgba(30, 37, 56, 0)"),f.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),f.addColorStop(1,"rgba(22, 28, 44, 0.12)"),o.fillStyle=f,o.fillRect(0,Z(-6),ne,ke-Z(-6));let g=Math.atan2(r,-s),y=Vg(t,i,g,c),S=y.maxDelta>=Wg;S&&zg(o,y.bins,wt,Z);let k=Math.max(.3,Math.min(1,1-(l-6)/60)),w=Do(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),x=Math.min(45,w.topPitch),T=w.basePitch;d.mode==="sport"?Qg(o,l,c,d,k,h,m,u):d.mode==="arena"?Zg(o,l,c,d,k,m,u):qg(o,v,x,T,k,h,m,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${m},0.8)`;for(let C=0;C<P;C++){let I=(C+.5)/P*ne,R=Z(d.mode==="sport"?58:54+C*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,B),o.fill()}jg(o,t,i,e,g,c,r,s,S,d);let L=o.createLinearGradient(0,0,0,ke);return L.addColorStop(0,"rgba(0,0,0,0.85)"),L.addColorStop(.12,"rgba(0,0,0,0)"),L.addColorStop(.9,"rgba(0,0,0,0)"),L.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=L,o.fillRect(0,0,ne,ke),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function qg(t,e,i,n,o,r,s,a){let l=wt(-e),c=wt(e),d=Z(i),u=Z(n),h=c-l,p=u-d,m=Z(Math.min(50,i+10)),b=h*(1.1+(1-o)*.5),f=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,b);f.addColorStop(0,"rgba(255, 214, 150, 0.34)"),f.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),f.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),f.addColorStop(1,"rgba(99, 102, 241, 0)"),t.fillStyle=f,t.fillRect(l-h*.6,d-p*1.2,h*2.2,p*3.4);let g=ce(r,.62,.55),y=ce(r+40,.7,.5),S=ce(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,h,p),t.clip();let k=t.createLinearGradient(0,d,0,u);k.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),k.addColorStop(.5,`rgb(${y[0]},${y[1]},${y[2]})`),k.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=k,t.fillRect(l,d,h,p),t.globalAlpha=1;let w=t.createRadialGradient(ne/2,(d+u)/2,h*.12,ne/2,(d+u)/2,h*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=w,t.fillRect(l,d,h,p),t.restore();let v=3+Math.floor(a()*3),x=p*.46,T=u-p*.08;for(let E=0;E<v;E++){let W=(E+1)/(v+1),N=l+h*(.22+W*.56+(a()-.5)*.06);Vo(t,N,T,x*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ce(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-h*.5,m,h*.5,u-m),t.fillRect(c,m,h*.5,u-m);let P=h*.055+3,L=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,u),t.lineTo(l-L,m),t.lineTo(l+h*.012,m),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+P,u),t.lineTo(c+L,m),t.lineTo(c-h*.012,m),t.closePath(),t.fill(),t.fillRect(l-L,m,h+L*2,(u-m)*.12);let C=p*.14,I=m+(u-m)*.12;t.fillStyle="rgba(4,6,12,0.96)";let R=7;t.beginPath(),t.moveTo(l-L,I);for(let E=0;E<=R;E++){let W=l-L+(h+L*2)*E/R;t.quadraticCurveTo(W-(h+L*2)/R/2,I+C,W,I)}t.lineTo(c+L,I),t.lineTo(c+L,m),t.lineTo(l-L,m),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,I,1.5,u-I),t.fillRect(c,I,1.5,u-I),t.fillStyle="#0b0f18",t.fillRect(l-P,u-p*.05,h+P*2,p*.05+3);let M=t.createLinearGradient(0,u-p*.05,0,u+p*.12);M.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),M.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=M,t.fillRect(l-P,u-p*.05,h+P*2,p*.2);let A=3+Math.floor(a()*2);for(let E=0;E<A;E++){let W=(E+1)/(A+1),N=l+h*(W+(a()-.5)*.08),Y=Z(Math.min(62,i+26)),re=(a()-.5)*h*.16;on(t,N,Y,N+re,u,4,h*.09,s,.16*(.7+o*.5)),zo(t,N,Y,2.4,s)}}function Zg(t,e,i,n,o,r,s){let a=Math.min(e*.6,Math.max(3,n.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=ne/2,d=1.2,u=Math.max(e*.45,e-a),h=e+a,p=Math.atan2(d-i,u)*180/Math.PI,m=Math.atan2(d-i,h)*180/Math.PI,b=Math.atan2(-i,u)*180/Math.PI,f=Z(p),g=Z(m),y=Z(b),S=wt(l)-c,k=Math.max(6,(f-g)/2),w=(f+g)/2,v=t.createRadialGradient(c,y,4,c,y,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,g-k,S*5.2,y-g+k+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,w),t.ellipse(c,w,S,k,0,Math.PI,0,!1),t.lineTo(c+S,y),t.ellipse(c,y,S,k,0,0,Math.PI,!1),t.closePath(),t.fill();let x=t.createLinearGradient(0,w,0,y);x.addColorStop(0,`rgba(${r},0.14)`),x.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=x,t.fillRect(c-S,w,S*2,y-w);let T=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],P=T[Math.floor(s()*T.length)],L=s()<.5?-1:1,C=K=>c+K.u*L*S*.84,I=K=>w+K.v*k*.8,R=P.find(K=>K.lead)??P[0],M=C(R),A=t.createLinearGradient(0,w-k,0,w+k);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),t.fillStyle=A,t.beginPath(),t.ellipse(c,w,S,k,0,0,B),t.fill();let E=t.createRadialGradient(M,w,2,M,w,S);E.addColorStop(0,`rgba(255,214,160,${(.5*o).toFixed(3)})`),E.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=E,t.beginPath(),t.ellipse(c,w,S,k,0,0,B),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,w,S,k,0,0,B),t.stroke();let W=Math.max(24,(y-g)*1.3),N=P.length>=3?3:2;for(let K=0;K<N;K++){let xe=(-.62+K*.52+(s()-.5)*.12)*-L,Ne=c+xe*S*.7,kt=w-k*(.45+s()*.18),et=S*(.07+s()*.04),dn=W*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Ne-et/2,kt-dn,et,dn),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Ne-et/2,kt-dn,et,1.5)}if(P.length>=3){let K=c-R.u*L*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(K,w-k*.34,S*.08,k*.1,0,0,B),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let K of[...P].sort((xe,Ne)=>xe.v-Ne.v)){let xe=.82+(K.v+1)*.14;Vo(t,C(K),I(K),W*xe*(K.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:K.pose,rim:ce(40,.72,.8),rimStrength:K.lead?1.4:.9})}let Y=Z(Math.min(60,m+34)),re=k*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,Y,S*1.15,re,0,0,B),t.stroke();let H=4+Math.floor(s()*3);for(let K=0;K<H;K++){let xe=K/H*B,Ne=c+Math.cos(xe)*S*1.15,kt=Y+Math.sin(xe)*re;if(Math.sin(xe)>-.2){let et=c+(s()-.5)*S*.8;on(t,Ne,kt,et,w,3,S*.32,r,.2*(.7+o*.4))}zo(t,Ne,kt,3,r)}let _=Z(Math.min(52,m+24)),V=Math.max(60,S*.4),oe=Math.max(24,V*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-V*.3,_-oe/2),t.lineTo(c-V*.16,_-oe*2.2),t.moveTo(c+V*.3,_-oe/2),t.lineTo(c+V*.16,_-oe*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-V/2,_-oe/2,V,oe);let sn=t.createLinearGradient(0,_-oe*.3,0,_+oe*.42);sn.addColorStop(0,`rgba(${r},0.5)`),sn.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=sn,t.fillRect(c-V*.42,_-oe*.3,V*.84,oe*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-V/2,_+oe/2-2,V,2);let an=t.createRadialGradient(c,_,4,c,_,V*1.1);an.addColorStop(0,`rgba(${r},0.2)`),an.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=an,t.fillRect(c-V*1.1,_-V*.8,V*2.2,V*1.6);let ln=t.createRadialGradient(c,(Y+w)/2,6,c,(Y+w)/2,S*1.5);ln.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),ln.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=ln,t.fillRect(c-S*1.5,Y-40,S*3,w-Y+80),t.restore();let _h=c+Math.sign(M-c||1)*S*.5;on(t,_h,Y-re*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let cn=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);cn.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),cn.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=cn,t.beginPath(),t.ellipse(M,I(R),S*.2,k*.24,0,0,B),t.fill(),t.restore()}function Qg(t,e,i,n,o,r,s,a){let l=ne/2,c=Math.max(10,n.voidRadiusM),d=Math.max(2,e-c),u=e+c,h=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),p=Math.atan2(-i,d)*180/Math.PI,m=Math.atan2(-i,u)*180/Math.PI,b=Z(p),f=Z(m),g=wt(h)-l,y=(b+f)/2,S=Math.max(10,(b-f)/2),k=t.createRadialGradient(l,y,4,l,y,g);k.addColorStop(0,"#e8f0fb"),k.addColorStop(.7,"#b9c9e2"),k.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,y,g,S,0,0,B),t.clip(),t.fillStyle=k,t.fillRect(l-g,y-S,g*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,y-S),t.lineTo(l,y+S),t.moveTo(l-g*.5,y-S),t.lineTo(l-g*.5,y+S),t.moveTo(l+g*.5,y-S),t.lineTo(l+g*.5,y+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,y,S*.9,S*.5,0,0,B),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,y,g,S,0,0,B),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let C=0;C<5;C++){let I=l+(a()-.5)*g*1.4,R=y+(a()-.5)*S*1.1,M=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,R,M*.6,M,0,0,B),t.fill()}let w=t.createRadialGradient(l,y,4,l,y,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=w,t.fillRect(l-g*1.4,f-S,g*2.8,b-f+S*2),t.restore();let v=Z(Math.min(66,m+60)),x=Math.max(80,g*.7),T=x*.5,P=t.createRadialGradient(l,v,4,l,v,x*1.6);P.addColorStop(0,`rgba(${s},0.3)`),P.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=P,t.fillRect(l-x*1.6,v-x*1.2,x*3.2,x*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-x/2,v-T/2),t.lineTo(l+x/2,v-T/2),t.lineTo(l+x*.6,v),t.lineTo(l+x/2,v+T/2),t.lineTo(l-x/2,v+T/2),t.lineTo(l-x*.6,v),t.closePath(),t.fill();let L=r;for(let C=0;C<3;C++){let I=ce(L+C*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=x*.26;t.fillRect(l-x*.42+C*(R+x*.06),v-T*.32,R,T*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let C=0;C<8;C++){let I=l-x*.6+x*1.2*C/7;t.beginPath(),t.arc(I,v+T*.62,2.4,0,B),t.fill()}}function jg(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let b of i){if(b.id===e.id)continue;let f=b.x-e.x,g=b.y-e.y,y=Math.hypot(f,g)*Qt;if(d&&b.sectionId===d&&y<3&&f*s+g*a>0&&(u=!0),y<.3||y>32)continue;let k=((Math.atan2(f,-g)-o)*180/Math.PI+540)%360-180,w=l?(b.eyeHeightM??Ae)-r:0,v=Math.atan2(w-.28,y)*180/Math.PI;if(v>10&&y>5)continue;let x=0;for(let L=0;L<b.id.length;L++)x=x*31+b.id.charCodeAt(L)&65535;let T=.9+(x&15)/40,P=Math.min(78,Math.atan2(.16,y)*180/Math.PI*Gg*T);P<1.2||h.push({hx:wt(k),hy:Z(v),r:P,d:y,hash:x})}h.sort((b,f)=>f.d-b.d);let p=[];{let b=[...h].sort((y,S)=>y.hy-S.hy),f=[],g=()=>{if(!f.length)return;let y=f.reduce((w,v)=>w+v.d,0)/f.length,S=f.reduce((w,v)=>w+v.hy,0)/f.length,k=f.reduce((w,v)=>w+v.r,0)/f.length;p.push({figs:f.sort((w,v)=>v.d-w.d),d:y,hy:S,r:k}),f=[]};for(let y of b){let S=f[f.length-1];S&&Math.abs(y.hy-S.hy)>Math.max(5,(S.r+y.r)/2*1.7)&&g(),f.push(y)}g()}p.sort((b,f)=>f.d-b.d);let m=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let b of p){if(b.figs.length>=3&&b.r>=1.6&&b.r<26){let f=[],g=[...b.figs].sort((k,w)=>k.hx-w.hx),y=[];for(let k of g){let w=y[y.length-1];w&&k.hx-w.hx>Math.max(14,k.r*7)&&(y.length>=3&&f.push(y),y=[]),y.push(k)}y.length>=3&&f.push(y);let S=Math.min(.42,.5*(1-b.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let k of f){let w=k[0].hx-b.r*1.6,v=k[k.length-1].hx+b.r*1.6;t.beginPath(),t.roundRect(w,b.hy+b.r*.8,v-w,b.r*2.4,b.r*.8),t.fill()}}}for(let f of b.figs){let g=f.d<12?.95:f.d<17?Math.max(.66,.95-(f.d-12)/18):Math.max(.3,.68-(f.d-17)/34),y=Math.round((1-Math.min(1,f.d/16))*10),S=[14+(f.hash>>4&6)+y,17+(f.hash>>4&6)+y,25+(f.hash>>4&6)+y],k=m[f.hash%m.length],w=[k[0]+y,k[1]+y,k[2]+y];if(f.r>=13){let v=f.d<9?.16*(1-f.d/9)+(c.mode==="proscenium"?.06:0):0;Ug(t,f.hx,f.hy,f.r,{tone:S,clothing:w,alpha:g,tilt:((f.hash>>2&7)-3.5)*.018,shoulderK:1.72+(f.hash>>5&7)/22,hair:f.hash%Xg,rim:v,turn:((f.hash>>8&7)-3.5)*.034,lean:((f.hash>>10&3)-1.5)*.09})}else f.r>=5.5?$g(t,f.hx,f.hy,f.r,w,S,g):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,t.beginPath(),t.arc(f.hx,f.hy,f.r,0,B),t.fill(),t.beginPath(),t.ellipse(f.hx,f.hy+f.r*1.4,f.r*1.85,f.r*.95,0,Math.PI,0,!0),t.fill())}}if(u){let b=Z(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,b,ne,ke-b),t.fillStyle="rgba(24, 30, 46, 0.9)";let f=16;for(let g=0;g<f;g++){let y=(g+.5)/f*ne;t.beginPath(),t.ellipse(y,b+6,ne/f*.42,22,0,Math.PI,0,!0),t.fill()}}}var he=480,vt=270,Wo=50,Je=30,Mh=t=>(t+Wo)/(2*Wo)*he,Zt=t=>(Je-t)/(2*Je)*vt;function nI(t,e,i){let n=document.createElement("canvas");n.width=he,n.height=vt;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*Qt),l=Ah(Eh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=ce(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=o.createLinearGradient(0,0,0,vt);h.addColorStop(0,"#080b12"),h.addColorStop(.44,"#151c32"),h.addColorStop(.5,"#1d2644"),h.addColorStop(.58,"#161c2e"),h.addColorStop(1,"#131829"),o.fillStyle=h,o.fillRect(0,0,he,vt);let p=t.eyeHeightM??Ae,m=Do(p,a),b=Math.min(Wo-2,Math.atan2(4,a)*180/Math.PI),f=Math.min(Je-2,m.topPitch),g=Math.max(-Je+2,m.basePitch),y=Mh(-b),S=Mh(b),k=Zt(f),w=Zt(g),v=S-y,x=w-k,T=Math.max(.35,Math.min(1,1-(a-6)/60)),P=Zt(Math.min(Je-1,f+8)),L=o.createRadialGradient(he/2,(k+w)/2,4,he/2,(k+w)/2,v*1.15);L.addColorStop(0,"rgba(255,214,150,0.34)"),L.addColorStop(.28,"rgba(150,150,230,0.3)"),L.addColorStop(.6,"rgba(99,102,241,0.12)"),L.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=L,o.fillRect(y-v*.6,k-x*1.2,v*2.2,x*3.4);let C=ce(c,.62,.55),I=ce(c+40,.7,.5),R=ce(c+70,.78,.52);o.save(),o.beginPath(),o.rect(y,k,v,x),o.clip();let M=o.createLinearGradient(0,k,0,w);M.addColorStop(0,`rgb(${C[0]},${C[1]},${C[2]})`),M.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),M.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),o.globalAlpha=.8,o.fillStyle=M,o.fillRect(y,k,v,x),o.globalAlpha=1;let A=o.createRadialGradient(he/2,(k+w)/2,v*.12,he/2,(k+w)/2,v*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),o.fillStyle=A,o.fillRect(y,k,v,x),o.restore();let E=3,W=w-x*.08;for(let H=0;H<E;H++){let _=(H+1)/(E+1);Vo(o,y+v*(.24+_*.52),W,x*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ce(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(y-v*.5,P,v*.5,w-P),o.fillRect(S,P,v*.5,w-P);let N=v*.05+2,Y=N*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(y,w),o.lineTo(y-N,w),o.lineTo(y-Y,P),o.lineTo(y+v*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,w),o.lineTo(S+N,w),o.lineTo(S+Y,P),o.lineTo(S-v*.012,P),o.closePath(),o.fill(),o.fillRect(y-Y,P,v+Y*2,(w-P)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(y-1.2,P,1.2,w-P),o.fillRect(S,P,1.2,w-P),o.fillStyle="#0b0f18",o.fillRect(y-N,w-x*.05,v+N*2,x*.05+2);let re=o.createLinearGradient(0,w-x*.05,0,w+x*.14);re.addColorStop(0,`rgba(255,206,140,${(.5*T).toFixed(3)})`),re.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=re,o.fillRect(y-N,w-x*.05,v+N*2,x*.22);for(let H=0;H<3;H++){let _=(H+1)/4,V=y+v*_,oe=Zt(Math.min(Je-1,f+20));on(o,V,oe,V+(l()-.5)*v*.14,w,3,v*.09,u,.17*T),zo(o,V,oe,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let H=0;H<8;H++)o.beginPath(),o.arc((H+.5)/8*he,Zt(Je-4-H%2*3),2.2,0,B),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,vt-26,he,26),o.fillStyle="rgba(30,37,54,0.9)";for(let H=0;H<9;H++){let _=H*(he/9)+he/18;o.beginPath(),o.ellipse(_,vt-22,he/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:n.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Fh=new Set(["en"]),rn=new Map;async function Jg(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await Kr(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-STMEO2AW.js"),i=e[t];return i?await i():null}async function aI(t,e){let i=ra(t,e);if(i==="en"||Fh.has(i))return ct(i),i;if(!oa.includes(i))return ct("en"),"en";try{let n=rn.get(i);n||(n=Jg(i),rn.set(i,n));let o=await n;return rn.delete(i),o?(ct(i,o),Fh.add(i),i):(ct("en"),"en")}catch{return rn.delete(i),ct("en"),"en"}}export{nb as ACCESSIBILITY_RING_COLOR,Xo as ACCESSIBILITY_TYPES,Qb as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,Zb as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,db as BOOTH_TYPES,tb as CHART_STORAGE_KEY,Ny as CURRENCY_CHOICES,Oy as DEFAULT_CURRENCY,fb as DEFAULT_EVENT_INVENTORY_LIMIT,nT as EMPTY_AVAILABILITY_REFRESH,yb as EVENT_CONFIGURATION_EXPORT_SCHEMA,bb as EVENT_CONFIGURATION_SCHEMA,Yb as FLOOR_COVER_LIMIT,zb as FLOOR_STACK_GAP_RATIO,qb as FLOOR_STACK_MIN_SURFACE_PX,Jb as GA_UNIT_LABEL_PREFIX,iT as HOLD_CLOCK_SKEW_MS,Cn as LABEL_FADE_MS,lb as LABEL_STYLE_MAX_SIZE,ab as LABEL_STYLE_MIN_SIZE,mb as LARGE_VENUE_INVENTORY_MODULE,yy as LEGIBILITY_HYSTERESIS_PX,Ub as LEVEL_CONTEXT_PREFIX,Uy as LOCALE_NAMES,pb as MAX_EVENT_INVENTORY,ty as MAX_GA_CAPACITY,ry as MAX_ONE_PARTY_GUESTS,li as MIN_POINTER_TARGET_PX,sy as ONE_PARTY_LIMIT_MESSAGE,Th as PickerController,Ee as PickerSelectionError,gy as RENDERED_QUALITY_REPORT_VERSION,cb as ROW_AISLE_SEATS,rb as SEAT_COMMERCIAL_MARKS,dy as SEAT_TYPE_ICON_BODY,mn as SEAT_TYPE_ICON_VIEWBOX,eb as STAGE_LABEL_STYLE_MAX_SIZE,Iu as SUPPORTED_LOCALES,hb as SURROUNDINGS_SHAPE_ROLES,Eo as SeatmapRenderer,Pb as TABLE_SEAT_OFFSET,Tb as TIER_HEIGHT_M,oa as TRANSLATED_LOCALES,ur as UNGROUPED_ID,Jd as accessNeedsFor,cy as accessibilityLabelKey,ib as accessibilityMeta,ob as accessibilityRingColor,ti as allObjects,gr as applyHidden,wg as applyOrganizerSeatGlyph,Bo as asPickerSalesState,ih as attachVisibilityCatchUp,jb as automaticRoundTableRadius,xb as canTransitionEventConfiguration,wb as canonicalEventConfigurationJson,ir as chartBounds,Hd as clearOrganizerSeatGlyph,rr as combinedFloorZoneId,Rt as compactRowLabel,mr as computeSections,py as computeSectionsPerFloor,Dd as createRenderer,Xr as crossesThreshold,Cu as currencyExponent,Wy as currencySymbol,tt as effectiveFloorOverview,gb as eventInventoryLimitFor,Db as expandBooth,He as expandChart,Ab as expandRow,Eb as expandRowSlots,Ob as expandTable,_b as expandTableSlots,Wb as floorObjects,Kb as floorStackPlacements,ei as floorsOf,Jy as formatDate,Gy as formatMinor,Ue as formatMoney,Tu as fromMinorUnits,Ct as gaAreasOf,un as gaBoxBounds,hn as gaBoxMode,oy as gaInventorySegments,iy as gaUnitLabel,ay as gaUnitLabels,pn as gaUnitLabelsForModel,Lt as gaWheelchairPlaceCount,fn as gaWheelchairUnitLabels,iI as generateSeatPanorama,nI as generateSeatThumb,$y as getLocale,ly as growJoinedGAInventory,my as hiddenObjectIds,Ig as holdHasLapsed,rT as holdRecoveryShape,In as hysteresisScale,cr as initialFloorMode,kb as inspectEventConfigurationCompatibility,by as inspectRenderedQualityEvidence,ey as isGaUnitLabel,Zy as isLocaleLoaded,Nd as isOrganizerGlyphPainted,fy as isSectionHidden,ub as layerOf,ar as layoutCombinedFloorPlan,sr as layoutFloorStack,lr as levelContextOutlines,aI as loadLocale,qy as localeDirection,$b as mainFloorId,Cb as migrateLegacyEventConfigurations,Hy as numberLocale,Hb as objectCenter,Qy as onLocaleChange,Gb as owningSectionForObject,vb as parseEventConfigurationExport,Sb as parseEventConfigurationVersion,jt as pointInPolygon,te as pointInPolygonWithHoles,Nb as pointOnPolygonBoundary,Jt as polygonLabelPoint,eh as reconcileAvailability,oT as refreshChangedSomething,Tn as renderedPx,Dy as resolveCurrency,Lb as resolveEventConfigurationRollback,ra as resolveLocale,Mb as rowInventoryCount,Rb as rowSeatPositions,sb as seatCommercialMeta,dr as seatNoteRowModel,hr as seatTypeIconBody,hy as seatTypeIconSvg,it as sectionEntrancesById,Ib as sectionGeometry,uy as sectionIdentitiesById,pr as sectionLabelsById,fr as sectionOwnersByObject,ct as setLocale,na as setMoneyLocale,jy as setStringOverrides,th as shouldWaitForHoldExpiry,tr as stackFloors,Xb as suggestedFloorOverview,F as t,aa as tCount,Bb as tableInventoryCount,Fb as tableSeatCountsBySide,Vb as translateObject,er as usableHoles,ny as validGAInventorySegments,Sy as zoomTowardPoint};
1
+ import{a as Ln,c as Cn,e as Wr,f as mi,h as Vr,j as zr,m as Kr}from"./chunk-ZYQXT5JP.js";import{a as Ly,b as ci,c as Cy}from"./chunk-WR6VXY5U.js";import{a as Qb,b as sr,c as jb,d as ar,e as lr,f as tt,g as Jb,h as ey,i as ty,j as cr,k as iy,l as ny,m as dr,o as Mr,r as rt}from"./chunk-MRLWH6RC.js";import{d as Xr}from"./chunk-TGHNVDWA.js";import{a as gn,b as yy,c as ur,d as Sy}from"./chunk-YPVYZYMH.js";import{a as by,b as hr,c as Rt,d as _r,e as Br,f as Or,g as Dr}from"./chunk-LWBTU56C.js";import{b as Rr,e as wn,i as ui,k as Gr}from"./chunk-FBXZWNND.js";import{b as di,f as Cr,h as ot,i as Tr,j as Ir,l as Pr}from"./chunk-4N5CHKHD.js";import{A as Hr,b as Mt,c as pi,d as kn,e as Er,f as Ar,g as xn,l as Fr,n as fi,z as Nr}from"./chunk-JXIX3PNI.js";import{A as Lr,B as ze,C as vn,D as ai,E as Y,F as de,G as li,a as me,b as Sr,c as Ge,e as ge,f as oi,g as ri,h as vr,i as It,j as We,k as Ve,l as V,n as wr,p as kr,q as xr,s as be,t as ye,w as nt,x as Pt,y as si}from"./chunk-MADX5HYP.js";import{a as oy,b as ry,c as sy,f as hi}from"./chunk-WRAPI4MD.js";import{b as or,c as rr,l as xt}from"./chunk-M4NGX5NM.js";import{b as lb,c as Xo,d as cb,e as Yo,f as db,g as hb,h as ub,i as pb,j as fb,k as mb,l as gb,m as bb,n as yb,o as Sb,p as vb}from"./chunk-R6BN4HDQ.js";import{a as ay,b as ly,c as cy,d as dy,e as hy,f as uy,g as py,h as fy,i as un,j as pn,k as my,l as fn,m as Lt,n as mn,o as gy,p as Ct,q as pr,r as vy,s as it,t as fr,u as mr,v as gr,w as wy,x as ky,y as xy,z as br}from"./chunk-UUIZHJYL.js";import{$a as ti,Ga as Jo,Ia as er,J as Uo,Ka as Ob,L as $o,La as Db,Ma as Nb,N as q,Na as Hb,Oa as Gb,Pa as Wb,Qa as Vb,Ra as zb,Sa as Kb,Ta as Xb,Ua as Jt,Va as Yb,Wa as tr,Xa as te,Ya as ei,Za as Ub,_a as $b,ab as qb,ba as qo,bb as ii,ca as Zo,cb as Zb,d as wb,da as Qo,db as ir,e as kb,eb as He,f as xb,fb as nr,g as Lb,h as Cb,i as Tb,j as Ib,k as Pb,ka as jo,l as Rb,m as Mb,ma as _b,n as Eb,o as Ab,p as Fb,ua as Ae,va as Bb}from"./chunk-YE4NP3XB.js";import"./chunk-S3VH7IDA.js";import{C as G,c as bn,h as yn,m as Tt,o as yr,t as H,u as se,v as Fe,w as j,x as ni,z as Sn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var Ty=1,Tn=90;function In(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Yr(t,e,i,n=1){if(!Number.isFinite(t))return i;let o=Math.max(0,n);return i?t>=e-o:t>=e+o}function Pn(t,e,i,n=1){if(!Number.isFinite(t)||!(i>0))return t;let o=Math.max(0,n)/i;return e?t*(1+o):t*(1-o)}function Iy(t){let{point:e,camera:i,scale:n,nextScale:o}=t;if(!Number.isFinite(n)||n<=0||!Number.isFinite(o))return{...i};let r=(e.x-i.x)/n,s=(e.y-i.y)/n;return{x:e.x-r*o,y:e.y-s*o}}import{Konva as Ji}from"konva/lib/Core";import{Stage as xg}from"konva/lib/Stage";import{Layer as Eo}from"konva/lib/Layer";import{Group as qt}from"konva/lib/Group";import{Circle as Wd}from"konva/lib/shapes/Circle";import{Group as Xn}from"konva/lib/Group";import{Circle as Oe}from"konva/lib/shapes/Circle";import{Line as $n}from"konva/lib/shapes/Line";import{Rect as Yn}from"konva/lib/shapes/Rect";import{Text as fa}from"konva/lib/shapes/Text";var J=9,Se=.9,Q=.55*Se,ie=V/me,st=4,ue=14,Ur=10;var $r=14;var Le=.45*Se,ve=.9*Se,ae=(Le+ve)/2,qr=Math.max(Se*1.1,ve),we=8,Zr=700,ee=2,Qr=3,Et=V,Gh=12,Wh=12;function jr(t){return t<U?Wh:Gh}var gi=.85,Jr=V,At=64,Ke=.55*Le,es=700,ts=120,is=2500,ns=420,os=420,rs=1,Xe=1,ss=2,at=16,_e=12,Rn=[.85,.72,.62],Vh=10,zh=9;function bi(t){return t<U?zh:Vh}var yi=13,Si=12,as=0,ls="600",cs="500",ds=8,hs=5,us=10,ps=6,fs=8,ms=.6,gs=.7,bs=[0,18,-18,36,-36,54,-54],Ce="600",ys="500",U=640,Ss=Ce,vs="400",Be=0,ws=14,ks=.34,xs=.92,Ls=7,Cs=3;function vi(t){return Math.min(1,Math.max(_e/at,t/900))}function lt(t,e){return Math.max(_e,t*vi(e))}var Kh=.5,Xh=1.15,Ts=2,Is=3,Ps=22,Yh=8,Uh=6;function Ft(t){return t<U?Uh:Yh}var Mn=.08;function En(t,e,i,n,o=Kh,r=_e){let s=t*vi(e),a=Math.max(r*(1+Mn),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*Xh);return Math.min(c,a*l)}var Rs=.1,_t=1.02;var wi=1.25;function Ms(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var $h="#e5e7eb",qh="#c7cbd1",Zh="#6b7280",Qh=["#6b7280","#5b6470","#4b5563","#374151"],jh=["#cbd5e1","#e2e8f0","#f8fafc"],Jh="#d1d5db",eu="#b8bdc4",tu="#273142",iu="#526078",nu="#f1f5f9",ou="#374151",ru="#64748b",su="#111827",Es="#6b7280",As="#374151";var Fs="#4b5563",_s=.4,Te=.16,Bs="rgba(244,246,248,0.06)",ki=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Os(t,e,i){let n=new Map;for(let s of t){let a=e(s);!a||i(a)||n.set(a,(n.get(a)??0)+1)}let o=null,r=0;for(let[s,a]of n)(a>r||a===r&&o!=null&&s<o)&&(o=s,r=a);return o}function le(t){return H(t)?{sectionFill:$h,sectionStroke:qh,sectionInk:Zh,focalFill:Jh,focalStroke:eu}:{sectionFill:tu,sectionStroke:iu,sectionInk:nu,focalFill:ou,focalStroke:ru}}function An(t,e){let i=t.sectionFill,n=H(i),o=n?se(i,.6):Sn(Fe(i,.2),.85);switch(e){case"closed":return n?se(i,.4):Fe(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Ds=.28,Ns=.42,au=.55,lu=.7;function Hs(t,e,i){let n=le(t),o=An(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=H(t);return{fill:j(o,i,r?Ns:Ds),stroke:G(i,r?lu:au)}}var cu=.03;function Gs(t,e){let i=le(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>An(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&Fn(t,e)}function Fn(t,e){let i=bn(e);if(!i)return!1;let n=le(t),o=Math.max(Ds,Ns)+cu;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=bn(An(n,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=o:!1})}var du="#f8fafc",hu="#f4f6fb",uu="#111827",pu=.72;function Ws(t){let e=H(t),i=e?du:su,n=e?uu:hu,o=j(n,i,1-pu);return{plate:i,ink:n,subInk:Tt(o,i)>=yr?o:n}}function Vs(t,e,i,n){if(e)return e;let o=H(i)?jh:Qh;for(let r of[i,...o])if(Tt(r,t)>=n)return r;return de(t,e,i,n)}var fu=.45,mu=.3,gu=.1,bu=5;function zs(t,e,i){let n=H(e)?Fe:se,o=Sn(n(t,fu),mu);for(let r=0;r<bu;r+=1){if(Tt(o,e)>=i)return o;o=n(o,gu)}return Tt(o,e)>=i?o:de(e,null,o,i)}import{Shape as Su}from"konva/lib/Shape";import{Circle as vu}from"konva/lib/shapes/Circle";import{Rect as wu}from"konva/lib/shapes/Rect";var yu={M:2,L:2,Q:4,C:6,Z:0},_n=new Map;function Bn(t){let e=_n.get(t);if(e)return e;let i=ot(t);if(!i)return _n.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=yu[s];if(a===void 0||r+a>n.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=n.slice(r,r+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${t}".`);r+=a,s==="M"||s==="L"?o.push({command:s,points:l}):s==="Q"?o.push({command:s,points:l}):s==="C"?o.push({command:s,points:l}):o.push({command:"Z",points:[]})}return _n.set(t,o),o}function Ks(t,e,i,n=0,o=0){let r=Bn(e),s=Cr(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=Tr(s,i);t.save(),t.translate(n,o),t.scale(a.scale,a.scale),t.translate(-a.centreX,-a.centreY);for(let l of r)l.command==="M"?t.moveTo(l.points[0],l.points[1]):l.command==="L"?t.lineTo(l.points[0],l.points[1]):l.command==="Q"?t.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?t.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):t.closePath();return t.restore(),!0}function Xs(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ye=class extends Su{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=Bn(n),r=this.attrs.seatGlyphDetail,s;if(r===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;s=i*2*c>=16}else s=r;if(!o.length||!s){Xs(e,i),e.fillStrokeShape(this);return}e.beginPath(),Ks(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){Xs(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function On(t,e){return t==="circle"||!ot(t)?null:new Ye({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:t,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Ys(t){let{x:e,y:i,radius:n}=t;return t.wheelchairBay?new wu({x:e,y:i,width:n*2,height:n*2,offsetX:n,offsetY:n,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):On(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new vu({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function ku(t,e){return t*2*e>=16}function Us(t,e,i,n){let o=ku(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function xi(t){return t?.35:.3}function Zs(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let n=t/.45;return 1+e*(1-(1-n)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function Dn(t){let e=t<=0?0:t>=1?1:t,i=1-(1-e)**3;return{radiusScale:1+(2.5-1)*i,opacity:.55*(1-e)}}var Qs=700,xu=2400,Nn=12,js=30,$s=1,Lu=1.16,qs=.5,Cu=1;function Hn(t){return t*.61803398875%1}function Js(t,e){let n=((t/xu+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:$s+(Lu-$s)*o,opacity:qs+(Cu-qs)*o}}var ta;function ia(t){ta=t}function Tu(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var ea=new Map;function Iu(t,e){let i=t??ta,n=`${i??""}|${JSON.stringify(e)}`,o=ea.get(n);return o||(o=new Intl.DateTimeFormat(i,e),ea.set(n,o)),o}var Pu={dateStyle:"medium",timeStyle:"short"};function na(t,e={}){let{locale:i,...n}=e,o=Tu(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:Pu;return Iu(i,r).format(o)}var Ky="USD";function Xy(t,e){return t?.trim()||e?.trim()||"USD"}var Yy=["USD","EUR","GBP","CAD","AUD","INR","AED","SAR","KWD","QAR","BHD","OMR","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL","ARS","CLP","COP","PEN","UYU","IDR","PHP","THB","VND","MYR","NGN","GHS","KES","UGX","TZS","RWF","XAF","XOF","EGP"],Wn;function ra(t){Wn=t}function Uy(){return Wn??"en"}var oa=new Map;function Gn(t,e,i,n){let o=n??Wn,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=oa.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),oa.set(r,s)),s}function Ue(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return Gn(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let o=i??(Number.isInteger(t)?0:void 0);return Gn(e,o,o,n).format(t)}var Ru={BIF:0,CLP:0,DJF:0,GNF:0,JPY:0,KMF:0,KRW:0,MGA:0,PYG:0,RWF:0,UGX:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,BHD:3,IQD:3,JOD:3,KWD:3,LYD:3,OMR:3,TND:3};function Mu(t="USD"){return Ru[t.toUpperCase()]??2}function Eu(t,e="USD"){return t/10**Mu(e)}function $y(t,e="USD",i){return Ue(Eu(t,e),e,void 0,i)}function qy(t="USD"){return Gn(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Bt={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired and the seats were released. Pick again.","picker.holdExpiredTitle":"Your seats were released","picker.holdExpiredBody":"Your hold time ran out and the seats went back on sale.","picker.holdExpiredRestart":"Choose seats again","picker.holdExpiredPickAgain":"Pick your seats again to continue. They may already be taken.","picker.releasedPair":"{first} \xB7 {second}","picker.releasedSeatPlace":"Section {section}, Row {row}, Seat {seat}","picker.releasedSeatRange":"Section {section}, Row {row}, Seats {from}\u2013{to}","picker.releasedInSection":"{seats} in Section {section}","picker.releasedInSections":"{seats} in Sections {sections}","picker.releasedGa":"{quantity} \xD7 {area}","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.testModeExplained":"Bookings here are not real and no card is charged","picker.findClosestSeatsTogether":"Find the closest seats together","picker.findSeatsTogether":"Find seats together","picker.addSeat":"Add seat","picker.removeSeat":"Remove seat","picker.added":"Added","picker.findSeats":"Find seats","picker.findBestSeats":"Find best seats","picker.displayOptions":"Display options","picker.closeVenueNavigation":"Close venue navigation","picker.orphanHint":"This leaves a single seat stranded. Consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.noWheelchairSpace":"NO WHEELCHAIR SPACE","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview: groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks: sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats: blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.aisleSeat":"Aisle seat","picker.boothType.inline":"Inline booth \xB7 1 open side","picker.boothType.corner":"Corner booth \xB7 2 open sides","picker.boothType.peninsula":"Peninsula booth \xB7 3 open sides","picker.boothType.island":"Island booth \xB7 4 open sides","picker.gaBookWholeArea":"Book the whole area","picker.gaBook":"Book","picker.noWheelchairSpace":"No wheelchair space","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count}. Showing best overall","picker.loading3d":"Building the 3D venue\u2026","picker.unavailable3d":"3D could not start. The seat map is still available.","picker.jumpToSection":"Jump to section","picker.salesClosedPill":"Sales are closed","picker.salesClosedCopy":"Ticket sales for this event have ended.","picker.salesNotOpenPill":"Sales haven\u2019t opened yet","picker.salesNotOpenCopy":"Tickets for this event aren\u2019t on sale yet.","picker.salesPausedPill":"Sales are paused","picker.salesPausedCopy":"Ticket sales are paused for now.","picker.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total}. You won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types. Tap one below to show just those seats.","picker.aboutTicketPrices":"About ticket prices","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now.","picker.accessExpiredTitle":"The seat map timed out","picker.accessInvalidBody":"You can still book anything shown as available. Contact whoever sent you here for access to the rest.","picker.accessInvalidTitle":"We couldn\u2019t verify your access","picker.accessPausedBody":"The organizer has paused this selection. Try again in a few minutes.","picker.accessPausedTitle":"These seats are on hold right now","picker.accessRefresh":"Refresh","picker.accessRetry":"Try again","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.idlePausedBody":"You were away for a while. Refresh to see which seats are free now.","picker.idlePausedTitle":"Your session expired","picker.idleRefresh":"Show latest seats","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addMinutes":"+{count} min","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Zones","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held. Please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.aboutBestSeats":"About finding seats together","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessSpreadHint":"{count} accessible spaces in {sections} sections \xB7 tap a highlighted section","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time. Please head to checkout now.","picker.savedSeatsNotRestored":"Your earlier seats could not be restored. Please choose again.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.dragToLookTouch":"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close","picker.dragToLookMouse":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party \xB7 {typeWord}","picker.fullScreen":"Full screen","picker.generalAdmission":"General admission","picker.guestCountCouldNotBeSecured":"That guest count could not be secured. Your current table hold is unchanged.","picker.guestCountNoLongerAvailable":"That guest count is no longer available. Your current hold is unchanged.","picker.guests":"Guests","picker.guestsCount":"{count} guests","picker.guestsCountEdit":"{count} guests \xB7 Edit","picker.held":"Held","picker.heldByOther":"Held by another buyer, may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.hidePanel":"Hide panel","picker.hideTicketPanel":"Hide the ticket panel","picker.holdSeatsAndCheckout":"Hold seats & checkout","picker.howOfferWorks":"How the {name} offer works","picker.interactive3dVenueView":"Interactive 3D venue view","picker.keepMine":"Keep mine","picker.labelNoLongerAvailable":"{label} is no longer available.","picker.labelRemoved":"{label} removed.","picker.labelRemovedFromHold":"{label} removed from your hold.","picker.labelRestored":"{label} restored.","picker.labelsNoLongerAvailable.one":"{labels} is no longer available. Choose another seat.","picker.labelsNoLongerAvailable.other":"{labels} are no longer available. Choose another group.","picker.leftCount.one":"{count} left","picker.leftCount.other":"{count} left","picker.levelNumber":"Level {number}","picker.levels":"Levels","picker.loadingSeatMap":"Loading seat map\u2026","picker.lookAroundLive3d":"Look around in live 3D","picker.manualTicketsRemovedNote":"Your manually selected tickets will be removed only after a new group is secured.","picker.map":"Map","picker.mapDidNotLoad":"The seat map didn\u2019t load","picker.eventUnavailableTitle":"This event isn\u2019t available","picker.eventUnavailable":"Tickets can\u2019t be booked here right now.","picker.maxTicketsForOrder":"You can select up to {count} tickets for this order.","picker.selectExactMore":"Select {count} more","picker.selectExactCount":"Select exactly {count} tickets","picker.selectMinimumMore":"Select {count} more","picker.adjustSeatSelection":"Adjust seat selection","picker.selectSeatsTogether":"Choose seats together in the same row and ticket category.","picker.minToMaxGuests":"{min} to {max} guests","picker.more":"More","picker.moreCount":"+{count} more","picker.showLess":"Show less","picker.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreTimeAdded":"More time added. Your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notForSale":"Not for sale","picker.notAvailable":"Not available","picker.seatUnavailableNote":"This seat isn't available.","picker.notForSaleExplanation":"This seat is not included in the current sale.","picker.numberOfGuests":"Number of guests","picker.offerDetailActive":"This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over.","picker.offerDetailUpcoming":"Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts.","picker.offerRemainingAvailable":"{count} available","picker.offerStarts":"starts {time}","picker.offerUntil":"until {time}","picker.oneSeatSaved":"1 seat saved","picker.oneSeatSavedChooseAnother":"One seat saved; choose another to compare","picker.openAuthored360":"Open venue 360\xB0","picker.openComparison":"Open comparison","picker.openComparisonOfSeats":"Open comparison of {count} seats","picker.openTicketPanel":"Open ticket panel","picker.peekFromPrice":"From {price}","picker.peekTicketsTotal.one":"{count} ticket \xB7 {total}","picker.peekTicketsTotal.other":"{count} tickets \xB7 {total}","picker.perGuestPrice":"{price} per guest","picker.pickYourSeats":"Pick your seats","picker.preferredTicketType":"Preferred ticket type","picker.preferredVenueZone":"Preferred venue zone","picker.priceNotSupplied":"Price not supplied","picker.removeHeldTicketLabel":"Remove held ticket {label}","picker.removeSeatLabel":"Remove {label}","picker.removeTicketsUntilOrFewer":"Remove tickets until your order has {count} or fewer.","picker.replaceCurrentChoices":"Replace your current choices?","picker.review":"Review","picker.row":"Row","picker.rowLabel":"Row {label}","picker.saveToCompare":"Save to compare","picker.savedForComparison":"Saved for comparison","picker.savedSeatComparison":"Saved seat comparison","picker.scheduledOffer":"Scheduled offer","picker.seat":"Seat","picker.seatCount.one":"{count} seat","picker.seatCount.other":"{count} seats","picker.seatJustTakenByAnother":"Seat {label} was just taken by another buyer.","picker.seatLabel":"Seat {label}","picker.seatNoLongerAvailable":"That seat is no longer available.","picker.seatNoLongerYours":"Some seats are no longer available to you. They have been removed from your order.","picker.seatNumberLower":"seat {label}","picker.seatSalesClosedForEvent":"Seat sales have closed for this event.","picker.maintenancePaused.one":"Booking is paused for maintenance. Please try again in about {count} minute.","picker.maintenancePaused.other":"Booking is paused for maintenance. Please try again in about {count} minutes.","picker.maintenancePausedShortly":"Booking is paused for a few minutes for maintenance. Please try again shortly.","picker.seatSelection":"Seat selection","picker.seatStatusLegend":"Seat status legend","picker.seatTaken":"Someone else took a seat you had picked. It has been removed from your order.","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.seeItIn3d":"See it in 3D","picker.select":"Select","picker.selectSeats":"Select seats","picker.selectTable":"Select table","picker.selectWholeTable":"Select whole table","picker.selected":"Selected","picker.selectingEllipsis":"Selecting\u2026","picker.showAllSeats":"Show all seats","picker.showAllTicketTypes":"Show all {count} ticket types","picker.showFewer":"Show fewer","picker.showLabelSeatsOnMap":"Show {label} seats on the map","picker.showTicketPanel":"Show the ticket panel","picker.sold":"Sold","picker.soldOutCopy":"No reserved seats are currently available for this event.","picker.soldOutEyebrow":"This event","picker.soldOutTitle":"Sold out","picker.soldSeatExplanation":"This seat has already been booked.","picker.statusAvailable":"available","picker.statusOnHold":"on hold","picker.statusTaken2":"taken","picker.table":"Table","picker.tableCapacity":"Table capacity","picker.tableUpdatedForGuests":"{label} updated for {count} guests.","picker.temporarilyHeld":"Temporarily held","picker.ticketPrices":"Ticket prices","picker.ticketTypeNotChanged":"That ticket type is not available for this seat. Your hold is unchanged.","picker.ticketTypeSoldOut":"That ticket type is sold out. Try another ticket type.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} ticket","picker.ticketsCount.other":"{count} tickets","picker.toggleColorblindColors":"Toggle colorblind-friendly colors","picker.total":"Total","picker.trayHintTapOrBest":"Tap a seat on the map, or let us pick the best available for you.","picker.aboutYourSeats":"How to choose seats","picker.trayHintTapOrStanding":"Tap a seat on the map or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating\u2026","picker.venueView":"Venue view","picker.recentreOnStage":"Recentre on the stage","picker.stopYourSeat":"Your seat","picker.stopYourRow":"Your row","picker.stopYourSection":"Your section","picker.stopWholeVenue":"Whole venue","picker.viewFromHere":"View from here","picker.viewFromYourSeat":"view from your seat","picker.fromYourSeat":"from your seat","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We\u2019ll choose the closest available group for you.","picker.willFindSeatsTogether":"We\u2019ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.fitWholeVenue":"Show whole venue","picker.dragToRotateVenue":"Drag to rotate the venue","picker.dragToMoveVenue":"Drag to move the venue","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & zones","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances","checkout.free":"Free","checkout.confirmBooking":"Confirm booking","checkout.price":"Price","checkout.freeNote":"This event is free. Nothing is charged.","checkout.confirmingBooking":"Confirming your booking\u2026","checkout.confirmingSeats":"Confirming your seats\u2026","checkout.busyRetryingBooking":"Busy right now. Still confirming your booking\u2026","checkout.busyRetryingPayment":"Busy right now. Still opening secure payment\u2026","checkout.busyFailedBooking":"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.busyFailedPayment":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.seatsUnavailable":"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.","checkout.title":"Checkout","checkout.back":"Back to seats","checkout.heldFor":"Seats held for {time}","checkout.yourOrder":"Your order","checkout.row":"Row {row}","checkout.seat":"Seat {seat}","checkout.quantity":"{label} \xD7 {count}","checkout.showAll":"Show all {count} seats","checkout.yourDetails":"Your details","checkout.email":"Email","checkout.emailHint":"Your tickets are sent here.","checkout.name":"Name","checkout.namePlaceholder":"Your name","checkout.optional":"Optional","checkout.forSomeoneElse":"Ticket for someone else?","checkout.holderYou":"You \xB7 {name}","checkout.holderYouPlain":"You","checkout.change":"Change","checkout.changeHolder":"Change the holder of {ticket}","checkout.addNames":"Add names for each ticket","checkout.questions":"A few questions","checkout.payWith":"Pay with","checkout.continue":"Continue to payment","checkout.continueTest":"Continue to test payment","checkout.tryAgain":"Try again","checkout.trust":"Secure payment on the organizer\u2019s payment page. We never see your card.","checkout.freeTrust":"Free booking. Nothing is charged.","checkout.testStrip":"No real charge \xB7 tickets not valid for entry","checkout.testStripFree":"Test booking \xB7 tickets not valid for entry","checkout.privacy":"The organizer and SeatLayer use your details to issue and manage your tickets.","checkout.privacyLink":"Privacy Policy","checkout.expiringSoon":"Your seats are held for {time}. Finish soon to keep them.","checkout.opening":"Opening secure payment\u2026","checkout.redirectTitle":"Taking you to secure payment","checkout.redirectBody":"You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.","checkout.waitingPayment":"Waiting for payment\u2026","checkout.dontClose":"Don\u2019t close this tab.","checkout.confirmingTitle":"Confirming your seats","checkout.paymentReceived":"Payment received. This usually takes a few seconds.","checkout.noNeedPayAgain":"You don\u2019t need to pay again.","checkout.stillConfirmingTitle":"Still confirming","checkout.stillConfirming":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.","checkout.nothingCharged":"Nothing was charged.","checkout.expiredTitle":"Your seats were released","checkout.expiredBody":"The hold on {seats} ran out before payment started.","checkout.chooseAgain":"Choose seats again","checkout.takenTitle":"Those seats were just taken","checkout.takenBody":"Someone booked {seats} while you were filling this in.","checkout.chooseOther":"Choose other seats","checkout.networkTitle":"Couldn\u2019t reach checkout.","checkout.networkBody":"Check your connection and try again. Nothing was charged, and your seats are still held.","checkout.error.email":"Enter an email like name@example.com.","checkout.error.notTakingPayments":"This event is not taking online payments yet. Contact the organizer to buy these seats.","checkout.error.accessEnded":"Your access to this private sale has ended. Nothing was charged. Ask whoever sent you the link for a new one.","checkout.error.holdReleased":"Your seats were released before checkout started. Nothing was charged. Please pick again.","checkout.error.releasedBeforePayment":"Your seats were released before payment completed. Nothing was charged. Please pick again.","checkout.error.paymentFailed":"The payment did not complete. If you were charged, it has been refunded automatically.","checkout.error.alreadyStarted":"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.","checkout.error.eventClosed":"Sales for this event have closed.","checkout.error.salesPaused":"Ticket sales are paused for a moment while the organizer updates their account. Nothing was charged. Please try again later or contact the organizer.","checkout.error.pricing":"These seats can\u2019t be checked out right now because of a pricing setup problem. Nothing was charged. Please contact the organizer.","checkout.error.providerRefused":"The organizer\u2019s payment setup refused this payment. Nothing was charged. Please contact the organizer.","checkout.error.rateLimited":"Too many attempts. Wait a moment and try again.","checkout.error.generic":"We couldn\u2019t start the payment. Nothing was charged. Please try again.","checkout.goingTo":"You\u2019re going to {event}","checkout.confirmedTitle":"Your tickets are confirmed","checkout.sentTo":"Your tickets and QR codes are on their way to {email}, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.sentToYourEmail":"Your tickets and QR codes are on their way to your email, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.viewTickets":"View tickets & QR codes","checkout.paid":"Paid","checkout.order":"Order","checkout.keepLink":"Keep this link. It opens your tickets any time: no login, and it does not expire.","checkout.copy":"Copy","checkout.copied":"Copied","checkout.selectCopy":"Select & copy","checkout.linkCopied":"Link copied.","checkout.clipboardBlocked":"Your browser blocked the clipboard. The link is selected, press \u2318C / Ctrl+C.","bookingForm.ticketHolders":"Ticket holders","bookingForm.bookingQuestions":"About your booking","bookingForm.ticketNumber":"Ticket {number}","bookingForm.guestOf":"{area} \xB7 Guest {index} of {total}","bookingForm.useMyDetails":"Use my details","bookingForm.syncedHint":"Filled in from your details above.","bookingForm.name":"Name","bookingForm.email":"Email","bookingForm.phone":"Phone","bookingForm.optional":"(optional)","bookingForm.fixErrors":"Some details need attention before you continue.","bookingForm.error.required":"{field} is required.","bookingForm.error.tooLong":"{field} must be {max} characters or fewer.","bookingForm.error.email":"{field} must be a valid email address.","bookingForm.error.phone":"{field} must be 6\u201320 characters: digits, spaces, + - ( ).","bookingForm.error.number":"{field} must be a number.","bookingForm.error.date":"{field} must be a date.","bookingForm.error.choice":"Choose a valid option for {field}.","bookingForm.error.invalid":"Check {field}.","tickets.editNames":"Edit names","tickets.editNamesHint":"You can correct names until the event starts.","tickets.saveNames":"Save names","tickets.savingNames":"Saving\u2026","tickets.cancel":"Cancel","tickets.namesSaved":"Names updated.","tickets.editClosed":"Names can\u2019t be changed after the event starts.","tickets.editUnavailable":"Names can\u2019t be changed on this order.","tickets.saveFailed":"Couldn\u2019t save the names. Check your connection and try again.","picker.bookingForm.ticket":"Ticket {number}","picker.bookingForm.useMyDetails":"Use my details","picker.bookingForm.name":"Name","picker.bookingForm.email":"Email","picker.bookingForm.phone":"Phone","picker.bookingForm.optional":"{label} (optional)","picker.bookingForm.choose":"Choose\u2026","picker.bookingForm.required":"This is required.","picker.bookingForm.invalid":"Check this answer.","picker.bookingForm.invalidEmail":"Enter a valid email address.","picker.bookingForm.invalidPhone":"Enter a valid phone number.","picker.bookingForm.tooLong":"This is too long.","picker.bookingForm.fix":"Some details need attention.","picker.bookingForm.unsupported":"This event needs details for each ticket holder that this checkout can\u2019t collect. Your seats are still held and nothing was charged.","picker.bookingForm.continueOnEventPage":"Continue on the event page","picker.bookingForm.guestOfCount":"{label} \xB7 Guest {index} of {total}","buyer.testBookingStrip":"Test booking: no real charge, tickets not valid for entry","buyer.testTicketNotValid":"Test ticket: not valid for entry"};var Au=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],tS={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",cy:"Cymraeg",da:"Dansk",de:"Deutsch",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",en:"English",es:"Espa\xF1ol",et:"Eesti",fa:"\u0641\u0627\u0631\u0633\u06CC",fi:"Suomi",fr:"Fran\xE7ais",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hi:"\u0939\u093F\u0928\u094D\u0926\u0940",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",ms:"Bahasa Melayu",nl:"Nederlands",no:"Norsk",pl:"Polski",pt:"Portugu\xEAs",ro:"Rom\xE2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sl:"Sloven\u0161\u010Dina",sr:"\u0421\u0440\u043F\u0441\u043A\u0438",sv:"Svenska",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},sa=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],Fu=new Set(["ar","fa","he"]),Vn={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",in:"id",zsm:"ms",zh:"zh-Hans","zh-cn":"zh-Hans","zh-sg":"zh-Hans","zh-my":"zh-Hans","zh-tw":"zh-Hant","zh-hk":"zh-Hant","zh-mo":"zh-Hant"},zn=new Map(Au.map(t=>[t.toLowerCase(),t]));function _u(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=zn.get(e)??Vn[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=zn.get(o)??Vn[o];if(r)return r}return zn.get(n[0])??Vn[n[0]]}var $e={en:Bt},Li={},pe="en";function aa(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let n of[t,e,...i]){if(!n)continue;let o=_u(n);if(o)return o}return"en"}function iS(){return pe}function nS(t=pe){return Fu.has(t)?"rtl":"ltr"}function oS(t){return!!$e[t]}var Kn=new Set;function rS(t){return Kn.add(t),()=>{Kn.delete(t)}}function ct(t,e){e&&($e[t]={...$e[t],...e}),pe=$e[t]?t:"en",ra(pe),ia(pe),typeof document<"u"&&(document.documentElement.lang=pe);for(let i of Kn)i()}function sS(t){Li=t}var la=/\{(\w+)\}/g;function B(t,e){let i=Li[t]??$e[pe]?.[t]??Bt[t]??t;return e?i.replace(la,(n,o)=>String(e[o]??`{${o}}`)):i}function ca(t,e,i){let n=new Intl.PluralRules(pe).select(e);return(Li[`${t}.${n}`]??$e[pe]?.[`${t}.${n}`]??Bt[`${t}.${n}`]??Li[`${t}.other`]??$e[pe]?.[`${t}.other`]??Bt[`${t}.other`]??t).replace(la,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function aS(t,e){return na(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:pe})}function ha(t,e,i,n=!1,o=!1){let r=t.displayLabel?.trim()||t.label;return o&&!n?{title:r,detail:B("picker.heldForYou"),sellable:!1}:n||e==="booked"||e==="held"||e==="not_for_sale"?{title:r,detail:B("picker.group.legendUnavailable"),sellable:!1}:{title:r,detail:i()??"",sellable:!0}}var dt=32,da=70;function ua(t,e){let i=dt+6,n=t.y-da;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+da,e.height-i)}}var Un=.8,Nu=Math.hypot(.46,.36),Hu=.26,Gu=1.6,Wu=2*(1-Nu),ba="#0b1220",ma="#ffffff";function ga(t,e,i,n,o){let r=Math.min(Math.max(Gu,i*Hu),i*Wu);return new $n({x:t,y:e,points:[-i*.42,i*.02,-i*.1,i*.34,i*.46,-i*.36],stroke:n,strokeWidth:r,lineCap:"round",lineJoin:"round",...o?{shadowColor:ba,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function Vu(t){if(!(t instanceof Ye)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&ot(e)?e:null}var zu=220,Ku=.08,Ci=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,n){let o=n.get(e);if(n.delete(e),!i){this.retire(o);return}o?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=Y(typeof a=="string"?a:"",r.selectionColor(),ze),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:Vu(r.seatShape(e)),h=r.seatRadius(),f=new Xn({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});f.setAttrs({seatId:e,ringColor:l});let m={name:"selection-halo",stroke:G(r.categoryColor(s.categoryKey),xi(H(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;f.add(new Yn({...m,width:d.width+p*2,height:d.height+p*2,offsetX:(d.width+p*2)/2,offsetY:(d.height+p*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else f.add(new Oe({...m,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let y={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(f.add(new Yn({...y,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new Yn({...y,stroke:ai(r.canvasBackground()),width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2.5,opacity:Un}));else{let p=Math.max(0,d.width/2-14),g=-Math.max(0,d.height/2-14);f.add(new Oe({x:p,y:g,radius:10,fill:l,listening:!1})),f.add(new $n({x:p,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:H(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(f,u,h,c,y);else{let p=Math.max(1,h-1.25),g=Math.min(2.5,Math.max(1.8,h*.22));if(f.add(new Oe({...y,radius:p,strokeWidth:g})),c)f.add(new Oe({...y,stroke:ai(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Un}));else{let b=Math.max(0,p-g/2);f.add(ga(0,0,b,ma,!0))}}n.set(e,f),this.host.overlayLayer.add(f)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new Oe({...r,stroke:ai(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:Un}));return}let l=Y(a,s.selectionColor(),ze),c=On(i,{x:0,y:0,radius:n,fill:l,detail:!0});if(!c)return;c.name("selection-body"),c.listening(!1),e.add(c);let d=Ir(i,n);if(!d)return;let u=H(l)?ba:ma;e.add(ga(d.x,d.y,d.radius,u,!1))}resyncMarkers(e,i){if(e.size){for(let n of[...e.keys()])this.syncMarker(n,!0,e);i()}}retire(e){let i=this.host;if(!e)return;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let n=performance.now(),o=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-n)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(o):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(o)}play(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden||!i.seat(e))return;this.emitPulse(e,!0);let n=this.echoTimers.get(e);n&&clearTimeout(n),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},Qs))}emitPulse(e,i){let n=this.host,o=n.seat(e);if(!o)return;let r=n.seatRadius();this.pulses.get(e)?.destroy();let s=new Oe({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Dn(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,s),this.pulseHome().add(s);let a=i&&!n.isCached()?n.seatShape(e):void 0,l=performance.now(),c=()=>{a?.scale({x:1,y:1}),s.destroy(),this.pulses.get(e)===s&&this.pulses.delete(e),n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw()},d=u=>{if(n.isDestroyed()){c();return}s.getLayer()||this.pulseHome().add(s);let h=u-l,f=Dn(h/420);if(s.radius(r*f.radiusScale),s.opacity(f.opacity),a){let m=Zs(h/320);a.scale({x:m,y:m})}n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw(),h<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{n.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(d)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let n=i.seatShape(e);if(!n)return;let o=performance.now(),r=()=>{n.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!n.getLayer()){r();return}let l=a-o,c=Math.min(1,l/zu),d=1+Ku*Math.sin(Math.PI*c);n.scale({x:d,y:d}),i.seatLayer.batchDraw(),c<1?requestAnimationFrame(s):r()};requestAnimationFrame(s)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Xn({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let i=this.host;if(i.isExportMode()||i.isDestroyed())return;let n=i.nearestSeat(e,ue),o=n?i.seat(n):void 0;if(!o){this.hideLoupe();return}let r=ha(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id),i.seatOwnedHold(o.id)),s=ua(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=o.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(o.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),n=Y(i,le(i).sectionInk),o=new Xn({name:"touch-loupe",listening:!1,visible:!1});o.add(new $n({points:[-7,dt-4,0,dt+12,7,dt-4],closed:!0,fill:i,stroke:G(n,.25),strokeWidth:1,listening:!1})),o.add(new Oe({radius:dt,fill:i,stroke:G(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new Oe({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new fa({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new fa({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:G(n,.72),listening:!1,perfectDrawEnabled:!1});return o.add(r),o.add(s),o.add(a),e.overlayLayer.add(o),o.moveToTop(),this.loupe={group:o,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as Xu}from"konva/lib/Animation";var Yu=1e3/js;function ya(t){return t.findOne(".selection-halo")??null}var Ti=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let n=[],o=0;for(let[s,a]of this.markers){let l=ya(a);if(l){if(this.paintHalo(s,l),o>=Nn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:Hn(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Nn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:Hn(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new Xu(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let n=this.host,o=xi(H(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(G(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=ya(n);o&&(this.paintHalo(i,o),o.scale({x:1,y:1}),o.opacity(1),e=!0)}for(let i of this.beaconRings)i.scale({x:1,y:1}),i.opacity(1),e=!0;e&&!this.host.isDestroyed()&&this.host.overlayLayer.batchDraw()}frame(){if(this.host.isDestroyed()||!this.targets.length)return this.stop(),!1;let i=performance.now();if(i-this.lastFrameAt<Yu)return!1;this.lastFrameAt=i;let n=i-this.startedAt;for(let o of this.targets){let{scale:r,opacity:s}=Js(n,o.phase);o.node.scale({x:r,y:r}),o.node.opacity(s)}return!0}pageVisible(){return typeof document>"u"?!0:document.visibilityState==="visible"}bindVisibility(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!0)}unbindVisibility(){!this.visibilityBound||typeof document>"u"||(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!1)}};import{Group as Uu}from"konva/lib/Group";import{Circle as qn}from"konva/lib/shapes/Circle";import{Text as $u}from"konva/lib/shapes/Text";var Sa=28,qu=12,Zu="800",Qu=44,va=1.6,wa=1.95;function ka(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,n=new Map(t.zones.map(o=>[o.id,o.name]));for(let o of t.sections){let r=t.ownedSeatIds(o);if(!r.length)continue;let s=t.rung==="zones"&&o.zone!=null&&n.has(o.zone),a=s?o.zone:o.logicalId,l=e.get(a);if(l){l.count+=r.length,r.length>(i.get(a)??0)&&(i.set(a,r.length),l.seatId=r[0],l.anchor=t.sectionAnchor(o),l.toward=t.sectionCentre(o));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?n.get(o.zone):t.sectionName(o),count:r.length,seatId:r[0],anchor:t.sectionAnchor(o),toward:t.sectionCentre(o)})}return[...e.values()]}function ju(t,e){return B("map.beaconAria",{seats:ca("picker.seatCount",t),name:e})}function Ju(t,e){let i=e*wa,n=t.toward.x-t.anchor.x,o=t.toward.y-t.anchor.y,r=Math.hypot(n,o);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+n/r*i,y:t.anchor.y+o/r*i}}var ep="selection-beacon-ring",Ii=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),n=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(n===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=n,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let o=Sa/2/i,r=Math.max(Qu,Math.ceil(2*(o*wa+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Uu({listening:!1,name:"selection-beacons"});for(let c of e){let d=Ju(c,o);l.add(new qn({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*va,fill:G(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new qn({name:ep,x:c.anchor.x,y:c.anchor.y,radius:o*va,stroke:G(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new qn({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:G(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new $u({x:d.x,y:d.y,text:String(c.count),fontSize:qu/i,fontStyle:Zu,fontFamily:this.host.labelFont(),fill:a,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2),l.add(h),this.rings.push(u),this.centres.push(c.anchor),this.buttons.push(this.buildButton(c,c.anchor,r))}this.host.overlayLayer.add(l),l.moveToTop(),this.group=l,this.host.overlayLayer.batchDraw()}raise(){this.group?.moveToTop()}clear(){this.group?.destroy(),this.group=null,this.rings=[],this.targets=[],this.centres=[],this.signature="";for(let e of this.buttons)e.remove();this.buttons=[]}repositionButtons(){for(let e=0;e<this.buttons.length;e+=1){let i=this.buttons[e],n=this.host.worldToScreen(this.centres[e]),o=i.offsetWidth||parseFloat(i.style.width)||Sa;i.style.left=`${n.x-o/2}px`,i.style.top=`${n.y-o/2}px`}}buildButton(e,i,n){let o=this.host.worldToScreen(i),r=document.createElement("button");return r.type="button",r.className="sl-beacon",r.dataset.beacon=e.id,r.setAttribute("aria-label",ju(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${o.x-n/2}px`,top:`${o.y-n/2}px`,width:`${n}px`,height:`${n}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function Ot(t,e,i){let n=t.width(),o=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=n*2,d=o*2;for(let u of e){let h=u.getClientRect();if(!(!(h.width>1)||!(h.height>1))){if(h.x<-c||h.y<-d||h.x+h.width>n+c||h.y+h.height>o+d)return null;h.x<r&&(r=h.x),h.y<s&&(s=h.y),h.x+h.width>a&&(a=h.x+h.width),h.y+h.height>l&&(l=h.y+h.height)}}if(i&&i.width>=0&&i.height>=0){let u=t.scaleX(),h=i.x*u+t.x(),f=i.y*u+t.y();h<r&&(r=h),f<s&&(s=f),h+i.width*u>a&&(a=h+i.width*u),f+i.height*u>l&&(l=f+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var Pi=8,tp=.02,xa=1,La=.5;function Ca(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Ot(t,e,o);if(!s)return 0;Zn(t,s,r);let a=Math.min((r.width-2*Pi)/s.width,(r.height-2*Pi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>La?a:Math.min(a,ip(t.scaleX(),n));if(!(c>1+tp)&&!(l>La)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,u=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:u+(t.y()-u)*c});let h=Ot(t,e,o);return h&&Zn(t,h,r),c}function Qn(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=Ot(t,e,n);return r?Zn(t,r,o):!1}function ip(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(xa,e):xa)/i}function Zn(t,e,i){let n=i.x+i.width/2-(e.x+e.width/2),o=i.y+i.height/2-(e.y+e.height/2);return n===0&&o===0?!1:(t.position({x:t.x()+n,y:t.y()+o}),!0)}function qe(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as np}from"konva/lib/Group";import{Circle as Ta}from"konva/lib/shapes/Circle";import{Line as op}from"konva/lib/shapes/Line";import{Text as rp}from"konva/lib/shapes/Text";var sp=6;function Dt(t){return H(t)?"#0b1220":"#ffffff"}function Ia(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",n=0,o=0;for(let r of e)n+=r.x,o+=r.y;return{count:e.length,centroid:{x:n/e.length,y:o/e.length},fill:i,ink:Dt(i)}}var Ri=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let n=Ia({points:this.host.ownedPoints(i),categoryColor:null});if(n)return n.centroid}return null}badgeAt(e){for(let i of this.badges)if(Math.hypot(e.x-i.centre.x,e.y-i.centre.y)<=i.radius)return i.id;return null}sync(e,i="seats"){if(this.group?.destroy(),this.group=null,this.badges=[],e>=ve){this.host.overlayLayer.batchDraw();return}let n=Math.max(this.host.stageScale(),1e-4),o=new np({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Ia({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(sp/2/n,1);for(let y of a)o.add(new Ta({name:"owned-seat-dot",x:y.x,y:y.y,radius:c,fill:l.fill,stroke:G("#ffffff",.55),strokeWidth:Math.max(.5,c*.28),shadowColor:l.fill,shadowBlur:c*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(i!=="seats"||r.has(s.logicalId))continue;r.add(s.logicalId);let d=this.host.sections().filter(y=>y.logicalId===s.logicalId).reduce((y,p)=>y+this.host.ownedPoints(p).length,0),u=this.host.labelAnchor(s),h=11/n,f={x:u.x,y:u.y-h*2.1};o.add(new Ta({name:"owned-section-badge",x:f.x,y:f.y,radius:h,fill:l.fill,stroke:G(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new op({x:f.x-h*.62,y:f.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:l.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new rp({x:f.x+h*.12,y:f.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:s.logicalId,centre:f,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};import{Text as ap}from"konva/lib/shapes/Text";var lp=4;function Nt(t){return H(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function cp(t,e,i,n){let o=Math.max(0,Math.min(n,e/2,i/2));t.beginPath(),t.moveTo(o,0),t.arcTo(e,0,e,i,o),t.arcTo(e,i,0,i,o),t.arcTo(0,i,0,0,o),t.arcTo(0,0,e,0,o),t.closePath()}function Pa(t,e){t.padding(lp),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),cp(n,o,r,Math.min(r/2,8)),n.setAttr("fillStyle",e.plate),n.fill(),n.setAttr("strokeStyle",e.stroke),n.setAttr("lineWidth",1),n.stroke(),n.restore(),ap.prototype._sceneFunc.call(this,n)})}function Ra(t){return t?"seat":"section"}function Ma(t){let e=new Set,i=0;for(let o of t.memberIds){let r=t.categoryKey(o);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(o)&&(i+=1)}let n=[];for(let o of t.categoryOrder)e.has(o)&&n.push({key:o,name:t.categoryLabel(o)||o,price:t.categoryPrice(o),color:t.categoryColor(o)});return n.length?i?{mode:"section",title:t.name,fields:[],rows:n,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("picker.group.legendUnavailable")}}function Ea(t){let e=t.place?.kind==="booth",i=e?"":hp(t.label,t.sectionLabel,t.rowLabel),n=t.place?{caption:t.place.typeWord?.trim()||B(e?"picker.booth":"picker.table"),value:t.place.name}:null,o=[t.sectionLabel,t.rowLabel?B("picker.rowLabel",{label:t.rowLabel}):null,n?n.value:null,i?B("picker.seatLabel",{label:i}):null].filter(Boolean).join(" \xB7 ")||t.label,r=[t.sectionLabel?{caption:B("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:B("picker.row"),value:t.rowLabel}:null,n,i?{caption:B("picker.seat"),value:i}:null].filter(c=>c!=null),s={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},a=hr(t).map(c=>{let d=B(c.titleKey);return{icon:c.icon,title:d===c.titleKey?c.titleFallback:d,tone:c.tone,...c.note?{note:c.note}:{}}}),l=t.facts??[];return{mode:"seat",title:o,fields:r,rows:[s],notes:a,facts:l,...l.length&&t.head?{head:t.head}:{},note:l.length?null:dp(t.status,t.closed)}}function dp(t,e){return e||t==="not_for_sale"?B("picker.notForSale"):t==="booked"?B("map.statusTaken"):t==="held"?B("map.statusHeld"):null}function hp(t,e,i){let n=t;for(let o of[e,i])!o||!n.startsWith(o)||n.length<=o.length||(n=n.slice(o.length).replace(/^[\s·\-/_]+/,""));return n}var up=16,pp=8;function Aa(t,e,i,n=up){let o=pp,r=t.x+n;r+e.width>i.width-o&&(r=t.x-n-e.width);let s=t.y+n;return s+e.height>i.height-o&&(s=t.y-n-e.height),{x:Math.max(o,Math.min(r,Math.max(o,i.width-o-e.width))),y:Math.max(o,Math.min(s,Math.max(o,i.height-o-e.height)))}}var Fa=16,jn=14,_a=10.5,fp=14,mp=12.5,Ba={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},gp={warn:"#d8a425",premium:"#e8c15a"},bp=.1,yp=.06,Oa={minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",boxShadow:"0 6px 20px rgba(2,6,23,0.22)",lineHeight:"1.35"},Sp={minWidth:"",maxWidth:"",padding:"",overflow:"",borderRadius:"",boxShadow:"",lineHeight:"",background:"",backgroundColor:"",border:"",fontFamily:""},Mi=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.roomEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.presented=null;this.mount=null;this.presentedView=null;this.viewEl=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.aisleIds=new Set;this.aisleDoc=null;this.placeFacts=new Map;this.sectionEntrances=new Map;this.placeDoc=null;this.onPointerMove=e=>{if(this.fromPresenter(e))return;if(this.presented=null,this.mount=null,this.presentedView=null,e.pointerType!=="mouse"){this.hide();return}let i=this.host.container.getBoundingClientRect();this.cursor={x:e.clientX-i.left,y:e.clientY-i.top},this.schedule()};this.onPointerLeave=e=>{this.fromPresenter(e)||this.hide()};this.onPointerDown=e=>{e.pointerType!=="mouse"&&!this.fromPresenter(e)&&this.hide()};this.onWheel=e=>{this.cursor&&!this.fromPresenter(e)&&this.schedule()};this.host=e}attach(){this.attached||(this.attached=!0,this.host.container.addEventListener("pointermove",this.onPointerMove),this.host.container.addEventListener("pointerleave",this.onPointerLeave),this.host.container.addEventListener("pointerdown",this.onPointerDown),this.host.container.addEventListener("wheel",this.onWheel,{passive:!0}))}destroy(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0),this.host.container.removeEventListener("pointermove",this.onPointerMove),this.host.container.removeEventListener("pointerleave",this.onPointerLeave),this.host.container.removeEventListener("pointerdown",this.onPointerDown),this.host.container.removeEventListener("wheel",this.onWheel),this.attached=!1,this.cursor=null,this.root?.remove(),this.root=null,this.titleEl=null,this.rowsEl=null,this.notesEl=null,this.factsEl=null,this.noteEl=null,this.viewEl=null,this.signature=""}presentSeat(e,i,n,o){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),o!==void 0&&(this.presentedView=o),this.presented=e,this.mount=n,this.cursor=i,this.update()}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":e.head?[e.head.title,e.head.sub,...e.facts.map(i=>`${i.caption} ${i.value}`)].filter(Boolean).join(" | "):[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}fromPresenter(e){return!!this.mount&&e.target instanceof Node&&this.mount.contains(e.target)}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let n=this.host.hostCardOpen?.()?null:this.resolve(i);if(!n){this.hide(),this.lastUpdateMs=performance.now()-e;return}let o=this.ensureRoot(),r=`${n.mode}|${n.title}|${n.note??""}|${this.host.canvasBackground()}|`+n.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${n.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${n.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`+(n.head?`|${n.head.title}|${n.head.sub??""}|${n.head.tone??""}|${n.head.plate??""}`:"");r!==this.signature&&(this.signature=r,this.paint(n)),this.showView(this.presented?this.presentedView:null),this.model=n,o.style.display="block";let s=this.mount??this.host.container,a=Aa(i,{width:o.offsetWidth,height:o.offsetHeight},{width:s.clientWidth,height:s.clientHeight});o.style.left=`${a.x}px`,o.style.top=`${a.y}px`,this.lastUpdateMs=performance.now()-e}showView(e){let i=this.root;if(!i)return;if(!e){this.viewEl&&(this.viewEl.style.display="none");return}let n=this.viewEl;if(!n){n=document.createElement("div"),n.setAttribute("data-seat-view",""),Object.assign(n.style,{position:"relative",width:"100%",aspectRatio:"16 / 9",minWidth:"240px",backgroundSize:"cover",backgroundPosition:"center"});let r=document.createElement("span");r.textContent="View from this seat",Object.assign(r.style,{position:"absolute",left:"8px",bottom:"7px",padding:"2px 8px",borderRadius:"999px",font:"600 11px/1.4 inherit",color:"#ffffff",background:"rgba(8,12,24,0.62)"}),n.appendChild(r),this.viewEl=n}(n.parentElement!==i||i.firstChild!==n)&&i.insertBefore(n,i.firstChild);let o=`url("${e.replace(/"/g,"%22")}")`;n.style.backgroundImage!==o&&(n.style.backgroundImage=o),n.style.display="block"}resolve(e){if(this.presented)return this.seatModel(this.presented);if(Ra(this.host.seatsPickable())==="seat"){let a=this.host.hoveredSeatId()??this.host.nearestSeat(e);return a?this.seatModel(a):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;if(!i||n==null||this.host.sectionInteractive?.(i)===!1)return null;let o=this.host.sectionMembers(i),r=this.host.sectionCardHead?.(i,o)??null,s=Ma({name:n||i,memberIds:o,categoryOrder:this.host.categoryOrder(),categoryKey:a=>this.host.seat(a)?.categoryKey??null,categoryLabel:a=>this.host.categoryLabel(a),categoryPrice:a=>this.host.categoryPrice(a),categoryColor:a=>this.host.categoryColor(a),categorySellable:a=>this.host.categorySellable(a),seatSellable:a=>this.host.seatSellable(a)});return r?{...s,head:r,facts:s.rows.map(a=>({caption:a.name,value:a.price??""}))}:s}seatModel(e){let i=this.host.seat(e);if(!i)return null;let n=this.host.seatStatus(e),o=this.host.seatFacts?.(e)??null;if((n!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!o?.length)return null;let s=this.host.seatSectionLabel(e),a=o?.length?this.host.seatCardHead?.(e)??null:null;return Ea({label:i.displayLabel?.trim()||i.label,rowLabel:this.rowName(i,s),sectionLabel:s,categoryKey:i.categoryKey,categoryLabel:this.host.categoryLabel(i.categoryKey),categoryPrice:this.host.categoryPrice(i.categoryKey),categoryColor:this.host.categoryColor(i.categoryKey),status:this.host.seatStatus(e),closed:this.host.seatClosed(e),...i.accessibility?.length?{accessibility:i.accessibility}:{},...i.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{},...i.commercial?{commercial:i.commercial}:{},...this.isAisleSeat(e)?{aisle:!0}:{},...this.placeOf(i),...o?.length?{facts:o}:{},...a?{head:a}:{}})}placeOf(e){let i=this.host.chartDoc();if(!i)return{};if(this.placeDoc!==i){this.placeDoc=i,this.placeFacts.clear(),this.sectionEntrances=it(i);for(let r of ii(i))r.type!=="table"&&r.type!=="booth"||this.placeFacts.set(r.id,{kind:r.type,name:r.displayLabel?.trim()||r.label,...r.displayType?.trim()?{typeWord:r.displayType.trim()}:{},...r.type==="booth"&&r.boothType?{boothType:r.boothType}:{},...r.entrance?.trim()?{entrance:r.entrance.trim()}:{}})}let n=this.placeFacts.get(e.rowId);if(!n)return{};let o=n.entrance??(e.sectionId?this.sectionEntrances.get(e.sectionId):void 0);return{place:{kind:n.kind,name:n.name,...n.typeWord?{typeWord:n.typeWord}:{}},...n.boothType?{boothType:n.boothType}:{},...o?{entrance:o}:{}}}isAisleSeat(e){let i=this.host.chartDoc();return i?(this.aisleDoc!==i&&(this.aisleDoc=i,this.aisleIds=hi(i)),this.aisleIds.has(e)):!1}rowName(e,i){let n=this.host.chartDoc();if(!n)return null;if(this.rowNamesDoc!==n){this.rowNamesDoc=n,this.rowNames.clear();for(let r of n.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let o=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return o?Rt(o,i??void 0)||o:null}ensureRoot(){let e=this.mount??this.host.container;if(this.root)return this.root.parentElement!==e&&e.appendChild(this.root),this.root;let i=Nt(this.host.canvasBackground()),n=document.createElement("div");n.className="sl-hover-card",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",...Oa,background:i.plate,border:`1px solid ${i.stroke}`,fontFamily:this.host.labelFont(),zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Fa}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:Y(i.plate,"#0b1220")});let r=document.createElement("div");Object.assign(r.style,{display:"flex",flexDirection:"column",gap:"0"});let s=document.createElement("div");Object.assign(s.style,{display:"none",flexDirection:"column",gap:"0"});let a=document.createElement("div");Object.assign(a.style,{fontSize:`${jn}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:Y(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),n.append(o,r,s,l,a),e.appendChild(n),this.root=n,this.titleEl=o,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,n}paint(e){let i=this.ensureRoot();if(e.head)return this.paintRoomCard(i,e,e.head);this.roomEl&&this.leaveRoomCard(i);let n=Nt(this.host.canvasBackground());i.style.background=n.plate,i.style.border=`1px solid ${n.stroke}`;let o=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=Y(n.plate,"#0b1220");if(o.replaceChildren(),o.style.color=l,o.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;o.style.display="flex",o.style.padding="0";for(let[d,u]of e.fields.entries()){let h=document.createElement("div");Object.assign(h.style,{flex:u.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${n.stroke}`:"none"});let f=document.createElement("div");f.textContent=u.caption,Object.assign(f.style,{fontSize:`${_a}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let m=document.createElement("div");m.textContent=u.value,Object.assign(m.style,{marginTop:"2px",fontSize:`${Fa}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(f,m),o.append(h)}}else o.style.display="block",o.style.padding="10px 15px 9px",o.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${jn}px`,fontWeight:"700",background:c.color,color:vn(c.color)});let u=document.createElement("span");u.textContent=c.name;let h=document.createElement("span");h.textContent=c.price??"",d.append(u,h),r.appendChild(d)}this.paintNotes(s,e,n,l),this.paintFacts(this.factsEl,e,n,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=Y(n.plate,"#0b1220")}paintRoomCard(e,i,n){e.classList.add("room"),Object.assign(e.style,Sp);for(let c of[this.titleEl,this.rowsEl,this.notesEl,this.factsEl,this.noteEl])c&&(c.style.display="none");let o=this.roomEl;o||(o=document.createElement("div"),e.appendChild(o),this.roomEl=o),o.style.display="block";let r=document.createElement("div");if(r.className="slhc-head",n.plate){let c=document.createElement("span");c.className="slhc-plate",c.innerHTML=n.plate,r.appendChild(c)}let s=document.createElement("div"),a=document.createElement("b");if(a.className="slhc-title",a.textContent=n.title,s.appendChild(a),n.sub){let c=document.createElement("span");c.className="slhc-sub",c.textContent=n.sub,n.tone&&(c.style.color=n.tone),s.appendChild(c)}r.appendChild(s);let l=i.facts.map(c=>{let d=document.createElement("div");d.className="slhc-row";let u=document.createElement("span");u.textContent=c.caption;let h=document.createElement("b");return h.textContent=c.value,d.append(u,h),d});o.replaceChildren(r,...l)}leaveRoomCard(e){e.classList.remove("room"),this.roomEl?.remove(),this.roomEl=null,this.rowsEl&&(this.rowsEl.style.display="flex"),Object.assign(e.style,{...Oa,fontFamily:this.host.labelFont()})}paintFacts(e,i,n,o){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${n.stroke}`,color:o});for(let[r,s]of i.facts.entries()){let a=document.createElement("div");Object.assign(a.style,{flex:"1 1 auto",padding:"8px 12px 9px",textAlign:"center",borderLeft:r?`1px solid ${n.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${_a}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let c=document.createElement("div");c.textContent=s.value,Object.assign(c.style,{marginTop:"2px",fontSize:`${jn}px`,fontWeight:"700",whiteSpace:"nowrap"}),a.append(l,c),e.append(a)}}paintNotes(e,i,n,o){if(e.replaceChildren(),!i.notes.length){e.style.display="none";return}e.style.display="flex";for(let[r,s]of i.notes.entries()){let a=vn(n.plate)==="#ffffff"?Ba.onDark:Ba.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,gp[s.tone],bp):j(n.plate,o,yp),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${n.stroke}`:"none"});let u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("viewBox",`0 0 ${20} ${20}`),u.setAttribute("width","17"),u.setAttribute("height","17"),u.setAttribute("fill","none"),u.setAttribute("stroke",l),u.setAttribute("stroke-width","1.45"),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("aria-hidden","true"),u.innerHTML=ur(s.icon),Object.assign(u.style,{flex:"none",marginTop:"1px"});let h=document.createElement("div");Object.assign(h.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let f=document.createElement("div");if(f.textContent=s.title,Object.assign(f.style,{fontSize:`${fp}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(f),s.note){let m=document.createElement("div");m.textContent=s.note,Object.assign(m.style,{fontSize:`${mp}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(m)}d.append(u,h),e.appendChild(d)}}};var Da="#1f9d6b";function vp(t,e){if(t===e)return!0;if(!t||!e||t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function Na(t,e){let i=e?new Set(e):null;vp(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Ha(t,e){let i=t.labelLayers(),n={...i,...e};n.seatLabels===i.seatLabels&&n.rowLabels===i.rowLabels||(t.setLabelLayersState(n),t.updateLabels(),t.draw())}function Ga(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function K(t){let e=Rr(t);return e?{x:e.x,y:e.y,width:Math.max(1,e.width),height:Math.max(1,e.height)}:{x:0,y:0,width:1,height:1}}function ht(t,e,i,n){let o=n*Math.PI/180,r=Math.cos(o),s=Math.sin(o);return[{x:-e/2,y:-i/2},{x:e/2,y:-i/2},{x:e/2,y:i/2},{x:-e/2,y:i/2}].map(a=>({x:t.x+a.x*r-a.y*s,y:t.y+a.x*s+a.y*r}))}function ut(t,e,i,n,o,r){let s=n*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let u=e*(d/6-.5),h=i*(c/4-.5),f={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!te(f,o,r))return!1}return!0}function Wa(t,e,i){let n=K(t),o={x:n.x+n.width/2,y:n.y+n.height/2},r=te(o,t,e)?[o,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:n.x+n.width*c/12,y:n.y+n.height*l/12};te(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:Uo(l,a)})).sort((l,c)=>c.room-l.room).map(l=>l.point)].filter((l,c,d)=>c===d.findIndex(u=>Math.abs(u.x-l.x)<1e-6&&Math.abs(u.y-l.y)<1e-6))}function Va(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return K(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function wp(t,e){let i=t.width*t.height;if(i<=0)return 0;let n=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),o=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return n*o/i}function za(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=wp(a.bounds,i)*a.members;l<=0||n.set(a.logicalId,(n.get(a.logicalId)??0)+l)}if(!n.size)return e;let o=null,r=0;for(let[a,l]of n)l>r&&(r=l,o=a);if(!o||o===e)return e;let s=e!=null?n.get(e)??0:0;return r>s*1.35?o:e}import{Text as kp}from"konva/lib/shapes/Text";function Jn(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}var fe=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let n=this.cells.get(i);n?n.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,n=0;for(let o of this.keys(e))for(let r of this.cells.get(o)??[])i.has(r)||(i.add(r),Jn(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/At),n=Math.floor((e.x+Math.max(0,e.width))/At),o=Math.floor(e.y/At),r=Math.floor((e.y+Math.max(0,e.height))/At),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var eo=new WeakMap;function Ze(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=eo.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},eo.set(t,e);let i=()=>{let n=eo.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Ka=new WeakMap,Xa=new WeakMap;function Ya(t){let e=new Map;return{get(i){let n=JSON.stringify([i.text,i.fontSize,i.rotation]),o=e.get(n);return o||(o=new kp({text:i.text,fontSize:i.fontSize,fontStyle:"700",fontFamily:t,rotation:i.rotation,listening:!1}),o.offsetX(o.width()/2),o.offsetY(o.height()/2),e.set(n,o)),o},destroy(){for(let i of e.values())i.destroy()}}}function xp(t){let e=t.labelFont(),i=Ze(),n=Xa.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new fe,r=Ya(e);for(let s of t.rowLabelPlan){let a=r.get(s),l=t.rowLabelBox(a,{x:s.x,y:s.y}),c=s.automaticAway,d=c?Math.max(7,Math.min(16,s.fontSize*.75))*4*(Math.abs(c.x)+Math.abs(c.y)):0;o.insert({x:l.x-d,y:l.y-d,width:l.width+d*2,height:l.height+d*2})}return r.destroy(),Xa.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function Lp(t){let e=xp(t),i=[...t.freeTextById.values()].map(({node:l})=>{let c=l.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});return{x:c.x-ee,y:c.y-ee,width:c.width+ee*2,height:c.height+ee*2}}).filter(l=>e.collisionCount(l)>0),n=JSON.stringify([t.labelFont(),Ze(),t.seatR,i]),o=Ka.get(t.rowLabelPlan);if(o?.key===n&&o.seats===t.seatById)return o.boxes;let r=new fe;for(let l of i)r.insert(l);let s=Ya(t.labelFont()),a=t.rowLabelPlan.map(l=>{let c=s.get(l),d=t.resolveAutomaticRowLabelPosition(c,l,r),u=t.rowLabelBox(c,d);return r.insert(u),u});return s.destroy(),Ka.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function Ua(t,e){let i=t.sections.filter(m=>m.id===e||m.logicalId===e),n=i.map(m=>K(m.outline));if(!n.length)return null;let o=Math.min(...n.map(m=>m.x)),r=Math.min(...n.map(m=>m.y)),s=Math.max(...n.map(m=>m.x+m.width)),a=Math.max(...n.map(m=>m.y+m.height)),l=new Set(i.flatMap(m=>m.memberIds));for(let m of l){let y=t.seatById.get(m);y&&(o=Math.min(o,y.x-t.seatR),r=Math.min(r,y.y-t.seatR),s=Math.max(s,y.x+t.seatR),a=Math.max(a,y.y+t.seatR))}let c=m=>{[m.x,m.y,m.width,m.height].every(Number.isFinite)&&(o=Math.min(o,m.x),r=Math.min(r,m.y),s=Math.max(s,m.x+m.width),a=Math.max(a,m.y+m.height))},d=m=>{let y={x:m.x+m.width/2,y:m.y+m.height/2};return i.some(p=>te(y,p.outline,p.holes))};for(let{node:m,backdrop:y}of t.freeTextById.values()){let p=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),y&&c(y.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:m}of t.iconNodeById.values()){let y=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(y)&&c(y)}let u=Lp(t);t.rowLabelPlan.forEach((m,y)=>{(m.focusKeys??[]).some(g=>g===e||i.some(b=>g===b.id||g===b.logicalId))&&c(u[y])});let h=Math.max(s-o,a-r),f=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-f,y:r-f,width:Math.max(1,s-o+f*2),height:Math.max(1,a-r+f*2)}}import{Rect as Cp}from"konva/lib/shapes/Rect";import{Text as $a}from"konva/lib/shapes/Text";var to="\0";function Tp(t){let e=0;for(let i=0;i<t.length;i++){let n=t[i],o=t[(i+1)%t.length];e+=n.x*o.y-o.x*n.y}return Math.abs(e)/2}function Ip(t,e){let i=t.filter(f=>Number.isFinite(f.centroid.x)&&Number.isFinite(f.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let n=i.map(f=>({member:f,weight:Math.max(1,Tp(f.outline))})),o=n.reduce((f,m)=>f+m.weight,0),r=n.reduce((f,m)=>({x:f.x+m.member.centroid.x*m.weight/o,y:f.y+m.member.centroid.y*m.weight/o}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(f=>{let m={x:f.centroid.x-e.x,y:f.centroid.y-e.y},y={x:f.centroid.x-r.x,y:f.centroid.y-r.y};return{member:f,depth:m.x*l.x+m.y*l.y,lateral:Math.abs(y.x*-l.y+y.y*l.x)}}).sort((f,m)=>m.depth-f.depth||f.member.id.localeCompare(m.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(f=>f.depth>=u);return h.sort((f,m)=>f.lateral-m.lateral||m.depth-f.depth||f.member.id.localeCompare(m.member.id)),h[0].member}function Pp(t){let i=[...B("map.fromPrice",{price:to}).toLocaleLowerCase()],n=i.findIndex(o=>o!==to&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(to).join(t)}function Rp(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function Mp(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>Rp(n.label,i))}function qa(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Ws(t.canvasBackground),n=new Map;for(let o of t.sections)o.zone&&(n.get(o.zone)??n.set(o.zone,[]).get(o.zone)).push(o);for(let o of e.zones){let r=n.get(o.id);if(!r||!r.length||!t.derivedFloorGroups&&!Mp(o.label,r))continue;let s=r[0];for(let w of r)w.centroid.y<s.centroid.y&&(s=w);t.derivedFloorGroups&&(s=Ip(r,o.focalPoint??e.focalPoint)??s);let a=1/0,l=-1/0,c=1/0,d=-1/0;for(let w of r)for(let k of w.outline)k.x<a&&(a=k.x),k.x>l&&(l=k.x),k.y<c&&(c=k.y),k.y>d&&(d=k.y);let u=isFinite(a)&&l>a?l-a:0,h=!t.derivedFloorGroups&&isFinite(c),f=h?(a+l)/2:s.centroid.x,m=h?c:s.centroid.y,y=1/0,p=1/0;for(let w of r)for(let k of w.memberIds){let v=t.seatById.get(k),x=v&&t.catPrice.get(v.categoryKey);!v||typeof x!="number"||(v.accessible||v.accessibility?.length?p=Math.min(p,x):y=Math.min(y,x))}isFinite(y)||(y=p);let g=new Cp({x:f,y:m,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(g);let b=new $a({x:f,y:m,text:o.label,fontSize:yi,fontStyle:ls,letterSpacing:0,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1});b.offsetX(b.width()/2),b.offsetY(b.height()/2),t.bgLayer.add(b);let S=null;isFinite(y)&&(S=new $a({x:f,y:m,text:Pp(Ue(y,t.currency)),fontSize:Si,fontStyle:cs,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),S.offsetX(S.width()/2),t.bgLayer.add(S)),t.zones.push({id:o.id,anchor:{x:f,y:m},back:g,background:t.canvasBackground,name:o.label,spanWorld:u,aboveZone:h,area:isFinite(a)?{x:a,y:c,width:l-a,height:d-c}:void 0,label:b,sub:S})}}function Za(t,e){let i=t.zones.find(({back:d})=>{if(!d.visible()||d.opacity()<.5)return!1;let u=d.getClientRect();return e.x>=u.x&&e.x<=u.x+u.width&&e.y>=u.y&&e.y<=u.y+u.height});if(!i)return!1;let n=t.doc,o=n&&tt(n)==="combined"&&!n.zones?.length?n.floors?.find(d=>sr(d.id)===i.id):void 0;if(o)return t.enterFloor(o.id),!0;let r=t.sections.filter(d=>d.zone===i.id).flatMap(d=>d.outline);if(!r.length)return!1;let s=Math.min(...r.map(d=>d.x)),a=Math.max(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.y));return t.frame({x:s,y:l,width:Math.max(1,a-s),height:Math.max(1,c-l)}),!0}var Ep=new Set,Qa=16,Ap=5,Ei=class{constructor(e,i,n=8e3){this.chunks=e;this.host=i;this.warmSeats=n;this.wanted=new Set;this.built=new Map;this.loose=new Map;this.located=new Map;this.queue=[];this.pinQueue=[];this.frame=0;this.stepping=!1;this.stopped=!1}locate(e){let i=this.located.get(e);if(i===void 0){i=null;let n=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let o of n){let r=o===void 0?-1:this.chunks.get(o)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:o,seat:this.chunks.get(o)[r],index:r};break}}this.located.set(e,i)}return i??void 0}isResident(e){let i=this.locate(e);return!!i&&(this.loose.has(e)||(this.built.get(i.section)??0)>i.index)}sync(e,i=Ep){if(this.stopped)return;this.wanted=new Set(e),this.queue=e.filter(r=>(this.built.get(r)??0)<(this.chunks.get(r)?.length??0));for(let r of e)if(this.built.has(r)){let s=this.built.get(r);this.built.delete(r),this.built.set(r,s)}let n=0;for(let[r,s]of[...this.built].reverse()){if(this.wanted.has(r)||(n+=s,n<=this.warmSeats))continue;let a=[];this.chunks.get(r).slice(0,s).forEach((l,c)=>{i.has(l.id)?this.loose.set(l.id,{section:r,seat:l,index:c}):a.push(l)}),a.length&&this.host.remove(a),this.built.delete(r)}let o=[];for(let[r,s]of this.loose)i.has(r)||this.wanted.has(s.section)||(o.push(s.seat),this.loose.delete(r));o.length&&this.host.remove(o),this.pinQueue=[];for(let r of i)this.locate(r)&&!this.isResident(r)&&this.pinQueue.push(r);!this.frame&&!this.stepping&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}step(){if(this.frame=0,this.stopped)return;this.stepping=!0;let e=this.host.now(),i=!1,n=()=>!i||this.host.now()-e<Ap;for(;this.pinQueue.length&&n();){let o=[];for(let r of this.pinQueue.splice(0,Qa)){let s=this.locate(r);s&&!this.isResident(r)&&(o.push(s.seat),this.loose.set(r,s))}o.length&&this.host.build(o),i=!0}for(;this.queue.length&&n();){let o=this.queue[0],r=this.chunks.get(o);if(!r){this.queue.shift();continue}let s=this.built.get(o)??0,a=Math.min(s+Qa,r.length),l=[];for(let c=s;c<a;c++)this.loose.delete(r[c].id)||l.push(r[c]);l.length&&this.host.build(l),this.built.set(o,a),a===r.length&&this.queue.shift(),i=!0}this.host.draw(),this.stepping=!1,!this.stopped&&!this.frame&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}finish(){this.cancel();for(let[e,i]of this.chunks){let n=i.slice(this.built.get(e)??0).filter(o=>!this.loose.has(o.id));n.length&&this.host.build(n),this.built.set(e,i.length)}this.loose.clear(),this.queue=[],this.pinQueue=[],this.host.draw()}cancel(){this.stopped=!0,this.frame&&this.host.cancel(this.frame),this.frame=0}get pending(){return(this.queue.length>0||this.pinQueue.length>0)&&!this.stopped}get nodeCount(){return[...this.built.values()].reduce((e,i)=>e+i,0)+this.loose.size}};function ja(t,e,i,n=1e3){let o=new Set,r=s=>{for(let a of s){if(o.size>=n)return!1;a&&o.add(a)}return o.size<n};return r(t)&&r(e)&&r(i),o}import{Circle as Vp}from"konva/lib/shapes/Circle";import{Line as zp}from"konva/lib/shapes/Line";import{Rect as Kp}from"konva/lib/shapes/Rect";import{Text as Xp}from"konva/lib/shapes/Text";function Ie(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Pe(t,e){return Ie(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Ja=.35,el=.7,Qe="#0b1220",pt="#ffffff",tl="#0b1220",io="#232c40",il="#8b93a7";function no(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var oo="#f7f8fb";import{Text as ol}from"konva/lib/shapes/Text";var nl="500",Fp=2.5;function _p(t,e){return t>=ie||e&&t>=gi}function Bp(t){return t.effectiveScale<gi?!1:t.focusActive||t.stageWidth<U}function Op(t,e,i){return i&&e>=gi?Math.max(t,Jr/Math.max(e,1e-4)):t}function Dp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=V/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(st,r),s)}function ro(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function rl(t){let e=new Map;for(let o of t){let r=e.get(o.rowId);r?r.push(o):e.set(o.rowId,[o])}let i=[];for(let o of e.values())if(!(o.length<2))for(let r=1;r<o.length;r+=1){let s=Math.hypot(o[r].x-o[r-1].x,o[r].y-o[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((o,r)=>o-r);let n=Math.floor(i.length/2);return i.length%2?i[n]:(i[n-1]+i[n])/2}function sl(t,e){return e>0?Math.min(t,e/2):t}function al(t){return Ai(so(t))}function so(t){let e=ro(t,!1),i=ro(J,!1),n=e>0?i/e:1;return me/Math.max(1,n)}function Ai(t){return V/Math.max(t,1e-4)/Pn(1,!1,V)}function ll(t){return Ai(t)*wi}function Np(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function cl(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=Bp({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:Pn(e,t.labelsWereVisible(),V),o=t.labelLayers(),r=o.seatLabels&&_p(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=g=>{let b=t.worldToScreen({x:g.x(),y:g.y()}),S=g.width()*e,w=g.height()*e;return b.x-S/2>=0&&b.y-w/2>=0&&b.x+S/2<=t.stage.width()&&b.y+w/2<=t.stage.height()};for(let[g,b]of t.boothLabelById){let S=t.circleById.get(g);b.visible(be(b.fontSize(),n)&&!!S?.isVisible()&&t.focusedSeatOpacity(g,S?.getAbsoluteOpacity()??1)>=.5&&s(b))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0,c=t.rowLabelDwell,d=t.gesturing?.()??!1,u=performance.now();if(c?.begin(),r)for(let g of t.visibleSeatCandidates()){if(g.kind==="booth")continue;let b=t.worldToScreen(g);if(b.x<-20||b.x>t.stage.width()+20||b.y<-20||b.y>t.stage.height()+20||t.accessGlyphById.has(g.id)&&t.accessGlyphShouldShow(g.id))continue;let S=t.circleById.get(g.id);if(!S?.isVisible()){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let w=t.statusById.get(g.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(g.id)&&(w==="booked"||w==="not_for_sale"||w==="held"&&!t.ownedHold.has(g.id))){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(g.id)){t.seatLabelDrops.set(g.id,"selection-tick");continue}if(S&&t.opts.organizerGlyph?.isPainted(S)){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.focusedSeatOpacity(g.id,S.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let x=Op(me*t.seatLabelScale(g),e,i),T=si(g.displayLabel??g.label),P=S?t.seatLabelInk(g,S):t.seatPreferredLabelInk(g),L=t.seatLabelPool.get(g.id);L?(L.position({x:g.x,y:g.y}),L.text(T),L.fontSize(x),L.fontFamily(t.labelFont()),L.fill(P),L.offset({x:0,y:0}),L.scale({x:1,y:1})):(L=new ol({x:g.x,y:g.y,text:T,fontSize:x,fontStyle:nl,fontFamily:t.labelFont(),fill:P,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(g.id,L));let C=ro(t.seatR,i);if(L.fontSize(Dp({authoredFontSize:x,measuredWidth:L.width(),maxWidth:C,effectiveScale:e})),L.width()>C+.01){t.seatLabelDrops.set(g.id,"label-overflows-marker");continue}if(!be(L.fontSize(),e)){t.seatLabelDrops.set(g.id,"below-minimum-size");continue}if(L.offsetX(L.width()/2),L.offsetY(L.height()/2),Np(t,g.id,L),!s(L)){t.seatLabelDrops.set(g.id,"outside-viewport");continue}if(!(c&&!c.admit(`seat:${g.id}`,u,d))&&(a.add(g.id),t.seatLabelById.set(g.id,L),++l>=es))break}for(let[g,b]of t.seatLabelPool)a.has(g)||(b.destroy(),t.seatLabelPool.delete(g));let h=new fe;for(let{node:g}of t.freeTextById.values()){if(!g.isVisible())continue;let b=g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:b.x-ee,y:b.y-ee,width:b.width+ee*2,height:b.height+ee*2})}let f=new fe,m=null,y=()=>{if(m)return m;m=new fe;for(let g of t.seatLabelById.values()){if(!g.isVisible())continue;let b=g.getClientRect({skipShadow:!0,skipStroke:!0});m.insert({x:b.x,y:b.y,width:b.width,height:b.height})}return m},p=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Fp;if(o.rowLabels)for(let g of Hp(t.rowLabelPlan)){let b=t.rowLabelPlan[g],S=t.focusedSectionId!=null&&b.focusKeys?.includes(t.focusedSectionId),w=Math.max(e,1e-4),k=S?Math.max(b.fontSize,Et/w):b.fontSize,v=Math.max(Math.min(k,jr(t.stage.width())/w),S?Et/w:0);if(!r&&(!S||!p)||!S&&!be(v,n))continue;let x=t.worldToScreen({x:b.x,y:b.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let T=new ol({x:b.x,y:b.y,text:b.text,fontSize:v,fontStyle:nl,fontFamily:t.labelFont(),fill:b.ink,rotation:b.rotation,opacity:b.opacity,shadowColor:"#05070c",shadowBlur:b.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:b.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});b.pill&&Pa(T,b.pill),T.offsetX(T.width()/2),T.offsetY(T.height()/2);let P=t.resolveAutomaticRowLabelPosition(T,b,h);T.position(P),T.setAttr("rowLabel",!0),b.rowKey&&T.setAttr("rowKey",b.rowKey),T.setAttr("focusKeys",b.focusKeys??[]),t.rowLabelGroup.add(T);let L=T.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,I=L.x<C?C-L.x:L.x+L.width>t.stage.width()-C?t.stage.width()-C-L.x-L.width:0,R=L.y<C?C-L.y:L.y+L.height>t.stage.height()-C?t.stage.height()-C-L.y-L.height:0,M=P;if(I||R){let _=t.labelGroup.getAbsoluteTransform(),F=_.point(P);if(M=_.copy().invert().point({x:F.x+I,y:F.y+R}),b.automaticAway&&Math.abs((M.x-P.x)*-b.automaticAway.y+(M.y-P.y)*b.automaticAway.x)>(t.markerR??t.seatR)){T.destroy();continue}T.position(M);let N=T.getClientRect({skipShadow:!0,skipStroke:!0});if(y().collisionCount({x:N.x,y:N.y,width:N.width,height:N.height})>0){T.destroy();continue}}let E=t.rowLabelBox(T,M),A=Qr/w;if(f.collisionCount({x:E.x-A/2,y:E.y-A/2,width:E.width+A,height:E.height+A})>0){T.destroy();continue}if(b.automaticAway&&h.collisionCount(E)>0){T.destroy();continue}if(c&&!c.admit(`row:${g}`,u,d)){T.destroy();continue}h.insert(E),f.insert(E)}c?.end(),t.overlayLayer.batchDraw()}function Hp(t){let e=o=>o.focusKeys?.length?o.focusKeys.join(" "):"",i=[],n=0;for(;n<t.length;){let o=e(t[n]),r=n;for(;r+1<t.length&&e(t[r+1])===o;)r++;if(o){i.push(n),r>n&&i.push(r);for(let s=n+1;s<r;s++)i.push(s)}else for(let s=n;s<=r;s++)i.push(s);n=r+1}return i}function ao(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:so(e)}}function Gp(t){let e=ft(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:J*2,labelFontSize:ge({width:e.width,height:e.height,text:t.label})}}function ft(t){let e=t.points;if(!e||e.length<3)return{width:Math.abs(t.width),height:Math.abs(t.height)};let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=Math.min(i,s.x),o=Math.max(o,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y));return Number.isFinite(i)?{width:o-i,height:r-n}:{width:Math.abs(t.width),height:Math.abs(t.height)}}function dl(t,e){let i=ao(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?Gp({...e.blockDims.get(o.rowId)??{width:J*2,height:J*2},label:o.displayLabel??o.label}):i;(!n||r.labelFontSize<n.labelFontSize||r.labelFontSize===n.labelFontSize&&r.diameter<n.diameter)&&(n=r)}return n??i}function Wp(t){return ll(t.labelFontSize)}function hl(t){return Ai(t.labelFontSize)}function Fi(t){let e=Math.max(t.diameter,1e-4);return Math.max(ae,ci/e)}function ul(t){return Math.max(Wp(t),Fi(t)*wi)}function pl(t){for(let e of t.seats){if(e.kind==="booth"){Yp(t,e);continue}let i=t.seatContainer(e.id),n=Ys({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:Pr(e.glyph,t.catByKey.get(e.categoryKey)),wheelchairBay:e.wheelchairSpaceType==="no-seat"});if(n instanceof Ye&&t.glyphMarkers.push(n),n.setAttr("seatId",e.id),t.circleById.set(e.id,n),t.paintSeat(n,e.id),i.add(n),e.accessible){if(e.wheelchairSpaceType!=="no-seat"){let o=new Vp({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Pt(e.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(e.id,o),i.add(o)}if(nt(e.accessibility??[])){let o=t.buildAccessGlyph(e,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(e.id,o),i.add(o)}}}}function Yp(t,e){let i=t.seatContainer(e.id),n=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},o=e.x,r=e.y,s;if(n.points&&n.points.length>=3?(s=new zp({x:e.x,y:e.y,points:n.points.flatMap(c=>[c.x,c.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),o=e.x+n.points.reduce((c,d)=>c+d.x,0)/n.points.length,r=e.y+n.points.reduce((c,d)=>c+d.y,0)/n.points.length):s=new Kp({x:e.x,y:e.y,width:n.width,height:n.height,offsetX:n.width/2,offsetY:n.height/2,rotation:n.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s),n.nameHidden){t.paintSeat(s,e.id);return}let a=e.displayLabel??e.label,l=new Xp({x:o,y:r,text:a,fontSize:n.nameSize??ge({...ft(n),text:a}),fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??Qe,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),t.boothLabelById.set(e.id,l),i.add(l),t.paintSeat(s,e.id)}function fl(t,e,i,n){let o=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!n?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.seatR*s+i,d=Math.hypot(l.x-e.x,l.y-e.y);d<=c&&d<r&&(r=d,o=a.id)}return o}function ml(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),n=null,o=1/0;for(let r of t.seats){let s=r.x-i.x,a=r.y-i.y,l=s*s+a*a;l<o&&(o=l,n=r.rowId)}return n?t.objectFloor.get(n)??null:null}import{Circle as bf}from"konva/lib/shapes/Circle";import{Group as Hl}from"konva/lib/Group";import{Rect as yf}from"konva/lib/shapes/Rect";import{Text as Sf}from"konva/lib/shapes/Text";var Re=1.12;function mt(t,e,i,n){if(e.width<=0||e.height<=0)return t.scaleX();let o=n??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(o.width/(e.width*Re),o.height/(e.height*Re));return q(r,i.min,i.max)}var Ht=.55;function Gt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function lo(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??_t,a=e.scaleX(),l=mt(e,i,n,o)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(o.x+o.width/2),d=r.y-(o.y+o.height/2);return Math.hypot(c,d)<=Math.min(o.width,o.height)*.02}function gl(t,e,i,n){let o=q(e,n.min,n.max),r=t.scaleX();if(o===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.setAttrs({scaleX:o,scaleY:o,x:i.x-s*o,y:i.y-a*o}),!0}function bl(t,e,i,n,o,r){let s=o??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Re),s.height/(e.height*Re)),l=n??i.min,c=q(Math.max(a,l),i.min,Math.max(l,Gt(i,r)));t.scale({x:c,y:c}),t.position({x:s.x+s.width/2-(e.x+e.width/2)*c,y:s.y+s.height/2-(e.y+e.height/2)*c})}function yl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function co(t,e){let i=null;for(let n of t){let o=e.get(n)?.logicalId;if(!o||i!=null&&i!==o)return null;i=o}return i}function Sl(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Up="500",$p=11;function qp(t){let e=lt($p,t),i=bi(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var Zp=4;function Qp(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let n=i[0];for(let o of i)o.length>=n.length&&(n=o);return n}return e}function vl(t,e,i){let n=t.numberLabel,o=Qp(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.fontStyle(i<U?Up:Ce),n.visible(!0),n.rotation(0);let r=Zp/e;for(let s of qp(i)){n.fontSize(s/e),n.offsetX(n.width()/2),n.offsetY(n.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(n.position(a),ut(a,n.width()+r,n.height()+r,0,t.outline,t.holes))return!0}return n.position(t.centroid),!1}function wl(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let n=e.get(i.logicalId);n?n.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let n=i[0];for(let o of i)o.labelArea>n.labelArea&&(n=o);for(let o of i)o!==n&&o.numberLabel.opacity(0)}}function Tl(t,e){let i=t.sectionHeat.get(e.id)??t.sectionHeat.get(e.logicalId)??(e.zone?t.sectionHeat.get(e.zone):void 0);if(i==null||i<=0){e.outlinePoly.stroke(G(e.outlineTint,.5)),e.outlinePoly.fill(G(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(G(n,.72+i*.25)),e.outlinePoly.fill(G(n,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(n),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function ho(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function Il(t,e,i,n){if(!e)return 0;let o=0;for(let r of t){if(i(r)!=="free")continue;let s=n(r);s&&Ie(s,e)&&(o+=1)}return o}function Pl(t,e){return ho(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Rs?"nearly-gone":"normal"}function Rl(t,e){let i=Pl(t,e),n=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,o=t.blockPaint?.({id:e.logicalId,label:e.label,free:e.free,total:e.total,state:i})??null;e.stateWord=o?.stateWord??null;let r=Hs(t.canvasBackground,i,n?null:o?o.tint??null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(i==="sold-out"?B("map.soldOut"):B("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Ml(t,e){return j(e,H(t)?"#ffffff":"#000000",ks)}function uo(t,e,i=0){let n=ws-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function jp(t,e){return El(t,e)!=null}function El(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function Al(t,e,i){let n=uo(t.label,e,i?i.length+1:0),o=t.stateWord?[`${n} \xB7 ${t.stateWord}`]:[];return i?[...o.map(r=>`${i} ${r}`),`${i} ${n}`,i]:[...o,n]}function Jp(t,e,i){let n=Al(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(vs),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Be:0)}function ef(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var tf=.05;function Fl(t){if(!t.seatCount)return!1;let e=0;for(let n of t.sections)e+=n.memberIds.length;return(t.seatCount-Math.min(e,t.seatCount))/t.seatCount<=tf}function _l(t,e){let i,n;t.reducedMotion?(i=e<=Le?1:0,n=e<=Ke?1:0):(i=q((ve-e)/(ve-Le),0,1),n=q((Le-e)/(Le-Ke),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Q;o&&(i=1),(!t.zones.length||t.sectionsPinned)&&(n=0),t.seatLayer.opacity(Fl(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>Mn);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<U,c=l&&o&&t.zones.length===0,d=le(t.canvasBackground),u=q((i-.2)/.8,0,1),h=new Set(t.zones.map(p=>p.id)),f=new Set,m;for(let p of t.sections){let g=t.hasFocusDimOverlay?1:a&&p.id!==a&&p.logicalId!==a&&p.zone!==a?Te:1,b=El(t,p);b&&p.zone&&f.add(p.zone);let S=Math.min(g,Sl(p.memberCategoryKeys,t.categoryFilter)?Te:1,t.accessFilterActive&&!b?Te:1);p.outlinePoly.opacity(o?0:(1-i)*S),p.blockPoly.opacity(rs*i*S);let w=t.sectionIsOwned(p);p.blockPoly.stroke(w?t.selectionColor:p.shellStroke||d.sectionStroke),p.blockPoly.strokeWidth((w?ss:Xe)/Math.max(r,1e-4));let k=p.blockPoly.fill(),v=typeof k=="string"?k:p.baseFill,x=!!p.shellCategoryColor&&!p.explicitInk&&["normal","nearly-gone"].includes(Pl(t,p)),T=x?zs(p.shellCategoryColor,v,4.5):Vs(v,p.explicitInk,p.preferredInk,wr);p.nameLabel.fill(T),p.subLabel.fill(T),Jp(p,l,b);let P=p.zone!=null&&h.has(p.zone);s&&(u>.01||p.externalLabel)&&(m??=rf(t.sections),af(t,p,r,Al(p,l,b),!P&&m));let L=b||!P?1:1-n;p.nameLabel.opacity(p.nameLabelFits?(p.externalLabel?1:u)*L*S:0),p.subLabel.opacity(0);let C=c&&!p.nameLabelFits,I=P&&n>.01;s&&(p.numberLabelFits=(I||C)&&vl(p,r,t.stageWidth)),p.numberLabelFits&&p.numberLabel.fill(x?T:de(v,p.explicitInk,p.preferredInk)),p.numberLabel.opacity(p.numberLabelFits?(C?u:I?n:0)*S:0);let R=p.nameLabel.opacity(),M=p.numberLabel.opacity();if(R>.05&&M>.05){let E=Math.min(1*S,R+M);R>=M?(p.nameLabel.opacity(E),p.numberLabel.opacity(0)):(p.numberLabel.opacity(E),p.nameLabel.opacity(0))}}let y=n;for(let p of t.zones){let g=t.accessFilterActive&&!f.has(p.id)?Te:1,b=p.label.visible()?y*g:0;p.back.opacity(b),p.label.opacity(b),p.sub&&p.sub.opacity(kl(t,p)?0:b),s&&lf(t,p,r)}if(!t.glideInProgress&&(u>.01||y>.01)){of(t,r),nf(t.sections);for(let p of t.zones){let g=p.label.opacity();p.back.opacity(g),p.sub&&p.sub.opacity(kl(t,p)?0:g)}}(y>.01||c)&&wl(t.sections);for(let p of t.sections)ef(p);t.bgLayer.batchDraw()}function kl(t,e){return t.stageWidth<U||!e.sub||!e.sub.visible()}function nf(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let n=i.filter(o=>o.nameLabel.opacity()>.05).sort((o,r)=>{let s=K(o.outline),a=K(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function of(t,e){let n=[],o=u=>{let h=t.worldToScreen({x:u.x(),y:u.y()}),f=K(ht({x:0,y:0},u.width()*e,u.height()*e,u.rotation()));return{x:h.x-f.width/2,y:h.y-f.height/2,w:f.width,h:f.height}};for(let u of t.zones){if(u.label.opacity()<=.05)continue;let h=u.back.getAbsolutePosition(),f=u.back.width()*e,m=u.back.height()*e;n.push({node:u.label,tier:2,section:!1,zone:u,box:{x:h.x-f/2,y:h.y-m/2,w:f,h:m}})}for(let u of t.sections){if(u.nameLabel.opacity()>.05){let h=jp(t,u)?-1:1;n.push({node:u.nameLabel,tier:h,section:!0,area:u.labelArea,box:o(u.nameLabel)})}u.numberLabel.opacity()>.05&&n.push({node:u.numberLabel,tier:1,section:!1,area:u.labelArea,box:o(u.numberLabel)})}let r=t.landmarks.map(u=>{let h=t.worldToScreen({x:u.x,y:u.y}),f=t.worldToScreen({x:u.x+u.width,y:u.y+u.height});return{x:Math.min(h.x,f.x),y:Math.min(h.y,f.y),w:Math.abs(f.x-h.x),h:Math.abs(f.y-h.y)}});if(n.length<2&&!r.length)return;n.sort((u,h)=>u.tier-h.tier||(h.area??0)-(u.area??0)||u.box.y-h.box.y||u.box.x-h.box.x);let s=[...r],a=u=>s.some(h=>u.x<h.x+h.w+4&&h.x<u.x+u.w+4&&u.y<h.y+h.h+4&&h.y<u.y+u.h+4),l=n.some(u=>u.zone)?uf(t):[],c=t.bgLayer.getStage()?.height()??1/0,d=u=>!a(u)&&!l.some(h=>hf(u,h,2))&&u.x>=6&&u.x+u.w<=t.stageWidth-6&&u.y>=Bl&&u.y+u.h<=c-6;for(let u of n){if(u.zone){let f=pf(t,u.zone,u.box,d);f?s.push(f):u.node.opacity(0);continue}if(!a(u.box)){s.push(u.box);continue}let h=!1;if(u.section){let f=u.node.fontSize(),m=u.node.y(),y=u.node.letterSpacing()>0;for(let p of Rn){let g=f*p;if(g*e<Ft(t.stageWidth))break;Me(u.node,g,m),y&&(u.node.letterSpacing(u.node.fontSize()*Be),u.node.offsetX(u.node.width()/2));let b=o(u.node);if(!a(b)){s.push(b),h=!0;break}}h||(Me(u.node,f,m),y&&(u.node.letterSpacing(u.node.fontSize()*Be),u.node.offsetX(u.node.width()/2)))}h||u.node.opacity(0)}}function Me(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}var xl=8;function rf(t){if(t.length<=xl)return!0;let e=new Set;for(let i of t)if(e.add(i.logicalId),e.size>xl)return!1;return!0}function sf(t,e,i){let n=K(t);return ge({width:n.width*i,height:n.height*i,text:e})}function af(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<U,s=Ft(t.stageWidth),a=En(at*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&Fl(t)?Math.max(a,sf(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Me(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,f]of n.entries()){e.nameLabel.text(f);let m=K(e.outline),y=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:m.height>m.width*Is?[0,-90]:[0];for(let p of y)for(let g of e.labelAnchors)for(let b=c;b>=s;b-=1){e.nameLabel.rotation(p),Me(e.nameLabel,b/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(g);let S=Ts/i;if(ut(g,e.nameLabel.width()+S,e.nameLabel.height()+S,p,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=h>0;return}}}e.nameLabel.text(n[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Me(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=K(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function Ll(t,e,i){let n=o=>(t.text(o),t.width());if(!(n(e)<=i)){for(let o=e.length-1;o>=1;o-=1)if(n(`${e.slice(0,o).trimEnd()}\u2026`)<=i)return;n("\u2026")}}function lf(t,e,i){let n=vi(t.stageWidth),o=t.stageWidth<U,r=e.sub!=null&&!o,s=(o?ds:us)*n/i,a=(o?hs:ps)*n/i,l=En(yi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Me(e.label,l/i,e.anchor.y),r&&(Me(e.sub,lt(Si,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*as),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*ms/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*gs-s*2:1/0,u=Math.min(c,d),h=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&h()>u&&(r=!1),h()>u)for(let x of Rn){let T=Math.max(_e,l*x);if(T>=e.label.fontSize()*i-.001||(Me(e.label,T/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(Ll(e.label,e.name,Math.max(u,1)),cf(e.label.text())<df(e.name)&&Ll(e.label,e.name,Math.max(c,1)),Me(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){Cl(e);return}e.label.visible(!0),e.back.visible(!0);let f=r?3*n/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let m=Math.max(e.label.width(),r?e.sub.width():0)+s*2,y=e.label.height()+(r?f+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(f+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+f)/2),e.back.position(e.anchor),e.back.size({width:m,height:y}),e.back.offset({x:m/2,y:y/2}),e.back.cornerRadius(fs*n/i),e.back.strokeWidth(1/i),e.aboveZone&&_i(e,0,-(y/2+4*n/i));let p=e.back.getAbsolutePosition(),g=6,b=m*i;if(b>t.stageWidth-g*2){Cl(e);return}let S=b/2,k=(q(p.x,g+S,t.stageWidth-g-S)-p.x)/i;Math.abs(k)>.001&&_i(e,k,0);let v=Bl+y*i/2;p.y<v&&_i(e,0,(v-p.y)/i)}function cf(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function df(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function Cl(t){t.label.visible(!1),t.label.opacity(0),t.back.visible(!1),t.back.opacity(0),t.sub&&(t.sub.visible(!1),t.sub.opacity(0))}function _i(t,e,i){t.label.x(t.label.x()+e),t.label.y(t.label.y()+i),t.sub&&(t.sub.x(t.sub.x()+e),t.sub.y(t.sub.y()+i)),t.back.x(t.back.x()+e),t.back.y(t.back.y()+i)}var Bl=62;function hf(t,e,i){return t.x<e.x+e.w+i&&e.x<t.x+t.w+i&&t.y<e.y+e.h+i&&e.y<t.y+t.h+i}function uf(t){return t.sections.map(e=>{let i=K(e.outline),n=t.worldToScreen({x:i.x,y:i.y}),o=t.worldToScreen({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(n.x,o.x),y:Math.min(n.y,o.y),w:Math.abs(o.x-n.x),h:Math.abs(o.y-n.y)}})}function pf(t,e,i,n){let o=[i];if(e.area){let a=t.worldToScreen({x:e.area.x,y:e.area.y}),l=t.worldToScreen({x:e.area.x+e.area.width,y:e.area.y+e.area.height}),c=(a.x+l.x)/2-i.w/2,d=(a.y+l.y)/2-i.h/2;o.push({...i,x:c,y:l.y+6},{...i,x:a.x-6-i.w,y:d},{...i,x:l.x+6,y:d})}for(let s of bs)s!==0&&o.push({...i,y:i.y+s});let r=t.stageScaleX||1;for(let s of o)if(n(s))return s!==i&&_i(e,(s.x-i.x)/r,(s.y-i.y)/r),s;return null}function ff(t,e){if(!t.length)return null;let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of t)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(s.x<i&&(i=s.x),s.y<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(n)?null:{x:i-e,y:n-e,width:o-i+e*2,height:r-n+e*2}}function mo(t,e=0){let i=new Map;for(let o of t){let r=`${o.rowId}|${o.categoryKey}`,s=i.get(r);s||(s={categoryKey:o.categoryKey,points:[]},i.set(r,s)),s.points.push({x:o.x,y:o.y})}let n=[];for(let[o,r]of i){let s=ff(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function po(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),n=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,n)}function fo(t,e){let i=Math.min(t.x,e.x),n=Math.min(t.y,e.y);return{x:i,y:n,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-n}}function Ol(t){if(!t.length)return 0;let e=[...t].sort((n,o)=>n-o),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function mf(t){if(!t.length)return 0;let e=Ol(t.map(n=>Math.min(n.bounds.width,n.bounds.height)));if(t.length<2)return e;let i=[];for(let n=0;n<t.length;n+=1){let o=1/0;for(let r=0;r<t.length;r+=1)n!==r&&(o=Math.min(o,po(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return Ol(i)+e}function go(t,e){if(!t.length)return[];let i=mf(t)*(e?.gapRows??2),n=e?.minRows??2,o=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((h,f)=>h.bounds.y-f.bounds.y||h.bounds.x-f.bounds.x||h.id.localeCompare(f.id)),d=[];for(let h of c){let f=d.find(m=>po(m.bounds,h.bounds)<=i);f?(f.bounds=fo(f.bounds,h.bounds),f.rowIds.push(h.id),f.seatCount+=h.seatCount):d.push({categoryKey:a,bounds:{...h.bounds},rowIds:[h.id],seatCount:h.seatCount})}let u=!0;for(;u&&d.length>1;){u=!1;e:for(let h=0;h<d.length;h+=1)for(let f=h+1;f<d.length;f+=1)if(!(po(d[h].bounds,d[f].bounds)>i)){d[h].bounds=fo(d[h].bounds,d[f].bounds),d[h].rowIds.push(...d[f].rowIds),d[h].seatCount+=d[f].seatCount,d.splice(f,1),u=!0;break e}}for(let h of d)h.rowIds.length<n&&h.seatCount<o||(h.rowIds.sort(),s.push(h))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function Dl(t){let e=null;for(let i of t)e=e?fo(e,i.bounds):{...i.bounds};return e}function Nl(t,e){let i=null,n=1/0;for(let o of t){let{x:r,y:s,width:a,height:l}=o.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<n&&(i=o,n=c)}return i}function Wl(t){return t*.3}function Gl(t){return Wl(t)*2+t*.42}var Bi=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey="";this.pressOnChart=!0}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.pressOnChart=!0,this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=go(mo(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=le(i),o=Ml(i,i),r=Y(o,n.sectionInk),s=new Hl({listening:!1,opacity:0,visible:!1});for(let a of e){let l=this.host.categoryLabel(a.categoryKey);if(!l)continue;let c={x:a.bounds.x+a.bounds.width/2,y:a.bounds.y+a.bounds.height/2},d=new Hl({listening:!1}),u=new yf({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:Xe,opacity:xs,listening:!1,perfectDrawEnabled:!1}),h=new bf({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),f=new Sf({...c,text:l,fontSize:at,fontStyle:Ce,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(f),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:f,label:l})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,n=this.host.exportMode||this.host.seatsPickable()&&e<ae||e>=this.host.readableScale();return this.revealed=n||Yr(In(i,e),In(i,ae),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.revealed||this.capOnePerCategory(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.host.screenToWorld(e),n=this.clusterAt(i);if(!n)return!1;let o=this.host.seatR()*2,r={x:n.bounds.x-o,y:n.bounds.y-o,width:n.bounds.width+o*2,height:n.bounds.height+o*2},s=this.host.stage;if(mt(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*_t)return!1;let l=this.diveTarget(r,null,i);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i,n){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),a=mt(o,e,s,r),l=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),s.max);if(a>=l)return e;let c=r.width/(l*Re),d=r.height/(l*Re);if(!(c>0)||!(d>0))return null;let u=i??{x:e.x+e.width/2,y:e.y+e.height/2},h={x:u.x-c/2,y:u.y-d/2,width:c,height:d};return n?wf(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=Ms(i,this.host.pickableScale());if(n==null||n<=i*_t)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Re),a=r.height/(n*Re);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:o.x-s/2,y:o.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.seatsPickable()?e?"pointer":"default":this.pressOnChart?"zoom-in":"default";for(let n of[this.host.stage.container(),this.host.stage.content])n&&n.style.cursor!==i&&(n.style.cursor=i)}clusterAt(e){let i=Nl(this.all,e);if(i)return i;if(!this.visible)return null;for(let n of this.labels){if(!n.pill.visible())continue;let o=n.plate.width()/2,r=n.plate.height()/2;if(Math.abs(e.x-n.text.x())<=o&&Math.abs(e.y-n.text.y())<=r)return n.cluster}return null}size(e,i){let n=Math.max(e,1e-4),o=i<U,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=lt(at,i),a=Ls/n,l=Cs/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:f}=c;d.text(uo(c.label,o)),d.fontStyle(o?Ss:Ce);let m=s,y=0;for(;d.fontSize(Math.max(1,m/n)),d.letterSpacing(d.fontSize()*Be),y=Gl(d.fontSize())+d.width()+a*2,!(y<=f.bounds.width||m<=_e);)m=Math.max(_e,m-1);let p={x:f.bounds.x+f.bounds.width/2,y:f.bounds.y+f.bounds.height/2},g=d.height()+l*2,b=y-a*2,S=p.x-b/2;h.radius(Wl(d.fontSize())),h.position({x:S+h.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Gl(d.fontSize()),y:p.y}),u.size({width:y,height:g}),u.offset({x:y/2,y:g/2}),u.cornerRadius(g/2),u.strokeWidth(Xe/n),u.position(p)}return!0}capOnePerCategory(){if(this.labels.length<2)return;let e=this.viewportWorldRect(),i={x:e.x+e.width/2,y:e.y+e.height/2},n=new Map;for(let r of this.labels){let s=r.cluster.bounds;if(s.x>e.x+e.width||s.x+s.width<e.x||s.y>e.y+e.height||s.y+s.height<e.y)continue;let a=Math.hypot(s.x+s.width/2-i.x,s.y+s.height/2-i.y),l=n.get(r.cluster.categoryKey);(!l||a<l.distance||a===l.distance&&r.cluster.seatCount>l.entry.cluster.seatCount)&&n.set(r.cluster.categoryKey,{entry:r,distance:a})}let o=!1;for(let r of this.labels){let s=n.get(r.cluster.categoryKey)?.entry===r;r.pill.visible()!==s&&(r.pill.visible(s),o=!0)}o&&this.host.labelLayer.batchDraw()}viewportWorldRect(){let e=this.host.framingViewport(),i=this.host.screenToWorld({x:e.x,y:e.y}),n=this.host.screenToWorld({x:e.x+e.width,y:e.y+e.height});return{x:i.x,y:i.y,width:n.x-i.x,height:n.y-i.y}}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let n of this.labels){let o=e&&!e.has(n.cluster.categoryKey)?.22:1;n.pill.opacity()!==o&&(n.pill.opacity(o),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let n=mo(e,this.host.seatR()),o=go(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=Dl(o);if(!r)return null;let s=o.reduce((a,l)=>l.seatCount>a.seatCount?l:a,o[0]);return{bounds:{x:r.x-i,y:r.y-i,width:r.width+i*2,height:r.height+i*2},anchor:{x:s.bounds.x+s.bounds.width/2,y:s.bounds.y+s.bounds.height/2},singleBlock:o.length===1&&e.every(a=>a.x>=r.x&&a.x<=r.x+r.width&&a.y>=r.y&&a.y<=r.y+r.height)}}applyVisibility(e){let i=this.group;if(!i||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),i.visible(!0),this.host.reducedMotion()){i.opacity(e?1:0),i.visible(e),this.host.labelLayer.batchDraw();return}let n=i.opacity(),o=e?1:0,r=performance.now(),s=a=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let l=Math.min(1,(a-r)/90);i.opacity(n+(o-n)*l),l>=1&&i.visible(o>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}},vf=.18;function wf(t,e){let i=(n,o,r)=>{let s=o*vf;return r<n+s?r-s:r>n+o-s?r+s-o:n};return{...t,x:i(t.x,t.width,e.x),y:i(t.y,t.height,e.y)}}import{Circle as kf}from"konva/lib/shapes/Circle";import{Line as xf}from"konva/lib/shapes/Line";function Vl(t,e,i){let n=t.seatRadius(),o=new kf({x:e.x,y:e.y,radius:n,stroke:i,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.overlayLayer.add(o);let r=performance.now(),s=620,a=l=>{if(!o.getLayer())return;let c=Math.max(0,Math.min(1,(l-r)/s));o.radius(n*(1+c*1.8)),o.opacity(.9*(1-c)),t.overlayLayer.batchDraw(),c<1?requestAnimationFrame(a):(o.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(a)}function zl(t,e,i){for(let n of e){let o=n.outline,r=o.reduce((u,h)=>({x:u.x+h.x,y:u.y+h.y}),{x:0,y:0});r.x/=o.length,r.y/=o.length;let s=new xf({x:r.x,y:r.y,points:o.flatMap(u=>[u.x-r.x,u.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=u=>{if(t.isDestroyed()||!s.getLayer())return;let h=Math.max(0,Math.min(1,(u-l)/c)),m=1+(1-Math.pow(1-h,3))*.04;s.scale({x:m,y:m}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Rf}from"konva/lib/Group";import{Shape as Mf}from"konva/lib/Shape";import{Group as Lf}from"konva/lib/Group";import{Shape as Cf}from"konva/lib/Shape";function Tf(t,e,i){let n=e.length,o={x:(e[n-1].x+e[0].x)/2,y:(e[n-1].y+e[0].y)/2};t.moveTo(o.x,o.y);for(let r=0;r<n;r+=1){let s=e[r],a=e[(r+1)%n],l=e[(r-1+n)%n],c=Math.min(Math.hypot(s.x-l.x,s.y-l.y)/2,Math.hypot(a.x-s.x,a.y-s.y)/2);t.arcTo(s.x,s.y,a.x,a.y,Math.max(0,Math.min(i,c)))}t.closePath()}function If(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0,s=(a,l)=>{!Number.isFinite(a)||!Number.isFinite(l)||(a<i&&(i=a),l<n&&(n=l),a>o&&(o=a),l>r&&(r=l))};for(let a of t)s(a.x,a.y);if(e){let a=e.start;s(a.x,a.y);for(let l of e.segments){if(s(l.end.x,l.end.y),l.kind==="arc")for(let c of Pf(l,a))s(c.x,c.y);else l.kind==="bezier"&&(s(l.control1.x,l.control1.y),s(l.control2.x,l.control2.y));a=l.end}}return!(o>=i)||!(r>=n)?{x:0,y:0,width:0,height:0}:{x:i,y:n,width:o-i,height:r-n}}function Pf(t,e){let{center:i,radius:n}=t;if(!(n>0))return[];let o=Math.PI*2,r=d=>(d%o+o)%o,s=Math.atan2(e.y-i.y,e.x-i.x),a=Math.atan2(t.end.y-i.y,t.end.x-i.x),l=r(t.clockwise?a-s:s-a)||o,c=[];for(let d=0;d<4;d+=1){let u=d*(Math.PI/2);r(t.clockwise?u-s:s-u)<=l&&c.push({x:i.x+n*Math.cos(u),y:i.y+n*Math.sin(u)})}return c}function De(t,e,i,n){let o=wn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new Cf({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return Tf(l,h,r);l.moveTo(h[0].x,h[0].y);for(let f=1;f<h.length;f+=1)l.lineTo(h[f].x,h[f].y);l.closePath()}};n?(h=>{l.moveTo(h.start.x,h.start.y);let f=h.start;for(let m of h.segments)m.kind==="line"?l.lineTo(m.end.x,m.end.y):m.kind==="arc"?l.arc(m.center.x,m.center.y,m.radius,Math.atan2(f.y-m.center.y,f.x-m.center.x),Math.atan2(m.end.y-m.center.y,m.end.x-m.center.x),!m.clockwise):l.bezierCurveTo(m.control1.x,m.control1.y,m.control2.x,m.control2.y,m.end.x,m.end.y),f=m.end;l.closePath()})(n):d(t);for(let h of tr(e)){let f=wn(h)>0;d(f===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=If(t,n);return s.getSelfRect=()=>({...a}),s}var gt=class extends Lf{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(i){i!==this.viewportCulled&&(this.viewportCulled=i,i||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...i){return this.viewportCulled?this:super.drawScene(...i)}drawHit(...i){return this.viewportCulled?this:super.drawHit(...i)}_clearSelfAndDescendantCache(i){if(!this.viewportCulled){super._clearSelfAndDescendantCache(i);return}this._clearCache(i)}};function Kl(t,e){if(!e.length)return null;let i=new Rf({listening:!1});for(let n of e)i.add(De(n.outline,n.holes,{fill:Bs,stroke:G("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function Xl(t,e){let{bounds:i}=t,o=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-o,y:i.y-o},{x:i.x+i.width+o,y:i.y-o},{x:i.x+i.width+o,y:i.y+i.height+o},{x:i.x-o,y:i.y+i.height+o}],s=new Mf({fill:t.canvasBackground,opacity:1-Te,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=u=>{if(u.length){a.moveTo(u[0].x,u[0].y);for(let h=1;h<u.length;h++)a.lineTo(u[h].x,u[h].y);a.closePath()}};a.beginPath(),c(r);let d=[];for(let u of e)d.push(u.outline);d.push(...t.focusedRowLabelCutouts?.()??[]),a.save();for(let u of d)u.length<3||(a.beginPath(),c(r),c(u),a.clip("evenodd"));a.beginPath(),c(r),a.fillStrokeShape(l),a.restore()}});return t.overlayLayer.add(s),s.moveToTop(),s}var Ef=.2;function Yl(t,e){return t.startsWith("#")?j(e,t,Ef):t}var Ql=.5,$=Math.SQRT1_2,Af="#f3f4f6",Ul=4;function Ff(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Ql:Math.min(1,Math.max(0,e))}function _f(t){return t==="booked"||t==="not_for_sale"?As:Es}function $l(t,e){return Number.parseInt(t.slice(e,e+2),16)}function ql(t){let e=t.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,i,n,o]=e.toLowerCase();return`#${i}${i}${n}${n}${o}${o}`}function Bf(t,e,i){let n=ql(t),o=ql(e);if(!n||!o)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round($l(n,a)*(1-r)+$l(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Zl(t,e,i,n){let o=i*4,r=e*$,s=-e*$,a=n*$*2*o,l=n*-$*2*o,c=r+o*$,d=s+o*$,u=r-o*$,h=s-o*$;t.beginPath(),t.moveTo(c,d),t.lineTo(u,h),t.lineTo(u+a,h+l),t.lineTo(c+a,d+l),t.closePath(),t.clip()}function Of(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-Ul;o<=Ul;o++){let r=o*n*2,s=r+n,a=r*$,l=-r*$,c=s*$,d=-s*$;t.moveTo(a+i*$,l+i*$),t.lineTo(a-i*$,l-i*$),t.lineTo(c-i*$,d-i*$),t.lineTo(c+i*$,d+i*$),t.closePath()}t.clip()}function Oi(t,e){t._sceneFunc(e)}function jl(t){let e=this,i=e.attrs,n=i.markRadius||1,o=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(n*2*s<16){i.fill=i.markMidtone??o,Oi(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??Ql))*n;t.save(),Zl(t,l,n,1),i.fill=i.markBase??o,Oi(e,t),t.restore(),t.save(),Zl(t,l,n,-1),i.fill=i.markFill??o,Oi(e,t),i.markHatch&&(Of(t,n),i.fill=Af,Oi(e,t)),t.restore(),i.fill=o}function Df(t,e,i,n,o,r){let s=Ff(e),a=_f(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=Bf(n,a,1-s),l.markHatch=r,l.markRadius=o>0?o:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(jl)}function Nf(t){t.setAttr("sceneFunc",void 0)}function Ni(t){return t.attrs.sceneFunc===jl}var Di=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let n=new Set;for(let[o,r]of Object.entries(e))i.has(o)&&(r&&r.kind==="partial"?(this.marks.set(o,r),n.add(o)):this.marks.delete(o)&&n.add(o));return n}paint(e,i,n,o,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Ni(e)&&Nf(e);return}Df(e,l,n,o,r,s)}};var Jl="#9ca3af";var Hf="#f4b740",Gf="#854d0e",Wf="#1a1200",Vf="#f1f4f9",zf="#1a2234",Kf="#475569",Xf="#c3cbdc";function Yf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function ec(t,e=!1,i=!1){if(!Yf(t))return null;if(e){if(t==="not_for_sale"){let n=i?Xf:Kf;return{fill:i?zf:Vf,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:Jl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:Hf,stroke:Gf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:Wf}}return{fill:Jl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function tc(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),n=t.sectionOf(e);if(n!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===n&&i.add(d)}return i}let o=t.seats.find(c=>t.seatId(c)===e);if(!o)return i;let r=t.seatPoint(o),s=t.seatPitch>0?t.seatPitch:t.seatRadius*2,a=6*(s>0?s:1),l=a*a;for(let c of t.seats){let d=t.seatPoint(c),u=d.x-r.x,h=d.y-r.y;u*u+h*h<=l&&i.add(t.seatId(c))}return i}function ic(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Hi=Object.freeze([]),Uf=.18;function nc(t,e,i){let n=t.seat(i),o=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(n.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Hi),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=o==="held"&&t.isOwnedHold(i),u=t.organizer?.()??!1,h=d?null:ec(o,u,u&&!H(l));if(h?(e.fill(h.fill),e.stroke(h.stroke),e.strokeWidth(h.strokeWidth),e.dash(h.dash),e.opacity(h.opacity),h.scale!==1&&e.scale({x:h.scale,y:h.scale})):d?(e.fill(se(s,c===pt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===pt?se(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Ni(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(h?"":n.displayLabel??n.label);let L=t.boothExtent(n.rowId);a.fontSize(L?.nameSize??(L?ge({...L,text:n.displayLabel??n.label}):Ge)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Qe),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let f=o==="free"||o==="held"&&!t.isOwnedHold(i),m=()=>{let L=e.fill();typeof L=="string"&&e.fill(Yl(L,l))},y=t.accessFilter();if(y&&f&&!r){let L=Pe(n,y);L==="other"?(m(),e.opacity(Math.min(e.opacity(),Ja))):L==="companion"&&e.opacity(Math.min(e.opacity(),el))}let p=t.categoryHighlight();p&&o==="free"&&!r&&n.categoryKey!==p&&e.opacity(.25);let g=t.seatHighlight();g&&!r&&!g.has(i)&&e.opacity(Math.min(e.opacity(),Uf));let b=t.categoryFilter();b&&f&&!r&&!b.has(n.categoryKey)&&(m(),e.opacity(.22)),t.commercialLimitedFilter()&&o==="free"&&!r&&(n.commercial?.restrictedView||n.commercial?.obstructedView)&&e.opacity(.22);let S=t.dimmedSections();if(S.size){let L=t.seatSection(i);(L?S.has(L.id)||S.has(L.logicalId)||L.zone!=null&&S.has(L.zone):S.has(pr))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Fs),e.stroke(""),e.strokeWidth(0),e.dash(Hi),e.opacity(_s),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let w=t.boothLabel(i)??t.seatLabel(i);if(w){w.fill(t.seatLabelInk(n,e));let L=!a&&(r||d);w.visible(be(w.fontSize(),t.effScale())&&e.opacity()>=.5&&!L)}let k=t.organizerGlyph,v=h?.glyph??null,x=Ni(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(k&&v&&!x){let L=a?t.boothExtent(n.rowId):void 0,C=L?Math.min(L.width,L.height)/2:t.seatRadius();k.apply(e,v,h.glyphInk??"",C),a||w?.visible(!1)}else k?.isPainted(e)&&k.clear(e);let T=t.accessGlyph(i);if(T){let L=e.fill();T.fill(li(typeof L=="string"?L:"")),T.opacity(e.opacity()),T.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function Gi(t,e){let i=null,n=1/0;for(let[o,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),u=Math.abs(e.x-a),h=Math.abs(e.y-l);if(u>c||h>d)continue;let f=u*u+h*h;f<n&&(n=f,i=o)}return i}var $f=Math.log(1.15)/100,qf=.01,Zf=220,Qf=50;function sc(){return{kind:null,at:-1/0}}function oc(t,e,i){return e===1?t*33:e===2?t*i:t}function ac(t,e,i,n=800){let o=oc(t.deltaX,t.deltaMode,n),r=oc(t.deltaY,t.deltaMode,n),s=i-e.at<Zf&&e.kind!==null,a,l=t.deltaX===0&&Number.isInteger(t.deltaY)&&Math.abs(t.deltaY)>=Qf;return(t.ctrlKey||t.metaKey)&&!(t.deltaMode!==0||l)?a="pinch":t.ctrlKey||t.metaKey?a="notch":s&&e.kind!=="pinch"?a=e.kind:t.deltaMode!==0||l?a="notch":a="pan",e.kind=a,e.at=i,a==="pan"?{kind:"pan",dx:o,dy:r}:a==="pinch"?{kind:"zoom",factor:rc(Math.exp(-r*qf),.8,1.25),eased:!1}:{kind:"zoom",factor:rc(Math.exp(-r*$f),.5,2),eased:!0}}function rc(t,e,i){return Math.min(i,Math.max(e,t))}var bt=new WeakMap;function Wt(t){let e=bt.get(t);e&&(e.raf&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.raf),bt.delete(t))}function Wi(t,e,i){let{min:n,max:o}=t.bounds(),r=t.stage.scaleX(),s=bt.get(t.stage),a=s?.raf?s.target:r,l=Math.min(o,Math.max(n,a*e));if(t.reducedMotion()||typeof requestAnimationFrame!="function"){Wt(t.stage),t.apply(l,i);return}if(s?.raf){s.target=l,s.point=i;return}if(Math.abs(Math.log(l/r))<.002)return;let c={target:l,point:i,raf:0,last:performance.now()};bt.set(t.stage,c);let d=u=>{let h=bt.get(t.stage);if(h!==c)return;let f=Math.max(0,u-h.last);h.last=u;let m=t.stage.scaleX(),y=Math.log(h.target/m),p=1-Math.exp(-f/55),g=Math.abs(y*(1-p))<.002,b=g?h.target:m*Math.exp(y*p);t.apply(b,h.point);let S=Math.abs(b-m)>1e-9&&t.stage.scaleX()===m;if(g||S){bt.delete(t.stage);return}h.raf=requestAnimationFrame(d)};c.raf=requestAnimationFrame(d)}function Vi(t){return t?.getAttr?.("seatId")??void 0}var zi=.85,jf=.38,Jf=Object.freeze([3,3]);function em(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function lc(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function tm(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(Vt(t)||(t.clusterLabels.setPressLandsOnChart(!lc(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}var im=Object.freeze([2,2]);function nm(t){let e=null,i=0,n=!1,o=null,r=()=>{o&&(o=null,t.hoverRing.visible(!1),t.overlayLayer.batchDraw())},s=()=>{if(i=0,!e||n||t.destroyed?.())return;if(!t.manageSeatHits()||t.cached()){r();return}let a=t.nearestSeatToScreen(e,ue),l=a?t.seat(a):void 0;if(!a||!l){r();return}a!==o&&(o=a,t.hoverRing.position(l),t.hoverRing.opacity(zi),t.hoverRing.dash(im),t.hoverRing.visible(!0),t.overlayLayer.batchDraw())};return{move(a){e=a,i||(i=requestAnimationFrame(s))},hide(){e=null,r()},onSeat(a){n=a,a&&(o=null)}}}var Vt=t=>t.seatsPickable()||t.manageSeatHits();function cc(t){t.attachHoverCard();let e=tm(t),i=nm(t);t.seatLayer.on("click tap",o=>{if(t.moved()>we||t.isGhostClick(o))return;let r=Vi(o.target);r&&Vt(t)&&t.handleSeatTap(r)}),t.seatLayer.on("mouseover",o=>{let r=Vi(o.target);if(!r)return;let s=t.seat(r);if(!s)return;i.onSeat(!0),t.setHoveredId(r);let a=om(t,r);t.hoverRing.position(s),t.hoverRing.opacity(a==="muted"?jf:zi),t.hoverRing.dash(a==="muted"?Jf:Hi),t.hoverRing.visible(a!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(a==="full"),t.onHover?.(s,{mark:t.seatMark(r),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{i.onSeat(!1),t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let o=t.stage.getPointerPosition();o&&(e(o),i.move(o))}),t.stage.on("mouseleave",()=>i.hide());let n=sc();t.stage.on("wheel",o=>{o.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let r=t.container.getBoundingClientRect(),s={x:o.evt.clientX-r.left,y:o.evt.clientY-r.top},a=ac(o.evt,n,performance.now(),t.stage.height());a.kind==="pan"&&t.panBy?t.panBy(a.dx,a.dy):a.kind==="zoom"&&a.eased&&t.zoomBounds?Wi({stage:t.stage,reducedMotion:t.reducedMotion,bounds:t.zoomBounds,apply:(l,c)=>t.zoomAbout(l,c,"frame")},a.factor,s):a.kind==="zoom"&&t.zoomAbout(t.stage.scaleX()*a.factor,s,"frame"),e(s)}),t.stage.on("click tap",o=>{if(t.moved()>we||t.isGhostClick(o))return;let r=t.stage.getPointerPosition();if(!r)return;if(t.sectionCount()){let a=t.ownedBadgeAt(t.screenToWorld(r));if(a&&t.focusOwnedSeats(a))return}if(!(Vi(o.target)&&Vt(t))){let a=Gi(t.selectionMarkers(),r);if(a){t.focusSeats([a],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(r))return;if(t.rowLabelAt&&t.selectRow){let a=t.rowLabelAt(r);if(a){t.selectRow(a);return}}if(!t.cached()){if(Vi(o.target)&&Vt(t))return;if(Vt(t)){let a=t.focusedSectionId(),l=t.manageSeatHits(),c=t.nearestSeatToScreen(r,ue),d=c?t.seatSection(c):null;if(c&&(!a||l||d&&t.sectionMatchesFocus(d))){t.handleSeatTap(c);return}let u=c?null:t.nearestSeatToScreen(r,ue,!0),h=u?t.seatSection(u):null;if(u&&(!a||l||h&&t.sectionMatchesFocus(h))){t.handleSeatTap(u);return}if(a&&t.onBackdropTap&&!t.floorOverview()){let m=t.sectionAt(r);if(m&&t.sectionInteractive?.(m)===!1)return;if(m&&m!==a){let y=t.sectionTapAnchor(m,t.screenToWorld(r));t.onSectionTap?t.onSectionTap(m,y):t.focusSection(m,{anchor:y})}else m||t.onBackdropTap();return}if(a||l)return;let f=t.sectionCount()?em(t,r):null;if(!f||t.effScale()>=ie||t.sectionFrameScale(f)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let a=t.floorOverview()?t.sectionAt(r):null,l=(a?t.objectFloor(a):null)??t.deckFloorAt();if(l){t.onDeckTap(l);return}}if(t.sectionCount()){let a=t.screenToWorld(r),l=t.ownedBadgeAt(a);if(l&&t.focusOwnedSeats(l)||!l&&lc(t,r))return;let c=l??t.sectionAt(r);if(c){let d=t.sectionTapAnchor(c,a);t.onSectionTap?t.onSectionTap(c,d):t.focusSection(c,{anchor:d});return}if(!t.pressLandsOnChart(r))return}if(!t.seatsPickable()){let a=t.tableAt?.(r);if(a?.length&&t.focusSeats(a,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(r)||t.clusterLabels.glideTowardTap(r))return;let s=Math.max(Se*1.2,t.stage.scaleX()*2.5);t.zoomAbout(s,r)})}function dc(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let n=t.objectFloor(t.seat(e)?.rowId??"");if(n){t.onDeckTap(n);return}}if(t.effScale()<ie&&t.sectionCount()&&!t.manageSeatHits()){let n=t.seatSection(e);if(n){let o=t.focusedSectionId()===n.logicalId,r=t.sectionFrameScale(n.logicalId)>t.stage.scaleX()*1.02;if(!o&&r){let s=t.seat(e),a=s?{x:s.x,y:s.y}:void 0;t.onSectionTap?t.onSectionTap(n.logicalId,a):t.focusSection(n.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let n=t.seat(e)??null,o=t.hiddenByAccessFilter(e);n&&(o||t.hasSeatMark(e))&&(t.onHover?.(n,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...o?{filteredOut:!0}:{}}),t.nudgeSeat(e));return}t.hasSeatMark(e)&&t.onHover?.(t.seat(e)??null,{mark:t.seatMark(e),interaction:"press"}),t.toggleSeat(e)}function om(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function hc(t,e){return!e.manageMode||!e.marqueeSelect?!1:t.pointerType!=="touch"&&t.button===0}var uc=450;function pc(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<ae}import{Path as Lg}from"konva/lib/shapes/Path";import{Group as rm}from"konva/lib/Group";import{Line as sm}from"konva/lib/shapes/Line";import{Text as am}from"konva/lib/shapes/Text";function fc(t,e,i,n){if(!e||!n)return;let o=cr(e,i);if(!o.length)return;let r=new rm({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new sm({points:s.points.flatMap(a=>[a.x,a.y]),closed:!0,stroke:s.stroke?.color??"#8a93a6",strokeWidth:1.5,strokeScaleEnabled:!1,opacity:s.opacity??.35,listening:!1,perfectDrawEnabled:!1}));else if(s.type==="text"){let a=new am({x:s.position.x,y:s.position.y,text:s.text,fontSize:s.fontSize,fontFamily:"Inter, system-ui, sans-serif",fontStyle:"600",fill:s.color??"#8a93a6",opacity:s.opacity??.6,listening:!1});a.offset({x:a.width()/2,y:a.height()/2}),r.add(a)}t.add(r),r.moveToBottom()}var lm=10;function cm(t){let e=t.framingViewport();if(t.stage.width()>=U||t.exportMode())return e;let i=lm;return{...e,x:e.x+i,y:e.y+i,width:Math.max(1,e.width-i*2),height:Math.max(1,e.height-i*2)}}function mc(t){Wt(t.stage);let e=cm(t),i=t.revealWorldRect?.()??null,n=e.width,o=e.height,r=t.bounds();if(t.setFitScale(Math.min(n/r.width,o/r.height)||1),t.portraitFitCrop()&&!t.exportMode()){let l=n/r.width<=o/r.height,c=r.height*t.fitScale();l&&c<.55*o&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*o/r.height))}let s=hm(t);s&&t.setFitScale(dm);let a=t.fitScale();if(t.stage.scale({x:a,y:a}),t.stage.position({x:e.x+(n-r.width*a)/2-r.x*a,y:e.y+(o-r.height*a)/2-r.y*a}),t.settleView(),!t.exportMode()){let l=Ca(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<ae?ae*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);l>0&&l!==1&&t.setFitScale(t.fitScale()*l),l>0&&(t.afterViewChange(),Qn(t.stage,[t.bgLayer,t.seatLayer],e,i)),um(t,e),t.setFitPose(qe(t.stage))}t.stage.batchDraw()}var dm=Q*(1-1e-6);function hm(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Q&&e<Se}function um(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=Ot(t.stage,[t.bgLayer,t.seatLayer],n);if(!o)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&o.x+o.width<=e.x+e.width-r)return;let s=e.height-i;if(o.height<=s){Qn(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+Pi-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function zt(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,Ke*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function gc(t,e,i,n="now"){let o=t.stage.position();gl(t.stage,e,i,zt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.gestureFrame?.(),t.updateSeatGroupVisibility(),yc(t)):t.afterViewChange(),t.stage.batchDraw())}function bc(t,e,i){let n=t.stage.position();t.stage.position(t.constrainPan({x:n.x-e,y:n.y-i},n)),t.gestureFrame?.(),t.updateSeatGroupVisibility(),yc(t),t.stage.batchDraw()}function yc(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function Sc(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function pm(t,e,i,n,o=0){bl(t.stage,e,zt(t),i,Kt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function vc(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){pm(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Kt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=zt(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=q(Math.max(d,u),a,Math.max(u,Gt({min:a,max:l},i?.maxScale))),f=o.x+r/2-(n.x+n.width/2)*h,m=o.y+s/2-(n.y+n.height/2)*h,y=t.stage.scaleX(),p=t.stage.x(),g=t.stage.y();if(Math.abs(h-y)<1e-4&&Math.abs(f-p)<.5&&Math.abs(m-g)<.5){t.settleView();return}let b=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let w=k=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(k-b)/S),x=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,T=y+(h-y)*x;t.stage.setAttrs({scaleX:T,scaleY:T,x:p+(f-p)*x,y:g+(m-g)*x}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(w)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(w))}function Kt(t,e){let i=Math.max(0,Math.min(e,t.width/3,t.height/3));return i===0?t:{x:t.x+i,y:t.y+i,width:t.width-i*2,height:t.height-i*2}}import{Text as fm}from"konva/lib/shapes/Text";function wc(t){let e=new WeakMap;return()=>{let i=t(),n=i.labelFont(),o=Ze(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===n&&r.generation===o)return r.value;let s=mm(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function mm(t){let e=1/0,i=new fm({fontSize:me,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),n=t.seatR*2-3,o=new Map;for(let s of t.seats){if(s.kind==="booth"){let u=t.blockExtent?.(s);e=Math.min(e,u?ge({...u,text:s.displayLabel??s.label}):Ge);continue}let a=me*t.seatLabelScale(s),l=si(s.displayLabel??s.label),c=o.get(a);c||o.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>n?Math.max(st,a*n/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=st)break}i.destroy();let r=Number.isFinite(e)?e:Ge;return V/Math.max(st,r)}function xc(t,e,i,n,o,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:kc(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:kc(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function kc(t,e,i,n,o,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(r))return t;let l=n*e,c=Math.min(l,r*(1-s)),d=o+c-(i+n)*e,u=o+r-c-i*e;if(!(d<=u))return t;if(Number.isFinite(a)){let h=a;return Math.min(Math.max(t,Math.min(d,h)),Math.max(u,h))}return Math.min(Math.max(t,d),u)}var bo={top:0,right:0,bottom:0,left:0};function Lc(t){let e=i=>typeof i=="number"&&Number.isFinite(i)&&i>0?i:0;return t?{top:e(t.top),right:e(t.right),bottom:e(t.bottom),left:e(t.left)}:{...bo}}var gm=.7;function Cc(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,f,m)=>{let y=h+f,p=m*gm;if(y<=p||y<=0)return[h,f];let g=p/y;return[h*g,f*g]},[l,c]=a(s,o,t),[d,u]=a(n,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-u)}}function Tc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function Ic(t,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(t.scale({x:e.scale,y:e.scale}),t.position({x:e.x,y:e.y}),!0)}function Ki(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Pc(t,e){let i=e({x:t.x,y:t.y}),n=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,n.x),y:Math.min(i.y,n.y),width:Math.abs(n.x-i.x),height:Math.abs(n.y-i.y)}}function yo(t,e,i,n,o,r,s){if(!e)return{box:{x:i,y:n,width:0,height:0},fitWidth:0,fitHeight:0,x:i,y:n,baseFontSize:o,insideInk:r,fill:s};let a=((t??0)%180+180)%180,l=a*Math.PI/180,c=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=e.x+e.width/2,h=e.y+e.height/2,f=e.width*c+e.height*d,m=e.width*d+e.height*c,y={x:u-f/2,y:h-m/2,width:f,height:m},p=a===0?[e.width,e.height]:a===90?[e.height,e.width]:[Math.min(e.width,e.height),Math.min(e.width,e.height)];return{box:y,fitWidth:p[0],fitHeight:p[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var Rc=V,bm=3,ym=.5;function Sm(t){return Y(t,H(t)?"#475569":"#cbd5e1")}function Mc(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function vm(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=Rc){let u=t.measure(n.baseFontSize);return i.occupied.insert(Mc(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=Rc/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*ym)return{visible:!1,reason:"shape-too-small"};let a=bm/o,l=s.width+a*2<=n.fitWidth&&s.height+a*2<=n.fitHeight,c=n.box.x+n.box.width/2,d=l?[{where:"inside",x:n.x,y:n.y}]:[{where:"below",x:c,y:n.box.y+n.box.height+a+s.height/2},{where:"above",x:c,y:n.box.y-a-s.height/2}];for(let u of d){let h=Mc(u.x,u.y,s);if(!(i.coversSeat(h)||i.occupied.collisionCount(h)>0))return i.occupied.insert(h),{visible:!0,where:u.where,fontSize:r,x:u.x,y:u.y}}return{visible:!1,reason:"no-clear-place"}}function Ec(t){let e=[],i=new fe,n=a=>{if(!a.isVisible())return;let l=a.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});i.insert(l)};for(let a of t.freeTextById.values())a.area?e.push({record:a,spec:a.area}):n(a.node);if(!e.length)return;for(let a of t.focalLabels)n(a);let o=t.seatIndex,r={coversSeat:a=>!!o&&rt(o,a,{mode:"overlap"}).length>0,occupied:i},s=Sm(t.canvasBackground);e.sort((a,l)=>l.spec.box.width*l.spec.box.height-a.spec.box.width*a.spec.box.height);for(let{record:a,spec:l}of e){let{node:c}=a,d=vm({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);wm(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function wm(t,e,i,n){if(!i.visible){t.fontSize(e.baseFontSize),t.visible(!1);return}t.fontSize(i.fontSize),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.position({x:i.x,y:i.y}),t.fill(i.where==="inside"?e.insideInk:n),t.visible(!0)}function Ac(t){let e=t.map((n,o)=>({text:n,order:o})).filter(({text:n})=>n.node.visible()).sort((n,o)=>o.text.baseFontSize-n.text.baseFontSize||n.order-o.order),i=[];for(let{text:n}of e){let o=n.node.getClientRect({skipShadow:!0,skipStroke:!0}),r=n.node.fontSize()>n.baseFontSize;if(i.some(s=>(r||s.floored)&&Jn(o,s.box))){n.node.visible(!1),n.backdrop?.visible(!1);continue}i.push({box:o,floored:r})}}function Fc(t){let e=[];for(let i of t)i.type==="table"&&e.push({id:i.id,centre:{x:i.center.x,y:i.center.y},radius:i.shape==="round"?i.radius??40:Math.max(Math.abs(i.width??80),Math.abs(i.height??50))/2});return e}function So(t,e,i,n){let o=km(t,i,n);if(!o)return null;let r=e.filter(s=>s.rowId===o.id).map(s=>s.id);return r.length?r:null}function km(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,ci/2/n),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!o||a<o.distance)&&(o={table:r,distance:a})}return o?.table??null}function Bc(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?os:ns}function Oc(t){return Math.max(t*1.05,qr,Q*1.3)}var xm=42;function Dc(t){return xm/(2*Math.max(t,1e-4))}function je(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t)i=Math.min(i,s.x),n=Math.max(n,s.x),o=Math.min(o,s.y),r=Math.max(r,s.y);return i-=e,n+=e,o-=e,r+=e,{x:i,y:o,width:Math.max(40,n-i),height:Math.max(40,r-o)}}function Nc(t){let{stageWidth:e,stageHeight:i,fullBounds:n,visibleBounds:o,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(n.width*a),i/(n.height*a))>=s)return null;let c=t.tapAnchor??{x:o.x+o.width/2,y:o.y+o.height/2},d=r[0],u=1/0;for(let y of r){let p=(y.x-c.x)**2+(y.y-c.y)**2;p<u&&(d=y,u=p)}let h=e/(s*a),f=i/(s*a),m=je(r,0);return{bounds:{x:_c(d.x,h,m.x,m.width),y:_c(d.y,f,m.y,m.height),width:h,height:f},minScale:s}}function _c(t,e,i,n){return n<=e?i+n/2-e/2:Math.min(Math.max(t-e/2,i),i+n-e)}import{Shape as Cm}from"konva/lib/Shape";var Hc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},Lm=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function Gc(t,e){let i=new Map;for(let o of t){if(o.kind==="booth")continue;let r=e.get(o.rowId),s=Hc(o);if(!(r&&r>0)||s==null)continue;let a=Lm(o),l=i.get(a)??[];l.push({seat:o,index:s}),i.set(a,l)}let n=[];for(let o of i.values()){o.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(n.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of o){let l=r[r.length-1];if(l){let c=Hc(l),d=Math.hypot(a.seat.x-l.x,a.seat.y-l.y),u=e.get(a.seat.rowId),h=Math.max(1e-6,u*1e-6);(c==null||a.index!==c+1||d<=h||d>u*1.5)&&s()}r.push(a.seat)}s()}return n}var Xt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15;this.paints=new Map}get active(){return this.entries.length>0}paint(e,i){let n=`${e}|${i}`,o=this.paints.get(n);return o===void 0&&(this.paints.size>512&&this.paints.clear(),o=G(e,i),this.paints.set(n,o)),o}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,n,o,r,s,a,l,c=()=>1,d=()=>!1,u=()=>1/0){if(!l||!e||!n){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let m of[...e.objects,...(e.floors??[]).flatMap(y=>y.objects)])m.type==="row"&&this.spacing.set(m.id,m.seatSpacing)}if(this.focusKey!==n&&(this.focusKey=n,this.detailScale=Math.min(Math.max(1.15,c()*1.15),u()*.9)),o>=this.detailScale){this.clear();return}let h=i.filter(m=>m.id===n||m.logicalId===n||d(m)),f=h.map(m=>m.id).join("|");if(!(this.key===f&&this.active)){this.clear(),this.key=f;for(let m of h){if(m.memberIds.length>2e3||m.memberIds.some(g=>!a.has(g)||!this.spacing.has(s.get(g)?.rowId??"")))continue;let y=Gc(m.memberIds.map(g=>s.get(g)).filter(Boolean),this.spacing);if(!y.length||y.reduce((g,b)=>g+b.seats.length,0)!==m.memberIds.length)continue;let p=new Cm({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:g=>{let b=g._context,S=p.getStage(),w=S&&S.width()<=U?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;b.save(),b.lineWidth=w*2,b.lineCap="round",b.lineJoin="round";let k=v=>{let x=a.get(v.id);return this.paint(String(x.fill()),x.opacity())};for(let v of y){let x=v.points;if(x.length===1){b.fillStyle=k(v.seats[0]),b.beginPath(),b.arc(x[0].x,x[0].y,w,0,Math.PI*2),b.fill();continue}let T=v.seats.map(k),P=(R,M)=>{let E=Math.hypot(M.x-R.x,M.y-R.y);return{x:-(M.y-R.y)/E,y:(M.x-R.x)/E}},L=x.map((R,M)=>{let E=x[Math.max(0,M-1)],A=x[Math.min(x.length-1,M+1)];return Math.hypot(A.x-E.x,A.y-E.y)>.001?P(E,A):P(x[M],x[M+1]??x[M-1])}),C=(R,M,E)=>({x:R.x+M.x*w*E,y:R.y+M.y*w*E}),I=0;for(;I<x.length;){let R=I;for(;R+1<x.length&&T[R+1]===T[I];)R++;let M=I===0?x[0]:{x:(x[I-1].x+x[I].x)/2,y:(x[I-1].y+x[I].y)/2},E=R===x.length-1?x[R]:{x:(x[R].x+x[R+1].x)/2,y:(x[R].y+x[R+1].y)/2},A=I===0?L[0]:P(x[I-1],x[I]),_=R===x.length-1?L[R]:P(x[R],x[R+1]),F=[M,...x.slice(I,R+1),E],N=[A,...L.slice(I,R+1),_],oe=F.map((O,z)=>C(O,N[z],1)),W=F.map((O,z)=>C(O,N[z],-1));b.fillStyle=T[I],b.beginPath(),b.moveTo(oe[0].x,oe[0].y);for(let O of oe.slice(1))b.lineTo(O.x,O.y);if(R===x.length-1){let O=Math.atan2(_.y,_.x);b.arc(E.x,E.y,w,O,O-Math.PI,!0)}else b.lineTo(W[W.length-1].x,W[W.length-1].y);for(let O of W.slice(0,-1).reverse())b.lineTo(O.x,O.y);if(I===0){let O=Math.atan2(-A.y,-A.x);b.arc(M.x,M.y,w,O,O-Math.PI,!0)}b.closePath(),b.fill(),I=R+1}}b.restore()}});this.entries.push({section:m,shape:p,opacity:m.liftGroupSeat.opacity(),listening:m.liftGroupSeat.listening()}),m.liftGroupBg.add(p),m.liftGroupSeat.opacity(0),m.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as Tm}from"konva/lib/shapes/Text";var Wc=new WeakMap,Im=(t,e)=>{let i=new Tm({text:t,fontSize:Et,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function Vc(t,e,i,n=Im){let o=Wc.get(t);o||Wc.set(t,o=new Map);let r=`${e}\0${Ze()}`,s=o.get(r);s||o.set(r,s=new Map);let a=s.get(i);if(a!==void 0)return a;let l=0;for(let d of t){if(!d.focusKeys?.includes(i))continue;let u=n(d.text,e);l=Math.max(l,u.width,u.height)}let c=l>0?Math.ceil(l+V+ee*2+6):0;return s.set(i,c),c}function zc(t){let e=t.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(t.offsetX(e.x+e.width/2),t.offsetY(e.y+e.height/2))}var vo=1e6;function Pm(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function wo(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Xi=class{constructor(e,i=Pm()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.holdTimer=null;this.lastTapAt=0;this.rect=null;this.onLayoutChanged=()=>{this.rect=null};this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||(this.rect=null,this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button,e.shiftKey,e.altKey))};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let i=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,i)&&this.applyPointerMove(i)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId,e.type==="pointercancel")};this.onReleaseElsewhere=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId)||e.composedPath().includes(this.host.container))return;let i=e.type==="pointercancel";!i&&this.host.marqueeActive()&&this.host.updateMarquee(this.toLocal(e.clientX,e.clientY)),this.endPointer(e.pointerId,i)};this.onWindowBlur=()=>{this.abandonGesture()};this.onEscape=e=>{e.key!=="Escape"||this.pointers.size===0||!this.host.marqueeActive()||(e.preventDefault(),e.stopPropagation(),this.abandonGesture())};this.onTouchStart=e=>{if(!wo(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.beginPointer(vo+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(wo(e))return;e.preventDefault();let i=null;for(let n=0;n<e.changedTouches.length;n+=1){let o=e.changedTouches.item(n);if(!o)continue;let r=this.toLocal(o.clientX,o.clientY);this.updatePointer(vo+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!wo(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(vo+n.identifier,e.type==="touchcancel")}}};this.host=e,this.useWebKitTouchEvents=i}get moved(){return this.movedPx}attach(){let{container:e}=this.host;this.rect=null,typeof window<"u"&&(window.addEventListener("scroll",this.onLayoutChanged,{capture:!0,passive:!0}),window.addEventListener("resize",this.onLayoutChanged,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onLayoutChanged),window.visualViewport?.addEventListener("scroll",this.onLayoutChanged),window.addEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("blur",this.onWindowBlur),window.addEventListener("keydown",this.onEscape,{capture:!0})),e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){this.clearHold();let{container:e}=this.host;typeof window<"u"&&(window.removeEventListener("scroll",this.onLayoutChanged,{capture:!0}),window.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("scroll",this.onLayoutChanged),window.removeEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("blur",this.onWindowBlur),window.removeEventListener("keydown",this.onEscape,{capture:!0})),e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<Zr}invalidateRect(){this.rect=null}toLocal(e,i){let n=this.rect;if(!n){let o=this.host.container.getBoundingClientRect();n={left:o.left,top:o.top},this.rect=n}return{x:e-n.left,y:i-n.top}}beginPointer(e,i,n,o,r=!1,s=!1){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=n==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:n,button:o,local:i,shiftKey:r,altKey:s})?(this.host.beginMarquee(i,s),this.panLast=null):(this.panLast=i,n==="touch"&&this.host.marqueeShouldStart({pointerType:"touch-hold",button:o,local:i,shiftKey:r,altKey:s})&&(this.holdTimer=setTimeout(()=>{this.holdTimer=null,!(this.pointers.size!==1||this.panStarted||this.movedPx>we)&&(this.endTouchProbe(),this.panLast=null,this.host.beginMarquee(i,!1))},uc)));else if(this.pointers.size===2){this.clearHold(),this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[a,l]=[...this.pointers.values()],c={x:(a.x+l.x)/2,y:(a.y+l.y)/2},d=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(l.x-a.x,l.y-a.y),startScale:d,worldMid:{x:(c.x-this.host.stage.x())/d,y:(c.y-this.host.stage.y())/d}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+1}}updatePointer(e,i){return this.pointers.has(e)?(this.pointers.set(e,i),this.pointers.size===1&&this.panStart?(this.movedPx=Math.max(this.movedPx,Math.hypot(i.x-this.panStart.x,i.y-this.panStart.y)),this.movedPx>we&&this.clearHold()):this.pointers.size>=2&&(this.movedPx=we+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>we?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[i,n]=[...this.pointers.values()],o=Math.hypot(n.x-i.x,n.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+n.x)/2,y:(i.y+n.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=q(this.pinch.startScale*(o/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}let i={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.position(this.host.constrainPan({x:i.x+(e.x-this.panLast.x),y:i.y+(e.y-this.panLast.y)},i)),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}abandonGesture(){if(this.pointers.size===0)return;let e=this.host.marqueeActive();e&&this.host.cancelMarquee(),this.pointers.clear(),this.pinch=null,this.resetPan(),this.endTouchProbe(),e||this.host.afterViewChange()}clearHold(){this.holdTimer&&clearTimeout(this.holdTimer),this.holdTimer=null}endPointer(e,i=!1){if(this.pointers.has(e)){if(this.clearHold(),this.host.marqueeActive()){this.endTouchProbe(),i?this.host.cancelMarquee():this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as Rm}from"konva/lib/shapes/Circle";import{Group as Mm}from"konva/lib/Group";import{Line as Em}from"konva/lib/shapes/Line";import{Text as Am}from"konva/lib/shapes/Text";var Fm=11,_m=.3,Bm=.08;function Uc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function Om(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?B("map.soldOut"):t.wheelchairFree!=null?t.wheelchairFree<=0?B("map.noWheelchairSpace"):B("map.seatsLeft",{count:t.wheelchairFree}):B("map.seatsLeft",{count:t.available})}function $c(t,e){return e&&t.available!=null&&t.available<=0}function Dm(t,e){return $c(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function qc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=Dm(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?Ve*Bm:o?Ve*_m:Ve),e.polygon.listening(!t.exportMode&&!n&&!i&&!$c(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),Nm(t,e,o,r,n,t.dimmed(e.categoryKey))}}function Nm(t,e,i,n,o,r){if(e.capacityNode){let s=Om(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}Hm(t,e,o||r),n>0&&!o?Km(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var ko=9,Kc=.86;function Hm(t,e,i){Gm(t,e,i),xo(e)}function xo(t){let e=t.wheelchairGlyph,i=t.capacityNode;if(!e)return;if(!i||!i.visible()||!i.text()){e.visible(!1);return}let n=i.fontSize(),o=n/ye;e.scale({x:o,y:o}),e.offset({x:ye/2,y:ye/2}),e.position({x:i.x()-i.width()/2-n*.7,y:i.y()-i.offsetY()+i.height()/2}),e.visible(!0)}function Gm(t,e,i){let{labelNode:n,capacityNode:o}=e;if(!n&&!o)return;let r=Math.max(t.effScale(),1e-4);if(i){n?.visible(!1),o?.visible(!1);return}if(!t.pickerMode){n?.visible(t.labelLegible(n.fontSize())),o?.visible(t.labelLegible(o.fontSize()));return}let s=Wm(e,r),a=Xc(n,e.nameSize??oi,s.width*Kc,r),l=Xc(o,ri,s.width*Kc,r),c=a!=null,d=l!=null&&(n?c&&a+l+ko<=s.height:l<=s.height);Yc(n,c?a:null,e.labelPoint.y-ko/r,r),Yc(o,d?l:null,n?e.labelPoint.y+ko/r:e.labelPoint.y,r)}function Wm(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>n&&(n=s.x),s.y<o&&(o=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(n-i)*e,height:(r-o)*e}:{width:0,height:0}}function Xc(t,e,i,n){if(!t||!t.text())return null;t.fontSize(e/n);let o=t.width()*n;if(o<=i||o<=0)return e;let r=e*(i/o);return r>=V?r:null}function Yc(t,e,i,n){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/n),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}var Vm=.72;function zm(t,e,i){let n=-1/0,o=1/0;for(let s of t)s.x>n&&(n=s.x),s.y<o&&(o=s.y);if(!Number.isFinite(n)||!Number.isFinite(o))return e;let r=i*Vm;return{x:n+r,y:o-r}}function Km(t,e,i,n){let o=Fm;if(!e.chip){let a=new Mm({listening:!1});a.add(new Rm({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new Em({name:"ga-chip-tick",x:-o*.62,points:[-o*.22,0,-o*.02,o*.2,o*.34,-o*.26],strokeWidth:Math.max(.6,o*.16),lineCap:"round",lineJoin:"round",listening:!1}));let l=new Am({x:o*.12,y:-o*.5,text:String(i),fontSize:o,fontStyle:"800",fontFamily:t.labelFont(),listening:!1,perfectDrawEnabled:!1});a.add(l),t.bgLayer.add(a),e.chip=a,e.chipText=l}let r=Dt(t.selectionColor),s=e.chip.findOne(".ga-chip-disc");s?.fill(t.selectionColor),s?.stroke(G(r,.35)),e.chip.findOne(".ga-chip-tick")?.stroke(r),e.chipText&&(e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText.fill(r)),e.chip.position(zm(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function Zc(t,e){let i=!1;for(let[n,o]of Object.entries(e)){let r=t.get(n);r&&(o.available!==void 0&&r.available!==o.available&&(r.available=o.available,i=!0),o.wheelchairFree!==void 0&&(r.wheelchairFree??null)!==o.wheelchairFree&&(r.wheelchairFree=o.wheelchairFree,i=!0),o.selected!==void 0&&r.selected!==o.selected&&(r.selected=o.selected,i=!0))}return i}function Qc(t){let{width:e,height:i}=t;return!(e>0)||!(i>0)?"hidden":e===t.stageWidth&&i===t.stageHeight?"unchanged":{width:e,height:i}}function Xm(t){let{sections:e,viewCentre:i,focusedSectionId:n}=t;if(n){let s=e.findIndex(a=>a.id===n||a.logicalId===n);if(s>=0)return s}let o=-1,r=1/0;return e.forEach((s,a)=>{if(s.outline.length<3)return;let l=K(s.outline),c=i.x>=l.x&&i.x<=l.x+l.width&&i.y>=l.y&&i.y<=l.y+l.height,d=l.x+l.width/2-i.x,u=l.y+l.height/2-i.y,h=(c?0:1e12)+d*d+u*u;h<r&&(o=a,r=h)}),o}function Ym(t){let{rung:e,viewCentre:i,target:n,width:o,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(f=>{let m=K(f.outline);return{x:m.x+m.width/2,y:m.y+m.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(f=>Math.abs(f.x-i.x)<=d&&Math.abs(f.y-i.y)<=u)){let f=c.reduce((m,y)=>{let p=(y.x-i.x)**2+(y.y-i.y)**2;return p<m.distance?{point:y,distance:p}:m},{point:c[0],distance:1/0});s=f.point.x,a=f.point.y}}let l=e==="seats"?t.seats.filter(c=>c.kind!=="booth"):[];if(l.length>0){let c=l[0],d=1/0;for(let u of l){let h=u.x-i.x,f=u.y-i.y,m=h*h+f*f;m<d&&(c=u,d=m)}s=c.x,a=c.y}return{x:s,y:a}}function jc(t){if(t.rung==="sections")return{bounds:t.bounds};let e=Xm(t);if(e>=0)return{bounds:K(t.sections[e].outline),minScale:t.seatFloor};let i=t.seatScale,{x:n,y:o}=Ym({...t,rung:"seats",target:i}),r=t.width/(i*1.12),s=t.height/(i*1.12);return{bounds:{x:n-r/2,y:o-s/2,width:r,height:s}}}var Jc=["pointerdown","pointermove","mousedown","mousemove","touchstart","click"],Yi=class{constructor(e=()=>{}){this.onEnd=e;this.until=0;this.timer=null;this.holding=!1;this.stale=new Set;this.flushNow=()=>this.flush();this.container=null}get active(){return this.holding}listen(e){this.container=e;for(let i of Jc)e.addEventListener(i,this.flushNow,{capture:!0,passive:!0})}wrap(e){let i=e.drawHit;e.drawHit=((n,o)=>this.active&&!n?(this.stale.add(e),e):i.call(e,n,o))}bump(){typeof setTimeout=="function"&&(this.holding=!0,this.until=performance.now()+120,this.timer||this.arm(120))}arm(e){this.timer=setTimeout(()=>{this.timer=null;let i=this.until-performance.now();if(i>1){this.arm(i);return}this.flush()},e)}flush(){let e=this.holding;if(this.holding=!1,this.timer&&(clearTimeout(this.timer),this.timer=null),this.stale.size){let i=[...this.stale];this.stale.clear();for(let n of i)n.getStage()&&n.drawHit()}e&&this.onEnd()}destroy(){if(this.timer&&clearTimeout(this.timer),this.timer=null,this.holding=!1,this.stale.clear(),this.container)for(let e of Jc)this.container.removeEventListener(e,this.flushNow,{capture:!0});this.container=null}};var Ui=class{constructor(){this.since=new Map;this.shown=new Set;this.wanted=new Set}begin(){this.wanted=new Set}admit(e,i,n){this.wanted.add(e);let o=this.since.get(e);return o===void 0&&(o=i,this.since.set(e,i)),!n||this.shown.has(e)||i-o>=150?(this.shown.add(e),!0):!1}end(){for(let e of[...this.since.keys()])this.wanted.has(e)||(this.since.delete(e),this.shown.delete(e))}reset(){this.since.clear(),this.shown.clear(),this.wanted.clear()}};function ed(t,e,i,n){if(t.length<3)return[];let o=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<o&&(o=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-o)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e)d.x<o||d.x>r||d.y<s||d.y>a||Jt(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function Um(t){return t.logicalRowId??t.rowId}function td(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(Um(o)!==t||!i(o.id)||n.push(o.id));return n}function id(t,e,i=4){for(let n of e){let{box:o}=n;if(t.x>=o.x-i&&t.x<=o.x+o.width+i&&t.y>=o.y-i&&t.y<=o.y+o.height+i)return n.rowKey}return null}import{Line as $m}from"konva/lib/shapes/Line";import{Rect as qm}from"konva/lib/shapes/Rect";var $i=class{constructor(e){this.host=e;this.box=null;this.lasso=null;this.remove=!1}active(){return this.box!==null||this.lasso!==null}begin(e,i,n=!1){this.cancel(),this.remove=n;let o=this.host.screenToWorld(e),r=this.host.stageScale()||1,s={stroke:n?"#d64545":this.host.selectionColor(),strokeWidth:1.5/r,dash:[5/r,4/r],fill:n?"rgba(214,69,69,0.10)":"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let a=new $m({...s,points:[o.x,o.y],closed:!0,lineJoin:"round"});this.host.overlayLayer().add(a),this.lasso={points:[o],line:a}}else{let a=new qm({...s,x:o.x,y:o.y,width:0,height:0});this.host.overlayLayer().add(a),this.box={start:o,cur:o,rect:a}}this.host.overlayLayer().batchDraw()}update(e){let i=this.host.screenToWorld(e);if(this.lasso){let r=this.lasso.points[this.lasso.points.length-1];if(Math.hypot(i.x-r.x,i.y-r.y)*(this.host.stageScale()||1)<2)return;this.lasso.points.push(i),this.lasso.line.points(this.lasso.points.flatMap(s=>[s.x,s.y])),this.host.overlayLayer().batchDraw();return}if(!this.box)return;let{start:n,rect:o}=this.box;o.setAttrs({x:Math.min(n.x,i.x),y:Math.min(n.y,i.y),width:Math.abs(i.x-n.x),height:Math.abs(i.y-n.y)}),this.box.cur=i,this.host.overlayLayer().batchDraw()}cancel(){!this.box&&!this.lasso||(this.lasso?.line.destroy(),this.box?.rect.destroy(),this.lasso=null,this.box=null,this.host.overlayLayer().batchDraw())}finish(){let e=this.host.stageScale()||1;if(this.lasso){let{points:l,line:c}=this.lasso;this.lasso=null,c.destroy(),this.host.overlayLayer().batchDraw();let d=l.map(h=>h.x),u=l.map(h=>h.y);if(l.length<3||(Math.max(...d)-Math.min(...d))*e<4&&(Math.max(...u)-Math.min(...u))*e<4)return;this.apply(ed(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)}),h=>Jt(h,l));return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let n=Math.min(i.start.x,i.cur.x),o=Math.max(i.start.x,i.cur.x),r=Math.min(i.start.y,i.cur.y),s=Math.max(i.start.y,i.cur.y);if((o-n)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats())l.x<n||l.x>o||l.y<r||l.y>s||this.host.isSelectable(l.id)&&a.push(l.id);this.apply(a,l=>l.x>=n&&l.x<=o&&l.y>=r&&l.y<=s)}apply(e,i){this.host.applyBand(e,i,this.remove),this.host.selectionChanged()}};var qi=class{constructor(e){this.sync=e;this.depth=0;this.pending=!1}request(){if(this.depth>0){this.pending=!0;return}this.sync()}batch(e){this.depth+=1;try{return e()}finally{this.depth-=1,this.depth===0&&this.pending&&(this.pending=!1,this.sync())}}};import{Rect as nd}from"konva/lib/shapes/Rect";import{Text as Zm}from"konva/lib/shapes/Text";function od(t){let e=t.effScale(),i=t.stage.scaleX(),n={width:t.stage.width(),height:t.stage.height()},o=p=>Math.round(p*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(p=>[String(p.getAttr("seatId")??""),String(p.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(p=>{let g=t.circleById.get(p.id),b=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=p.kind==="booth"?Ge:me*t.seatLabelScale(p),w=o((b?.fontSize()??S)*e),k=t.worldToScreen(p),v=b?b.width()*i:0,x=b?b.height()*e:0,T=k.x-v/2<0||k.x+v/2>n.width||k.y-x/2<0||k.y+x/2>n.height,P=t.focusedSeatOpacity(p.id,g?.getAbsoluteOpacity()??0),L=t.seatSection.get(p.id),C=!!b?.isVisible()&&P>=.5&&!T,I;C||(P<.5?I="dimmed-or-unavailable":w<V?I="below-minimum-size":T?I="outside-viewport":b?I="renderer-hidden":I=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=g instanceof nd?g.width()*i:t.seatR*2*e,M=g instanceof nd?g.height()*e:t.seatR*2*e,E=2*(t.seatR*e+ue),A=g?.fill(),_=b?.fill(),F=t.accessGlyphById.get(p.id),N=F?.getAbsoluteScale();return{seatId:p.id,label:p.label,kind:p.kind==="booth"?"booth":"seat",markerShape:p.kind==="booth"?"booth":p.wheelchairSpaceType==="no-seat"?"square":"circle",...p.wheelchairSpaceType?{wheelchairSpaceType:p.wheelchairSpaceType}:{},categoryKey:p.categoryKey,...L?{sectionId:L.id}:{},...L?.zone?{zoneId:L.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:C,renderedFontPx:w,fill:typeof A=="string"?A:"",ink:typeof _=="string"?_:g?t.seatLabelInk(p,g):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:o(P),...F?{accessibilityMarker:{glyphVisible:F.isVisible(),glyphWidthPx:o(ye*Math.abs(N?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!g?.isVisible()&&!!g?.isListening()&&t.isSelectable(p.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),E))},screenCenter:{x:o(k.x),y:o(k.y)},...C?{screenBox:{x:o(k.x-v/2),y:o(k.y-x/2),width:o(v),height:o(x)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(p=>p.visible).length,l=(p,g,b,S,w,k,v)=>{let x=ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),T=K(x.map(M=>t.worldToScreen(M))),P=o(S.opacity()),L=S.fill(),C=T.x+T.width<0||T.x>n.width||T.y+T.height<0||T.y>n.height,I=S.isVisible()&&P>.05&&!C,R=k?ut({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),k.outline,k.holes):void 0;return{id:p,kind:g,role:b,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:P,fill:w,ink:typeof L=="string"?L:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(T.x),y:o(T.y),width:o(T.width),height:o(T.height)}}:{}}},c=p=>{let g=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof g=="string"&&g)return g;let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},d=p=>{let g=p.blockPoly.fill();return typeof g=="string"?g:p.baseFill},u=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,Ft(n.width))),...t.sections.map(p=>l(`${p.id}:availability`,"section","availability",p.subLabel,c(p),p)),...t.sections.map(p=>l(`${p.id}:number`,"section","number",p.numberLabel,d(p),p,bi(n.width))),...t.zones.flatMap(p=>[l(p.id,"zone","name",p.label,p.background),...p.sub?[l(`${p.id}:price`,"zone","price",p.sub,p.background)]:[]])],h=[...t.gaById].map(([p,g])=>{let b=g.points.map(C=>t.worldToScreen(C)),S=Math.min(...b.map(C=>C.x)),w=Math.min(...b.map(C=>C.y)),k=Math.max(...b.map(C=>C.x)),v=Math.max(...b.map(C=>C.y)),x=k<0||S>n.width||v<0||w>n.height,T=o(g.polygon.opacity()),P=T>=.1&&!x,L=g.polygon.fill();return{areaId:p,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:P,interactive:g.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:g.effectiveBackground,...P?{screenBox:{x:o(S),y:o(w),width:o(k-S),height:o(v-w)}}:{}}}),f=[...t.freeTextById].map(([p,g])=>{let{node:b,kind:S}=g,w=g.plate&&g.plate.opacity()>.05?g.plate.fill():null,k=typeof w=="string"&&w?w:g.background,v=t.worldToScreen({x:b.x(),y:b.y()}),x=b.width()*i,T=b.height()*e,P=v.x-b.offsetX()*i,L=v.y-b.offsetY()*e,C=o(b.fontSize()*e),I=P+x<0||P>n.width||L+T<0||L>n.height,R=b.isVisible()&&!I,M=b.fill(),E=o(b.getAbsoluteOpacity()),A;return R||(C<V?A="below-minimum-size":I?A="outside-viewport":A="renderer-hidden"),{objectId:g.objectId??p,kind:S,text:b.text(),visible:R,renderedFontPx:C,ink:typeof M=="string"?M:"",background:k,opacity:E,...R?{screenBox:{x:o(P),y:o(L),width:o(x),height:o(T)}}:{},...A?{hiddenReason:A}:{}}}),m=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof Zm).map(p=>{let g=p.getClientRect({skipShadow:!0,skipStroke:!0}),b=g.x+g.width<0||g.x>n.width||g.y+g.height<0||g.y>n.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!b,renderedFontPx:o(p.fontSize()*e),ink:typeof S=="string"?S:"",...b?{}:{screenBox:{x:o(g.x),y:o(g.y),width:o(g.width),height:o(g.height)}}}}),y=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:V,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((p,g)=>p+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(p=>String(p.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:t.effSelection,focusedSectionId:t.focusedSectionId,focusBackdropVisible:!!t.focusBackdrop?.isVisible(),categoryFilterKeys:t.categoryFilter?[...t.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(p=>{let g=p.blockPoly.fill();return typeof g!="string"||!Fn(t.canvasBackground,g)}).length,tintedSectionShells:y.filter(p=>{let g=p.blockPoly.fill();return typeof g=="string"&&Gs(t.canvasBackground,g)}).length,visibleCategoryDetailOutlines:t.sections.filter(p=>p.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(p=>p.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(p=>p.sectionId!=null&&p.polygon.opacity()>.05).length},labels:s,gaAreas:h,hierarchyLabels:u,freeTextLabels:f,rowLabels:m}}import{Circle as sg}from"konva/lib/shapes/Circle";import{Ellipse as ag}from"konva/lib/shapes/Ellipse";import{Line as lg}from"konva/lib/shapes/Line";import{Arrow as cg}from"konva/lib/shapes/Arrow";import{Path as dg}from"konva/lib/shapes/Path";import{Rect as Yt}from"konva/lib/shapes/Rect";import{Text as To}from"konva/lib/shapes/Text";import{Image as dd}from"konva/lib/shapes/Image";import{Group as rd}from"konva/lib/Group";import{Circle as Qm}from"konva/lib/shapes/Circle";import{Path as jm}from"konva/lib/shapes/Path";function Jm(t,e){let i=e?.trim();return i&&i.toLowerCase()!==Fr?i:Mt[t.group]}var sd=new WeakMap;function Zi(t){let{icon:e,size:i}=t,n=Jm(e,t.color),o=H(n)&&n!==Mt[e.group]?kr:pi,r=H(t.background)?0:i*kn.ringRatio,s=t.listening??!1,a=new rd({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new Qm({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:xr,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*kn.glyphScale,c=new jm({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/xn,scaleY:l/xn,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),sd.set(a,{glyph:c,icon:e}),a}function Lo(t,e,i){let n=t instanceof rd?sd.get(t):void 0;if(n?.icon.solidLarge){let o=Er(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function ad(t,e,i){let n=fi("wheelchair"),o=Dr(t);if(!n||!o)return null;let r=Or(e),s=Zi({icon:n,x:o.x-r/2,y:o.y-r/2,size:r,background:i,listening:!1});return s.name("step-free-route-mark"),s}import{Group as eg}from"konva/lib/Group";import{Path as tg}from"konva/lib/shapes/Path";import{Rect as ig}from"konva/lib/shapes/Rect";import{Text as ng}from"konva/lib/shapes/Text";function og(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function rg(t,e,i={}){let n=t.height??40,o=t.width??n*3,r=(t.x??0)+o/2,s=(t.y??0)+n/2,a=n*.46,l=pi,c=new ng({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?Ar("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,f=u+h+c.width(),m=Math.max(o,f+n),y=new eg({name:"gate-sign",x:r,y:s,rotation:og(t.rotation??0),listening:i.hitTarget===!0});y.add(new ig({name:"gate-sign-pill",x:-m/2,y:-n/2,width:m,height:n,cornerRadius:n/2,fill:t.fill??Mt.navigation,stroke:l,strokeWidth:Math.max(1,n*.05),opacity:i.organizerOnly?.55:1,dash:i.organizerOnly?[n*.2,n*.12]:void 0,listening:i.hitTarget===!0,perfectDrawEnabled:!1}));let p=-f/2;return d&&(y.add(new tg({name:"gate-sign-step-free",data:d,x:p,y:-u/2,scaleX:u/24,scaleY:u/24,fill:l,listening:!1,perfectDrawEnabled:!1})),p+=u+h),c.position({x:p,y:-c.height()/2}),y.add(c),y.setAttr("gateSignHeight",n),{group:y,fontSize:a,bounds:{x:r-m/2,y:s-n/2,width:m,height:n}}}function ld(t,e){if(e.gate.hideFromBuyers)return;let i=rg(e,t.labelFont());i.group.setAttr("shapeObjectId",e.id),e.opacity!=null&&i.group.opacity(Math.min(1,Math.max(.1,e.opacity))),t.bgLayer.add(i.group),t.iconNodeById.set(e.id,{node:i.group,fontSize:i.fontSize}),t.landmarkBoxes.push(i.bounds)}function hd(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let n=i.naturalWidth||4,o=i.naturalHeight||3,r=e.crop??{x:0,y:0,width:1,height:1},s=Math.max(0,Math.min(.99,r.x)),a=Math.max(0,Math.min(.99,r.y)),l={x:s,y:a,width:Math.max(.01,Math.min(1-s,r.width)),height:Math.max(.01,Math.min(1-a,r.height))},c=e.width,d=c*(o*l.height/(n*l.width)),u=new dd({image:i,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:d/2,width:c,height:d,rotation:e.rotation??0,crop:{x:l.x*n,y:l.y*o,width:l.width*n,height:l.height*o},opacity:e.opacity,listening:!1}),h=e.layer==="above"?t.fgDecorGroup:t.bgLayer;h.add(u),u.moveToBottom(),h.getLayer()?.batchDraw()})}function ud(t,e){let i=new window.Image,n=new dd({image:i,x:e.x+e.width/2,y:e.y+e.height/2,offsetX:e.width/2,offsetY:e.height/2,width:e.width,height:e.height,rotation:e.rotation??0,opacity:q(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(n):t.bgLayer.add(n),e.role&&t.landmarkBoxes.push(K(ht({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),t.trackAssetImage(i,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let o=n.getLayer();o&&o.batchDraw()})}function pd(t,e){let i=e.fill??t.theme.decorFill??io,n=se(i,.12);if(e.shape==="round")t.bgLayer.add(new sg({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:n,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Yt({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:n,strokeWidth:1.5,cornerRadius:4,listening:!1}))}if(!It(e))return;let o=Ut(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,Y(i,t.theme.textColor??"#cbd5e1"),We(e)??vr,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var hg=8,ug=6;function pg(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(hg,e*.35),o=Math.max(ug,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function fd(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??Y(i,t.theme.textColor??il),o=e.semanticKind==="icon"?fi(e.iconKey):void 0;if(o){let d=Zi({icon:o,x:e.position.x,y:e.position.y,size:e.fontSize,rotation:e.rotation,color:e.color,background:t.canvasBackground});t.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),t.bgLayer.add(d);return}let r=e.background?.padding??0,s=e.opacity??1,a=rr(e),l=new To({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:no(e.bold,e.italic,"600"),fill:n,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;e.background&&(c=new Yt({x:e.position.x,y:e.position.y,...pg(l,e.fontSize),rotation:e.rotation,fill:e.background.color,opacity:s*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),t.bgLayer.add(c)),t.freeTextById.set(e.id,{node:l,backdrop:c,background:i,kind:a?"direct-landmark":"free-text",...e.labelImportance==="detail"?{showAt:"detail"}:{}}),t.bgLayer.add(l)}function md(t,e){if(Gr(e)){ld(t,e);return}let i=e.fill??t.theme.decorFill??io,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=or(e),a=le(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?se(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?q(e.opacity,.1,1):1,f=0,m=0,y=null;if(c&&e.points&&e.points.length>=2){f=e.points.reduce((k,v)=>k+v.x,0)/e.points.length,m=e.points.reduce((k,v)=>k+v.y,0)/e.points.length;let p=Nr(e),g=Hr(u),b=_r(e),S=new cg({points:e.points.flatMap(k=>[k.x,k.y]),closed:!1,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:u,opacity:h,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path",...b?{dash:Br(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let w=b?ad(e,u,t.canvasBackground):null;w&&t.bgLayer.add(w)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=n?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l};f=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Yt({x:f,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:u,cornerRadius:q(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){f=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height};let p=n?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l};t.bgLayer.add(new ag({x:f,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:u,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=Zo(e),g=K(p);f=e.points.reduce((w,k)=>w+k.x,0)/e.points.length,m=e.points.reduce((w,k)=>w+k.y,0)/e.points.length,y=g;let b=n?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l},S=De(p,Qo(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},qo(e)??void 0);S.setAttrs({x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,...b}),t.bgLayer.add(S)}y&&e.role&&t.landmarkBoxes.push(y);for(let p of er(e))t.bgLayer.add(new lg({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:p.ink??Jo,fill:p.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(n){let{node:p,spec:g}=mg(t,f,m,e.label,l,y,e.labelStyle);t.primaryFocalLabels.set(p,g),t.freeTextById.set(e.id,{node:p,background:l,plate:g.plate,kind:"stage"})}else if(r){let p=o||s,g=Y(l,p?"#e6e9f0":"#9aa3b5"),b=Ut(t,t.bgLayer,e.label,f,m,g,p?18:12,!1);p&&t.primaryFocalLabels.set(b,{targetPx:18,trackingRatio:0,ink:String(b.fill()??""),plateInk:String(b.fill()??""),plate:new Yt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:b,background:l,kind:"decor",...p?{}:{area:yo(e.rotation,y,f,m,12,g,l)}})}else{let p=Y(l,"#cbd5e1"),g=Ut(t,t.bgLayer,e.label,f,m,p,16,!0);t.freeTextById.set(e.id,{node:g,background:l,kind:"decor",area:yo(e.rotation,y,f,m,16,p,l)})}}var Co=22,cd=V,Qi=6,fg=.5;function mg(t,e,i,n,o,r,s){let a=s?.size??Co,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??Y(o,l),d=r?r.x+r.width/2:e,u=r?r.y+r.height/2:i,h=gg(t.canvasBackground,o),f=new Yt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(f);let m=new To({x:d,y:u,text:n,fontSize:a,fontStyle:no(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/Co),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return m.offsetX(m.width()/2),m.offsetY(m.height()/2),t.bgLayer.add(m),{node:m,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/Co,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??Y(h,l),plate:f}}}function gg(t,e){return j(e,H(t)?"#ffffff":"#000000",.34)}function gd(t,e,i,n,o=0){let r=Math.max(i,1e-4),s=o>0&&r>o?r/o:1,l=Math.min(e.targetPx,Math.max(cd,e.targetPx*fg)*s)/r,c=g=>{t.letterSpacing(g*e.trackingRatio),n(t,g)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=Xo(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-Qi*2,height:(u?d.width:d.height)-Qi*2},f=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(f<1&&(l=Math.max(cd/r,l*f),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let y=(u?t.height():t.width())+Qi*2,p=(u?t.width():t.height())+Qi;e.plate.size({width:y,height:p}),e.plate.offset({x:y/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function bd(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=Lr(i,n,Ve),r=t.theme.textColor??"#e6e9f0",s=Y(o,r),a=De(e.points,e.holes,{fill:i,opacity:Ve,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",y=>{t.isGhostClick(y)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=ei(e.points,e.holes),c=t.sections.find(y=>te(l,y.outline,y.holes)),d=We(e)??oi,u=It(e)?Ut(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Ut(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,ri,!1);u&&t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:u,background:o,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:o,kind:"ga-capacity",categoryKey:e.categoryKey});let f=Lt(e)>0?new dg({data:nt(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;f&&t.bgLayer.add(f);let m={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:i,labelPoint:l,labelNode:u,...We(e)!==void 0?{nameSize:d}:{},capacityNode:h,...f?{wheelchairGlyph:f}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,m),xo(m)}function Ut(t,e,i,n,o,r,s,a){let l=new To({x:n,y:o,text:i,fontSize:s,fontStyle:a?"700":"500",fontFamily:t.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function Sd(t,e){let i=[],n=e.canvasBackground,o=new Map,r=(h,f)=>{let m=o.get(h)??[];m.push(f),o.set(h,m)};for(let h of e.seats){if(h.kind==="booth")continue;let f=h.logicalRowId??h.rowId;r(f,h),f!==h.rowId&&r(h.rowId,h)}let s=(e.sections??[]).filter(h=>h.outline?.length>=3).map(h=>{let f=h.outline.map(y=>y.x),m=h.outline.map(y=>y.y);return{section:h,minX:Math.min(...f),minY:Math.min(...m),maxX:Math.max(...f),maxY:Math.max(...m)}}),a=(h,f,m,y)=>{let p=e.seatR+12+y*6;return s.filter(g=>g.section!==h&&f+p>=g.minX&&f-p<=g.maxX&&m+p>=g.minY&&m-p<=g.maxY).map(g=>g.section.outline)},l=h=>h.logicalSeatIndex??Number(h.id.split(":").pop()??0);for(let h of t.objects){if(h.type!=="row")continue;let f=h.segmentedRow?.repeatLabelOnComponents===!0;if(h.segmentedRow&&!f&&h.segmentedRow.componentIndex!==0)continue;let m=f?h.labelPresentation:h.segmentedRow?.labelPresentation??h.labelPresentation;if(m?.visible===!1||m?.positionPreset==="none")continue;let y=h.segmentedRow&&!f?h.segmentedRow.groupId:h.id,p=(o.get(y)??[]).slice().sort((_,F)=>l(_)-l(F));if(!p.length)continue;let g=p[0],b=p[p.length-1],S=m?.labelStyle,w=m?.style==="pill"?Nt(n):null,k=w?w.plate:n,v=de(k,S?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",ze),x=S?.size??Sr,T=m?.rotation??0,P=e.objectFilteredOut(h)?.15:1,L=p.reduce((_,F)=>_??e.seatSection.get(F.id),void 0),I=h.segmentedRow?.displayLabel??h.displayLabel??Rt(h.label,L?.label);if(!I)continue;let R=L?[...new Set([L.id,L.logicalId,L.zone].filter(_=>!!_))]:void 0,M=(_,F,N)=>i.push({text:I,x:_,y:F,rotation:T,fontSize:x,ink:v,opacity:P,rowKey:y,...w?{pill:w}:{},...R?.length?{focusKeys:R}:{},...N?{automaticAway:N}:{},...N&&L?.outline?.length?{outline:L.outline}:{},...N&&L?.outline?.length&&s.length?{neighbourOutlines:a(L,_,F,x)}:{}});if(m?.position){M(m.position.x,m.position.y);continue}let E=e.seatR+12,A=m?.positionPreset??"start";if(A==="start"||A==="both"){let _=h.rotation*Math.PI/180,F={x:-Math.cos(_),y:-Math.sin(_)};M(g.x+F.x*E,g.y+F.y*E,F)}if(A==="end"||A==="both"){let _=(h.rotation+h.curve)*Math.PI/180,F={x:Math.cos(_),y:Math.sin(_)};M(b.x+F.x*E,b.y+F.y*E,F)}}let c=(e.seatR+12)*2.2,d=[],u=new Map;for(let h of i){let f=u.get(h.text),m=f?.find(y=>Math.hypot(y.x-h.x,y.y-h.y)<=c);if(m){m.x=(m.x+h.x)/2,m.y=(m.y+h.y)/2;continue}d.push(h),f?f.push(h):u.set(h.text,[h])}return d}function $t(t,e,i=ee){let n=t.rotation()*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=(t.width()*o+t.height()*r)/2+i,a=(t.width()*r+t.height()*o)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function vd(t,e,i,n){let o=e.automaticAway;if(!o)return{x:e.x,y:e.y};let r={x:e.x,y:e.y},s={x:-o.y,y:o.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=e.outline,c=m=>l?yd(l,m):0;if(l){let m={...r},y=!1;for(let g=1;g<=12&&c($t(t,r))>0;g++)r.x+=o.x*a/4,r.y+=o.y*a/4,y=!0;let p=$t(t,r);y&&e.neighbourOutlines?.some(g=>yd(g,p)>0||bg(r,g))&&(r.x=m.x,r.y=m.y,l=void 0)}let d=[{x:0,y:0}];for(let m=1;m<=4;m++){let y=a*m;d.push({x:s.x*y,y:s.y*y},{x:-s.x*y,y:-s.y*y},{x:o.x*y,y:o.y*y},{x:(o.x+s.x)*y,y:(o.y+s.y)*y},{x:(o.x-s.x)*y,y:(o.y-s.y)*y})}let u=r,h=1/0,f=1/0;for(let m of d){let y={x:r.x+m.x,y:r.y+m.y},p=$t(t,y),b=(n?rt(n,p,{mode:"overlap"}).length:0)+i.collisionCount(p)+c(p),S=Math.hypot(m.x,m.y);if((b<h||b===h&&S<f)&&(u=y,h=b,f=S),b===0)break}return u}function yd(t,e){let i=0;for(let n=0;n<t.length;n++)yg(t[n],t[(n+1)%t.length],e)&&i++;return i}function bg(t,e){let i=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){let r=e[n],s=e[o];r.y>t.y!=s.y>t.y&&t.x<(s.x-r.x)*(t.y-r.y)/(s.y-r.y)+r.x&&(i=!i)}return i}function yg(t,e,i){let n=e.x-t.x,o=e.y-t.y,r=0,s=1,a=[[-n,t.x-i.x],[n,i.x+i.width-t.x],[-o,t.y-i.y],[o,i.y+i.height-t.y]];for(let[l,c]of a){if(l===0){if(c<0)return!1;continue}let d=c/l;if(l<0?r=Math.max(r,d):s=Math.min(s,d),r>s)return!1}return!0}var ji=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,n,o,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(u),l())},u=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(u),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&o(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&o()}).catch(()=>{s===this.generationCount&&this.errors.push(`${n} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${n} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function wd(t,e){let i=e,n=i._cache instanceof Map?i._cache:null,o=i._canvasCache??n?.get("canvas");if(!o){e.isCached?.()&&e.clearCache();return}let r=[o.scene,o.filter,o.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),n?.delete("canvas")}function kd(t){let e=t.drawScene;t.drawScene=((i,n,...o)=>!i&&t.opacity()===0?(t.getCanvas().getContext().clear(),t):e.call(t,i,n,...o))}function xd(t,e){let i=0,n=0,o=r=>{i||(i=r),n+=1;let s=r-i;s>=1e3&&(t(Math.round(n*1e3/s)),n=0,i=r),e(requestAnimationFrame(o))};e(requestAnimationFrame(o))}function Sg(t){return t<0?0:t>1?1:t}function Ld(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,n=t.reducedMotion===!0,o=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},u=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},h=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,p()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,p()},16)}},f=()=>{a||s||(a=!0,u(),t.done())},m=p=>{for(let g=c.length-1;g>=0;g--){let b=c[g],S=n?1:Sg((p-b.startedAt)/160);t.fade(b.work,S),S>=1&&c.splice(g,1)}return c.length>0},y=()=>{if(s)return;let p=e(),g=p;for(;r<t.chunks.length&&(r===0||e()-g<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,n?1:0),n||c.push({work:S.work,startedAt:p+(r-1)*o}),e()-g>=i)break}let b=m(p);t.draw(),r<t.chunks.length||b?h(y):f()};return h(y),{cancel(){if(!a){s=!0,u();for(let p of c)t.fade(p.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let p=t.chunks[r++];t.build(p.work)}for(let p of t.chunks)t.fade(p.work,1);c.length=0,t.draw(),f()}},get done(){return a}}}var vg={width:40,height:30,rotation:0};function Cd(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??vg;if(l.points&&l.points.length>=3){for(let m of l.points)s.x+m.x<i&&(i=s.x+m.x),s.y+m.y<n&&(n=s.y+m.y),s.x+m.x>o&&(o=s.x+m.x),s.y+m.y>r&&(r=s.y+m.y);continue}let c=l.rotation*Math.PI/180,d=l.width/2,u=l.height/2,h=Math.abs(d*Math.cos(c))+Math.abs(u*Math.sin(c)),f=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-f<n&&(n=s.y-f),s.x+h>o&&(o=s.x+h),s.y+f>r&&(r=s.y+f);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<n&&(n=s.y-a),s.x+a>o&&(o=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:n,width:o-i,height:r-n}:null}function Td(t){let e=new Map,i=[];for(let o of t.seats){let r=t.sectionIdOf(o.id);if(r==null){i.push(o);continue}let s=e.get(r);s?s.push(o):e.set(r,[o])}let n=[...e.entries()].flatMap(([o,r])=>{let s=t.sections.find(a=>a.id===o);return s?[{chunk:{id:o,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((o,r)=>o.distance-r.distance).map(o=>o.chunk);return i.length&&t.looseGroup&&n.push({id:"",work:{seats:i,group:t.looseGroup}}),n}var Id=!1;function Pd(t){return t&&t!=="flat"&&!Id&&(Id=!0,console.warn(`[seatlayer] view mode '${t}' was removed; the map shows the flat view. Pass 'flat', or use the Map | 3D control for the immersive venue view.`)),"flat"}var Rd=(t,e)=>t.length===e.length&&t.every(i=>e.some(n=>Math.abs(i.x-n.x)<.001&&Math.abs(i.y-n.y)<.001));function Md(t,e){let n=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),o=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=n.find(c=>c.id===o),a=o!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>Rd(c,e.outline)),l=n.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>Rd(c,d.outline)))}}import{Group as Ed}from"konva/lib/Group";import{Rect as wg}from"konva/lib/shapes/Rect";import{Text as Io}from"konva/lib/shapes/Text";function Ad(t,e){let i=ei(e.outline,e.holes),n=le(t.canvasBackground),o=[],r=new Map,s=0,a=K(e.outline),l=t.seatIndex?rt(t.seatIndex,a).map(C=>t.seatById.get(C)).filter(C=>!!C):t.seats;for(let C of l)t.seatSection.has(C.id)||te(C,e.outline,e.holes)&&(o.push(C.id),r.set(C.categoryKey,(r.get(C.categoryKey)??0)+1),(t.statusById.get(C.id)??"free")==="free"&&s++);let c=e.color??ni([...r].map(([C,I])=>({hex:t.catColor.get(C)??"#6e7bff",w:I})),"#3a4358"),d=new Ed({listening:!1});t.bgLayer.add(d);let u=new Ed({listening:!1});d.add(u);let h=new gt({listening:!0});t.seatLayer.add(h);let f=u,m=Md(t.chartDoc,e),y=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",p=De(e.outline,m.holes,{visible:!m.hidden,stroke:G(y,.5),strokeWidth:1,fill:G(y,.08),listening:!1},e.outlinePath);f.add(p);let g=De(e.outline,m.holes,{visible:!m.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:Xe,opacity:0,listening:!1},e.outlinePath);f.add(g);let b=e.labelPresentation?.labelStyle,S=b?.color,w=n.sectionInk,k=(b?.size??18)/18,v=new wg({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});f.add(v);let x=new Io({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*k,fontStyle:Ce,fontFamily:t.labelFont(),fill:de(n.sectionFill,S,w),listening:!1,perfectDrawEnabled:!1});x.offsetX(x.width()/2),x.offsetY(x.height()/2),f.add(x);let T=new Io({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Ce,fontFamily:t.labelFont(),fill:de(n.sectionFill,S,w),opacity:0,listening:!1,perfectDrawEnabled:!1});f.add(T);let P=new Io({x:i.x,y:i.y,text:B("map.seatsLeft",{count:s}),fontSize:12,fontStyle:ys,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),f.add(P),{id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...Wa(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(C=>t.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(o),shellFill:n.sectionFill,shellStroke:n.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!te(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},...e.labelPresentation?.rotation?{authoredLabelRotation:e.labelPresentation.rotation}:{},labelArea:$o(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:y,outlinePoly:p,blockPoly:g,namePlate:v,nameLabel:x,numberLabel:T,subLabel:P,preferredInk:w,...S?{explicitInk:S}:{},labelScale:k,authoredLabelSize:b?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function _d(t,e,i){if(!e?.length)return;let n=new Set(e),o=t.seats.filter(d=>!n.has(d.categoryKey)||t.seatInClosedSection(d.id)?!1:(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id));if(!o.length)return;let r=co(o.map(d=>d.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=t.clusterLabels.boundsForSeats(o,s),l=je(o,s);if(a?.singleBlock&&(!t.hasSections||r!=null)){let d=t.clusterLabels.diveTarget(a.bounds,a.anchor);if(d){t.focusRegion(d,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:yt(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};lo({stage:t.stage,box:l,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(c)})||t.focusRegion(l,{animate:i?.animate,durationMs:t.cameraGlideMs})}function yt(t){let e=Dc(Math.max(t.seatR,t.markerR));return Math.max(e,al(t.markerR))}var Fd=.25;function kg(t,e){if(e.length===0)return 1/0;let i=je([...e],t.sellableUnit.diameter/2),n=t.framingViewport();return Math.min(n.width*Fd/Math.max(i.width,1e-6),n.height*Fd/Math.max(i.height,1e-6))}function Bd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=Od(t,i);if(!n.length)return!1;t.clearSectionFocus();let o=Math.max(24,t.seatR*3),r=je(n,o),s={x:r.x+r.width/2,y:r.y+r.height/2};return lo({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:yt(t)}),!0}function Od(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Pe(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function Dd(t,e,i){let n=i===void 0?t.accessFilter:i;if(!n||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let o=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Pe(s,n)==="match"});return o.length&&Po(t,o)||t.focusSection(e),!0}function Nd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Od(t,i);if(!n.length)return null;let o=Math.max(24,t.seatR*3),r=je(n,o),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht;return{spaces:n.length,sections:Mo(t,i),wholeVenue:a}}function Po(t,e,i){let n=e.map(h=>t.seatById.get(h)).filter(h=>h!=null);if(!n.length)return!1;let o=t.seatPitch>0?t.seatPitch:t.seatR*2,r=je(n,Math.max(24,t.seatR*3,o*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht)return!1;let a=co(n.map(h=>h.id),t.seatSection);a&&t.markSectionFocus(a,{x:r.x+r.width/2,y:r.y+r.height/2});let l=t.rowBandDetailScale()*1.08,c=t.zoomBounds(),d=Math.min(Math.max(Math.min(t.seatLabelTargetScale(),c.max),l),c.max),u=kg(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(yt(t),u),d)}),!0}function Hd(t,e,i=!0,n){let o=t.sectionBounds(e);if(!o)return;let r=t.sectionMembers(e).map(d=>t.seatById.get(d)).filter(d=>d!=null),s=r.filter(d=>(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id)),a=s.length?s:r,l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,o,n,l);t.focusRegion(c?.bounds??o,{animate:i,minScale:c?.minScale,maxScale:yt(t),focusPaddingPx:l})}function Ro(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let n=Gd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,n),n}function Gd(t,e,i){return Il(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function Mo(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let n=i===t.accessFilter,o=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=n?Ro(t,r):Gd(t,r,i);if(s<=0)continue;let a=o.get(r.logicalId);a?a.free+=s:o.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...o.values()]}var Cg=1800,Zt=class Zt{constructor(e,i={}){this.seatLabelPool=new Map;this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.canonicalSeatIds=new Set;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=oo;this.effSelection=pt;this.colorblind=!1;this.cbHueByKey=new Map;this.colourOverride=null;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.sectionRungPinned=!1;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Di;this.seatPaintCache=null;this.selectionFocusId=null;this.selectionFocusKeep=null;this.hiddenPose=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.accessFreeBySection=new Map;this.categoryHighlight=null;this.seatHighlight=null;this.labelLayers={seatLabels:!0,rowLabels:!0};this.categoryColours=!0;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];this.landmarkBoxes=[];this.seatSection=new Map;this.unsectionedSeatGroup=null;this.catPrice=new Map;this.dimmedSections=new Set;this.sectionHeat=new Map;this.closedSections=new Set;this.focusedSectionId=null;this.focusMembership=new Map;this.focusMembershipKey=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.sectionFocusDim=null;this.cameraGestures=0;this.objectFloor=new Map;this.unsectionedSeatIds=null;this.tableFootprints=[];this.zoneColor=new Map;this.hasSections=!1;this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=Bc();this.fitScale=1;this.fitPose="";this.viewportInsets={...bo};this.fitClearance={bottom:0,width:0};this.seatR=J;this.markerR=J;this.seatPitch=0;this.sellableUnit=ao(J);this.bounds={x:0,y:0,width:1,height:1};this.cached=!1;this.dpr=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);this.assets=new ji;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.viewportSeats=null;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.gestureHits=new Yi(()=>{!this.destroyed&&!this.exportMode&&this.updateLabels()});this.rowLabelDwell=new Ui;this.readingFocusedFrame=!1;this.marquee=new $i({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,isSelectable:e=>this.isSelectable(e),applyBand:(e,i,n)=>{this.opts.onBand?.(e,i,n)||(n?this.deselect(e):this.selectMany(e))},selectionChanged:()=>{this.opts.onMarquee?.(this.getSelection())}});this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let n=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;n&&this.focusSeat(n);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let n=this.seatById.get(this.focusedId);n&&this.opts.onFocusSeat?.(n)}};this.focusRingLinger=null;this.cameraHostCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.selectionFollowUps=new qi(()=>{this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)});this.sectionBoundsMemo=new Map;this.interactionHostCache=null;this.seatLabelTargetScale=wc(()=>({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e),blockExtent:e=>{let i=this.boothDims.get(e.rowId);return i?ft(i):void 0}}));this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let n=Ji.pixelRatio;if(this.exportMode&&(this.dpr=1),Ji.pixelRatio=this.dpr,this.stage=new xg({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Xi(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",B("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Eo({listening:!this.exportMode}),this.seatLayer=new Eo({listening:!this.exportMode}),this.overlayLayer=new Eo({listening:!1}),this.exportMode||(this.gestureHits.wrap(this.bgLayer),this.gestureHits.wrap(this.seatLayer),this.gestureHits.listen(e),kd(this.seatLayer)),this.labelGroup=new qt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new qt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Bi({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>hl(this.sellableUnit),pickableScale:()=>Fi(this.sellableUnit),categoryLabel:o=>this.catByKey.get(o)?.label??"",categoryColor:o=>this.categoryDisplayColor(o),categoryFilter:()=>this.categoryFilter,seatsPickable:()=>this.seatsPickable(),screenToWorld:o=>this.screenToWorld(o),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(o,r)=>this.focusRegion(o,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new Wd({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:zi,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Wd({radius:J+3,stroke:"#38bdf8",strokeWidth:2.5,dash:[4,3],opacity:.95,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.focusRing),this.stage.add(this.bgLayer,this.seatLayer,this.overlayLayer),this.exportMode&&(Ji.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&xd(o,r=>{this.rafId=r})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setRowBandPreview(e){this.rowBandPreview?.clear(),this.rowBandPreview=e?new Xt:null,this.rowBandZoomAnchor=null,this.hoverRing.visible(!1),this.updateLOD(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw()}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Ci({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),seatOwnedHold:e=>this.ownedHold.has(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new Ti({overlayLayer:this.overlayLayer,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,categoryColor:e=>this.categoryDisplayColor(e),seatCategoryKey:e=>this.seatById.get(e)?.categoryKey??null,isOwnedHold:e=>this.ownedHold.has(e),reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed})),this.breathCache}presentSeatHover(e,i,n,o){this.hoverCard.presentSeat(e,i,n,o)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Mi({container:this.container,labelFont:()=>this.labelFont(),canvasBackground:()=>this.canvasBackground,seatsPickable:()=>this.seatsPickable(),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionLabel:e=>this.sections.find(i=>i.logicalId===e)?.label??null,sectionMembers:e=>this.sectionMembers(e),hoveredSeatId:()=>this.hoveredId,hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,nearestSeat:e=>this.nearestSeatToScreen(e,ue,!0),seat:e=>this.seatById.get(e),seatSectionLabel:e=>this.seatSection.get(e)?.label??null,seatStatus:e=>this.statusById.get(e)??"free",seatOwnedHold:e=>this.ownedHold.has(e),seatClosed:e=>this.seatInClosedSection(e),seatSellable:e=>this.opts.manageMode?!this.seatInClosedSection(e)&&(this.statusById.get(e)??"free")==="free":this.isSelectable(e),categoryOrder:()=>this.catOrder,categoryLabel:e=>this.catByKey.get(e)?.label??"",categoryPrice:e=>this.categoryPriceLabel(e),categoryColor:e=>this.categoryDisplayColor(e),categorySellable:e=>this.catByKey.get(e)?.notForSale!==!0,chartDoc:()=>this.chartDoc,seatFacts:e=>this.opts.hoverFacts?.(e)??null,seatCardHead:e=>this.opts.hoverCardHead?.(e)??null,sectionCardHead:(e,i)=>this.opts.hoverSectionHead?.(e,i)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Ii({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Dt(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let n=this.sectionTapAnchor(i,this.seatById.get(e.seatId)??{x:0,y:0});this.opts.onSectionTap?this.opts.onSectionTap(i,n):this.focusSection(i,{anchor:n})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(n=>n.id).filter(n=>{let o=this.seatSection.get(n);return!!o&&(o.logicalId===e||o.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(ka({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null);if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let n=0,o=0;for(let r of i)n+=r.x,o+=r.y;return{x:n/i.length,y:o/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Ri({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let n of e.memberIds){if(!this.selection.has(n)&&!this.ownedHold.has(n))continue;let o=this.seatById.get(n);o&&i.push(o)}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>this.marquee.active(),marqueeShouldStart:e=>hc(e,{manageMode:this.opts.manageMode===!0,marqueeSelect:this.opts.marqueeSelect===!0}),beginMarquee:(e,i)=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box",i),updateMarquee:e=>this.marquee.update(e),finishMarquee:()=>this.marquee.finish(),cancelMarquee:()=>this.marquee.cancel(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,i){this.sectionBoundsMemo.clear(),this.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Xt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.sectionRungPinned=!1,this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??ti(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let a of e.floors)for(let l of a.objects)this.objectFloor.set(l.id,a.id),l.type==="section"&&l.logicalSectionId&&this.objectFloor.set(l.logicalSectionId,a.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.focusMembership.clear(),this.focusMembershipKey=null,this.unsectionedSeatIds=null,this.primaryFocalLabels.clear(),this.gaById.clear();for(let a of this.selectionMarkers.values())a.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),n||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,n||this.statusById.clear(),this.accessFreeBySection.clear(),n||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,n||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.seatHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasSections=o.objects.some(a=>a.type==="section");for(let a of e.zones??[])a.color&&this.zoneColor.set(a.id,a.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=ui(this.theme.seatScale)*J,this.container.style.background="",this.canvasBackground=this.resolveCanvasBackground(),this.container.style.background=this.canvasBackground,this.effSelection=this.resolveSelectionColor(),this.hoverRing.stroke(this.effSelection),this.hoverRing.radius(this.seatR+2),this.catColor.clear(),this.catByKey.clear(),this.catPrice.clear(),this.catOrder=e.categories.map(a=>a.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((a,l)=>{this.cbHueByKey.set(a,ki[l%ki.length])});for(let a of e.categories){this.catColor.set(a.key,a.color),this.catByKey.set(a.key,a);let l=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[a.key]?.min??a.price;typeof l=="number"&&this.catPrice.set(a.key,l)}this.tableFootprints=Fc(o.objects);for(let a of o.objects)a.type==="booth"&&this.boothDims.set(a.id,{width:a.width,height:a.height,rotation:a.rotation,...a.points&&a.points.length>=3?{points:a.points.map(l=>({x:l.x,y:l.y}))}:{},...It(a)?{}:{nameHidden:!0},...We(a)?{nameSize:We(a)}:{}});if(this.seats=He(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===e?this.seats:He(e);this.canonicalSeatIds=new Set(a.map(l=>l.id))}for(let a of this.seats)this.seatById.set(a.id,a),this.statusById.has(a.id)||this.statusById.set(a.id,"free");this.seatIndex=Mr(this.seats,{seatRadius:this.seatR}),this.seatPitch=rl(this.seats),this.markerR=sl(this.seatR,this.seatPitch),this.sellableUnit=dl(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=nr(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new qt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?Cd(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,!s&&!r&&this.renderSeats(),this.buildRowLabelPlan(o),this.overlayLayer.add(this.labelGroup,this.fgDecorGroup),this.overlayLayer.add(this.hoverRing,this.focusRing),fc(this.overlayLayer,this.chartDoc,this.activeFloorId,!this.floorOverview&&!this.stacked&&!this.exportMode),this.mountCachePending=!s&&!r,this.zoomToFit(),s&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=Td({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Ld({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,n)=>i.group.opacity(n),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.afterViewChange(),this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){if(this.viewportSeats){let n=this.viewportSeats;this.viewportSeats=null,e?n.finish():n.cancel()}let i=this.seatReveal;this.seatRevealPending=!1,i&&(this.seatReveal=null,e?i.finishNow():i.cancel(),this.seats.length&&!this.destroyed&&this.updateLabels())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:xt(e)};if(this.floorOverview&&e.floors.length>=2)return tt(e)==="combined"?lr(e):ar(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...ir(e),referenceImage:void 0,backgroundImage:xt(e)};let i=e.floors.find(n=>n.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:xt(i),floors:void 0}}floorBaseHeightMFor(){let e=this.chartDoc?.floors;return e?.length?e.find(i=>i.id===this.activeFloorId)?.baseHeightM??0:0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&!!this.chartDoc&&tt(this.chartDoc)!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?ti(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let n=!1,o=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),n=!0),o){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),o.add(l))}}if(o&&o.size){for(let r of o)this.refreshSectionFill(r);this.bgLayer.batchDraw()}n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setSeatCategories(e){let i=!1,n=!1,o=new Set;for(let[s,a]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(a)||l.categoryKey===a)continue;l.categoryKey=a,i=!0;let c=this.circleById.get(s);c&&(this.paintSeat(c,s),n=!0);let d=this.seatSection.get(s);d&&o.add(d)}if(!i)return;let r=new Map((this.chartDoc?ti(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){if(!r.get(s.id)?.color){let l=new Map;for(let c of s.memberIds){let d=this.seatById.get(c)?.categoryKey;d&&l.set(d,(l.get(d)??0)+1)}s.baseFill=ni([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(o=>this.statusById.has(o))),n=new Set([...this.ownedHold,...i]);this.ownedHold=i,this.selectionFollowUps.batch(()=>{for(let o of n){let r=this.circleById.get(o);r&&this.paintSeat(r,o),this.syncSelectionMarker(o)}}),n.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let n=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=tc({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>s,sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=n!=null&&i!=null&&ic(n,i,s=>this.seatSection.get(s)?.logicalId??null)?[n,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}n&&this.syncSelectionMarker(n),i&&this.syncSelectionMarker(i);for(let[s,a]of this.selectionMarkers)a.opacity(this.selectionFocusDims(s)?.2:1);this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.updateLabels(),this.overlayLayer.batchDraw()}setSeatMarks(e){let i=this.seatMarks.merge(e,this.statusById);for(let n of i){let o=this.circleById.get(n);o&&this.paintSeat(o,n)}i.size&&(this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}getSeatMark(e){return this.seatMarks.get(e)}getStatus(e){return this.statusById.get(e)??"free"}getSelection(){let e=[];for(let i of this.selection){let n=this.seatById.get(i)??this.selectedSeatById.get(i);n&&e.push(n)}return e}clearSelection(){let e=[...this.selection];this.selectionFollowUps.batch(()=>{for(let i of e)this.setSelected(i,!1,!0)}),this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let i=[];return this.selectionFollowUps.batch(()=>{for(let n of e){if(this.selection.has(n)||!this.isSelectable(n))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(n,!0,!0);let o=this.seatById.get(n);o&&i.push(o)}}),i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee.cancel(),this.gestures.resetPan();let i=e.organizerStatus!==!1,n=i!==this.organizerStatus;this.organizerStatus=i,this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.marqueeShape=e.marqueeShape??"box",this.opts.rowLabelSelect=e.rowLabelSelect===!0,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let o=[...this.selection].filter(r=>!this.isSelectable(r));o.length&&this.deselect(o),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),n&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,n]of Object.entries(e??{}))Number.isFinite(n)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,n)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;this.selectionFollowUps.batch(()=>{for(let n of e)this.selection.has(n)&&(this.setSelected(n,!1,!0),i=!0)}),i&&(this.overlayLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let i of this.seats)this.isSelectable(i.id)&&e.push(i.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let i=new Set(e),n=[];for(let o of this.seats)i.has(o.label)&&this.isSelectable(o.id)&&n.push(o.id);return this.selectMany(n)}setEvidenceSelection(e){return!this.seatById.has(e)||!this.isSelectable(e)?!1:(this.selection.size&&this.clearSelection(),this.setSelected(e,!0),this.overlayLayer.batchDraw(),this.selection.has(e))}getSelectableInSection(e){let i=[],n=new Set;for(let o of this.sections)if(!(o.id!==e&&o.logicalId!==e&&o.zone!==e))for(let r of o.memberIds){if(n.has(r)||(n.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(o=>!this.selection.has(o));if(!i.length)return this.getSelection();let n=this.selection.size+i.length<=is;return this.selectionFollowUps.batch(()=>{for(let o of i)if(n)this.setSelected(o,!0,!0);else{this.selection.add(o);let r=this.circleById.get(o);r&&this.paintSeat(r,o)}}),this.queueViewportPinSync(),this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}rowLabelAtScreen(e){if(!this.opts.manageMode||!this.opts.rowLabelSelect)return null;let i=[],n=this.rowLabelGroup.find(o=>o.getAttr("rowLabel")===!0);for(let o of n){let r=o.getAttr("rowKey");!r||!o.isVisible()||i.push({rowKey:r,box:o.getClientRect({skipShadow:!0,skipStroke:!0})})}return id(e,i)}selectRow(e){let i=td(e,this.seats,n=>this.isSelectable(n));return i.length&&(this.selectMany(i),this.opts.onMarquee?.(this.getSelection())),this.getSelection()}flashSeat(e,i="#f43f5e"){let n=this.seatById.get(e);n&&Vl(this.flashHost,n,i)}flashSection(e,i="#22a06b"){zl(this.flashHost,this.sections.filter(n=>n.id===e||n.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed}}nearestSeat(e,i){let n=this.seatById.get(e);if(!n)return null;let o=n,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=a,c=l.x-o.x,d=l.y-o.y,u=c*i.x+d*i.y;if(u<=.5)continue;let h=Math.abs(c*i.y-d*i.x),f=u+h*2.5;f<s&&(s=f,r=a.id)}return r}focusSeat(e,i){let n=this.seatById.get(e);n&&(this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(n),this.focusRing.scale({x:1,y:1}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},Cg)),i?.move!==!1&&this.ensureVisible(n),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(n))}clearFocusRingLinger(){this.focusRingLinger&&clearTimeout(this.focusRingLinger),this.focusRingLinger=null}dismissFocusRing(){this.clearFocusRingLinger(),this.focusRing.visible()&&(this.focusRing.visible(!1),this.queueViewportPinSync(),this.overlayLayer.batchDraw())}ensureVisible(e){let i=this.stage.width(),n=this.stage.height(),o=Math.max(this.stage.scaleX(),Se*1.2),r=this.worldToScreen(e),s=70,a=r.x<s||r.x>i-s||r.y<s||r.y>n-s;if(this.stage.scaleX()<o||a){let l=e;this.stage.scale({x:o,y:o}),this.stage.position({x:i/2-l.x*o,y:n/2-l.y*o}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=Lc(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e,i=0){let n={bottom:Math.max(0,e||0),width:Math.max(0,i||0)};n.bottom===this.fitClearance.bottom&&n.width===this.fitClearance.width||(this.fitClearance=n,this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return Cc(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){return xc(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return Pc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){mc(this.cameraHost)}isSeatRevealPending(){return this.seatRevealPending||this.seatReveal!==null||!!this.viewportSeats?.pending}get cameraHost(){return this.cameraHostCache??={stage:this.stage,bgLayer:this.bgLayer,seatLayer:this.seatLayer,exportMode:()=>this.exportMode,destroyed:()=>this.destroyed,reducedMotion:()=>this.reducedMotion,cameraGlideMs:()=>this.cameraGlideMs,portraitFitCrop:()=>this.opts.portraitFitCrop,openAtSectionsWhenDense:()=>this.opts.openAtSectionsWhenDense===!0,hasSections:()=>this.hasSections,fitClearanceBottom:()=>this.fitClearance.bottom,fitClearanceWidth:()=>this.fitClearance.width,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),zones:()=>this.zones,markerR:()=>this.markerR,unitZoomCeiling:()=>Math.max(ul(this.sellableUnit),this.hasSections?ve:0),bounds:()=>this.bounds,fitScale:()=>this.fitScale,setFitScale:e=>{this.fitScale=e},setFitPose:e=>{this.fitPose=e},revealWorldRect:()=>this.viewportSeats||this.isSeatRevealPending()?this.revealWorldRect:null,glideRaf:()=>this.glideRaf,setGlideRaf:e=>{this.glideRaf=e},setGlideInProgress:e=>{this.glideInProgress=e},zoomSettleRaf:()=>this.zoomSettleRaf,setZoomSettleRaf:e=>{this.zoomSettleRaf=e},gestureFrame:()=>this.gestureHits.bump(),framingViewport:()=>this.framingViewport(),constrainPan:(e,i)=>this.constrainPan(e,i),sectionBounds:e=>this.sectionBounds(e),effScale:()=>this.effScale(),settleView:()=>this.settleView(),afterViewChange:()=>this.afterViewChange(),scheduleViewChange:()=>this.scheduleViewChange(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),updateLOD:()=>this.updateLOD(),cancelGlide:()=>this.cancelGlide()}}refitCurrentView(e=!1){if(e){this.settleView();return}if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return Tc(this.stage)}setCameraPose(e){this.cancelGlide(),Ic(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.stepZoom(Zt.ZOOM_STEP)}zoomOut(){this.stepZoom(1/Zt.ZOOM_STEP)}stepZoom(e){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),Wi({stage:this.stage,reducedMotion:()=>this.reducedMotion,bounds:()=>this.zoomBounds(),apply:(i,n)=>this.zoomAbout(i,n)},e,Ki(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX();return{x:e.x*i+this.stage.x(),y:e.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let n of this.sections)this.refreshSectionFill(n);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale()),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((n,o)=>n===e[o])}setCommercialLimitedFilter(e){this.commercialLimitedFilter!==e&&(this.commercialLimitedFilter=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setCategoryFilter(e){let i=e===null?null:new Set(e);yl(i,this.categoryFilter)||(this.categoryFilter=i,this.lodScale=0,this.updateLOD(),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}applyGAFilterState(){this.clusterLabels.applyFilterDim(),this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){qc({gaById:this.gaById,bgLayer:this.bgLayer,exportMode:this.exportMode,pickerMode:!!this.opts.gaPickerMode,selectionColor:this.effSelection,labelFont:()=>this.labelFont(),filteredOut:e=>!!(this.categoryFilter&&!this.categoryFilter.has(e)),dimmed:e=>Uc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Q,effScale:()=>this.effScale(),labelLegible:e=>be(e,this.effScale())})}setGAStates(e){Zc(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,i){this.setGAStates({[e]:i})}get focusFramingContext(){return{stage:this.stage,seats:this.seats,sections:this.sections,hasSections:this.hasSections,seatById:this.seatById,seatSection:this.seatSection,statusById:this.statusById,ownedHold:this.ownedHold,accessFilter:this.accessFilter,accessFreeBySection:this.accessFreeBySection,clusterLabels:this.clusterLabels,seatR:this.seatR,markerR:this.markerR,sellableUnit:this.sellableUnit,seatPitch:this.seatPitch,cameraGlideMs:this.cameraGlideMs,seatInClosedSection:e=>this.seatInClosedSection(e),isSectionClosed:e=>this.isSectionClosed(e),sectionMembers:e=>this.sectionMembers(e),sectionBounds:e=>this.sectionBounds(e),focusedRowLabelGutter:e=>this.focusedRowLabelGutter(e),seatLabelTargetScale:()=>this.seatLabelTargetScale(),zoomBounds:()=>this.zoomBounds(),rowBandDetailScale:()=>this.rowBandPreview?.active?this.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,n,o)=>this.narrowSeatDetailFocus(e,i,n,o),focusSection:(e,i)=>this.focusSection(e,i),markSectionFocus:(e,i)=>this.markSectionFocus(e,i),clearSectionFocus:()=>this.clearSectionFocus(),focusRegion:(e,i)=>this.focusRegion(e,i)}}focusCategories(e,i){_d(this.focusFramingContext,e,i)}diveCeiling(){return yt(this.focusFramingContext)}focusAccessibleSeats(e){return Bd(this.focusFramingContext,e)}focusAccessibleSection(e,i){return Dd(this.focusFramingContext,e,i)}accessibleSpread(e){return Nd(this.focusFramingContext,e)}setViewMode(e){Pd(e),this.afterViewChange()}getViewMode(){return"flat"}effScale(){return this.stage.scaleX()}destroy(){this.movingLabelTimer&&(clearTimeout(this.movingLabelTimer),this.movingLabelTimer=null),this.rowBandPreview?.clear(),this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.rafId&&cancelAnimationFrame(this.rafId),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.gestureHits.destroy(),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let n=this.seatSection.get(e);return i*(n&&this.sectionMatchesFocus(n)?1:Te)}sectionScreenBounds(e){return Va({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Q,i=[],n=96,o=this.stage.width(),r=this.stage.height();for(let s of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(s);a=c.x+c.width>=-n&&c.y+c.height>=-n&&c.x<=o+n&&c.y<=r+n}this.viewportSeats&&a&&(e||s.id===this.focusedSectionId||s.logicalId===this.focusedSectionId)&&i.push(s.id),s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0)}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let n of i.memberIds){let o=this.seatById.get(n);o&&e.push(o)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let n=this.seatById.get(i);n&&e.push(n)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let n=this.labelLiftGroups.get(i.id);return n||(n=new gt({listening:!1}),n.setViewportCulled(i.liftGroupSeat.isViewportCulled()),this.labelGroup.add(n),this.labelLiftGroups.set(i.id,n)),n}viewportPins(){return ja([this.focusRing.visible()?this.focusedId:null,this.hoveredId],this.ownedHold,this.selection)}queueViewportPinSync(){!this.viewportSeats||this.viewportPinSync||(this.viewportPinSync=!0,queueMicrotask(()=>{this.viewportPinSync=!1,this.viewportSeats?.sync(this.viewportWanted,this.viewportPins())}))}startViewportSeats(){let e=new Map;this.viewportWanted=["__loose"];for(let i of this.seats){let n=this.seatSection.get(i.id)?.id??"__loose",o=e.get(n);o||e.set(n,o=[]),o.push(i)}this.viewportSeats=new Ei(e,{build:i=>this.renderSeats(i),remove:i=>{for(let n of i)for(let o of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])o.get(n.id)?.destroy(),o.delete(n.id);this.glyphMarkers=this.glyphMarkers.filter(n=>!!n.getParent())},draw:()=>{this.updateLOD(),this.updateLabels(),this.seatLayer.batchDraw()},schedule:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i),now:()=>performance.now(),sectionOf:i=>this.seatById.has(i)?this.seatSection.get(i)?.id??"__loose":void 0})}renderSeats(e=this.seats){pl({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,n)=>this.buildAccessGlyph(i,n),paintSeat:(i,n)=>this.paintSeat(i,n),labelFont:()=>this.labelFont()}),this.selectionFollowUps.batch(()=>{for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)})}buildAccessGlyph(e,i){let n=this.seatR*1.5/ye,o=new Lg({x:e.x,y:e.y,data:nt(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:li(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return zc(o),o}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,n]of this.accessGlyphById){let o=this.seatR*1.5/ye,s=this.accessGlyphFilterEmphasized(i)?$r:Ur,a=Math.max(o,s/(ye*Math.max(e,.001)));n.scale({x:a,y:a}),n.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),n=this.accessFilter;return!!i&&n!==null&&!!i.accessibility?.length&&Ie(i,n)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode||i==="not_for_sale"&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${Ue(i.min,this.currency)}\u2013${Ue(i.max,this.currency)}`;let n=this.catPrice.get(e);return typeof n=="number"?Ue(n,this.currency):null}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,n])=>[i,{min:n.min,max:n.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let n=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof n=="number"&&this.catPrice.set(i.key,n)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.categoryColours?this.colourOverride?.[e]?this.colourOverride[e]:this.colorblind?this.cbHueByKey.get(e)??ki[0]:this.catColor.get(e)??"#6e7bff":Da}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Qe}seatLabelInk(e,i){let n=i.fill();return de(typeof n=="string"?n:"",e.labelStyle?.color,this.theme.seatLabelColor??Qe,ze)}get seatPaintContext(){return this.seatPaintCache||(this.seatPaintCache={organizer:()=>this.opts.manageMode===!0&&this.organizerStatus,organizerGlyph:this.opts.organizerGlyph,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",isSelected:e=>this.selection.has(e),isOwnedHold:e=>this.ownedHold.has(e),categoryColor:e=>this.categoryDisplayColor(e),boothLabel:e=>this.boothLabelById.get(e),boothExtent:e=>{let i=this.boothDims.get(e);return i?{...ft(i),...i.nameSize?{nameSize:i.nameSize}:{}}:void 0},seatLabel:e=>this.seatLabelById.get(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatMarks:this.seatMarks,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,colorblind:()=>this.colorblind,selectionColor:()=>this.effSelection,theme:()=>this.theme,effScale:()=>this.effScale(),seatInClosedSection:e=>this.seatInClosedSection(e),selectionFocusDims:e=>this.selectionFocusDims(e),accessFilter:()=>this.accessFilter,categoryHighlight:()=>this.categoryHighlight,seatHighlight:()=>this.seatHighlight,categoryFilter:()=>this.categoryFilter,commercialLimitedFilter:()=>this.commercialLimitedFilter,dimmedSections:()=>this.dimmedSections,closedSections:()=>this.closedSections,seatSection:e=>this.seatSection.get(e),accessGlyph:e=>this.accessGlyphById.get(e),accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),accessRing:e=>this.accessRingById.get(e),accessRingShouldShow:e=>this.accessRingShouldShow(e)}),this.seatPaintCache}paintSeat(e,i){nc(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}repaintSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){e!==this.colorblind&&(this.colorblind=e,this.recolourCategories())}setCategoryColourOverride(e){this.colourOverride=e,this.recolourCategories()}recolourCategories(){this.repaintSeats();for(let e of this.sections)e.shellCategoryColor=this.dominantSellableColor(e.memberIds),this.refreshSectionFill(e);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}setDimmedSections(e){let i=new Set(e??[]);i.size===this.dimmedSections.size&&[...i].every(n=>this.dimmedSections.has(n))||(this.dimmedSections=i,this.repaintSeats(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(n=>this.closedSections.has(n))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(n=>n.id===e||n.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return Po(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,n){if(this.rowBandPreview&&!this.exportMode){let o=this.sectionBounds(e);if(o){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(o,{animate:i,maxScale:r});return}}Hd(this.focusFramingContext,e,i,n)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=U}setSectionFocusDim(e){let i=this.sectionDimEnabled();this.sectionFocusDim=e,i!==e&&(e||this.dropFocusDim())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=ae}atVenueFit(){return this.fitPose!==""&&qe(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active||this.viewportSeats&&this.seatLayer.opacity()===0?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=Fi(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(n=>n.id===e||n.logicalId===e);if(this.focusBackdrop=Kl(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Xl(this.focusBackdropHost,i);for(let n of this.selectionMarkers.values())n.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let n=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),o=2;return[{x:n.x-o,y:n.y-o},{x:n.x+n.width+o,y:n.y-o},{x:n.x+n.width+o,y:n.y+n.height+o},{x:n.x-o,y:n.y+n.height+o}]}):[]}}}repaintSectionsAndSeats(){this.repaintSeats();for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,n=-1/0,o=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>n&&(n=s),a>o&&(o=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,n-e),height:Math.max(1,o-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let n=this.isSectionClosed(i)||i.free<=0,o=i.memberIds.some(a=>this.selection.has(a)),r=o||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:o?"selected":n?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r,free:i.free,total:i.memberIds.length}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),n={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:n.x+this.stage.width()/2-i.x,y:n.y+this.stage.height()/2-i.y},n)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let n=this.stage.x(),o=this.stage.y(),r=this.constrainPan({x:n+e.x,y:o+e.y},{x:n,y:o}),s=r.x-n,a=r.y-o;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=u=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let h=Math.min(1,(u-l)/c),f=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:n+s*f,y:o+a*f}),this.scheduleViewChange(),this.stage.batchDraw(),h<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setSeatHighlight(e){Na(this.readingAidsHost,e)}setLabelLayers(e){Ha(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Ga(this.readingAidsHost,e)}refreshBlockPaint(){this.repaintSectionsAndSeats(),this.updateLOD()}getCategoryColours(){return this.categoryColours}get readingAidsHost(){return{seatHighlight:()=>this.seatHighlight,setSeatHighlightState:e=>{this.seatHighlight=e},labelLayers:()=>this.labelLayers,setLabelLayersState:e=>{this.labelLayers=e},repaintSeats:()=>this.repaintSeats(),updateLabels:()=>this.updateLabels(),draw:()=>{this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()},categoryColours:()=>this.categoryColours,setCategoryColoursState:e=>{this.categoryColours=e},repaintSectionsAndSeats:()=>this.repaintSectionsAndSeats()}}setCategoryHighlight(e){this.categoryHighlight!==e&&(this.categoryHighlight=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}renderBackground(e){let i=xt(e);i&&this.renderBackgroundImage(i);for(let n of e.objects)n.type==="decorImage"&&this.renderDecorImage(n);for(let n of e.objects)n.type==="section"&&this.renderSection(n);for(let n of e.objects)n.type==="shape"?this.renderShape(n):n.type==="gaArea"?this.renderGA(n):n.type==="table"?this.renderTable(n):n.type==="text"&&this.renderText(n);this.renderZones(e)}trackAssetImage(e,i,n,o){this.assets.track(e,i,n,o,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){hd(this.objectDrawContext,e)}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,landmarkBoxes:this.landmarkBoxes,labelFont:()=>this.labelFont(),trackAssetImage:(e,i,n,o)=>this.trackAssetImage(e,i,n,o),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){ud(this.objectDrawContext,e)}renderTable(e){pd(this.objectDrawContext,e)}renderText(e){fd(this.objectDrawContext,e)}renderShape(e){md(this.objectDrawContext,e)}renderGA(e){bd(this.objectDrawContext,e)}renderSection(e){let i=Ad(this.sectionBuildContext,e);for(let n of i.memberIds)this.seatSection.set(n,i);this.unsectionedSeatIds=null,this.refreshSectionFill(i),this.refreshSectionHeat(i),this.sections.push(i)}get sectionBuildContext(){return{bgLayer:this.bgLayer,seatLayer:this.seatLayer,canvasBackground:this.canvasBackground,seats:this.seats,seatById:this.seatById,seatSection:this.seatSection,seatIndex:this.seatIndex,statusById:this.statusById,catColor:this.catColor,zoneColor:this.zoneColor,chartDoc:this.chartDoc,labelFont:()=>this.labelFont(),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){Tl(this.sectionLodPaintContext,e)}refreshSectionFill(e){Rl(this.sectionLodPaintContext,e)}isSectionClosed(e){return ho(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Os(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return Ro(this.focusFramingContext,e)}accessibleSections(e){return Mo(this.focusFramingContext,e)}get sectionLodPaintContext(){let e=new Set([...this.selection,...this.ownedHold].map(i=>this.seatSection.get(i)));return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:i=>e.has(i),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:i=>this.sectionAccessibleFree(i),blockPaint:this.opts.blockPaint,selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,glideInProgress:this.glideInProgress,sectionsPinned:this.sectionRungPinned,reducedMotion:this.reducedMotion,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){this.opts.manageMode||qa({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:!!this.chartDoc&&tt(this.chartDoc)==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX();return{x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i}}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),n=this.sections.find(o=>te(i,o.outline,o.holes));return n?n.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Gi(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let n of this.gaById.values())if(te(i,n.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||So(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,ue,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(n=>n.id===e||n.logicalId===e||n.zone===e);return!i.length||this.opts.manageMode?!0:i.some(n=>!this.isSectionClosed(n)&&n.free>0?!0:n.memberIds.some(o=>this.selection.has(o)||this.ownedHold.has(o)))}sectionMembers(e){return[...new Set(this.sections.filter(i=>i.id===e||i.logicalId===e||i.zone===e).flatMap(i=>i.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)||!(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")?!1:!this.hiddenByAccessFilter(e)}hiddenByAccessFilter(e){if(!this.accessFilter||this.selection.has(e))return!1;let i=this.seatById.get(e);return i?Pe(i,this.accessFilter)==="other":!1}toggleSeat(e){if(this.ownedHold.has(e)){let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i);return}if(this.selection.has(e)){this.setSelected(e,!1),this.effScale()>ie&&this.updateLabels();let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i)}else{if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);return}this.setSelected(e,!0),this.playSeatPickMoment(e);let i=this.seatById.get(e);i&&this.opts.onSelect?.(i)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?yn(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let n=yn(getComputedStyle(i).backgroundColor);if(n)return n;i=i.parentElement}}return oo}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:H(this.canvasBackground)?tl:pt}setSelected(e,i,n=!1){let o=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());o&&(this.paintSeat(o,e),!n&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.queueViewportPinSync(),this.selectionFollowUps.request()}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){let i=this.sectionBoundsMemo;if(i.has(e))return i.get(e)??null;!i.size&&typeof queueMicrotask=="function"&&queueMicrotask(()=>i.clear());let n=this.measureSectionBounds(e);return typeof queueMicrotask=="function"&&i.set(e,n),n}measureSectionBounds(e){return Ua({sections:this.sections,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,n,o)=>this.resolveAutomaticRowLabelPosition(i,n,o),rowLabelBox:(i,n)=>this.rowLabelBox(i,n)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(mt(this.stage,i,this.zoomBounds(),Kt(this.framingViewport(),this.focusedRowLabelGutter(e))),Gt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return Vc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return ml(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return fl(this.screenPickingHost,e,i,{includeUnavailable:n})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,selection:this.selection,objectFloor:this.objectFloor,screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){cc(this.interactionHost)}handleSeatTap(e){dc(this.interactionHost,e)}get interactionHost(){return this.interactionHostCache??={stage:this.stage,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,hoverRing:this.hoverRing,clusterLabels:this.clusterLabels,container:this.container,attachHoverCard:()=>this.hoverCard.attach(),moved:()=>this.moved,isGhostClick:e=>this.isGhostClick(e),cached:()=>this.cached,reducedMotion:()=>this.reducedMotion,stacked:()=>this.stacked,floorOverview:()=>this.separatedFloorOverview,focusedSectionId:()=>this.focusedSectionId,sectionCount:()=>this.sections.length,selectionMarkers:()=>this.selectionMarkers,dismissFocusRing:()=>this.dismissFocusRing(),seat:e=>this.seatById.get(e),seatMark:e=>this.seatMarks.get(e),seatSection:e=>this.seatSection.get(e),objectFloor:e=>this.objectFloor.get(e),setHoveredId:e=>{this.hoveredId!==e&&(this.hoveredId=e,this.queueViewportPinSync())},seatsPickable:()=>this.seatsPickable(),manageSeatHits:()=>this.opts.manageMode===!0&&this.getRung()==="seats",handleSeatTap:e=>this.handleSeatTap(e),seatStatus:e=>this.statusById.get(e)??"free",hasSeatMark:e=>this.seatMarks.has(e),isOwnedHold:e=>this.ownedHold.has(e),isSelected:e=>this.selection.has(e),isSelectable:e=>this.isSelectable(e),hiddenByAccessFilter:e=>this.hiddenByAccessFilter(e),seatInClosedSection:e=>this.seatInClosedSection(e),toggleSeat:e=>this.toggleSeat(e),nudgeSeat:e=>this.moments.nudge(e),nearestSeatToScreen:(e,i,n)=>this.nearestSeatToScreen(e,i,n),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>Za({doc:this.chartDoc,zones:this.zones,sections:this.sections,enterFloor:i=>this.opts.onDeckTap?this.opts.onDeckTap(i):this.setActiveFloor(i),frame:i=>this.focusRegion(i)},e),sectionFrameScale:e=>this.sectionFrameScale(e),sectionTapAnchor:(e,i)=>this.sectionTapAnchor(e,i),rowLabelAt:e=>this.rowLabelAtScreen(e),selectRow:e=>{this.selectRow(e)},ownedBadgeAt:e=>this.owned.badgeAt(e),focusOwnedSeats:e=>this.focusOwnedSeatsIn(e),pressLandsOnChart:e=>this.pressLandsOnChart(e),tableAt:e=>So(this.tableFootprints,this.seats,this.screenToWorld(e),this.effScale()),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,n)=>this.zoomAbout(e,i,n),panBy:(e,i)=>bc(this.cameraHost,e,i),zoomBounds:()=>this.zoomBounds(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):Ki(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),n)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap??(this.opts.manageMode?()=>this.overview():void 0),onDeckTap:this.opts.onDeckTap}}zoomBounds(){return zt(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),gc(this.cameraHost,e,i,n)}cancelZoomSettle(){Sc(this.cameraHost)}focusRegion(e,i){vc(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let n=performance.now();this.labelGroup.opacity(0);let o=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-n)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(o):0};this.labelFadeRaf=requestAnimationFrame(o)}cancelGlide(){Wt(this.stage),this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Q?"seats":this.sectionRungPinned?"sections":this.zones.length&&e<Ke?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),od(this.renderedQualityContext)}setRung(e){let i=this.sectionRungPinned;if(this.sectionRungPinned=e==="sections",e==="zones")this.cancelGlide(),this.zoomToFit();else{let n=this.framingViewport(),o=jc({rung:e,bounds:this.bounds,sections:this.sections,seats:this.seats,focusedSectionId:this.focusedSectionId,viewCentre:Ki(this.framingWorldRect()),width:n.width,height:n.height,seatScale:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),seatFloor:Math.min(this.rowBandPreview?this.rowBandPreview.detailScale*1.08:Q*1.1,this.zoomBounds().max)});this.focusRegion(o.bounds,o.minScale===void 0?void 0:{minScale:o.minScale})}(i||this.sectionRungPinned)&&this.updateLOD()}seatRungScale(){return Oc(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Kt(this.framingViewport(),o);return Nc({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:n})}releaseFocusOnPullBack(){this.rowBandPreview&&this.focusedSectionId&&this.effScale()>=Math.min(Q,this.sectionFrameScale(this.focusedSectionId)*.85)||pc({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Q))return;let o=(i&&e?this.sectionAt(e):null)??za({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!o||o===this.focusedSectionId||(this.focusedSectionId=o,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(o))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ie&&!this.rowBandPreview?.active||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},ts))}sizeLabel(e,i,n){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(n)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),ve+.01,ie):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)gd(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(_l(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Q,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Q),()=>this.sectionFrameScale(this.focusedSectionId),r=>{let s=r.outline.map(a=>this.worldToScreen(a));return Math.max(...s.map(a=>a.x))>=0&&Math.min(...s.map(a=>a.x))<=this.stage.width()&&Math.max(...s.map(a=>a.y))>=0&&Math.min(...s.map(a=>a.y))<=this.stage.height()},()=>this.zoomBounds().max),this.owned.sync(e,this.getRung()),this.syncBeacons()):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e);let n=this.seatGlyphDetail;if(this.seatGlyphDetail=Us(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),n!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let r=this.seatLayer.opacity()>0;this.seatLayer.listening(r),!r&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let o=!this.exportMode&&!this.rowBandPreview?.active&&e<Q;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),o&&!this.cached&&this.seatLayer.opacity()===0){this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.seatLayer.listening(!1),this.hoveredId&&this.seatLayer.fire("mouseout");return}if(o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.viewportSeats||this.seatReveal||this.seatRevealPending||this.rowBandPreview?.active)return;if(this.seatLayer.opacity()===0){this.cached&&this.releaseSeatLayerBitmap(),this.cached=!1,this.seatLayer.listening(!1);return}this.updateSeatGroupVisibility();let e=q(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0,this.mountCachePending=!1}cacheSeatLayer(){this.destroyed||typeof document>"u"||(this.recacheTimer=null,this.rebuildSeatCache(),this.seatLayer.batchDraw())}releaseSeatLayerBitmap(){wd(Ji,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.gestureHits.flush(),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Q?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),n=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:n,width:Math.max(1,o-i),height:Math.max(1,r-n)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),n=Math.max(12,Math.min(36,Math.min(e,i)*.025)),o=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-n*2),a=Math.max(1,i-n*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};o(),o()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(o){let r=o instanceof Error?o.message:String(o);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let n=i.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");n.fillStyle=this.canvasBackground,n.fillRect(0,0,i.width,i.height);try{n.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ie):this.effScale(),i=[];for(let{node:n,backdrop:o,kind:r,showAt:s,area:a}of this.freeTextById.values()){if(r==="ga-label"||r==="ga-capacity"||a)continue;let l=r==="free-text"&&this.nodeBelongsToFocusedSection(n),c=r==="direct-landmark";if(c){let f=Number(n.getAttr("directLandmarkBaseFontSize"))||n.fontSize();n.setAttr("directLandmarkBaseFontSize",f),n.fontSize(Math.max(f,V/e)),i.push({node:n,backdrop:o,baseFontSize:f})}let d=s==="detail"&&!this.exportMode&&e<Le,h=c||r==="stage"||l||!d&&be(n.fontSize(),e);if(n.visible(h),o?.visible(h),!this.exportMode&&r==="free-text"){let f=Math.min(1,Ps/Math.max(n.fontSize()*e,1e-6));n.scale({x:f,y:f}),o?.scale({x:f,y:f})}}Ac(i),Ec({freeTextById:this.freeTextById,focalLabels:this.primaryFocalLabels.keys(),seatIndex:this.seatIndex,bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,scale:e});for(let{node:n,fontSize:o}of this.iconNodeById.values())n.visible(this.nodeBelongsToFocusedSection(n)||be(Lo(n,o,e),e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let n=this.focusMembership.get(e);if(n!==void 0)return n;let o=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(o.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=o.some(l=>te(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.sectionBoundsMemo.clear(),this.rowLabelDwell.reset(),this.rowLabelPlan=Sd(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,sections:this.sections,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,n=ee){return $t(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return vd(e,i,n,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){cl(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,labelLayers:()=>this.labelLayers,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),rowLabelDwell:this.rowLabelDwell,gesturing:()=>this.gestureHits.active,worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,markerR:this.markerR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,n)=>this.resolveAutomaticRowLabelPosition(e,i,n),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Qc({width:this.container.clientWidth,height:this.container.clientHeight,stageWidth:this.stage.width(),stageHeight:this.stage.height()});if(e==="hidden"){this.hiddenPose??=this.getCameraPose();return}let i=this.hiddenPose;if(this.hiddenPose=null,e==="unchanged"){i&&this.setCameraPose(i);return}let n={width:this.stage.width(),height:this.stage.height()};this.stage.size(e),i&&this.setCameraPose(i);let r=!(this.fitPose===""||qe(this.stage)===this.fitPose)&&e.width===n.width;r&&this.stage.position({x:this.stage.x()+(e.width-n.width)/2,y:this.stage.y()+(e.height-n.height)/2}),this.refitCurrentView(r)}};Zt.ZOOM_STEP=1.4;var Ao=Zt;function Vd(t,e){return new Ao(t,e)}function Tg(t,e){return t*2*.6*e>=6}function Ig(t,e){t._sceneFunc(e)}function Fo(t){let e=this,i=e.attrs;Ig(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Tg(n,r))return;let s=n*.6;t.save(),t.setAttr("strokeStyle",i.organizerGlyphInk||"#000000"),t.setAttr("lineWidth",Math.max(n*.2,.75)),t.setAttr("lineCap","round"),t.setAttr("lineJoin","round"),t.beginPath(),i.organizerGlyph==="cross"?(t.moveTo(-s,-s),t.lineTo(s,s),t.moveTo(s,-s),t.lineTo(-s,s)):(t.moveTo(0,-s),t.lineTo(0,0),t.lineTo(s*.72,0)),t.stroke(),t.restore()}function zd(t){return t.attrs.sceneFunc===Fo}function Kd(t){zd(t)&&t.setAttr("sceneFunc",void 0)}function Pg(t,e,i,n){if(!e){Kd(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==Fo&&t.setAttr("sceneFunc",Fo)}function Xd(t,e){t.accessFilter=e===null?null:[...e],t.renderer?.setAccessibilityFilter?.(e);let i=t.renderer?.getFocusedSection?.()??null;i&&t.emitSectionFocus(t.sectionSummary(i))}function _o(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let n=e===void 0?t.accessFilter:e;if(!n)return!1;let o=qd(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function Yd(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let n=e===void 0?t.accessFilter:e;return n?i.accessibleSpread(n):null}function Ud(t,e,i,n){let o=t.renderer;o&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&o.focusAccessibleSection?.(e,t.accessFilter)||(o.focusSection?o.focusSection(e,n?{anchor:n}:void 0):o.focusRegion?.(e)))}function $d(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=qd(t,i);n&&t.setFloor(n);let o=t.renderer,r=o?.accessibleSections?.(i)??[];if(!r.length)return null;let s=t.accessStepAt?r.findIndex(l=>l.id===t.accessStepAt):-1,a=r[(s+1)%r.length];return t.accessStepAt=a.id,o?.focusAccessibleSection?.(a.id,i)||o?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function qd(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=l=>n.size===0?!!l.accessible:!!l.accessibility?.some(c=>n.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(o)),s=t.getActiveFloorId(),a=i.floors.find(l=>l.id===s);return a&&r(a.objects)?null:i.floors.find(l=>r(l.objects))?.id??null}function Zd(t,e){return t.accessFilter?Pe(e,t.accessFilter)==="other":!1}function Qd(t,e){let i=t.renderer;if(!i)return;let n=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?n:null);let r=Rg(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let o=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&_o(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function Rg(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=a=>a.some(l=>l.type==="row"&&(n.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&n.has(c.categoryKey)))||l.type==="gaArea"&&n.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&o(s.objects)?null:i.floors.find(a=>o(a.objects))?.id??null}function jd(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(ii(t).map(h=>[h.id,h])),c=fr(t),d=it(t),u=hi(t);for(let h of e){n.set(h.label,h.id),o.set(h.label,h),r.set(h.id,h),a.push(h.id);let f=l.get(h.rowId),m=f&&"label"in f&&typeof f.label=="string"?f.label:void 0,y=f?.type==="row"?f.segmentedRow:void 0,p=y?.displayLabel??(f&&"displayLabel"in f&&typeof f.displayLabel=="string"&&f.displayLabel?f.displayLabel:m),g=i.get(h.rowId),b=f?.type==="table"?"table":f?.type==="booth"?"booth":"seat",S=p,w=y?.displayType?.trim()||(f&&"displayType"in f&&typeof f.displayType=="string"&&f.displayType.trim()?f.displayType.trim():void 0),k=h.displayLabel??h.label,v=k.split("-"),x=g||h.kind==="booth"?void 0:p&&k.startsWith(`${p}-`)?k.slice(p.length+1):v[v.length-1]??k;s.set(h.id,{objectId:h.rowId,objectType:b,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:x,...w?{displayType:w,rowType:w}:{},...Mg(f,h.sectionId?d.get(h.sectionId):void 0),...f?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function Mg(t,e){if(t?.type!=="table"&&t?.type!=="booth")return{};let i=t.entrance?.trim()||e;return{...i?{entrance:i}:{},...t.type==="booth"&&t.boothType?{boothType:t.boothType}:{}}}function Jd(t,e={}){let{baseMs:i=1e3,factor:n=2,maxMs:o=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*n**Math.max(0,t),o);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function eh(t,e,i,n=1){let o=mr(t),r=it(t);return Ct(t).map(s=>{let a=t.categories.find(d=>d.key===s.categoryKey),l=o.get(s.id),c=s.entrance?.trim()||(l?r.get(l):void 0);return{id:s.id,label:s.label,...s.displayLabel?{displayLabel:s.displayLabel}:{},...s.displayType?{displayType:s.displayType}:{},capacity:Math.max(0,Math.floor(s.capacity)),...Eg(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function Eg(t,e,i){let n=fn(t,i),o=mn(t,i),r=Lt(t),s=i===2&&n.length===1&&n[0]===t.label?un(t):null;if(s){let{min:l,max:c}=pn(t),d=e(t.label)==="free";return{available:d?c:0,bookingMode:s,minOccupancy:l,maxOccupancy:c,...r?{wheelchairPlaces:r,wheelchairAvailable:d?r:0}:{}}}let a=n.filter(l=>e(l)==="free");return{available:a.length,...r?{wheelchairPlaces:r,wheelchairAvailable:a.filter(l=>o.has(l)).length}:{}}}function th(t,e,i){let n=Math.floor(e),o=fn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?un(t):null;if(r){let{min:d,max:u}=pn(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!Lt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=mn(t,i.modelVersion),a=o.filter(d=>!i.alreadyHeld.has(d)&&i.statusOf(d)==="free"),c=(i.wheelchairOnly?a.filter(d=>s.has(d)):[...a.filter(d=>!s.has(d)),...a.filter(d=>s.has(d))]).slice(0,n);return c.length===n?c.map(d=>({label:d})):null}function Ag(t){return t.available<=0?0:t.bookingMode==="whole"||t.bookingMode==="variable"?t.wheelchairPlaces?t.wheelchairAvailable??t.wheelchairPlaces:0:Math.min(t.available,t.wheelchairAvailable??0)}function ih(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?Ag(o):null;n[o.id]=e?{available:o.available,selected:e.get(o.id)??0,wheelchairFree:r}:{available:o.available,wheelchairFree:r}}return n}function nh(t){let e={};for(let[i,n]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[n.categoryKey]=(e[n.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(o=>t.closedMembers.has(o.id)))continue;let n=i.chairs[0];n&&(t.statusOf(n.id)??"free")==="free"&&(e[i.categoryKey]=(e[i.categoryKey]??0)+i.maxOccupancy)}for(let i of t.gaAreas??[])e[i.categoryKey]=(e[i.categoryKey]??0)+i.available;return e}function Fg(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function oh(t,e,i=[]){let n=new Set,o=new Map;for(let r of i)n.add(r.need),o.set(r.need,(o.get(r.need)??0)+r.free);for(let r of t){let s=Fg(r);if(!s.length)continue;let a=e(r.id)==="free";for(let l of s)n.add(l),a&&o.set(l,(o.get(l)??0)+1)}return n.size?Yo.filter(r=>n.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var pT=5e3,fT={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function _g(t){if(!t.holdActive||t.holdLabels.length===0)return!1;let e=t.now??Date.now();return t.holdExpiresAt!=null&&e>=t.holdExpiresAt+5e3||t.serverHoldActive===!1?!0:!t.holdLabels.some(i=>t.statusOf(i)==="held")}function rh(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!_g(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let n=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:n,recoverable:n.filter(o=>t.statusOf(o)==="free")}}function mT(t){return t.lost.length>0||t.holdLapsed}function gT(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function sh(t,e,i=Date.now()){return e&&i<t+5e3}function ah(t){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&t()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function lh(t){if(!t?.zones?.length)return[];let e=new Set(gr(t).sections.filter(i=>i.seatCount>0&&!!i.zone).map(i=>i.zone));return t.zones.filter(i=>e.has(i.id)).map(i=>({id:i.id,label:i.label}))}function ch(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=He(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),o=new Set;for(let s of n)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Ie(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=zr(n,o,{qty:t.qty,categoryKey:t.categoryKey,zoneId:t.zoneId,focal:i,preferPremium:!0});return r.labels.length!==t.qty?null:r.labels.every(s=>t.isPremium(s))?[...r.labels]:null}var Bo=["background","rowLabelColor","textColor","selectionColor"];function dh(t,e){return!t||!e?!t&&!e:Bo.every(i=>t[i]===e[i])}function St(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function en(t){return t==="blocked"?"not_for_sale":t==="unavailable"?"held":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function hh(t,e,i){let n=dr(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}var Ee=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function Oo(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function uh(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var tn=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,i){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let n=this.ref;this.pending=e.eventConfiguration(i).then(o=>{if(o.reference.id!==n.id||o.reference.version!==n.version||o.configuration.id!==n.id||o.configuration.version!==n.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return o.configuration})}return this.pending}};async function ph(t,e,i){if(!t.renderer)return null;let o=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...o])];if(!s.length)return null;let a=t.ticketIssue(s);if(a)throw new Ee(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let u=r.find(m=>m.label===d);if(u&&(u.objectType==="ga"||u.quantity!=null||u.tierId!=null))return{label:d,tierId:u.tierId,...u.quantity!=null?{quantity:u.quantity}:{}};let h=t.labelToSeat.get(d),f=h?t.toSeat(h):null;return{label:d,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),c=await t.api.hold(t.key,l,i,t.hold_?.holdId);return t.setHold({holdId:c.holdId,labels:s,expiresAt:c.expiresAt,items:c.items}),t.hold_}catch(l){throw t.handle409Conflicts(l),l}}async function fh(t,e){if(t.closed||!e||!t.api.resume)return null;let i=await t.api.resume(t.key,e);if(t.closed)return null;let n=[...new Set(i.items.map(o=>o.label))];return n.length?(t.setHold({holdId:i.holdId,labels:n,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function mh(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let n=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:n.expiresAt,items:i.items}),t.hold_}catch{return null}}async function gh(t,e,i,n){let o=t.renderer;if(!o)return null;if(!t.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let r=i??t.getSelection().map(c=>c.label);if(!r.length)return null;let s=t.ticketIssue(r);if(s)throw new Ee(s);let a;try{if(t.hold_&&t.holdCovers(r))a=t.hold_.holdId;else{let c=t.hold_?.holdId,d=await t.api.hold(t.key,r.map(u=>{let h=t.labelToSeat.get(u),f=h?t.toSeat(h):null;return{label:u,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),n,c);a=d.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:d.expiresAt,items:d.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:u,reason:h}=St(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let f=new Set(u.map(p=>p.label)),m=t.idsForLabels(f);m.length&&(o.setStatus(m,"booked"),o.deselect(m),t.resetTableQuantitiesForLabels(f));let y=r.filter(p=>!f.has(p));y.length&&a&&t.api.release(t.key,y,a).catch(()=>{}),t.emitSelectionChange()}else a&&t.api.release(t.key,r,a).catch(()=>{});throw c}let l=t.idsForLabels(r);return l.length&&(o.setStatus(l,"booked"),o.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function bh(t){let e=t.hold_;if(!e)return!0;try{let n=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(n,e.labels))return await t.resnapshot(),!1}catch(n){return t.emitError(n),!1}if(t.hold_?.holdId!==e.holdId)return!0;t.clearHold(),t.resetTableQuantitiesForLabels(e.labels);let i=t.idsForLabels(e.labels);return i.length&&(t.renderer?.deselect(i),t.renderer?.setStatus(i,"free")),!0}async function yh(t,e){let i=t.hold_;if(!i)return!0;let n=e.filter(a=>i.labels.includes(a));if(!n.length)return!0;try{let a=await t.api.release(t.key,n,i.holdId);if(!t.releaseConfirmed(a,n))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let o=i.labels.filter(a=>!n.includes(a)),r=i.items?.filter(a=>!n.includes(a.label));o.length?t.setHold({...i,labels:o,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(n);let s=t.idsForLabels(n);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function Sh(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function vh(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let n=new Map((i.items??[]).map(r=>[r.label,r.tierId])),o=new Map((i.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let s=t.labelToSeat.get(r),a=s?t.toSeat(s):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||t.confirmedVariableTables.has(r))&&(!o.has(r)||o.get(r)===a.quantity))&&(!n.has(r)||n.get(r)===l)})}function wh(t,e){let{status:i,conflicts:n}=St(e);if(i!==409||!n?.length)return;let o=t.renderer;if(!o)return;let r=t.idsForLabels(n.map(s=>s.label));r.length&&(o.deselect(r),o.setStatus(r,"held"),t.resetTableQuantitiesForLabels(n.map(s=>s.label))),t.emitSelectionChange()}function kh(t,e,i="created"){for(let r of e.items??[])t.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(t.tableQuantities.set(r.label,r.quantity),t.groupedTablesByLabel.get(r.label)?.mode==="variable"&&t.confirmedVariableTables.add(r.label));let n={...e,seats:t.seatsForLabels(e.labels)};t.hold_=n,t.renderer?.setOwnedHold?.(t.idsForLabels(n.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let o=Math.max(0,n.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},o),i==="restored"?t.opts.onHoldRestored?.(n):t.opts.onHold?.(n)}function xh(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function Lh(t){let e=t.hold_;if(e){try{let i=await t.api.objects(t.key);if(t.hold_?.holdId!==e.holdId)return;t.applySeatsMap(i.seats,i.default??"free")}catch{t.hold_?.holdId===e.holdId&&(t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},2e3));return}if(t.hold_?.holdId===e.holdId){if(sh(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function Ch(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function Th(t,e,i,n){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let o=[],r=0,s=!1,a=!1;for(let c of i??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");r=Math.max(r,Number(c.minimum))}else if(c?.type==="consecutiveSeats")s=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(r&&o.push({type:"minimumSelectedPlaces",minimum:r}),s&&o.push({type:"consecutiveSeats"}),a&&o.push({type:"noOrphanSeats"}),t!=null&&r>t)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??t??Math.max(n,r)));if(t!=null&&l<t)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<r)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:o,maxSelection:t??l}}function Og(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Dg(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(o=>o.objectId!==e||o.categoryKey!==i))return!0;let n=t.map(o=>Og(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function Ih(t,e,i,n,o){let r=n.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,s=i??r,a=[];return i!=null&&e!==i&&a.push("numberOfPlacesToSelect"),r&&e<r&&a.push("minimumSelectedPlaces"),n.some(l=>l.type==="consecutiveSeats")&&Dg(t)&&a.push("consecutiveSeats"),n.some(l=>l.type==="noOrphanSeats")&&o()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function Ph(t){let{id:e,doc:i,seatById:n,groupedTableBySeatId:o}=t,r=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,u=new Set,h=0,f=0;for(let v of l){let x=n.get(v);if(!x)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(x)&&(f+=1);let T=o.get(v);if(T){if(u.has(T.label))continue;u.add(T.label),c.set(T.categoryKey,(c.get(T.categoryKey)??0)+T.maxOccupancy),t.statusOf(T.chairs[0]?.id??v)==="free"&&(h+=T.maxOccupancy,d.set(T.categoryKey,(d.get(T.categoryKey)??0)+T.maxOccupancy))}else c.set(x.categoryKey,(c.get(x.categoryKey)??0)+1),t.statusOf(v)==="free"&&(h++,d.set(x.categoryKey,(d.get(x.categoryKey)??0)+1))}let m=[...c.entries()].map(([v,x])=>{let T=i.categories.find(R=>R.key===v),P=T?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],L=P.length?P:typeof T?.price=="number"&&Number.isFinite(T.price)?[T.price]:[],C=L.length?Math.min(...L):void 0,I=L.length?Math.max(...L):void 0;return{key:v,count:x,label:T?.label??v,color:T?.color??"#6e7bff",...C!==void 0?{price:C,priceMin:C,priceMax:I}:{}}}).sort((v,x)=>(v.priceMin??1/0)-(x.priceMin??1/0)||v.key.localeCompare(x.key)),y=m.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),p=m.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),g=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,b=v=>{let x=null,T=0;for(let[P,L]of v)(L>T||L===T&&x!=null&&P<x)&&(x=P,T=L);return x},S=b(d)??b(c),k=(S?m.find(v=>v.key===S)?.color:void 0)??g?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:f}:{},label:a.displayLabel??a.label,zoneLabel:g?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:k,seatsLeft:h,...y.length?{priceMin:Math.min(...y),priceMax:Math.max(...p)}:{},categories:m}}var nn=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,i=!1){if(!i){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let n=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===n&&(this.inFlight=null)});return this.inFlight=n,n}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function Rh(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function Mh(t,e){return t?.source==="socket"?t:e?{seats:e.seats,default:e.default,source:"http",...e.fetchedAt===void 0?{}:{fetchedAt:e.fetchedAt}}:t}var Wg=!0,Vg=!0,zg="#f43f5e",Kg=10,Xg=15e3,Eh=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new tn;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.inventoryModelVersion=1;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.connectFallback=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new nn;this.narrowLayout=!1;this.fitClearance=0;this.accessFilter=null;this.viewportInsets=null;this.accessStepAt=null;this.bandReturnPose=null;this.bandReturnSection=null;this.hintShown=!1;this.lastSnapshotAt=0;this.seatsBuilt=!1;this.pendingSnapshot=null;this.socketVersion=0;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=Ch(e.numberOfPlacesToSelect);let i=Th(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Kg);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(n=>typeof n=="string"&&!!n))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=br(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let n of Bo){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return dh(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),n=this.getActiveFloorId(),o=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),n?{floorId:n}:void 0),this.applyRowBandPreview(e),o&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(o=>typeof o=="string");if(i.length===this.hidden.size&&i.every(o=>this.hidden.has(o)))return!1;this.hidden=new Set(i);let n=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),n&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(n=>typeof n=="string");return i.length===this.closedSections.size&&i.every(n=>this.closedSections.has(n))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(o=>o.id);let n=this.labelToId.get(e);return n?[n]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let o=this.visibleDoc(),r=Ct(o).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let o=this.groupedTablesByLabel.get(e.label);return{...o?.displayLabel&&o.displayLabel!==o.label?{displayLabel:o.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}let i=this.labelToSeat.get(e.label),n=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),n={},o=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:o(r)}),C=>({ok:!1,error:C,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:o(a)}),()=>({ok:!1,elapsed:o(a)})),c=await s;if(n.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=uh(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let u=performance.now();try{this.inventoryModelVersion=d.event.inventoryModelVersion===2?2:1;let C=Kr(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(C.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(C.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(C.flatMap(I=>I.chairs.map(R=>[R.id,I]))),this.tableQuantities=new Map(C.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=C.reduce((I,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(C){return this.emitError(C),null}this.expandedSeats=He(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=jd(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=h.labelToId,this.labelToSeat=h.labelToSeat,this.seatById=h.seatById,this.seatContext=h.seatContext,this.allIds=h.allIds;for(let C of this.groupedTablesByLabel.values()){let I=C.chairs[0];I&&(this.labelToId.set(C.label,I.id),this.labelToSeat.set(C.label,I))}n.normalizeBuyerModel=o(u);let f=d.event.currency??this.opts.currency;this.currency=f??"USD";let m=performance.now(),y=Vd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:f,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(i),this.opts.onSeatsRevealed?.()},onSelect:C=>{this.handleRendererSelect(C)},onDeselect:C=>{this.handleRendererDeselect(C)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(C,I)=>{this.opts.onHover?.(C),this.opts.onSeatHover&&this.opts.onSeatHover(C?this.describeSeat(C,I):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(C,I)=>this.previewSection(C,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:C=>this.opts.onSectionFocus?.(C==null||this.isSectionClosed(C)?null:this.sectionSummary(C)),onDeckTap:C=>this.handleDeckTap(C),onFps:this.opts.onFps});if(n.createRenderer=o(m),this.closed)return y.destroy(),null;this.renderer=y,this.viewportInsets&&y.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&y.setFitClearance?.(this.fitClearance);let p=null,g="free",b=[],S,w=await l;if(w.ok){let C=w.objects;this.hidden=new Set(C.hidden??[]),b=(C.closed??[]).filter(I=>typeof I=="string"),p=C.seats,g=C.default??"free",S=typeof C.fetchedAt=="number"?C.fetchedAt:void 0}if(n.loadStatuses=w.elapsed,this.closed)return y.destroy(),this.renderer=null,null;let k=performance.now();this.opts.categoryPriceRanges&&y.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),y.setChart(this.visibleDoc()),this.applyRowBandPreview(y),hh(y,d.doc,e.clientWidth),this.opts.colorblindSafe&&y.setColorblindSafe?.(!0),n.buildScene=o(k),this.closedSections=new Set(b);let v=performance.now();b.length&&y.setClosedSections?.(b),this.seatsBuilt=!0;let x=this.pendingSnapshot;this.pendingSnapshot=null;let T=Mh(x,p?{seats:p,default:g,fetchedAt:S}:null);T&&this.applySeatsMap(T.seats,T.default,T.source,T.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(v);let P=performance.now();y.forceDraw(),n.firstPaint=o(P);let L=performance.now();return w.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(L),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Oo(d.event.status),eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:f,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:n}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let n of this.renderer.getSelection()){let o=this.groupedTableBySeatId.get(n.id);o?i.has(o.label)||(i.add(o.label),e.push(this.toTableSeat(o))):e.push(this.toSeat(n))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let n of e){let o=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(o)o.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(o.label)||(this.tableQuantities.set(o.label,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(o.label));else{let r=this.seatById.has(n)?n:this.labelToId.get(n);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),n=new Set,o=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?o.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&n.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?o.push(c.label):n.add(l)}}if(o.length&&this.emitError(new Ee(Cn(o))),!n.size)return[];if(this.renderer?.select?.([...n]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...n]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(s=>!i.has(s.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let i=new Set(e);return this.select([...this.seatById.values()].filter(n=>i.has(n.categoryKey)).map(n=>n.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(n=>i.has(n.categoryKey)).map(n=>n.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(n=>typeof n=="string"&&!!n))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(n=>!this.isSelectableByPolicy(n.id)).map(n=>n.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),n=e??i.reduce((o,r)=>o+(r.quantity??1),0);return Ih(i,n,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(n=>n.id));return i.size>0&&Ln(this.seatById.values(),n=>e.getStatus(n),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let n=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(n){n.chairs.forEach(r=>e.add(r.id));continue}let o=this.seatById.has(i)?i:this.labelToId.get(i);o&&e.add(o)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let n=this.groupedTablesByLabel.get(e);if(!n)return!1;let o=n.mode==="whole"?n.capacity:Math.floor(i);if(!Number.isInteger(o)||o<n.minOccupancy||o>n.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??n.minOccupancy;return this.tableQuantities.set(e,o),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(n.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,n){let o=this.groupedTablesByLabel.get(e),r=this.hold_;if(!o||o.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.maxOccupancy)return null;if((r.items??[]).filter(d=>d.label!==e).reduce((d,u)=>d+(u.quantity??1),0)+s>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?s:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,n,r.holdId);return this.tableQuantities.set(e,s),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}setNarrowLayout(e){this.narrowLayout!==e&&(this.narrowLayout=e,this.renderer&&this.applyRowBandPreview(this.renderer))}rowBandsWanted(){return Wg&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(Vg||!this.narrowLayout)}applyRowBandPreview(e){if(!this.opts.sectionPreview)return;let i=this.rowBandsWanted();e.setRowBandPreview?.(i),i&&e.setSectionFocusDim?.(!1)}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,i)=>e+(i.quantity??1),0)}handleRendererSelect(e){let i=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(i?i.chairs.map(o=>o.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(o=>o.id):[e.id]),this.emitError(new Ee(Cn([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(o=>o.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(o=>o.id)),this.opts.onSelect?.(i.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(i)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let i=this.groupedTableBySeatId.get(e.id),n=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(n)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(n)){this.opts.onDeselect?.(i?{...e,label:n}:e);return}i?(this.renderer?.deselect(i.chairs.map(o=>o.id)),this.hold_?.labels.includes(i.label)||(this.tableQuantities.set(i.label,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(i.label)),this.opts.onDeselect?.(i.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let i of e){let n=this.groupedTablesByLabel.get(i);n&&(this.tableQuantities.set(i,n.mode==="whole"?n.capacity:n.minOccupancy),n.mode==="variable"&&this.confirmedVariableTables.delete(i))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}hold(e,i){return ph(this,e,i)}resumeHold(e){return fh(this,e)}extendHold(e){return mh(this,e)}categoryAvailability(){return nh({seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,groupedTablesByLabel:this.groupedTablesByLabel,closedMembers:this.closedMemberIds(),statusOf:e=>this.getStatus(e),gaAreas:this.getGAAreas()})}closedMemberIds(){let e=new Set,i=this.renderer;if(!i||!this.closedSections.size)return e;for(let n of this.closedSections)for(let o of i.sectionMembers?.(n)??[])e.add(o);return e}getGAAreas(){let e=this.visibleDoc();return e?eh(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(ih(this.getGAAreas(),this.gaSelected,{wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0}))}async holdGA(e,i,n={}){let o=this.visibleDoc();if(!o||!Number.isFinite(i)||i<1)return null;let r=Ct(o).find(d=>d.id===e);if(!r)return null;let s=th(r,i,{modelVersion:this.inventoryModelVersion,statusOf:d=>this.statusOf(d),alreadyHeld:new Set(this.hold_?.labels??[]),wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0});if(!s)return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of s)a.set(d.label,{...d,...n.tierId?{tierId:n.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,n.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return lh(this.visibleDoc())}pickPremiumBlock(e,i,n){return ch({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:n,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:o=>this.seatTierResolution(o).kind!=="invalid",statusOfLabel:o=>this.getStatus(this.labelToId.get(o)??"")??"free",isPremium:o=>!!this.labelToSeat.get(o)?.commercial?.premium})}async bestAvailable(e,i,n={}){let o=this.renderer;if(!o)return null;if(n.preferPremium){let r=this.pickPremiumBlock(e,i,n.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let s=r.map(d=>{let u=this.labelToSeat.get(d),h=u?this.toSeat(u):null;return{label:d,...h?.tierId?{tierId:h.tierId}:{}}}),a=await this.api.hold(this.key,s,n.ttlMs);o.clearSelection();let l=this.idsForLabels(r);l.length&&o.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...r],expiresAt:a.expiresAt,items:a.items});let c=r.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(s){let{status:a,reason:l}=St(s);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),s}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,i,n.zoneId,n.ttlMs);o.clearSelection();let s=this.idsForLabels(r.labels);s.length&&o.setStatus(s,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let a=r.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(r){let{status:s,reason:a}=St(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return gh(this,e,i,n)}release(){return bh(this)}releaseLabels(e){return yh(this,e)}releaseConfirmed(e,i){return Sh(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(o=>o.notForSale).map(o=>o.key));if(!i.size)return[];let n=[];for(let[o,r]of this.seatById)i.has(r.categoryKey)&&n.push(o);return n}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return ui(this._doc?.theme?.seatScale)*J*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){Xd(this.pickerFocusContext,e),this.pushGAState()}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}get pickerFocusContext(){let e=this;return{renderer:e.renderer,doc:e._doc,get accessFilter(){return e.accessFilter},set accessFilter(i){e.accessFilter=i},get accessStepAt(){return e.accessStepAt},set accessStepAt(i){e.accessStepAt=i},get bandReturnPose(){return e.bandReturnPose},set bandReturnPose(i){e.bandReturnPose=i},get bandReturnSection(){return e.bandReturnSection},set bandReturnSection(i){e.bandReturnSection=i},getActiveFloorId:()=>e.getActiveFloorId(),setFloor:i=>e.setFloor(i),sectionSummary:i=>e.sectionSummary(i),emitSectionFocus:i=>{e.opts.onSectionFocus?.(i)}}}focusAccessibilityFilter(e){return _o(this.pickerFocusContext,e)}accessibilitySpread(e){return Yd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return $d(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Zd(this.pickerFocusContext,e)}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let i=this.renderer;!i?.setActiveFloor||e===i.getActiveFloorId?.()&&!i.isFloorOverview?.()||(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let i=this.renderer;!i?.setStacked||e===i.isStacked?.()||(i.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let i=this.renderer;!i?.setFloorOverview||e===i.isFloorOverview?.()||(i.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let i=this.renderer;i&&(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor?.(e),this.resnapshot(),this.emitSelectionChange(),this.opts.onDeckTap?.(e))}setViewMode(e){this.renderer?.setViewMode?.(e)}getViewMode(){return this.renderer?.getViewMode?.()??"flat"}getRung(){return this.renderer?.getRung?.()??"seats"}getFocusedSection(){return this.renderer?.getFocusedSection?.()??null}seatsRevealed(){let e=this.renderer;return e?.seatsRevealed?e.seatsRevealed():this.getRung()==="seats"||!!this.getFocusedSection()}atVenueFit(){return this.renderer?.atVenueFit?.()}canZoomIn(){return this.renderer?.canZoomIn?.()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){Qd(this.pickerFocusContext,e)}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,i){this.handleSectionTap(e,i)}focusSeats(e,i){let n=this.renderer;if(!n?.focusSeats?.(e,i))return!1;let o=n.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(o?this.sectionSummary(o):null),!0}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}previewSection(e,i){this.handleSectionTap(e,i)}handleSectionTap(e,i){if(!this.renderer)return;let n=this.isSectionClosed(e)?null:this.sectionSummary(e);Ud(this.pickerFocusContext,e,n,i),this.opts.onSectionFocus?.(n)}sectionSummary(e){return!this.renderer||!this._doc?null:Ph({id:e,doc:this._doc,sectionMembers:i=>this.renderer?.sectionMembers?.(i)??[],statusOf:i=>this.renderer?.getStatus(i)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:i=>Ie(i,this.accessFilter)}:{}})}clearConnectFallback(){this.connectFallback&&(clearTimeout(this.connectFallback),this.connectFallback=null)}destroy(){if(this.closed=!0,this.seatsBuilt=!1,this.pendingSnapshot=null,this.clearConnectFallback(),this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let i=this.groupedTableBySeatId.get(e.id);if(i)return this.toTableSeat(i);let n=e.commercial?{commercial:e.commercial}:void 0,o=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,s=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...n,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...n,...r,...s}}toTableSeat(e){let i=e.chairs[0],n=this.tiersFor(e.categoryKey)?.filter(s=>mi(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),o=this.tableTierResolution(e),r=o.kind==="resolved"?o.tier:void 0;return{id:i?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:i?this.seatContext.get(i.id)?.sectionLabel:void 0,...i&&this.seatContext.get(i.id)?.entrance?{entrance:this.seatContext.get(i.id).entrance}:{},rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...n?{tiers:n,tierId:r?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(s=>s.id)}}describeSeat(e,i){let n=this._doc?.categories.find(o=>o.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:n?.label??e.categoryKey,categoryColor:n?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...i?.interaction?{interaction:i.interaction}:{},...i?.unavailable?{unavailable:!0}:{},...i?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(i=>i.key===e)?.price??0}tiersFor(e){let i=this._doc?.categories.find(n=>n.key===e)?.tiers;return i&&i.length?i:void 0}tiersForSeat(e){if(!this._doc)return;let i=Wr(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?mi(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(i=>i.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let i=e.chairs[0]?.id??"";return mi(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let n=this.seatById.get(e);if(!n)return;let o=this.tiersForSeat(n);if(o){if(i==null)this.seatTiers.delete(e);else if(o.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let n of e){let o=this.labelToSeat.get(n);o&&i.push(this.toSeat(o))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return Vr(this._doc,i.map(n=>({label:n.label,...n.tierId?{tierId:n.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?B("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let n=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),o=new Set(e.getSelection().map(s=>s.id));(n&&o.size?Ln(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(B("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return vh(this,e)}handle409Conflicts(e){wh(this,e)}setHold(e,i="created"){kh(this,e,i)}clearHold(){xh(this)}expireActiveHold(){return Lh(this)}applySeatsMap(e,i="free",n="http",o){n==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Rh(this.pendingSnapshot,{seats:e,default:i,source:n,...o===void 0?{}:{fetchedAt:o}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=o??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=en(i);this.allIds.length&&r.setStatus(this.allIds,a),r.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let l={free:[],held:[],booked:[],not_for_sale:[]};for(let[d,u]of Object.entries(e))l[en(u)].push(...this.idsForLabel(d));["free","held","booked","not_for_sale"].forEach(d=>{d!==a&&l[d].length&&r.setStatus(l[d],d)});let c=this.notForSaleCategorySeatIds();c.length&&r.setStatus(c,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:s})}snapshotIsFresh(e=5e3){return this.lastSnapshotAt>0&&Date.now()-this.lastSnapshotAt<e}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(i=>this.statusOf(i)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let i=this.socketVersion,n=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(n.seats,n.default??"free","http",n.fetchedAt)},e)}resync(e){return e?.reason==="connect"&&this.snapshotIsFresh()?Promise.resolve():this.resnapshot()}applyProjection(e){this.applySeatsMap(e.exceptions,e.default,"socket")}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,i=rh({selection:this.getSelection().map(n=>n.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:n=>this.statusOf(n)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let n=this.idsForLabels(i.lapsedLabels);n.length&&this.renderer?.deselect(n),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return oh(this.seatById.values(),e=>this.getStatus(e)??"free",this.getGAAreas().filter(e=>e.wheelchairPlaces).map(e=>({need:"wheelchair",free:e.wheelchairAvailable??0})))}attachVisibility(){this.detachVisibility||(this.detachVisibility=ah(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applyProjection(e),resync:e=>this.resync(e),onSections:(e,i)=>{let n=this.syncHidden(e),o=this.syncClosed(i);n&&this.resnapshot(),(n||o)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let n=Object.entries(e);if(n.length!==this.liveStatuses.size)return!0;for(let[o,r]of n)if(this.liveStatuses.get(o)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let n=e.some(s=>this.liveStatuses.get(s.label)!==s.status),o=new Map;for(let s of e){this.liveStatuses.set(s.label,s.status);let a=this.idsForLabel(s.label);if(!a.length)continue;let l=en(s.status);this.opts.flashOnLiveChange&&l!=="free"&&a.some(c=>(o.get(c)??i.getStatus(c))==="free")&&!this.hold_?.labels.includes(s.label)&&a.forEach(c=>i.flashSeat(c,zg));for(let c of a)o.set(c,l)}let r=new Map;for(let[s,a]of o){let l=r.get(a);l||r.set(a,l=[]),l.push(s)}for(let[s,a]of r)i.setStatus(a,s);this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&i.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:n})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let n=null;try{n=this.api.createRealtime(this.key,this.realtimeSink())}catch{n=null}if(n){this.realtime=n,n.start();return}}if(this.realtime)return;let i;try{let n=this.api.socketProtocols?.(this.key);i=n&&n.length?new WebSocket(e,n):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=i,i.onopen=()=>{if(this.attempt=0,!this.snapshotIsFresh()){this.resnapshot();return}this.clearConnectFallback(),this.connectFallback=setTimeout(()=>{this.connectFallback=null,this.resnapshot()},2500)},i.onmessage=n=>{this.clearConnectFallback();let o;try{o=JSON.parse(typeof n.data=="string"?n.data:"")}catch{return}if(!this.renderer||!o||typeof o!="object")return;let s=o;Array.isArray(s.hidden)&&this.syncHidden(s.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(s.closed)&&this.syncClosed(s.closed)&&this.opts.onStatusChange?.({changed:!0}),s.type!=="hidden"&&(s.seats&&typeof s.seats=="object"?this.applySeatsMap(s.seats):Array.isArray(s.changes)&&this.applyStatusChanges(s.changes))},i.onclose=()=>{this.ws===i&&(this.ws=null),this.scheduleReconnect()},i.onerror=()=>{try{i.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),i=Jd(e,{baseMs:1e3,maxMs:Xg,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var Yg=5,Ug=-1.1,Do=35;function No(t,e){let i=t-Ae,n=Math.atan2(Yg-i,e)*180/Math.PI,o=Math.atan2(Ug-i,e)*180/Math.PI;return o<-Do&&(n+=-Do-o,o=-Do),{topPitch:n,basePitch:o}}var ne=2048,ke=1024,jt=jo,D=Math.PI*2,$g=ke/180,wt=t=>(t+180)/360*ne,Z=t=>(90-t)/180*ke;function Oh(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return e>>>0}function Dh(t){let e=t>>>0;return()=>{e|=0,e=e+1831565813|0;let i=Math.imul(e^e>>>15,1|e);return i=i+Math.imul(i^i>>>7,61|i)^i,((i^i>>>14)>>>0)/4294967296}}var on=96,Wo=360/on,qg=.6,Ho=[17,23,42];function Go(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(Ho[0]-t[0])*n),r=Math.round(t[1]+(Ho[1]-t[1])*n),s=Math.round(t[2]+(Ho[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function Ah(t,e,i){return[Math.round(t[0]+(e[0]-t[0])*i),Math.round(t[1]+(e[1]-t[1])*i),Math.round(t[2]+(e[2]-t[2])*i)]}function ce(t,e,i){let n=(1-Math.abs(2*i-1))*e,o=(t%360+360)%360/60,r=n*(1-Math.abs(o%2-1)),s=0,a=0,l=0;o<1?[s,a,l]=[n,r,0]:o<2?[s,a,l]=[r,n,0]:o<3?[s,a,l]=[0,n,r]:o<4?[s,a,l]=[0,r,n]:o<5?[s,a,l]=[r,0,n]:[s,a,l]=[n,0,r];let c=i-n/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var Fh=new Map;function _h(t){if(!t)return null;let e=Fh.get(t);if(e)return e;let i=2166136261;for(let r=0;r<t.length;r++)i^=t.charCodeAt(r),i=Math.imul(i,16777619);let n=(i>>>0)%360,o=ce(n,.3,.42);return Fh.set(t,o),o}function Zg(t,e,i,n){let o=new Array(on).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,u=Math.hypot(c,d)*jt;if(u<1.5||u>95)continue;let h=a.eyeHeightM??Ae,f=h-n;Math.abs(f)>r&&(r=Math.abs(f));let m=Math.atan2(f,u)*180/Math.PI,y=Math.atan2(h-Ae-n,u)*180/Math.PI,g=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,b=Math.min(on-1,Math.max(0,Math.floor((g+180)/Wo))),S=m>34&&u<16,w=o[b];w?(m>w.top&&(w.top=m),y<w.base&&(w.base=y),u<w.nearM&&(w.nearM=u,w.tint=_h(a.categoryKey)),w.overhead=w.overhead||S):o[b]={top:m,base:y,nearM:u,overhead:S,tint:_h(a.categoryKey)}}return{bins:o,maxDelta:r}}function Qg(t,e,i,n){for(let o=0;o<on;o++){let r=e[o];if(!r)continue;let s=-180+o*Wo,a=i(s),l=i(s+Wo);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),u=n(c),h=n(d);if(h<=u)continue;let f=r.nearM/95,m=r.tint,y=m?Ah([44,54,80],m,.34):[44,54,80],p=m?Ah([24,30,48],m,.28):[24,30,48],g=t.createLinearGradient(0,u,0,h);g.addColorStop(0,Go(y,f)),g.addColorStop(.24,Go(p,f)),g.addColorStop(1,Go([10,13,22],f)),t.fillStyle=g,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-f*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,n(0))-u;if(S>8){let k=1-f*.4;for(let v=1;v<6;v++){let x=u+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*k})`,t.fillRect(a,x,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*k})`,t.fillRect(a,x+1.5,l-a+1,1.2)}}if(r.overhead){let w=n(Math.min(86,c+12)),k=t.createLinearGradient(0,w,0,u);k.addColorStop(0,"rgba(3,4,8,0.9)"),k.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=k,t.fillRect(a,w,l-a+1,u-w),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function jg(t,e,i){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let g of i){a++,g.sectionId&&s.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,w=Math.hypot(b,S)*jt;if(w<.5)continue;let k=Math.atan2(b,-S),v=Math.floor((k+Math.PI)/D*72);v<0?v=0:v>=72&&(v=71),o[v]=!0,w<r[v]&&(r[v]=w)}let l=0,c=[];for(let g=0;g<72;g++)o[g]&&(l++,c.push(r[g]));let d=l/72*360;c.sort((g,b)=>g-b);let u=c.length?c[c.length>>1]:0,h=c.length?c[Math.floor(c.length*.15)]??u:0,f=c.length?c[Math.floor(c.length*.85)]??u:0,m=h>.5?f/h:1,y=Oh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&u>11&&m>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:y,voidRadiusM:u,aspect:m}}var Jg=5;function eb(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,D),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,D),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,D),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,D),t.fill();break;default:break}}function tb(t,e,i,n,o){let r=n*.44,s=n*o.shoulderK,a=n*.66,l=n*1.68,c=n*5.4,d=`rgba(${o.clothing[0]},${o.clothing[1]},${o.clothing[2]},${o.alpha})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;t.save(),t.translate(e,i);let h=o.lean*n;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-h-n*.6,-s,l-h),t.quadraticCurveTo(-s*1.05,l+n*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+n*1.2,s,l+h),t.quadraticCurveTo(r*1.18,l+h-n*.6,r,a),t.closePath(),t.fill(),t.fillStyle=u,t.fillRect(-r*.82,n*.5,r*1.64,n*.9),t.save(),t.rotate(o.tilt),t.translate(o.turn*n,0),t.fillStyle=u,n>=18?(t.beginPath(),t.moveTo(-n*.9,-n*.15),t.quadraticCurveTo(-n*.96,-n*1.12,0,-n*1.06),t.quadraticCurveTo(n*.96,-n*1.12,n*.9,-n*.15),t.quadraticCurveTo(n*.86,n*.55,n*.36,n*.98),t.quadraticCurveTo(0,n*1.14,-n*.36,n*.98),t.quadraticCurveTo(-n*.86,n*.55,-n*.9,-n*.15),t.closePath(),t.fill(),n>=22&&(t.beginPath(),t.ellipse(-n*.9,n*.18,n*.13,n*.22,0,0,D),t.ellipse(n*.9,n*.18,n*.13,n*.22,0,0,D),t.fill())):(t.beginPath(),t.ellipse(0,0,n*.9,n*1.06,0,0,D),t.fill()),eb(t,n,o.hair),o.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.14),t.beginPath(),t.ellipse(0,-n*.06,n*.86,n*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),o.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.12),t.beginPath(),t.moveTo(-s*.8,l-n*.05),t.quadraticCurveTo(-r,l-n*.75,0,l-n*.82),t.quadraticCurveTo(r,l-n*.75,s*.8,l-n*.05),t.stroke()),t.restore()}function ib(t,e,i,n,o,r,s){t.fillStyle=`rgba(${o[0]},${o[1]},${o[2]},${s})`,t.beginPath(),t.moveTo(e-n*1.72,i+n*4),t.quadraticCurveTo(e-n*1.78,i+n*1.55,e-n*.46,i+n*1.02),t.lineTo(e-n*.4,i+n*.62),t.lineTo(e+n*.4,i+n*.62),t.lineTo(e+n*.46,i+n*1.02),t.quadraticCurveTo(e+n*1.78,i+n*1.55,e+n*1.72,i+n*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,n*.9,n*1.05,0,0,D),t.fill()}function zo(t,e,i,n,o){let r=n*.1,s=i-n*.9,a=i-n*.74,l=i-n*.46,c=n*.13,d=n*.09,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,h=t.createRadialGradient(e,i,1,e,i,n*.24);h.addColorStop(0,"rgba(0,0,0,0.4)"),h.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=h,t.beginPath(),t.ellipse(e,i/.28,n*.24,n*.24,0,0,D),t.fill(),t.restore(),t.fillStyle=u,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+n*.02),t.lineTo(e+d*.1,l+n*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-n*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-n*.12,e+c,a),t.quadraticCurveTo(e,a-n*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=n*.055;let f=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,f),t.lineTo(e-d*.4,l-n*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-n*.04,n*.07,n*.09,-.5,0,D),t.fill()):o.pose===3?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=n*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-n*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,f),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,f),t.lineTo(e+c*.95,l+n*.02),t.stroke()),t.fillStyle=u,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,D),t.fill(),o.rimStrength>.01&&(t.strokeStyle=`rgba(${o.rim[0]},${o.rim[1]},${o.rim[2]},${(.6*o.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,n*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function rn(t,e,i,n,o,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,o);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-r,i),t.lineTo(n-s,o),t.lineTo(n+s,o),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function Ko(t,e,i,n,o){let r=t.createRadialGradient(e,i,0,e,i,n*3);r.addColorStop(0,`rgba(${o},0.9)`),r.addColorStop(.4,`rgba(${o},0.35)`),r.addColorStop(1,`rgba(${o},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,n*3,0,D),t.fill(),t.fillStyle=`rgba(${o},1)`,t.beginPath(),t.arc(e,i,n,0,D),t.fill()}function pI(t,e,i){let n=document.createElement("canvas");n.width=ne,n.height=ke;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.hypot(r,s),l=Math.max(2,a*jt),c=t.eyeHeightM??Ae,d=jg(t,e,i),u=Dh(d.seed),h=210+u()*150,f=ce(220+(u()-.5)*60,.55,.82),m=`${f[0]},${f[1]},${f[2]}`,y=o.createLinearGradient(0,0,0,ke);y.addColorStop(0,"#080b12"),y.addColorStop(.42,"#12182c"),y.addColorStop(.5,"#1c2440"),y.addColorStop(.56,"#151b2c"),y.addColorStop(.78,"#171e30"),y.addColorStop(1,"#131829"),o.fillStyle=y,o.fillRect(0,0,ne,ke);let p=o.createLinearGradient(0,Z(-6),0,ke);p.addColorStop(0,"rgba(30, 37, 56, 0)"),p.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),p.addColorStop(1,"rgba(22, 28, 44, 0.12)"),o.fillStyle=p,o.fillRect(0,Z(-6),ne,ke-Z(-6));let g=Math.atan2(r,-s),b=Zg(t,i,g,c),S=b.maxDelta>=qg;S&&Qg(o,b.bins,wt,Z);let w=Math.max(.3,Math.min(1,1-(l-6)/60)),k=No(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),x=Math.min(45,k.topPitch),T=k.basePitch;d.mode==="sport"?rb(o,l,c,d,w,h,m,u):d.mode==="arena"?ob(o,l,c,d,w,m,u):nb(o,v,x,T,w,h,m,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${m},0.8)`;for(let C=0;C<P;C++){let I=(C+.5)/P*ne,R=Z(d.mode==="sport"?58:54+C*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,D),o.fill()}sb(o,t,i,e,g,c,r,s,S,d);let L=o.createLinearGradient(0,0,0,ke);return L.addColorStop(0,"rgba(0,0,0,0.85)"),L.addColorStop(.12,"rgba(0,0,0,0)"),L.addColorStop(.9,"rgba(0,0,0,0)"),L.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=L,o.fillRect(0,0,ne,ke),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function nb(t,e,i,n,o,r,s,a){let l=wt(-e),c=wt(e),d=Z(i),u=Z(n),h=c-l,f=u-d,m=Z(Math.min(50,i+10)),y=h*(1.1+(1-o)*.5),p=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,y);p.addColorStop(0,"rgba(255, 214, 150, 0.34)"),p.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),p.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),p.addColorStop(1,"rgba(99, 102, 241, 0)"),t.fillStyle=p,t.fillRect(l-h*.6,d-f*1.2,h*2.2,f*3.4);let g=ce(r,.62,.55),b=ce(r+40,.7,.5),S=ce(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,h,f),t.clip();let w=t.createLinearGradient(0,d,0,u);w.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),w.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),w.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=w,t.fillRect(l,d,h,f),t.globalAlpha=1;let k=t.createRadialGradient(ne/2,(d+u)/2,h*.12,ne/2,(d+u)/2,h*.62);k.addColorStop(0,"rgba(6,8,14,0)"),k.addColorStop(.7,"rgba(6,8,14,0.15)"),k.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=k,t.fillRect(l,d,h,f),t.restore();let v=3+Math.floor(a()*3),x=f*.46,T=u-f*.08;for(let A=0;A<v;A++){let _=(A+1)/(v+1),F=l+h*(.22+_*.56+(a()-.5)*.06);zo(t,F,T,x*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ce(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-h*.5,m,h*.5,u-m),t.fillRect(c,m,h*.5,u-m);let P=h*.055+3,L=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,u),t.lineTo(l-L,m),t.lineTo(l+h*.012,m),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+P,u),t.lineTo(c+L,m),t.lineTo(c-h*.012,m),t.closePath(),t.fill(),t.fillRect(l-L,m,h+L*2,(u-m)*.12);let C=f*.14,I=m+(u-m)*.12;t.fillStyle="rgba(4,6,12,0.96)";let R=7;t.beginPath(),t.moveTo(l-L,I);for(let A=0;A<=R;A++){let _=l-L+(h+L*2)*A/R;t.quadraticCurveTo(_-(h+L*2)/R/2,I+C,_,I)}t.lineTo(c+L,I),t.lineTo(c+L,m),t.lineTo(l-L,m),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,I,1.5,u-I),t.fillRect(c,I,1.5,u-I),t.fillStyle="#0b0f18",t.fillRect(l-P,u-f*.05,h+P*2,f*.05+3);let M=t.createLinearGradient(0,u-f*.05,0,u+f*.12);M.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),M.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=M,t.fillRect(l-P,u-f*.05,h+P*2,f*.2);let E=3+Math.floor(a()*2);for(let A=0;A<E;A++){let _=(A+1)/(E+1),F=l+h*(_+(a()-.5)*.08),N=Z(Math.min(62,i+26)),oe=(a()-.5)*h*.16;rn(t,F,N,F+oe,u,4,h*.09,s,.16*(.7+o*.5)),Ko(t,F,N,2.4,s)}}function ob(t,e,i,n,o,r,s){let a=Math.min(e*.6,Math.max(3,n.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=ne/2,d=1.2,u=Math.max(e*.45,e-a),h=e+a,f=Math.atan2(d-i,u)*180/Math.PI,m=Math.atan2(d-i,h)*180/Math.PI,y=Math.atan2(-i,u)*180/Math.PI,p=Z(f),g=Z(m),b=Z(y),S=wt(l)-c,w=Math.max(6,(p-g)/2),k=(p+g)/2,v=t.createRadialGradient(c,b,4,c,b,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,g-w,S*5.2,b-g+w+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,k),t.ellipse(c,k,S,w,0,Math.PI,0,!1),t.lineTo(c+S,b),t.ellipse(c,b,S,w,0,0,Math.PI,!1),t.closePath(),t.fill();let x=t.createLinearGradient(0,k,0,b);x.addColorStop(0,`rgba(${r},0.14)`),x.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=x,t.fillRect(c-S,k,S*2,b-k);let T=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],P=T[Math.floor(s()*T.length)],L=s()<.5?-1:1,C=X=>c+X.u*L*S*.84,I=X=>k+X.v*w*.8,R=P.find(X=>X.lead)??P[0],M=C(R),E=t.createLinearGradient(0,k-w,0,k+w);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),t.fillStyle=E,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.fill();let A=t.createRadialGradient(M,k,2,M,k,S);A.addColorStop(0,`rgba(255,214,160,${(.5*o).toFixed(3)})`),A.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=A,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.stroke();let _=Math.max(24,(b-g)*1.3),F=P.length>=3?3:2;for(let X=0;X<F;X++){let xe=(-.62+X*.52+(s()-.5)*.12)*-L,Ne=c+xe*S*.7,kt=k-w*(.45+s()*.18),et=S*(.07+s()*.04),hn=_*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Ne-et/2,kt-hn,et,hn),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Ne-et/2,kt-hn,et,1.5)}if(P.length>=3){let X=c-R.u*L*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(X,k-w*.34,S*.08,w*.1,0,0,D),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let X of[...P].sort((xe,Ne)=>xe.v-Ne.v)){let xe=.82+(X.v+1)*.14;zo(t,C(X),I(X),_*xe*(X.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:X.pose,rim:ce(40,.72,.8),rimStrength:X.lead?1.4:.9})}let N=Z(Math.min(60,m+34)),oe=w*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,N,S*1.15,oe,0,0,D),t.stroke();let W=4+Math.floor(s()*3);for(let X=0;X<W;X++){let xe=X/W*D,Ne=c+Math.cos(xe)*S*1.15,kt=N+Math.sin(xe)*oe;if(Math.sin(xe)>-.2){let et=c+(s()-.5)*S*.8;rn(t,Ne,kt,et,k,3,S*.32,r,.2*(.7+o*.4))}Ko(t,Ne,kt,3,r)}let O=Z(Math.min(52,m+24)),z=Math.max(60,S*.4),re=Math.max(24,z*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-z*.3,O-re/2),t.lineTo(c-z*.16,O-re*2.2),t.moveTo(c+z*.3,O-re/2),t.lineTo(c+z*.16,O-re*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-z/2,O-re/2,z,re);let an=t.createLinearGradient(0,O-re*.3,0,O+re*.42);an.addColorStop(0,`rgba(${r},0.5)`),an.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=an,t.fillRect(c-z*.42,O-re*.3,z*.84,re*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-z/2,O+re/2-2,z,2);let ln=t.createRadialGradient(c,O,4,c,O,z*1.1);ln.addColorStop(0,`rgba(${r},0.2)`),ln.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=ln,t.fillRect(c-z*1.1,O-z*.8,z*2.2,z*1.6);let cn=t.createRadialGradient(c,(N+k)/2,6,c,(N+k)/2,S*1.5);cn.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),cn.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=cn,t.fillRect(c-S*1.5,N-40,S*3,k-N+80),t.restore();let Hh=c+Math.sign(M-c||1)*S*.5;rn(t,Hh,N-oe*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let dn=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);dn.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),dn.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=dn,t.beginPath(),t.ellipse(M,I(R),S*.2,w*.24,0,0,D),t.fill(),t.restore()}function rb(t,e,i,n,o,r,s,a){let l=ne/2,c=Math.max(10,n.voidRadiusM),d=Math.max(2,e-c),u=e+c,h=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),f=Math.atan2(-i,d)*180/Math.PI,m=Math.atan2(-i,u)*180/Math.PI,y=Z(f),p=Z(m),g=wt(h)-l,b=(y+p)/2,S=Math.max(10,(y-p)/2),w=t.createRadialGradient(l,b,4,l,b,g);w.addColorStop(0,"#e8f0fb"),w.addColorStop(.7,"#b9c9e2"),w.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,b,g,S,0,0,D),t.clip(),t.fillStyle=w,t.fillRect(l-g,b-S,g*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,b-S),t.lineTo(l,b+S),t.moveTo(l-g*.5,b-S),t.lineTo(l-g*.5,b+S),t.moveTo(l+g*.5,b-S),t.lineTo(l+g*.5,b+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,b,S*.9,S*.5,0,0,D),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,b,g,S,0,0,D),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let C=0;C<5;C++){let I=l+(a()-.5)*g*1.4,R=b+(a()-.5)*S*1.1,M=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,R,M*.6,M,0,0,D),t.fill()}let k=t.createRadialGradient(l,b,4,l,b,g*1.4);k.addColorStop(0,"rgba(200,220,255,0.12)"),k.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(l-g*1.4,p-S,g*2.8,y-p+S*2),t.restore();let v=Z(Math.min(66,m+60)),x=Math.max(80,g*.7),T=x*.5,P=t.createRadialGradient(l,v,4,l,v,x*1.6);P.addColorStop(0,`rgba(${s},0.3)`),P.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=P,t.fillRect(l-x*1.6,v-x*1.2,x*3.2,x*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-x/2,v-T/2),t.lineTo(l+x/2,v-T/2),t.lineTo(l+x*.6,v),t.lineTo(l+x/2,v+T/2),t.lineTo(l-x/2,v+T/2),t.lineTo(l-x*.6,v),t.closePath(),t.fill();let L=r;for(let C=0;C<3;C++){let I=ce(L+C*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=x*.26;t.fillRect(l-x*.42+C*(R+x*.06),v-T*.32,R,T*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let C=0;C<8;C++){let I=l-x*.6+x*1.2*C/7;t.beginPath(),t.arc(I,v+T*.62,2.4,0,D),t.fill()}}function sb(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let y of i){if(y.id===e.id)continue;let p=y.x-e.x,g=y.y-e.y,b=Math.hypot(p,g)*jt;if(d&&y.sectionId===d&&b<3&&p*s+g*a>0&&(u=!0),b<.3||b>32)continue;let w=((Math.atan2(p,-g)-o)*180/Math.PI+540)%360-180,k=l?(y.eyeHeightM??Ae)-r:0,v=Math.atan2(k-.28,b)*180/Math.PI;if(v>10&&b>5)continue;let x=0;for(let L=0;L<y.id.length;L++)x=x*31+y.id.charCodeAt(L)&65535;let T=.9+(x&15)/40,P=Math.min(78,Math.atan2(.16,b)*180/Math.PI*$g*T);P<1.2||h.push({hx:wt(w),hy:Z(v),r:P,d:b,hash:x})}h.sort((y,p)=>p.d-y.d);let f=[];{let y=[...h].sort((b,S)=>b.hy-S.hy),p=[],g=()=>{if(!p.length)return;let b=p.reduce((k,v)=>k+v.d,0)/p.length,S=p.reduce((k,v)=>k+v.hy,0)/p.length,w=p.reduce((k,v)=>k+v.r,0)/p.length;f.push({figs:p.sort((k,v)=>v.d-k.d),d:b,hy:S,r:w}),p=[]};for(let b of y){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),p.push(b)}g()}f.sort((y,p)=>p.d-y.d);let m=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let y of f){if(y.figs.length>=3&&y.r>=1.6&&y.r<26){let p=[],g=[...y.figs].sort((w,k)=>w.hx-k.hx),b=[];for(let w of g){let k=b[b.length-1];k&&w.hx-k.hx>Math.max(14,w.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(w)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-y.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let w of p){let k=w[0].hx-y.r*1.6,v=w[w.length-1].hx+y.r*1.6;t.beginPath(),t.roundRect(k,y.hy+y.r*.8,v-k,y.r*2.4,y.r*.8),t.fill()}}}for(let p of y.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),b=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+b,17+(p.hash>>4&6)+b,25+(p.hash>>4&6)+b],w=m[p.hash%m.length],k=[w[0]+b,w[1]+b,w[2]+b];if(p.r>=13){let v=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;tb(t,p.hx,p.hy,p.r,{tone:S,clothing:k,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%Jg,rim:v,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?ib(t,p.hx,p.hy,p.r,k,S,g):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,D),t.fill(),t.beginPath(),t.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),t.fill())}}if(u){let y=Z(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,y,ne,ke-y),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let b=(g+.5)/p*ne;t.beginPath(),t.ellipse(b,y+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var he=480,vt=270,Vo=50,Je=30,Bh=t=>(t+Vo)/(2*Vo)*he,Qt=t=>(Je-t)/(2*Je)*vt;function fI(t,e,i){let n=document.createElement("canvas");n.width=he,n.height=vt;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*jt),l=Dh(Oh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=ce(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=o.createLinearGradient(0,0,0,vt);h.addColorStop(0,"#080b12"),h.addColorStop(.44,"#151c32"),h.addColorStop(.5,"#1d2644"),h.addColorStop(.58,"#161c2e"),h.addColorStop(1,"#131829"),o.fillStyle=h,o.fillRect(0,0,he,vt);let f=t.eyeHeightM??Ae,m=No(f,a),y=Math.min(Vo-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(Je-2,m.topPitch),g=Math.max(-Je+2,m.basePitch),b=Bh(-y),S=Bh(y),w=Qt(p),k=Qt(g),v=S-b,x=k-w,T=Math.max(.35,Math.min(1,1-(a-6)/60)),P=Qt(Math.min(Je-1,p+8)),L=o.createRadialGradient(he/2,(w+k)/2,4,he/2,(w+k)/2,v*1.15);L.addColorStop(0,"rgba(255,214,150,0.34)"),L.addColorStop(.28,"rgba(150,150,230,0.3)"),L.addColorStop(.6,"rgba(99,102,241,0.12)"),L.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=L,o.fillRect(b-v*.6,w-x*1.2,v*2.2,x*3.4);let C=ce(c,.62,.55),I=ce(c+40,.7,.5),R=ce(c+70,.78,.52);o.save(),o.beginPath(),o.rect(b,w,v,x),o.clip();let M=o.createLinearGradient(0,w,0,k);M.addColorStop(0,`rgb(${C[0]},${C[1]},${C[2]})`),M.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),M.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),o.globalAlpha=.8,o.fillStyle=M,o.fillRect(b,w,v,x),o.globalAlpha=1;let E=o.createRadialGradient(he/2,(w+k)/2,v*.12,he/2,(w+k)/2,v*.6);E.addColorStop(0,"rgba(6,8,14,0)"),E.addColorStop(.7,"rgba(6,8,14,0.15)"),E.addColorStop(1,"rgba(5,6,11,0.9)"),o.fillStyle=E,o.fillRect(b,w,v,x),o.restore();let A=3,_=k-x*.08;for(let W=0;W<A;W++){let O=(W+1)/(A+1);zo(o,b+v*(.24+O*.52),_,x*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ce(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(b-v*.5,P,v*.5,k-P),o.fillRect(S,P,v*.5,k-P);let F=v*.05+2,N=F*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(b,k),o.lineTo(b-F,k),o.lineTo(b-N,P),o.lineTo(b+v*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,k),o.lineTo(S+F,k),o.lineTo(S+N,P),o.lineTo(S-v*.012,P),o.closePath(),o.fill(),o.fillRect(b-N,P,v+N*2,(k-P)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(b-1.2,P,1.2,k-P),o.fillRect(S,P,1.2,k-P),o.fillStyle="#0b0f18",o.fillRect(b-F,k-x*.05,v+F*2,x*.05+2);let oe=o.createLinearGradient(0,k-x*.05,0,k+x*.14);oe.addColorStop(0,`rgba(255,206,140,${(.5*T).toFixed(3)})`),oe.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=oe,o.fillRect(b-F,k-x*.05,v+F*2,x*.22);for(let W=0;W<3;W++){let O=(W+1)/4,z=b+v*O,re=Qt(Math.min(Je-1,p+20));rn(o,z,re,z+(l()-.5)*v*.14,k,3,v*.09,u,.17*T),Ko(o,z,re,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let W=0;W<8;W++)o.beginPath(),o.arc((W+.5)/8*he,Qt(Je-4-W%2*3),2.2,0,D),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,vt-26,he,26),o.fillStyle="rgba(30,37,54,0.9)";for(let W=0;W<9;W++){let O=W*(he/9)+he/18;o.beginPath(),o.ellipse(O,vt-22,he/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:n.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Nh=new Set(["en"]),sn=new Map;async function ab(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await Xr(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-KSTMCSWV.js"),i=e[t];return i?await i():null}async function yI(t,e){let i=aa(t,e);if(i==="en"||Nh.has(i))return ct(i),i;if(!sa.includes(i))return ct("en"),"en";try{let n=sn.get(i);n||(n=ab(i),sn.set(i,n));let o=await n;return sn.delete(i),o?(ct(i,o),Nh.add(i),i):(ct("en"),"en")}catch{return sn.delete(i),ct("en"),"en"}}export{hb as ACCESSIBILITY_RING_COLOR,Yo as ACCESSIBILITY_TYPES,ry as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,oy as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,yb as BOOTH_TYPES,cb as CHART_STORAGE_KEY,Yy as CURRENCY_CHOICES,Ky as DEFAULT_CURRENCY,kb as DEFAULT_EVENT_INVENTORY_LIMIT,fT as EMPTY_AVAILABILITY_REFRESH,Tb as EVENT_CONFIGURATION_EXPORT_SCHEMA,Cb as EVENT_CONFIGURATION_SCHEMA,ey as FLOOR_COVER_LIMIT,Qb as FLOOR_STACK_GAP_RATIO,ny as FLOOR_STACK_MIN_SURFACE_PX,ay as GA_UNIT_LABEL_PREFIX,pT as HOLD_CLOCK_SKEW_MS,Tn as LABEL_FADE_MS,gb as LABEL_STYLE_MAX_SIZE,mb as LABEL_STYLE_MIN_SIZE,xb as LARGE_VENUE_INVENTORY_MODULE,Ty as LEGIBILITY_HYSTERESIS_PX,ty as LEVEL_CONTEXT_PREFIX,tS as LOCALE_NAMES,wb as MAX_EVENT_INVENTORY,cy as MAX_GA_CAPACITY,py as MAX_ONE_PARTY_GUESTS,ci as MIN_POINTER_TARGET_PX,fy as ONE_PARTY_LIMIT_MESSAGE,Eh as PickerController,Ee as PickerSelectionError,Ly as RENDERED_QUALITY_REPORT_VERSION,bb as ROW_AISLE_SEATS,pb as SEAT_COMMERCIAL_MARKS,yy as SEAT_TYPE_ICON_BODY,gn as SEAT_TYPE_ICON_VIEWBOX,lb as STAGE_LABEL_STYLE_MAX_SIZE,Au as SUPPORTED_LOCALES,Sb as SURROUNDINGS_SHAPE_ROLES,Ao as SeatmapRenderer,Ob as TABLE_SEAT_OFFSET,_b as TIER_HEIGHT_M,sa as TRANSLATED_LOCALES,pr as UNGROUPED_ID,oh as accessNeedsFor,by as accessibilityLabelKey,db as accessibilityMeta,ub as accessibilityRingColor,ii as allObjects,br as applyHidden,Pg as applyOrganizerSeatGlyph,Oo as asPickerSalesState,ah as attachVisibilityCatchUp,sy as automaticRoundTableRadius,Eb as canTransitionEventConfiguration,Rb as canonicalEventConfigurationJson,nr as chartBounds,Kd as clearOrganizerSeatGlyph,sr as combinedFloorZoneId,Rt as compactRowLabel,gr as computeSections,wy as computeSectionsPerFloor,Vd as createRenderer,Yr as crossesThreshold,Mu as currencyExponent,qy as currencySymbol,tt as effectiveFloorOverview,Lb as eventInventoryLimitFor,Xb as expandBooth,He as expandChart,Gb as expandRow,Hb as expandRowSlots,Kb as expandTable,Vb as expandTableSlots,qb as floorObjects,jb as floorStackPlacements,ti as floorsOf,aS as formatDate,$y as formatMinor,Ue as formatMoney,Eu as fromMinorUnits,Ct as gaAreasOf,pn as gaBoxBounds,un as gaBoxMode,uy as gaInventorySegments,dy as gaUnitLabel,my as gaUnitLabels,fn as gaUnitLabelsForModel,Lt as gaWheelchairPlaceCount,mn as gaWheelchairUnitLabels,pI as generateSeatPanorama,fI as generateSeatThumb,iS as getLocale,gy as growJoinedGAInventory,xy as hiddenObjectIds,_g as holdHasLapsed,gT as holdRecoveryShape,Pn as hysteresisScale,dr as initialFloorMode,Mb as inspectEventConfigurationCompatibility,Cy as inspectRenderedQualityEvidence,ly as isGaUnitLabel,oS as isLocaleLoaded,zd as isOrganizerGlyphPainted,ky as isSectionHidden,vb as layerOf,lr as layoutCombinedFloorPlan,ar as layoutFloorStack,cr as levelContextOutlines,yI as loadLocale,nS as localeDirection,iy as mainFloorId,Fb as migrateLegacyEventConfigurations,Uy as numberLocale,Ub as objectCenter,rS as onLocaleChange,$b as owningSectionForObject,Pb as parseEventConfigurationExport,Ib as parseEventConfigurationVersion,Jt as pointInPolygon,te as pointInPolygonWithHoles,Yb as pointOnPolygonBoundary,ei as polygonLabelPoint,rh as reconcileAvailability,mT as refreshChangedSomething,In as renderedPx,Xy as resolveCurrency,Ab as resolveEventConfigurationRollback,aa as resolveLocale,Nb as rowInventoryCount,Db as rowSeatPositions,fb as seatCommercialMeta,hr as seatNoteRowModel,ur as seatTypeIconBody,Sy as seatTypeIconSvg,it as sectionEntrancesById,Bb as sectionGeometry,vy as sectionIdentitiesById,fr as sectionLabelsById,mr as sectionOwnersByObject,ct as setLocale,ra as setMoneyLocale,sS as setStringOverrides,sh as shouldWaitForHoldExpiry,ir as stackFloors,Jb as suggestedFloorOverview,B as t,ca as tCount,zb as tableInventoryCount,Wb as tableSeatCountsBySide,Zb as translateObject,tr as usableHoles,hy as validGAInventorySegments,Iy as zoomTowardPoint};