@seatlayer/core 0.104.1 → 0.105.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GUNNA5LB.js → chunk-4LW4TZZR.js} +1 -1
- package/dist/{chunk-IEBXXGQC.js → chunk-4SHLBEG5.js} +1 -1
- package/dist/{chunk-URW7MSCJ.js → chunk-522ENS2Q.js} +1 -1
- package/dist/{chunk-4522UUXG.js → chunk-7Q366RVM.js} +1 -1
- package/dist/{chunk-EE2CVYFJ.js → chunk-DDQWZ323.js} +1 -1
- package/dist/{chunk-P2BTUNG6.js → chunk-DO545QTN.js} +1 -1
- package/dist/{chunk-P6ASVG3X.js → chunk-EYJ5T5JM.js} +1 -1
- package/dist/{chunk-KYPY7GWB.js → chunk-GCIZT3CV.js} +1 -1
- package/dist/{chunk-HIU4MMID.js → chunk-GZYHULZY.js} +1 -1
- package/dist/chunk-VHFSP53L.js +1 -0
- package/dist/{chunk-PBXGWYB4.js → chunk-VSX4JWN7.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +40 -1
- package/dist/core/chart-ops/index.d.ts +40 -1
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.d.cts +2 -2
- package/dist/core/inventory/index.d.ts +2 -2
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +2 -2
- package/dist/core/layout/index.d.ts +2 -2
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.d.cts +2 -2
- package/dist/core/quality/index.d.ts +2 -2
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/sections/index.d.cts +1 -1
- package/dist/core/sections/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -12
- package/dist/index.d.ts +10 -12
- package/dist/index.js +1 -1
- package/dist/{renderedQuality-D62MKRV8.d.cts → renderedQuality-C7NrTR19.d.cts} +1 -1
- package/dist/{renderedQuality-DZOIkUX_.d.ts → renderedQuality-q5he_9Bt.d.ts} +1 -1
- package/dist/{renderer-BIR1jJrt.d.cts → renderer-BZuro9aF.d.cts} +7 -0
- package/dist/{renderer-CiPst9uA.d.ts → renderer-DIEE9JhZ.d.ts} +7 -0
- package/dist/{tableSizing-BnlXRH_v.d.ts → tableSizing-D-vDBFpb.d.ts} +1 -1
- package/dist/{tableSizing-DuRJVaJs.d.cts → tableSizing-saWGNPZM.d.cts} +1 -1
- package/dist/{ticketRestrictions-BBZ5mbsi.d.cts → ticketRestrictions-BNemUVPU.d.cts} +1 -1
- package/dist/{ticketRestrictions-BEHxDUyd.d.ts → ticketRestrictions-DUuUJygM.d.ts} +1 -1
- package/dist/view3d/index.d.cts +1 -1
- package/dist/view3d/index.d.ts +1 -1
- package/dist/view3d/index.js +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6YTPIDLM.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as un,c as pn,e as Ar,f as di,h as Er,j as Fr,m as _r}from"./chunk-BF3XROP5.js";import{a as ub,b as qo,c as pb,d as Zo,e as Qo,f as tt,g as fb,h as mb,i as gb,j as jo,k as bb,l as yb,m as Jo,o as vr,r as rt}from"./chunk-6YTPIDLM.js";import{a as Hb,b as oi,c as Gb}from"./chunk-4522UUXG.js";import{d as Br}from"./chunk-TGHNVDWA.js";import{a as on,b as Fb,c as tr,d as _b}from"./chunk-YPVYZYMH.js";import{a as Eb,b as er,c as It,d as Lr,e as Cr,f as Tr,g as Ir}from"./chunk-PBXGWYB4.js";import{b as Sr,e as cn,i as ai,k as Mr}from"./chunk-QFX6XSO6.js";import{a as Sb,b as vb,c as wb,f as si}from"./chunk-P2BTUNG6.js";import{b as ri,f as mr,h as ot,i as gr,j as br,l as yr}from"./chunk-4N5CHKHD.js";import{A as Rr,b as Pt,c as li,d as dn,e as wr,f as kr,g as hn,l as xr,n as ci,z as Pr}from"./chunk-GUNNA5LB.js";import{b as Uo,c as $o,l as kt}from"./chunk-TFYAMLCK.js";import{A as fr,B as Ve,C as ln,D as ii,E as X,F as he,G as ni,a as me,b as cr,c as He,e as ge,f as Jt,g as ei,h as dr,i as Ct,j as Ge,k as We,l as H,n as hr,p as ur,q as pr,s as be,t as ye,w as nt,x as Tt,y as ti}from"./chunk-EE2CVYFJ.js";import{b as xg,c as Fo,d as Lg,e as _o,f as Cg,g as Tg,h as Ig,i as Pg,j as Rg,k as Mg,l as Ag,m as Eg,n as Fg,o as _g,p as Bg}from"./chunk-URW7MSCJ.js";import{a as kb,b as xb,c as Lb,d as Cb,e as Tb,f as Ib,g as Pb,h as Rb,i as Ji,j as en,k as Mb,l as tn,m as xt,n as nn,o as Ab,p as Lt,q as ir,r as Bb,s as it,t as nr,u as or,v as rr,w as Ob,x as Db,y as Nb,z as sr}from"./chunk-UKODEMIM.js";import{$a as Zt,Ga as Wo,Ia as Vo,J as Bo,Ka as Qg,L as Oo,La as jg,Ma as Jg,N as K,Na as eb,Oa as tb,Pa as ib,Qa as nb,Ra as ob,Sa as rb,Ta as sb,Ua as zo,Va as ab,Wa as Ko,Xa as te,Ya as qt,Za as lb,_a as cb,ab as db,ba as Do,bb as Qt,ca as No,cb as hb,d as Og,da as Ho,db as Xo,e as Dg,eb as De,f as Ng,fb as Yo,g as Hg,h as Gg,i as Wg,j as Vg,k as zg,ka as Go,l as Kg,m as Xg,ma as qg,n as Yg,o as Ug,p as $g,ua as Me,va as Zg}from"./chunk-HKVCBUON.js";import"./chunk-KTMZ3QAO.js";import{C as O,c as rn,h as sn,m as an,o as ar,t as D,u as ce,v as Ne,w as j,x as jt,z as lr}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var Wb=1,fn=90;function mn(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Or(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 gn(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 Vb(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 Wi}from"konva/lib/Core";import{Stage as Hm}from"konva/lib/Stage";import{Layer as So}from"konva/lib/Layer";import{Group as Xt}from"konva/lib/Group";import{Circle as bd}from"konva/lib/shapes/Circle";import{Group as An}from"konva/lib/Group";import{Circle as _e}from"konva/lib/shapes/Circle";import{Line as _n}from"konva/lib/shapes/Line";import{Rect as En}from"konva/lib/shapes/Rect";import{Text as oa}from"konva/lib/shapes/Text";var J=9,Se=.9,Z=.55*Se,ie=H/me,st=4,ue=14,Dr=10;var Nr=14;var ve=.45*Se,we=.9*Se,se=(ve+we)/2,Hr=Math.max(Se*1.1,we),Ae=8,Gr=700,ee=2,Rt=H,gh=12,bh=12;function Wr(t){return t<Q?bh:gh}var hi=.85,Vr=H,Mt=64,ze=.55*ve,zr=700,Kr=120,Xr=2500,Yr=420,Ur=420,$r=1,Ke=1,qr=2,at=16,Ee=12,bn=[.85,.72,.62],yh=10,Sh=9;function ui(t){return t<Q?Sh:yh}var pi=13,fi=12,Zr=0,Qr="700",jr="600",Jr=8,es=5,ts=10,is=6,ns=8,os=.6,rs=.6,ss=.7,as=[0,18,-18,36,-36,54,-54],Xe="600",ls="500",Q=640,cs=Xe,ds="400",Fe=0,hs=14,us=.34,ps=.92,fs=7,ms=3;function mi(t){return Math.min(1,Math.max(Ee/at,t/900))}function lt(t,e){return Math.max(Ee,t*mi(e))}var vh=.5,wh=1.15,gs=2,bs=3,ys=22,kh=8,xh=6;function At(t){return t<Q?xh:kh}var yn=.08;function Sn(t,e,i,n,o=vh,r=Ee){let s=t*mi(e),a=Math.max(r*(1+yn),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*wh);return Math.min(c,a*l)}var Ss=.1,Et=1.02;var gi=1.25;function vs(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var Lh="#e5e7eb",Ch="#c7cbd1",Th="#6b7280",Ih=["#6b7280","#5b6470","#4b5563","#374151"],Ph=["#cbd5e1","#e2e8f0","#f8fafc"],Rh="#d1d5db",Mh="#b8bdc4",Ah="#273142",Eh="#526078",Fh="#f1f5f9",_h="#374151",Bh="#64748b",Oh="#111827",ws="#6b7280",ks="#374151";var xs="#4b5563",Ls=.4,Le=.16,Cs="rgba(244,246,248,0.06)",bi=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Ts(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 ae(t){return D(t)?{sectionFill:Lh,sectionStroke:Ch,sectionInk:Th,focalFill:Rh,focalStroke:Mh}:{sectionFill:Ah,sectionStroke:Eh,sectionInk:Fh,focalFill:_h,focalStroke:Bh}}function vn(t,e){let i=t.sectionFill,n=D(i),o=n?ce(i,.6):lr(Ne(i,.2),.85);switch(e){case"closed":return n?ce(i,.4):Ne(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Is=.28,Ps=.42,Dh=.55,Nh=.7;function Rs(t,e,i){let n=ae(t),o=vn(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=D(t);return{fill:j(o,i,r?Ps:Is),stroke:O(i,r?Nh:Dh)}}var Hh=.03;function Ms(t,e){let i=ae(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>vn(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&wn(t,e)}function wn(t,e){let i=rn(e);if(!i)return!1;let n=ae(t),o=Math.max(Is,Ps)+Hh;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=rn(vn(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 Gh="#f8fafc",Wh="#f4f6fb",Vh="#111827",zh=.72;function As(t){let e=D(t),i=e?Gh:Oh,n=e?Vh:Wh,o=j(n,i,1-zh);return{plate:i,ink:n,subInk:an(o,i)>=ar?o:n}}function Es(t,e,i,n){if(e)return e;let o=D(i)?Ph:Ih;for(let r of[i,...o])if(an(r,t)>=n)return r;return he(t,e,i,n)}import{Shape as Xh}from"konva/lib/Shape";import{Circle as Yh}from"konva/lib/shapes/Circle";import{Rect as Uh}from"konva/lib/shapes/Rect";var Kh={M:2,L:2,Q:4,C:6,Z:0},kn=new Map;function xn(t){let e=kn.get(t);if(e)return e;let i=ot(t);if(!i)return kn.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=Kh[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 kn.set(t,o),o}function Fs(t,e,i,n=0,o=0){let r=xn(e),s=mr(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=gr(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 _s(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ye=class extends Xh{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=xn(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){_s(e,i),e.fillStrokeShape(this);return}e.beginPath(),Fs(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){_s(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 Ln(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 Bs(t){let{x:e,y:i,radius:n}=t;return t.wheelchairBay?new Uh({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}):Ln(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new Yh({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function $h(t,e){return t*2*e>=16}function Os(t,e,i,n){let o=$h(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function yi(t){return t?.35:.3}function Hs(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 Cn(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 Gs=700,qh=2400,Tn=12,Ws=30,Ds=1,Zh=1.16,Ns=.5,Qh=1;function In(t){return t*.61803398875%1}function Vs(t,e){let n=((t/qh+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:Ds+(Zh-Ds)*o,opacity:Ns+(Qh-Ns)*o}}var Ks;function Xs(t){Ks=t}function jh(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var zs=new Map;function Jh(t,e){let i=t??Ks,n=`${i??""}|${JSON.stringify(e)}`,o=zs.get(n);return o||(o=new Intl.DateTimeFormat(i,e),zs.set(n,o)),o}var eu={dateStyle:"medium",timeStyle:"short"};function Ys(t,e={}){let{locale:i,...n}=e,o=jh(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:eu;return Jh(i,r).format(o)}var ry="USD";function sy(t,e){return t?.trim()||e?.trim()||"USD"}var ay=["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"],$s;function qs(t){$s=t}var Us=new Map;function Pn(t,e,i,n){let o=n??$s,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=Us.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),Us.set(r,s)),s}function Ue(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return Pn(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 Pn(e,o,o,n).format(t)}var tu={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 iu(t="USD"){return tu[t.toUpperCase()]??2}function nu(t,e="USD"){return t/10**iu(e)}function ly(t,e="USD",i){return Ue(nu(t,e),e,void 0,i)}function cy(t="USD"){return Pn(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Ft={"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 ou=["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"],my={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"},Zs=["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"],ru=new Set(["ar","fa","he"]),Rn={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"},Mn=new Map(ou.map(t=>[t.toLowerCase(),t]));function su(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=Mn.get(e)??Rn[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=Mn.get(o)??Rn[o];if(r)return r}return Mn.get(n[0])??Rn[n[0]]}var $e={en:Ft},Si={},pe="en";function Qs(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=su(n);if(o)return o}return"en"}function gy(){return pe}function by(t=pe){return ru.has(t)?"rtl":"ltr"}function yy(t){return!!$e[t]}function ct(t,e){e&&($e[t]={...$e[t],...e}),pe=$e[t]?t:"en",qs(pe),Xs(pe),typeof document<"u"&&(document.documentElement.lang=pe)}function Sy(t){Si=t}var js=/\{(\w+)\}/g;function F(t,e){let i=Si[t]??$e[pe]?.[t]??Ft[t]??t;return e?i.replace(js,(n,o)=>String(e[o]??`{${o}}`)):i}function Js(t,e,i){let n=new Intl.PluralRules(pe).select(e);return(Si[`${t}.${n}`]??$e[pe]?.[`${t}.${n}`]??Ft[`${t}.${n}`]??Si[`${t}.other`]??$e[pe]?.[`${t}.other`]??Ft[`${t}.other`]??t).replace(js,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function vy(t,e){return Ys(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:pe})}function ta(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,ea=70;function ia(t,e){let i=dt+6,n=t.y-ea;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+ea,e.height-i)}}var Fn=.8,du=Math.hypot(.46,.36),hu=.26,uu=1.6,pu=2*(1-du),aa="#0b1220",ra="#ffffff";function sa(t,e,i,n,o){let r=Math.min(Math.max(uu,i*hu),i*pu);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:aa,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function fu(t){if(!(t instanceof Ye)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&ot(e)?e:null}var mu=220,gu=.08,vi=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(),Ve),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:fu(r.seatShape(e)),h=r.seatRadius(),m=new An({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});m.setAttrs({seatId:e,ringColor:l});let f={name:"selection-halo",stroke:O(r.categoryColor(s.categoryKey),yi(D(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;m.add(new En({...f,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 m.add(new _e({...f,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let g={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(m.add(new En({...g,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)m.add(new En({...g,stroke:ii(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:Fn}));else{let p=Math.max(0,d.width/2-14),b=-Math.max(0,d.height/2-14);m.add(new _e({x:p,y:b,radius:10,fill:l,listening:!1})),m.add(new _n({x:p,y:b,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:D(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(m,u,h,c,g);else{let p=Math.max(1,h-1.25),b=Math.min(2.5,Math.max(1.8,h*.22));if(m.add(new _e({...g,radius:p,strokeWidth:b})),c)m.add(new _e({...g,stroke:ii(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Fn}));else{let y=Math.max(0,p-b/2);m.add(sa(0,0,y,ra,!0))}}n.set(e,m),this.host.overlayLayer.add(m)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new _e({...r,stroke:ii(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:Fn}));return}let l=X(a,s.selectionColor(),Ve),c=Ln(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=br(i,n);if(!d)return;let u=D(l)?aa:ra;e.add(sa(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))},Gs))}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 _e({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Cn(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,m=Cn(h/420);if(s.radius(r*m.radiusScale),s.opacity(m.opacity),a){let f=Hs(h/320);a.scale({x:f,y:f})}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/mu),d=1+gu*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 An({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=ta(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id)),s=ia(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,ae(i).sectionInk),o=new An({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:O(n,.25),strokeWidth:1,listening:!1})),o.add(new _e({radius:dt,fill:i,stroke:O(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new _e({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new oa({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new oa({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:O(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 bu}from"konva/lib/Animation";var yu=1e3/Ws;function la(t){return t.findOne(".selection-halo")??null}var wi=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=la(a);if(l){if(this.paintHalo(s,l),o>=Tn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:In(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Tn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:In(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new bu(()=>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=yi(D(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(O(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=la(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}=Vs(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 Su}from"konva/lib/Group";import{Circle as Bn}from"konva/lib/shapes/Circle";import{Text as vu}from"konva/lib/shapes/Text";var ca=28,wu=12,ku="800",xu=44,da=1.6,ha=1.95;function ua(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 Lu(t,e){return F("map.beaconAria",{seats:Js("picker.seatCount",t),name:e})}function Cu(t,e){let i=e*ha,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 Tu="selection-beacon-ring",ki=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=ca/2/i,r=Math.max(xu,Math.ceil(2*(o*ha+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Su({listening:!1,name:"selection-beacons"});for(let c of e){let d=Cu(c,o);l.add(new Bn({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*da,fill:O(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new Bn({name:Tu,x:c.anchor.x,y:c.anchor.y,radius:o*da,stroke:O(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new Bn({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:O(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new vu({x:d.x,y:d.y,text:String(c.count),fontSize:wu/i,fontStyle:ku,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)||ca;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",Lu(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 _t(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(),m=i.y*u+t.y();h<r&&(r=h),m<s&&(s=m),h+i.width*u>a&&(a=h+i.width*u),m+i.height*u>l&&(l=m+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var xi=8,Iu=.02,pa=1,fa=.5;function ma(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=_t(t,e,o);if(!s)return 0;On(t,s,r);let a=Math.min((r.width-2*xi)/s.width,(r.height-2*xi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>fa?a:Math.min(a,Pu(t.scaleX(),n));if(!(c>1+Iu)&&!(l>fa)||!(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=_t(t,e,o);return h&&On(t,h,r),c}function Dn(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=_t(t,e,n);return r?On(t,r,o):!1}function Pu(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(pa,e):pa)/i}function On(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 Ru}from"konva/lib/Group";import{Circle as ga}from"konva/lib/shapes/Circle";import{Line as Mu}from"konva/lib/shapes/Line";import{Text as Au}from"konva/lib/shapes/Text";var Eu=6;function Bt(t){return D(t)?"#0b1220":"#ffffff"}function ba(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:Bt(i)}}var Li=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=ba({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>=we){this.host.overlayLayer.batchDraw();return}let n=Math.max(this.host.stageScale(),1e-4),o=new Ru({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=ba({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(Eu/2/n,1);for(let g of a)o.add(new ga({name:"owned-seat-dot",x:g.x,y:g.y,radius:c,fill:l.fill,stroke:O("#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(g=>g.logicalId===s.logicalId).reduce((g,p)=>g+this.host.ownedPoints(p).length,0),u=this.host.labelAnchor(s),h=11/n,m={x:u.x,y:u.y-h*2.1};o.add(new ga({name:"owned-section-badge",x:m.x,y:m.y,radius:h,fill:l.fill,stroke:O(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new Mu({x:m.x-h*.62,y:m.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 f=new Au({x:m.x+h*.12,y:m.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(f),this.badges.push({id:s.logicalId,centre:m,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 Fu}from"konva/lib/shapes/Text";var _u=4;function Ot(t){return D(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function Bu(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 ya(t,e){t.padding(_u),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),Bu(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(),Fu.prototype._sceneFunc.call(this,n)})}function Sa(t){return t?"seat":"section"}function va(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 wa(t){let e=t.place?.kind==="booth",i=e?"":Du(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=er(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,note:l.length?null:Ou(t.status,t.closed)}}function Ou(t,e){return e||t==="not_for_sale"?F("picker.notForSale"):t==="booked"?F("map.statusTaken"):t==="held"?F("map.statusHeld"):null}function Du(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 Nu=16,Hu=8;function ka(t,e,i,n=Nu){let o=Hu,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 xa=16,Nn=14,La=10.5,Gu=14,Wu=12.5,Ca={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Vu={warn:"#d8a425",premium:"#e8c15a"},zu=.1,Ku=.06,Ci=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=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.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(",")}`;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=ka(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(Sa(this.host.seatsPickable())==="seat"){let o=this.host.hoveredSeatId()??this.host.nearestSeat(e);return o?this.seatModel(o):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;return!i||n==null||this.host.sectionInteractive?.(i)===!1?null:va({name:n||i,memberIds:this.host.sectionMembers(i),categoryOrder:this.host.categoryOrder(),categoryKey:o=>this.host.seat(o)?.categoryKey??null,categoryLabel:o=>this.host.categoryLabel(o),categoryPrice:o=>this.host.categoryPrice(o),categoryColor:o=>this.host.categoryColor(o),categorySellable:o=>this.host.categorySellable(o),seatSellable:o=>this.host.seatSellable(o)})}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);return wa({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}:{}})}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 Qt(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=si(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?It(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=Ot(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",minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",background:i.plate,border:`1px solid ${i.stroke}`,boxShadow:"0 6px 20px rgba(2,6,23,0.22)",fontFamily:this.host.labelFont(),lineHeight:"1.35",zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${xa}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:`${Nn}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(),n=Ot(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 m=document.createElement("div");m.textContent=u.caption,Object.assign(m.style,{fontSize:`${La}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let f=document.createElement("div");f.textContent=u.value,Object.assign(f.style,{marginTop:"2px",fontSize:`${xa}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(m,f),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:`${Nn}px`,fontWeight:"700",background:c.color,color:ln(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")}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:`${La}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:`${Nn}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=ln(n.plate)==="#ffffff"?Ca.onDark:Ca.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,Vu[s.tone],zu):j(n.plate,o,Ku),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=tr(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 m=document.createElement("div");if(m.textContent=s.title,Object.assign(m.style,{fontSize:`${Gu}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(m),s.note){let f=document.createElement("div");f.textContent=s.note,Object.assign(f.style,{fontSize:`${Wu}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(f)}d.append(u,h),e.appendChild(d)}}};var Ta="#5b6db0";function Xu(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 Ia(t,e){let i=e?new Set(e):null;Xu(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Pa(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 Ra(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function Y(t){let e=Sr(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),m={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!te(m,o,r))return!1}return!0}function Ma(t,e,i){let n=Y(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:Bo(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 Aa(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return Y(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function Yu(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 Ea(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=Yu(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 $u}from"konva/lib/shapes/Text";function Uu(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),Uu(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/Mt),n=Math.floor((e.x+Math.max(0,e.width))/Mt),o=Math.floor(e.y/Mt),r=Math.floor((e.y+Math.max(0,e.height))/Mt),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var Hn=new WeakMap;function Ze(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=Hn.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},Hn.set(t,e);let i=()=>{let n=Hn.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Fa=new WeakMap,_a=new WeakMap;function Ba(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 $u({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 qu(t){let e=t.labelFont(),i=Ze(),n=_a.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new fe,r=Ba(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(),_a.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function Zu(t){let e=qu(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=Fa.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=Ba(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(),Fa.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function Oa(t,e){let i=t.sections.filter(f=>f.id===e||f.logicalId===e),n=i.map(f=>Y(f.outline));if(!n.length)return null;let o=Math.min(...n.map(f=>f.x)),r=Math.min(...n.map(f=>f.y)),s=Math.max(...n.map(f=>f.x+f.width)),a=Math.max(...n.map(f=>f.y+f.height)),l=new Set(i.flatMap(f=>f.memberIds));for(let f of l){let g=t.seatById.get(f);g&&(o=Math.min(o,g.x-t.seatR),r=Math.min(r,g.y-t.seatR),s=Math.max(s,g.x+t.seatR),a=Math.max(a,g.y+t.seatR))}let c=f=>{[f.x,f.y,f.width,f.height].every(Number.isFinite)&&(o=Math.min(o,f.x),r=Math.min(r,f.y),s=Math.max(s,f.x+f.width),a=Math.max(a,f.y+f.height))},d=f=>{let g={x:f.x+f.width/2,y:f.y+f.height/2};return i.some(p=>te(g,p.outline,p.holes))};for(let{node:f,backdrop:g}of t.freeTextById.values()){let p=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),g&&c(g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:f}of t.iconNodeById.values()){let g=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(g)&&c(g)}let u=Zu(t);t.rowLabelPlan.forEach((f,g)=>{(f.focusKeys??[]).some(b=>b===e||i.some(y=>b===y.id||b===y.logicalId))&&c(u[g])});let h=Math.max(s-o,a-r),m=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-m,y:r-m,width:Math.max(1,s-o+m*2),height:Math.max(1,a-r+m*2)}}import{Rect as Qu}from"konva/lib/shapes/Rect";import{Text as Da}from"konva/lib/shapes/Text";var Gn="\0";function ju(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 Ju(t,e){let i=t.filter(m=>Number.isFinite(m.centroid.x)&&Number.isFinite(m.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let n=i.map(m=>({member:m,weight:Math.max(1,ju(m.outline))})),o=n.reduce((m,f)=>m+f.weight,0),r=n.reduce((m,f)=>({x:m.x+f.member.centroid.x*f.weight/o,y:m.y+f.member.centroid.y*f.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(m=>{let f={x:m.centroid.x-e.x,y:m.centroid.y-e.y},g={x:m.centroid.x-r.x,y:m.centroid.y-r.y};return{member:m,depth:f.x*l.x+f.y*l.y,lateral:Math.abs(g.x*-l.y+g.y*l.x)}}).sort((m,f)=>f.depth-m.depth||m.member.id.localeCompare(f.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(m=>m.depth>=u);return h.sort((m,f)=>m.lateral-f.lateral||f.depth-m.depth||m.member.id.localeCompare(f.member.id)),h[0].member}function ep(t){let i=[...F("map.fromPrice",{price:Gn}).toLocaleLowerCase()],n=i.findIndex(o=>o!==Gn&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(Gn).join(t)}function tp(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function ip(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>tp(n.label,i))}function Na(t,e){if(!e.zones?.length||!t.sections.length)return;let i=As(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&&!ip(o.label,r))continue;let s=r[0];for(let p of r)p.centroid.y<s.centroid.y&&(s=p);t.derivedFloorGroups&&(s=Ju(r,o.focalPoint??e.focalPoint)??s);let a=s.centroid.x,l=s.centroid.y,c=1/0,d=-1/0;for(let p of r)for(let b of p.outline)b.x<c&&(c=b.x),b.x>d&&(d=b.x);let u=isFinite(c)&&d>c?d-c:0,h=1/0;for(let p of r)for(let b of p.memberIds){let y=t.seatById.get(b),S=y&&t.catPrice.get(y.categoryKey);typeof S=="number"&&S<h&&(h=S)}let m=new Qu({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:i.plate,stroke:O(o.color??s.outlineTint,os),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new Da({x:a,y:l,text:o.label,fontSize:pi,fontStyle:Qr,letterSpacing:0,fontFamily:t.labelFont(),fill:i.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f);let g=null;isFinite(h)&&(g=new Da({x:a,y:l,text:ep(Ue(h,t.currency)),fontSize:fi,fontStyle:jr,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),g.offsetX(g.width()/2),t.bgLayer.add(g)),t.zones.push({id:o.id,anchor:{x:a,y:l},back:m,background:i.plate,name:o.label,spanWorld:u,label:f,sub:g})}}function Ha(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=>qo(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 np=new Set,Ga=16,op=5,Ti=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=np){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<op;for(;this.pinQueue.length&&n();){let o=[];for(let r of this.pinQueue.splice(0,Ga)){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+Ga,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 Wa(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 fp}from"konva/lib/shapes/Circle";import{Line as mp}from"konva/lib/shapes/Line";import{Rect as gp}from"konva/lib/shapes/Rect";import{Text as bp}from"konva/lib/shapes/Text";function Ce(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Te(t,e){return Ce(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Va=.35,za=.7,Qe="#0b1220",pt="#ffffff",Ka="#0b1220",Wn="#232c40",Xa="#8b93a7";function Vn(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var zn="#f7f8fb";import{Text as Ua}from"konva/lib/shapes/Text";var Ya="500",rp=2.5;function sp(t,e){return t>=ie||e&&t>=hi}function ap(t){return t.effectiveScale<hi?!1:t.focusActive||t.stageWidth<Q}function lp(t,e,i){return i&&e>=hi?Math.max(t,Vr/Math.max(e,1e-4)):t}function cp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=H/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(st,r),s)}function Kn(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function $a(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 qa(t,e){return e>0?Math.min(t,e/2):t}function Za(t){return Ii(Xn(t))}function Xn(t){let e=Kn(t,!1),i=Kn(J,!1),n=e>0?i/e:1;return me/Math.max(1,n)}function Ii(t){return H/Math.max(t,1e-4)/gn(1,!1,H)}function Qa(t){return Ii(t)*gi}function dp(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function ja(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=ap({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:gn(e,t.labelsWereVisible(),H),o=t.labelLayers(),r=o.seatLabels&&sp(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=f=>{let g=t.worldToScreen({x:f.x(),y:f.y()}),p=f.width()*e,b=f.height()*e;return g.x-p/2>=0&&g.y-b/2>=0&&g.x+p/2<=t.stage.width()&&g.y+b/2<=t.stage.height()};for(let[f,g]of t.boothLabelById){let p=t.circleById.get(f);g.visible(be(g.fontSize(),n)&&!!p?.isVisible()&&t.focusedSeatOpacity(f,p?.getAbsoluteOpacity()??1)>=.5&&s(g))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0;if(r)for(let f of t.visibleSeatCandidates()){if(f.kind==="booth")continue;let g=t.worldToScreen(f);if(g.x<-20||g.x>t.stage.width()+20||g.y<-20||g.y>t.stage.height()+20||t.accessGlyphById.has(f.id)&&t.accessGlyphShouldShow(f.id))continue;let p=t.circleById.get(f.id);if(!p?.isVisible()){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let b=t.statusById.get(f.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(f.id)&&(b==="booked"||b==="not_for_sale"||b==="held"&&!t.ownedHold.has(f.id))){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(f.id)){t.seatLabelDrops.set(f.id,"selection-tick");continue}if(t.focusedSeatOpacity(f.id,p.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let x=lp(me*t.seatLabelScale(f),e,i),w=ti(f.displayLabel??f.label),k=p?t.seatLabelInk(f,p):t.seatPreferredLabelInk(f),v=t.seatLabelPool.get(f.id);v?(v.position({x:f.x,y:f.y}),v.text(w),v.fontSize(x),v.fontFamily(t.labelFont()),v.fill(k),v.offset({x:0,y:0}),v.scale({x:1,y:1})):(v=new Ua({x:f.x,y:f.y,text:w,fontSize:x,fontStyle:Ya,fontFamily:t.labelFont(),fill:k,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(f.id,v));let C=Kn(t.seatR,i);if(v.fontSize(cp({authoredFontSize:x,measuredWidth:v.width(),maxWidth:C,effectiveScale:e})),v.width()>C+.01){t.seatLabelDrops.set(f.id,"label-overflows-marker");continue}if(!be(v.fontSize(),e)){t.seatLabelDrops.set(f.id,"below-minimum-size");continue}if(v.offsetX(v.width()/2),v.offsetY(v.height()/2),dp(t,f.id,v),!s(v)){t.seatLabelDrops.set(f.id,"outside-viewport");continue}if(a.add(f.id),t.seatLabelById.set(f.id,v),++l>=zr)break}for(let[f,g]of t.seatLabelPool)a.has(f)||(g.destroy(),t.seatLabelPool.delete(f));let c=new fe;for(let{node:f}of t.freeTextById.values()){if(!f.isVisible())continue;let g=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});c.insert({x:g.x-ee,y:g.y-ee,width:g.width+ee*2,height:g.height+ee*2})}let d=new fe,u=null,h=()=>{if(u)return u;u=new fe;for(let f of t.seatLabelById.values()){if(!f.isVisible())continue;let g=f.getClientRect({skipShadow:!0,skipStroke:!0});u.insert({x:g.x,y:g.y,width:g.width,height:g.height})}return u},m=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*rp;if(o.rowLabels)for(let f of hp(t.rowLabelPlan)){let g=t.rowLabelPlan[f],p=t.focusedSectionId!=null&&g.focusKeys?.includes(t.focusedSectionId),b=Math.max(e,1e-4),y=p?Math.max(g.fontSize,Rt/b):g.fontSize,S=Math.max(Math.min(y,Wr(t.stage.width())/b),p?Rt/b:0);if(!r&&(!p||!m)||!p&&!be(S,n))continue;let x=t.worldToScreen({x:g.x,y:g.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let w=new Ua({x:g.x,y:g.y,text:g.text,fontSize:S,fontStyle:Ya,fontFamily:t.labelFont(),fill:g.ink,rotation:g.rotation,opacity:g.opacity,shadowColor:"#05070c",shadowBlur:g.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:g.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});g.pill&&ya(w,g.pill),w.offsetX(w.width()/2),w.offsetY(w.height()/2);let k=t.resolveAutomaticRowLabelPosition(w,g,c);w.position(k),w.setAttr("rowLabel",!0),g.rowKey&&w.setAttr("rowKey",g.rowKey),w.setAttr("focusKeys",g.focusKeys??[]),t.rowLabelGroup.add(w);let v=w.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,P=v.x<C?C-v.x:v.x+v.width>t.stage.width()-C?t.stage.width()-C-v.x-v.width:0,T=v.y<C?C-v.y:v.y+v.height>t.stage.height()-C?t.stage.height()-C-v.y-v.height:0,L=k;if(P||T){let R=t.labelGroup.getAbsoluteTransform(),M=R.point(k);L=R.copy().invert().point({x:M.x+P,y:M.y+T}),w.position(L);let E=w.getClientRect({skipShadow:!0,skipStroke:!0});if(h().collisionCount({x:E.x,y:E.y,width:E.width,height:E.height})>0){w.destroy();continue}}let I=t.rowLabelBox(w,L);if(d.collisionCount(I)>0){w.destroy();continue}if(g.automaticAway&&c.collisionCount(I)>0){w.destroy();continue}c.insert(I),d.insert(I)}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 Yn(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:Xn(e)}}function up(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 Ja(t,e){let i=Yn(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?up({...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 pp(t){return Qa(t.labelFontSize)}function el(t){return Ii(t.labelFontSize)}function Pi(t){let e=Math.max(t.diameter,1e-4);return Math.max(se,oi/e)}function tl(t){return Math.max(pp(t),Pi(t)*gi)}function il(t){for(let e of t.seats){if(e.kind==="booth"){yp(t,e);continue}let i=t.seatContainer(e.id),n=Bs({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:yr(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 fp({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Tt(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 mp({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 bp({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 nl(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 ol(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 Wp}from"konva/lib/shapes/Circle";import{Group as Tl}from"konva/lib/Group";import{Rect as Vp}from"konva/lib/shapes/Rect";import{Text as zp}from"konva/lib/shapes/Text";var Ie=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*Ie),o.height/(e.height*Ie));return K(r,i.min,i.max)}var Dt=.55;function Nt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function Un(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??Et,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 rl(t,e,i,n){let o=K(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.scale({x:o,y:o}),t.position({x:i.x-s*o,y:i.y-a*o}),!0}function sl(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*Ie),s.height/(e.height*Ie)),l=n??i.min,c=K(Math.max(a,l),i.min,Math.max(l,Nt(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 al(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function $n(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 ll(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Sp=11;function vp(t){let e=lt(Sp,t),i=ui(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var wp=4,kp=2;function xp(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.length<=4?e:null}function cl(t,e,i){let n=t.numberLabel,o=xp(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.visible(!0),n.rotation(0);let r=wp/e;for(let s of vp(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 Lp(t,e,i){let n=i({x:t.x(),y:t.y()}),o=t.width()*e,r=t.height()*e;return{x:n.x-o/2,y:n.y-r/2,w:o,h:r}}function Cp(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 dl(t,e,i,n){let o=[];for(let r of e){if(r.label.opacity()<=.05)continue;let s=r.back.getAbsolutePosition(),a=r.back.width()*i,l=r.back.height()*i;o.push({x:s.x-a/2,y:s.y-l/2,w:a,h:l})}if(o.length)for(let r of t){if(r.numberLabel.opacity()<=.05)continue;let s=Lp(r.numberLabel,i,n);for(let a of o)if(Cp(s,a,kp)){r.numberLabel.opacity(0);break}}}function hl(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 ml(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(O(e.outlineTint,.5)),e.outlinePoly.fill(O(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(O(n,.72+i*.25)),e.outlinePoly.fill(O(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 Zn(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function gl(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&&Ce(s,e)&&(o+=1)}return o}function Tp(t,e){return Zn(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Ss?"nearly-gone":"normal"}function bl(t,e){let i=Tp(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=Rs(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 yl(t,e){return j(e,D(t)?"#ffffff":"#000000",us)}function Qn(t,e,i=0){let n=hs-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function Ip(t,e){return Sl(t,e)!=null}function Sl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function vl(t,e,i){let n=Qn(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 Pp(t,e,i){let n=vl(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(ds),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Fe:0)}function Rp(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var Mp=.05;function wl(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<=Mp}function kl(t,e){let i,n;t.reducedMotion?(i=e<=ve?1:0,n=e<=ze?1:0):(i=K((we-e)/(we-ve),0,1),n=K((ve-e)/(ve-ze),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Z;o&&(i=1),t.zones.length||(n=0),t.seatLayer.opacity(wl(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>yn);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<Q,c=l&&o&&t.zones.length===0,d=ae(t.canvasBackground),u=K((i-.2)/.8,0,1),h=new Set(t.zones.map(g=>g.id)),m=new Set;for(let g of t.sections){let p=t.hasFocusDimOverlay?1:a&&g.id!==a&&g.logicalId!==a&&g.zone!==a?Le:1,b=Sl(t,g);b&&g.zone&&m.add(g.zone);let y=Math.min(p,ll(g.memberCategoryKeys,t.categoryFilter)?Le:1,t.accessFilterActive&&!b?Le:1);g.outlinePoly.opacity(o?0:(1-i)*y),g.blockPoly.opacity($r*i*y);let S=t.sectionIsOwned(g);g.blockPoly.stroke(S?t.selectionColor:g.shellStroke||d.sectionStroke),g.blockPoly.strokeWidth((S?qr:Ke)/Math.max(r,1e-4));let x=g.blockPoly.fill(),w=typeof x=="string"?x:g.baseFill,k=Es(w,g.explicitInk,g.preferredInk,hr);g.nameLabel.fill(k),g.subLabel.fill(k),Pp(g,l,b);let v=g.zone!=null&&h.has(g.zone);s&&(u>.01||g.externalLabel)&&_p(t,g,r,vl(g,l,b),!v);let C=b||!v?1:1-n;g.nameLabel.opacity(g.nameLabelFits?(g.externalLabel?1:u)*C*y:0),g.subLabel.opacity(0);let P=c&&!g.nameLabelFits,T=v&&n>.01;s&&(g.numberLabelFits=(T||P)&&cl(g,r,t.stageWidth)),g.numberLabelFits&&g.numberLabel.fill(he(w,g.explicitInk,g.preferredInk)),g.numberLabel.opacity(g.numberLabelFits?(P?u:T?n:0)*y:0)}let f=n;for(let g of t.zones){let p=t.accessFilterActive&&!m.has(g.id)?Le:1,b=g.label.visible()?f*p:0;g.back.opacity(b),g.label.opacity(b),g.sub&&g.sub.opacity(ul(t,g)?0:b),s&&Bp(t,g,r)}if(!t.glideInProgress&&(u>.01||f>.01)){Ep(t,r,c),Ap(t.sections);for(let g of t.zones){let p=g.label.opacity();g.back.opacity(p),g.sub&&g.sub.opacity(ul(t,g)?0:p)}}(f>.01||c)&&(f>.01&&dl(t.sections,t.zones,r,t.worldToScreen),hl(t.sections));for(let g of t.sections)Rp(g);t.bgLayer.batchDraw()}function ul(t,e){return t.stageWidth<Q||!e.sub||!e.sub.visible()}function Ap(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=Y(o.outline),a=Y(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function Ep(t,e,i=!1){let o=[],r=c=>{let d=t.worldToScreen({x:c.x(),y:c.y()}),u=Y(ht({x:0,y:0},c.width()*e,c.height()*e,c.rotation()));return{x:d.x-u.width/2,y:d.y-u.height/2,w:u.width,h:u.height}};for(let c of t.zones){if(c.label.opacity()<=.05)continue;let d=c.back.getAbsolutePosition(),u=c.back.width()*e,h=c.back.height()*e;o.push({node:c.label,tier:0,section:!1,zone:c,box:{x:d.x-u/2,y:d.y-h/2,w:u,h}})}for(let c of t.sections){if(c.nameLabel.opacity()>.05){let d=Ip(t,c)?-1:1;o.push({node:c.nameLabel,tier:d,section:!0,area:c.labelArea,box:r(c.nameLabel)})}i&&c.numberLabel.opacity()>.05&&o.push({node:c.numberLabel,tier:1,section:!1,area:c.labelArea,box:r(c.numberLabel)})}let s=t.landmarks.map(c=>{let d=t.worldToScreen({x:c.x,y:c.y}),u=t.worldToScreen({x:c.x+c.width,y:c.y+c.height});return{x:Math.min(d.x,u.x),y:Math.min(d.y,u.y),w:Math.abs(u.x-d.x),h:Math.abs(u.y-d.y)}});if(o.length<2&&!s.length)return;o.sort((c,d)=>c.tier-d.tier||(d.area??0)-(c.area??0)||c.box.y-d.box.y||c.box.x-d.box.x);let a=[...s],l=c=>a.some(d=>c.x<d.x+d.w+4&&d.x<c.x+c.w+4&&c.y<d.y+d.h+4&&d.y<c.y+c.h+4);for(let c of o){if(!l(c.box)){a.push(c.box);continue}let d=!1;if(c.zone)for(let u of as){if(u===0)continue;let h={...c.box,y:c.box.y+u};if(!l(h)){qn(c.zone,0,u/e),a.push(h),d=!0;break}}if(c.section){let u=c.node.fontSize(),h=c.node.y(),m=c.node.letterSpacing()>0;for(let f of bn){let g=u*f;if(g*e<At(t.stageWidth))break;Pe(c.node,g,h),m&&(c.node.letterSpacing(c.node.fontSize()*Fe),c.node.offsetX(c.node.width()/2));let p=r(c.node);if(!l(p)){a.push(p),d=!0;break}}d||(Pe(c.node,u,h),m&&(c.node.letterSpacing(c.node.fontSize()*Fe),c.node.offsetX(c.node.width()/2)))}d||c.node.opacity(0)}}function Pe(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function Fp(t,e,i){let n=Y(t);return ge({width:n.width*i,height:n.height*i,text:e})}function _p(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<Q,s=At(t.stageWidth),a=Sn(at*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&wl(t)?Math.max(a,Fp(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Pe(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,m]of n.entries()){e.nameLabel.text(m);let f=Y(e.outline),g=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:f.height>f.width*bs?[0,-90]:[0];for(let p of g)for(let b of e.labelAnchors)for(let y=c;y>=s;y-=1){e.nameLabel.rotation(p),Pe(e.nameLabel,y/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Fe),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(b);let S=gs/i;if(ut(b,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),Pe(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Fe),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=Y(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function pl(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 Bp(t,e,i){let n=mi(t.stageWidth),o=t.stageWidth<Q,r=e.sub!=null&&!o,s=(o?Jr:ts)*n/i,a=(o?es:is)*n/i,l=Sn(pi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Pe(e.label,l/i,e.anchor.y),r&&(Pe(e.sub,lt(fi,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*Zr),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*rs/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*ss-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 v of bn){let C=Math.max(Ee,l*v);if(C>=e.label.fontSize()*i-.001||(Pe(e.label,C/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(pl(e.label,e.name,Math.max(u,1)),Op(e.label.text())<Dp(e.name)&&pl(e.label,e.name,Math.max(c,1)),Pe(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){fl(e);return}e.label.visible(!0),e.back.visible(!0);let m=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 f=Math.max(e.label.width(),r?e.sub.width():0)+s*2,g=e.label.height()+(r?m+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(m+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+m)/2),e.back.position(e.anchor),e.back.size({width:f,height:g}),e.back.offset({x:f/2,y:g/2}),e.back.cornerRadius(ns*n/i),e.back.strokeWidth(1/i);let p=e.back.getAbsolutePosition(),b=6,y=f*i;if(y>t.stageWidth-b*2){fl(e);return}let S=y/2,w=(K(p.x,b+S,t.stageWidth-b-S)-p.x)/i;Math.abs(w)>.001&&qn(e,w,0);let k=62+g*i/2;p.y<k&&qn(e,0,(k-p.y)/i)}function Op(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function Dp(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function fl(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 qn(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)}function Np(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 eo(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=Np(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function jn(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 Jn(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 xl(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 Hp(t){if(!t.length)return 0;let e=xl(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,jn(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return xl(i)+e}function to(t,e){if(!t.length)return[];let i=Hp(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,m)=>h.bounds.y-m.bounds.y||h.bounds.x-m.bounds.x||h.id.localeCompare(m.id)),d=[];for(let h of c){let m=d.find(f=>jn(f.bounds,h.bounds)<=i);m?(m.bounds=Jn(m.bounds,h.bounds),m.rowIds.push(h.id),m.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 m=h+1;m<d.length;m+=1)if(!(jn(d[h].bounds,d[m].bounds)>i)){d[h].bounds=Jn(d[h].bounds,d[m].bounds),d[h].rowIds.push(...d[m].rowIds),d[h].seatCount+=d[m].seatCount,d.splice(m,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 Ll(t){let e=null;for(let i of t)e=e?Jn(e,i.bounds):{...i.bounds};return e}function Cl(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 Pl(t){return t*.3}function Il(t){return Pl(t)*2+t*.42}var Ri=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=to(eo(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=ae(i),o=yl(i,i),r=X(o,n.sectionInk),s=new Tl({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 Tl({listening:!1}),u=new Vp({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:Ke,opacity:ps,listening:!1,perfectDrawEnabled:!1}),h=new Wp({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),m=new zp({...c,text:l,fontSize:at,fontStyle:Xe,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(m),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:m,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<se||e>=this.host.readableScale();return this.revealed=n||Or(mn(i,e),mn(i,se),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()*Et)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*Ie),d=r.height/(l*Ie);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?Xp(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=vs(i,this.host.pickableScale());if(n==null||n<=i*Et)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Ie),a=r.height/(n*Ie);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=Cl(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<Q,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=lt(at,i),a=fs/n,l=ms/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:m}=c;d.text(Qn(c.label,o)),d.fontStyle(o?cs:Xe);let f=s,g=0;for(;d.fontSize(Math.max(1,f/n)),d.letterSpacing(d.fontSize()*Fe),g=Il(d.fontSize())+d.width()+a*2,!(g<=m.bounds.width||f<=Ee);)f=Math.max(Ee,f-1);let p={x:m.bounds.x+m.bounds.width/2,y:m.bounds.y+m.bounds.height/2},b=d.height()+l*2,y=g-a*2,S=p.x-y/2;h.radius(Pl(d.fontSize())),h.position({x:S+h.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Il(d.fontSize()),y:p.y}),u.size({width:g,height:b}),u.offset({x:g/2,y:b/2}),u.cornerRadius(b/2),u.strokeWidth(Ke/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=eo(e,this.host.seatR()),o=to(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=Ll(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)}},Kp=.18;function Xp(t,e){let i=(n,o,r)=>{let s=o*Kp;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 Yp}from"konva/lib/shapes/Circle";import{Line as Up}from"konva/lib/shapes/Line";function Rl(t,e,i){let n=t.seatRadius(),o=new Yp({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 Ml(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 Up({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)),f=1+(1-Math.pow(1-h,3))*.04;s.scale({x:f,y:f}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Jp}from"konva/lib/Group";import{Shape as ef}from"konva/lib/Shape";import{Group as $p}from"konva/lib/Group";import{Shape as qp}from"konva/lib/Shape";function Zp(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 Qp(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 jp(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 jp(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 Be(t,e,i,n){let o=cn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new qp({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return Zp(l,h,r);l.moveTo(h[0].x,h[0].y);for(let m=1;m<h.length;m+=1)l.lineTo(h[m].x,h[m].y);l.closePath()}};n?(h=>{l.moveTo(h.start.x,h.start.y);let m=h.start;for(let f of h.segments)f.kind==="line"?l.lineTo(f.end.x,f.end.y):f.kind==="arc"?l.arc(f.center.x,f.center.y,f.radius,Math.atan2(m.y-f.center.y,m.x-f.center.x),Math.atan2(f.end.y-f.center.y,f.end.x-f.center.x),!f.clockwise):l.bezierCurveTo(f.control1.x,f.control1.y,f.control2.x,f.control2.y,f.end.x,f.end.y),m=f.end;l.closePath()})(n):d(t);for(let h of Ko(e)){let m=cn(h)>0;d(m===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=Qp(t,n);return s.getSelfRect=()=>({...a}),s}var gt=class extends $p{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 Al(t,e){if(!e.length)return null;let i=new Jp({listening:!1});for(let n of e)i.add(Be(n.outline,n.holes,{fill:Cs,stroke:O("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function El(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 ef({fill:t.canvasBackground,opacity:1-Le,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 Fl(t,e){return t.startsWith("#")?j(e,t,tf):t}var Nl=.5,$=Math.SQRT1_2,nf="#f3f4f6",_l=4;function of(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Nl:Math.min(1,Math.max(0,e))}function rf(t){return t==="booked"||t==="not_for_sale"?ks:ws}function Bl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Ol(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 sf(t,e,i){let n=Ol(t),o=Ol(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(Bl(n,a)*(1-r)+Bl(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Dl(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 af(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-_l;o<=_l;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 Mi(t,e){t._sceneFunc(e)}function Hl(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,Mi(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??Nl))*n;t.save(),Dl(t,l,n,1),i.fill=i.markBase??o,Mi(e,t),t.restore(),t.save(),Dl(t,l,n,-1),i.fill=i.markFill??o,Mi(e,t),i.markHatch&&(af(t,n),i.fill=nf,Mi(e,t)),t.restore(),i.fill=o}function lf(t,e,i,n,o,r){let s=of(e),a=rf(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=sf(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(Hl)}function cf(t){t.setAttr("sceneFunc",void 0)}function Ei(t){return t.attrs.sceneFunc===Hl}var Ai=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){Ei(e)&&cf(e);return}lf(e,l,n,o,r,s)}};var Gl="#9ca3af";var df="#f4b740",hf="#854d0e",uf="#1a1200",pf="#f1f4f9",ff="#1a2234",mf="#475569",gf="#c3cbdc";function bf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Wl(t,e=!1,i=!1){if(!bf(t))return null;if(e){if(t==="not_for_sale"){let n=i?gf:mf;return{fill:i?ff:pf,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:Gl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:df,stroke:hf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:uf}}return{fill:Gl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function Vl(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 zl(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Fi=Object.freeze([]),yf=.18;function Kl(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(Fi),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:Wl(o,u,u&&!D(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(ce(s,c===pt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===pt?ce(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Ei(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Tt(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 T=t.boothExtent(n.rowId);a.fontSize(T?.nameSize??(T?ge({...T,text:n.displayLabel??n.label}):He)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Qe),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let m=o==="free"||o==="held"&&!t.isOwnedHold(i),f=()=>{let T=e.fill();typeof T=="string"&&e.fill(Fl(T,l))},g=t.accessFilter();if(g&&m&&!r){let T=Te(n,g);T==="other"?(f(),e.opacity(Math.min(e.opacity(),Va))):T==="companion"&&e.opacity(Math.min(e.opacity(),za))}let p=t.categoryHighlight();p&&o==="free"&&!r&&n.categoryKey!==p&&e.opacity(.25);let b=t.seatHighlight();b&&!r&&!b.has(i)&&e.opacity(Math.min(e.opacity(),yf));let y=t.categoryFilter();y&&m&&!r&&!y.has(n.categoryKey)&&(f(),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 T=t.seatSection(i);(T?S.has(T.id)||S.has(T.logicalId)||T.zone!=null&&S.has(T.zone):S.has(ir))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(xs),e.stroke(""),e.strokeWidth(0),e.dash(Fi),e.opacity(Ls),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let x=t.boothLabel(i)??t.seatLabel(i);if(x){x.fill(t.seatLabelInk(n,e));let T=!a&&(r||d);x.visible(be(x.fontSize(),t.effScale())&&e.opacity()>=.5&&!T)}let w=t.organizerGlyph,k=h?.glyph??null,v=Ei(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(w&&k&&!v){let T=a?t.boothExtent(n.rowId):void 0,L=T?Math.min(T.width,T.height)/2:t.seatRadius();w.apply(e,k,h.glyphInk??"",L)}else w?.isPainted(e)&&w.clear(e);let C=t.accessGlyph(i);if(C){let T=e.fill();C.fill(ni(typeof T=="string"?T:"")),C.opacity(e.opacity()),C.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Tt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function _i(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 m=u*u+h*h;m<n&&(n=m,i=o)}return i}function Bi(t){return t?.getAttr?.("seatId")??void 0}var io=.85,Sf=.38,vf=Object.freeze([3,3]);function wf(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function Xl(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function kf(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(t.seatsPickable()||(t.clusterLabels.setPressLandsOnChart(!Xl(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}function Yl(t){t.attachHoverCard();let e=kf(t);t.seatLayer.on("click tap",i=>{if(t.moved()>Ae||t.isGhostClick(i))return;let n=Bi(i.target);n&&t.seatsPickable()&&t.handleSeatTap(n)}),t.seatLayer.on("mouseover",i=>{let n=Bi(i.target);if(!n)return;let o=t.seat(n);if(!o)return;t.setHoveredId(n);let r=xf(t,n);t.hoverRing.position(o),t.hoverRing.opacity(r==="muted"?Sf:io),t.hoverRing.dash(r==="muted"?vf:Fi),t.hoverRing.visible(r!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(r==="full"),t.onHover?.(o,{mark:t.seatMark(n),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let i=t.stage.getPointerPosition();i&&e(i)}),t.stage.on("wheel",i=>{i.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let n=t.container.getBoundingClientRect(),o={x:i.evt.clientX-n.left,y:i.evt.clientY-n.top},r=Math.exp(-i.evt.deltaY*.002);t.zoomAbout(t.stage.scaleX()*K(r,.5,2),o,"frame"),e(o)}),t.stage.on("click tap",i=>{if(t.moved()>Ae||t.isGhostClick(i))return;let n=t.stage.getPointerPosition();if(!n)return;if(t.sectionCount()){let r=t.ownedBadgeAt(t.screenToWorld(n));if(r&&t.focusOwnedSeats(r))return}if(!(Bi(i.target)&&t.seatsPickable())){let r=_i(t.selectionMarkers(),n);if(r){t.focusSeats([r],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(n))return;if(t.rowLabelAt&&t.selectRow){let r=t.rowLabelAt(n);if(r){t.selectRow(r);return}}if(!t.cached()){if(Bi(i.target)&&t.seatsPickable())return;if(t.seatsPickable()){let r=t.focusedSectionId(),s=t.nearestSeatToScreen(n,ue),a=s?t.seatSection(s):null;if(s&&(!r||a&&t.sectionMatchesFocus(a))){t.handleSeatTap(s);return}let l=s?null:t.nearestSeatToScreen(n,ue,!0),c=l?t.seatSection(l):null;if(l&&(!r||c&&t.sectionMatchesFocus(c))){t.handleSeatTap(l);return}if(r&&t.onBackdropTap&&!t.floorOverview()){let u=t.sectionAt(n);if(u&&t.sectionInteractive?.(u)===!1)return;if(u&&u!==r){let h=t.sectionTapAnchor(u,t.screenToWorld(n));t.onSectionTap?t.onSectionTap(u,h):t.focusSection(u,{anchor:h})}else u||t.onBackdropTap();return}if(r)return;let d=t.sectionCount()?wf(t,n):null;if(!d||t.effScale()>=ie||t.sectionFrameScale(d)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let r=t.floorOverview()?t.sectionAt(n):null,s=(r?t.objectFloor(r):null)??t.deckFloorAt();if(s){t.onDeckTap(s);return}}if(t.sectionCount()){let r=t.screenToWorld(n),s=t.ownedBadgeAt(r);if(s&&t.focusOwnedSeats(s)||!s&&Xl(t,n))return;let a=s??t.sectionAt(n);if(a){let l=t.sectionTapAnchor(a,r);t.onSectionTap?t.onSectionTap(a,l):t.focusSection(a,{anchor:l});return}if(!t.pressLandsOnChart(n))return}if(!t.seatsPickable()){let r=t.tableAt?.(n);if(r?.length&&t.focusSeats(r,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(n)||t.clusterLabels.glideTowardTap(n))return;let o=Math.max(Se*1.2,t.stage.scaleX()*2.5);t.zoomAbout(o,n)})}function Ul(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()){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 xf(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function $l(t,e){return!e.manageMode||!e.marqueeSelect||!e.atSeatRung||t.pointerType==="touch"||t.button!==0?!1:t.shiftKey||e.hitSeatAt(t.local)}function ql(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<se}import{Path as Gm}from"konva/lib/shapes/Path";import{Group as Lf}from"konva/lib/Group";import{Line as Cf}from"konva/lib/shapes/Line";import{Text as Tf}from"konva/lib/shapes/Text";function Zl(t,e,i,n){if(!e||!n)return;let o=jo(e,i);if(!o.length)return;let r=new Lf({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new Cf({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 Tf({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 If=10;function Pf(t){let e=t.framingViewport();if(t.stage.width()>=Q||t.exportMode())return e;let i=If;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 Ql(t){let e=Pf(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=Mf(t);s&&t.setFitScale(Rf);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=ma(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<se?se*.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(),Dn(t.stage,[t.bgLayer,t.seatLayer],e,i)),Af(t,e),t.setFitPose(qe(t.stage))}t.stage.batchDraw()}var Rf=Z*(1-1e-6);function Mf(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Z&&e<Se}function Af(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=_t(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){Dn(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+xi-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function Ht(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,ze*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function jl(t,e,i,n="now"){let o=t.stage.position();rl(t.stage,e,i,Ht(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.updateSeatGroupVisibility(),Ef(t)):t.afterViewChange(),t.stage.batchDraw())}function Ef(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function Jl(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function Ff(t,e,i,n,o=0){sl(t.stage,e,Ht(t),i,Gt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function ec(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){Ff(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Gt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=Ht(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=K(Math.max(d,u),a,Math.max(u,Nt({min:a,max:l},i?.maxScale))),m=o.x+r/2-(n.x+n.width/2)*h,f=o.y+s/2-(n.y+n.height/2)*h,g=t.stage.scaleX(),p=t.stage.x(),b=t.stage.y();if(Math.abs(h-g)<1e-4&&Math.abs(m-p)<.5&&Math.abs(f-b)<.5){t.settleView();return}let y=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let x=w=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let k=Math.min(1,(w-y)/S),v=k<.5?4*k*k*k:1-Math.pow(-2*k+2,3)/2,C=g+(h-g)*v;t.stage.scale({x:C,y:C}),t.stage.position({x:p+(m-p)*v,y:b+(f-b)*v}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),k<1?t.setGlideRaf(requestAnimationFrame(x)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(x))}function Gt(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 _f}from"konva/lib/shapes/Text";function tc(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=Bf(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function Bf(t){let e=1/0,i=new _f({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}):He);continue}let a=me*t.seatLabelScale(s),l=ti(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:He;return H/Math.max(st,r)}function nc(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:ic(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:ic(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function ic(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 no={top:0,right:0,bottom:0,left:0};function oc(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)}:{...no}}var Of=.7;function rc(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,m,f)=>{let g=h+m,p=f*Of;if(g<=p||g<=0)return[h,m];let b=p/g;return[h*b,m*b]},[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 sc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function ac(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 Wt(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function lc(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 oo(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,m=e.width*c+e.height*d,f=e.width*d+e.height*c,g={x:u-m/2,y:h-f/2,width:m,height:f},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:g,fitWidth:p[0],fitHeight:p[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var cc=H,Df=3,Nf=.5;function Hf(t){return X(t,D(t)?"#475569":"#cbd5e1")}function dc(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function Gf(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=cc){let u=t.measure(n.baseFontSize);return i.occupied.insert(dc(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=cc/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*Nf)return{visible:!1,reason:"shape-too-small"};let a=Df/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=dc(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 hc(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=Hf(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=Gf({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);Wf(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function Wf(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 uc(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 ro(t,e,i,n){let o=Vf(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 Vf(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,oi/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 fc(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Ur:Yr}function mc(t){return Math.max(t*1.05,Hr,Z*1.3)}var zf=42;function gc(t){return zf/(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 bc(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 g of r){let p=(g.x-c.x)**2+(g.y-c.y)**2;p<u&&(d=g,u=p)}let h=e/(s*a),m=i/(s*a),f=je(r,0);return{bounds:{x:pc(d.x,h,f.x,f.width),y:pc(d.y,m,f.y,f.height),width:h,height:m},minScale:s}}function pc(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 Xf}from"konva/lib/Shape";var yc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},Kf=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function Sc(t,e){let i=new Map;for(let o of t){if(o.kind==="booth")continue;let r=e.get(o.rowId),s=yc(o);if(!(r&&r>0)||s==null)continue;let a=Kf(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=yc(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 Vt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15}get active(){return this.entries.length>0}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 f of[...e.objects,...(e.floors??[]).flatMap(g=>g.objects)])f.type==="row"&&this.spacing.set(f.id,f.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(f=>f.id===n||f.logicalId===n||d(f)),m=h.map(f=>f.id).join("|");if(!(this.key===m&&this.active)){this.clear(),this.key=m;for(let f of h){if(f.memberIds.length>2e3||f.memberIds.some(b=>!a.has(b)||!this.spacing.has(s.get(b)?.rowId??"")))continue;let g=Sc(f.memberIds.map(b=>s.get(b)).filter(Boolean),this.spacing);if(!g.length||g.reduce((b,y)=>b+y.seats.length,0)!==f.memberIds.length)continue;let p=new Xf({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:b=>{let y=b._context,S=p.getStage(),x=S&&S.width()<=Q?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;y.save(),y.lineWidth=x*2,y.lineCap="round",y.lineJoin="round";let w=k=>{let v=a.get(k.id);return O(String(v.fill()),v.opacity())};for(let k of g){let v=k.points;if(v.length===1){y.fillStyle=w(k.seats[0]),y.beginPath(),y.arc(v[0].x,v[0].y,x,0,Math.PI*2),y.fill();continue}let C=k.seats.map(w),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}},T=v.map((R,M)=>{let E=v[Math.max(0,M-1)],A=v[Math.min(v.length-1,M+1)];return Math.hypot(A.x-E.x,A.y-E.y)>.001?P(E,A):P(v[M],v[M+1]??v[M-1])}),L=(R,M,E)=>({x:R.x+M.x*x*E,y:R.y+M.y*x*E}),I=0;for(;I<v.length;){let R=I;for(;R+1<v.length&&C[R+1]===C[I];)R++;let M=I===0?v[0]:{x:(v[I-1].x+v[I].x)/2,y:(v[I-1].y+v[I].y)/2},E=R===v.length-1?v[R]:{x:(v[R].x+v[R+1].x)/2,y:(v[R].y+v[R+1].y)/2},A=I===0?T[0]:P(v[I-1],v[I]),z=R===v.length-1?T[R]:P(v[R],v[R+1]),W=[M,...v.slice(I,R+1),E],U=[A,...T.slice(I,R+1),z],re=W.map((_,G)=>L(_,U[G],1)),N=W.map((_,G)=>L(_,U[G],-1));y.fillStyle=C[I],y.beginPath(),y.moveTo(re[0].x,re[0].y);for(let _ of re.slice(1))y.lineTo(_.x,_.y);if(R===v.length-1){let _=Math.atan2(z.y,z.x);y.arc(E.x,E.y,x,_,_-Math.PI,!0)}else y.lineTo(N[N.length-1].x,N[N.length-1].y);for(let _ of N.slice(0,-1).reverse())y.lineTo(_.x,_.y);if(I===0){let _=Math.atan2(-A.y,-A.x);y.arc(M.x,M.y,x,_,_-Math.PI,!0)}y.closePath(),y.fill(),I=R+1}}y.restore()}});this.entries.push({section:f,shape:p,opacity:f.liftGroupSeat.opacity(),listening:f.liftGroupSeat.listening()}),f.liftGroupBg.add(p),f.liftGroupSeat.opacity(0),f.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as Yf}from"konva/lib/shapes/Text";var vc=new WeakMap,Uf=(t,e)=>{let i=new Yf({text:t,fontSize:Rt,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function wc(t,e,i,n=Uf){let o=vc.get(t);o||vc.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+H+ee*2+6):0;return s.set(i,c),c}function kc(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 so=1e6;function $f(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function ao(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Oi=class{constructor(e,i=$f()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;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))};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)};this.onTouchStart=e=>{if(!ao(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(so+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(ao(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(so+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!ao(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(so+n.identifier)}}};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)),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(){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)),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<Gr}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){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})?(this.host.beginMarquee(i),this.panLast=null):this.panLast=i;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[s,a]=[...this.pointers.values()],l={x:(s.x+a.x)/2,y:(s.y+a.y)/2},c=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(a.x-s.x,a.y-s.y),startScale:c,worldMid:{x:(l.x-this.host.stage.x())/c,y:(l.y-this.host.stage.y())/c}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=Ae+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.pointers.size>=2&&(this.movedPx=Ae+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>Ae?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=K(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<=Ae)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()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.endTouchProbe(),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 qf}from"konva/lib/shapes/Circle";import{Group as Zf}from"konva/lib/Group";import{Line as Qf}from"konva/lib/shapes/Line";import{Text as jf}from"konva/lib/shapes/Text";var Jf=11,em=.3,tm=.08;function Tc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function im(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 Ic(t,e){return e&&t.available!=null&&t.available<=0}function nm(t,e){return Ic(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function Pc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=nm(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?We*tm:o?We*em:We),e.polygon.listening(!t.exportMode&&!n&&!i&&!Ic(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),om(t,e,o,r,n,t.dimmed(e.categoryKey))}}function om(t,e,i,n,o,r){if(e.capacityNode){let s=im(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}rm(t,e,o||r),n>0&&!o?dm(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var lo=9,xc=.86;function rm(t,e,i){sm(t,e,i),co(e)}function co(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 sm(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=am(e,r),a=Lc(n,e.nameSize??Jt,s.width*xc,r),l=Lc(o,ei,s.width*xc,r),c=a!=null,d=l!=null&&(n?c&&a+l+lo<=s.height:l<=s.height);Cc(n,c?a:null,e.labelPoint.y-lo/r,r),Cc(o,d?l:null,n?e.labelPoint.y+lo/r:e.labelPoint.y,r)}function am(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 Lc(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>=H?r:null}function Cc(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 lm=.72;function cm(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*lm;return{x:n+r,y:o-r}}function dm(t,e,i,n){let o=Jf;if(!e.chip){let a=new Zf({listening:!1});a.add(new qf({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new Qf({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 jf({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=Bt(t.selectionColor),s=e.chip.findOne(".ga-chip-disc");s?.fill(t.selectionColor),s?.stroke(O(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(cm(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function Rc(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 Mc(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 Ac(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(m=>{let f=Y(m.outline);return{x:f.x+f.width/2,y:f.y+f.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(m=>Math.abs(m.x-i.x)<=d&&Math.abs(m.y-i.y)<=u)){let m=c.reduce((f,g)=>{let p=(g.x-i.x)**2+(g.y-i.y)**2;return p<f.distance?{point:g,distance:p}:f},{point:c[0],distance:1/0});s=m.point.x,a=m.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,m=u.y-i.y,f=h*h+m*m;f<d&&(c=u,d=f)}s=c.x,a=c.y}return{x:s,y:a}}function Ec(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||zo(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function hm(t){return t.logicalRowId??t.rowId}function Fc(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(hm(o)!==t||!i(o.id)||n.push(o.id));return n}function _c(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 um}from"konva/lib/shapes/Line";import{Rect as pm}from"konva/lib/shapes/Rect";var Di=class{constructor(e){this.host=e;this.box=null;this.lasso=null}active(){return this.box!==null||this.lasso!==null}begin(e,i){let n=this.host.screenToWorld(e),o=this.host.stageScale()||1,r={stroke:this.host.selectionColor(),strokeWidth:1.5/o,dash:[5/o,4/o],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let s=new um({...r,points:[n.x,n.y],closed:!0,lineJoin:"round"});this.host.overlayLayer().add(s),this.lasso={points:[n],line:s}}else{let s=new pm({...r,x:n.x,y:n.y,width:0,height:0});this.host.overlayLayer().add(s),this.box={start:n,cur:n,rect:s}}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.host.selectMany(Ec(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)})),this.host.selectionChanged();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.host.selectMany(a),this.host.selectionChanged()}};import{Rect as Bc}from"konva/lib/shapes/Rect";import{Text as fm}from"konva/lib/shapes/Text";function Oc(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 b=t.circleById.get(p.id),y=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=p.kind==="booth"?He:me*t.seatLabelScale(p),x=o((y?.fontSize()??S)*e),w=t.worldToScreen(p),k=y?y.width()*i:0,v=y?y.height()*e:0,C=w.x-k/2<0||w.x+k/2>n.width||w.y-v/2<0||w.y+v/2>n.height,P=t.focusedSeatOpacity(p.id,b?.getAbsoluteOpacity()??0),T=t.seatSection.get(p.id),L=!!y?.isVisible()&&P>=.5&&!C,I;L||(P<.5?I="dimmed-or-unavailable":x<H?I="below-minimum-size":C?I="outside-viewport":y?I="renderer-hidden":I=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=b instanceof Bc?b.width()*i:t.seatR*2*e,M=b instanceof Bc?b.height()*e:t.seatR*2*e,E=2*(t.seatR*e+ue),A=b?.fill(),z=y?.fill(),W=t.accessGlyphById.get(p.id),U=W?.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,...T?{sectionId:T.id}:{},...T?.zone?{zoneId:T.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:L,renderedFontPx:x,fill:typeof A=="string"?A:"",ink:typeof z=="string"?z:b?t.seatLabelInk(p,b):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:o(P),...W?{accessibilityMarker:{glyphVisible:W.isVisible(),glyphWidthPx:o(ye*Math.abs(U?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!b?.isVisible()&&!!b?.isListening()&&t.isSelectable(p.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),E))},screenCenter:{x:o(w.x),y:o(w.y)},...L?{screenBox:{x:o(w.x-k/2),y:o(w.y-v/2),width:o(k),height:o(v)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(p=>p.visible).length,l=(p,b,y,S,x,w,k)=>{let v=ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),C=Y(v.map(M=>t.worldToScreen(M))),P=o(S.opacity()),T=S.fill(),L=C.x+C.width<0||C.x>n.width||C.y+C.height<0||C.y>n.height,I=S.isVisible()&&P>.05&&!L,R=w?ut({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:p,kind:b,role:y,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...k==null?{}:{sizeFloorPx:k},opacity:P,fill:x,ink:typeof T=="string"?T:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(C.x),y:o(C.y),width:o(C.width),height:o(C.height)}}:{}}},c=p=>{let b=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof b=="string"&&b)return b;let y=p.blockPoly.fill();return typeof y=="string"?y:p.baseFill},d=p=>{let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},u=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,At(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,ui(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,b])=>{let y=b.points.map(L=>t.worldToScreen(L)),S=Math.min(...y.map(L=>L.x)),x=Math.min(...y.map(L=>L.y)),w=Math.max(...y.map(L=>L.x)),k=Math.max(...y.map(L=>L.y)),v=w<0||S>n.width||k<0||x>n.height,C=o(b.polygon.opacity()),P=C>=.1&&!v,T=b.polygon.fill();return{areaId:p,label:b.label,capacity:b.capacity,categoryKey:b.categoryKey,...b.sectionId?{sectionId:b.sectionId}:{},visible:P,interactive:b.polygon.listening(),opacity:C,fill:typeof T=="string"?T:"",effectiveBackground:b.effectiveBackground,...P?{screenBox:{x:o(S),y:o(x),width:o(w-S),height:o(k-x)}}:{}}}),m=[...t.freeTextById].map(([p,b])=>{let{node:y,kind:S}=b,x=b.plate&&b.plate.opacity()>.05?b.plate.fill():null,w=typeof x=="string"&&x?x:b.background,k=t.worldToScreen({x:y.x(),y:y.y()}),v=y.width()*i,C=y.height()*e,P=k.x-y.offsetX()*i,T=k.y-y.offsetY()*e,L=o(y.fontSize()*e),I=P+v<0||P>n.width||T+C<0||T>n.height,R=y.isVisible()&&!I,M=y.fill(),E=o(y.getAbsoluteOpacity()),A;return R||(L<H?A="below-minimum-size":I?A="outside-viewport":A="renderer-hidden"),{objectId:b.objectId??p,kind:S,text:y.text(),visible:R,renderedFontPx:L,ink:typeof M=="string"?M:"",background:w,opacity:E,...R?{screenBox:{x:o(P),y:o(T),width:o(v),height:o(C)}}:{},...A?{hiddenReason:A}:{}}}),f=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof fm).map(p=>{let b=p.getClientRect({skipShadow:!0,skipStroke:!0}),y=b.x+b.width<0||b.x>n.width||b.y+b.height<0||b.y>n.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!y,renderedFontPx:o(p.fontSize()*e),ink:typeof S=="string"?S:"",...y?{}:{screenBox:{x:o(b.x),y:o(b.y),width:o(b.width),height:o(b.height)}}}}),g=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:H,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((p,b)=>p+b.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:g.length,categoryPaintedSectionShells:g.filter(p=>{let b=p.blockPoly.fill();return typeof b!="string"||!wn(t.canvasBackground,b)}).length,tintedSectionShells:g.filter(p=>{let b=p.blockPoly.fill();return typeof b=="string"&&Ms(t.canvasBackground,b)}).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:m,rowLabels:f}}import{Circle as Lm}from"konva/lib/shapes/Circle";import{Ellipse as Cm}from"konva/lib/shapes/Ellipse";import{Line as Tm}from"konva/lib/shapes/Line";import{Arrow as Im}from"konva/lib/shapes/Arrow";import{Path as Pm}from"konva/lib/shapes/Path";import{Rect as zt}from"konva/lib/shapes/Rect";import{Text as po}from"konva/lib/shapes/Text";import{Image as Vc}from"konva/lib/shapes/Image";import{Group as Dc}from"konva/lib/Group";import{Circle as mm}from"konva/lib/shapes/Circle";import{Path as gm}from"konva/lib/shapes/Path";function bm(t,e){let i=e?.trim();return i&&i.toLowerCase()!==xr?i:Pt[t.group]}var Nc=new WeakMap;function Ni(t){let{icon:e,size:i}=t,n=bm(e,t.color),o=D(n)&&n!==Pt[e.group]?ur:li,r=D(t.background)?0:i*dn.ringRatio,s=t.listening??!1,a=new Dc({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new mm({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:pr,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*dn.glyphScale,c=new gm({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/hn,scaleY:l/hn,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),Nc.set(a,{glyph:c,icon:e}),a}function ho(t,e,i){let n=t instanceof Dc?Nc.get(t):void 0;if(n?.icon.solidLarge){let o=wr(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function Hc(t,e,i){let n=ci("wheelchair"),o=Ir(t);if(!n||!o)return null;let r=Tr(e),s=Ni({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 ym}from"konva/lib/Group";import{Path as Sm}from"konva/lib/shapes/Path";import{Rect as vm}from"konva/lib/shapes/Rect";import{Text as wm}from"konva/lib/shapes/Text";function km(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function xm(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=li,c=new wm({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?kr("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,m=u+h+c.width(),f=Math.max(o,m+n),g=new ym({name:"gate-sign",x:r,y:s,rotation:km(t.rotation??0),listening:i.hitTarget===!0});g.add(new vm({name:"gate-sign-pill",x:-f/2,y:-n/2,width:f,height:n,cornerRadius:n/2,fill:t.fill??Pt.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=-m/2;return d&&(g.add(new Sm({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}),g.add(c),g.setAttr("gateSignHeight",n),{group:g,fontSize:a,bounds:{x:r-f/2,y:s-n/2,width:f,height:n}}}function Gc(t,e){if(e.gate.hideFromBuyers)return;let i=xm(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 zc(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 Vc({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 Kc(t,e){let i=new window.Image,n=new Vc({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:K(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(Y(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 Xc(t,e){let i=e.fill??t.theme.decorFill??Wn,n=ce(i,.12);if(e.shape==="round")t.bgLayer.add(new Lm({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 zt({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(!Ct(e))return;let o=Kt(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,X(i,t.theme.textColor??"#cbd5e1"),Ge(e)??dr,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var Rm=8,Mm=6;function Am(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(Rm,e*.35),o=Math.max(Mm,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function Yc(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??X(i,t.theme.textColor??Xa),o=e.semanticKind==="icon"?ci(e.iconKey):void 0;if(o){let d=Ni({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=$o(e),l=new po({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Vn(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 zt({x:e.position.x,y:e.position.y,...Am(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 Uc(t,e){if(Mr(e)){Gc(t,e);return}let i=e.fill??t.theme.decorFill??Wn,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=Uo(e),a=ae(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?ce(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?K(e.opacity,.1,1):1,m=0,f=0,g=null;if(c&&e.points&&e.points.length>=2){m=e.points.reduce((w,k)=>w+k.x,0)/e.points.length,f=e.points.reduce((w,k)=>w+k.y,0)/e.points.length;let p=Pr(e),b=Rr(u),y=Lr(e),S=new Im({points:e.points.flatMap(w=>[w.x,w.y]),closed:!1,x:m,y:f,offsetX:m,offsetY:f,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",...b,listening:!1,name:"buyer-shape-open-path",...y?{dash:Cr(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let x=y?Hc(e,u,t.canvasBackground):null;x&&t.bgLayer.add(x)}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,Ne(l,.3),1,ce(l,.12)]}:{fill:l};m=e.x+e.width/2,f=e.y+e.height/2,g={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new zt({x:m,y:f,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:u,cornerRadius:K(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){m=e.x+e.width/2,f=e.y+e.height/2,g={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,Ne(l,.3),1,ce(l,.12)]}:{fill:l};t.bgLayer.add(new Cm({x:m,y:f,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=No(e),b=Y(p);m=e.points.reduce((x,w)=>x+w.x,0)/e.points.length,f=e.points.reduce((x,w)=>x+w.y,0)/e.points.length,g=b;let y=n?{fillLinearGradientStartPoint:{x:0,y:b.y},fillLinearGradientEndPoint:{x:0,y:b.y+b.height},fillLinearGradientColorStops:[0,Ne(l,.3),1,ce(l,.12)]}:{fill:l},S=Be(p,Ho(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},Do(e)??void 0);S.setAttrs({x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,...y}),t.bgLayer.add(S)}g&&e.role&&t.landmarkBoxes.push(g);for(let p of Vo(e))t.bgLayer.add(new Tm({points:p.points.flatMap(b=>[b.x,b.y]),closed:p.closed,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,stroke:p.ink??Wo,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:b}=Fm(t,m,f,e.label,l,g,e.labelStyle);t.primaryFocalLabels.set(p,b),t.freeTextById.set(e.id,{node:p,background:l,plate:b.plate,kind:"stage"})}else if(r){let p=o||s,b=X(l,p?"#e6e9f0":"#9aa3b5"),y=Kt(t,t.bgLayer,e.label,m,f,b,p?18:12,!1);p&&t.primaryFocalLabels.set(y,{targetPx:18,trackingRatio:0,ink:String(y.fill()??""),plateInk:String(y.fill()??""),plate:new zt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:y,background:l,kind:"decor",...p?{}:{area:oo(e.rotation,g,m,f,12,b,l)}})}else{let p=X(l,"#cbd5e1"),b=Kt(t,t.bgLayer,e.label,m,f,p,16,!0);t.freeTextById.set(e.id,{node:b,background:l,kind:"decor",area:oo(e.rotation,g,m,f,16,p,l)})}}var uo=22,Wc=H,Hi=6,Em=.5;function Fm(t,e,i,n,o,r,s){let a=s?.size??uo,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=_m(t.canvasBackground,o),m=new zt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new po({x:d,y:u,text:n,fontSize:a,fontStyle:Vn(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/uo),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f),{node:f,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/uo,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??X(h,l),plate:m}}}function _m(t,e){return j(e,D(t)?"#ffffff":"#000000",.34)}function $c(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(Wc,e.targetPx*Em)*s)/r,c=b=>{t.letterSpacing(b*e.trackingRatio),n(t,b)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=Fo(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-Hi*2,height:(u?d.width:d.height)-Hi*2},m=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(m<1&&(l=Math.max(Wc/r,l*m),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let g=(u?t.height():t.width())+Hi*2,p=(u?t.width():t.height())+Hi;e.plate.size({width:g,height:p}),e.plate.offset({x:g/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function qc(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=fr(i,n,We),r=t.theme.textColor??"#e6e9f0",s=X(o,r),a=Be(e.points,e.holes,{fill:i,opacity:We,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",g=>{t.isGhostClick(g)||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=qt(e.points,e.holes),c=t.sections.find(g=>te(l,g.outline,g.holes)),d=Ge(e)??Jt,u=Ct(e)?Kt(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Kt(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,ei,!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 m=xt(e)>0?new Pm({data:nt(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;m&&t.bgLayer.add(m);let f={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:i,labelPoint:l,labelNode:u,...Ge(e)!==void 0?{nameSize:d}:{},capacityNode:h,...m?{wheelchairGlyph:m}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,f),co(f)}function Kt(t,e,i,n,o,r,s,a){let l=new po({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 Zc(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 m=d.segmentedRow&&!u?d.segmentedRow.groupId:d.id,f=(o.get(m)??[]).slice().sort((E,A)=>s(E)-s(A));if(!f.length)continue;let g=f[0],p=f[f.length-1],b=h?.labelStyle,y=h?.style==="pill"?Ot(n):null,S=y?y.plate:n,x=he(S,b?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Ve),w=b?.size??cr,k=h?.rotation??0,v=e.objectFilteredOut(d)?.15:1,C=f.reduce((E,A)=>E??e.seatSection.get(A.id),void 0),T=d.segmentedRow?.displayLabel??d.displayLabel??It(d.label,C?.label);if(!T)continue;let L=C?[...new Set([C.id,C.logicalId,C.zone].filter(E=>!!E))]:void 0,I=(E,A,z)=>i.push({text:T,x:E,y:A,rotation:k,fontSize:w,ink:x,opacity:v,rowKey:m,...y?{pill:y}:{},...L?.length?{focusKeys:L}:{},...z?{automaticAway:z}:{}});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 E=d.rotation*Math.PI/180,A={x:-Math.cos(E),y:-Math.sin(E)};I(g.x+A.x*R,g.y+A.y*R,A)}if(M==="end"||M==="both"){let E=(d.rotation+d.curve)*Math.PI/180,A={x:Math.cos(E),y:Math.sin(E)};I(p.x+A.x*R,p.y+A.y*R,A)}}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(m=>Math.hypot(m.x-d.x,m.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 fo(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 Qc(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 m=a*h;l.push({x:s.x*m,y:s.y*m},{x:-s.x*m,y:-s.y*m},{x:r.x*m,y:r.y*m},{x:(r.x+s.x)*m,y:(r.y+s.y)*m},{x:(r.x-s.x)*m,y:(r.y-s.y)*m})}let c=o,d=1/0,u=1/0;for(let h of l){let m={x:o.x+h.x,y:o.y+h.y},f=fo(t,m),p=(n?rt(n,f,{mode:"overlap"}).length:0)+i.collisionCount(f),b=Math.hypot(h.x,h.y);if((p<d||p===d&&b<u)&&(c=m,d=p,u=b),p===0)break}return c}var Gi=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 jc(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 Jc(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 Bm(t){return t<0?0:t>1?1:t}function ed(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)}},m=()=>{a||s||(a=!0,u(),t.done())},f=p=>{for(let b=c.length-1;b>=0;b--){let y=c[b],S=n?1:Bm((p-y.startedAt)/160);t.fade(y.work,S),S>=1&&c.splice(b,1)}return c.length>0},g=()=>{if(s)return;let p=e(),b=p;for(;r<t.chunks.length&&(r===0||e()-b<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()-b>=i)break}let y=f(p);t.draw(),r<t.chunks.length||y?h(g):m()};return h(g),{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(),m()}},get done(){return a}}}var Om={width:40,height:30,rotation:0};function td(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)??Om;if(l.points&&l.points.length>=3){for(let f of l.points)s.x+f.x<i&&(i=s.x+f.x),s.y+f.y<n&&(n=s.y+f.y),s.x+f.x>o&&(o=s.x+f.x),s.y+f.y>r&&(r=s.y+f.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)),m=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-m<n&&(n=s.y-m),s.x+h>o&&(o=s.x+h),s.y+m>r&&(r=s.y+m);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 id(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 nd=!1;function od(t){return t&&t!=="flat"&&!nd&&(nd=!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 sd(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 ad}from"konva/lib/Group";import{Rect as Dm}from"konva/lib/shapes/Rect";import{Text as mo}from"konva/lib/shapes/Text";function ld(t,e){let i=qt(e.outline,e.holes),n=ae(t.canvasBackground),o=[],r=new Map,s=0,a=Y(e.outline),l=t.seatIndex?rt(t.seatIndex,a).map(L=>t.seatById.get(L)).filter(L=>!!L):t.seats;for(let L of l)t.seatSection.has(L.id)||te(L,e.outline,e.holes)&&(o.push(L.id),r.set(L.categoryKey,(r.get(L.categoryKey)??0)+1),(t.statusById.get(L.id)??"free")==="free"&&s++);let c=e.color??jt([...r].map(([L,I])=>({hex:t.catColor.get(L)??"#6e7bff",w:I})),"#3a4358"),d=new ad({listening:!1});t.bgLayer.add(d);let u=new ad({listening:!1});d.add(u);let h=new gt({listening:!0});t.seatLayer.add(h);let m=u,f=sd(t.chartDoc,e),g=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",p=Be(e.outline,f.holes,{visible:!f.hidden,stroke:O(g,.5),strokeWidth:1,fill:O(g,.08),listening:!1},e.outlinePath);m.add(p);let b=Be(e.outline,f.holes,{visible:!f.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:Ke,opacity:0,listening:!1},e.outlinePath);m.add(b);let y=e.labelPresentation?.labelStyle,S=y?.color,x=n.sectionInk,w=(y?.size??18)/18,k=new Dm({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});m.add(k);let v=new mo({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:Xe,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,x),listening:!1,perfectDrawEnabled:!1});v.offsetX(v.width()/2),v.offsetY(v.height()/2),m.add(v);let C=new mo({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Xe,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,x),opacity:0,listening:!1,perfectDrawEnabled:!1});m.add(C);let P=new mo({x:i.x,y:i.y,text:F("map.seatsLeft",{count:s}),fontSize:12,fontStyle:ls,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),m.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]:[],...Ma(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(L=>t.seatById.get(L)?.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:Oo(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:g,outlinePoly:p,blockPoly:b,namePlate:k,nameLabel:v,numberLabel:C,subLabel:P,preferredInk:x,...S?{explicitInk:S}:{},labelScale:w,authoredLabelSize:y?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function dd(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=$n(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:bt(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};Un({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 bt(t){let e=gc(Math.max(t.seatR,t.markerR));return Math.max(e,Za(t.markerR))}var cd=.25;function Nm(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*cd/Math.max(i.width,1e-6),n.height*cd/Math.max(i.height,1e-6))}function hd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=ud(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 Un({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:bt(t)}),!0}function ud(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Te(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function pd(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&&Te(s,n)==="match"});return o.length&&go(t,o)||t.focusSection(e),!0}function fd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=ud(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*Dt&&r.height>=s.height*Dt;return{spaces:n.length,sections:yo(t,i),wholeVenue:a}}function go(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*Dt&&r.height>=s.height*Dt)return!1;let a=$n(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=Nm(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(bt(t),u),d)}),!0}function md(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:bt(t),focusPaddingPx:l})}function bo(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 gl(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function yo(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?bo(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 Wm=1800,Yt=class Yt{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=zn;this.effSelection=pt;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;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 Ai;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=fc();this.fitScale=1;this.fitPose="";this.viewportInsets={...no};this.fitClearance={bottom:0,width:0};this.seatR=J;this.markerR=J;this.seatPitch=0;this.sellableUnit=Yn(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 Gi;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.readingFocusedFrame=!1;this.marquee=new Di({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,isSelectable:e=>this.isSelectable(e),selectMany: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.interactionHostCache=null;this.seatLabelTargetScale=tc(()=>({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=Wi.pixelRatio;if(this.exportMode&&(this.dpr=1),Wi.pixelRatio=this.dpr,this.stage=new Hm({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Oi(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 So({listening:!this.exportMode}),this.seatLayer=new So({listening:!this.exportMode}),this.overlayLayer=new So({listening:!1}),this.labelGroup=new Xt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new Xt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new Xt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Ri({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:()=>el(this.sellableUnit),pickableScale:()=>Pi(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 bd({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:io,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new bd({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&&(Wi.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&Jc(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 Vt: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 vi({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 wi({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 Ci({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})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new ki({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Bt(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(ua({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 Li({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=>$l(e,{manageMode:this.opts.manageMode===!0,atSeatRung:this.getRung()==="seats",marqueeSelect:this.opts.marqueeSelect===!0,hitSeatAt:i=>this.sectionAt(i)!==null||this.nearestSeatToScreen(i,ue,!0)!==null}),beginMarquee:e=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box"),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.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Vt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??Zt(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 Xt({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=ai(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,bi[l%bi.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=uc(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}))}:{},...Ct(a)?{}:{nameHidden:!0},...Ge(a)?{nameSize:Ge(a)}:{}});if(this.seats=De(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===e?this.seats:De(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=vr(this.seats,{seatRadius:this.seatR}),this.seatPitch=$a(this.seats),this.markerR=qa(this.seatR,this.seatPitch),this.sellableUnit=Ja(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=Yo(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new Xt({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?td(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),Zl(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=id({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=ed({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:kt(e)};if(this.floorOverview&&e.floors.length>=2)return tt(e)==="combined"?Qo(e):Zo(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...Xo(e),referenceImage:void 0,backgroundImage:kt(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:kt(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?Zt(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?Zt(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=jt([...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;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=Vl({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&&zl(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];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=[];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)}return 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;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<=Xr;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)}return 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 _c(e,i)}selectRow(e){let i=Fc(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&&Rl(this.flashHost,n,i)}flashSection(e,i="#22a06b"){Ml(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),m=u+h*2.5;m<s&&(s=m,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()},Wm)),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=oc(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 rc(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){return nc(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return lc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){Ql(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(tl(this.sellableUnit),this.hasSections?we: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},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 sc(this.stage)}setCameraPose(e){this.cancelGlide(),ac(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()*Yt.ZOOM_STEP,Wt(this.framingViewport()))}zoomOut(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()/Yt.ZOOM_STEP,Wt(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);al(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(){Pc({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=>Tc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Z,effScale:()=>this.effScale(),labelLegible:e=>be(e,this.effScale())})}setGAStates(e){Rc(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){dd(this.focusFramingContext,e,i)}diveCeiling(){return bt(this.focusFramingContext)}focusAccessibleSeats(e){return hd(this.focusFramingContext,e)}focusAccessibleSection(e,i){return pd(this.focusFramingContext,e,i)}accessibleSpread(e){return fd(this.focusFramingContext,e)}setViewMode(e){od(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.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:Le)}sectionScreenBounds(e){return Aa({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Z,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 Wa([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 Ti(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){il({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()});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 Gm({x:e.x,y:e.y,data:nt(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:ni(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return kc(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)?Nr:Dr,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&&Ce(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.colorblind?this.cbHueByKey.get(e)??bi[0]:this.catColor.get(e)??"#6e7bff":Ta}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 he(typeof n=="string"?n:"",e.labelStyle?.color,this.theme.seatLabelColor??Qe,Ve)}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){Kl(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){if(e!==this.colorblind){this.colorblind=e,this.repaintSeats();for(let i of this.sections)i.shellCategoryColor=this.dominantSellableColor(i.memberIds),this.refreshSectionFill(i);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 go(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}}md(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()>=Q}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()>=se}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()>=Pi(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=Al(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=El(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),m=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:n+s*m,y:o+a*m}),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){Ia(this.readingAidsHost,e)}setLabelLayers(e){Pa(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Ra(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=kt(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){zc(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){Kc(this.objectDrawContext,e)}renderTable(e){Xc(this.objectDrawContext,e)}renderText(e){Yc(this.objectDrawContext,e)}renderShape(e){Uc(this.objectDrawContext,e)}renderGA(e){qc(this.objectDrawContext,e)}renderSection(e){let i=ld(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){ml(this.sectionLodPaintContext,e)}refreshSectionFill(e){bl(this.sectionLodPaintContext,e)}isSectionClosed(e){return Zn(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Ts(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return bo(this.focusFramingContext,e)}accessibleSections(e){return yo(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,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){Na({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)||_i(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)||ro(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?i.some(n=>!this.isSectionClosed(n)&&n.free>0?!0:n.memberIds.some(o=>this.selection.has(o)||this.ownedHold.has(o))):!0}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?Te(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?sn(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let n=sn(getComputedStyle(i).backgroundColor);if(n)return n;i=i.parentElement}}return zn}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:D(this.canvasBackground)?Ka: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.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return Oa({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(),Gt(this.framingViewport(),this.focusedRowLabelGutter(e))),Nt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return wc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return ol(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return nl(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(){Yl(this.interactionHost)}handleSeatTap(e){Ul(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(),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=>Ha({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=>ro(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),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):Wt(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,onDeckTap:this.opts.onDeckTap}}zoomBounds(){return Ht(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),jl(this.cameraHost,e,i,n)}cancelZoomSettle(){Jl(this.cameraHost)}focusRegion(e,i){ec(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(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Z?"seats":this.zones.length&&e<ze?"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),Oc(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let i=e==="sections"?(ve+Z)/2:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),n=this.framingViewport(),o=n.width,r=n.height,s=Wt(this.framingWorldRect()),{x:a,y:l}=Ac({rung:e,sections:this.sections,seats:this.seats,viewCentre:s,target:i,width:o,height:r}),c=o/(i*1.12),d=r/(i*1.12);this.focusRegion({x:a-c/2,y:l-d/2,width:c,height:d})}seatRungScale(){return mc(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Gt(this.framingViewport(),o);return bc({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(Z,this.sectionFrameScale(this.focusedSectionId)*.85)||ql({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()<Z))return;let o=(i&&e?this.sectionAt(e):null)??Ea({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()},Kr))}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(),we+.01,ie):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)$c(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(kl(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Z,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Z),()=>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=Os(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<Z;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),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;this.updateSeatGroupVisibility();let e=K(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(){jc(Wi,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Z?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,H/e))}let c=r==="detail"&&!this.exportMode&&e<ve,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,ys/Math.max(i.fontSize()*e,1e-6));i.scale({x:u,y:u}),n?.scale({x:u,y:u})}}hc({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(ho(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.rowLabelPlan=Zc(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 fo(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return Qc(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(){ja(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(),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=Mc({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)}};Yt.ZOOM_STEP=1.4;var vo=Yt;function yd(t,e){return new vo(t,e)}function Vm(t,e){return t*2*.6*e>=6}function zm(t,e){t._sceneFunc(e)}function wo(t){let e=this,i=e.attrs;zm(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Vm(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 Sd(t){return t.attrs.sceneFunc===wo}function vd(t){Sd(t)&&t.setAttr("sceneFunc",void 0)}function Km(t,e,i,n){if(!e){vd(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==wo&&t.setAttr("sceneFunc",wo)}function wd(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 ko(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=Cd(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function kd(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 xd(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 Ld(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Cd(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 Cd(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 Td(t,e){return t.accessFilter?Te(e,t.accessFilter)==="other":!1}function Id(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=Xm(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&&ko(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function Xm(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 Pd(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(Qt(t).map(h=>[h.id,h])),c=nr(t),d=it(t),u=si(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 m=l.get(h.rowId),f=m&&"label"in m&&typeof m.label=="string"?m.label:void 0,g=m?.type==="row"?m.segmentedRow:void 0,p=g?.displayLabel??(m&&"displayLabel"in m&&typeof m.displayLabel=="string"&&m.displayLabel?m.displayLabel:f),b=i.get(h.rowId),y=m?.type==="table"?"table":m?.type==="booth"?"booth":"seat",S=p,x=g?.displayType?.trim()||(m&&"displayType"in m&&typeof m.displayType=="string"&&m.displayType.trim()?m.displayType.trim():void 0),w=h.displayLabel??h.label,k=w.split("-"),v=b||h.kind==="booth"?void 0:p&&w.startsWith(`${p}-`)?w.slice(p.length+1):k[k.length-1]??w;s.set(h.id,{objectId:h.rowId,objectType:y,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:v,...x?{displayType:x,rowType:x}:{},...Ym(m,h.sectionId?d.get(h.sectionId):void 0),...m?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function Ym(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 Rd(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 Md(t,e,i,n=1){let o=or(t),r=it(t);return Lt(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)),...Um(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function Um(t,e,i){let n=tn(t,i),o=nn(t,i),r=xt(t),s=i===2&&n.length===1&&n[0]===t.label?Ji(t):null;if(s){let{min:l,max:c}=en(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 Ad(t,e,i){let n=Math.floor(e),o=tn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?Ji(t):null;if(r){let{min:d,max:u}=en(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!xt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=nn(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 $m(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 Ed(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?$m(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 Fd(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 qm(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function _d(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=qm(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?_o.filter(r=>n.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var hC=5e3,uC={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Zm(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 Bd(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!Zm(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 pC(t){return t.lost.length>0||t.holdLapsed}function fC(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function Od(t,e,i=Date.now()){return e&&i<t+5e3}function Dd(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 Nd(t){if(!t?.zones?.length)return[];let e=new Set(rr(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 Hd(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=De(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&&!Ce(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=Fr(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 xo=["background","rowLabelColor","textColor","selectionColor"];function Gd(t,e){return!t||!e?!t&&!e:xo.every(i=>t[i]===e[i])}function yt(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Vi(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Wd(t,e,i){let n=Jo(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}var Re=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function Lo(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function Vd(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var zi=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 zd(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 Re(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let u=r.find(f=>f.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),m=h?t.toSeat(h):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),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 Kd(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 Xd(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 Yd(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 Re(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),m=h?t.toSeat(h):null;return{label:u,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),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}=yt(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let m=new Set(u.map(p=>p.label)),f=t.idsForLabels(m);f.length&&(o.setStatus(f,"booked"),o.deselect(f),t.resetTableQuantitiesForLabels(m));let g=r.filter(p=>!m.has(p));g.length&&a&&t.api.release(t.key,g,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 Ud(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 $d(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 qd(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function Zd(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 Qd(t,e){let{status:i,conflicts:n}=yt(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 jd(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 Jd(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function eh(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(Od(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function th(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function ih(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 jm(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Jm(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=>jm(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function nh(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")&&Jm(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 oh(t){let{id:e,doc:i,seatById:n,groupedTableBySeatId:o}=t,r=k=>k.type==="section"&&(k.id===e||k.logicalSectionId===e),s=i.floors?.find(k=>k.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,m=0;for(let k of l){let v=n.get(k);if(!v)continue;t.matchesAccessFilter&&t.statusOf(k)==="free"&&t.matchesAccessFilter(v)&&(m+=1);let C=o.get(k);if(C){if(u.has(C.label))continue;u.add(C.label),c.set(C.categoryKey,(c.get(C.categoryKey)??0)+C.maxOccupancy),t.statusOf(C.chairs[0]?.id??k)==="free"&&(h+=C.maxOccupancy,d.set(C.categoryKey,(d.get(C.categoryKey)??0)+C.maxOccupancy))}else c.set(v.categoryKey,(c.get(v.categoryKey)??0)+1),t.statusOf(k)==="free"&&(h++,d.set(v.categoryKey,(d.get(v.categoryKey)??0)+1))}let f=[...c.entries()].map(([k,v])=>{let C=i.categories.find(R=>R.key===k),P=C?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],T=P.length?P:typeof C?.price=="number"&&Number.isFinite(C.price)?[C.price]:[],L=T.length?Math.min(...T):void 0,I=T.length?Math.max(...T):void 0;return{key:k,count:v,label:C?.label??k,color:C?.color??"#6e7bff",...L!==void 0?{price:L,priceMin:L,priceMax:I}:{}}}).sort((k,v)=>(k.priceMin??1/0)-(v.priceMin??1/0)||k.key.localeCompare(v.key)),g=f.flatMap(k=>k.priceMin===void 0?[]:[k.priceMin]),p=f.flatMap(k=>k.priceMax===void 0?[]:[k.priceMax]),b=a.zone?i.zones?.find(k=>k.id===a.zone):void 0,y=k=>{let v=null,C=0;for(let[P,T]of k)(T>C||T===C&&v!=null&&P<v)&&(v=P,C=T);return v},S=y(d)??y(c),w=(S?f.find(k=>k.key===S)?.color:void 0)??b?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:m}:{},label:a.displayLabel??a.label,zoneLabel:b?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:w,seatsLeft:h,...g.length?{priceMin:Math.min(...g),priceMax:Math.max(...p)}:{},categories:f}}var Ki=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 sh(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 ng=!0,og=!0,rg=10,sg=15e3,ah=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new zi;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 Ki;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=th(e.numberOfPlacesToSelect);let i=ih(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,rg);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=sr(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let n of xo){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return Gd(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=Lt(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=L=>Math.round((performance.now()-L)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(L=>({ok:!0,res:L,elapsed:o(r)}),L=>({ok:!1,error:L,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(L=>({ok:!0,objects:L,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=Vd(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 L=_r(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(L.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(L.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(L.flatMap(I=>I.chairs.map(R=>[R.id,I]))),this.tableQuantities=new Map(L.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=L.reduce((I,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(L){return this.emitError(L),null}this.expandedSeats=De(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=Pd(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 L of this.groupedTablesByLabel.values()){let I=L.chairs[0];I&&(this.labelToId.set(L.label,I.id),this.labelToSeat.set(L.label,I))}n.normalizeBuyerModel=o(u);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let f=performance.now(),g=yd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(i),this.opts.onSeatsRevealed?.()},onSelect:L=>{this.handleRendererSelect(L)},onDeselect:L=>{this.handleRendererDeselect(L)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(L,I)=>{this.opts.onHover?.(L),this.opts.onSeatHover&&this.opts.onSeatHover(L?this.describeSeat(L,I):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(L,I)=>this.previewSection(L,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:L=>this.opts.onSectionFocus?.(L==null||this.isSectionClosed(L)?null:this.sectionSummary(L)),onDeckTap:L=>this.handleDeckTap(L),onFps:this.opts.onFps});if(n.createRenderer=o(f),this.closed)return g.destroy(),null;this.renderer=g,this.viewportInsets&&g.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&g.setFitClearance?.(this.fitClearance);let p=null,b="free",y=[],S,x=await l;if(x.ok){let L=x.objects;this.hidden=new Set(L.hidden??[]),y=(L.closed??[]).filter(I=>typeof I=="string"),p=L.seats,b=L.default??"free",S=typeof L.fetchedAt=="number"?L.fetchedAt:void 0}if(n.loadStatuses=x.elapsed,this.closed)return g.destroy(),this.renderer=null,null;let w=performance.now();this.opts.categoryPriceRanges&&g.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),g.setChart(this.visibleDoc()),this.applyRowBandPreview(g),Wd(g,d.doc,e.clientWidth),this.opts.colorblindSafe&&g.setColorblindSafe?.(!0),n.buildScene=o(w),this.closedSections=new Set(y);let k=performance.now();y.length&&g.setClosedSections?.(y),this.seatsBuilt=!0;let v=this.pendingSnapshot;this.pendingSnapshot=null;let C=sh(v,p?{seats:p,default:b,fetchedAt:S}:null);C&&this.applySeatsMap(C.seats,C.default,C.source,C.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(k);let P=performance.now();g.forceDraw(),n.firstPaint=o(P);let T=performance.now();return x.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(T),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Lo(d.event.status),eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:m,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 Re(pn(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 nh(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&&un(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 ng&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(og||!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 Re(pn([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 zd(this,e,i)}resumeHold(e){return Kd(this,e)}extendHold(e){return Xd(this,e)}categoryAvailability(){return Fd({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?Md(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Ed(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=Lt(o).find(d=>d.id===e);if(!r)return null;let s=Ad(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 Nd(this.visibleDoc())}pickPremiumBlock(e,i,n){return Hd({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}=yt(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}=yt(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return Yd(this,e,i,n)}release(){return Ud(this)}releaseLabels(e){return $d(this,e)}releaseConfirmed(e,i){return qd(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 ai(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){wd(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 ko(this.pickerFocusContext,e)}accessibilitySpread(e){return kd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Ld(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Td(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){Id(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);xd(this.pickerFocusContext,e,n,i),this.opts.onSectionFocus?.(n)}sectionSummary(e){return!this.renderer||!this._doc?null:oh({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=>Ce(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=>di(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=Ar(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?di(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 di(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 Er(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?un(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 Zd(this,e)}handle409Conflicts(e){Qd(this,e)}setHold(e,i="created"){jd(this,e,i)}clearHold(){Jd(this)}expireActiveHold(){return eh(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=Vi(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[Vi(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=Bd({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 _d(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=Dd(()=>{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=Vi(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=Rd(e,{baseMs:1e3,maxMs:sg,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var ag=5,lg=-1.1,Co=35;function To(t,e){let i=t-Me,n=Math.atan2(ag-i,e)*180/Math.PI,o=Math.atan2(lg-i,e)*180/Math.PI;return o<-Co&&(n+=-Co-o,o=-Co),{topPitch:n,basePitch:o}}var ne=2048,ke=1024,$t=Go,B=Math.PI*2,cg=ke/180,vt=t=>(t+180)/360*ne,q=t=>(90-t)/180*ke;function uh(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 ph(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 Xi=96,Ro=360/Xi,dg=.6,Io=[17,23,42];function Po(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(Io[0]-t[0])*n),r=Math.round(t[1]+(Io[1]-t[1])*n),s=Math.round(t[2]+(Io[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function lh(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 le(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 ch=new Map;function dh(t){if(!t)return null;let e=ch.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=le(n,.3,.42);return ch.set(t,o),o}function hg(t,e,i,n){let o=new Array(Xi).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)*$t;if(u<1.5||u>95)continue;let h=a.eyeHeightM??Me,m=h-n;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,u)*180/Math.PI,g=Math.atan2(h-Me-n,u)*180/Math.PI,b=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,y=Math.min(Xi-1,Math.max(0,Math.floor((b+180)/Ro))),S=f>34&&u<16,x=o[y];x?(f>x.top&&(x.top=f),g<x.base&&(x.base=g),u<x.nearM&&(x.nearM=u,x.tint=dh(a.categoryKey)),x.overhead=x.overhead||S):o[y]={top:f,base:g,nearM:u,overhead:S,tint:dh(a.categoryKey)}}return{bins:o,maxDelta:r}}function ug(t,e,i,n){for(let o=0;o<Xi;o++){let r=e[o];if(!r)continue;let s=-180+o*Ro,a=i(s),l=i(s+Ro);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 m=r.nearM/95,f=r.tint,g=f?lh([44,54,80],f,.34):[44,54,80],p=f?lh([24,30,48],f,.28):[24,30,48],b=t.createLinearGradient(0,u,0,h);b.addColorStop(0,Po(g,m)),b.addColorStop(.24,Po(p,m)),b.addColorStop(1,Po([10,13,22],m)),t.fillStyle=b,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,n(0))-u;if(S>8){let w=1-m*.4;for(let k=1;k<6;k++){let v=u+S*k/6;t.fillStyle=`rgba(0,0,0,${.16*w})`,t.fillRect(a,v,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*w})`,t.fillRect(a,v+1.5,l-a+1,1.2)}}if(r.overhead){let x=n(Math.min(86,c+12)),w=t.createLinearGradient(0,x,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,x,l-a+1,u-x),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function pg(t,e,i){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let b of i){a++,b.sectionId&&s.add(b.sectionId);let y=b.x-e.x,S=b.y-e.y,x=Math.hypot(y,S)*$t;if(x<.5)continue;let w=Math.atan2(y,-S),k=Math.floor((w+Math.PI)/B*72);k<0?k=0:k>=72&&(k=71),o[k]=!0,x<r[k]&&(r[k]=x)}let l=0,c=[];for(let b=0;b<72;b++)o[b]&&(l++,c.push(r[b]));let d=l/72*360;c.sort((b,y)=>b-y);let u=c.length?c[c.length>>1]:0,h=c.length?c[Math.floor(c.length*.15)]??u:0,m=c.length?c[Math.floor(c.length*.85)]??u:0,f=h>.5?m/h:1,g=uh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&u>11&&f>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:g,voidRadiusM:u,aspect:f}}var fg=5;function mg(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 gg(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()),mg(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 bg(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 Ao(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 m=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,m),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,m),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,m),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,m),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,m),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,m),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 Yi(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 Eo(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 hT(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*$t),c=t.eyeHeightM??Me,d=pg(t,e,i),u=ph(d.seed),h=210+u()*150,m=le(220+(u()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,g=o.createLinearGradient(0,0,0,ke);g.addColorStop(0,"#080b12"),g.addColorStop(.42,"#12182c"),g.addColorStop(.5,"#1c2440"),g.addColorStop(.56,"#151b2c"),g.addColorStop(.78,"#171e30"),g.addColorStop(1,"#131829"),o.fillStyle=g,o.fillRect(0,0,ne,ke);let p=o.createLinearGradient(0,q(-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,q(-6),ne,ke-q(-6));let b=Math.atan2(r,-s),y=hg(t,i,b,c),S=y.maxDelta>=dg;S&&ug(o,y.bins,vt,q);let x=Math.max(.3,Math.min(1,1-(l-6)/60)),w=To(c,l),k=Math.min(80,Math.atan2(4,l)*180/Math.PI),v=Math.min(45,w.topPitch),C=w.basePitch;d.mode==="sport"?vg(o,l,c,d,x,h,f,u):d.mode==="arena"?Sg(o,l,c,d,x,f,u):yg(o,k,v,C,x,h,f,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${f},0.8)`;for(let L=0;L<P;L++){let I=(L+.5)/P*ne,R=q(d.mode==="sport"?58:54+L*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,B),o.fill()}wg(o,t,i,e,b,c,r,s,S,d);let T=o.createLinearGradient(0,0,0,ke);return T.addColorStop(0,"rgba(0,0,0,0.85)"),T.addColorStop(.12,"rgba(0,0,0,0)"),T.addColorStop(.9,"rgba(0,0,0,0)"),T.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=T,o.fillRect(0,0,ne,ke),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function yg(t,e,i,n,o,r,s,a){let l=vt(-e),c=vt(e),d=q(i),u=q(n),h=c-l,m=u-d,f=q(Math.min(50,i+10)),g=h*(1.1+(1-o)*.5),p=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,g);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-m*1.2,h*2.2,m*3.4);let b=le(r,.62,.55),y=le(r+40,.7,.5),S=le(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,h,m),t.clip();let x=t.createLinearGradient(0,d,0,u);x.addColorStop(0,`rgb(${b[0]},${b[1]},${b[2]})`),x.addColorStop(.5,`rgb(${y[0]},${y[1]},${y[2]})`),x.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=x,t.fillRect(l,d,h,m),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,m),t.restore();let k=3+Math.floor(a()*3),v=m*.46,C=u-m*.08;for(let A=0;A<k;A++){let z=(A+1)/(k+1),W=l+h*(.22+z*.56+(a()-.5)*.06);Ao(t,W,C,v*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:le(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-h*.5,f,h*.5,u-f),t.fillRect(c,f,h*.5,u-f);let P=h*.055+3,T=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,u),t.lineTo(l-T,f),t.lineTo(l+h*.012,f),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+P,u),t.lineTo(c+T,f),t.lineTo(c-h*.012,f),t.closePath(),t.fill(),t.fillRect(l-T,f,h+T*2,(u-f)*.12);let L=m*.14,I=f+(u-f)*.12;t.fillStyle="rgba(4,6,12,0.96)";let R=7;t.beginPath(),t.moveTo(l-T,I);for(let A=0;A<=R;A++){let z=l-T+(h+T*2)*A/R;t.quadraticCurveTo(z-(h+T*2)/R/2,I+L,z,I)}t.lineTo(c+T,I),t.lineTo(c+T,f),t.lineTo(l-T,f),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-m*.05,h+P*2,m*.05+3);let M=t.createLinearGradient(0,u-m*.05,0,u+m*.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-m*.05,h+P*2,m*.2);let E=3+Math.floor(a()*2);for(let A=0;A<E;A++){let z=(A+1)/(E+1),W=l+h*(z+(a()-.5)*.08),U=q(Math.min(62,i+26)),re=(a()-.5)*h*.16;Yi(t,W,U,W+re,u,4,h*.09,s,.16*(.7+o*.5)),Eo(t,W,U,2.4,s)}}function Sg(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,m=Math.atan2(d-i,u)*180/Math.PI,f=Math.atan2(d-i,h)*180/Math.PI,g=Math.atan2(-i,u)*180/Math.PI,p=q(m),b=q(f),y=q(g),S=vt(l)-c,x=Math.max(6,(p-b)/2),w=(p+b)/2,k=t.createRadialGradient(c,y,4,c,y,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),k.addColorStop(.5,"rgba(150,140,190,0.08)"),k.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(c-S*2.6,b-x,S*5.2,y-b+x+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,w),t.ellipse(c,w,S,x,0,Math.PI,0,!1),t.lineTo(c+S,y),t.ellipse(c,y,S,x,0,0,Math.PI,!1),t.closePath(),t.fill();let v=t.createLinearGradient(0,w,0,y);v.addColorStop(0,`rgba(${r},0.14)`),v.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=v,t.fillRect(c-S,w,S*2,y-w);let C=[[{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=C[Math.floor(s()*C.length)],T=s()<.5?-1:1,L=V=>c+V.u*T*S*.84,I=V=>w+V.v*x*.8,R=P.find(V=>V.lead)??P[0],M=L(R),E=t.createLinearGradient(0,w-x,0,w+x);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),t.fillStyle=E,t.beginPath(),t.ellipse(c,w,S,x,0,0,B),t.fill();let A=t.createRadialGradient(M,w,2,M,w,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,w,S,x,0,0,B),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,w,S,x,0,0,B),t.stroke();let z=Math.max(24,(y-b)*1.3),W=P.length>=3?3:2;for(let V=0;V<W;V++){let xe=(-.62+V*.52+(s()-.5)*.12)*-T,Oe=c+xe*S*.7,wt=w-x*(.45+s()*.18),et=S*(.07+s()*.04),ji=z*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Oe-et/2,wt-ji,et,ji),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Oe-et/2,wt-ji,et,1.5)}if(P.length>=3){let V=c-R.u*T*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(V,w-x*.34,S*.08,x*.1,0,0,B),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let V of[...P].sort((xe,Oe)=>xe.v-Oe.v)){let xe=.82+(V.v+1)*.14;Ao(t,L(V),I(V),z*xe*(V.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:V.pose,rim:le(40,.72,.8),rimStrength:V.lead?1.4:.9})}let U=q(Math.min(60,f+34)),re=x*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,U,S*1.15,re,0,0,B),t.stroke();let N=4+Math.floor(s()*3);for(let V=0;V<N;V++){let xe=V/N*B,Oe=c+Math.cos(xe)*S*1.15,wt=U+Math.sin(xe)*re;if(Math.sin(xe)>-.2){let et=c+(s()-.5)*S*.8;Yi(t,Oe,wt,et,w,3,S*.32,r,.2*(.7+o*.4))}Eo(t,Oe,wt,3,r)}let _=q(Math.min(52,f+24)),G=Math.max(60,S*.4),oe=Math.max(24,G*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-G*.3,_-oe/2),t.lineTo(c-G*.16,_-oe*2.2),t.moveTo(c+G*.3,_-oe/2),t.lineTo(c+G*.16,_-oe*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-G/2,_-oe/2,G,oe);let $i=t.createLinearGradient(0,_-oe*.3,0,_+oe*.42);$i.addColorStop(0,`rgba(${r},0.5)`),$i.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=$i,t.fillRect(c-G*.42,_-oe*.3,G*.84,oe*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-G/2,_+oe/2-2,G,2);let qi=t.createRadialGradient(c,_,4,c,_,G*1.1);qi.addColorStop(0,`rgba(${r},0.2)`),qi.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=qi,t.fillRect(c-G*1.1,_-G*.8,G*2.2,G*1.6);let Zi=t.createRadialGradient(c,(U+w)/2,6,c,(U+w)/2,S*1.5);Zi.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),Zi.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=Zi,t.fillRect(c-S*1.5,U-40,S*3,w-U+80),t.restore();let mh=c+Math.sign(M-c||1)*S*.5;Yi(t,mh,U-re*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let Qi=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);Qi.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),Qi.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=Qi,t.beginPath(),t.ellipse(M,I(R),S*.2,x*.24,0,0,B),t.fill(),t.restore()}function vg(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),m=Math.atan2(-i,d)*180/Math.PI,f=Math.atan2(-i,u)*180/Math.PI,g=q(m),p=q(f),b=vt(h)-l,y=(g+p)/2,S=Math.max(10,(g-p)/2),x=t.createRadialGradient(l,y,4,l,y,b);x.addColorStop(0,"#e8f0fb"),x.addColorStop(.7,"#b9c9e2"),x.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,y,b,S,0,0,B),t.clip(),t.fillStyle=x,t.fillRect(l-b,y-S,b*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-b*.5,y-S),t.lineTo(l-b*.5,y+S),t.moveTo(l+b*.5,y-S),t.lineTo(l+b*.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,b,S,0,0,B),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let L=0;L<5;L++){let I=l+(a()-.5)*b*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,b*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-b*1.4,p-S,b*2.8,g-p+S*2),t.restore();let k=q(Math.min(66,f+60)),v=Math.max(80,b*.7),C=v*.5,P=t.createRadialGradient(l,k,4,l,k,v*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-v*1.6,k-v*1.2,v*3.2,v*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-v/2,k-C/2),t.lineTo(l+v/2,k-C/2),t.lineTo(l+v*.6,k),t.lineTo(l+v/2,k+C/2),t.lineTo(l-v/2,k+C/2),t.lineTo(l-v*.6,k),t.closePath(),t.fill();let T=r;for(let L=0;L<3;L++){let I=le(T+L*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=v*.26;t.fillRect(l-v*.42+L*(R+v*.06),k-C*.32,R,C*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let L=0;L<8;L++){let I=l-v*.6+v*1.2*L/7;t.beginPath(),t.arc(I,k+C*.62,2.4,0,B),t.fill()}}function wg(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let g of i){if(g.id===e.id)continue;let p=g.x-e.x,b=g.y-e.y,y=Math.hypot(p,b)*$t;if(d&&g.sectionId===d&&y<3&&p*s+b*a>0&&(u=!0),y<.3||y>32)continue;let x=((Math.atan2(p,-b)-o)*180/Math.PI+540)%360-180,w=l?(g.eyeHeightM??Me)-r:0,k=Math.atan2(w-.28,y)*180/Math.PI;if(k>10&&y>5)continue;let v=0;for(let T=0;T<g.id.length;T++)v=v*31+g.id.charCodeAt(T)&65535;let C=.9+(v&15)/40,P=Math.min(78,Math.atan2(.16,y)*180/Math.PI*cg*C);P<1.2||h.push({hx:vt(x),hy:q(k),r:P,d:y,hash:v})}h.sort((g,p)=>p.d-g.d);let m=[];{let g=[...h].sort((y,S)=>y.hy-S.hy),p=[],b=()=>{if(!p.length)return;let y=p.reduce((w,k)=>w+k.d,0)/p.length,S=p.reduce((w,k)=>w+k.hy,0)/p.length,x=p.reduce((w,k)=>w+k.r,0)/p.length;m.push({figs:p.sort((w,k)=>k.d-w.d),d:y,hy:S,r:x}),p=[]};for(let y of g){let S=p[p.length-1];S&&Math.abs(y.hy-S.hy)>Math.max(5,(S.r+y.r)/2*1.7)&&b(),p.push(y)}b()}m.sort((g,p)=>p.d-g.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let g of m){if(g.figs.length>=3&&g.r>=1.6&&g.r<26){let p=[],b=[...g.figs].sort((x,w)=>x.hx-w.hx),y=[];for(let x of b){let w=y[y.length-1];w&&x.hx-w.hx>Math.max(14,x.r*7)&&(y.length>=3&&p.push(y),y=[]),y.push(x)}y.length>=3&&p.push(y);let S=Math.min(.42,.5*(1-g.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let x of p){let w=x[0].hx-g.r*1.6,k=x[x.length-1].hx+g.r*1.6;t.beginPath(),t.roundRect(w,g.hy+g.r*.8,k-w,g.r*2.4,g.r*.8),t.fill()}}}for(let p of g.figs){let b=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),y=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+y,17+(p.hash>>4&6)+y,25+(p.hash>>4&6)+y],x=f[p.hash%f.length],w=[x[0]+y,x[1]+y,x[2]+y];if(p.r>=13){let k=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;gg(t,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:b,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%fg,rim:k,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?bg(t,p.hx,p.hy,p.r,w,S,b):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${b.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,B),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 g=q(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,g,ne,ke-g),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let b=0;b<p;b++){let y=(b+.5)/p*ne;t.beginPath(),t.ellipse(y,g+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var de=480,St=270,Mo=50,Je=30,hh=t=>(t+Mo)/(2*Mo)*de,Ut=t=>(Je-t)/(2*Je)*St;function uT(t,e,i){let n=document.createElement("canvas");n.width=de,n.height=St;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*$t),l=ph(uh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=le(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=o.createLinearGradient(0,0,0,St);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,de,St);let m=t.eyeHeightM??Me,f=To(m,a),g=Math.min(Mo-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(Je-2,f.topPitch),b=Math.max(-Je+2,f.basePitch),y=hh(-g),S=hh(g),x=Ut(p),w=Ut(b),k=S-y,v=w-x,C=Math.max(.35,Math.min(1,1-(a-6)/60)),P=Ut(Math.min(Je-1,p+8)),T=o.createRadialGradient(de/2,(x+w)/2,4,de/2,(x+w)/2,k*1.15);T.addColorStop(0,"rgba(255,214,150,0.34)"),T.addColorStop(.28,"rgba(150,150,230,0.3)"),T.addColorStop(.6,"rgba(99,102,241,0.12)"),T.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=T,o.fillRect(y-k*.6,x-v*1.2,k*2.2,v*3.4);let L=le(c,.62,.55),I=le(c+40,.7,.5),R=le(c+70,.78,.52);o.save(),o.beginPath(),o.rect(y,x,k,v),o.clip();let M=o.createLinearGradient(0,x,0,w);M.addColorStop(0,`rgb(${L[0]},${L[1]},${L[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,x,k,v),o.globalAlpha=1;let E=o.createRadialGradient(de/2,(x+w)/2,k*.12,de/2,(x+w)/2,k*.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(y,x,k,v),o.restore();let A=3,z=w-v*.08;for(let N=0;N<A;N++){let _=(N+1)/(A+1);Ao(o,y+k*(.24+_*.52),z,v*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:le(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(y-k*.5,P,k*.5,w-P),o.fillRect(S,P,k*.5,w-P);let W=k*.05+2,U=W*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(y,w),o.lineTo(y-W,w),o.lineTo(y-U,P),o.lineTo(y+k*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,w),o.lineTo(S+W,w),o.lineTo(S+U,P),o.lineTo(S-k*.012,P),o.closePath(),o.fill(),o.fillRect(y-U,P,k+U*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-W,w-v*.05,k+W*2,v*.05+2);let re=o.createLinearGradient(0,w-v*.05,0,w+v*.14);re.addColorStop(0,`rgba(255,206,140,${(.5*C).toFixed(3)})`),re.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=re,o.fillRect(y-W,w-v*.05,k+W*2,v*.22);for(let N=0;N<3;N++){let _=(N+1)/4,G=y+k*_,oe=Ut(Math.min(Je-1,p+20));Yi(o,G,oe,G+(l()-.5)*k*.14,w,3,k*.09,u,.17*C),Eo(o,G,oe,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let N=0;N<8;N++)o.beginPath(),o.arc((N+.5)/8*de,Ut(Je-4-N%2*3),2.2,0,B),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,St-26,de,26),o.fillStyle="rgba(30,37,54,0.9)";for(let N=0;N<9;N++){let _=N*(de/9)+de/18;o.beginPath(),o.ellipse(_,St-22,de/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"]),Ui=new Map;async function kg(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await Br(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-L36RHPNS.js"),i=e[t];return i?await i():null}async function gT(t,e){let i=Qs(t,e);if(i==="en"||fh.has(i))return ct(i),i;if(!Zs.includes(i))return ct("en"),"en";try{let n=Ui.get(i);n||(n=kg(i),Ui.set(i,n));let o=await n;return Ui.delete(i),o?(ct(i,o),fh.add(i),i):(ct("en"),"en")}catch{return Ui.delete(i),ct("en"),"en"}}export{Tg as ACCESSIBILITY_RING_COLOR,_o as ACCESSIBILITY_TYPES,vb as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,Sb as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,Fg as BOOTH_TYPES,Lg as CHART_STORAGE_KEY,ay as CURRENCY_CHOICES,ry as DEFAULT_CURRENCY,Dg as DEFAULT_EVENT_INVENTORY_LIMIT,uC as EMPTY_AVAILABILITY_REFRESH,Wg as EVENT_CONFIGURATION_EXPORT_SCHEMA,Gg as EVENT_CONFIGURATION_SCHEMA,mb as FLOOR_COVER_LIMIT,ub as FLOOR_STACK_GAP_RATIO,yb as FLOOR_STACK_MIN_SURFACE_PX,kb as GA_UNIT_LABEL_PREFIX,hC as HOLD_CLOCK_SKEW_MS,fn as LABEL_FADE_MS,Ag as LABEL_STYLE_MAX_SIZE,Mg as LABEL_STYLE_MIN_SIZE,Ng as LARGE_VENUE_INVENTORY_MODULE,Wb as LEGIBILITY_HYSTERESIS_PX,gb as LEVEL_CONTEXT_PREFIX,my as LOCALE_NAMES,Og as MAX_EVENT_INVENTORY,Lb as MAX_GA_CAPACITY,Pb as MAX_ONE_PARTY_GUESTS,oi as MIN_POINTER_TARGET_PX,Rb as ONE_PARTY_LIMIT_MESSAGE,ah as PickerController,Re as PickerSelectionError,Hb as RENDERED_QUALITY_REPORT_VERSION,Eg as ROW_AISLE_SEATS,Pg as SEAT_COMMERCIAL_MARKS,Fb as SEAT_TYPE_ICON_BODY,on as SEAT_TYPE_ICON_VIEWBOX,xg as STAGE_LABEL_STYLE_MAX_SIZE,ou as SUPPORTED_LOCALES,_g as SURROUNDINGS_SHAPE_ROLES,vo as SeatmapRenderer,Qg as TABLE_SEAT_OFFSET,qg as TIER_HEIGHT_M,Zs as TRANSLATED_LOCALES,ir as UNGROUPED_ID,_d as accessNeedsFor,Eb as accessibilityLabelKey,Cg as accessibilityMeta,Ig as accessibilityRingColor,Qt as allObjects,sr as applyHidden,Km as applyOrganizerSeatGlyph,Lo as asPickerSalesState,Dd as attachVisibilityCatchUp,wb as automaticRoundTableRadius,Yg as canTransitionEventConfiguration,Kg as canonicalEventConfigurationJson,Yo as chartBounds,vd as clearOrganizerSeatGlyph,qo as combinedFloorZoneId,It as compactRowLabel,rr as computeSections,Ob as computeSectionsPerFloor,yd as createRenderer,Or as crossesThreshold,iu as currencyExponent,cy as currencySymbol,tt as effectiveFloorOverview,Hg as eventInventoryLimitFor,sb as expandBooth,De as expandChart,tb as expandRow,eb as expandRowSlots,rb as expandTable,nb as expandTableSlots,db as floorObjects,pb as floorStackPlacements,Zt as floorsOf,vy as formatDate,ly as formatMinor,Ue as formatMoney,nu as fromMinorUnits,Lt as gaAreasOf,en as gaBoxBounds,Ji as gaBoxMode,Ib as gaInventorySegments,Cb as gaUnitLabel,Mb as gaUnitLabels,tn as gaUnitLabelsForModel,xt as gaWheelchairPlaceCount,nn as gaWheelchairUnitLabels,hT as generateSeatPanorama,uT as generateSeatThumb,gy as getLocale,Ab as growJoinedGAInventory,Nb as hiddenObjectIds,Zm as holdHasLapsed,fC as holdRecoveryShape,gn as hysteresisScale,Jo as initialFloorMode,Xg as inspectEventConfigurationCompatibility,Gb as inspectRenderedQualityEvidence,xb as isGaUnitLabel,yy as isLocaleLoaded,Sd as isOrganizerGlyphPainted,Db as isSectionHidden,Bg as layerOf,Qo as layoutCombinedFloorPlan,Zo as layoutFloorStack,jo as levelContextOutlines,gT as loadLocale,by as localeDirection,bb as mainFloorId,$g as migrateLegacyEventConfigurations,lb as objectCenter,cb as owningSectionForObject,zg as parseEventConfigurationExport,Vg as parseEventConfigurationVersion,zo as pointInPolygon,te as pointInPolygonWithHoles,ab as pointOnPolygonBoundary,qt as polygonLabelPoint,Bd as reconcileAvailability,pC as refreshChangedSomething,mn as renderedPx,sy as resolveCurrency,Ug as resolveEventConfigurationRollback,Qs as resolveLocale,Jg as rowInventoryCount,jg as rowSeatPositions,Rg as seatCommercialMeta,er as seatNoteRowModel,tr as seatTypeIconBody,_b as seatTypeIconSvg,it as sectionEntrancesById,Zg as sectionGeometry,Bb as sectionIdentitiesById,nr as sectionLabelsById,or as sectionOwnersByObject,ct as setLocale,qs as setMoneyLocale,Sy as setStringOverrides,Od as shouldWaitForHoldExpiry,Xo as stackFloors,fb as suggestedFloorOverview,F as t,Js as tCount,ob as tableInventoryCount,ib as tableSeatCountsBySide,hb as translateObject,Ko as usableHoles,Tb as validGAInventorySegments,Vb as zoomTowardPoint};
|
|
1
|
+
import{a as gn,c as bn,e as Fr,f as ui,h as _r,j as Br,m as Or}from"./chunk-BF3XROP5.js";import{a as bb,b as Qo,c as yb,d as jo,e as Jo,f as tt,g as Sb,h as vb,i as wb,j as er,k as kb,l as xb,m as tr,o as kr,r as rt}from"./chunk-VHFSP53L.js";import{a as Kb,b as si,c as Xb}from"./chunk-7Q366RVM.js";import{d as Dr}from"./chunk-TGHNVDWA.js";import{a as ln,b as Nb,c as nr,d as Hb}from"./chunk-YPVYZYMH.js";import{a as Db,b as ir,c as It,d as Tr,e as Ir,f as Pr,g as Rr}from"./chunk-VSX4JWN7.js";import{b as wr,e as pn,i as ci,k as Er}from"./chunk-QFX6XSO6.js";import{a as Lb,b as Cb,c as Tb,f as li}from"./chunk-DO545QTN.js";import{b as ai,f as br,h as ot,i as yr,j as Sr,l as vr}from"./chunk-4N5CHKHD.js";import{A as Ar,b as Pt,c as di,d as fn,e as xr,f as Lr,g as mn,l as Cr,n as hi,z as Mr}from"./chunk-4LW4TZZR.js";import{b as qo,c as Zo,l as kt}from"./chunk-TFYAMLCK.js";import{A as gr,B as Ve,C as un,D as oi,E as X,F as he,G as ri,a as me,b as hr,c as He,e as ge,f as ti,g as ii,h as ur,i as Ct,j as Ge,k as We,l as H,n as pr,p as fr,q as mr,s as be,t as ye,w as nt,x as Tt,y as ni}from"./chunk-DDQWZ323.js";import{b as Pg,c as Oo,d as Rg,e as Do,f as Mg,g as Ag,h as Eg,i as Fg,j as _g,k as Bg,l as Og,m as Dg,n as Ng,o as Hg,p as Gg}from"./chunk-522ENS2Q.js";import{a as Ib,b as Pb,c as Rb,d as Mb,e as Ab,f as Eb,g as Fb,h as _b,i as on,j as rn,k as Bb,l as sn,m as xt,n as an,o as Ob,p as Lt,q as or,r as Gb,s as it,t as rr,u as sr,v as ar,w as Wb,x as Vb,y as zb,z as lr}from"./chunk-UKODEMIM.js";import{$a as jt,Ga as Ko,Ia as Xo,J as No,Ka as ib,L as Ho,La as nb,Ma as ob,N as K,Na as rb,Oa as sb,Pa as ab,Qa as lb,Ra as cb,Sa as db,Ta as hb,Ua as Zt,Va as ub,Wa as Uo,Xa as te,Ya as Qt,Za as pb,_a as fb,ab as mb,ba as Go,bb as Jt,ca as Wo,cb as gb,d as Wg,da as Vo,db as Yo,e as Vg,eb as De,f as zg,fb as $o,g as Kg,h as Xg,i as Ug,j as Yg,k as $g,ka as zo,l as qg,m as Zg,ma as eb,n as Qg,o as jg,p as Jg,ua as Ae,va as tb}from"./chunk-HKVCBUON.js";import"./chunk-KTMZ3QAO.js";import{C as O,c as cn,h as dn,m as hn,o as cr,t as D,u as ce,v as Ne,w as j,x as ei,z as dr}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var Ub=1,yn=90;function Sn(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Nr(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 vn(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 Yb(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 Xi}from"konva/lib/Core";import{Stage as Km}from"konva/lib/Stage";import{Layer as ko}from"konva/lib/Layer";import{Group as Ut}from"konva/lib/Group";import{Circle as vd}from"konva/lib/shapes/Circle";import{Group as Bn}from"konva/lib/Group";import{Circle as _e}from"konva/lib/shapes/Circle";import{Line as Nn}from"konva/lib/shapes/Line";import{Rect as On}from"konva/lib/shapes/Rect";import{Text as sa}from"konva/lib/shapes/Text";var J=9,Se=.9,Z=.55*Se,ie=H/me,st=4,ue=14,Hr=10;var Gr=14;var ve=.45*Se,we=.9*Se,se=(ve+we)/2,Wr=Math.max(Se*1.1,we),ke=8,Vr=700,ee=2,Rt=H,Sh=12,vh=12;function zr(t){return t<Q?vh:Sh}var pi=.85,Kr=H,Mt=64,ze=.55*ve,Xr=700,Ur=120,Yr=2500,$r=420,qr=420,Zr=1,Ke=1,Qr=2,at=16,Ee=12,wn=[.85,.72,.62],wh=10,kh=9;function fi(t){return t<Q?kh:wh}var mi=13,gi=12,jr=0,Jr="700",es="600",ts=8,is=5,ns=10,os=6,rs=8,ss=.6,as=.6,ls=.7,cs=[0,18,-18,36,-36,54,-54],Xe="600",ds="500",Q=640,hs=Xe,us="400",Fe=0,ps=14,fs=.34,ms=.92,gs=7,bs=3;function bi(t){return Math.min(1,Math.max(Ee/at,t/900))}function lt(t,e){return Math.max(Ee,t*bi(e))}var xh=.5,Lh=1.15,ys=2,Ss=3,vs=22,Ch=8,Th=6;function At(t){return t<Q?Th:Ch}var kn=.08;function xn(t,e,i,n,o=xh,r=Ee){let s=t*bi(e),a=Math.max(r*(1+kn),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*Lh);return Math.min(c,a*l)}var ws=.1,Et=1.02;var yi=1.25;function ks(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var Ih="#e5e7eb",Ph="#c7cbd1",Rh="#6b7280",Mh=["#6b7280","#5b6470","#4b5563","#374151"],Ah=["#cbd5e1","#e2e8f0","#f8fafc"],Eh="#d1d5db",Fh="#b8bdc4",_h="#273142",Bh="#526078",Oh="#f1f5f9",Dh="#374151",Nh="#64748b",Hh="#111827",xs="#6b7280",Ls="#374151";var Cs="#4b5563",Ts=.4,Ce=.16,Is="rgba(244,246,248,0.06)",Si=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Ps(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 ae(t){return D(t)?{sectionFill:Ih,sectionStroke:Ph,sectionInk:Rh,focalFill:Eh,focalStroke:Fh}:{sectionFill:_h,sectionStroke:Bh,sectionInk:Oh,focalFill:Dh,focalStroke:Nh}}function Ln(t,e){let i=t.sectionFill,n=D(i),o=n?ce(i,.6):dr(Ne(i,.2),.85);switch(e){case"closed":return n?ce(i,.4):Ne(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Rs=.28,Ms=.42,Gh=.55,Wh=.7;function As(t,e,i){let n=ae(t),o=Ln(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=D(t);return{fill:j(o,i,r?Ms:Rs),stroke:O(i,r?Wh:Gh)}}var Vh=.03;function Es(t,e){let i=ae(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>Ln(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&Cn(t,e)}function Cn(t,e){let i=cn(e);if(!i)return!1;let n=ae(t),o=Math.max(Rs,Ms)+Vh;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=cn(Ln(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 zh="#f8fafc",Kh="#f4f6fb",Xh="#111827",Uh=.72;function Fs(t){let e=D(t),i=e?zh:Hh,n=e?Xh:Kh,o=j(n,i,1-Uh);return{plate:i,ink:n,subInk:hn(o,i)>=cr?o:n}}function _s(t,e,i,n){if(e)return e;let o=D(i)?Ah:Mh;for(let r of[i,...o])if(hn(r,t)>=n)return r;return he(t,e,i,n)}import{Shape as $h}from"konva/lib/Shape";import{Circle as qh}from"konva/lib/shapes/Circle";import{Rect as Zh}from"konva/lib/shapes/Rect";var Yh={M:2,L:2,Q:4,C:6,Z:0},Tn=new Map;function In(t){let e=Tn.get(t);if(e)return e;let i=ot(t);if(!i)return Tn.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=Yh[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 Tn.set(t,o),o}function Bs(t,e,i,n=0,o=0){let r=In(e),s=br(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=yr(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 Os(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ue=class extends $h{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=In(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){Os(e,i),e.fillStrokeShape(this);return}e.beginPath(),Bs(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){Os(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 Pn(t,e){return t==="circle"||!ot(t)?null:new Ue({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 Ds(t){let{x:e,y:i,radius:n}=t;return t.wheelchairBay?new Zh({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}):Pn(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new qh({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Qh(t,e){return t*2*e>=16}function Ns(t,e,i,n){let o=Qh(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function vi(t){return t?.35:.3}function Ws(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 Rn(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 Vs=700,jh=2400,Mn=12,zs=30,Hs=1,Jh=1.16,Gs=.5,eu=1;function An(t){return t*.61803398875%1}function Ks(t,e){let n=((t/jh+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:Hs+(Jh-Hs)*o,opacity:Gs+(eu-Gs)*o}}var Us;function Ys(t){Us=t}function tu(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var Xs=new Map;function iu(t,e){let i=t??Us,n=`${i??""}|${JSON.stringify(e)}`,o=Xs.get(n);return o||(o=new Intl.DateTimeFormat(i,e),Xs.set(n,o)),o}var nu={dateStyle:"medium",timeStyle:"short"};function $s(t,e={}){let{locale:i,...n}=e,o=tu(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:nu;return iu(i,r).format(o)}var dy="USD";function hy(t,e){return t?.trim()||e?.trim()||"USD"}var uy=["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"],Zs;function Qs(t){Zs=t}var qs=new Map;function En(t,e,i,n){let o=n??Zs,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=qs.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),qs.set(r,s)),s}function Ye(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return En(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 En(e,o,o,n).format(t)}var ou={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 ru(t="USD"){return ou[t.toUpperCase()]??2}function su(t,e="USD"){return t/10**ru(e)}function py(t,e="USD",i){return Ye(su(t,e),e,void 0,i)}function fy(t="USD"){return En(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Ft={"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 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"],vy={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"},js=["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"],lu=new Set(["ar","fa","he"]),Fn={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"},_n=new Map(au.map(t=>[t.toLowerCase(),t]));function cu(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=_n.get(e)??Fn[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=_n.get(o)??Fn[o];if(r)return r}return _n.get(n[0])??Fn[n[0]]}var $e={en:Ft},wi={},pe="en";function Js(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=cu(n);if(o)return o}return"en"}function wy(){return pe}function ky(t=pe){return lu.has(t)?"rtl":"ltr"}function xy(t){return!!$e[t]}function ct(t,e){e&&($e[t]={...$e[t],...e}),pe=$e[t]?t:"en",Qs(pe),Ys(pe),typeof document<"u"&&(document.documentElement.lang=pe)}function Ly(t){wi=t}var ea=/\{(\w+)\}/g;function F(t,e){let i=wi[t]??$e[pe]?.[t]??Ft[t]??t;return e?i.replace(ea,(n,o)=>String(e[o]??`{${o}}`)):i}function ta(t,e,i){let n=new Intl.PluralRules(pe).select(e);return(wi[`${t}.${n}`]??$e[pe]?.[`${t}.${n}`]??Ft[`${t}.${n}`]??wi[`${t}.other`]??$e[pe]?.[`${t}.other`]??Ft[`${t}.other`]??t).replace(ea,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function Cy(t,e){return $s(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:pe})}function na(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,ia=70;function oa(t,e){let i=dt+6,n=t.y-ia;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+ia,e.height-i)}}var Dn=.8,pu=Math.hypot(.46,.36),fu=.26,mu=1.6,gu=2*(1-pu),ca="#0b1220",aa="#ffffff";function la(t,e,i,n,o){let r=Math.min(Math.max(mu,i*fu),i*gu);return new Nn({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:ca,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function bu(t){if(!(t instanceof Ue)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&ot(e)?e:null}var yu=220,Su=.08,ki=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(),Ve),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:bu(r.seatShape(e)),h=r.seatRadius(),m=new Bn({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});m.setAttrs({seatId:e,ringColor:l});let f={name:"selection-halo",stroke:O(r.categoryColor(s.categoryKey),vi(D(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;m.add(new On({...f,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 m.add(new _e({...f,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let g={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(m.add(new On({...g,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)m.add(new On({...g,stroke:oi(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:Dn}));else{let p=Math.max(0,d.width/2-14),b=-Math.max(0,d.height/2-14);m.add(new _e({x:p,y:b,radius:10,fill:l,listening:!1})),m.add(new Nn({x:p,y:b,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:D(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(m,u,h,c,g);else{let p=Math.max(1,h-1.25),b=Math.min(2.5,Math.max(1.8,h*.22));if(m.add(new _e({...g,radius:p,strokeWidth:b})),c)m.add(new _e({...g,stroke:oi(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Dn}));else{let y=Math.max(0,p-b/2);m.add(la(0,0,y,aa,!0))}}n.set(e,m),this.host.overlayLayer.add(m)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new _e({...r,stroke:oi(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:Dn}));return}let l=X(a,s.selectionColor(),Ve),c=Pn(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=Sr(i,n);if(!d)return;let u=D(l)?ca:aa;e.add(la(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))},Vs))}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 _e({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Rn(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,m=Rn(h/420);if(s.radius(r*m.radiusScale),s.opacity(m.opacity),a){let f=Ws(h/320);a.scale({x:f,y:f})}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/yu),d=1+Su*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 Bn({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=na(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id)),s=oa(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,ae(i).sectionInk),o=new Bn({name:"touch-loupe",listening:!1,visible:!1});o.add(new Nn({points:[-7,dt-4,0,dt+12,7,dt-4],closed:!0,fill:i,stroke:O(n,.25),strokeWidth:1,listening:!1})),o.add(new _e({radius:dt,fill:i,stroke:O(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new _e({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new sa({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new sa({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:O(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 vu}from"konva/lib/Animation";var wu=1e3/zs;function da(t){return t.findOne(".selection-halo")??null}var xi=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=da(a);if(l){if(this.paintHalo(s,l),o>=Mn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:An(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Mn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:An(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new vu(()=>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=vi(D(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(O(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=da(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}=Ks(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 ku}from"konva/lib/Group";import{Circle as Hn}from"konva/lib/shapes/Circle";import{Text as xu}from"konva/lib/shapes/Text";var ha=28,Lu=12,Cu="800",Tu=44,ua=1.6,pa=1.95;function fa(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 Iu(t,e){return F("map.beaconAria",{seats:ta("picker.seatCount",t),name:e})}function Pu(t,e){let i=e*pa,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 Ru="selection-beacon-ring",Li=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=ha/2/i,r=Math.max(Tu,Math.ceil(2*(o*pa+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new ku({listening:!1,name:"selection-beacons"});for(let c of e){let d=Pu(c,o);l.add(new Hn({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*ua,fill:O(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new Hn({name:Ru,x:c.anchor.x,y:c.anchor.y,radius:o*ua,stroke:O(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new Hn({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:O(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new xu({x:d.x,y:d.y,text:String(c.count),fontSize:Lu/i,fontStyle:Cu,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)||ha;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",Iu(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 _t(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(),m=i.y*u+t.y();h<r&&(r=h),m<s&&(s=m),h+i.width*u>a&&(a=h+i.width*u),m+i.height*u>l&&(l=m+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var Ci=8,Mu=.02,ma=1,ga=.5;function ba(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=_t(t,e,o);if(!s)return 0;Gn(t,s,r);let a=Math.min((r.width-2*Ci)/s.width,(r.height-2*Ci)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>ga?a:Math.min(a,Au(t.scaleX(),n));if(!(c>1+Mu)&&!(l>ga)||!(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=_t(t,e,o);return h&&Gn(t,h,r),c}function Wn(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=_t(t,e,n);return r?Gn(t,r,o):!1}function Au(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(ma,e):ma)/i}function Gn(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 Eu}from"konva/lib/Group";import{Circle as ya}from"konva/lib/shapes/Circle";import{Line as Fu}from"konva/lib/shapes/Line";import{Text as _u}from"konva/lib/shapes/Text";var Bu=6;function Bt(t){return D(t)?"#0b1220":"#ffffff"}function Sa(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:Bt(i)}}var Ti=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=Sa({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>=we){this.host.overlayLayer.batchDraw();return}let n=Math.max(this.host.stageScale(),1e-4),o=new Eu({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Sa({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(Bu/2/n,1);for(let g of a)o.add(new ya({name:"owned-seat-dot",x:g.x,y:g.y,radius:c,fill:l.fill,stroke:O("#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(g=>g.logicalId===s.logicalId).reduce((g,p)=>g+this.host.ownedPoints(p).length,0),u=this.host.labelAnchor(s),h=11/n,m={x:u.x,y:u.y-h*2.1};o.add(new ya({name:"owned-section-badge",x:m.x,y:m.y,radius:h,fill:l.fill,stroke:O(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new Fu({x:m.x-h*.62,y:m.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 f=new _u({x:m.x+h*.12,y:m.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(f),this.badges.push({id:s.logicalId,centre:m,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 Ou}from"konva/lib/shapes/Text";var Du=4;function Ot(t){return D(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function Nu(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 va(t,e){t.padding(Du),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),Nu(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(),Ou.prototype._sceneFunc.call(this,n)})}function wa(t){return t?"seat":"section"}function ka(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 xa(t){let e=t.place?.kind==="booth",i=e?"":Gu(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=ir(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,note:l.length?null:Hu(t.status,t.closed)}}function Hu(t,e){return e||t==="not_for_sale"?F("picker.notForSale"):t==="booked"?F("map.statusTaken"):t==="held"?F("map.statusHeld"):null}function Gu(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 Wu=16,Vu=8;function La(t,e,i,n=Wu){let o=Vu,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 Ca=16,Vn=14,Ta=10.5,zu=14,Ku=12.5,Ia={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Xu={warn:"#d8a425",premium:"#e8c15a"},Uu=.1,Yu=.06,Ii=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=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.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(",")}`;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=La(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(wa(this.host.seatsPickable())==="seat"){let o=this.host.hoveredSeatId()??this.host.nearestSeat(e);return o?this.seatModel(o):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;return!i||n==null||this.host.sectionInteractive?.(i)===!1?null:ka({name:n||i,memberIds:this.host.sectionMembers(i),categoryOrder:this.host.categoryOrder(),categoryKey:o=>this.host.seat(o)?.categoryKey??null,categoryLabel:o=>this.host.categoryLabel(o),categoryPrice:o=>this.host.categoryPrice(o),categoryColor:o=>this.host.categoryColor(o),categorySellable:o=>this.host.categorySellable(o),seatSellable:o=>this.host.seatSellable(o)})}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);return xa({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}:{}})}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 Jt(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=li(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?It(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=Ot(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",minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",background:i.plate,border:`1px solid ${i.stroke}`,boxShadow:"0 6px 20px rgba(2,6,23,0.22)",fontFamily:this.host.labelFont(),lineHeight:"1.35",zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Ca}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:`${Vn}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(),n=Ot(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 m=document.createElement("div");m.textContent=u.caption,Object.assign(m.style,{fontSize:`${Ta}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let f=document.createElement("div");f.textContent=u.value,Object.assign(f.style,{marginTop:"2px",fontSize:`${Ca}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(m,f),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:`${Vn}px`,fontWeight:"700",background:c.color,color:un(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")}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:`${Ta}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:`${Vn}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=un(n.plate)==="#ffffff"?Ia.onDark:Ia.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,Xu[s.tone],Uu):j(n.plate,o,Yu),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=nr(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 m=document.createElement("div");if(m.textContent=s.title,Object.assign(m.style,{fontSize:`${zu}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(m),s.note){let f=document.createElement("div");f.textContent=s.note,Object.assign(f.style,{fontSize:`${Ku}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(f)}d.append(u,h),e.appendChild(d)}}};var Pa="#1f9d6b";function $u(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 Ra(t,e){let i=e?new Set(e):null;$u(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Ma(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 Aa(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function U(t){let e=wr(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),m={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!te(m,o,r))return!1}return!0}function Ea(t,e,i){let n=U(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:No(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 Fa(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return U(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function qu(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 _a(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=qu(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 Qu}from"konva/lib/shapes/Text";function Zu(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),Zu(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/Mt),n=Math.floor((e.x+Math.max(0,e.width))/Mt),o=Math.floor(e.y/Mt),r=Math.floor((e.y+Math.max(0,e.height))/Mt),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var zn=new WeakMap;function Ze(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=zn.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},zn.set(t,e);let i=()=>{let n=zn.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Ba=new WeakMap,Oa=new WeakMap;function Da(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 Qu({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 ju(t){let e=t.labelFont(),i=Ze(),n=Oa.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new fe,r=Da(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(),Oa.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function Ju(t){let e=ju(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=Ba.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=Da(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(),Ba.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function Na(t,e){let i=t.sections.filter(f=>f.id===e||f.logicalId===e),n=i.map(f=>U(f.outline));if(!n.length)return null;let o=Math.min(...n.map(f=>f.x)),r=Math.min(...n.map(f=>f.y)),s=Math.max(...n.map(f=>f.x+f.width)),a=Math.max(...n.map(f=>f.y+f.height)),l=new Set(i.flatMap(f=>f.memberIds));for(let f of l){let g=t.seatById.get(f);g&&(o=Math.min(o,g.x-t.seatR),r=Math.min(r,g.y-t.seatR),s=Math.max(s,g.x+t.seatR),a=Math.max(a,g.y+t.seatR))}let c=f=>{[f.x,f.y,f.width,f.height].every(Number.isFinite)&&(o=Math.min(o,f.x),r=Math.min(r,f.y),s=Math.max(s,f.x+f.width),a=Math.max(a,f.y+f.height))},d=f=>{let g={x:f.x+f.width/2,y:f.y+f.height/2};return i.some(p=>te(g,p.outline,p.holes))};for(let{node:f,backdrop:g}of t.freeTextById.values()){let p=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),g&&c(g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:f}of t.iconNodeById.values()){let g=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(g)&&c(g)}let u=Ju(t);t.rowLabelPlan.forEach((f,g)=>{(f.focusKeys??[]).some(b=>b===e||i.some(y=>b===y.id||b===y.logicalId))&&c(u[g])});let h=Math.max(s-o,a-r),m=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-m,y:r-m,width:Math.max(1,s-o+m*2),height:Math.max(1,a-r+m*2)}}import{Rect as ep}from"konva/lib/shapes/Rect";import{Text as Ha}from"konva/lib/shapes/Text";var Kn="\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(m=>Number.isFinite(m.centroid.x)&&Number.isFinite(m.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let n=i.map(m=>({member:m,weight:Math.max(1,tp(m.outline))})),o=n.reduce((m,f)=>m+f.weight,0),r=n.reduce((m,f)=>({x:m.x+f.member.centroid.x*f.weight/o,y:m.y+f.member.centroid.y*f.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(m=>{let f={x:m.centroid.x-e.x,y:m.centroid.y-e.y},g={x:m.centroid.x-r.x,y:m.centroid.y-r.y};return{member:m,depth:f.x*l.x+f.y*l.y,lateral:Math.abs(g.x*-l.y+g.y*l.x)}}).sort((m,f)=>f.depth-m.depth||m.member.id.localeCompare(f.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(m=>m.depth>=u);return h.sort((m,f)=>m.lateral-f.lateral||f.depth-m.depth||m.member.id.localeCompare(f.member.id)),h[0].member}function np(t){let i=[...F("map.fromPrice",{price:Kn}).toLocaleLowerCase()],n=i.findIndex(o=>o!==Kn&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(Kn).join(t)}function op(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function rp(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>op(n.label,i))}function Ga(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Fs(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&&!rp(o.label,r))continue;let s=r[0];for(let p of r)p.centroid.y<s.centroid.y&&(s=p);t.derivedFloorGroups&&(s=ip(r,o.focalPoint??e.focalPoint)??s);let a=s.centroid.x,l=s.centroid.y,c=1/0,d=-1/0;for(let p of r)for(let b of p.outline)b.x<c&&(c=b.x),b.x>d&&(d=b.x);let u=isFinite(c)&&d>c?d-c:0,h=1/0;for(let p of r)for(let b of p.memberIds){let y=t.seatById.get(b),S=y&&t.catPrice.get(y.categoryKey);typeof S=="number"&&S<h&&(h=S)}let m=new ep({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:i.plate,stroke:O(o.color??s.outlineTint,ss),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new Ha({x:a,y:l,text:o.label,fontSize:mi,fontStyle:Jr,letterSpacing:0,fontFamily:t.labelFont(),fill:i.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f);let g=null;isFinite(h)&&(g=new Ha({x:a,y:l,text:np(Ye(h,t.currency)),fontSize:gi,fontStyle:es,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),g.offsetX(g.width()/2),t.bgLayer.add(g)),t.zones.push({id:o.id,anchor:{x:a,y:l},back:m,background:i.plate,name:o.label,spanWorld:u,label:f,sub:g})}}function Wa(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=>Qo(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 sp=new Set,Va=16,ap=5,Pi=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=sp){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,Va)){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+Va,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 bp}from"konva/lib/shapes/Circle";import{Line as yp}from"konva/lib/shapes/Line";import{Rect as Sp}from"konva/lib/shapes/Rect";import{Text as vp}from"konva/lib/shapes/Text";function Te(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Ie(t,e){return Te(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Ka=.35,Xa=.7,Qe="#0b1220",pt="#ffffff",Ua="#0b1220",Xn="#232c40",Ya="#8b93a7";function Un(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var Yn="#f7f8fb";import{Text as qa}from"konva/lib/shapes/Text";var $a="500",lp=2.5;function cp(t,e){return t>=ie||e&&t>=pi}function dp(t){return t.effectiveScale<pi?!1:t.focusActive||t.stageWidth<Q}function hp(t,e,i){return i&&e>=pi?Math.max(t,Kr/Math.max(e,1e-4)):t}function up(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=H/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(st,r),s)}function $n(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function Za(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 Qa(t,e){return e>0?Math.min(t,e/2):t}function ja(t){return Ri(qn(t))}function qn(t){let e=$n(t,!1),i=$n(J,!1),n=e>0?i/e:1;return me/Math.max(1,n)}function Ri(t){return H/Math.max(t,1e-4)/vn(1,!1,H)}function Ja(t){return Ri(t)*yi}function pp(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function el(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=dp({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:vn(e,t.labelsWereVisible(),H),o=t.labelLayers(),r=o.seatLabels&&cp(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=f=>{let g=t.worldToScreen({x:f.x(),y:f.y()}),p=f.width()*e,b=f.height()*e;return g.x-p/2>=0&&g.y-b/2>=0&&g.x+p/2<=t.stage.width()&&g.y+b/2<=t.stage.height()};for(let[f,g]of t.boothLabelById){let p=t.circleById.get(f);g.visible(be(g.fontSize(),n)&&!!p?.isVisible()&&t.focusedSeatOpacity(f,p?.getAbsoluteOpacity()??1)>=.5&&s(g))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0;if(r)for(let f of t.visibleSeatCandidates()){if(f.kind==="booth")continue;let g=t.worldToScreen(f);if(g.x<-20||g.x>t.stage.width()+20||g.y<-20||g.y>t.stage.height()+20||t.accessGlyphById.has(f.id)&&t.accessGlyphShouldShow(f.id))continue;let p=t.circleById.get(f.id);if(!p?.isVisible()){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let b=t.statusById.get(f.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(f.id)&&(b==="booked"||b==="not_for_sale"||b==="held"&&!t.ownedHold.has(f.id))){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(f.id)){t.seatLabelDrops.set(f.id,"selection-tick");continue}if(t.focusedSeatOpacity(f.id,p.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let x=hp(me*t.seatLabelScale(f),e,i),w=ni(f.displayLabel??f.label),k=p?t.seatLabelInk(f,p):t.seatPreferredLabelInk(f),v=t.seatLabelPool.get(f.id);v?(v.position({x:f.x,y:f.y}),v.text(w),v.fontSize(x),v.fontFamily(t.labelFont()),v.fill(k),v.offset({x:0,y:0}),v.scale({x:1,y:1})):(v=new qa({x:f.x,y:f.y,text:w,fontSize:x,fontStyle:$a,fontFamily:t.labelFont(),fill:k,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(f.id,v));let C=$n(t.seatR,i);if(v.fontSize(up({authoredFontSize:x,measuredWidth:v.width(),maxWidth:C,effectiveScale:e})),v.width()>C+.01){t.seatLabelDrops.set(f.id,"label-overflows-marker");continue}if(!be(v.fontSize(),e)){t.seatLabelDrops.set(f.id,"below-minimum-size");continue}if(v.offsetX(v.width()/2),v.offsetY(v.height()/2),pp(t,f.id,v),!s(v)){t.seatLabelDrops.set(f.id,"outside-viewport");continue}if(a.add(f.id),t.seatLabelById.set(f.id,v),++l>=Xr)break}for(let[f,g]of t.seatLabelPool)a.has(f)||(g.destroy(),t.seatLabelPool.delete(f));let c=new fe;for(let{node:f}of t.freeTextById.values()){if(!f.isVisible())continue;let g=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});c.insert({x:g.x-ee,y:g.y-ee,width:g.width+ee*2,height:g.height+ee*2})}let d=new fe,u=null,h=()=>{if(u)return u;u=new fe;for(let f of t.seatLabelById.values()){if(!f.isVisible())continue;let g=f.getClientRect({skipShadow:!0,skipStroke:!0});u.insert({x:g.x,y:g.y,width:g.width,height:g.height})}return u},m=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*lp;if(o.rowLabels)for(let f of fp(t.rowLabelPlan)){let g=t.rowLabelPlan[f],p=t.focusedSectionId!=null&&g.focusKeys?.includes(t.focusedSectionId),b=Math.max(e,1e-4),y=p?Math.max(g.fontSize,Rt/b):g.fontSize,S=Math.max(Math.min(y,zr(t.stage.width())/b),p?Rt/b:0);if(!r&&(!p||!m)||!p&&!be(S,n))continue;let x=t.worldToScreen({x:g.x,y:g.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let w=new qa({x:g.x,y:g.y,text:g.text,fontSize:S,fontStyle:$a,fontFamily:t.labelFont(),fill:g.ink,rotation:g.rotation,opacity:g.opacity,shadowColor:"#05070c",shadowBlur:g.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:g.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});g.pill&&va(w,g.pill),w.offsetX(w.width()/2),w.offsetY(w.height()/2);let k=t.resolveAutomaticRowLabelPosition(w,g,c);w.position(k),w.setAttr("rowLabel",!0),g.rowKey&&w.setAttr("rowKey",g.rowKey),w.setAttr("focusKeys",g.focusKeys??[]),t.rowLabelGroup.add(w);let v=w.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,P=v.x<C?C-v.x:v.x+v.width>t.stage.width()-C?t.stage.width()-C-v.x-v.width:0,T=v.y<C?C-v.y:v.y+v.height>t.stage.height()-C?t.stage.height()-C-v.y-v.height:0,L=k;if(P||T){let R=t.labelGroup.getAbsoluteTransform(),M=R.point(k);L=R.copy().invert().point({x:M.x+P,y:M.y+T}),w.position(L);let E=w.getClientRect({skipShadow:!0,skipStroke:!0});if(h().collisionCount({x:E.x,y:E.y,width:E.width,height:E.height})>0){w.destroy();continue}}let I=t.rowLabelBox(w,L);if(d.collisionCount(I)>0){w.destroy();continue}if(g.automaticAway&&c.collisionCount(I)>0){w.destroy();continue}c.insert(I),d.insert(I)}t.overlayLayer.batchDraw()}function fp(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 Zn(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:qn(e)}}function mp(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 tl(t,e){let i=Zn(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?mp({...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 gp(t){return Ja(t.labelFontSize)}function il(t){return Ri(t.labelFontSize)}function Mi(t){let e=Math.max(t.diameter,1e-4);return Math.max(se,si/e)}function nl(t){return Math.max(gp(t),Mi(t)*yi)}function ol(t){for(let e of t.seats){if(e.kind==="booth"){wp(t,e);continue}let i=t.seatContainer(e.id),n=Ds({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:vr(e.glyph,t.catByKey.get(e.categoryKey)),wheelchairBay:e.wheelchairSpaceType==="no-seat"});if(n instanceof Ue&&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 bp({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Tt(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 wp(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 yp({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 Sp({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 vp({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 rl(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 sl(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 Kp}from"konva/lib/shapes/Circle";import{Group as Pl}from"konva/lib/Group";import{Rect as Xp}from"konva/lib/shapes/Rect";import{Text as Up}from"konva/lib/shapes/Text";var Pe=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*Pe),o.height/(e.height*Pe));return K(r,i.min,i.max)}var Dt=.55;function Nt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function Qn(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??Et,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 al(t,e,i,n){let o=K(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.scale({x:o,y:o}),t.position({x:i.x-s*o,y:i.y-a*o}),!0}function ll(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*Pe),s.height/(e.height*Pe)),l=n??i.min,c=K(Math.max(a,l),i.min,Math.max(l,Nt(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 cl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function jn(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 dl(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var kp=11;function xp(t){let e=lt(kp,t),i=fi(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var Lp=4,Cp=2;function Tp(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.length<=4?e:null}function hl(t,e,i){let n=t.numberLabel,o=Tp(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.visible(!0),n.rotation(0);let r=Lp/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 Ip(t,e,i){let n=i({x:t.x(),y:t.y()}),o=t.width()*e,r=t.height()*e;return{x:n.x-o/2,y:n.y-r/2,w:o,h:r}}function Pp(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 ul(t,e,i,n){let o=[];for(let r of e){if(r.label.opacity()<=.05)continue;let s=r.back.getAbsolutePosition(),a=r.back.width()*i,l=r.back.height()*i;o.push({x:s.x-a/2,y:s.y-l/2,w:a,h:l})}if(o.length)for(let r of t){if(r.numberLabel.opacity()<=.05)continue;let s=Ip(r.numberLabel,i,n);for(let a of o)if(Pp(s,a,Cp)){r.numberLabel.opacity(0);break}}}function pl(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 bl(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(O(e.outlineTint,.5)),e.outlinePoly.fill(O(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(O(n,.72+i*.25)),e.outlinePoly.fill(O(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 eo(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function yl(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&&Te(s,e)&&(o+=1)}return o}function Rp(t,e){return eo(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*ws?"nearly-gone":"normal"}function Sl(t,e){let i=Rp(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=As(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 vl(t,e){return j(e,D(t)?"#ffffff":"#000000",fs)}function to(t,e,i=0){let n=ps-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function Mp(t,e){return wl(t,e)!=null}function wl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function kl(t,e,i){let n=to(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 Ap(t,e,i){let n=kl(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(us),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Fe:0)}function Ep(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var Fp=.05;function xl(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<=Fp}function Ll(t,e){let i,n;t.reducedMotion?(i=e<=ve?1:0,n=e<=ze?1:0):(i=K((we-e)/(we-ve),0,1),n=K((ve-e)/(ve-ze),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Z;o&&(i=1),t.zones.length||(n=0),t.seatLayer.opacity(xl(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>kn);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<Q,c=l&&o&&t.zones.length===0,d=ae(t.canvasBackground),u=K((i-.2)/.8,0,1),h=new Set(t.zones.map(g=>g.id)),m=new Set;for(let g of t.sections){let p=t.hasFocusDimOverlay?1:a&&g.id!==a&&g.logicalId!==a&&g.zone!==a?Ce:1,b=wl(t,g);b&&g.zone&&m.add(g.zone);let y=Math.min(p,dl(g.memberCategoryKeys,t.categoryFilter)?Ce:1,t.accessFilterActive&&!b?Ce:1);g.outlinePoly.opacity(o?0:(1-i)*y),g.blockPoly.opacity(Zr*i*y);let S=t.sectionIsOwned(g);g.blockPoly.stroke(S?t.selectionColor:g.shellStroke||d.sectionStroke),g.blockPoly.strokeWidth((S?Qr:Ke)/Math.max(r,1e-4));let x=g.blockPoly.fill(),w=typeof x=="string"?x:g.baseFill,k=_s(w,g.explicitInk,g.preferredInk,pr);g.nameLabel.fill(k),g.subLabel.fill(k),Ap(g,l,b);let v=g.zone!=null&&h.has(g.zone);s&&(u>.01||g.externalLabel)&&Dp(t,g,r,kl(g,l,b),!v);let C=b||!v?1:1-n;g.nameLabel.opacity(g.nameLabelFits?(g.externalLabel?1:u)*C*y:0),g.subLabel.opacity(0);let P=c&&!g.nameLabelFits,T=v&&n>.01;s&&(g.numberLabelFits=(T||P)&&hl(g,r,t.stageWidth)),g.numberLabelFits&&g.numberLabel.fill(he(w,g.explicitInk,g.preferredInk)),g.numberLabel.opacity(g.numberLabelFits?(P?u:T?n:0)*y:0)}let f=n;for(let g of t.zones){let p=t.accessFilterActive&&!m.has(g.id)?Ce:1,b=g.label.visible()?f*p:0;g.back.opacity(b),g.label.opacity(b),g.sub&&g.sub.opacity(fl(t,g)?0:b),s&&Np(t,g,r)}if(!t.glideInProgress&&(u>.01||f>.01)){Bp(t,r,c),_p(t.sections);for(let g of t.zones){let p=g.label.opacity();g.back.opacity(p),g.sub&&g.sub.opacity(fl(t,g)?0:p)}}(f>.01||c)&&(f>.01&&ul(t.sections,t.zones,r,t.worldToScreen),pl(t.sections));for(let g of t.sections)Ep(g);t.bgLayer.batchDraw()}function fl(t,e){return t.stageWidth<Q||!e.sub||!e.sub.visible()}function _p(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=U(o.outline),a=U(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function Bp(t,e,i=!1){let o=[],r=c=>{let d=t.worldToScreen({x:c.x(),y:c.y()}),u=U(ht({x:0,y:0},c.width()*e,c.height()*e,c.rotation()));return{x:d.x-u.width/2,y:d.y-u.height/2,w:u.width,h:u.height}};for(let c of t.zones){if(c.label.opacity()<=.05)continue;let d=c.back.getAbsolutePosition(),u=c.back.width()*e,h=c.back.height()*e;o.push({node:c.label,tier:0,section:!1,zone:c,box:{x:d.x-u/2,y:d.y-h/2,w:u,h}})}for(let c of t.sections){if(c.nameLabel.opacity()>.05){let d=Mp(t,c)?-1:1;o.push({node:c.nameLabel,tier:d,section:!0,area:c.labelArea,box:r(c.nameLabel)})}i&&c.numberLabel.opacity()>.05&&o.push({node:c.numberLabel,tier:1,section:!1,area:c.labelArea,box:r(c.numberLabel)})}let s=t.landmarks.map(c=>{let d=t.worldToScreen({x:c.x,y:c.y}),u=t.worldToScreen({x:c.x+c.width,y:c.y+c.height});return{x:Math.min(d.x,u.x),y:Math.min(d.y,u.y),w:Math.abs(u.x-d.x),h:Math.abs(u.y-d.y)}});if(o.length<2&&!s.length)return;o.sort((c,d)=>c.tier-d.tier||(d.area??0)-(c.area??0)||c.box.y-d.box.y||c.box.x-d.box.x);let a=[...s],l=c=>a.some(d=>c.x<d.x+d.w+4&&d.x<c.x+c.w+4&&c.y<d.y+d.h+4&&d.y<c.y+c.h+4);for(let c of o){if(!l(c.box)){a.push(c.box);continue}let d=!1;if(c.zone)for(let u of cs){if(u===0)continue;let h={...c.box,y:c.box.y+u};if(!l(h)){Jn(c.zone,0,u/e),a.push(h),d=!0;break}}if(c.section){let u=c.node.fontSize(),h=c.node.y(),m=c.node.letterSpacing()>0;for(let f of wn){let g=u*f;if(g*e<At(t.stageWidth))break;Re(c.node,g,h),m&&(c.node.letterSpacing(c.node.fontSize()*Fe),c.node.offsetX(c.node.width()/2));let p=r(c.node);if(!l(p)){a.push(p),d=!0;break}}d||(Re(c.node,u,h),m&&(c.node.letterSpacing(c.node.fontSize()*Fe),c.node.offsetX(c.node.width()/2)))}d||c.node.opacity(0)}}function Re(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function Op(t,e,i){let n=U(t);return ge({width:n.width*i,height:n.height*i,text:e})}function Dp(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<Q,s=At(t.stageWidth),a=xn(at*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&xl(t)?Math.max(a,Op(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Re(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,m]of n.entries()){e.nameLabel.text(m);let f=U(e.outline),g=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:f.height>f.width*Ss?[0,-90]:[0];for(let p of g)for(let b of e.labelAnchors)for(let y=c;y>=s;y-=1){e.nameLabel.rotation(p),Re(e.nameLabel,y/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Fe),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(b);let S=ys/i;if(ut(b,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),Re(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Fe),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=U(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function ml(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 Np(t,e,i){let n=bi(t.stageWidth),o=t.stageWidth<Q,r=e.sub!=null&&!o,s=(o?ts:ns)*n/i,a=(o?is:os)*n/i,l=xn(mi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Re(e.label,l/i,e.anchor.y),r&&(Re(e.sub,lt(gi,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*jr),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*as/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*ls-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 v of wn){let C=Math.max(Ee,l*v);if(C>=e.label.fontSize()*i-.001||(Re(e.label,C/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(ml(e.label,e.name,Math.max(u,1)),Hp(e.label.text())<Gp(e.name)&&ml(e.label,e.name,Math.max(c,1)),Re(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){gl(e);return}e.label.visible(!0),e.back.visible(!0);let m=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 f=Math.max(e.label.width(),r?e.sub.width():0)+s*2,g=e.label.height()+(r?m+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(m+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+m)/2),e.back.position(e.anchor),e.back.size({width:f,height:g}),e.back.offset({x:f/2,y:g/2}),e.back.cornerRadius(rs*n/i),e.back.strokeWidth(1/i);let p=e.back.getAbsolutePosition(),b=6,y=f*i;if(y>t.stageWidth-b*2){gl(e);return}let S=y/2,w=(K(p.x,b+S,t.stageWidth-b-S)-p.x)/i;Math.abs(w)>.001&&Jn(e,w,0);let k=62+g*i/2;p.y<k&&Jn(e,0,(k-p.y)/i)}function Hp(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function Gp(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function gl(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 Jn(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)}function Wp(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 oo(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=Wp(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function io(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 no(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 Cl(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 Vp(t){if(!t.length)return 0;let e=Cl(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,io(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return Cl(i)+e}function ro(t,e){if(!t.length)return[];let i=Vp(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,m)=>h.bounds.y-m.bounds.y||h.bounds.x-m.bounds.x||h.id.localeCompare(m.id)),d=[];for(let h of c){let m=d.find(f=>io(f.bounds,h.bounds)<=i);m?(m.bounds=no(m.bounds,h.bounds),m.rowIds.push(h.id),m.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 m=h+1;m<d.length;m+=1)if(!(io(d[h].bounds,d[m].bounds)>i)){d[h].bounds=no(d[h].bounds,d[m].bounds),d[h].rowIds.push(...d[m].rowIds),d[h].seatCount+=d[m].seatCount,d.splice(m,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 Tl(t){let e=null;for(let i of t)e=e?no(e,i.bounds):{...i.bounds};return e}function Il(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 Ml(t){return t*.3}function Rl(t){return Ml(t)*2+t*.42}var Ai=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=ro(oo(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=ae(i),o=vl(i,i),r=X(o,n.sectionInk),s=new Pl({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 Pl({listening:!1}),u=new Xp({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:Ke,opacity:ms,listening:!1,perfectDrawEnabled:!1}),h=new Kp({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),m=new Up({...c,text:l,fontSize:at,fontStyle:Xe,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(m),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:m,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<se||e>=this.host.readableScale();return this.revealed=n||Nr(Sn(i,e),Sn(i,se),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()*Et)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*Pe),d=r.height/(l*Pe);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?$p(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=ks(i,this.host.pickableScale());if(n==null||n<=i*Et)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Pe),a=r.height/(n*Pe);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=Il(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<Q,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=lt(at,i),a=gs/n,l=bs/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:m}=c;d.text(to(c.label,o)),d.fontStyle(o?hs:Xe);let f=s,g=0;for(;d.fontSize(Math.max(1,f/n)),d.letterSpacing(d.fontSize()*Fe),g=Rl(d.fontSize())+d.width()+a*2,!(g<=m.bounds.width||f<=Ee);)f=Math.max(Ee,f-1);let p={x:m.bounds.x+m.bounds.width/2,y:m.bounds.y+m.bounds.height/2},b=d.height()+l*2,y=g-a*2,S=p.x-y/2;h.radius(Ml(d.fontSize())),h.position({x:S+h.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Rl(d.fontSize()),y:p.y}),u.size({width:g,height:b}),u.offset({x:g/2,y:b/2}),u.cornerRadius(b/2),u.strokeWidth(Ke/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=oo(e,this.host.seatR()),o=ro(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=Tl(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)}},Yp=.18;function $p(t,e){let i=(n,o,r)=>{let s=o*Yp;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 qp}from"konva/lib/shapes/Circle";import{Line as Zp}from"konva/lib/shapes/Line";function Al(t,e,i){let n=t.seatRadius(),o=new qp({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 El(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 Zp({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)),f=1+(1-Math.pow(1-h,3))*.04;s.scale({x:f,y:f}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as nf}from"konva/lib/Group";import{Shape as of}from"konva/lib/Shape";import{Group as Qp}from"konva/lib/Group";import{Shape as jp}from"konva/lib/Shape";function Jp(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 ef(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 tf(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 tf(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 Be(t,e,i,n){let o=pn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new jp({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return Jp(l,h,r);l.moveTo(h[0].x,h[0].y);for(let m=1;m<h.length;m+=1)l.lineTo(h[m].x,h[m].y);l.closePath()}};n?(h=>{l.moveTo(h.start.x,h.start.y);let m=h.start;for(let f of h.segments)f.kind==="line"?l.lineTo(f.end.x,f.end.y):f.kind==="arc"?l.arc(f.center.x,f.center.y,f.radius,Math.atan2(m.y-f.center.y,m.x-f.center.x),Math.atan2(f.end.y-f.center.y,f.end.x-f.center.x),!f.clockwise):l.bezierCurveTo(f.control1.x,f.control1.y,f.control2.x,f.control2.y,f.end.x,f.end.y),m=f.end;l.closePath()})(n):d(t);for(let h of Uo(e)){let m=pn(h)>0;d(m===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=ef(t,n);return s.getSelfRect=()=>({...a}),s}var gt=class extends Qp{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 Fl(t,e){if(!e.length)return null;let i=new nf({listening:!1});for(let n of e)i.add(Be(n.outline,n.holes,{fill:Is,stroke:O("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function _l(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 of({fill:t.canvasBackground,opacity:1-Ce,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 rf=.2;function Bl(t,e){return t.startsWith("#")?j(e,t,rf):t}var Gl=.5,$=Math.SQRT1_2,sf="#f3f4f6",Ol=4;function af(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Gl:Math.min(1,Math.max(0,e))}function lf(t){return t==="booked"||t==="not_for_sale"?Ls:xs}function Dl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Nl(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 cf(t,e,i){let n=Nl(t),o=Nl(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(Dl(n,a)*(1-r)+Dl(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Hl(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 df(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-Ol;o<=Ol;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 Ei(t,e){t._sceneFunc(e)}function Wl(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,Ei(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??Gl))*n;t.save(),Hl(t,l,n,1),i.fill=i.markBase??o,Ei(e,t),t.restore(),t.save(),Hl(t,l,n,-1),i.fill=i.markFill??o,Ei(e,t),i.markHatch&&(df(t,n),i.fill=sf,Ei(e,t)),t.restore(),i.fill=o}function hf(t,e,i,n,o,r){let s=af(e),a=lf(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=cf(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(Wl)}function uf(t){t.setAttr("sceneFunc",void 0)}function _i(t){return t.attrs.sceneFunc===Wl}var Fi=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){_i(e)&&uf(e);return}hf(e,l,n,o,r,s)}};var Vl="#9ca3af";var pf="#f4b740",ff="#854d0e",mf="#1a1200",gf="#f1f4f9",bf="#1a2234",yf="#475569",Sf="#c3cbdc";function vf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function zl(t,e=!1,i=!1){if(!vf(t))return null;if(e){if(t==="not_for_sale"){let n=i?Sf:yf;return{fill:i?bf:gf,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:Vl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:pf,stroke:ff,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:mf}}return{fill:Vl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function Kl(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 Xl(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Bi=Object.freeze([]),wf=.18;function Ul(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(Bi),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:zl(o,u,u&&!D(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(ce(s,c===pt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===pt?ce(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),_i(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Tt(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 T=t.boothExtent(n.rowId);a.fontSize(T?.nameSize??(T?ge({...T,text:n.displayLabel??n.label}):He)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Qe),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let m=o==="free"||o==="held"&&!t.isOwnedHold(i),f=()=>{let T=e.fill();typeof T=="string"&&e.fill(Bl(T,l))},g=t.accessFilter();if(g&&m&&!r){let T=Ie(n,g);T==="other"?(f(),e.opacity(Math.min(e.opacity(),Ka))):T==="companion"&&e.opacity(Math.min(e.opacity(),Xa))}let p=t.categoryHighlight();p&&o==="free"&&!r&&n.categoryKey!==p&&e.opacity(.25);let b=t.seatHighlight();b&&!r&&!b.has(i)&&e.opacity(Math.min(e.opacity(),wf));let y=t.categoryFilter();y&&m&&!r&&!y.has(n.categoryKey)&&(f(),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 T=t.seatSection(i);(T?S.has(T.id)||S.has(T.logicalId)||T.zone!=null&&S.has(T.zone):S.has(or))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Cs),e.stroke(""),e.strokeWidth(0),e.dash(Bi),e.opacity(Ts),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let x=t.boothLabel(i)??t.seatLabel(i);if(x){x.fill(t.seatLabelInk(n,e));let T=!a&&(r||d);x.visible(be(x.fontSize(),t.effScale())&&e.opacity()>=.5&&!T)}let w=t.organizerGlyph,k=h?.glyph??null,v=_i(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(w&&k&&!v){let T=a?t.boothExtent(n.rowId):void 0,L=T?Math.min(T.width,T.height)/2:t.seatRadius();w.apply(e,k,h.glyphInk??"",L)}else w?.isPainted(e)&&w.clear(e);let C=t.accessGlyph(i);if(C){let T=e.fill();C.fill(ri(typeof T=="string"?T:"")),C.opacity(e.opacity()),C.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Tt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function Oi(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 m=u*u+h*h;m<n&&(n=m,i=o)}return i}function Di(t){return t?.getAttr?.("seatId")??void 0}var Ni=.85,kf=.38,xf=Object.freeze([3,3]);function Lf(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function Yl(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function Cf(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(Ht(t)||(t.clusterLabels.setPressLandsOnChart(!Yl(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}var Tf=Object.freeze([2,2]);function If(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(Ni),t.hoverRing.dash(Tf),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 Ht=t=>t.seatsPickable()||t.manageSeatHits();function $l(t){t.attachHoverCard();let e=Cf(t),i=If(t);t.seatLayer.on("click tap",n=>{if(t.moved()>ke||t.isGhostClick(n))return;let o=Di(n.target);o&&Ht(t)&&t.handleSeatTap(o)}),t.seatLayer.on("mouseover",n=>{let o=Di(n.target);if(!o)return;let r=t.seat(o);if(!r)return;i.onSeat(!0),t.setHoveredId(o);let s=Pf(t,o);t.hoverRing.position(r),t.hoverRing.opacity(s==="muted"?kf:Ni),t.hoverRing.dash(s==="muted"?xf:Bi),t.hoverRing.visible(s!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(s==="full"),t.onHover?.(r,{mark:t.seatMark(o),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 n=t.stage.getPointerPosition();n&&(e(n),i.move(n))}),t.stage.on("mouseleave",()=>i.hide()),t.stage.on("wheel",n=>{n.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let o=t.container.getBoundingClientRect(),r={x:n.evt.clientX-o.left,y:n.evt.clientY-o.top},s=Math.exp(-n.evt.deltaY*.002);t.zoomAbout(t.stage.scaleX()*K(s,.5,2),r,"frame"),e(r)}),t.stage.on("click tap",n=>{if(t.moved()>ke||t.isGhostClick(n))return;let o=t.stage.getPointerPosition();if(!o)return;if(t.sectionCount()){let s=t.ownedBadgeAt(t.screenToWorld(o));if(s&&t.focusOwnedSeats(s))return}if(!(Di(n.target)&&Ht(t))){let s=Oi(t.selectionMarkers(),o);if(s){t.focusSeats([s],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(o))return;if(t.rowLabelAt&&t.selectRow){let s=t.rowLabelAt(o);if(s){t.selectRow(s);return}}if(!t.cached()){if(Di(n.target)&&Ht(t))return;if(Ht(t)){let s=t.focusedSectionId(),a=t.manageSeatHits(),l=t.nearestSeatToScreen(o,ue),c=l?t.seatSection(l):null;if(l&&(!s||a||c&&t.sectionMatchesFocus(c))){t.handleSeatTap(l);return}let d=l?null:t.nearestSeatToScreen(o,ue,!0),u=d?t.seatSection(d):null;if(d&&(!s||a||u&&t.sectionMatchesFocus(u))){t.handleSeatTap(d);return}if(s&&t.onBackdropTap&&!t.floorOverview()){let m=t.sectionAt(o);if(m&&t.sectionInteractive?.(m)===!1)return;if(m&&m!==s){let f=t.sectionTapAnchor(m,t.screenToWorld(o));t.onSectionTap?t.onSectionTap(m,f):t.focusSection(m,{anchor:f})}else m||t.onBackdropTap();return}if(s||a)return;let h=t.sectionCount()?Lf(t,o):null;if(!h||t.effScale()>=ie||t.sectionFrameScale(h)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let s=t.floorOverview()?t.sectionAt(o):null,a=(s?t.objectFloor(s):null)??t.deckFloorAt();if(a){t.onDeckTap(a);return}}if(t.sectionCount()){let s=t.screenToWorld(o),a=t.ownedBadgeAt(s);if(a&&t.focusOwnedSeats(a)||!a&&Yl(t,o))return;let l=a??t.sectionAt(o);if(l){let c=t.sectionTapAnchor(l,s);t.onSectionTap?t.onSectionTap(l,c):t.focusSection(l,{anchor:c});return}if(!t.pressLandsOnChart(o))return}if(!t.seatsPickable()){let s=t.tableAt?.(o);if(s?.length&&t.focusSeats(s,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(o)||t.clusterLabels.glideTowardTap(o))return;let r=Math.max(Se*1.2,t.stage.scaleX()*2.5);t.zoomAbout(r,o)})}function ql(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 Pf(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function Zl(t,e){return!e.manageMode||!e.marqueeSelect?!1:t.pointerType!=="touch"&&t.button===0}var Ql=450;function jl(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<se}import{Path as Xm}from"konva/lib/shapes/Path";import{Group as Rf}from"konva/lib/Group";import{Line as Mf}from"konva/lib/shapes/Line";import{Text as Af}from"konva/lib/shapes/Text";function Jl(t,e,i,n){if(!e||!n)return;let o=er(e,i);if(!o.length)return;let r=new Rf({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new Mf({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 Af({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 Ef=10;function Ff(t){let e=t.framingViewport();if(t.stage.width()>=Q||t.exportMode())return e;let i=Ef;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 ec(t){let e=Ff(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=Bf(t);s&&t.setFitScale(_f);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=ba(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<se?se*.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(),Wn(t.stage,[t.bgLayer,t.seatLayer],e,i)),Of(t,e),t.setFitPose(qe(t.stage))}t.stage.batchDraw()}var _f=Z*(1-1e-6);function Bf(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Z&&e<Se}function Of(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=_t(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){Wn(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+Ci-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function Gt(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,ze*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function tc(t,e,i,n="now"){let o=t.stage.position();al(t.stage,e,i,Gt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.updateSeatGroupVisibility(),Df(t)):t.afterViewChange(),t.stage.batchDraw())}function Df(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function ic(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function Nf(t,e,i,n,o=0){ll(t.stage,e,Gt(t),i,Wt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function nc(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){Nf(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Wt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=Gt(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=K(Math.max(d,u),a,Math.max(u,Nt({min:a,max:l},i?.maxScale))),m=o.x+r/2-(n.x+n.width/2)*h,f=o.y+s/2-(n.y+n.height/2)*h,g=t.stage.scaleX(),p=t.stage.x(),b=t.stage.y();if(Math.abs(h-g)<1e-4&&Math.abs(m-p)<.5&&Math.abs(f-b)<.5){t.settleView();return}let y=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let x=w=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let k=Math.min(1,(w-y)/S),v=k<.5?4*k*k*k:1-Math.pow(-2*k+2,3)/2,C=g+(h-g)*v;t.stage.scale({x:C,y:C}),t.stage.position({x:p+(m-p)*v,y:b+(f-b)*v}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),k<1?t.setGlideRaf(requestAnimationFrame(x)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(x))}function Wt(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 Hf}from"konva/lib/shapes/Text";function oc(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=Gf(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function Gf(t){let e=1/0,i=new Hf({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}):He);continue}let a=me*t.seatLabelScale(s),l=ni(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:He;return H/Math.max(st,r)}function sc(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:rc(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:rc(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function rc(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 so={top:0,right:0,bottom:0,left:0};function ac(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)}:{...so}}var Wf=.7;function lc(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,m,f)=>{let g=h+m,p=f*Wf;if(g<=p||g<=0)return[h,m];let b=p/g;return[h*b,m*b]},[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 cc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function dc(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 Vt(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function hc(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 ao(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,m=e.width*c+e.height*d,f=e.width*d+e.height*c,g={x:u-m/2,y:h-f/2,width:m,height:f},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:g,fitWidth:p[0],fitHeight:p[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var uc=H,Vf=3,zf=.5;function Kf(t){return X(t,D(t)?"#475569":"#cbd5e1")}function pc(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function Xf(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=uc){let u=t.measure(n.baseFontSize);return i.occupied.insert(pc(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=uc/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*zf)return{visible:!1,reason:"shape-too-small"};let a=Vf/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=pc(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 fc(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=Kf(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=Xf({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);Uf(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function Uf(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 mc(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 lo(t,e,i,n){let o=Yf(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 Yf(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,si/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?qr:$r}function yc(t){return Math.max(t*1.05,Wr,Z*1.3)}var $f=42;function Sc(t){return $f/(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 vc(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 g of r){let p=(g.x-c.x)**2+(g.y-c.y)**2;p<u&&(d=g,u=p)}let h=e/(s*a),m=i/(s*a),f=je(r,0);return{bounds:{x:gc(d.x,h,f.x,f.width),y:gc(d.y,m,f.y,f.height),width:h,height:m},minScale:s}}function gc(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 Zf}from"konva/lib/Shape";var wc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},qf=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function kc(t,e){let i=new Map;for(let o of t){if(o.kind==="booth")continue;let r=e.get(o.rowId),s=wc(o);if(!(r&&r>0)||s==null)continue;let a=qf(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=wc(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 zt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15}get active(){return this.entries.length>0}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 f of[...e.objects,...(e.floors??[]).flatMap(g=>g.objects)])f.type==="row"&&this.spacing.set(f.id,f.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(f=>f.id===n||f.logicalId===n||d(f)),m=h.map(f=>f.id).join("|");if(!(this.key===m&&this.active)){this.clear(),this.key=m;for(let f of h){if(f.memberIds.length>2e3||f.memberIds.some(b=>!a.has(b)||!this.spacing.has(s.get(b)?.rowId??"")))continue;let g=kc(f.memberIds.map(b=>s.get(b)).filter(Boolean),this.spacing);if(!g.length||g.reduce((b,y)=>b+y.seats.length,0)!==f.memberIds.length)continue;let p=new Zf({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:b=>{let y=b._context,S=p.getStage(),x=S&&S.width()<=Q?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;y.save(),y.lineWidth=x*2,y.lineCap="round",y.lineJoin="round";let w=k=>{let v=a.get(k.id);return O(String(v.fill()),v.opacity())};for(let k of g){let v=k.points;if(v.length===1){y.fillStyle=w(k.seats[0]),y.beginPath(),y.arc(v[0].x,v[0].y,x,0,Math.PI*2),y.fill();continue}let C=k.seats.map(w),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}},T=v.map((R,M)=>{let E=v[Math.max(0,M-1)],A=v[Math.min(v.length-1,M+1)];return Math.hypot(A.x-E.x,A.y-E.y)>.001?P(E,A):P(v[M],v[M+1]??v[M-1])}),L=(R,M,E)=>({x:R.x+M.x*x*E,y:R.y+M.y*x*E}),I=0;for(;I<v.length;){let R=I;for(;R+1<v.length&&C[R+1]===C[I];)R++;let M=I===0?v[0]:{x:(v[I-1].x+v[I].x)/2,y:(v[I-1].y+v[I].y)/2},E=R===v.length-1?v[R]:{x:(v[R].x+v[R+1].x)/2,y:(v[R].y+v[R+1].y)/2},A=I===0?T[0]:P(v[I-1],v[I]),z=R===v.length-1?T[R]:P(v[R],v[R+1]),W=[M,...v.slice(I,R+1),E],Y=[A,...T.slice(I,R+1),z],re=W.map((_,G)=>L(_,Y[G],1)),N=W.map((_,G)=>L(_,Y[G],-1));y.fillStyle=C[I],y.beginPath(),y.moveTo(re[0].x,re[0].y);for(let _ of re.slice(1))y.lineTo(_.x,_.y);if(R===v.length-1){let _=Math.atan2(z.y,z.x);y.arc(E.x,E.y,x,_,_-Math.PI,!0)}else y.lineTo(N[N.length-1].x,N[N.length-1].y);for(let _ of N.slice(0,-1).reverse())y.lineTo(_.x,_.y);if(I===0){let _=Math.atan2(-A.y,-A.x);y.arc(M.x,M.y,x,_,_-Math.PI,!0)}y.closePath(),y.fill(),I=R+1}}y.restore()}});this.entries.push({section:f,shape:p,opacity:f.liftGroupSeat.opacity(),listening:f.liftGroupSeat.listening()}),f.liftGroupBg.add(p),f.liftGroupSeat.opacity(0),f.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as Qf}from"konva/lib/shapes/Text";var xc=new WeakMap,jf=(t,e)=>{let i=new Qf({text:t,fontSize:Rt,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function Lc(t,e,i,n=jf){let o=xc.get(t);o||xc.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+H+ee*2+6):0;return s.set(i,c),c}function Cc(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 co=1e6;function Jf(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function ho(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Hi=class{constructor(e,i=Jf()){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(!ho(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(co+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(ho(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(co+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!ho(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(co+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<Vr}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>ke)&&(this.endTouchProbe(),this.panLast=null,this.host.beginMarquee(i,!1))},Ql)));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=ke+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>ke&&this.clearHold()):this.pointers.size>=2&&(this.movedPx=ke+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>ke?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=K(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<=ke)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 em}from"konva/lib/shapes/Circle";import{Group as tm}from"konva/lib/Group";import{Line as im}from"konva/lib/shapes/Line";import{Text as nm}from"konva/lib/shapes/Text";var om=11,rm=.3,sm=.08;function Rc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function am(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 Mc(t,e){return e&&t.available!=null&&t.available<=0}function lm(t,e){return Mc(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function Ac(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=lm(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?We*sm:o?We*rm:We),e.polygon.listening(!t.exportMode&&!n&&!i&&!Mc(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),cm(t,e,o,r,n,t.dimmed(e.categoryKey))}}function cm(t,e,i,n,o,r){if(e.capacityNode){let s=am(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}dm(t,e,o||r),n>0&&!o?mm(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var uo=9,Tc=.86;function dm(t,e,i){hm(t,e,i),po(e)}function po(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 hm(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=um(e,r),a=Ic(n,e.nameSize??ti,s.width*Tc,r),l=Ic(o,ii,s.width*Tc,r),c=a!=null,d=l!=null&&(n?c&&a+l+uo<=s.height:l<=s.height);Pc(n,c?a:null,e.labelPoint.y-uo/r,r),Pc(o,d?l:null,n?e.labelPoint.y+uo/r:e.labelPoint.y,r)}function um(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 Ic(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>=H?r:null}function Pc(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 pm=.72;function fm(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*pm;return{x:n+r,y:o-r}}function mm(t,e,i,n){let o=om;if(!e.chip){let a=new tm({listening:!1});a.add(new em({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new im({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 nm({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=Bt(t.selectionColor),s=e.chip.findOne(".ga-chip-disc");s?.fill(t.selectionColor),s?.stroke(O(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(fm(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function Ec(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 Fc(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 _c(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(m=>{let f=U(m.outline);return{x:f.x+f.width/2,y:f.y+f.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(m=>Math.abs(m.x-i.x)<=d&&Math.abs(m.y-i.y)<=u)){let m=c.reduce((f,g)=>{let p=(g.x-i.x)**2+(g.y-i.y)**2;return p<f.distance?{point:g,distance:p}:f},{point:c[0],distance:1/0});s=m.point.x,a=m.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,m=u.y-i.y,f=h*h+m*m;f<d&&(c=u,d=f)}s=c.x,a=c.y}return{x:s,y:a}}function Bc(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||Zt(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function gm(t){return t.logicalRowId??t.rowId}function Oc(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(gm(o)!==t||!i(o.id)||n.push(o.id));return n}function Dc(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 bm}from"konva/lib/shapes/Line";import{Rect as ym}from"konva/lib/shapes/Rect";var Gi=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 bm({...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 ym({...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(Bc(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)}),h=>Zt(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 Wi=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 Nc}from"konva/lib/shapes/Rect";import{Text as Sm}from"konva/lib/shapes/Text";function Hc(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 b=t.circleById.get(p.id),y=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=p.kind==="booth"?He:me*t.seatLabelScale(p),x=o((y?.fontSize()??S)*e),w=t.worldToScreen(p),k=y?y.width()*i:0,v=y?y.height()*e:0,C=w.x-k/2<0||w.x+k/2>n.width||w.y-v/2<0||w.y+v/2>n.height,P=t.focusedSeatOpacity(p.id,b?.getAbsoluteOpacity()??0),T=t.seatSection.get(p.id),L=!!y?.isVisible()&&P>=.5&&!C,I;L||(P<.5?I="dimmed-or-unavailable":x<H?I="below-minimum-size":C?I="outside-viewport":y?I="renderer-hidden":I=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=b instanceof Nc?b.width()*i:t.seatR*2*e,M=b instanceof Nc?b.height()*e:t.seatR*2*e,E=2*(t.seatR*e+ue),A=b?.fill(),z=y?.fill(),W=t.accessGlyphById.get(p.id),Y=W?.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,...T?{sectionId:T.id}:{},...T?.zone?{zoneId:T.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:L,renderedFontPx:x,fill:typeof A=="string"?A:"",ink:typeof z=="string"?z:b?t.seatLabelInk(p,b):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:o(P),...W?{accessibilityMarker:{glyphVisible:W.isVisible(),glyphWidthPx:o(ye*Math.abs(Y?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!b?.isVisible()&&!!b?.isListening()&&t.isSelectable(p.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),E))},screenCenter:{x:o(w.x),y:o(w.y)},...L?{screenBox:{x:o(w.x-k/2),y:o(w.y-v/2),width:o(k),height:o(v)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(p=>p.visible).length,l=(p,b,y,S,x,w,k)=>{let v=ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),C=U(v.map(M=>t.worldToScreen(M))),P=o(S.opacity()),T=S.fill(),L=C.x+C.width<0||C.x>n.width||C.y+C.height<0||C.y>n.height,I=S.isVisible()&&P>.05&&!L,R=w?ut({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:p,kind:b,role:y,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...k==null?{}:{sizeFloorPx:k},opacity:P,fill:x,ink:typeof T=="string"?T:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(C.x),y:o(C.y),width:o(C.width),height:o(C.height)}}:{}}},c=p=>{let b=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof b=="string"&&b)return b;let y=p.blockPoly.fill();return typeof y=="string"?y:p.baseFill},d=p=>{let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},u=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,At(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,fi(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,b])=>{let y=b.points.map(L=>t.worldToScreen(L)),S=Math.min(...y.map(L=>L.x)),x=Math.min(...y.map(L=>L.y)),w=Math.max(...y.map(L=>L.x)),k=Math.max(...y.map(L=>L.y)),v=w<0||S>n.width||k<0||x>n.height,C=o(b.polygon.opacity()),P=C>=.1&&!v,T=b.polygon.fill();return{areaId:p,label:b.label,capacity:b.capacity,categoryKey:b.categoryKey,...b.sectionId?{sectionId:b.sectionId}:{},visible:P,interactive:b.polygon.listening(),opacity:C,fill:typeof T=="string"?T:"",effectiveBackground:b.effectiveBackground,...P?{screenBox:{x:o(S),y:o(x),width:o(w-S),height:o(k-x)}}:{}}}),m=[...t.freeTextById].map(([p,b])=>{let{node:y,kind:S}=b,x=b.plate&&b.plate.opacity()>.05?b.plate.fill():null,w=typeof x=="string"&&x?x:b.background,k=t.worldToScreen({x:y.x(),y:y.y()}),v=y.width()*i,C=y.height()*e,P=k.x-y.offsetX()*i,T=k.y-y.offsetY()*e,L=o(y.fontSize()*e),I=P+v<0||P>n.width||T+C<0||T>n.height,R=y.isVisible()&&!I,M=y.fill(),E=o(y.getAbsoluteOpacity()),A;return R||(L<H?A="below-minimum-size":I?A="outside-viewport":A="renderer-hidden"),{objectId:b.objectId??p,kind:S,text:y.text(),visible:R,renderedFontPx:L,ink:typeof M=="string"?M:"",background:w,opacity:E,...R?{screenBox:{x:o(P),y:o(T),width:o(v),height:o(C)}}:{},...A?{hiddenReason:A}:{}}}),f=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof Sm).map(p=>{let b=p.getClientRect({skipShadow:!0,skipStroke:!0}),y=b.x+b.width<0||b.x>n.width||b.y+b.height<0||b.y>n.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!y,renderedFontPx:o(p.fontSize()*e),ink:typeof S=="string"?S:"",...y?{}:{screenBox:{x:o(b.x),y:o(b.y),width:o(b.width),height:o(b.height)}}}}),g=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:H,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((p,b)=>p+b.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:g.length,categoryPaintedSectionShells:g.filter(p=>{let b=p.blockPoly.fill();return typeof b!="string"||!Cn(t.canvasBackground,b)}).length,tintedSectionShells:g.filter(p=>{let b=p.blockPoly.fill();return typeof b=="string"&&Es(t.canvasBackground,b)}).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:m,rowLabels:f}}import{Circle as Rm}from"konva/lib/shapes/Circle";import{Ellipse as Mm}from"konva/lib/shapes/Ellipse";import{Line as Am}from"konva/lib/shapes/Line";import{Arrow as Em}from"konva/lib/shapes/Arrow";import{Path as Fm}from"konva/lib/shapes/Path";import{Rect as Kt}from"konva/lib/shapes/Rect";import{Text as go}from"konva/lib/shapes/Text";import{Image as Xc}from"konva/lib/shapes/Image";import{Group as Gc}from"konva/lib/Group";import{Circle as vm}from"konva/lib/shapes/Circle";import{Path as wm}from"konva/lib/shapes/Path";function km(t,e){let i=e?.trim();return i&&i.toLowerCase()!==Cr?i:Pt[t.group]}var Wc=new WeakMap;function Vi(t){let{icon:e,size:i}=t,n=km(e,t.color),o=D(n)&&n!==Pt[e.group]?fr:di,r=D(t.background)?0:i*fn.ringRatio,s=t.listening??!1,a=new Gc({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new vm({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:mr,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*fn.glyphScale,c=new wm({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/mn,scaleY:l/mn,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),Wc.set(a,{glyph:c,icon:e}),a}function fo(t,e,i){let n=t instanceof Gc?Wc.get(t):void 0;if(n?.icon.solidLarge){let o=xr(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function Vc(t,e,i){let n=hi("wheelchair"),o=Rr(t);if(!n||!o)return null;let r=Pr(e),s=Vi({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 xm}from"konva/lib/Group";import{Path as Lm}from"konva/lib/shapes/Path";import{Rect as Cm}from"konva/lib/shapes/Rect";import{Text as Tm}from"konva/lib/shapes/Text";function Im(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function Pm(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=di,c=new Tm({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?Lr("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,m=u+h+c.width(),f=Math.max(o,m+n),g=new xm({name:"gate-sign",x:r,y:s,rotation:Im(t.rotation??0),listening:i.hitTarget===!0});g.add(new Cm({name:"gate-sign-pill",x:-f/2,y:-n/2,width:f,height:n,cornerRadius:n/2,fill:t.fill??Pt.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=-m/2;return d&&(g.add(new Lm({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}),g.add(c),g.setAttr("gateSignHeight",n),{group:g,fontSize:a,bounds:{x:r-f/2,y:s-n/2,width:f,height:n}}}function zc(t,e){if(e.gate.hideFromBuyers)return;let i=Pm(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 Uc(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 Xc({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 Yc(t,e){let i=new window.Image,n=new Xc({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:K(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(U(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 $c(t,e){let i=e.fill??t.theme.decorFill??Xn,n=ce(i,.12);if(e.shape==="round")t.bgLayer.add(new Rm({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 Kt({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(!Ct(e))return;let o=Xt(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,X(i,t.theme.textColor??"#cbd5e1"),Ge(e)??ur,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var _m=8,Bm=6;function Om(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(_m,e*.35),o=Math.max(Bm,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function qc(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??X(i,t.theme.textColor??Ya),o=e.semanticKind==="icon"?hi(e.iconKey):void 0;if(o){let d=Vi({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=Zo(e),l=new go({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Un(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 Kt({x:e.position.x,y:e.position.y,...Om(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 Zc(t,e){if(Er(e)){zc(t,e);return}let i=e.fill??t.theme.decorFill??Xn,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=qo(e),a=ae(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?ce(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?K(e.opacity,.1,1):1,m=0,f=0,g=null;if(c&&e.points&&e.points.length>=2){m=e.points.reduce((w,k)=>w+k.x,0)/e.points.length,f=e.points.reduce((w,k)=>w+k.y,0)/e.points.length;let p=Mr(e),b=Ar(u),y=Tr(e),S=new Em({points:e.points.flatMap(w=>[w.x,w.y]),closed:!1,x:m,y:f,offsetX:m,offsetY:f,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",...b,listening:!1,name:"buyer-shape-open-path",...y?{dash:Ir(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let x=y?Vc(e,u,t.canvasBackground):null;x&&t.bgLayer.add(x)}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,Ne(l,.3),1,ce(l,.12)]}:{fill:l};m=e.x+e.width/2,f=e.y+e.height/2,g={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Kt({x:m,y:f,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:u,cornerRadius:K(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){m=e.x+e.width/2,f=e.y+e.height/2,g={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,Ne(l,.3),1,ce(l,.12)]}:{fill:l};t.bgLayer.add(new Mm({x:m,y:f,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=Wo(e),b=U(p);m=e.points.reduce((x,w)=>x+w.x,0)/e.points.length,f=e.points.reduce((x,w)=>x+w.y,0)/e.points.length,g=b;let y=n?{fillLinearGradientStartPoint:{x:0,y:b.y},fillLinearGradientEndPoint:{x:0,y:b.y+b.height},fillLinearGradientColorStops:[0,Ne(l,.3),1,ce(l,.12)]}:{fill:l},S=Be(p,Vo(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},Go(e)??void 0);S.setAttrs({x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,...y}),t.bgLayer.add(S)}g&&e.role&&t.landmarkBoxes.push(g);for(let p of Xo(e))t.bgLayer.add(new Am({points:p.points.flatMap(b=>[b.x,b.y]),closed:p.closed,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,stroke:p.ink??Ko,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:b}=Nm(t,m,f,e.label,l,g,e.labelStyle);t.primaryFocalLabels.set(p,b),t.freeTextById.set(e.id,{node:p,background:l,plate:b.plate,kind:"stage"})}else if(r){let p=o||s,b=X(l,p?"#e6e9f0":"#9aa3b5"),y=Xt(t,t.bgLayer,e.label,m,f,b,p?18:12,!1);p&&t.primaryFocalLabels.set(y,{targetPx:18,trackingRatio:0,ink:String(y.fill()??""),plateInk:String(y.fill()??""),plate:new Kt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:y,background:l,kind:"decor",...p?{}:{area:ao(e.rotation,g,m,f,12,b,l)}})}else{let p=X(l,"#cbd5e1"),b=Xt(t,t.bgLayer,e.label,m,f,p,16,!0);t.freeTextById.set(e.id,{node:b,background:l,kind:"decor",area:ao(e.rotation,g,m,f,16,p,l)})}}var mo=22,Kc=H,zi=6,Dm=.5;function Nm(t,e,i,n,o,r,s){let a=s?.size??mo,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=Hm(t.canvasBackground,o),m=new Kt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new go({x:d,y:u,text:n,fontSize:a,fontStyle:Un(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/mo),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f),{node:f,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/mo,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??X(h,l),plate:m}}}function Hm(t,e){return j(e,D(t)?"#ffffff":"#000000",.34)}function Qc(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(Kc,e.targetPx*Dm)*s)/r,c=b=>{t.letterSpacing(b*e.trackingRatio),n(t,b)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=Oo(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},m=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(m<1&&(l=Math.max(Kc/r,l*m),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let g=(u?t.height():t.width())+zi*2,p=(u?t.width():t.height())+zi;e.plate.size({width:g,height:p}),e.plate.offset({x:g/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function jc(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=gr(i,n,We),r=t.theme.textColor??"#e6e9f0",s=X(o,r),a=Be(e.points,e.holes,{fill:i,opacity:We,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",g=>{t.isGhostClick(g)||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=Qt(e.points,e.holes),c=t.sections.find(g=>te(l,g.outline,g.holes)),d=Ge(e)??ti,u=Ct(e)?Xt(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Xt(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,ii,!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 m=xt(e)>0?new Fm({data:nt(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;m&&t.bgLayer.add(m);let f={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:i,labelPoint:l,labelNode:u,...Ge(e)!==void 0?{nameSize:d}:{},capacityNode:h,...m?{wheelchairGlyph:m}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,f),po(f)}function Xt(t,e,i,n,o,r,s,a){let l=new go({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 Jc(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 m=d.segmentedRow&&!u?d.segmentedRow.groupId:d.id,f=(o.get(m)??[]).slice().sort((E,A)=>s(E)-s(A));if(!f.length)continue;let g=f[0],p=f[f.length-1],b=h?.labelStyle,y=h?.style==="pill"?Ot(n):null,S=y?y.plate:n,x=he(S,b?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Ve),w=b?.size??hr,k=h?.rotation??0,v=e.objectFilteredOut(d)?.15:1,C=f.reduce((E,A)=>E??e.seatSection.get(A.id),void 0),T=d.segmentedRow?.displayLabel??d.displayLabel??It(d.label,C?.label);if(!T)continue;let L=C?[...new Set([C.id,C.logicalId,C.zone].filter(E=>!!E))]:void 0,I=(E,A,z)=>i.push({text:T,x:E,y:A,rotation:k,fontSize:w,ink:x,opacity:v,rowKey:m,...y?{pill:y}:{},...L?.length?{focusKeys:L}:{},...z?{automaticAway:z}:{}});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 E=d.rotation*Math.PI/180,A={x:-Math.cos(E),y:-Math.sin(E)};I(g.x+A.x*R,g.y+A.y*R,A)}if(M==="end"||M==="both"){let E=(d.rotation+d.curve)*Math.PI/180,A={x:Math.cos(E),y:Math.sin(E)};I(p.x+A.x*R,p.y+A.y*R,A)}}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(m=>Math.hypot(m.x-d.x,m.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 bo(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 ed(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 m=a*h;l.push({x:s.x*m,y:s.y*m},{x:-s.x*m,y:-s.y*m},{x:r.x*m,y:r.y*m},{x:(r.x+s.x)*m,y:(r.y+s.y)*m},{x:(r.x-s.x)*m,y:(r.y-s.y)*m})}let c=o,d=1/0,u=1/0;for(let h of l){let m={x:o.x+h.x,y:o.y+h.y},f=bo(t,m),p=(n?rt(n,f,{mode:"overlap"}).length:0)+i.collisionCount(f),b=Math.hypot(h.x,h.y);if((p<d||p===d&&b<u)&&(c=m,d=p,u=b),p===0)break}return c}var Ki=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 td(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 id(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 Gm(t){return t<0?0:t>1?1:t}function nd(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)}},m=()=>{a||s||(a=!0,u(),t.done())},f=p=>{for(let b=c.length-1;b>=0;b--){let y=c[b],S=n?1:Gm((p-y.startedAt)/160);t.fade(y.work,S),S>=1&&c.splice(b,1)}return c.length>0},g=()=>{if(s)return;let p=e(),b=p;for(;r<t.chunks.length&&(r===0||e()-b<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()-b>=i)break}let y=f(p);t.draw(),r<t.chunks.length||y?h(g):m()};return h(g),{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(),m()}},get done(){return a}}}var Wm={width:40,height:30,rotation:0};function od(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)??Wm;if(l.points&&l.points.length>=3){for(let f of l.points)s.x+f.x<i&&(i=s.x+f.x),s.y+f.y<n&&(n=s.y+f.y),s.x+f.x>o&&(o=s.x+f.x),s.y+f.y>r&&(r=s.y+f.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)),m=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-m<n&&(n=s.y-m),s.x+h>o&&(o=s.x+h),s.y+m>r&&(r=s.y+m);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 rd(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 sd=!1;function ad(t){return t&&t!=="flat"&&!sd&&(sd=!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 dd}from"konva/lib/Group";import{Rect as Vm}from"konva/lib/shapes/Rect";import{Text as yo}from"konva/lib/shapes/Text";function hd(t,e){let i=Qt(e.outline,e.holes),n=ae(t.canvasBackground),o=[],r=new Map,s=0,a=U(e.outline),l=t.seatIndex?rt(t.seatIndex,a).map(L=>t.seatById.get(L)).filter(L=>!!L):t.seats;for(let L of l)t.seatSection.has(L.id)||te(L,e.outline,e.holes)&&(o.push(L.id),r.set(L.categoryKey,(r.get(L.categoryKey)??0)+1),(t.statusById.get(L.id)??"free")==="free"&&s++);let c=e.color??ei([...r].map(([L,I])=>({hex:t.catColor.get(L)??"#6e7bff",w:I})),"#3a4358"),d=new dd({listening:!1});t.bgLayer.add(d);let u=new dd({listening:!1});d.add(u);let h=new gt({listening:!0});t.seatLayer.add(h);let m=u,f=cd(t.chartDoc,e),g=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",p=Be(e.outline,f.holes,{visible:!f.hidden,stroke:O(g,.5),strokeWidth:1,fill:O(g,.08),listening:!1},e.outlinePath);m.add(p);let b=Be(e.outline,f.holes,{visible:!f.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:Ke,opacity:0,listening:!1},e.outlinePath);m.add(b);let y=e.labelPresentation?.labelStyle,S=y?.color,x=n.sectionInk,w=(y?.size??18)/18,k=new Vm({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});m.add(k);let v=new yo({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:Xe,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,x),listening:!1,perfectDrawEnabled:!1});v.offsetX(v.width()/2),v.offsetY(v.height()/2),m.add(v);let C=new yo({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Xe,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,x),opacity:0,listening:!1,perfectDrawEnabled:!1});m.add(C);let P=new yo({x:i.x,y:i.y,text:F("map.seatsLeft",{count:s}),fontSize:12,fontStyle:ds,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),m.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]:[],...Ea(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(L=>t.seatById.get(L)?.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:Ho(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:g,outlinePoly:p,blockPoly:b,namePlate:k,nameLabel:v,numberLabel:C,subLabel:P,preferredInk:x,...S?{explicitInk:S}:{},labelScale:w,authoredLabelSize:y?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function pd(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=jn(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:bt(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};Qn({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 bt(t){let e=Sc(Math.max(t.seatR,t.markerR));return Math.max(e,ja(t.markerR))}var ud=.25;function zm(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*ud/Math.max(i.width,1e-6),n.height*ud/Math.max(i.height,1e-6))}function fd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=md(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 Qn({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:bt(t)}),!0}function md(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Ie(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function gd(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&&Ie(s,n)==="match"});return o.length&&So(t,o)||t.focusSection(e),!0}function bd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=md(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*Dt&&r.height>=s.height*Dt;return{spaces:n.length,sections:wo(t,i),wholeVenue:a}}function So(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*Dt&&r.height>=s.height*Dt)return!1;let a=jn(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=zm(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(bt(t),u),d)}),!0}function yd(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:bt(t),focusPaddingPx:l})}function vo(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let n=Sd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,n),n}function Sd(t,e,i){return yl(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function wo(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?vo(t,r):Sd(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 Um=1800,Yt=class Yt{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=Yn;this.effSelection=pt;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;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 Fi;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={...so};this.fitClearance={bottom:0,width:0};this.seatR=J;this.markerR=J;this.seatPitch=0;this.sellableUnit=Zn(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 Ki;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.readingFocusedFrame=!1;this.marquee=new Gi({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 Wi(()=>{this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)});this.interactionHostCache=null;this.seatLabelTargetScale=oc(()=>({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=Xi.pixelRatio;if(this.exportMode&&(this.dpr=1),Xi.pixelRatio=this.dpr,this.stage=new Km({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Hi(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 ko({listening:!this.exportMode}),this.seatLayer=new ko({listening:!this.exportMode}),this.overlayLayer=new ko({listening:!1}),this.labelGroup=new Ut({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new Ut({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new Ut({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Ai({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:()=>il(this.sellableUnit),pickableScale:()=>Mi(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 vd({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:Ni,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new vd({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&&(Xi.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&id(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 zt: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 ki({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 xi({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 Ii({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})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Li({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Bt(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(fa({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 Ti({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=>Zl(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.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new zt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??jt(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 Ut({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=ci(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,Si[l%Si.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=mc(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}))}:{},...Ct(a)?{}:{nameHidden:!0},...Ge(a)?{nameSize:Ge(a)}:{}});if(this.seats=De(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===e?this.seats:De(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=kr(this.seats,{seatRadius:this.seatR}),this.seatPitch=Za(this.seats),this.markerR=Qa(this.seatR,this.seatPitch),this.sellableUnit=tl(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=$o(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new Ut({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?od(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),Jl(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=rd({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=nd({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:kt(e)};if(this.floorOverview&&e.floors.length>=2)return tt(e)==="combined"?Jo(e):jo(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...Yo(e),referenceImage:void 0,backgroundImage:kt(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:kt(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?jt(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?jt(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=ei([...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=Kl({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&&Xl(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<=Yr;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 Dc(e,i)}selectRow(e){let i=Oc(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&&Al(this.flashHost,n,i)}flashSection(e,i="#22a06b"){El(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),m=u+h*2.5;m<s&&(s=m,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()},Um)),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=ac(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 lc(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){return sc(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return hc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){ec(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(nl(this.sellableUnit),this.hasSections?we: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},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 cc(this.stage)}setCameraPose(e){this.cancelGlide(),dc(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()*Yt.ZOOM_STEP,Vt(this.framingViewport()))}zoomOut(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()/Yt.ZOOM_STEP,Vt(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);cl(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(){Ac({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=>Rc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Z,effScale:()=>this.effScale(),labelLegible:e=>be(e,this.effScale())})}setGAStates(e){Ec(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){pd(this.focusFramingContext,e,i)}diveCeiling(){return bt(this.focusFramingContext)}focusAccessibleSeats(e){return fd(this.focusFramingContext,e)}focusAccessibleSection(e,i){return gd(this.focusFramingContext,e,i)}accessibleSpread(e){return bd(this.focusFramingContext,e)}setViewMode(e){ad(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.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:Ce)}sectionScreenBounds(e){return Fa({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Z,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 Pi(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){ol({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 Xm({x:e.x,y:e.y,data:nt(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:ri(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Cc(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)?Gr:Hr,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&&Te(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`${Ye(i.min,this.currency)}\u2013${Ye(i.max,this.currency)}`;let n=this.catPrice.get(e);return typeof n=="number"?Ye(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.colorblind?this.cbHueByKey.get(e)??Si[0]:this.catColor.get(e)??"#6e7bff":Pa}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 he(typeof n=="string"?n:"",e.labelStyle?.color,this.theme.seatLabelColor??Qe,Ve)}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){Ul(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){if(e!==this.colorblind){this.colorblind=e,this.repaintSeats();for(let i of this.sections)i.shellCategoryColor=this.dominantSellableColor(i.memberIds),this.refreshSectionFill(i);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 So(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}}yd(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()>=Q}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()>=se}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()>=Mi(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=Fl(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=_l(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),m=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:n+s*m,y:o+a*m}),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){Ra(this.readingAidsHost,e)}setLabelLayers(e){Ma(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Aa(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=kt(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){Uc(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){Yc(this.objectDrawContext,e)}renderTable(e){$c(this.objectDrawContext,e)}renderText(e){qc(this.objectDrawContext,e)}renderShape(e){Zc(this.objectDrawContext,e)}renderGA(e){jc(this.objectDrawContext,e)}renderSection(e){let i=hd(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){bl(this.sectionLodPaintContext,e)}refreshSectionFill(e){Sl(this.sectionLodPaintContext,e)}isSectionClosed(e){return eo(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Ps(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return vo(this.focusFramingContext,e)}accessibleSections(e){return wo(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,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||Ga({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)||Oi(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)||lo(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?Ie(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?dn(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let n=dn(getComputedStyle(i).backgroundColor);if(n)return n;i=i.parentElement}}return Yn}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:D(this.canvasBackground)?Ua: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){return Na({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(),Wt(this.framingViewport(),this.focusedRowLabelGutter(e))),Nt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return Lc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return sl(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return rl(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(){$l(this.interactionHost)}handleSeatTap(e){ql(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=>Wa({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=>lo(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),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):Vt(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 Gt(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),tc(this.cameraHost,e,i,n)}cancelZoomSettle(){ic(this.cameraHost)}focusRegion(e,i){nc(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(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Z?"seats":this.zones.length&&e<ze?"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),Hc(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let i=e==="sections"?(ve+Z)/2:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),n=this.framingViewport(),o=n.width,r=n.height,s=Vt(this.framingWorldRect()),{x:a,y:l}=_c({rung:e,sections:this.sections,seats:this.seats,viewCentre:s,target:i,width:o,height:r}),c=o/(i*1.12),d=r/(i*1.12);this.focusRegion({x:a-c/2,y:l-d/2,width:c,height:d})}seatRungScale(){return yc(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Wt(this.framingViewport(),o);return vc({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(Z,this.sectionFrameScale(this.focusedSectionId)*.85)||jl({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()<Z))return;let o=(i&&e?this.sectionAt(e):null)??_a({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()},Ur))}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(),we+.01,ie):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)Qc(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(Ll(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Z,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Z),()=>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=Ns(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<Z;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),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;this.updateSeatGroupVisibility();let e=K(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(){td(Xi,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Z?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,H/e))}let c=r==="detail"&&!this.exportMode&&e<ve,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,vs/Math.max(i.fontSize()*e,1e-6));i.scale({x:u,y:u}),n?.scale({x:u,y:u})}}fc({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(fo(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.rowLabelPlan=Jc(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 bo(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return ed(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(){el(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(),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=Fc({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)}};Yt.ZOOM_STEP=1.4;var xo=Yt;function wd(t,e){return new xo(t,e)}function Ym(t,e){return t*2*.6*e>=6}function $m(t,e){t._sceneFunc(e)}function Lo(t){let e=this,i=e.attrs;$m(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Ym(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 kd(t){return t.attrs.sceneFunc===Lo}function xd(t){kd(t)&&t.setAttr("sceneFunc",void 0)}function qm(t,e,i,n){if(!e){xd(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==Lo&&t.setAttr("sceneFunc",Lo)}function Ld(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 Co(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=Pd(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function Cd(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 Td(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 Id(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Pd(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 Pd(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 Rd(t,e){return t.accessFilter?Ie(e,t.accessFilter)==="other":!1}function Md(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=Zm(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&&Co(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function Zm(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 Ad(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(Jt(t).map(h=>[h.id,h])),c=rr(t),d=it(t),u=li(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 m=l.get(h.rowId),f=m&&"label"in m&&typeof m.label=="string"?m.label:void 0,g=m?.type==="row"?m.segmentedRow:void 0,p=g?.displayLabel??(m&&"displayLabel"in m&&typeof m.displayLabel=="string"&&m.displayLabel?m.displayLabel:f),b=i.get(h.rowId),y=m?.type==="table"?"table":m?.type==="booth"?"booth":"seat",S=p,x=g?.displayType?.trim()||(m&&"displayType"in m&&typeof m.displayType=="string"&&m.displayType.trim()?m.displayType.trim():void 0),w=h.displayLabel??h.label,k=w.split("-"),v=b||h.kind==="booth"?void 0:p&&w.startsWith(`${p}-`)?w.slice(p.length+1):k[k.length-1]??w;s.set(h.id,{objectId:h.rowId,objectType:y,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:v,...x?{displayType:x,rowType:x}:{},...Qm(m,h.sectionId?d.get(h.sectionId):void 0),...m?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function Qm(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 Ed(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 Fd(t,e,i,n=1){let o=sr(t),r=it(t);return Lt(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)),...jm(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function jm(t,e,i){let n=sn(t,i),o=an(t,i),r=xt(t),s=i===2&&n.length===1&&n[0]===t.label?on(t):null;if(s){let{min:l,max:c}=rn(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 _d(t,e,i){let n=Math.floor(e),o=sn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?on(t):null;if(r){let{min:d,max:u}=rn(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!xt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=an(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 Jm(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 Bd(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?Jm(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 Od(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 eg(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function Dd(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=eg(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?Do.filter(r=>n.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var vC=5e3,wC={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function tg(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 Nd(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!tg(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 kC(t){return t.lost.length>0||t.holdLapsed}function xC(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function Hd(t,e,i=Date.now()){return e&&i<t+5e3}function Gd(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 Wd(t){if(!t?.zones?.length)return[];let e=new Set(ar(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 Vd(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=De(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&&!Te(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=Br(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 To=["background","rowLabelColor","textColor","selectionColor"];function zd(t,e){return!t||!e?!t&&!e:To.every(i=>t[i]===e[i])}function yt(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Ui(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Kd(t,e,i){let n=tr(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}var Me=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function Io(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function Xd(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var Yi=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 Ud(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 Me(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let u=r.find(f=>f.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),m=h?t.toSeat(h):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),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 Yd(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 $d(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 qd(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 Me(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),m=h?t.toSeat(h):null;return{label:u,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),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}=yt(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let m=new Set(u.map(p=>p.label)),f=t.idsForLabels(m);f.length&&(o.setStatus(f,"booked"),o.deselect(f),t.resetTableQuantitiesForLabels(m));let g=r.filter(p=>!m.has(p));g.length&&a&&t.api.release(t.key,g,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 Zd(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 Qd(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 jd(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function Jd(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 eh(t,e){let{status:i,conflicts:n}=yt(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 th(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 ih(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function nh(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(Hd(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function oh(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function rh(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 ng(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function og(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=>ng(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function sh(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")&&og(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 ah(t){let{id:e,doc:i,seatById:n,groupedTableBySeatId:o}=t,r=k=>k.type==="section"&&(k.id===e||k.logicalSectionId===e),s=i.floors?.find(k=>k.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,m=0;for(let k of l){let v=n.get(k);if(!v)continue;t.matchesAccessFilter&&t.statusOf(k)==="free"&&t.matchesAccessFilter(v)&&(m+=1);let C=o.get(k);if(C){if(u.has(C.label))continue;u.add(C.label),c.set(C.categoryKey,(c.get(C.categoryKey)??0)+C.maxOccupancy),t.statusOf(C.chairs[0]?.id??k)==="free"&&(h+=C.maxOccupancy,d.set(C.categoryKey,(d.get(C.categoryKey)??0)+C.maxOccupancy))}else c.set(v.categoryKey,(c.get(v.categoryKey)??0)+1),t.statusOf(k)==="free"&&(h++,d.set(v.categoryKey,(d.get(v.categoryKey)??0)+1))}let f=[...c.entries()].map(([k,v])=>{let C=i.categories.find(R=>R.key===k),P=C?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],T=P.length?P:typeof C?.price=="number"&&Number.isFinite(C.price)?[C.price]:[],L=T.length?Math.min(...T):void 0,I=T.length?Math.max(...T):void 0;return{key:k,count:v,label:C?.label??k,color:C?.color??"#6e7bff",...L!==void 0?{price:L,priceMin:L,priceMax:I}:{}}}).sort((k,v)=>(k.priceMin??1/0)-(v.priceMin??1/0)||k.key.localeCompare(v.key)),g=f.flatMap(k=>k.priceMin===void 0?[]:[k.priceMin]),p=f.flatMap(k=>k.priceMax===void 0?[]:[k.priceMax]),b=a.zone?i.zones?.find(k=>k.id===a.zone):void 0,y=k=>{let v=null,C=0;for(let[P,T]of k)(T>C||T===C&&v!=null&&P<v)&&(v=P,C=T);return v},S=y(d)??y(c),w=(S?f.find(k=>k.key===S)?.color:void 0)??b?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:m}:{},label:a.displayLabel??a.label,zoneLabel:b?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:w,seatsLeft:h,...g.length?{priceMin:Math.min(...g),priceMax:Math.max(...p)}:{},categories:f}}var $i=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 lg=!0,cg=!0,dg=10,hg=15e3,dh=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new Yi;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 $i;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=oh(e.numberOfPlacesToSelect);let i=rh(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,dg);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=lr(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let n of To){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return zd(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=Lt(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=L=>Math.round((performance.now()-L)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(L=>({ok:!0,res:L,elapsed:o(r)}),L=>({ok:!1,error:L,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(L=>({ok:!0,objects:L,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=Xd(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 L=Or(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(L.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(L.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(L.flatMap(I=>I.chairs.map(R=>[R.id,I]))),this.tableQuantities=new Map(L.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=L.reduce((I,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(L){return this.emitError(L),null}this.expandedSeats=De(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=Ad(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 L of this.groupedTablesByLabel.values()){let I=L.chairs[0];I&&(this.labelToId.set(L.label,I.id),this.labelToSeat.set(L.label,I))}n.normalizeBuyerModel=o(u);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let f=performance.now(),g=wd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(i),this.opts.onSeatsRevealed?.()},onSelect:L=>{this.handleRendererSelect(L)},onDeselect:L=>{this.handleRendererDeselect(L)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(L,I)=>{this.opts.onHover?.(L),this.opts.onSeatHover&&this.opts.onSeatHover(L?this.describeSeat(L,I):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(L,I)=>this.previewSection(L,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:L=>this.opts.onSectionFocus?.(L==null||this.isSectionClosed(L)?null:this.sectionSummary(L)),onDeckTap:L=>this.handleDeckTap(L),onFps:this.opts.onFps});if(n.createRenderer=o(f),this.closed)return g.destroy(),null;this.renderer=g,this.viewportInsets&&g.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&g.setFitClearance?.(this.fitClearance);let p=null,b="free",y=[],S,x=await l;if(x.ok){let L=x.objects;this.hidden=new Set(L.hidden??[]),y=(L.closed??[]).filter(I=>typeof I=="string"),p=L.seats,b=L.default??"free",S=typeof L.fetchedAt=="number"?L.fetchedAt:void 0}if(n.loadStatuses=x.elapsed,this.closed)return g.destroy(),this.renderer=null,null;let w=performance.now();this.opts.categoryPriceRanges&&g.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),g.setChart(this.visibleDoc()),this.applyRowBandPreview(g),Kd(g,d.doc,e.clientWidth),this.opts.colorblindSafe&&g.setColorblindSafe?.(!0),n.buildScene=o(w),this.closedSections=new Set(y);let k=performance.now();y.length&&g.setClosedSections?.(y),this.seatsBuilt=!0;let v=this.pendingSnapshot;this.pendingSnapshot=null;let C=ch(v,p?{seats:p,default:b,fetchedAt:S}:null);C&&this.applySeatsMap(C.seats,C.default,C.source,C.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(k);let P=performance.now();g.forceDraw(),n.firstPaint=o(P);let T=performance.now();return x.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(T),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Io(d.event.status),eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:m,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 Me(bn(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 sh(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&&gn(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 lg&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(cg||!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 Me(bn([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 Ud(this,e,i)}resumeHold(e){return Yd(this,e)}extendHold(e){return $d(this,e)}categoryAvailability(){return Od({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?Fd(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Bd(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=Lt(o).find(d=>d.id===e);if(!r)return null;let s=_d(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 Wd(this.visibleDoc())}pickPremiumBlock(e,i,n){return Vd({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}=yt(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}=yt(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return qd(this,e,i,n)}release(){return Zd(this)}releaseLabels(e){return Qd(this,e)}releaseConfirmed(e,i){return jd(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 ci(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){Ld(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 Co(this.pickerFocusContext,e)}accessibilitySpread(e){return Cd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Id(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Rd(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){Md(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);Td(this.pickerFocusContext,e,n,i),this.opts.onSectionFocus?.(n)}sectionSummary(e){return!this.renderer||!this._doc?null:ah({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=>Te(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=>ui(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=Fr(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?ui(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 ui(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 _r(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?gn(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 Jd(this,e)}handle409Conflicts(e){eh(this,e)}setHold(e,i="created"){th(this,e,i)}clearHold(){ih(this)}expireActiveHold(){return nh(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=Ui(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[Ui(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=Nd({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 Dd(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=Gd(()=>{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=Ui(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=Ed(e,{baseMs:1e3,maxMs:hg,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var ug=5,pg=-1.1,Po=35;function Ro(t,e){let i=t-Ae,n=Math.atan2(ug-i,e)*180/Math.PI,o=Math.atan2(pg-i,e)*180/Math.PI;return o<-Po&&(n+=-Po-o,o=-Po),{topPitch:n,basePitch:o}}var ne=2048,xe=1024,qt=zo,B=Math.PI*2,fg=xe/180,vt=t=>(t+180)/360*ne,q=t=>(90-t)/180*xe;function mh(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 gh(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 qi=96,Eo=360/qi,mg=.6,Mo=[17,23,42];function Ao(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(Mo[0]-t[0])*n),r=Math.round(t[1]+(Mo[1]-t[1])*n),s=Math.round(t[2]+(Mo[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function hh(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 le(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 uh=new Map;function ph(t){if(!t)return null;let e=uh.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=le(n,.3,.42);return uh.set(t,o),o}function gg(t,e,i,n){let o=new Array(qi).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,m=h-n;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,u)*180/Math.PI,g=Math.atan2(h-Ae-n,u)*180/Math.PI,b=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,y=Math.min(qi-1,Math.max(0,Math.floor((b+180)/Eo))),S=f>34&&u<16,x=o[y];x?(f>x.top&&(x.top=f),g<x.base&&(x.base=g),u<x.nearM&&(x.nearM=u,x.tint=ph(a.categoryKey)),x.overhead=x.overhead||S):o[y]={top:f,base:g,nearM:u,overhead:S,tint:ph(a.categoryKey)}}return{bins:o,maxDelta:r}}function bg(t,e,i,n){for(let o=0;o<qi;o++){let r=e[o];if(!r)continue;let s=-180+o*Eo,a=i(s),l=i(s+Eo);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 m=r.nearM/95,f=r.tint,g=f?hh([44,54,80],f,.34):[44,54,80],p=f?hh([24,30,48],f,.28):[24,30,48],b=t.createLinearGradient(0,u,0,h);b.addColorStop(0,Ao(g,m)),b.addColorStop(.24,Ao(p,m)),b.addColorStop(1,Ao([10,13,22],m)),t.fillStyle=b,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,n(0))-u;if(S>8){let w=1-m*.4;for(let k=1;k<6;k++){let v=u+S*k/6;t.fillStyle=`rgba(0,0,0,${.16*w})`,t.fillRect(a,v,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*w})`,t.fillRect(a,v+1.5,l-a+1,1.2)}}if(r.overhead){let x=n(Math.min(86,c+12)),w=t.createLinearGradient(0,x,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,x,l-a+1,u-x),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function yg(t,e,i){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let b of i){a++,b.sectionId&&s.add(b.sectionId);let y=b.x-e.x,S=b.y-e.y,x=Math.hypot(y,S)*qt;if(x<.5)continue;let w=Math.atan2(y,-S),k=Math.floor((w+Math.PI)/B*72);k<0?k=0:k>=72&&(k=71),o[k]=!0,x<r[k]&&(r[k]=x)}let l=0,c=[];for(let b=0;b<72;b++)o[b]&&(l++,c.push(r[b]));let d=l/72*360;c.sort((b,y)=>b-y);let u=c.length?c[c.length>>1]:0,h=c.length?c[Math.floor(c.length*.15)]??u:0,m=c.length?c[Math.floor(c.length*.85)]??u:0,f=h>.5?m/h:1,g=mh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&u>11&&f>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:g,voidRadiusM:u,aspect:f}}var Sg=5;function vg(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 wg(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()),vg(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 kg(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 _o(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 m=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,m),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,m),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,m),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,m),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,m),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,m),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 Zi(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 Bo(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 vT(t,e,i){let n=document.createElement("canvas");n.width=ne,n.height=xe;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=yg(t,e,i),u=gh(d.seed),h=210+u()*150,m=le(220+(u()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,g=o.createLinearGradient(0,0,0,xe);g.addColorStop(0,"#080b12"),g.addColorStop(.42,"#12182c"),g.addColorStop(.5,"#1c2440"),g.addColorStop(.56,"#151b2c"),g.addColorStop(.78,"#171e30"),g.addColorStop(1,"#131829"),o.fillStyle=g,o.fillRect(0,0,ne,xe);let p=o.createLinearGradient(0,q(-6),0,xe);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,q(-6),ne,xe-q(-6));let b=Math.atan2(r,-s),y=gg(t,i,b,c),S=y.maxDelta>=mg;S&&bg(o,y.bins,vt,q);let x=Math.max(.3,Math.min(1,1-(l-6)/60)),w=Ro(c,l),k=Math.min(80,Math.atan2(4,l)*180/Math.PI),v=Math.min(45,w.topPitch),C=w.basePitch;d.mode==="sport"?Cg(o,l,c,d,x,h,f,u):d.mode==="arena"?Lg(o,l,c,d,x,f,u):xg(o,k,v,C,x,h,f,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${f},0.8)`;for(let L=0;L<P;L++){let I=(L+.5)/P*ne,R=q(d.mode==="sport"?58:54+L*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,B),o.fill()}Tg(o,t,i,e,b,c,r,s,S,d);let T=o.createLinearGradient(0,0,0,xe);return T.addColorStop(0,"rgba(0,0,0,0.85)"),T.addColorStop(.12,"rgba(0,0,0,0)"),T.addColorStop(.9,"rgba(0,0,0,0)"),T.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=T,o.fillRect(0,0,ne,xe),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function xg(t,e,i,n,o,r,s,a){let l=vt(-e),c=vt(e),d=q(i),u=q(n),h=c-l,m=u-d,f=q(Math.min(50,i+10)),g=h*(1.1+(1-o)*.5),p=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,g);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-m*1.2,h*2.2,m*3.4);let b=le(r,.62,.55),y=le(r+40,.7,.5),S=le(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,h,m),t.clip();let x=t.createLinearGradient(0,d,0,u);x.addColorStop(0,`rgb(${b[0]},${b[1]},${b[2]})`),x.addColorStop(.5,`rgb(${y[0]},${y[1]},${y[2]})`),x.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=x,t.fillRect(l,d,h,m),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,m),t.restore();let k=3+Math.floor(a()*3),v=m*.46,C=u-m*.08;for(let A=0;A<k;A++){let z=(A+1)/(k+1),W=l+h*(.22+z*.56+(a()-.5)*.06);_o(t,W,C,v*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:le(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-h*.5,f,h*.5,u-f),t.fillRect(c,f,h*.5,u-f);let P=h*.055+3,T=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,u),t.lineTo(l-T,f),t.lineTo(l+h*.012,f),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+P,u),t.lineTo(c+T,f),t.lineTo(c-h*.012,f),t.closePath(),t.fill(),t.fillRect(l-T,f,h+T*2,(u-f)*.12);let L=m*.14,I=f+(u-f)*.12;t.fillStyle="rgba(4,6,12,0.96)";let R=7;t.beginPath(),t.moveTo(l-T,I);for(let A=0;A<=R;A++){let z=l-T+(h+T*2)*A/R;t.quadraticCurveTo(z-(h+T*2)/R/2,I+L,z,I)}t.lineTo(c+T,I),t.lineTo(c+T,f),t.lineTo(l-T,f),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-m*.05,h+P*2,m*.05+3);let M=t.createLinearGradient(0,u-m*.05,0,u+m*.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-m*.05,h+P*2,m*.2);let E=3+Math.floor(a()*2);for(let A=0;A<E;A++){let z=(A+1)/(E+1),W=l+h*(z+(a()-.5)*.08),Y=q(Math.min(62,i+26)),re=(a()-.5)*h*.16;Zi(t,W,Y,W+re,u,4,h*.09,s,.16*(.7+o*.5)),Bo(t,W,Y,2.4,s)}}function Lg(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,m=Math.atan2(d-i,u)*180/Math.PI,f=Math.atan2(d-i,h)*180/Math.PI,g=Math.atan2(-i,u)*180/Math.PI,p=q(m),b=q(f),y=q(g),S=vt(l)-c,x=Math.max(6,(p-b)/2),w=(p+b)/2,k=t.createRadialGradient(c,y,4,c,y,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),k.addColorStop(.5,"rgba(150,140,190,0.08)"),k.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(c-S*2.6,b-x,S*5.2,y-b+x+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,w),t.ellipse(c,w,S,x,0,Math.PI,0,!1),t.lineTo(c+S,y),t.ellipse(c,y,S,x,0,0,Math.PI,!1),t.closePath(),t.fill();let v=t.createLinearGradient(0,w,0,y);v.addColorStop(0,`rgba(${r},0.14)`),v.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=v,t.fillRect(c-S,w,S*2,y-w);let C=[[{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=C[Math.floor(s()*C.length)],T=s()<.5?-1:1,L=V=>c+V.u*T*S*.84,I=V=>w+V.v*x*.8,R=P.find(V=>V.lead)??P[0],M=L(R),E=t.createLinearGradient(0,w-x,0,w+x);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),t.fillStyle=E,t.beginPath(),t.ellipse(c,w,S,x,0,0,B),t.fill();let A=t.createRadialGradient(M,w,2,M,w,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,w,S,x,0,0,B),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,w,S,x,0,0,B),t.stroke();let z=Math.max(24,(y-b)*1.3),W=P.length>=3?3:2;for(let V=0;V<W;V++){let Le=(-.62+V*.52+(s()-.5)*.12)*-T,Oe=c+Le*S*.7,wt=w-x*(.45+s()*.18),et=S*(.07+s()*.04),nn=z*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Oe-et/2,wt-nn,et,nn),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Oe-et/2,wt-nn,et,1.5)}if(P.length>=3){let V=c-R.u*T*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(V,w-x*.34,S*.08,x*.1,0,0,B),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let V of[...P].sort((Le,Oe)=>Le.v-Oe.v)){let Le=.82+(V.v+1)*.14;_o(t,L(V),I(V),z*Le*(V.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:V.pose,rim:le(40,.72,.8),rimStrength:V.lead?1.4:.9})}let Y=q(Math.min(60,f+34)),re=x*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 N=4+Math.floor(s()*3);for(let V=0;V<N;V++){let Le=V/N*B,Oe=c+Math.cos(Le)*S*1.15,wt=Y+Math.sin(Le)*re;if(Math.sin(Le)>-.2){let et=c+(s()-.5)*S*.8;Zi(t,Oe,wt,et,w,3,S*.32,r,.2*(.7+o*.4))}Bo(t,Oe,wt,3,r)}let _=q(Math.min(52,f+24)),G=Math.max(60,S*.4),oe=Math.max(24,G*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-G*.3,_-oe/2),t.lineTo(c-G*.16,_-oe*2.2),t.moveTo(c+G*.3,_-oe/2),t.lineTo(c+G*.16,_-oe*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-G/2,_-oe/2,G,oe);let ji=t.createLinearGradient(0,_-oe*.3,0,_+oe*.42);ji.addColorStop(0,`rgba(${r},0.5)`),ji.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=ji,t.fillRect(c-G*.42,_-oe*.3,G*.84,oe*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-G/2,_+oe/2-2,G,2);let Ji=t.createRadialGradient(c,_,4,c,_,G*1.1);Ji.addColorStop(0,`rgba(${r},0.2)`),Ji.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=Ji,t.fillRect(c-G*1.1,_-G*.8,G*2.2,G*1.6);let en=t.createRadialGradient(c,(Y+w)/2,6,c,(Y+w)/2,S*1.5);en.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),en.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=en,t.fillRect(c-S*1.5,Y-40,S*3,w-Y+80),t.restore();let yh=c+Math.sign(M-c||1)*S*.5;Zi(t,yh,Y-re*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let tn=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);tn.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),tn.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=tn,t.beginPath(),t.ellipse(M,I(R),S*.2,x*.24,0,0,B),t.fill(),t.restore()}function Cg(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),m=Math.atan2(-i,d)*180/Math.PI,f=Math.atan2(-i,u)*180/Math.PI,g=q(m),p=q(f),b=vt(h)-l,y=(g+p)/2,S=Math.max(10,(g-p)/2),x=t.createRadialGradient(l,y,4,l,y,b);x.addColorStop(0,"#e8f0fb"),x.addColorStop(.7,"#b9c9e2"),x.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,y,b,S,0,0,B),t.clip(),t.fillStyle=x,t.fillRect(l-b,y-S,b*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-b*.5,y-S),t.lineTo(l-b*.5,y+S),t.moveTo(l+b*.5,y-S),t.lineTo(l+b*.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,b,S,0,0,B),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let L=0;L<5;L++){let I=l+(a()-.5)*b*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,b*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-b*1.4,p-S,b*2.8,g-p+S*2),t.restore();let k=q(Math.min(66,f+60)),v=Math.max(80,b*.7),C=v*.5,P=t.createRadialGradient(l,k,4,l,k,v*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-v*1.6,k-v*1.2,v*3.2,v*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-v/2,k-C/2),t.lineTo(l+v/2,k-C/2),t.lineTo(l+v*.6,k),t.lineTo(l+v/2,k+C/2),t.lineTo(l-v/2,k+C/2),t.lineTo(l-v*.6,k),t.closePath(),t.fill();let T=r;for(let L=0;L<3;L++){let I=le(T+L*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=v*.26;t.fillRect(l-v*.42+L*(R+v*.06),k-C*.32,R,C*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let L=0;L<8;L++){let I=l-v*.6+v*1.2*L/7;t.beginPath(),t.arc(I,k+C*.62,2.4,0,B),t.fill()}}function Tg(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let g of i){if(g.id===e.id)continue;let p=g.x-e.x,b=g.y-e.y,y=Math.hypot(p,b)*qt;if(d&&g.sectionId===d&&y<3&&p*s+b*a>0&&(u=!0),y<.3||y>32)continue;let x=((Math.atan2(p,-b)-o)*180/Math.PI+540)%360-180,w=l?(g.eyeHeightM??Ae)-r:0,k=Math.atan2(w-.28,y)*180/Math.PI;if(k>10&&y>5)continue;let v=0;for(let T=0;T<g.id.length;T++)v=v*31+g.id.charCodeAt(T)&65535;let C=.9+(v&15)/40,P=Math.min(78,Math.atan2(.16,y)*180/Math.PI*fg*C);P<1.2||h.push({hx:vt(x),hy:q(k),r:P,d:y,hash:v})}h.sort((g,p)=>p.d-g.d);let m=[];{let g=[...h].sort((y,S)=>y.hy-S.hy),p=[],b=()=>{if(!p.length)return;let y=p.reduce((w,k)=>w+k.d,0)/p.length,S=p.reduce((w,k)=>w+k.hy,0)/p.length,x=p.reduce((w,k)=>w+k.r,0)/p.length;m.push({figs:p.sort((w,k)=>k.d-w.d),d:y,hy:S,r:x}),p=[]};for(let y of g){let S=p[p.length-1];S&&Math.abs(y.hy-S.hy)>Math.max(5,(S.r+y.r)/2*1.7)&&b(),p.push(y)}b()}m.sort((g,p)=>p.d-g.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let g of m){if(g.figs.length>=3&&g.r>=1.6&&g.r<26){let p=[],b=[...g.figs].sort((x,w)=>x.hx-w.hx),y=[];for(let x of b){let w=y[y.length-1];w&&x.hx-w.hx>Math.max(14,x.r*7)&&(y.length>=3&&p.push(y),y=[]),y.push(x)}y.length>=3&&p.push(y);let S=Math.min(.42,.5*(1-g.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let x of p){let w=x[0].hx-g.r*1.6,k=x[x.length-1].hx+g.r*1.6;t.beginPath(),t.roundRect(w,g.hy+g.r*.8,k-w,g.r*2.4,g.r*.8),t.fill()}}}for(let p of g.figs){let b=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),y=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+y,17+(p.hash>>4&6)+y,25+(p.hash>>4&6)+y],x=f[p.hash%f.length],w=[x[0]+y,x[1]+y,x[2]+y];if(p.r>=13){let k=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;wg(t,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:b,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%Sg,rim:k,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?kg(t,p.hx,p.hy,p.r,w,S,b):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${b.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,B),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 g=q(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,g,ne,xe-g),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let b=0;b<p;b++){let y=(b+.5)/p*ne;t.beginPath(),t.ellipse(y,g+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var de=480,St=270,Fo=50,Je=30,fh=t=>(t+Fo)/(2*Fo)*de,$t=t=>(Je-t)/(2*Je)*St;function wT(t,e,i){let n=document.createElement("canvas");n.width=de,n.height=St;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=gh(mh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=le(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=o.createLinearGradient(0,0,0,St);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,de,St);let m=t.eyeHeightM??Ae,f=Ro(m,a),g=Math.min(Fo-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(Je-2,f.topPitch),b=Math.max(-Je+2,f.basePitch),y=fh(-g),S=fh(g),x=$t(p),w=$t(b),k=S-y,v=w-x,C=Math.max(.35,Math.min(1,1-(a-6)/60)),P=$t(Math.min(Je-1,p+8)),T=o.createRadialGradient(de/2,(x+w)/2,4,de/2,(x+w)/2,k*1.15);T.addColorStop(0,"rgba(255,214,150,0.34)"),T.addColorStop(.28,"rgba(150,150,230,0.3)"),T.addColorStop(.6,"rgba(99,102,241,0.12)"),T.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=T,o.fillRect(y-k*.6,x-v*1.2,k*2.2,v*3.4);let L=le(c,.62,.55),I=le(c+40,.7,.5),R=le(c+70,.78,.52);o.save(),o.beginPath(),o.rect(y,x,k,v),o.clip();let M=o.createLinearGradient(0,x,0,w);M.addColorStop(0,`rgb(${L[0]},${L[1]},${L[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,x,k,v),o.globalAlpha=1;let E=o.createRadialGradient(de/2,(x+w)/2,k*.12,de/2,(x+w)/2,k*.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(y,x,k,v),o.restore();let A=3,z=w-v*.08;for(let N=0;N<A;N++){let _=(N+1)/(A+1);_o(o,y+k*(.24+_*.52),z,v*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:le(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(y-k*.5,P,k*.5,w-P),o.fillRect(S,P,k*.5,w-P);let W=k*.05+2,Y=W*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(y,w),o.lineTo(y-W,w),o.lineTo(y-Y,P),o.lineTo(y+k*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,w),o.lineTo(S+W,w),o.lineTo(S+Y,P),o.lineTo(S-k*.012,P),o.closePath(),o.fill(),o.fillRect(y-Y,P,k+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-W,w-v*.05,k+W*2,v*.05+2);let re=o.createLinearGradient(0,w-v*.05,0,w+v*.14);re.addColorStop(0,`rgba(255,206,140,${(.5*C).toFixed(3)})`),re.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=re,o.fillRect(y-W,w-v*.05,k+W*2,v*.22);for(let N=0;N<3;N++){let _=(N+1)/4,G=y+k*_,oe=$t(Math.min(Je-1,p+20));Zi(o,G,oe,G+(l()-.5)*k*.14,w,3,k*.09,u,.17*C),Bo(o,G,oe,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let N=0;N<8;N++)o.beginPath(),o.arc((N+.5)/8*de,$t(Je-4-N%2*3),2.2,0,B),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,St-26,de,26),o.fillStyle="rgba(30,37,54,0.9)";for(let N=0;N<9;N++){let _=N*(de/9)+de/18;o.beginPath(),o.ellipse(_,St-22,de/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:n.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var bh=new Set(["en"]),Qi=new Map;async function Ig(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await Dr(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-L36RHPNS.js"),i=e[t];return i?await i():null}async function CT(t,e){let i=Js(t,e);if(i==="en"||bh.has(i))return ct(i),i;if(!js.includes(i))return ct("en"),"en";try{let n=Qi.get(i);n||(n=Ig(i),Qi.set(i,n));let o=await n;return Qi.delete(i),o?(ct(i,o),bh.add(i),i):(ct("en"),"en")}catch{return Qi.delete(i),ct("en"),"en"}}export{Ag as ACCESSIBILITY_RING_COLOR,Do as ACCESSIBILITY_TYPES,Cb as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,Lb as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,Ng as BOOTH_TYPES,Rg as CHART_STORAGE_KEY,uy as CURRENCY_CHOICES,dy as DEFAULT_CURRENCY,Vg as DEFAULT_EVENT_INVENTORY_LIMIT,wC as EMPTY_AVAILABILITY_REFRESH,Ug as EVENT_CONFIGURATION_EXPORT_SCHEMA,Xg as EVENT_CONFIGURATION_SCHEMA,vb as FLOOR_COVER_LIMIT,bb as FLOOR_STACK_GAP_RATIO,xb as FLOOR_STACK_MIN_SURFACE_PX,Ib as GA_UNIT_LABEL_PREFIX,vC as HOLD_CLOCK_SKEW_MS,yn as LABEL_FADE_MS,Og as LABEL_STYLE_MAX_SIZE,Bg as LABEL_STYLE_MIN_SIZE,zg as LARGE_VENUE_INVENTORY_MODULE,Ub as LEGIBILITY_HYSTERESIS_PX,wb as LEVEL_CONTEXT_PREFIX,vy as LOCALE_NAMES,Wg as MAX_EVENT_INVENTORY,Rb as MAX_GA_CAPACITY,Fb as MAX_ONE_PARTY_GUESTS,si as MIN_POINTER_TARGET_PX,_b as ONE_PARTY_LIMIT_MESSAGE,dh as PickerController,Me as PickerSelectionError,Kb as RENDERED_QUALITY_REPORT_VERSION,Dg as ROW_AISLE_SEATS,Fg as SEAT_COMMERCIAL_MARKS,Nb as SEAT_TYPE_ICON_BODY,ln as SEAT_TYPE_ICON_VIEWBOX,Pg as STAGE_LABEL_STYLE_MAX_SIZE,au as SUPPORTED_LOCALES,Hg as SURROUNDINGS_SHAPE_ROLES,xo as SeatmapRenderer,ib as TABLE_SEAT_OFFSET,eb as TIER_HEIGHT_M,js as TRANSLATED_LOCALES,or as UNGROUPED_ID,Dd as accessNeedsFor,Db as accessibilityLabelKey,Mg as accessibilityMeta,Eg as accessibilityRingColor,Jt as allObjects,lr as applyHidden,qm as applyOrganizerSeatGlyph,Io as asPickerSalesState,Gd as attachVisibilityCatchUp,Tb as automaticRoundTableRadius,Qg as canTransitionEventConfiguration,qg as canonicalEventConfigurationJson,$o as chartBounds,xd as clearOrganizerSeatGlyph,Qo as combinedFloorZoneId,It as compactRowLabel,ar as computeSections,Wb as computeSectionsPerFloor,wd as createRenderer,Nr as crossesThreshold,ru as currencyExponent,fy as currencySymbol,tt as effectiveFloorOverview,Kg as eventInventoryLimitFor,hb as expandBooth,De as expandChart,sb as expandRow,rb as expandRowSlots,db as expandTable,lb as expandTableSlots,mb as floorObjects,yb as floorStackPlacements,jt as floorsOf,Cy as formatDate,py as formatMinor,Ye as formatMoney,su as fromMinorUnits,Lt as gaAreasOf,rn as gaBoxBounds,on as gaBoxMode,Eb as gaInventorySegments,Mb as gaUnitLabel,Bb as gaUnitLabels,sn as gaUnitLabelsForModel,xt as gaWheelchairPlaceCount,an as gaWheelchairUnitLabels,vT as generateSeatPanorama,wT as generateSeatThumb,wy as getLocale,Ob as growJoinedGAInventory,zb as hiddenObjectIds,tg as holdHasLapsed,xC as holdRecoveryShape,vn as hysteresisScale,tr as initialFloorMode,Zg as inspectEventConfigurationCompatibility,Xb as inspectRenderedQualityEvidence,Pb as isGaUnitLabel,xy as isLocaleLoaded,kd as isOrganizerGlyphPainted,Vb as isSectionHidden,Gg as layerOf,Jo as layoutCombinedFloorPlan,jo as layoutFloorStack,er as levelContextOutlines,CT as loadLocale,ky as localeDirection,kb as mainFloorId,Jg as migrateLegacyEventConfigurations,pb as objectCenter,fb as owningSectionForObject,$g as parseEventConfigurationExport,Yg as parseEventConfigurationVersion,Zt as pointInPolygon,te as pointInPolygonWithHoles,ub as pointOnPolygonBoundary,Qt as polygonLabelPoint,Nd as reconcileAvailability,kC as refreshChangedSomething,Sn as renderedPx,hy as resolveCurrency,jg as resolveEventConfigurationRollback,Js as resolveLocale,ob as rowInventoryCount,nb as rowSeatPositions,_g as seatCommercialMeta,ir as seatNoteRowModel,nr as seatTypeIconBody,Hb as seatTypeIconSvg,it as sectionEntrancesById,tb as sectionGeometry,Gb as sectionIdentitiesById,rr as sectionLabelsById,sr as sectionOwnersByObject,ct as setLocale,Qs as setMoneyLocale,Ly as setStringOverrides,Hd as shouldWaitForHoldExpiry,Yo as stackFloors,Sb as suggestedFloorOverview,F as t,ta as tCount,cb as tableInventoryCount,ab as tableSeatCountsBySide,gb as translateObject,Uo as usableHoles,Ab as validGAInventorySegments,Yb as zoomTowardPoint};
|