@seatlayer/core 0.109.0 → 0.109.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/index.js CHANGED
@@ -1 +1 @@
1
- import{a as Ln,c as Cn,e as zr,f as mi,h as Kr,j as Xr,m as Yr}from"./chunk-ZYQXT5JP.js";import{a as ay,b as lr,c as ly,d as cr,e as dr,f as it,g as cy,h as dy,i as hy,j as hr,k as uy,l as py,m as ur,o as Ar,r as st}from"./chunk-MRLWH6RC.js";import{a as _y,b as ci,c as By}from"./chunk-GPZFVQXV.js";import{d as Ur}from"./chunk-TGHNVDWA.js";import{a as gn,b as Py,c as fr,d as Ry}from"./chunk-YPVYZYMH.js";import{a as Iy,b as pr,c as Rt,d as Or,e as Dr,f as Nr,g as Hr}from"./chunk-WKWXU5QM.js";import{b as Er,e as wn,i as ui,k as Vr}from"./chunk-FBXZWNND.js";import{a as fy,b as my,c as gy,f as hi}from"./chunk-UNSAUDO2.js";import{b as di,f as Ir,h as rt,i as Pr,j as Rr,l as Mr}from"./chunk-4N5CHKHD.js";import{A as Wr,b as Mt,c as pi,d as kn,e as Fr,f as _r,g as xn,l as Br,n as fi,z as Gr}from"./chunk-33SRM2CP.js";import{b as sr,c as ar,l as xt}from"./chunk-M4NGX5NM.js";import{A as Tr,B as Xe,C as vn,D as ai,E as Y,F as he,G as li,a as ge,b as wr,c as Ve,e as be,f as oi,g as ri,h as kr,i as It,j as ze,k as Ke,l as V,n as xr,p as Lr,q as Cr,s as ye,t as Se,w as ot,x as Pt,y as si}from"./chunk-JRZHC75P.js";import{b as yb,c as Uo,d as Sb,e as $o,f as vb,g as wb,h as kb,i as xb,j as Lb,k as Cb,l as Tb,m as Ib,n as Pb,o as Rb,p as Mb}from"./chunk-UEDS3HJ3.js";import{a as by,b as yy,c as Sy,d as vy,e as wy,f as ky,g as xy,h as Ly,i as un,j as pn,k as Cy,l as fn,m as Lt,n as mn,o as Ty,p as Ct,q as mr,r as My,s as nt,t as gr,u as br,v as yr,w as Ey,x as Ay,y as Fy,z as Sr}from"./chunk-UUIZHJYL.js";import{$a as ti,Ga as tr,Ia as ir,J as qo,Ka as Yb,L as Zo,La as Ub,Ma as $b,N as q,Na as qb,Oa as Zb,Pa as Qb,Qa as jb,Ra as Jb,Sa as ey,Ta as ty,Ua as Jt,Va as iy,Wa as nr,Xa as te,Ya as ei,Za as ny,_a as oy,ab as ry,ba as Qo,bb as ii,ca as jo,cb as sy,d as Eb,da as Jo,db as or,e as Ab,eb as We,f as Fb,fb as rr,g as _b,h as Bb,i as Ob,j as Db,k as Nb,ka as er,l as Hb,m as Gb,ma as Kb,n as Wb,o as Vb,p as zb,ua as Fe,va as Xb}from"./chunk-YE4NP3XB.js";import"./chunk-S3VH7IDA.js";import{C as G,c as bn,h as yn,m as Tt,o as vr,t as H,u as se,v as _e,w as j,x as ni,z as Sn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";function Tn(t,e){return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function In(t,e,i){let n=Tn(t,e);if(n!==void 0)return typeof n=="number"?n:i&&Object.prototype.hasOwnProperty.call(n.tiers,i)?n.tiers[i]:void 0}function Oy(t,e){if(typeof t=="number")return t;let i=e?.tiers?.[0]?.id;return i!==void 0?t.tiers[i]:Object.values(t.tiers)[0]}function Dy(t){let e=1/0,i=-1/0;for(let n of Object.values(t??{}))for(let o of typeof n=="number"?[n]:Object.values(n.tiers))o<e&&(e=o),o>i&&(i=o);return e===1/0?null:{min:e,max:i}}var Hy=1,Pn=90;function Rn(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function $r(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 Mn(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 Gy(t){let{point:e,camera:i,scale:n,nextScale:o}=t;if(!Number.isFinite(n)||n<=0||!Number.isFinite(o))return{...i};let r=(e.x-i.x)/n,s=(e.y-i.y)/n;return{x:e.x-r*o,y:e.y-s*o}}import{Konva as Ji}from"konva/lib/Core";import{Stage as Tg}from"konva/lib/Stage";import{Layer as Fo}from"konva/lib/Layer";import{Group as qt}from"konva/lib/Group";import{Circle as zd}from"konva/lib/shapes/Circle";import{Group as Un}from"konva/lib/Group";import{Circle as De}from"konva/lib/shapes/Circle";import{Line as Zn}from"konva/lib/shapes/Line";import{Rect as $n}from"konva/lib/shapes/Rect";import{Text as ga}from"konva/lib/shapes/Text";var J=9,ve=.9,Q=.55*ve,ie=V/ge,at=4,pe=14,qr=10;var Zr=14;var Ce=.45*ve,we=.9*ve,ae=(Ce+we)/2,Qr=Math.max(ve*1.1,we),ke=8,jr=700,ee=2,Jr=3,Et=V,zh=12,Kh=12;function es(t){return t<U?Kh:zh}var gi=.85,ts=V,At=64,Ye=.55*Ce,is=700,ns=120,os=2500,rs=420,ss=420,as=1,Ue=1,ls=2,lt=16,Be=12,En=[.85,.72,.62],Xh=10,Yh=9;function bi(t){return t<U?Yh:Xh}var yi=13,Si=12,cs=0,ds="600",hs="500",us=8,ps=5,fs=10,ms=6,gs=8,bs=.6,ys=.7,Ss=[0,18,-18,36,-36,54,-54],Te="600",vs="500",U=640,ws=Te,ks="400",Oe=0,xs=14,Ls=.34,Cs=.92,Ts=7,Is=3;function vi(t){return Math.min(1,Math.max(Be/lt,t/900))}function ct(t,e){return Math.max(Be,t*vi(e))}var Uh=.5,$h=1.15,Ps=2,Rs=3,Ms=22,qh=8,Zh=6;function Ft(t){return t<U?Zh:qh}var An=.08;function Fn(t,e,i,n,o=Uh,r=Be){let s=t*vi(e),a=Math.max(r*(1+An),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*$h);return Math.min(c,a*l)}var Es=.1,_t=1.02;var wi=1.25;function As(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var Qh="#e5e7eb",jh="#c7cbd1",Jh="#6b7280",eu=["#6b7280","#5b6470","#4b5563","#374151"],tu=["#cbd5e1","#e2e8f0","#f8fafc"],iu="#d1d5db",nu="#b8bdc4",ou="#273142",ru="#526078",su="#f1f5f9",au="#374151",lu="#64748b",cu="#111827",Fs="#6b7280",_s="#374151";var Bs="#4b5563",Os=.4,Ie=.16,Ds="rgba(244,246,248,0.06)",ki=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Ns(t,e,i){let n=new Map;for(let s of t){let a=e(s);!a||i(a)||n.set(a,(n.get(a)??0)+1)}let o=null,r=0;for(let[s,a]of n)(a>r||a===r&&o!=null&&s<o)&&(o=s,r=a);return o}function le(t){return H(t)?{sectionFill:Qh,sectionStroke:jh,sectionInk:Jh,focalFill:iu,focalStroke:nu}:{sectionFill:ou,sectionStroke:ru,sectionInk:su,focalFill:au,focalStroke:lu}}function _n(t,e){let i=t.sectionFill,n=H(i),o=n?se(i,.6):Sn(_e(i,.2),.85);switch(e){case"closed":return n?se(i,.4):_e(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Hs=.28,Gs=.42,du=.55,hu=.7;function Ws(t,e,i){let n=le(t),o=_n(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=H(t);return{fill:j(o,i,r?Gs:Hs),stroke:G(i,r?hu:du)}}var uu=.03;function Vs(t,e){let i=le(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>_n(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&Bn(t,e)}function Bn(t,e){let i=bn(e);if(!i)return!1;let n=le(t),o=Math.max(Hs,Gs)+uu;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=bn(_n(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 pu="#f8fafc",fu="#f4f6fb",mu="#111827",gu=.72;function zs(t){let e=H(t),i=e?pu:cu,n=e?mu:fu,o=j(n,i,1-gu);return{plate:i,ink:n,subInk:Tt(o,i)>=vr?o:n}}function Ks(t,e,i,n){if(e)return e;let o=H(i)?tu:eu;for(let r of[i,...o])if(Tt(r,t)>=n)return r;return he(t,e,i,n)}var bu=.45,yu=.3,Su=.1,vu=5;function Xs(t,e,i){let n=H(e)?_e:se,o=Sn(n(t,bu),yu);for(let r=0;r<vu;r+=1){if(Tt(o,e)>=i)return o;o=n(o,Su)}return Tt(o,e)>=i?o:he(e,null,o,i)}import{Shape as ku}from"konva/lib/Shape";import{Circle as xu}from"konva/lib/shapes/Circle";import{Rect as Lu}from"konva/lib/shapes/Rect";var wu={M:2,L:2,Q:4,C:6,Z:0},On=new Map;function Dn(t){let e=On.get(t);if(e)return e;let i=rt(t);if(!i)return On.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=wu[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 On.set(t,o),o}function Ys(t,e,i,n=0,o=0){let r=Dn(e),s=Ir(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=Pr(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 Us(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var $e=class extends ku{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=Dn(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){Us(e,i),e.fillStrokeShape(this);return}e.beginPath(),Ys(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){Us(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 Nn(t,e){return t==="circle"||!rt(t)?null:new $e({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 $s(t){let{x:e,y:i,radius:n}=t;return t.wheelchairBay?new Lu({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}):Nn(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new xu({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Cu(t,e){return t*2*e>=16}function qs(t,e,i,n){let o=Cu(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function xi(t){return t?.35:.3}function js(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 Hn(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 Js=700,Tu=2400,Gn=12,ea=30,Zs=1,Iu=1.16,Qs=.5,Pu=1;function Wn(t){return t*.61803398875%1}function ta(t,e){let n=((t/Tu+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:Zs+(Iu-Zs)*o,opacity:Qs+(Pu-Qs)*o}}var na;function oa(t){na=t}function Ru(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var ia=new Map;function Mu(t,e){let i=t??na,n=`${i??""}|${JSON.stringify(e)}`,o=ia.get(n);return o||(o=new Intl.DateTimeFormat(i,e),ia.set(n,o)),o}var Eu={dateStyle:"medium",timeStyle:"short"};function ra(t,e={}){let{locale:i,...n}=e,o=Ru(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:Eu;return Mu(i,r).format(o)}var nS="USD";function oS(t,e){return t?.trim()||e?.trim()||"USD"}var rS=["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"],zn;function aa(t){zn=t}function sS(){return zn??"en"}var sa=new Map;function Vn(t,e,i,n){let o=n??zn,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=sa.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),sa.set(r,s)),s}function ce(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return Vn(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 Vn(e,o,o,n).format(t)}var Au={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 Fu(t="USD"){return Au[t.toUpperCase()]??2}function _u(t,e="USD"){return t/10**Fu(e)}function aS(t,e="USD",i){return ce(_u(t,e),e,void 0,i)}function lS(t="USD"){return Vn(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Bt={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired and the seats were released. Pick again.","picker.holdExpiredTitle":"Your seats were released","picker.holdExpiredBody":"Your hold time ran out and the seats went back on sale.","picker.holdExpiredRestart":"Choose seats again","picker.holdExpiredPickAgain":"Pick your seats again to continue. They may already be taken.","picker.releasedPair":"{first} \xB7 {second}","picker.releasedSeatPlace":"Section {section}, Row {row}, Seat {seat}","picker.releasedSeatRange":"Section {section}, Row {row}, Seats {from}\u2013{to}","picker.releasedInSection":"{seats} in Section {section}","picker.releasedInSections":"{seats} in Sections {sections}","picker.releasedGa":"{quantity} \xD7 {area}","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.testModeExplained":"Bookings here are not real and no card is charged","picker.findClosestSeatsTogether":"Find the closest seats together","picker.findSeatsTogether":"Find seats together","picker.addSeat":"Add seat","picker.removeSeat":"Remove seat","picker.added":"Added","picker.findSeats":"Find seats","picker.findBestSeats":"Find best seats","picker.displayOptions":"Display options","picker.closeVenueNavigation":"Close venue navigation","picker.orphanHint":"This leaves a single seat stranded. Consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.noWheelchairSpace":"NO WHEELCHAIR SPACE","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview: groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks: sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats: blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.aisleSeat":"Aisle seat","picker.boothType.inline":"Inline booth \xB7 1 open side","picker.boothType.corner":"Corner booth \xB7 2 open sides","picker.boothType.peninsula":"Peninsula booth \xB7 3 open sides","picker.boothType.island":"Island booth \xB7 4 open sides","picker.gaBookWholeArea":"Book the whole area","picker.gaBook":"Book","picker.noWheelchairSpace":"No wheelchair space","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count}. Showing best overall","picker.loading3d":"Building the 3D venue\u2026","picker.unavailable3d":"3D could not start. The seat map is still available.","picker.jumpToSection":"Jump to section","picker.salesClosedPill":"Sales are closed","picker.salesClosedCopy":"Ticket sales for this event have ended.","picker.salesNotOpenPill":"Sales haven\u2019t opened yet","picker.salesNotOpenCopy":"Tickets for this event aren\u2019t on sale yet.","picker.salesPausedPill":"Sales are paused","picker.salesPausedCopy":"Ticket sales are paused for now.","picker.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.salesCloseTitle":"Online sales have closed","picker.salesCloseVenue":"You can still buy tickets at the venue box office.","picker.salesCloseHeld.one":"Your {count} seat is still held for you. Finish paying to keep it.","picker.salesCloseHeld.other":"Your {count} seats are still held for you. Finish paying to keep them.","picker.salesCloseTap":"Seats can\u2019t be picked: online sales have closed","picker.salesCloseSwitch":"Online sales just closed. The seat map is now view-only.","picker.eventEndedTitle":"This event has ended","picker.eventEndedWhen":"It was on {date} at {time}.","picker.eventEndedToast":"This event has ended.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total}. You won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types. Tap one below to show just those seats.","picker.aboutTicketPrices":"About ticket prices","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now.","picker.accessExpiredTitle":"The seat map timed out","picker.accessInvalidBody":"You can still book anything shown as available. Contact whoever sent you here for access to the rest.","picker.accessInvalidTitle":"We couldn\u2019t verify your access","picker.accessPausedBody":"The organizer has paused this selection. Try again in a few minutes.","picker.accessPausedTitle":"These seats are on hold right now","picker.accessRefresh":"Refresh","picker.accessRetry":"Try again","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.idlePausedBody":"You were away for a while. Refresh to see which seats are free now.","picker.idlePausedTitle":"Your session expired","picker.idleRefresh":"Show latest seats","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addMinutes":"+{count} min","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Zones","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held. Please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.aboutBestSeats":"About finding seats together","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessSpreadHint":"{count} accessible spaces in {sections} sections \xB7 tap a highlighted section","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time. Please head to checkout now.","picker.savedSeatsNotRestored":"Your earlier seats could not be restored. Please choose again.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.dragToLookTouch":"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close","picker.dragToLookMouse":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party \xB7 {typeWord}","picker.fullScreen":"Full screen","picker.generalAdmission":"General admission","picker.guestCountCouldNotBeSecured":"That guest count could not be secured. Your current table hold is unchanged.","picker.guestCountNoLongerAvailable":"That guest count is no longer available. Your current hold is unchanged.","picker.guests":"Guests","picker.guestsCount":"{count} guests","picker.guestsCountEdit":"{count} guests \xB7 Edit","picker.held":"Held","picker.heldByOther":"Held by another buyer, may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.hidePanel":"Hide panel","picker.hideTicketPanel":"Hide the ticket panel","picker.holdSeatsAndCheckout":"Hold seats & checkout","picker.howOfferWorks":"How the {name} offer works","picker.interactive3dVenueView":"Interactive 3D venue view","picker.keepMine":"Keep mine","picker.labelNoLongerAvailable":"{label} is no longer available.","picker.labelRemoved":"{label} removed.","picker.labelRemovedFromHold":"{label} removed from your hold.","picker.labelRestored":"{label} restored.","picker.labelsNoLongerAvailable.one":"{labels} is no longer available. Choose another seat.","picker.labelsNoLongerAvailable.other":"{labels} are no longer available. Choose another group.","picker.leftCount.one":"{count} left","picker.leftCount.other":"{count} left","picker.levelNumber":"Level {number}","picker.levels":"Levels","picker.loadingSeatMap":"Loading seat map\u2026","picker.lookAroundLive3d":"Look around in live 3D","picker.manualTicketsRemovedNote":"Your manually selected tickets will be removed only after a new group is secured.","picker.map":"Map","picker.mapDidNotLoad":"The seat map didn\u2019t load","picker.eventUnavailableTitle":"This event isn\u2019t available","picker.eventUnavailable":"Tickets can\u2019t be booked here right now.","picker.maxTicketsForOrder":"You can select up to {count} tickets for this order.","picker.selectExactMore":"Select {count} more","picker.selectExactCount":"Select exactly {count} tickets","picker.selectMinimumMore":"Select {count} more","picker.adjustSeatSelection":"Adjust seat selection","picker.selectSeatsTogether":"Choose seats together in the same row and ticket category.","picker.minToMaxGuests":"{min} to {max} guests","picker.more":"More","picker.moreCount":"+{count} more","picker.showLess":"Show less","picker.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreTimeAdded":"More time added. Your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notForSale":"Not for sale","picker.notAvailable":"Not available","picker.seatUnavailableNote":"This seat isn't available.","picker.notForSaleExplanation":"This seat is not included in the current sale.","picker.numberOfGuests":"Number of guests","picker.offerDetailActive":"This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over.","picker.offerDetailUpcoming":"Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts.","picker.offerRemainingAvailable":"{count} available","picker.offerStarts":"starts {time}","picker.offerUntil":"until {time}","picker.oneSeatSaved":"1 seat saved","picker.oneSeatSavedChooseAnother":"One seat saved; choose another to compare","picker.openAuthored360":"Open venue 360\xB0","picker.openComparison":"Open comparison","picker.openComparisonOfSeats":"Open comparison of {count} seats","picker.openTicketPanel":"Open ticket panel","picker.peekFromPrice":"From {price}","picker.peekTicketsTotal.one":"{count} ticket \xB7 {total}","picker.peekTicketsTotal.other":"{count} tickets \xB7 {total}","picker.perGuestPrice":"{price} per guest","picker.pickYourSeats":"Pick your seats","picker.preferredTicketType":"Preferred ticket type","picker.preferredVenueZone":"Preferred venue zone","picker.priceNotSupplied":"Price not supplied","picker.removeHeldTicketLabel":"Remove held ticket {label}","picker.removeSeatLabel":"Remove {label}","picker.removeTicketsUntilOrFewer":"Remove tickets until your order has {count} or fewer.","picker.replaceCurrentChoices":"Replace your current choices?","picker.review":"Review","picker.row":"Row","picker.rowLabel":"Row {label}","picker.saveToCompare":"Save to compare","picker.savedForComparison":"Saved for comparison","picker.savedSeatComparison":"Saved seat comparison","picker.scheduledOffer":"Scheduled offer","picker.seat":"Seat","picker.seatCount.one":"{count} seat","picker.seatCount.other":"{count} seats","picker.seatJustTakenByAnother":"Seat {label} was just taken by another buyer.","picker.seatLabel":"Seat {label}","picker.seatNoLongerAvailable":"That seat is no longer available.","picker.seatNoLongerYours":"Some seats are no longer available to you. They have been removed from your order.","picker.seatNumberLower":"seat {label}","picker.seatSalesClosedForEvent":"Seat sales have closed for this event.","picker.maintenancePaused.one":"Booking is paused for maintenance. Please try again in about {count} minute.","picker.maintenancePaused.other":"Booking is paused for maintenance. Please try again in about {count} minutes.","picker.maintenancePausedShortly":"Booking is paused for a few minutes for maintenance. Please try again shortly.","picker.seatSelection":"Seat selection","picker.seatStatusLegend":"Seat status legend","picker.seatTaken":"Someone else took a seat you had picked. It has been removed from your order.","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.seeItIn3d":"See it in 3D","picker.select":"Select","picker.selectSeats":"Select seats","picker.selectTable":"Select table","picker.selectWholeTable":"Select whole table","picker.selected":"Selected","picker.selectingEllipsis":"Selecting\u2026","picker.showAllSeats":"Show all seats","picker.showAllTicketTypes":"Show all {count} ticket types","picker.showFewer":"Show fewer","picker.showLabelSeatsOnMap":"Show {label} seats on the map","picker.showTicketPanel":"Show the ticket panel","picker.sold":"Sold","picker.soldOutCopy":"No reserved seats are currently available for this event.","picker.soldOutEyebrow":"This event","picker.soldOutTitle":"Sold out","picker.soldSeatExplanation":"This seat has already been booked.","picker.statusAvailable":"available","picker.statusOnHold":"on hold","picker.statusTaken2":"taken","picker.table":"Table","picker.tableCapacity":"Table capacity","picker.tableUpdatedForGuests":"{label} updated for {count} guests.","picker.temporarilyHeld":"Temporarily held","picker.ticketPrices":"Ticket prices","picker.ticketTypeNotChanged":"That ticket type is not available for this seat. Your hold is unchanged.","picker.ticketTypeSoldOut":"That ticket type is sold out. Try another ticket type.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} ticket","picker.ticketsCount.other":"{count} tickets","picker.toggleColorblindColors":"Toggle colorblind-friendly colors","picker.total":"Total","picker.trayHintTapOrBest":"Tap a seat on the map, or let us pick the best available for you.","picker.aboutYourSeats":"How to choose seats","picker.trayHintTapOrStanding":"Tap a seat on the map or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating\u2026","picker.venueView":"Venue view","picker.recentreOnStage":"Recentre on the stage","picker.stopYourSeat":"Your seat","picker.stopYourRow":"Your row","picker.stopYourSection":"Your section","picker.stopWholeVenue":"Whole venue","picker.viewFromHere":"View from here","picker.viewFromYourSeat":"view from your seat","picker.fromYourSeat":"from your seat","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We\u2019ll choose the closest available group for you.","picker.willFindSeatsTogether":"We\u2019ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.fitWholeVenue":"Show whole venue","picker.dragToRotateVenue":"Drag to rotate the venue","picker.dragToMoveVenue":"Drag to move the venue","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & zones","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances","checkout.free":"Free","checkout.confirmBooking":"Confirm booking","checkout.price":"Price","checkout.freeNote":"This event is free. Nothing is charged.","checkout.confirmingBooking":"Confirming your booking\u2026","checkout.confirmingSeats":"Confirming your seats\u2026","checkout.busyRetryingBooking":"Busy right now. Still confirming your booking\u2026","checkout.busyRetryingPayment":"Busy right now. Still opening secure payment\u2026","checkout.busyFailedBooking":"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.busyFailedPayment":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.seatsUnavailable":"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.","checkout.title":"Checkout","checkout.back":"Back to seats","checkout.heldFor":"Seats held for {time}","checkout.yourOrder":"Your order","checkout.row":"Row {row}","checkout.seat":"Seat {seat}","checkout.quantity":"{label} \xD7 {count}","checkout.showAll":"Show all {count} seats","checkout.yourDetails":"Your details","checkout.email":"Email","checkout.emailHint":"Your tickets are sent here.","checkout.name":"Name","checkout.namePlaceholder":"Your name","checkout.optional":"Optional","checkout.forSomeoneElse":"Ticket for someone else?","checkout.holderYou":"You \xB7 {name}","checkout.holderYouPlain":"You","checkout.change":"Change","checkout.changeHolder":"Change the holder of {ticket}","checkout.addNames":"Add names for each ticket","checkout.questions":"A few questions","checkout.payWith":"Pay with","checkout.continue":"Continue to payment","checkout.continueTest":"Continue to test payment","checkout.tryAgain":"Try again","checkout.trust":"Secure payment on the organizer\u2019s payment page. We never see your card.","checkout.freeTrust":"Free booking. Nothing is charged.","checkout.testStrip":"No real charge \xB7 tickets not valid for entry","checkout.testStripFree":"Test booking \xB7 tickets not valid for entry","checkout.privacy":"The organizer and SeatLayer use your details to issue and manage your tickets.","checkout.privacyLink":"Privacy Policy","checkout.expiringSoon":"Your seats are held for {time}. Finish soon to keep them.","checkout.opening":"Opening secure payment\u2026","checkout.redirectTitle":"Taking you to secure payment","checkout.redirectBody":"You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.","checkout.waitingPayment":"Waiting for payment\u2026","checkout.dontClose":"Don\u2019t close this tab.","checkout.confirmingTitle":"Confirming your seats","checkout.paymentReceived":"Payment received. This usually takes a few seconds.","checkout.noNeedPayAgain":"You don\u2019t need to pay again.","checkout.stillConfirmingTitle":"Still confirming","checkout.stillConfirming":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.","checkout.nothingCharged":"Nothing was charged.","checkout.expiredTitle":"Your seats were released","checkout.expiredBody":"The hold on {seats} ran out before payment started.","checkout.chooseAgain":"Choose seats again","checkout.takenTitle":"Those seats were just taken","checkout.takenBody":"Someone booked {seats} while you were filling this in.","checkout.chooseOther":"Choose other seats","checkout.closedTitle":"Online sales closed before you booked","checkout.closedBody":"These seats weren\u2019t held for you when sales closed.","checkout.backToEvent":"Back to the event","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 Bu=["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"],fS={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"},la=["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"],Ou=new Set(["ar","fa","he"]),Kn={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"},Xn=new Map(Bu.map(t=>[t.toLowerCase(),t]));function Du(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=Xn.get(e)??Kn[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=Xn.get(o)??Kn[o];if(r)return r}return Xn.get(n[0])??Kn[n[0]]}var qe={en:Bt},Li={},fe="en";function ca(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=Du(n);if(o)return o}return"en"}function mS(){return fe}function gS(t=fe){return Ou.has(t)?"rtl":"ltr"}function bS(t){return!!qe[t]}var Yn=new Set;function yS(t){return Yn.add(t),()=>{Yn.delete(t)}}function dt(t,e){e&&(qe[t]={...qe[t],...e}),fe=qe[t]?t:"en",aa(fe),oa(fe),typeof document<"u"&&(document.documentElement.lang=fe);for(let i of Yn)i()}function SS(t){Li=t}var da=/\{(\w+)\}/g;function B(t,e){let i=Li[t]??qe[fe]?.[t]??Bt[t]??t;return e?i.replace(da,(n,o)=>String(e[o]??`{${o}}`)):i}function ha(t,e,i){let n=new Intl.PluralRules(fe).select(e);return(Li[`${t}.${n}`]??qe[fe]?.[`${t}.${n}`]??Bt[`${t}.${n}`]??Li[`${t}.other`]??qe[fe]?.[`${t}.other`]??Bt[`${t}.other`]??t).replace(da,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function vS(t,e){return ra(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:fe})}function pa(t,e,i,n=!1,o=!1){let r=t.displayLabel?.trim()||t.label;return o&&!n?{title:r,detail:B("picker.heldForYou"),sellable:!1}:n||e==="booked"||e==="held"||e==="not_for_sale"?{title:r,detail:B("picker.group.legendUnavailable"),sellable:!1}:{title:r,detail:i()??"",sellable:!0}}var ht=32,ua=70;function fa(t,e){let i=ht+6,n=t.y-ua;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+ua,e.height-i)}}var qn=.8,Wu=Math.hypot(.46,.36),Vu=.26,zu=1.6,Ku=2*(1-Wu),Sa="#0b1220",ba="#ffffff";function ya(t,e,i,n,o){let r=Math.min(Math.max(zu,i*Vu),i*Ku);return new Zn({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:Sa,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function Xu(t){if(!(t instanceof $e)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&rt(e)?e:null}var Yu=220,Uu=.08,Ci=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,n){let o=n.get(e);if(n.delete(e),!i){this.retire(o);return}o?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=Y(typeof a=="string"?a:"",r.selectionColor(),Xe),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:Xu(r.seatShape(e)),h=r.seatRadius(),f=new Un({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});f.setAttrs({seatId:e,ringColor:l});let m={name:"selection-halo",stroke:G(r.categoryColor(s.categoryKey),xi(H(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;f.add(new $n({...m,width:d.width+p*2,height:d.height+p*2,offsetX:(d.width+p*2)/2,offsetY:(d.height+p*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else f.add(new De({...m,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let y={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(f.add(new $n({...y,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new $n({...y,stroke:ai(r.canvasBackground()),width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2.5,opacity:qn}));else{let p=Math.max(0,d.width/2-14),g=-Math.max(0,d.height/2-14);f.add(new De({x:p,y:g,radius:10,fill:l,listening:!1})),f.add(new Zn({x:p,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:H(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(f,u,h,c,y);else{let p=Math.max(1,h-1.25),g=Math.min(2.5,Math.max(1.8,h*.22));if(f.add(new De({...y,radius:p,strokeWidth:g})),c)f.add(new De({...y,stroke:ai(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:qn}));else{let b=Math.max(0,p-g/2);f.add(ya(0,0,b,ba,!0))}}n.set(e,f),this.host.overlayLayer.add(f)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new De({...r,stroke:ai(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:qn}));return}let l=Y(a,s.selectionColor(),Xe),c=Nn(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=Rr(i,n);if(!d)return;let u=H(l)?Sa:ba;e.add(ya(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))},Js))}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 De({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Hn(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,s),this.pulseHome().add(s);let a=i&&!n.isCached()?n.seatShape(e):void 0,l=performance.now(),c=()=>{a?.scale({x:1,y:1}),s.destroy(),this.pulses.get(e)===s&&this.pulses.delete(e),n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw()},d=u=>{if(n.isDestroyed()){c();return}s.getLayer()||this.pulseHome().add(s);let h=u-l,f=Hn(h/420);if(s.radius(r*f.radiusScale),s.opacity(f.opacity),a){let m=js(h/320);a.scale({x:m,y:m})}n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw(),h<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{n.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(d)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let n=i.seatShape(e);if(!n)return;let o=performance.now(),r=()=>{n.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!n.getLayer()){r();return}let l=a-o,c=Math.min(1,l/Yu),d=1+Uu*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 Un({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,pe),o=n?i.seat(n):void 0;if(!o){this.hideLoupe();return}let r=pa(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id),i.seatOwnedHold(o.id)),s=fa(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=o.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(o.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),n=Y(i,le(i).sectionInk),o=new Un({name:"touch-loupe",listening:!1,visible:!1});o.add(new Zn({points:[-7,ht-4,0,ht+12,7,ht-4],closed:!0,fill:i,stroke:G(n,.25),strokeWidth:1,listening:!1})),o.add(new De({radius:ht,fill:i,stroke:G(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new De({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new ga({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new ga({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:G(n,.72),listening:!1,perfectDrawEnabled:!1});return o.add(r),o.add(s),o.add(a),e.overlayLayer.add(o),o.moveToTop(),this.loupe={group:o,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as $u}from"konva/lib/Animation";var qu=1e3/ea;function va(t){return t.findOne(".selection-halo")??null}var Ti=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let n=[],o=0;for(let[s,a]of this.markers){let l=va(a);if(l){if(this.paintHalo(s,l),o>=Gn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:Wn(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Gn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:Wn(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new $u(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let n=this.host,o=xi(H(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(G(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=va(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<qu)return!1;this.lastFrameAt=i;let n=i-this.startedAt;for(let o of this.targets){let{scale:r,opacity:s}=ta(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 Zu}from"konva/lib/Group";import{Circle as Qn}from"konva/lib/shapes/Circle";import{Text as Qu}from"konva/lib/shapes/Text";var wa=28,ju=12,Ju="800",ep=44,ka=1.6,xa=1.95;function La(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 tp(t,e){return B("map.beaconAria",{seats:ha("picker.seatCount",t),name:e})}function ip(t,e){let i=e*xa,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 np="selection-beacon-ring",Ii=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),n=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(n===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=n,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let o=wa/2/i,r=Math.max(ep,Math.ceil(2*(o*xa+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Zu({listening:!1,name:"selection-beacons"});for(let c of e){let d=ip(c,o);l.add(new Qn({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*ka,fill:G(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new Qn({name:np,x:c.anchor.x,y:c.anchor.y,radius:o*ka,stroke:G(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new Qn({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:G(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new Qu({x:d.x,y:d.y,text:String(c.count),fontSize:ju/i,fontStyle:Ju,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)||wa;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",tp(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${o.x-n/2}px`,top:`${o.y-n/2}px`,width:`${n}px`,height:`${n}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function Ot(t,e,i){let n=t.width(),o=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=n*2,d=o*2;for(let u of e){let h=u.getClientRect();if(!(!(h.width>1)||!(h.height>1))){if(h.x<-c||h.y<-d||h.x+h.width>n+c||h.y+h.height>o+d)return null;h.x<r&&(r=h.x),h.y<s&&(s=h.y),h.x+h.width>a&&(a=h.x+h.width),h.y+h.height>l&&(l=h.y+h.height)}}if(i&&i.width>=0&&i.height>=0){let u=t.scaleX(),h=i.x*u+t.x(),f=i.y*u+t.y();h<r&&(r=h),f<s&&(s=f),h+i.width*u>a&&(a=h+i.width*u),f+i.height*u>l&&(l=f+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var Pi=8,op=.02,Ca=1,Ta=.5;function Ia(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Ot(t,e,o);if(!s)return 0;jn(t,s,r);let a=Math.min((r.width-2*Pi)/s.width,(r.height-2*Pi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>Ta?a:Math.min(a,rp(t.scaleX(),n));if(!(c>1+op)&&!(l>Ta)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,u=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:u+(t.y()-u)*c});let h=Ot(t,e,o);return h&&jn(t,h,r),c}function Jn(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=Ot(t,e,n);return r?jn(t,r,o):!1}function rp(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(Ca,e):Ca)/i}function jn(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 Ze(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as sp}from"konva/lib/Group";import{Circle as Pa}from"konva/lib/shapes/Circle";import{Line as ap}from"konva/lib/shapes/Line";import{Text as lp}from"konva/lib/shapes/Text";var cp=6;function Dt(t){return H(t)?"#0b1220":"#ffffff"}function Ra(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",n=0,o=0;for(let r of e)n+=r.x,o+=r.y;return{count:e.length,centroid:{x:n/e.length,y:o/e.length},fill:i,ink:Dt(i)}}var Ri=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let n=Ra({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 sp({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Ra({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(cp/2/n,1);for(let y of a)o.add(new Pa({name:"owned-seat-dot",x:y.x,y:y.y,radius:c,fill:l.fill,stroke:G("#ffffff",.55),strokeWidth:Math.max(.5,c*.28),shadowColor:l.fill,shadowBlur:c*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(i!=="seats"||r.has(s.logicalId))continue;r.add(s.logicalId);let d=this.host.sections().filter(y=>y.logicalId===s.logicalId).reduce((y,p)=>y+this.host.ownedPoints(p).length,0),u=this.host.labelAnchor(s),h=11/n,f={x:u.x,y:u.y-h*2.1};o.add(new Pa({name:"owned-section-badge",x:f.x,y:f.y,radius:h,fill:l.fill,stroke:G(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new ap({x:f.x-h*.62,y:f.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:l.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new lp({x:f.x+h*.12,y:f.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:s.logicalId,centre:f,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};import{Text as dp}from"konva/lib/shapes/Text";var hp=4;function Nt(t){return H(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function up(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 Ma(t,e){t.padding(hp),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),up(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(),dp.prototype._sceneFunc.call(this,n)})}function Ea(t){return t?"seat":"section"}function Aa(t){let e=new Set,i=0;for(let o of t.memberIds){let r=t.categoryKey(o);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(o)&&(i+=1)}let n=[];for(let o of t.categoryOrder)e.has(o)&&n.push({key:o,name:t.categoryLabel(o)||o,price:t.categoryPrice(o),color:t.categoryColor(o)});return n.length?i?{mode:"section",title:t.name,fields:[],rows:n,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("picker.group.legendUnavailable")}}function Fa(t){let e=t.place?.kind==="booth",i=e?"":fp(t.label,t.sectionLabel,t.rowLabel),n=t.place?{caption:t.place.typeWord?.trim()||B(e?"picker.booth":"picker.table"),value:t.place.name}:null,o=[t.sectionLabel,t.rowLabel?B("picker.rowLabel",{label:t.rowLabel}):null,n?n.value:null,i?B("picker.seatLabel",{label:i}):null].filter(Boolean).join(" \xB7 ")||t.label,r=[t.sectionLabel?{caption:B("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:B("picker.row"),value:t.rowLabel}:null,n,i?{caption:B("picker.seat"),value:i}:null].filter(c=>c!=null),s={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},a=pr(t).map(c=>{let d=B(c.titleKey);return{icon:c.icon,title:d===c.titleKey?c.titleFallback:d,tone:c.tone,...c.note?{note:c.note}:{}}}),l=t.facts??[];return{mode:"seat",title:o,fields:r,rows:[s],notes:a,facts:l,...l.length&&t.head?{head:t.head}:{},note:l.length?null:pp(t.status,t.closed)}}function pp(t,e){return e||t==="not_for_sale"?B("picker.notForSale"):t==="booked"?B("map.statusTaken"):t==="held"?B("map.statusHeld"):null}function fp(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 mp=16,gp=8;function _a(t,e,i,n=mp){let o=gp,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 Ba=16,eo=14,Oa=10.5,bp=14,yp=12.5,Da={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Sp={warn:"#d8a425",premium:"#e8c15a"},vp=.1,wp=.06,Na={minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",boxShadow:"0 6px 20px rgba(2,6,23,0.22)",lineHeight:"1.35"},kp={minWidth:"",maxWidth:"",padding:"",overflow:"",borderRadius:"",boxShadow:"",lineHeight:"",background:"",backgroundColor:"",border:"",fontFamily:""},Mi=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.roomEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.presented=null;this.mount=null;this.presentedView=null;this.viewEl=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.aisleIds=new Set;this.aisleDoc=null;this.placeFacts=new Map;this.sectionEntrances=new Map;this.placeDoc=null;this.onPointerMove=e=>{if(this.fromPresenter(e))return;if(this.presented=null,this.mount=null,this.presentedView=null,e.pointerType!=="mouse"){this.hide();return}let i=this.host.container.getBoundingClientRect();this.cursor={x:e.clientX-i.left,y:e.clientY-i.top},this.schedule()};this.onPointerLeave=e=>{this.fromPresenter(e)||this.hide()};this.onPointerDown=e=>{e.pointerType!=="mouse"&&!this.fromPresenter(e)&&this.hide()};this.onWheel=e=>{this.cursor&&!this.fromPresenter(e)&&this.schedule()};this.host=e}attach(){this.attached||(this.attached=!0,this.host.container.addEventListener("pointermove",this.onPointerMove),this.host.container.addEventListener("pointerleave",this.onPointerLeave),this.host.container.addEventListener("pointerdown",this.onPointerDown),this.host.container.addEventListener("wheel",this.onWheel,{passive:!0}))}destroy(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0),this.host.container.removeEventListener("pointermove",this.onPointerMove),this.host.container.removeEventListener("pointerleave",this.onPointerLeave),this.host.container.removeEventListener("pointerdown",this.onPointerDown),this.host.container.removeEventListener("wheel",this.onWheel),this.attached=!1,this.cursor=null,this.root?.remove(),this.root=null,this.titleEl=null,this.rowsEl=null,this.notesEl=null,this.factsEl=null,this.noteEl=null,this.viewEl=null,this.signature=""}presentSeat(e,i,n,o){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),o!==void 0&&(this.presentedView=o),this.presented=e,this.mount=n,this.cursor=i,this.update()}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":e.head?[e.head.title,e.head.sub,...e.facts.map(i=>`${i.caption} ${i.value}`)].filter(Boolean).join(" | "):[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}fromPresenter(e){return!!this.mount&&e.target instanceof Node&&this.mount.contains(e.target)}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let n=this.host.hostCardOpen?.()?null:this.resolve(i);if(!n){this.hide(),this.lastUpdateMs=performance.now()-e;return}let o=this.ensureRoot(),r=`${n.mode}|${n.title}|${n.note??""}|${this.host.canvasBackground()}|`+n.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${n.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${n.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`+(n.head?`|${n.head.title}|${n.head.sub??""}|${n.head.tone??""}|${n.head.plate??""}`:"");r!==this.signature&&(this.signature=r,this.paint(n)),this.showView(this.presented?this.presentedView:null),this.model=n,o.style.display="block";let s=this.mount??this.host.container,a=_a(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(Ea(this.host.seatsPickable())==="seat"){let a=this.host.hoveredSeatId()??this.host.nearestSeat(e);return a?this.seatModel(a):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;if(!i||n==null||this.host.sectionInteractive?.(i)===!1)return null;let o=this.host.sectionMembers(i),r=this.host.sectionCardHead?.(i,o)??null,s=Aa({name:n||i,memberIds:o,categoryOrder:this.host.categoryOrder(),categoryKey:a=>this.host.seat(a)?.categoryKey??null,categoryLabel:a=>this.host.categoryLabel(a),categoryPrice:a=>this.host.categoryPrice(a),categoryColor:a=>this.host.categoryColor(a),categorySellable:a=>this.host.categorySellable(a),seatSellable:a=>this.host.seatSellable(a)});return r?{...s,head:r,facts:s.rows.map(a=>({caption:a.name,value:a.price??""}))}:s}seatModel(e){let i=this.host.seat(e);if(!i)return null;let n=this.host.seatStatus(e),o=this.host.seatFacts?.(e)??null;if((n!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!o?.length)return null;let s=this.host.seatSectionLabel(e),a=o?.length?this.host.seatCardHead?.(e)??null:null;return Fa({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.seatPrice?.(i)??this.host.categoryPrice(i.categoryKey),categoryColor:this.host.categoryColor(i.categoryKey),status:this.host.seatStatus(e),closed:this.host.seatClosed(e),...i.accessibility?.length?{accessibility:i.accessibility}:{},...i.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{},...i.commercial?{commercial:i.commercial}:{},...this.isAisleSeat(e)?{aisle:!0}:{},...this.placeOf(i),...o?.length?{facts:o}:{},...a?{head:a}:{}})}placeOf(e){let i=this.host.chartDoc();if(!i)return{};if(this.placeDoc!==i){this.placeDoc=i,this.placeFacts.clear(),this.sectionEntrances=nt(i);for(let r of ii(i))r.type!=="table"&&r.type!=="booth"||this.placeFacts.set(r.id,{kind:r.type,name:r.displayLabel?.trim()||r.label,...r.displayType?.trim()?{typeWord:r.displayType.trim()}:{},...r.type==="booth"&&r.boothType?{boothType:r.boothType}:{},...r.entrance?.trim()?{entrance:r.entrance.trim()}:{}})}let n=this.placeFacts.get(e.rowId);if(!n)return{};let o=n.entrance??(e.sectionId?this.sectionEntrances.get(e.sectionId):void 0);return{place:{kind:n.kind,name:n.name,...n.typeWord?{typeWord:n.typeWord}:{}},...n.boothType?{boothType:n.boothType}:{},...o?{entrance:o}:{}}}isAisleSeat(e){let i=this.host.chartDoc();return i?(this.aisleDoc!==i&&(this.aisleDoc=i,this.aisleIds=hi(i)),this.aisleIds.has(e)):!1}rowName(e,i){let n=this.host.chartDoc();if(!n)return null;if(this.rowNamesDoc!==n){this.rowNamesDoc=n,this.rowNames.clear();for(let r of n.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let o=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return o?Rt(o,i??void 0)||o:null}ensureRoot(){let e=this.mount??this.host.container;if(this.root)return this.root.parentElement!==e&&e.appendChild(this.root),this.root;let i=Nt(this.host.canvasBackground()),n=document.createElement("div");n.className="sl-hover-card",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",...Na,background:i.plate,border:`1px solid ${i.stroke}`,fontFamily:this.host.labelFont(),zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Ba}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:Y(i.plate,"#0b1220")});let r=document.createElement("div");Object.assign(r.style,{display:"flex",flexDirection:"column",gap:"0"});let s=document.createElement("div");Object.assign(s.style,{display:"none",flexDirection:"column",gap:"0"});let a=document.createElement("div");Object.assign(a.style,{fontSize:`${eo}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:Y(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),n.append(o,r,s,l,a),e.appendChild(n),this.root=n,this.titleEl=o,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,n}paint(e){let i=this.ensureRoot();if(e.head)return this.paintRoomCard(i,e,e.head);this.roomEl&&this.leaveRoomCard(i);let n=Nt(this.host.canvasBackground());i.style.background=n.plate,i.style.border=`1px solid ${n.stroke}`;let o=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=Y(n.plate,"#0b1220");if(o.replaceChildren(),o.style.color=l,o.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;o.style.display="flex",o.style.padding="0";for(let[d,u]of e.fields.entries()){let h=document.createElement("div");Object.assign(h.style,{flex:u.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${n.stroke}`:"none"});let f=document.createElement("div");f.textContent=u.caption,Object.assign(f.style,{fontSize:`${Oa}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let m=document.createElement("div");m.textContent=u.value,Object.assign(m.style,{marginTop:"2px",fontSize:`${Ba}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(f,m),o.append(h)}}else o.style.display="block",o.style.padding="10px 15px 9px",o.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${eo}px`,fontWeight:"700",background:c.color,color:vn(c.color)});let u=document.createElement("span");u.textContent=c.name;let h=document.createElement("span");h.textContent=c.price??"",d.append(u,h),r.appendChild(d)}this.paintNotes(s,e,n,l),this.paintFacts(this.factsEl,e,n,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=Y(n.plate,"#0b1220")}paintRoomCard(e,i,n){e.classList.add("room"),Object.assign(e.style,kp);for(let c of[this.titleEl,this.rowsEl,this.notesEl,this.factsEl,this.noteEl])c&&(c.style.display="none");let o=this.roomEl;o||(o=document.createElement("div"),e.appendChild(o),this.roomEl=o),o.style.display="block";let r=document.createElement("div");if(r.className="slhc-head",n.plate){let c=document.createElement("span");c.className="slhc-plate",c.innerHTML=n.plate,r.appendChild(c)}let s=document.createElement("div"),a=document.createElement("b");if(a.className="slhc-title",a.textContent=n.title,s.appendChild(a),n.sub){let c=document.createElement("span");c.className="slhc-sub",c.textContent=n.sub,n.tone&&(c.style.color=n.tone),s.appendChild(c)}r.appendChild(s);let l=i.facts.map(c=>{let d=document.createElement("div");d.className="slhc-row";let u=document.createElement("span");u.textContent=c.caption;let h=document.createElement("b");return h.textContent=c.value,d.append(u,h),d});o.replaceChildren(r,...l)}leaveRoomCard(e){e.classList.remove("room"),this.roomEl?.remove(),this.roomEl=null,this.rowsEl&&(this.rowsEl.style.display="flex"),Object.assign(e.style,{...Na,fontFamily:this.host.labelFont()})}paintFacts(e,i,n,o){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${n.stroke}`,color:o});for(let[r,s]of i.facts.entries()){let a=document.createElement("div");Object.assign(a.style,{flex:"1 1 auto",padding:"8px 12px 9px",textAlign:"center",borderLeft:r?`1px solid ${n.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${Oa}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:`${eo}px`,fontWeight:"700",whiteSpace:"nowrap"}),a.append(l,c),e.append(a)}}paintNotes(e,i,n,o){if(e.replaceChildren(),!i.notes.length){e.style.display="none";return}e.style.display="flex";for(let[r,s]of i.notes.entries()){let a=vn(n.plate)==="#ffffff"?Da.onDark:Da.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,Sp[s.tone],vp):j(n.plate,o,wp),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=fr(s.icon),Object.assign(u.style,{flex:"none",marginTop:"1px"});let h=document.createElement("div");Object.assign(h.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let f=document.createElement("div");if(f.textContent=s.title,Object.assign(f.style,{fontSize:`${bp}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(f),s.note){let m=document.createElement("div");m.textContent=s.note,Object.assign(m.style,{fontSize:`${yp}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(m)}d.append(u,h),e.appendChild(d)}}};var Ha="#1f9d6b";function xp(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 Ga(t,e){let i=e?new Set(e):null;xp(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Wa(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 Va(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function K(t){let e=Er(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 ut(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 pt(t,e,i,n,o,r){let s=n*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let u=e*(d/6-.5),h=i*(c/4-.5),f={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!te(f,o,r))return!1}return!0}function za(t,e,i){let n=K(t),o={x:n.x+n.width/2,y:n.y+n.height/2},r=te(o,t,e)?[o,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:n.x+n.width*c/12,y:n.y+n.height*l/12};te(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:qo(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 Ka(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return K(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function Lp(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 Xa(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=Lp(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 Cp}from"konva/lib/shapes/Text";function to(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 me=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),to(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/At),n=Math.floor((e.x+Math.max(0,e.width))/At),o=Math.floor(e.y/At),r=Math.floor((e.y+Math.max(0,e.height))/At),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var io=new WeakMap;function Qe(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=io.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},io.set(t,e);let i=()=>{let n=io.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Ya=new WeakMap,Ua=new WeakMap;function $a(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 Cp({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 Tp(t){let e=t.labelFont(),i=Qe(),n=Ua.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new me,r=$a(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(),Ua.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function Ip(t){let e=Tp(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(),Qe(),t.seatR,i]),o=Ya.get(t.rowLabelPlan);if(o?.key===n&&o.seats===t.seatById)return o.boxes;let r=new me;for(let l of i)r.insert(l);let s=$a(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(),Ya.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function qa(t,e){let i=t.sections.filter(m=>m.id===e||m.logicalId===e),n=i.map(m=>K(m.outline));if(!n.length)return null;let o=Math.min(...n.map(m=>m.x)),r=Math.min(...n.map(m=>m.y)),s=Math.max(...n.map(m=>m.x+m.width)),a=Math.max(...n.map(m=>m.y+m.height)),l=new Set(i.flatMap(m=>m.memberIds));for(let m of l){let y=t.seatById.get(m);y&&(o=Math.min(o,y.x-t.seatR),r=Math.min(r,y.y-t.seatR),s=Math.max(s,y.x+t.seatR),a=Math.max(a,y.y+t.seatR))}let c=m=>{[m.x,m.y,m.width,m.height].every(Number.isFinite)&&(o=Math.min(o,m.x),r=Math.min(r,m.y),s=Math.max(s,m.x+m.width),a=Math.max(a,m.y+m.height))},d=m=>{let y={x:m.x+m.width/2,y:m.y+m.height/2};return i.some(p=>te(y,p.outline,p.holes))};for(let{node:m,backdrop:y}of t.freeTextById.values()){let p=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),y&&c(y.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:m}of t.iconNodeById.values()){let y=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(y)&&c(y)}let u=Ip(t);t.rowLabelPlan.forEach((m,y)=>{(m.focusKeys??[]).some(g=>g===e||i.some(b=>g===b.id||g===b.logicalId))&&c(u[y])});let h=Math.max(s-o,a-r),f=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-f,y:r-f,width:Math.max(1,s-o+f*2),height:Math.max(1,a-r+f*2)}}import{Rect as Pp}from"konva/lib/shapes/Rect";import{Text as Za}from"konva/lib/shapes/Text";var no="\0";function Rp(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 Mp(t,e){let i=t.filter(f=>Number.isFinite(f.centroid.x)&&Number.isFinite(f.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let n=i.map(f=>({member:f,weight:Math.max(1,Rp(f.outline))})),o=n.reduce((f,m)=>f+m.weight,0),r=n.reduce((f,m)=>({x:f.x+m.member.centroid.x*m.weight/o,y:f.y+m.member.centroid.y*m.weight/o}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(f=>{let m={x:f.centroid.x-e.x,y:f.centroid.y-e.y},y={x:f.centroid.x-r.x,y:f.centroid.y-r.y};return{member:f,depth:m.x*l.x+m.y*l.y,lateral:Math.abs(y.x*-l.y+y.y*l.x)}}).sort((f,m)=>m.depth-f.depth||f.member.id.localeCompare(m.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(f=>f.depth>=u);return h.sort((f,m)=>f.lateral-m.lateral||m.depth-f.depth||f.member.id.localeCompare(m.member.id)),h[0].member}function Ep(t){let i=[...B("map.fromPrice",{price:no}).toLocaleLowerCase()],n=i.findIndex(o=>o!==no&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(no).join(t)}function Ap(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function Fp(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>Ap(n.label,i))}function Qa(t,e){if(!e.zones?.length||!t.sections.length)return;let i=zs(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&&!Fp(o.label,r))continue;let s=r[0];for(let w of r)w.centroid.y<s.centroid.y&&(s=w);t.derivedFloorGroups&&(s=Mp(r,o.focalPoint??e.focalPoint)??s);let a=1/0,l=-1/0,c=1/0,d=-1/0;for(let w of r)for(let k of w.outline)k.x<a&&(a=k.x),k.x>l&&(l=k.x),k.y<c&&(c=k.y),k.y>d&&(d=k.y);let u=isFinite(a)&&l>a?l-a:0,h=!t.derivedFloorGroups&&isFinite(c),f=h?(a+l)/2:s.centroid.x,m=h?c:s.centroid.y,y=1/0,p=1/0;for(let w of r)for(let k of w.memberIds){let v=t.seatById.get(k),x=v&&t.catPrice.get(v.categoryKey);!v||typeof x!="number"||(v.accessible||v.accessibility?.length?p=Math.min(p,x):y=Math.min(y,x))}isFinite(y)||(y=p);let g=new Pp({x:f,y:m,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(g);let b=new Za({x:f,y:m,text:o.label,fontSize:yi,fontStyle:ds,letterSpacing:0,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1});b.offsetX(b.width()/2),b.offsetY(b.height()/2),t.bgLayer.add(b);let S=null;isFinite(y)&&(S=new Za({x:f,y:m,text:Ep(ce(y,t.currency)),fontSize:Si,fontStyle:hs,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),S.offsetX(S.width()/2),t.bgLayer.add(S)),t.zones.push({id:o.id,anchor:{x:f,y:m},back:g,background:t.canvasBackground,name:o.label,spanWorld:u,aboveZone:h,area:isFinite(a)?{x:a,y:c,width:l-a,height:d-c}:void 0,label:b,sub:S})}}function ja(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&&it(n)==="combined"&&!n.zones?.length?n.floors?.find(d=>lr(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 _p=new Set,Ja=16,Bp=5,Ei=class{constructor(e,i,n=8e3){this.chunks=e;this.host=i;this.warmSeats=n;this.wanted=new Set;this.built=new Map;this.loose=new Map;this.located=new Map;this.queue=[];this.pinQueue=[];this.frame=0;this.stepping=!1;this.stopped=!1}locate(e){let i=this.located.get(e);if(i===void 0){i=null;let n=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let o of n){let r=o===void 0?-1:this.chunks.get(o)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:o,seat:this.chunks.get(o)[r],index:r};break}}this.located.set(e,i)}return i??void 0}isResident(e){let i=this.locate(e);return!!i&&(this.loose.has(e)||(this.built.get(i.section)??0)>i.index)}sync(e,i=_p){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<Bp;for(;this.pinQueue.length&&n();){let o=[];for(let r of this.pinQueue.splice(0,Ja)){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+Ja,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 el(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 Xp}from"konva/lib/shapes/Circle";import{Line as Yp}from"konva/lib/shapes/Line";import{Rect as Up}from"konva/lib/shapes/Rect";import{Text as $p}from"konva/lib/shapes/Text";function Pe(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Re(t,e){return Pe(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var tl=.35,il=.7,je="#0b1220",ft="#ffffff",nl="#0b1220",oo="#232c40",ol="#8b93a7";function ro(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var so="#f7f8fb";import{Text as sl}from"konva/lib/shapes/Text";var rl="500",Op=2.5;function Dp(t,e){return t>=ie||e&&t>=gi}function Np(t){return t.effectiveScale<gi?!1:t.focusActive||t.stageWidth<U}function Hp(t,e,i){return i&&e>=gi?Math.max(t,ts/Math.max(e,1e-4)):t}function Gp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=V/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(at,r),s)}function ao(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function al(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 ll(t,e){return e>0?Math.min(t,e/2):t}function cl(t){return Ai(lo(t))}function lo(t){let e=ao(t,!1),i=ao(J,!1),n=e>0?i/e:1;return ge/Math.max(1,n)}function Ai(t){return V/Math.max(t,1e-4)/Mn(1,!1,V)}function dl(t){return Ai(t)*wi}function Wp(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function hl(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=Np({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:Mn(e,t.labelsWereVisible(),V),o=t.labelLayers(),r=o.seatLabels&&Dp(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=g=>{let b=t.worldToScreen({x:g.x(),y:g.y()}),S=g.width()*e,w=g.height()*e;return b.x-S/2>=0&&b.y-w/2>=0&&b.x+S/2<=t.stage.width()&&b.y+w/2<=t.stage.height()};for(let[g,b]of t.boothLabelById){let S=t.circleById.get(g);b.visible(ye(b.fontSize(),n)&&!!S?.isVisible()&&t.focusedSeatOpacity(g,S?.getAbsoluteOpacity()??1)>=.5&&s(b))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0,c=t.rowLabelDwell,d=t.gesturing?.()??!1,u=performance.now();if(c?.begin(),r)for(let g of t.visibleSeatCandidates()){if(g.kind==="booth")continue;let b=t.worldToScreen(g);if(b.x<-20||b.x>t.stage.width()+20||b.y<-20||b.y>t.stage.height()+20||t.accessGlyphById.has(g.id)&&t.accessGlyphShouldShow(g.id))continue;let S=t.circleById.get(g.id);if(!S?.isVisible()){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let w=t.statusById.get(g.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(g.id)&&(w==="booked"||w==="not_for_sale"||w==="held"&&!t.ownedHold.has(g.id))){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(g.id)){t.seatLabelDrops.set(g.id,"selection-tick");continue}if(S&&t.opts.organizerGlyph?.isPainted(S)){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.focusedSeatOpacity(g.id,S.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let x=Hp(ge*t.seatLabelScale(g),e,i),T=si(g.displayLabel??g.label),P=S?t.seatLabelInk(g,S):t.seatPreferredLabelInk(g),L=t.seatLabelPool.get(g.id);L?(L.position({x:g.x,y:g.y}),L.text(T),L.fontSize(x),L.fontFamily(t.labelFont()),L.fill(P),L.offset({x:0,y:0}),L.scale({x:1,y:1})):(L=new sl({x:g.x,y:g.y,text:T,fontSize:x,fontStyle:rl,fontFamily:t.labelFont(),fill:P,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(g.id,L));let C=ao(t.seatR,i);if(L.fontSize(Gp({authoredFontSize:x,measuredWidth:L.width(),maxWidth:C,effectiveScale:e})),L.width()>C+.01){t.seatLabelDrops.set(g.id,"label-overflows-marker");continue}if(!ye(L.fontSize(),e)){t.seatLabelDrops.set(g.id,"below-minimum-size");continue}if(L.offsetX(L.width()/2),L.offsetY(L.height()/2),Wp(t,g.id,L),!s(L)){t.seatLabelDrops.set(g.id,"outside-viewport");continue}if(!(c&&!c.admit(`seat:${g.id}`,u,d))&&(a.add(g.id),t.seatLabelById.set(g.id,L),++l>=is))break}for(let[g,b]of t.seatLabelPool)a.has(g)||(b.destroy(),t.seatLabelPool.delete(g));let h=new me;for(let{node:g}of t.freeTextById.values()){if(!g.isVisible())continue;let b=g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:b.x-ee,y:b.y-ee,width:b.width+ee*2,height:b.height+ee*2})}let f=new me,m=null,y=()=>{if(m)return m;m=new me;for(let g of t.seatLabelById.values()){if(!g.isVisible())continue;let b=g.getClientRect({skipShadow:!0,skipStroke:!0});m.insert({x:b.x,y:b.y,width:b.width,height:b.height})}return m},p=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Op;if(o.rowLabels)for(let g of Vp(t.rowLabelPlan)){let b=t.rowLabelPlan[g],S=t.focusedSectionId!=null&&b.focusKeys?.includes(t.focusedSectionId),w=Math.max(e,1e-4),k=S?Math.max(b.fontSize,Et/w):b.fontSize,v=Math.max(Math.min(k,es(t.stage.width())/w),S?Et/w:0);if(!r&&(!S||!p)||!S&&!ye(v,n))continue;let x=t.worldToScreen({x:b.x,y:b.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let T=new sl({x:b.x,y:b.y,text:b.text,fontSize:v,fontStyle:rl,fontFamily:t.labelFont(),fill:b.ink,rotation:b.rotation,opacity:b.opacity,shadowColor:"#05070c",shadowBlur:b.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:b.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});b.pill&&Ma(T,b.pill),T.offsetX(T.width()/2),T.offsetY(T.height()/2);let P=t.resolveAutomaticRowLabelPosition(T,b,h);T.position(P),T.setAttr("rowLabel",!0),b.rowKey&&T.setAttr("rowKey",b.rowKey),T.setAttr("focusKeys",b.focusKeys??[]),t.rowLabelGroup.add(T);let L=T.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,I=L.x<C?C-L.x:L.x+L.width>t.stage.width()-C?t.stage.width()-C-L.x-L.width:0,R=L.y<C?C-L.y:L.y+L.height>t.stage.height()-C?t.stage.height()-C-L.y-L.height:0,M=P;if(I||R){let _=t.labelGroup.getAbsoluteTransform(),F=_.point(P);if(M=_.copy().invert().point({x:F.x+I,y:F.y+R}),b.automaticAway&&Math.abs((M.x-P.x)*-b.automaticAway.y+(M.y-P.y)*b.automaticAway.x)>(t.markerR??t.seatR)){T.destroy();continue}T.position(M);let N=T.getClientRect({skipShadow:!0,skipStroke:!0});if(y().collisionCount({x:N.x,y:N.y,width:N.width,height:N.height})>0){T.destroy();continue}}let E=t.rowLabelBox(T,M),A=Jr/w;if(f.collisionCount({x:E.x-A/2,y:E.y-A/2,width:E.width+A,height:E.height+A})>0){T.destroy();continue}if(b.automaticAway&&h.collisionCount(E)>0){T.destroy();continue}if(c&&!c.admit(`row:${g}`,u,d)){T.destroy();continue}h.insert(E),f.insert(E)}c?.end(),t.overlayLayer.batchDraw()}function Vp(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 co(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:lo(e)}}function zp(t){let e=Ne(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:J*2,labelFontSize:be({width:e.width,height:e.height,text:t.label})}}function Ne(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 ul(t,e){let i=co(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?zp({...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 Kp(t){return dl(t.labelFontSize)}function pl(t){return Ai(t.labelFontSize)}function Fi(t){let e=Math.max(t.diameter,1e-4);return Math.max(ae,ci/e)}function fl(t){return Math.max(Kp(t),Fi(t)*wi)}function ml(t){for(let e of t.seats){if(e.kind==="booth"){qp(t,e);continue}let i=t.seatContainer(e.id),n=$s({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:Mr(e.glyph,t.catByKey.get(e.categoryKey)),wheelchairBay:e.wheelchairSpaceType==="no-seat"});if(n instanceof $e&&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 Xp({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Pt(e.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(e.id,o),i.add(o)}if(ot(e.accessibility??[])){let o=t.buildAccessGlyph(e,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(e.id,o),i.add(o)}}}}function qp(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 Up({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 $p({x:o,y:r,text:a,fontSize:n.nameSize??be({...Ne(n),text:a}),fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??je,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 gl(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 bl(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 vf}from"konva/lib/shapes/Circle";import{Group as Wl}from"konva/lib/Group";import{Rect as wf}from"konva/lib/shapes/Rect";import{Text as kf}from"konva/lib/shapes/Text";var Me=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*Me),o.height/(e.height*Me));return q(r,i.min,i.max)}var Ht=.55;function Gt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function ho(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??_t,a=e.scaleX(),l=mt(e,i,n,o)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(o.x+o.width/2),d=r.y-(o.y+o.height/2);return Math.hypot(c,d)<=Math.min(o.width,o.height)*.02}function yl(t,e,i,n){let o=q(e,n.min,n.max),r=t.scaleX();if(o===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.setAttrs({scaleX:o,scaleY:o,x:i.x-s*o,y:i.y-a*o}),!0}function 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*Me),s.height/(e.height*Me)),l=n??i.min,c=q(Math.max(a,l),i.min,Math.max(l,Gt(i,r)));t.scale({x:c,y:c}),t.position({x:s.x+s.width/2-(e.x+e.width/2)*c,y:s.y+s.height/2-(e.y+e.height/2)*c})}function vl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function uo(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 wl(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Zp="500",Qp=11;function jp(t){let e=ct(Qp,t),i=bi(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var Jp=4;function ef(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let n=i[0];for(let o of i)o.length>=n.length&&(n=o);return n}return e}function kl(t,e,i){let n=t.numberLabel,o=ef(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.fontStyle(i<U?Zp:Te),n.visible(!0),n.rotation(0);let r=Jp/e;for(let s of jp(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),pt(a,n.width()+r,n.height()+r,0,t.outline,t.holes))return!0}return n.position(t.centroid),!1}function xl(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 Pl(t,e){let i=t.sectionHeat.get(e.id)??t.sectionHeat.get(e.logicalId)??(e.zone?t.sectionHeat.get(e.zone):void 0);if(i==null||i<=0){e.outlinePoly.stroke(G(e.outlineTint,.5)),e.outlinePoly.fill(G(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(G(n,.72+i*.25)),e.outlinePoly.fill(G(n,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(n),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function po(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function Rl(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&&Pe(s,e)&&(o+=1)}return o}function Ml(t,e){return po(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Es?"nearly-gone":"normal"}function El(t,e){let i=Ml(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=Ws(t.canvasBackground,i,n?null:o?o.tint??null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(i==="sold-out"?B("map.soldOut"):B("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Al(t,e){return j(e,H(t)?"#ffffff":"#000000",Ls)}function fo(t,e,i=0){let n=xs-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function tf(t,e){return Fl(t,e)!=null}function Fl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function _l(t,e,i){let n=fo(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 nf(t,e,i){let n=_l(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(ks),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Oe:0)}function of(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var rf=.05;function Bl(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<=rf}function Ol(t,e){let i,n;t.reducedMotion?(i=e<=Ce?1:0,n=e<=Ye?1:0):(i=q((we-e)/(we-Ce),0,1),n=q((Ce-e)/(Ce-Ye),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Q;o&&(i=1),(!t.zones.length||t.sectionsPinned)&&(n=0),t.seatLayer.opacity(Bl(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>An);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<U,c=l&&o&&t.zones.length===0,d=le(t.canvasBackground),u=q((i-.2)/.8,0,1),h=new Set(t.zones.map(p=>p.id)),f=new Set,m;for(let p of t.sections){let g=t.hasFocusDimOverlay?1:a&&p.id!==a&&p.logicalId!==a&&p.zone!==a?Ie:1,b=Fl(t,p);b&&p.zone&&f.add(p.zone);let S=Math.min(g,wl(p.memberCategoryKeys,t.categoryFilter)?Ie:1,t.accessFilterActive&&!b?Ie:1);p.outlinePoly.opacity(o?0:(1-i)*S),p.blockPoly.opacity(as*i*S);let w=t.sectionIsOwned(p);p.blockPoly.stroke(w?t.selectionColor:p.shellStroke||d.sectionStroke),p.blockPoly.strokeWidth((w?ls:Ue)/Math.max(r,1e-4));let k=p.blockPoly.fill(),v=typeof k=="string"?k:p.baseFill,x=!!p.shellCategoryColor&&!p.explicitInk&&["normal","nearly-gone"].includes(Ml(t,p)),T=x?Xs(p.shellCategoryColor,v,4.5):Ks(v,p.explicitInk,p.preferredInk,xr);p.nameLabel.fill(T),p.subLabel.fill(T),nf(p,l,b);let P=p.zone!=null&&h.has(p.zone);s&&(u>.01||p.externalLabel)&&(m??=lf(t.sections),df(t,p,r,_l(p,l,b),!P&&m));let L=b||!P?1:1-n;p.nameLabel.opacity(p.nameLabelFits?(p.externalLabel?1:u)*L*S:0),p.subLabel.opacity(0);let C=c&&!p.nameLabelFits,I=P&&n>.01;s&&(p.numberLabelFits=(I||C)&&kl(p,r,t.stageWidth)),p.numberLabelFits&&p.numberLabel.fill(x?T:he(v,p.explicitInk,p.preferredInk)),p.numberLabel.opacity(p.numberLabelFits?(C?u:I?n:0)*S:0);let R=p.nameLabel.opacity(),M=p.numberLabel.opacity();if(R>.05&&M>.05){let E=Math.min(1*S,R+M);R>=M?(p.nameLabel.opacity(E),p.numberLabel.opacity(0)):(p.numberLabel.opacity(E),p.nameLabel.opacity(0))}}let y=n;for(let p of t.zones){let g=t.accessFilterActive&&!f.has(p.id)?Ie:1,b=p.label.visible()?y*g:0;p.back.opacity(b),p.label.opacity(b),p.sub&&p.sub.opacity(Ll(t,p)?0:b),s&&hf(t,p,r)}if(!t.glideInProgress&&(u>.01||y>.01)){af(t,r),sf(t.sections);for(let p of t.zones){let g=p.label.opacity();p.back.opacity(g),p.sub&&p.sub.opacity(Ll(t,p)?0:g)}}(y>.01||c)&&xl(t.sections);for(let p of t.sections)of(p);t.bgLayer.batchDraw()}function Ll(t,e){return t.stageWidth<U||!e.sub||!e.sub.visible()}function sf(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let n=i.filter(o=>o.nameLabel.opacity()>.05).sort((o,r)=>{let s=K(o.outline),a=K(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function af(t,e){let n=[],o=u=>{let h=t.worldToScreen({x:u.x(),y:u.y()}),f=K(ut({x:0,y:0},u.width()*e,u.height()*e,u.rotation()));return{x:h.x-f.width/2,y:h.y-f.height/2,w:f.width,h:f.height}};for(let u of t.zones){if(u.label.opacity()<=.05)continue;let h=u.back.getAbsolutePosition(),f=u.back.width()*e,m=u.back.height()*e;n.push({node:u.label,tier:2,section:!1,zone:u,box:{x:h.x-f/2,y:h.y-m/2,w:f,h:m}})}for(let u of t.sections){if(u.nameLabel.opacity()>.05){let h=tf(t,u)?-1:1;n.push({node:u.nameLabel,tier:h,section:!0,area:u.labelArea,box:o(u.nameLabel)})}u.numberLabel.opacity()>.05&&n.push({node:u.numberLabel,tier:1,section:!1,area:u.labelArea,box:o(u.numberLabel)})}let r=t.landmarks.map(u=>{let h=t.worldToScreen({x:u.x,y:u.y}),f=t.worldToScreen({x:u.x+u.width,y:u.y+u.height});return{x:Math.min(h.x,f.x),y:Math.min(h.y,f.y),w:Math.abs(f.x-h.x),h:Math.abs(f.y-h.y)}});if(n.length<2&&!r.length)return;n.sort((u,h)=>u.tier-h.tier||(h.area??0)-(u.area??0)||u.box.y-h.box.y||u.box.x-h.box.x);let s=[...r],a=u=>s.some(h=>u.x<h.x+h.w+4&&h.x<u.x+u.w+4&&u.y<h.y+h.h+4&&h.y<u.y+u.h+4),l=n.some(u=>u.zone)?mf(t):[],c=t.bgLayer.getStage()?.height()??1/0,d=u=>!a(u)&&!l.some(h=>ff(u,h,2))&&u.x>=6&&u.x+u.w<=t.stageWidth-6&&u.y>=Dl&&u.y+u.h<=c-6;for(let u of n){if(u.zone){let f=gf(t,u.zone,u.box,d);f?s.push(f):u.node.opacity(0);continue}if(!a(u.box)){s.push(u.box);continue}let h=!1;if(u.section){let f=u.node.fontSize(),m=u.node.y(),y=u.node.letterSpacing()>0;for(let p of En){let g=f*p;if(g*e<Ft(t.stageWidth))break;Ee(u.node,g,m),y&&(u.node.letterSpacing(u.node.fontSize()*Oe),u.node.offsetX(u.node.width()/2));let b=o(u.node);if(!a(b)){s.push(b),h=!0;break}}h||(Ee(u.node,f,m),y&&(u.node.letterSpacing(u.node.fontSize()*Oe),u.node.offsetX(u.node.width()/2)))}h||u.node.opacity(0)}}function Ee(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}var Cl=8;function lf(t){if(t.length<=Cl)return!0;let e=new Set;for(let i of t)if(e.add(i.logicalId),e.size>Cl)return!1;return!0}function cf(t,e,i){let n=K(t);return be({width:n.width*i,height:n.height*i,text:e})}function df(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<U,s=Ft(t.stageWidth),a=Fn(lt*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&Bl(t)?Math.max(a,cf(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Ee(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,f]of n.entries()){e.nameLabel.text(f);let m=K(e.outline),y=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:m.height>m.width*Rs?[0,-90]:[0];for(let p of y)for(let g of e.labelAnchors)for(let b=c;b>=s;b-=1){e.nameLabel.rotation(p),Ee(e.nameLabel,b/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Oe),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(g);let S=Ps/i;if(pt(g,e.nameLabel.width()+S,e.nameLabel.height()+S,p,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=h>0;return}}}e.nameLabel.text(n[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Ee(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Oe),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=K(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function Tl(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 hf(t,e,i){let n=vi(t.stageWidth),o=t.stageWidth<U,r=e.sub!=null&&!o,s=(o?us:fs)*n/i,a=(o?ps:ms)*n/i,l=Fn(yi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Ee(e.label,l/i,e.anchor.y),r&&(Ee(e.sub,ct(Si,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*cs),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*bs/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*ys-s*2:1/0,u=Math.min(c,d),h=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&h()>u&&(r=!1),h()>u)for(let x of En){let T=Math.max(Be,l*x);if(T>=e.label.fontSize()*i-.001||(Ee(e.label,T/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(Tl(e.label,e.name,Math.max(u,1)),uf(e.label.text())<pf(e.name)&&Tl(e.label,e.name,Math.max(c,1)),Ee(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){Il(e);return}e.label.visible(!0),e.back.visible(!0);let f=r?3*n/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let m=Math.max(e.label.width(),r?e.sub.width():0)+s*2,y=e.label.height()+(r?f+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(f+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+f)/2),e.back.position(e.anchor),e.back.size({width:m,height:y}),e.back.offset({x:m/2,y:y/2}),e.back.cornerRadius(gs*n/i),e.back.strokeWidth(1/i),e.aboveZone&&_i(e,0,-(y/2+4*n/i));let p=e.back.getAbsolutePosition(),g=6,b=m*i;if(b>t.stageWidth-g*2){Il(e);return}let S=b/2,k=(q(p.x,g+S,t.stageWidth-g-S)-p.x)/i;Math.abs(k)>.001&&_i(e,k,0);let v=Dl+y*i/2;p.y<v&&_i(e,0,(v-p.y)/i)}function uf(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function pf(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function Il(t){t.label.visible(!1),t.label.opacity(0),t.back.visible(!1),t.back.opacity(0),t.sub&&(t.sub.visible(!1),t.sub.opacity(0))}function _i(t,e,i){t.label.x(t.label.x()+e),t.label.y(t.label.y()+i),t.sub&&(t.sub.x(t.sub.x()+e),t.sub.y(t.sub.y()+i)),t.back.x(t.back.x()+e),t.back.y(t.back.y()+i)}var Dl=62;function ff(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 mf(t){return t.sections.map(e=>{let i=K(e.outline),n=t.worldToScreen({x:i.x,y:i.y}),o=t.worldToScreen({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(n.x,o.x),y:Math.min(n.y,o.y),w:Math.abs(o.x-n.x),h:Math.abs(o.y-n.y)}})}function gf(t,e,i,n){let o=[i];if(e.area){let a=t.worldToScreen({x:e.area.x,y:e.area.y}),l=t.worldToScreen({x:e.area.x+e.area.width,y:e.area.y+e.area.height}),c=(a.x+l.x)/2-i.w/2,d=(a.y+l.y)/2-i.h/2;o.push({...i,x:c,y:l.y+6},{...i,x:a.x-6-i.w,y:d},{...i,x:l.x+6,y:d})}for(let s of Ss)s!==0&&o.push({...i,y:i.y+s});let r=t.stageScaleX||1;for(let s of o)if(n(s))return s!==i&&_i(e,(s.x-i.x)/r,(s.y-i.y)/r),s;return null}function bf(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 bo(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=bf(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function mo(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 go(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 Nl(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 yf(t){if(!t.length)return 0;let e=Nl(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,mo(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return Nl(i)+e}function yo(t,e){if(!t.length)return[];let i=yf(t)*(e?.gapRows??2),n=e?.minRows??2,o=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((h,f)=>h.bounds.y-f.bounds.y||h.bounds.x-f.bounds.x||h.id.localeCompare(f.id)),d=[];for(let h of c){let f=d.find(m=>mo(m.bounds,h.bounds)<=i);f?(f.bounds=go(f.bounds,h.bounds),f.rowIds.push(h.id),f.seatCount+=h.seatCount):d.push({categoryKey:a,bounds:{...h.bounds},rowIds:[h.id],seatCount:h.seatCount})}let u=!0;for(;u&&d.length>1;){u=!1;e:for(let h=0;h<d.length;h+=1)for(let f=h+1;f<d.length;f+=1)if(!(mo(d[h].bounds,d[f].bounds)>i)){d[h].bounds=go(d[h].bounds,d[f].bounds),d[h].rowIds.push(...d[f].rowIds),d[h].seatCount+=d[f].seatCount,d.splice(f,1),u=!0;break e}}for(let h of d)h.rowIds.length<n&&h.seatCount<o||(h.rowIds.sort(),s.push(h))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function Hl(t){let e=null;for(let i of t)e=e?go(e,i.bounds):{...i.bounds};return e}function Gl(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 zl(t){return t*.3}function Vl(t){return zl(t)*2+t*.42}var Bi=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey="";this.pressOnChart=!0}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.pressOnChart=!0,this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=yo(bo(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=le(i),o=Al(i,i),r=Y(o,n.sectionInk),s=new Wl({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 Wl({listening:!1}),u=new wf({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:Ue,opacity:Cs,listening:!1,perfectDrawEnabled:!1}),h=new vf({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),f=new kf({...c,text:l,fontSize:lt,fontStyle:Te,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(f),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:f,label:l})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,n=this.host.exportMode||this.host.seatsPickable()&&e<ae||e>=this.host.readableScale();return this.revealed=n||$r(Rn(i,e),Rn(i,ae),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.revealed||this.capOnePerCategory(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.host.screenToWorld(e),n=this.clusterAt(i);if(!n)return!1;let o=this.host.seatR()*2,r={x:n.bounds.x-o,y:n.bounds.y-o,width:n.bounds.width+o*2,height:n.bounds.height+o*2},s=this.host.stage;if(mt(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*_t)return!1;let l=this.diveTarget(r,null,i);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i,n){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),a=mt(o,e,s,r),l=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),s.max);if(a>=l)return e;let c=r.width/(l*Me),d=r.height/(l*Me);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?Lf(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=As(i,this.host.pickableScale());if(n==null||n<=i*_t)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Me),a=r.height/(n*Me);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=Gl(this.all,e);if(i)return i;if(!this.visible)return null;for(let n of this.labels){if(!n.pill.visible())continue;let o=n.plate.width()/2,r=n.plate.height()/2;if(Math.abs(e.x-n.text.x())<=o&&Math.abs(e.y-n.text.y())<=r)return n.cluster}return null}size(e,i){let n=Math.max(e,1e-4),o=i<U,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=ct(lt,i),a=Ts/n,l=Is/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:f}=c;d.text(fo(c.label,o)),d.fontStyle(o?ws:Te);let m=s,y=0;for(;d.fontSize(Math.max(1,m/n)),d.letterSpacing(d.fontSize()*Oe),y=Vl(d.fontSize())+d.width()+a*2,!(y<=f.bounds.width||m<=Be);)m=Math.max(Be,m-1);let p={x:f.bounds.x+f.bounds.width/2,y:f.bounds.y+f.bounds.height/2},g=d.height()+l*2,b=y-a*2,S=p.x-b/2;h.radius(zl(d.fontSize())),h.position({x:S+h.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Vl(d.fontSize()),y:p.y}),u.size({width:y,height:g}),u.offset({x:y/2,y:g/2}),u.cornerRadius(g/2),u.strokeWidth(Ue/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=bo(e,this.host.seatR()),o=yo(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=Hl(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)}},xf=.18;function Lf(t,e){let i=(n,o,r)=>{let s=o*xf;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 Cf}from"konva/lib/shapes/Circle";import{Line as Tf}from"konva/lib/shapes/Line";function Kl(t,e,i){let n=t.seatRadius(),o=new Cf({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 Xl(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 Tf({x:r.x,y:r.y,points:o.flatMap(u=>[u.x-r.x,u.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=u=>{if(t.isDestroyed()||!s.getLayer())return;let h=Math.max(0,Math.min(1,(u-l)/c)),m=1+(1-Math.pow(1-h,3))*.04;s.scale({x:m,y:m}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Af}from"konva/lib/Group";import{Shape as Ff}from"konva/lib/Shape";import{Group as If}from"konva/lib/Group";import{Shape as Pf}from"konva/lib/Shape";function Rf(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 Mf(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 Ef(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 Ef(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 He(t,e,i,n){let o=wn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new Pf({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return Rf(l,h,r);l.moveTo(h[0].x,h[0].y);for(let f=1;f<h.length;f+=1)l.lineTo(h[f].x,h[f].y);l.closePath()}};n?(h=>{l.moveTo(h.start.x,h.start.y);let f=h.start;for(let m of h.segments)m.kind==="line"?l.lineTo(m.end.x,m.end.y):m.kind==="arc"?l.arc(m.center.x,m.center.y,m.radius,Math.atan2(f.y-m.center.y,f.x-m.center.x),Math.atan2(m.end.y-m.center.y,m.end.x-m.center.x),!m.clockwise):l.bezierCurveTo(m.control1.x,m.control1.y,m.control2.x,m.control2.y,m.end.x,m.end.y),f=m.end;l.closePath()})(n):d(t);for(let h of nr(e)){let f=wn(h)>0;d(f===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=Mf(t,n);return s.getSelfRect=()=>({...a}),s}var gt=class extends If{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 Yl(t,e){if(!e.length)return null;let i=new Af({listening:!1});for(let n of e)i.add(He(n.outline,n.holes,{fill:Ds,stroke:G("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function Ul(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 Ff({fill:t.canvasBackground,opacity:1-Ie,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 _f=.2;function $l(t,e){return t.startsWith("#")?j(e,t,_f):t}var Jl=.5,$=Math.SQRT1_2,Bf="#f3f4f6",ql=4;function Of(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Jl:Math.min(1,Math.max(0,e))}function Df(t){return t==="booked"||t==="not_for_sale"?_s:Fs}function Zl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Ql(t){let e=t.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,i,n,o]=e.toLowerCase();return`#${i}${i}${n}${n}${o}${o}`}function Nf(t,e,i){let n=Ql(t),o=Ql(e);if(!n||!o)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(Zl(n,a)*(1-r)+Zl(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function jl(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 Hf(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-ql;o<=ql;o++){let r=o*n*2,s=r+n,a=r*$,l=-r*$,c=s*$,d=-s*$;t.moveTo(a+i*$,l+i*$),t.lineTo(a-i*$,l-i*$),t.lineTo(c-i*$,d-i*$),t.lineTo(c+i*$,d+i*$),t.closePath()}t.clip()}function Oi(t,e){t._sceneFunc(e)}function ec(t){let e=this,i=e.attrs,n=i.markRadius||1,o=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(n*2*s<16){i.fill=i.markMidtone??o,Oi(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??Jl))*n;t.save(),jl(t,l,n,1),i.fill=i.markBase??o,Oi(e,t),t.restore(),t.save(),jl(t,l,n,-1),i.fill=i.markFill??o,Oi(e,t),i.markHatch&&(Hf(t,n),i.fill=Bf,Oi(e,t)),t.restore(),i.fill=o}function Gf(t,e,i,n,o,r){let s=Of(e),a=Df(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=Nf(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(ec)}function Wf(t){t.setAttr("sceneFunc",void 0)}function Ni(t){return t.attrs.sceneFunc===ec}var Di=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let n=new Set;for(let[o,r]of Object.entries(e))i.has(o)&&(r&&r.kind==="partial"?(this.marks.set(o,r),n.add(o)):this.marks.delete(o)&&n.add(o));return n}paint(e,i,n,o,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Ni(e)&&Wf(e);return}Gf(e,l,n,o,r,s)}};var tc="#9ca3af";var Vf="#f4b740",zf="#854d0e",Kf="#1a1200",Xf="#f1f4f9",Yf="#1a2234",Uf="#475569",$f="#c3cbdc";function qf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function ic(t,e=!1,i=!1){if(!qf(t))return null;if(e){if(t==="not_for_sale"){let n=i?$f:Uf;return{fill:i?Yf:Xf,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:tc,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:Vf,stroke:zf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:Kf}}return{fill:tc,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function nc(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 oc(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Hi=Object.freeze([]),Zf=.18;function rc(t,e,i){let n=t.seat(i),o=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(n.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Hi),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=o==="held"&&t.isOwnedHold(i),u=t.organizer?.()??!1,h=d?null:ic(o,u,u&&!H(l));if(h?(e.fill(h.fill),e.stroke(h.stroke),e.strokeWidth(h.strokeWidth),e.dash(h.dash),e.opacity(h.opacity),h.scale!==1&&e.scale({x:h.scale,y:h.scale})):d?(e.fill(se(s,c===ft?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===ft?se(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Ni(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(h?"":n.displayLabel??n.label);let L=t.boothExtent(n.rowId);a.fontSize(L?.nameSize??(L?be({...L,text:n.displayLabel??n.label}):Ve)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??je),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let f=o==="free"||o==="held"&&!t.isOwnedHold(i),m=()=>{let L=e.fill();typeof L=="string"&&e.fill($l(L,l))},y=t.accessFilter();if(y&&f&&!r){let L=Re(n,y);L==="other"?(m(),e.opacity(Math.min(e.opacity(),tl))):L==="companion"&&e.opacity(Math.min(e.opacity(),il))}let p=t.categoryHighlight();p&&o==="free"&&!r&&n.categoryKey!==p&&e.opacity(.25);let g=t.seatHighlight();g&&!r&&!g.has(i)&&e.opacity(Math.min(e.opacity(),Zf));let b=t.categoryFilter();b&&f&&!r&&!b.has(n.categoryKey)&&(m(),e.opacity(.22)),t.commercialLimitedFilter()&&o==="free"&&!r&&(n.commercial?.restrictedView||n.commercial?.obstructedView)&&e.opacity(.22);let S=t.dimmedSections();if(S.size){let L=t.seatSection(i);(L?S.has(L.id)||S.has(L.logicalId)||L.zone!=null&&S.has(L.zone):S.has(mr))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Bs),e.stroke(""),e.strokeWidth(0),e.dash(Hi),e.opacity(Os),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let w=t.boothLabel(i)??t.seatLabel(i);if(w){w.fill(t.seatLabelInk(n,e));let L=!a&&(r||d);w.visible(ye(w.fontSize(),t.effScale())&&e.opacity()>=.5&&!L)}let k=t.organizerGlyph,v=h?.glyph??null,x=Ni(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(k&&v&&!x){let L=a?t.boothExtent(n.rowId):void 0,C=L?Math.min(L.width,L.height)/2:t.seatRadius();k.apply(e,v,h.glyphInk??"",C),a||w?.visible(!1)}else k?.isPainted(e)&&k.clear(e);let T=t.accessGlyph(i);if(T){let L=e.fill();T.fill(li(typeof L=="string"?L:"")),T.opacity(e.opacity()),T.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function Gi(t,e){let i=null,n=1/0;for(let[o,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),u=Math.abs(e.x-a),h=Math.abs(e.y-l);if(u>c||h>d)continue;let f=u*u+h*h;f<n&&(n=f,i=o)}return i}var Qf=Math.log(1.15)/100,jf=.01,Jf=220,em=50;function lc(){return{kind:null,at:-1/0}}function sc(t,e,i){return e===1?t*33:e===2?t*i:t}function cc(t,e,i,n=800){let o=sc(t.deltaX,t.deltaMode,n),r=sc(t.deltaY,t.deltaMode,n),s=i-e.at<Jf&&e.kind!==null,a,l=t.deltaX===0&&Number.isInteger(t.deltaY)&&Math.abs(t.deltaY)>=em;return(t.ctrlKey||t.metaKey)&&!(t.deltaMode!==0||l)?a="pinch":t.ctrlKey||t.metaKey?a="notch":s&&e.kind!=="pinch"?a=e.kind:t.deltaMode!==0||l?a="notch":a="pan",e.kind=a,e.at=i,a==="pan"?{kind:"pan",dx:o,dy:r}:a==="pinch"?{kind:"zoom",factor:ac(Math.exp(-r*jf),.8,1.25),eased:!1}:{kind:"zoom",factor:ac(Math.exp(-r*Qf),.5,2),eased:!0}}function ac(t,e,i){return Math.min(i,Math.max(e,t))}var bt=new WeakMap;function Wt(t){let e=bt.get(t);e&&(e.raf&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.raf),bt.delete(t))}function Wi(t,e,i){let{min:n,max:o}=t.bounds(),r=t.stage.scaleX(),s=bt.get(t.stage),a=s?.raf?s.target:r,l=Math.min(o,Math.max(n,a*e));if(t.reducedMotion()||typeof requestAnimationFrame!="function"){Wt(t.stage),t.apply(l,i);return}if(s?.raf){s.target=l,s.point=i;return}if(Math.abs(Math.log(l/r))<.002)return;let c={target:l,point:i,raf:0,last:performance.now()};bt.set(t.stage,c);let d=u=>{let h=bt.get(t.stage);if(h!==c)return;let f=Math.max(0,u-h.last);h.last=u;let m=t.stage.scaleX(),y=Math.log(h.target/m),p=1-Math.exp(-f/55),g=Math.abs(y*(1-p))<.002,b=g?h.target:m*Math.exp(y*p);t.apply(b,h.point);let S=Math.abs(b-m)>1e-9&&t.stage.scaleX()===m;if(g||S){bt.delete(t.stage);return}h.raf=requestAnimationFrame(d)};c.raf=requestAnimationFrame(d)}function Vi(t){return t?.getAttr?.("seatId")??void 0}var zi=.85,tm=.38,im=Object.freeze([3,3]);function nm(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function dc(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function om(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(Vt(t)||(t.clusterLabels.setPressLandsOnChart(!dc(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}var rm=Object.freeze([2,2]);function sm(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,pe),l=a?t.seat(a):void 0;if(!a||!l){r();return}a!==o&&(o=a,t.hoverRing.position(l),t.hoverRing.opacity(zi),t.hoverRing.dash(rm),t.hoverRing.visible(!0),t.overlayLayer.batchDraw())};return{move(a){e=a,i||(i=requestAnimationFrame(s))},hide(){e=null,r()},onSeat(a){n=a,a&&(o=null)}}}var Vt=t=>t.seatsPickable()||t.manageSeatHits();function hc(t){t.attachHoverCard();let e=om(t),i=sm(t);t.seatLayer.on("click tap",o=>{if(t.moved()>ke||t.isGhostClick(o))return;let r=Vi(o.target);r&&Vt(t)&&t.handleSeatTap(r)}),t.seatLayer.on("mouseover",o=>{let r=Vi(o.target);if(!r)return;let s=t.seat(r);if(!s)return;i.onSeat(!0),t.setHoveredId(r);let a=am(t,r);t.hoverRing.position(s),t.hoverRing.opacity(a==="muted"?tm:zi),t.hoverRing.dash(a==="muted"?im:Hi),t.hoverRing.visible(a!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(a==="full"),t.onHover?.(s,{mark:t.seatMark(r),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{i.onSeat(!1),t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let o=t.stage.getPointerPosition();o&&(e(o),i.move(o))}),t.stage.on("mouseleave",()=>i.hide());let n=lc();t.stage.on("wheel",o=>{o.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let r=t.container.getBoundingClientRect(),s={x:o.evt.clientX-r.left,y:o.evt.clientY-r.top},a=cc(o.evt,n,performance.now(),t.stage.height());a.kind==="pan"&&t.panBy?t.panBy(a.dx,a.dy):a.kind==="zoom"&&a.eased&&t.zoomBounds?Wi({stage:t.stage,reducedMotion:t.reducedMotion,bounds:t.zoomBounds,apply:(l,c)=>t.zoomAbout(l,c,"frame")},a.factor,s):a.kind==="zoom"&&t.zoomAbout(t.stage.scaleX()*a.factor,s,"frame"),e(s)}),t.stage.on("click tap",o=>{if(t.moved()>ke||t.isGhostClick(o))return;let r=t.stage.getPointerPosition();if(!r)return;if(t.sectionCount()){let a=t.ownedBadgeAt(t.screenToWorld(r));if(a&&t.focusOwnedSeats(a))return}if(!(Vi(o.target)&&Vt(t))){let a=Gi(t.selectionMarkers(),r);if(a){t.focusSeats([a],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(r))return;if(t.rowLabelAt&&t.selectRow){let a=t.rowLabelAt(r);if(a){t.selectRow(a);return}}if(!t.cached()){if(Vi(o.target)&&Vt(t))return;if(Vt(t)){let a=t.focusedSectionId(),l=t.manageSeatHits(),c=t.nearestSeatToScreen(r,pe),d=c?t.seatSection(c):null;if(c&&(!a||l||d&&t.sectionMatchesFocus(d))){t.handleSeatTap(c);return}let u=c?null:t.nearestSeatToScreen(r,pe,!0),h=u?t.seatSection(u):null;if(u&&(!a||l||h&&t.sectionMatchesFocus(h))){t.handleSeatTap(u);return}if(a&&t.onBackdropTap&&!t.floorOverview()){let m=t.sectionAt(r);if(m&&t.sectionInteractive?.(m)===!1)return;if(m&&m!==a){let y=t.sectionTapAnchor(m,t.screenToWorld(r));t.onSectionTap?t.onSectionTap(m,y):t.focusSection(m,{anchor:y})}else m||t.onBackdropTap();return}if(a||l)return;let f=t.sectionCount()?nm(t,r):null;if(!f||t.effScale()>=ie||t.sectionFrameScale(f)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let a=t.floorOverview()?t.sectionAt(r):null,l=(a?t.objectFloor(a):null)??t.deckFloorAt();if(l){t.onDeckTap(l);return}}if(t.sectionCount()){let a=t.screenToWorld(r),l=t.ownedBadgeAt(a);if(l&&t.focusOwnedSeats(l)||!l&&dc(t,r))return;let c=l??t.sectionAt(r);if(c){let d=t.sectionTapAnchor(c,a);t.onSectionTap?t.onSectionTap(c,d):t.focusSection(c,{anchor:d});return}if(!t.pressLandsOnChart(r))return}if(!t.seatsPickable()){let a=t.tableAt?.(r);if(a?.length&&t.focusSeats(a,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(r)||t.clusterLabels.glideTowardTap(r))return;let s=Math.max(ve*1.2,t.stage.scaleX()*2.5);t.zoomAbout(s,r)})}function uc(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 am(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function pc(t,e){return!e.manageMode||!e.marqueeSelect?!1:t.pointerType!=="touch"&&t.button===0}var fc=450;function mc(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<ae}import{Path as Ig}from"konva/lib/shapes/Path";import{Group as lm}from"konva/lib/Group";import{Line as cm}from"konva/lib/shapes/Line";import{Text as dm}from"konva/lib/shapes/Text";function gc(t,e,i,n){if(!e||!n)return;let o=hr(e,i);if(!o.length)return;let r=new lm({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new cm({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 dm({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 hm=10;function um(t){let e=t.framingViewport();if(t.stage.width()>=U||t.exportMode())return e;let i=hm;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 bc(t){Wt(t.stage);let e=um(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=fm(t);s&&t.setFitScale(pm);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=Ia(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<ae?ae*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);l>0&&l!==1&&t.setFitScale(t.fitScale()*l),l>0&&(t.afterViewChange(),Jn(t.stage,[t.bgLayer,t.seatLayer],e,i)),mm(t,e),t.setFitPose(Ze(t.stage))}t.stage.batchDraw()}var pm=Q*(1-1e-6);function fm(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Q&&e<ve}function mm(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=Ot(t.stage,[t.bgLayer,t.seatLayer],n);if(!o)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&o.x+o.width<=e.x+e.width-r)return;let s=e.height-i;if(o.height<=s){Jn(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+Pi-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function zt(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,Ye*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function yc(t,e,i,n="now"){let o=t.stage.position();yl(t.stage,e,i,zt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.gestureFrame?.(),t.updateSeatGroupVisibility(),vc(t)):t.afterViewChange(),t.stage.batchDraw())}function Sc(t,e,i){let n=t.stage.position();t.stage.position(t.constrainPan({x:n.x-e,y:n.y-i},n)),t.gestureFrame?.(),t.updateSeatGroupVisibility(),vc(t),t.stage.batchDraw()}function vc(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function wc(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function gm(t,e,i,n,o=0){Sl(t.stage,e,zt(t),i,Kt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function kc(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){gm(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Kt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=zt(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=q(Math.max(d,u),a,Math.max(u,Gt({min:a,max:l},i?.maxScale))),f=o.x+r/2-(n.x+n.width/2)*h,m=o.y+s/2-(n.y+n.height/2)*h,y=t.stage.scaleX(),p=t.stage.x(),g=t.stage.y();if(Math.abs(h-y)<1e-4&&Math.abs(f-p)<.5&&Math.abs(m-g)<.5){t.settleView();return}let b=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let w=k=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(k-b)/S),x=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,T=y+(h-y)*x;t.stage.setAttrs({scaleX:T,scaleY:T,x:p+(f-p)*x,y:g+(m-g)*x}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(w)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(w))}function Kt(t,e){let i=Math.max(0,Math.min(e,t.width/3,t.height/3));return i===0?t:{x:t.x+i,y:t.y+i,width:t.width-i*2,height:t.height-i*2}}import{Text as bm}from"konva/lib/shapes/Text";function xc(t){let e=new WeakMap;return()=>{let i=t(),n=i.labelFont(),o=Qe(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===n&&r.generation===o)return r.value;let s=ym(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function ym(t){let e=1/0,i=new bm({fontSize:ge,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?be({...u,text:s.displayLabel??s.label}):Ve);continue}let a=ge*t.seatLabelScale(s),l=si(s.displayLabel??s.label),c=o.get(a);c||o.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>n?Math.max(at,a*n/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=at)break}i.destroy();let r=Number.isFinite(e)?e:Ve;return V/Math.max(at,r)}function Cc(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:Lc(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:Lc(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function Lc(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 Tc(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 Sm=.7;function Ic(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,f,m)=>{let y=h+f,p=m*Sm;if(y<=p||y<=0)return[h,f];let g=p/y;return[h*g,f*g]},[l,c]=a(s,o,t),[d,u]=a(n,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-u)}}function Pc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function Rc(t,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(t.scale({x:e.scale,y:e.scale}),t.position({x:e.x,y:e.y}),!0)}function Ki(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Mc(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 vo(t,e,i,n,o,r,s){if(!e)return{box:{x:i,y:n,width:0,height:0},fitWidth:0,fitHeight:0,x:i,y:n,baseFontSize:o,insideInk:r,fill:s};let a=((t??0)%180+180)%180,l=a*Math.PI/180,c=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=e.x+e.width/2,h=e.y+e.height/2,f=e.width*c+e.height*d,m=e.width*d+e.height*c,y={x:u-f/2,y:h-m/2,width:f,height:m},p=a===0?[e.width,e.height]:a===90?[e.height,e.width]:[Math.min(e.width,e.height),Math.min(e.width,e.height)];return{box:y,fitWidth:p[0],fitHeight:p[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var Ec=V,vm=3,wm=.5;function km(t){return Y(t,H(t)?"#475569":"#cbd5e1")}function Ac(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function xm(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=Ec){let u=t.measure(n.baseFontSize);return i.occupied.insert(Ac(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=Ec/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*wm)return{visible:!1,reason:"shape-too-small"};let a=vm/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=Ac(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 me,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&&st(o,a,{mode:"overlap"}).length>0,occupied:i},s=km(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=xm({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);Lm(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function Lm(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 _c(t){let e=t.map((n,o)=>({text:n,order:o})).filter(({text:n})=>n.node.visible()).sort((n,o)=>o.text.baseFontSize-n.text.baseFontSize||n.order-o.order),i=[];for(let{text:n}of e){let o=n.node.getClientRect({skipShadow:!0,skipStroke:!0}),r=n.node.fontSize()>n.baseFontSize;if(i.some(s=>(r||s.floored)&&to(o,s.box))){n.node.visible(!1),n.backdrop?.visible(!1);continue}i.push({box:o,floored:r})}}function Bc(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 wo(t,e,i,n){let o=Cm(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 Cm(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,ci/2/n),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!o||a<o.distance)&&(o={table:r,distance:a})}return o?.table??null}function Dc(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?ss:rs}function Nc(t){return Math.max(t*1.05,Qr,Q*1.3)}var Tm=42;function Hc(t){return Tm/(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 Gc(t){let{stageWidth:e,stageHeight:i,fullBounds:n,visibleBounds:o,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(n.width*a),i/(n.height*a))>=s)return null;let c=t.tapAnchor??{x:o.x+o.width/2,y:o.y+o.height/2},d=r[0],u=1/0;for(let y of r){let p=(y.x-c.x)**2+(y.y-c.y)**2;p<u&&(d=y,u=p)}let h=e/(s*a),f=i/(s*a),m=Je(r,0);return{bounds:{x:Oc(d.x,h,m.x,m.width),y:Oc(d.y,f,m.y,m.height),width:h,height:f},minScale:s}}function Oc(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 Pm}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},Im=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function Vc(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=Im(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 Xt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15;this.paints=new Map}get active(){return this.entries.length>0}paint(e,i){let n=`${e}|${i}`,o=this.paints.get(n);return o===void 0&&(this.paints.size>512&&this.paints.clear(),o=G(e,i),this.paints.set(n,o)),o}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,n,o,r,s,a,l,c=()=>1,d=()=>!1,u=()=>1/0){if(!l||!e||!n){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let m of[...e.objects,...(e.floors??[]).flatMap(y=>y.objects)])m.type==="row"&&this.spacing.set(m.id,m.seatSpacing)}if(this.focusKey!==n&&(this.focusKey=n,this.detailScale=Math.min(Math.max(1.15,c()*1.15),u()*.9)),o>=this.detailScale){this.clear();return}let h=i.filter(m=>m.id===n||m.logicalId===n||d(m)),f=h.map(m=>m.id).join("|");if(!(this.key===f&&this.active)){this.clear(),this.key=f;for(let m of h){if(m.memberIds.length>2e3||m.memberIds.some(g=>!a.has(g)||!this.spacing.has(s.get(g)?.rowId??"")))continue;let y=Vc(m.memberIds.map(g=>s.get(g)).filter(Boolean),this.spacing);if(!y.length||y.reduce((g,b)=>g+b.seats.length,0)!==m.memberIds.length)continue;let p=new Pm({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:g=>{let b=g._context,S=p.getStage(),w=S&&S.width()<=U?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;b.save(),b.lineWidth=w*2,b.lineCap="round",b.lineJoin="round";let k=v=>{let x=a.get(v.id);return this.paint(String(x.fill()),x.opacity())};for(let v of y){let x=v.points;if(x.length===1){b.fillStyle=k(v.seats[0]),b.beginPath(),b.arc(x[0].x,x[0].y,w,0,Math.PI*2),b.fill();continue}let T=v.seats.map(k),P=(R,M)=>{let E=Math.hypot(M.x-R.x,M.y-R.y);return{x:-(M.y-R.y)/E,y:(M.x-R.x)/E}},L=x.map((R,M)=>{let E=x[Math.max(0,M-1)],A=x[Math.min(x.length-1,M+1)];return Math.hypot(A.x-E.x,A.y-E.y)>.001?P(E,A):P(x[M],x[M+1]??x[M-1])}),C=(R,M,E)=>({x:R.x+M.x*w*E,y:R.y+M.y*w*E}),I=0;for(;I<x.length;){let R=I;for(;R+1<x.length&&T[R+1]===T[I];)R++;let M=I===0?x[0]:{x:(x[I-1].x+x[I].x)/2,y:(x[I-1].y+x[I].y)/2},E=R===x.length-1?x[R]:{x:(x[R].x+x[R+1].x)/2,y:(x[R].y+x[R+1].y)/2},A=I===0?L[0]:P(x[I-1],x[I]),_=R===x.length-1?L[R]:P(x[R],x[R+1]),F=[M,...x.slice(I,R+1),E],N=[A,...L.slice(I,R+1),_],oe=F.map((O,z)=>C(O,N[z],1)),W=F.map((O,z)=>C(O,N[z],-1));b.fillStyle=T[I],b.beginPath(),b.moveTo(oe[0].x,oe[0].y);for(let O of oe.slice(1))b.lineTo(O.x,O.y);if(R===x.length-1){let O=Math.atan2(_.y,_.x);b.arc(E.x,E.y,w,O,O-Math.PI,!0)}else b.lineTo(W[W.length-1].x,W[W.length-1].y);for(let O of W.slice(0,-1).reverse())b.lineTo(O.x,O.y);if(I===0){let O=Math.atan2(-A.y,-A.x);b.arc(M.x,M.y,w,O,O-Math.PI,!0)}b.closePath(),b.fill(),I=R+1}}b.restore()}});this.entries.push({section:m,shape:p,opacity:m.liftGroupSeat.opacity(),listening:m.liftGroupSeat.listening()}),m.liftGroupBg.add(p),m.liftGroupSeat.opacity(0),m.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as Rm}from"konva/lib/shapes/Text";var zc=new WeakMap,Mm=(t,e)=>{let i=new Rm({text:t,fontSize:Et,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function Kc(t,e,i,n=Mm){let o=zc.get(t);o||zc.set(t,o=new Map);let r=`${e}\0${Qe()}`,s=o.get(r);s||o.set(r,s=new Map);let a=s.get(i);if(a!==void 0)return a;let l=0;for(let d of t){if(!d.focusKeys?.includes(i))continue;let u=n(d.text,e);l=Math.max(l,u.width,u.height)}let c=l>0?Math.ceil(l+V+ee*2+6):0;return s.set(i,c),c}function Xc(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 ko=1e6;function Em(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function xo(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Xi=class{constructor(e,i=Em()){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(!xo(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(ko+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(xo(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(ko+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!xo(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(ko+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<jr}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))},fc)));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=q(this.pinch.startScale*(o/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=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 Am}from"konva/lib/shapes/Circle";import{Group as Fm}from"konva/lib/Group";import{Line as _m}from"konva/lib/shapes/Line";import{Text as Bm}from"konva/lib/shapes/Text";var Om=11,Dm=.3,Nm=.08;function qc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function Hm(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?B("map.soldOut"):t.wheelchairFree!=null?t.wheelchairFree<=0?B("map.noWheelchairSpace"):B("map.seatsLeft",{count:t.wheelchairFree}):B("map.seatsLeft",{count:t.available})}function Zc(t,e){return e&&t.available!=null&&t.available<=0}function Gm(t,e){return Zc(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function Qc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=Gm(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?Ke*Nm:o?Ke*Dm:Ke),e.polygon.listening(!t.exportMode&&!n&&!i&&!Zc(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),Wm(t,e,o,r,n,t.dimmed(e.categoryKey))}}function Wm(t,e,i,n,o,r){if(e.capacityNode){let s=Hm(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}Vm(t,e,o||r),n>0&&!o?Um(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var Lo=9,Yc=.86;function Vm(t,e,i){zm(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/Se;e.scale({x:o,y:o}),e.offset({x:Se/2,y:Se/2}),e.position({x:i.x()-i.width()/2-n*.7,y:i.y()-i.offsetY()+i.height()/2}),e.visible(!0)}function zm(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=Km(e,r),a=Uc(n,e.nameSize??oi,s.width*Yc,r),l=Uc(o,ri,s.width*Yc,r),c=a!=null,d=l!=null&&(n?c&&a+l+Lo<=s.height:l<=s.height);$c(n,c?a:null,e.labelPoint.y-Lo/r,r),$c(o,d?l:null,n?e.labelPoint.y+Lo/r:e.labelPoint.y,r)}function Km(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 Uc(t,e,i,n){if(!t||!t.text())return null;t.fontSize(e/n);let o=t.width()*n;if(o<=i||o<=0)return e;let r=e*(i/o);return r>=V?r:null}function $c(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 Xm=.72;function Ym(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*Xm;return{x:n+r,y:o-r}}function Um(t,e,i,n){let o=Om;if(!e.chip){let a=new Fm({listening:!1});a.add(new Am({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new _m({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 Bm({x:o*.12,y:-o*.5,text:String(i),fontSize:o,fontStyle:"800",fontFamily:t.labelFont(),listening:!1,perfectDrawEnabled:!1});a.add(l),t.bgLayer.add(a),e.chip=a,e.chipText=l}let r=Dt(t.selectionColor),s=e.chip.findOne(".ga-chip-disc");s?.fill(t.selectionColor),s?.stroke(G(r,.35)),e.chip.findOne(".ga-chip-tick")?.stroke(r),e.chipText&&(e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText.fill(r)),e.chip.position(Ym(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function jc(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 Jc(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 $m(t){let{sections:e,viewCentre:i,focusedSectionId:n}=t;if(n){let s=e.findIndex(a=>a.id===n||a.logicalId===n);if(s>=0)return s}let o=-1,r=1/0;return e.forEach((s,a)=>{if(s.outline.length<3)return;let l=K(s.outline),c=i.x>=l.x&&i.x<=l.x+l.width&&i.y>=l.y&&i.y<=l.y+l.height,d=l.x+l.width/2-i.x,u=l.y+l.height/2-i.y,h=(c?0:1e12)+d*d+u*u;h<r&&(o=a,r=h)}),o}function qm(t){let{rung:e,viewCentre:i,target:n,width:o,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(f=>{let m=K(f.outline);return{x:m.x+m.width/2,y:m.y+m.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(f=>Math.abs(f.x-i.x)<=d&&Math.abs(f.y-i.y)<=u)){let f=c.reduce((m,y)=>{let p=(y.x-i.x)**2+(y.y-i.y)**2;return p<m.distance?{point:y,distance:p}:m},{point:c[0],distance:1/0});s=f.point.x,a=f.point.y}}let l=e==="seats"?t.seats.filter(c=>c.kind!=="booth"):[];if(l.length>0){let c=l[0],d=1/0;for(let u of l){let h=u.x-i.x,f=u.y-i.y,m=h*h+f*f;m<d&&(c=u,d=m)}s=c.x,a=c.y}return{x:s,y:a}}function ed(t){if(t.rung==="sections")return{bounds:t.bounds};let e=$m(t);if(e>=0)return{bounds:K(t.sections[e].outline),minScale:t.seatFloor};let i=t.seatScale,{x:n,y:o}=qm({...t,rung:"seats",target:i}),r=t.width/(i*1.12),s=t.height/(i*1.12);return{bounds:{x:n-r/2,y:o-s/2,width:r,height:s}}}var td=["pointerdown","pointermove","mousedown","mousemove","touchstart","click"],Yi=class{constructor(e=()=>{}){this.onEnd=e;this.until=0;this.timer=null;this.holding=!1;this.stale=new Set;this.flushNow=()=>this.flush();this.container=null}get active(){return this.holding}listen(e){this.container=e;for(let i of td)e.addEventListener(i,this.flushNow,{capture:!0,passive:!0})}wrap(e){let i=e.drawHit;e.drawHit=((n,o)=>this.active&&!n?(this.stale.add(e),e):i.call(e,n,o))}bump(){typeof setTimeout=="function"&&(this.holding=!0,this.until=performance.now()+120,this.timer||this.arm(120))}arm(e){this.timer=setTimeout(()=>{this.timer=null;let i=this.until-performance.now();if(i>1){this.arm(i);return}this.flush()},e)}flush(){let e=this.holding;if(this.holding=!1,this.timer&&(clearTimeout(this.timer),this.timer=null),this.stale.size){let i=[...this.stale];this.stale.clear();for(let n of i)n.getStage()&&n.drawHit()}e&&this.onEnd()}destroy(){if(this.timer&&clearTimeout(this.timer),this.timer=null,this.holding=!1,this.stale.clear(),this.container)for(let e of td)this.container.removeEventListener(e,this.flushNow,{capture:!0});this.container=null}};var Ui=class{constructor(){this.since=new Map;this.shown=new Set;this.wanted=new Set}begin(){this.wanted=new Set}admit(e,i,n){this.wanted.add(e);let o=this.since.get(e);return o===void 0&&(o=i,this.since.set(e,i)),!n||this.shown.has(e)||i-o>=150?(this.shown.add(e),!0):!1}end(){for(let e of[...this.since.keys()])this.wanted.has(e)||(this.since.delete(e),this.shown.delete(e))}reset(){this.since.clear(),this.shown.clear(),this.wanted.clear()}};function id(t,e,i,n){if(t.length<3)return[];let o=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<o&&(o=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-o)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e)d.x<o||d.x>r||d.y<s||d.y>a||Jt(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function Zm(t){return t.logicalRowId??t.rowId}function nd(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(Zm(o)!==t||!i(o.id)||n.push(o.id));return n}function od(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 Qm}from"konva/lib/shapes/Line";import{Rect as jm}from"konva/lib/shapes/Rect";var $i=class{constructor(e){this.host=e;this.box=null;this.lasso=null;this.remove=!1}active(){return this.box!==null||this.lasso!==null}begin(e,i,n=!1){this.cancel(),this.remove=n;let o=this.host.screenToWorld(e),r=this.host.stageScale()||1,s={stroke:n?"#d64545":this.host.selectionColor(),strokeWidth:1.5/r,dash:[5/r,4/r],fill:n?"rgba(214,69,69,0.10)":"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let a=new Qm({...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 jm({...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(id(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)}),h=>Jt(h,l));return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let n=Math.min(i.start.x,i.cur.x),o=Math.max(i.start.x,i.cur.x),r=Math.min(i.start.y,i.cur.y),s=Math.max(i.start.y,i.cur.y);if((o-n)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats())l.x<n||l.x>o||l.y<r||l.y>s||this.host.isSelectable(l.id)&&a.push(l.id);this.apply(a,l=>l.x>=n&&l.x<=o&&l.y>=r&&l.y<=s)}apply(e,i){this.host.applyBand(e,i,this.remove),this.host.selectionChanged()}};var qi=class{constructor(e){this.sync=e;this.depth=0;this.pending=!1}request(){if(this.depth>0){this.pending=!0;return}this.sync()}batch(e){this.depth+=1;try{return e()}finally{this.depth-=1,this.depth===0&&this.pending&&(this.pending=!1,this.sync())}}};import{Rect as rd}from"konva/lib/shapes/Rect";import{Text as Jm}from"konva/lib/shapes/Text";function sd(t){let e=t.effScale(),i=t.stage.scaleX(),n={width:t.stage.width(),height:t.stage.height()},o=p=>Math.round(p*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(p=>[String(p.getAttr("seatId")??""),String(p.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(p=>{let g=t.circleById.get(p.id),b=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=p.kind==="booth"?Ve:ge*t.seatLabelScale(p),w=o((b?.fontSize()??S)*e),k=t.worldToScreen(p),v=b?b.width()*i:0,x=b?b.height()*e:0,T=k.x-v/2<0||k.x+v/2>n.width||k.y-x/2<0||k.y+x/2>n.height,P=t.focusedSeatOpacity(p.id,g?.getAbsoluteOpacity()??0),L=t.seatSection.get(p.id),C=!!b?.isVisible()&&P>=.5&&!T,I;C||(P<.5?I="dimmed-or-unavailable":w<V?I="below-minimum-size":T?I="outside-viewport":b?I="renderer-hidden":I=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=g instanceof rd?g.width()*i:t.seatR*2*e,M=g instanceof rd?g.height()*e:t.seatR*2*e,E=2*(t.seatR*e+pe),A=g?.fill(),_=b?.fill(),F=t.accessGlyphById.get(p.id),N=F?.getAbsoluteScale();return{seatId:p.id,label:p.label,kind:p.kind==="booth"?"booth":"seat",markerShape:p.kind==="booth"?"booth":p.wheelchairSpaceType==="no-seat"?"square":"circle",...p.wheelchairSpaceType?{wheelchairSpaceType:p.wheelchairSpaceType}:{},categoryKey:p.categoryKey,...L?{sectionId:L.id}:{},...L?.zone?{zoneId:L.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:C,renderedFontPx:w,fill:typeof A=="string"?A:"",ink:typeof _=="string"?_:g?t.seatLabelInk(p,g):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:o(P),...F?{accessibilityMarker:{glyphVisible:F.isVisible(),glyphWidthPx:o(Se*Math.abs(N?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!g?.isVisible()&&!!g?.isListening()&&t.isSelectable(p.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),E))},screenCenter:{x:o(k.x),y:o(k.y)},...C?{screenBox:{x:o(k.x-v/2),y:o(k.y-x/2),width:o(v),height:o(x)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(p=>p.visible).length,l=(p,g,b,S,w,k,v)=>{let x=ut({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),T=K(x.map(M=>t.worldToScreen(M))),P=o(S.opacity()),L=S.fill(),C=T.x+T.width<0||T.x>n.width||T.y+T.height<0||T.y>n.height,I=S.isVisible()&&P>.05&&!C,R=k?pt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),k.outline,k.holes):void 0;return{id:p,kind:g,role:b,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:P,fill:w,ink:typeof L=="string"?L:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(T.x),y:o(T.y),width:o(T.width),height:o(T.height)}}:{}}},c=p=>{let g=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof g=="string"&&g)return g;let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},d=p=>{let g=p.blockPoly.fill();return typeof g=="string"?g:p.baseFill},u=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,Ft(n.width))),...t.sections.map(p=>l(`${p.id}:availability`,"section","availability",p.subLabel,c(p),p)),...t.sections.map(p=>l(`${p.id}:number`,"section","number",p.numberLabel,d(p),p,bi(n.width))),...t.zones.flatMap(p=>[l(p.id,"zone","name",p.label,p.background),...p.sub?[l(`${p.id}:price`,"zone","price",p.sub,p.background)]:[]])],h=[...t.gaById].map(([p,g])=>{let b=g.points.map(C=>t.worldToScreen(C)),S=Math.min(...b.map(C=>C.x)),w=Math.min(...b.map(C=>C.y)),k=Math.max(...b.map(C=>C.x)),v=Math.max(...b.map(C=>C.y)),x=k<0||S>n.width||v<0||w>n.height,T=o(g.polygon.opacity()),P=T>=.1&&!x,L=g.polygon.fill();return{areaId:p,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:P,interactive:g.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:g.effectiveBackground,...P?{screenBox:{x:o(S),y:o(w),width:o(k-S),height:o(v-w)}}:{}}}),f=[...t.freeTextById].map(([p,g])=>{let{node:b,kind:S}=g,w=g.plate&&g.plate.opacity()>.05?g.plate.fill():null,k=typeof w=="string"&&w?w:g.background,v=t.worldToScreen({x:b.x(),y:b.y()}),x=b.width()*i,T=b.height()*e,P=v.x-b.offsetX()*i,L=v.y-b.offsetY()*e,C=o(b.fontSize()*e),I=P+x<0||P>n.width||L+T<0||L>n.height,R=b.isVisible()&&!I,M=b.fill(),E=o(b.getAbsoluteOpacity()),A;return R||(C<V?A="below-minimum-size":I?A="outside-viewport":A="renderer-hidden"),{objectId:g.objectId??p,kind:S,text:b.text(),visible:R,renderedFontPx:C,ink:typeof M=="string"?M:"",background:k,opacity:E,...R?{screenBox:{x:o(P),y:o(L),width:o(x),height:o(T)}}:{},...A?{hiddenReason:A}:{}}}),m=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof Jm).map(p=>{let g=p.getClientRect({skipShadow:!0,skipStroke:!0}),b=g.x+g.width<0||g.x>n.width||g.y+g.height<0||g.y>n.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!b,renderedFontPx:o(p.fontSize()*e),ink:typeof S=="string"?S:"",...b?{}:{screenBox:{x:o(g.x),y:o(g.y),width:o(g.width),height:o(g.height)}}}}),y=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:V,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((p,g)=>p+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(p=>String(p.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:t.effSelection,focusedSectionId:t.focusedSectionId,focusBackdropVisible:!!t.focusBackdrop?.isVisible(),categoryFilterKeys:t.categoryFilter?[...t.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(p=>{let g=p.blockPoly.fill();return typeof g!="string"||!Bn(t.canvasBackground,g)}).length,tintedSectionShells:y.filter(p=>{let g=p.blockPoly.fill();return typeof g=="string"&&Vs(t.canvasBackground,g)}).length,visibleCategoryDetailOutlines:t.sections.filter(p=>p.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(p=>p.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(p=>p.sectionId!=null&&p.polygon.opacity()>.05).length},labels:s,gaAreas:h,hierarchyLabels:u,freeTextLabels:f,rowLabels:m}}import{Circle as cg}from"konva/lib/shapes/Circle";import{Ellipse as dg}from"konva/lib/shapes/Ellipse";import{Line as hg}from"konva/lib/shapes/Line";import{Arrow as ug}from"konva/lib/shapes/Arrow";import{Path as pg}from"konva/lib/shapes/Path";import{Rect as Yt}from"konva/lib/shapes/Rect";import{Text as Po}from"konva/lib/shapes/Text";import{Image as ud}from"konva/lib/shapes/Image";import{Group as ad}from"konva/lib/Group";import{Circle as eg}from"konva/lib/shapes/Circle";import{Path as tg}from"konva/lib/shapes/Path";function ig(t,e){let i=e?.trim();return i&&i.toLowerCase()!==Br?i:Mt[t.group]}var ld=new WeakMap;function Zi(t){let{icon:e,size:i}=t,n=ig(e,t.color),o=H(n)&&n!==Mt[e.group]?Lr:pi,r=H(t.background)?0:i*kn.ringRatio,s=t.listening??!1,a=new ad({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new eg({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:Cr,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*kn.glyphScale,c=new tg({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/xn,scaleY:l/xn,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),ld.set(a,{glyph:c,icon:e}),a}function To(t,e,i){let n=t instanceof ad?ld.get(t):void 0;if(n?.icon.solidLarge){let o=Fr(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function cd(t,e,i){let n=fi("wheelchair"),o=Hr(t);if(!n||!o)return null;let r=Nr(e),s=Zi({icon:n,x:o.x-r/2,y:o.y-r/2,size:r,background:i,listening:!1});return s.name("step-free-route-mark"),s}import{Group as ng}from"konva/lib/Group";import{Path as og}from"konva/lib/shapes/Path";import{Rect as rg}from"konva/lib/shapes/Rect";import{Text as sg}from"konva/lib/shapes/Text";function ag(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function lg(t,e,i={}){let n=t.height??40,o=t.width??n*3,r=(t.x??0)+o/2,s=(t.y??0)+n/2,a=n*.46,l=pi,c=new sg({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?_r("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,f=u+h+c.width(),m=Math.max(o,f+n),y=new ng({name:"gate-sign",x:r,y:s,rotation:ag(t.rotation??0),listening:i.hitTarget===!0});y.add(new rg({name:"gate-sign-pill",x:-m/2,y:-n/2,width:m,height:n,cornerRadius:n/2,fill:t.fill??Mt.navigation,stroke:l,strokeWidth:Math.max(1,n*.05),opacity:i.organizerOnly?.55:1,dash:i.organizerOnly?[n*.2,n*.12]:void 0,listening:i.hitTarget===!0,perfectDrawEnabled:!1}));let p=-f/2;return d&&(y.add(new og({name:"gate-sign-step-free",data:d,x:p,y:-u/2,scaleX:u/24,scaleY:u/24,fill:l,listening:!1,perfectDrawEnabled:!1})),p+=u+h),c.position({x:p,y:-c.height()/2}),y.add(c),y.setAttr("gateSignHeight",n),{group:y,fontSize:a,bounds:{x:r-m/2,y:s-n/2,width:m,height:n}}}function dd(t,e){if(e.gate.hideFromBuyers)return;let i=lg(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 pd(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 ud({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 fd(t,e){let i=new window.Image,n=new ud({image:i,x:e.x+e.width/2,y:e.y+e.height/2,offsetX:e.width/2,offsetY:e.height/2,width:e.width,height:e.height,rotation:e.rotation??0,opacity:q(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(n):t.bgLayer.add(n),e.role&&t.landmarkBoxes.push(K(ut({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 md(t,e){let i=e.fill??t.theme.decorFill??oo,n=se(i,.12);if(e.shape==="round")t.bgLayer.add(new cg({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:n,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Yt({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:n,strokeWidth:1.5,cornerRadius:4,listening:!1}))}if(!It(e))return;let o=Ut(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,Y(i,t.theme.textColor??"#cbd5e1"),ze(e)??kr,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var fg=8,mg=6;function gg(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(fg,e*.35),o=Math.max(mg,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function gd(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??Y(i,t.theme.textColor??ol),o=e.semanticKind==="icon"?fi(e.iconKey):void 0;if(o){let d=Zi({icon:o,x:e.position.x,y:e.position.y,size:e.fontSize,rotation:e.rotation,color:e.color,background:t.canvasBackground});t.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),t.bgLayer.add(d);return}let r=e.background?.padding??0,s=e.opacity??1,a=ar(e),l=new Po({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:ro(e.bold,e.italic,"600"),fill:n,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;e.background&&(c=new Yt({x:e.position.x,y:e.position.y,...gg(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 bd(t,e){if(Vr(e)){dd(t,e);return}let i=e.fill??t.theme.decorFill??oo,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=sr(e),a=le(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?se(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?q(e.opacity,.1,1):1,f=0,m=0,y=null;if(c&&e.points&&e.points.length>=2){f=e.points.reduce((k,v)=>k+v.x,0)/e.points.length,m=e.points.reduce((k,v)=>k+v.y,0)/e.points.length;let p=Gr(e),g=Wr(u),b=Or(e),S=new ug({points:e.points.flatMap(k=>[k.x,k.y]),closed:!1,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:u,opacity:h,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path",...b?{dash:Dr(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let w=b?cd(e,u,t.canvasBackground):null;w&&t.bgLayer.add(w)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=n?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,_e(l,.3),1,se(l,.12)]}:{fill:l};f=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Yt({x:f,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:u,cornerRadius:q(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){f=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height};let p=n?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,_e(l,.3),1,se(l,.12)]}:{fill:l};t.bgLayer.add(new dg({x:f,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:u,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=jo(e),g=K(p);f=e.points.reduce((w,k)=>w+k.x,0)/e.points.length,m=e.points.reduce((w,k)=>w+k.y,0)/e.points.length,y=g;let b=n?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,_e(l,.3),1,se(l,.12)]}:{fill:l},S=He(p,Jo(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},Qo(e)??void 0);S.setAttrs({x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,...b}),t.bgLayer.add(S)}y&&e.role&&t.landmarkBoxes.push(y);for(let p of ir(e))t.bgLayer.add(new hg({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:p.ink??tr,fill:p.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(n){let{node:p,spec:g}=yg(t,f,m,e.label,l,y,e.labelStyle);t.primaryFocalLabels.set(p,g),t.freeTextById.set(e.id,{node:p,background:l,plate:g.plate,kind:"stage"})}else if(r){let p=o||s,g=Y(l,p?"#e6e9f0":"#9aa3b5"),b=Ut(t,t.bgLayer,e.label,f,m,g,p?18:12,!1);p&&t.primaryFocalLabels.set(b,{targetPx:18,trackingRatio:0,ink:String(b.fill()??""),plateInk:String(b.fill()??""),plate:new Yt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:b,background:l,kind:"decor",...p?{}:{area:vo(e.rotation,y,f,m,12,g,l)}})}else{let p=Y(l,"#cbd5e1"),g=Ut(t,t.bgLayer,e.label,f,m,p,16,!0);t.freeTextById.set(e.id,{node:g,background:l,kind:"decor",area:vo(e.rotation,y,f,m,16,p,l)})}}var Io=22,hd=V,Qi=6,bg=.5;function yg(t,e,i,n,o,r,s){let a=s?.size??Io,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??Y(o,l),d=r?r.x+r.width/2:e,u=r?r.y+r.height/2:i,h=Sg(t.canvasBackground,o),f=new Yt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(f);let m=new Po({x:d,y:u,text:n,fontSize:a,fontStyle:ro(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/Io),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return m.offsetX(m.width()/2),m.offsetY(m.height()/2),t.bgLayer.add(m),{node:m,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/Io,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??Y(h,l),plate:f}}}function Sg(t,e){return j(e,H(t)?"#ffffff":"#000000",.34)}function yd(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(hd,e.targetPx*bg)*s)/r,c=g=>{t.letterSpacing(g*e.trackingRatio),n(t,g)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=Uo(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-Qi*2,height:(u?d.width:d.height)-Qi*2},f=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(f<1&&(l=Math.max(hd/r,l*f),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let y=(u?t.height():t.width())+Qi*2,p=(u?t.width():t.height())+Qi;e.plate.size({width:y,height:p}),e.plate.offset({x:y/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function Sd(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=Tr(i,n,Ke),r=t.theme.textColor??"#e6e9f0",s=Y(o,r),a=He(e.points,e.holes,{fill:i,opacity:Ke,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",y=>{t.isGhostClick(y)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=ei(e.points,e.holes),c=t.sections.find(y=>te(l,y.outline,y.holes)),d=ze(e)??oi,u=It(e)?Ut(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Ut(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,ri,!1);u&&t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:u,background:o,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:o,kind:"ga-capacity",categoryKey:e.categoryKey});let f=Lt(e)>0?new pg({data:ot(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;f&&t.bgLayer.add(f);let m={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:i,labelPoint:l,labelNode:u,...ze(e)!==void 0?{nameSize:d}:{},capacityNode:h,...f?{wheelchairGlyph:f}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,m),Co(m)}function Ut(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 wd(t,e){let i=[],n=e.canvasBackground,o=new Map,r=(h,f)=>{let m=o.get(h)??[];m.push(f),o.set(h,m)};for(let h of e.seats){if(h.kind==="booth")continue;let f=h.logicalRowId??h.rowId;r(f,h),f!==h.rowId&&r(h.rowId,h)}let s=(e.sections??[]).filter(h=>h.outline?.length>=3).map(h=>{let f=h.outline.map(y=>y.x),m=h.outline.map(y=>y.y);return{section:h,minX:Math.min(...f),minY:Math.min(...m),maxX:Math.max(...f),maxY:Math.max(...m)}}),a=(h,f,m,y)=>{let p=e.seatR+12+y*6;return s.filter(g=>g.section!==h&&f+p>=g.minX&&f-p<=g.maxX&&m+p>=g.minY&&m-p<=g.maxY).map(g=>g.section.outline)},l=h=>h.logicalSeatIndex??Number(h.id.split(":").pop()??0);for(let h of t.objects){if(h.type!=="row")continue;let f=h.segmentedRow?.repeatLabelOnComponents===!0;if(h.segmentedRow&&!f&&h.segmentedRow.componentIndex!==0)continue;let m=f?h.labelPresentation:h.segmentedRow?.labelPresentation??h.labelPresentation;if(m?.visible===!1||m?.positionPreset==="none")continue;let y=h.segmentedRow&&!f?h.segmentedRow.groupId:h.id,p=(o.get(y)??[]).slice().sort((_,F)=>l(_)-l(F));if(!p.length)continue;let g=p[0],b=p[p.length-1],S=m?.labelStyle,w=m?.style==="pill"?Nt(n):null,k=w?w.plate:n,v=he(k,S?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Xe),x=S?.size??wr,T=m?.rotation??0,P=e.objectFilteredOut(h)?.15:1,L=p.reduce((_,F)=>_??e.seatSection.get(F.id),void 0),I=h.segmentedRow?.displayLabel??h.displayLabel??Rt(h.label,L?.label);if(!I)continue;let R=L?[...new Set([L.id,L.logicalId,L.zone].filter(_=>!!_))]:void 0,M=(_,F,N)=>i.push({text:I,x:_,y:F,rotation:T,fontSize:x,ink:v,opacity:P,rowKey:y,...w?{pill:w}:{},...R?.length?{focusKeys:R}:{},...N?{automaticAway:N}:{},...N&&L?.outline?.length?{outline:L.outline}:{},...N&&L?.outline?.length&&s.length?{neighbourOutlines:a(L,_,F,x)}:{}});if(m?.position){M(m.position.x,m.position.y);continue}let E=e.seatR+12,A=m?.positionPreset??"start";if(A==="start"||A==="both"){let _=h.rotation*Math.PI/180,F={x:-Math.cos(_),y:-Math.sin(_)};M(g.x+F.x*E,g.y+F.y*E,F)}if(A==="end"||A==="both"){let _=(h.rotation+h.curve)*Math.PI/180,F={x:Math.cos(_),y:Math.sin(_)};M(b.x+F.x*E,b.y+F.y*E,F)}}let c=(e.seatR+12)*2.2,d=[],u=new Map;for(let h of i){let f=u.get(h.text),m=f?.find(y=>Math.hypot(y.x-h.x,y.y-h.y)<=c);if(m){m.x=(m.x+h.x)/2,m.y=(m.y+h.y)/2;continue}d.push(h),f?f.push(h):u.set(h.text,[h])}return d}function $t(t,e,i=ee){let n=t.rotation()*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=(t.width()*o+t.height()*r)/2+i,a=(t.width()*r+t.height()*o)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function kd(t,e,i,n){let o=e.automaticAway;if(!o)return{x:e.x,y:e.y};let r={x:e.x,y:e.y},s={x:-o.y,y:o.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=e.outline,c=m=>l?vd(l,m):0;if(l){let m={...r},y=!1;for(let g=1;g<=12&&c($t(t,r))>0;g++)r.x+=o.x*a/4,r.y+=o.y*a/4,y=!0;let p=$t(t,r);y&&e.neighbourOutlines?.some(g=>vd(g,p)>0||vg(r,g))&&(r.x=m.x,r.y=m.y,l=void 0)}let d=[{x:0,y:0}];for(let m=1;m<=4;m++){let y=a*m;d.push({x:s.x*y,y:s.y*y},{x:-s.x*y,y:-s.y*y},{x:o.x*y,y:o.y*y},{x:(o.x+s.x)*y,y:(o.y+s.y)*y},{x:(o.x-s.x)*y,y:(o.y-s.y)*y})}let u=r,h=1/0,f=1/0;for(let m of d){let y={x:r.x+m.x,y:r.y+m.y},p=$t(t,y),b=(n?st(n,p,{mode:"overlap"}).length:0)+i.collisionCount(p)+c(p),S=Math.hypot(m.x,m.y);if((b<h||b===h&&S<f)&&(u=y,h=b,f=S),b===0)break}return u}function vd(t,e){let i=0;for(let n=0;n<t.length;n++)wg(t[n],t[(n+1)%t.length],e)&&i++;return i}function vg(t,e){let i=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){let r=e[n],s=e[o];r.y>t.y!=s.y>t.y&&t.x<(s.x-r.x)*(t.y-r.y)/(s.y-r.y)+r.x&&(i=!i)}return i}function wg(t,e,i){let n=e.x-t.x,o=e.y-t.y,r=0,s=1,a=[[-n,t.x-i.x],[n,i.x+i.width-t.x],[-o,t.y-i.y],[o,i.y+i.height-t.y]];for(let[l,c]of a){if(l===0){if(c<0)return!1;continue}let d=c/l;if(l<0?r=Math.max(r,d):s=Math.min(s,d),r>s)return!1}return!0}var ji=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,n,o,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(u),l())},u=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(u),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&o(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&o()}).catch(()=>{s===this.generationCount&&this.errors.push(`${n} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${n} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function xd(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 Ld(t){let e=t.drawScene;t.drawScene=((i,n,...o)=>!i&&t.opacity()===0?(t.getCanvas().getContext().clear(),t):e.call(t,i,n,...o))}function Cd(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 kg(t){return t<0?0:t>1?1:t}function Td(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,n=t.reducedMotion===!0,o=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},u=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},h=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,p()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,p()},16)}},f=()=>{a||s||(a=!0,u(),t.done())},m=p=>{for(let g=c.length-1;g>=0;g--){let b=c[g],S=n?1:kg((p-b.startedAt)/160);t.fade(b.work,S),S>=1&&c.splice(g,1)}return c.length>0},y=()=>{if(s)return;let p=e(),g=p;for(;r<t.chunks.length&&(r===0||e()-g<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,n?1:0),n||c.push({work:S.work,startedAt:p+(r-1)*o}),e()-g>=i)break}let b=m(p);t.draw(),r<t.chunks.length||b?h(y):f()};return h(y),{cancel(){if(!a){s=!0,u();for(let p of c)t.fade(p.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let p=t.chunks[r++];t.build(p.work)}for(let p of t.chunks)t.fade(p.work,1);c.length=0,t.draw(),f()}},get done(){return a}}}var xg={width:40,height:30,rotation:0};function Id(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)??xg;if(l.points&&l.points.length>=3){for(let m of l.points)s.x+m.x<i&&(i=s.x+m.x),s.y+m.y<n&&(n=s.y+m.y),s.x+m.x>o&&(o=s.x+m.x),s.y+m.y>r&&(r=s.y+m.y);continue}let c=l.rotation*Math.PI/180,d=l.width/2,u=l.height/2,h=Math.abs(d*Math.cos(c))+Math.abs(u*Math.sin(c)),f=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-f<n&&(n=s.y-f),s.x+h>o&&(o=s.x+h),s.y+f>r&&(r=s.y+f);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<n&&(n=s.y-a),s.x+a>o&&(o=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:n,width:o-i,height:r-n}:null}function Pd(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 Rd=!1;function Md(t){return t&&t!=="flat"&&!Rd&&(Rd=!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 Ed=(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 Ad(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=>Ed(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=>Ed(c,d.outline)))}}import{Group as Fd}from"konva/lib/Group";import{Rect as Lg}from"konva/lib/shapes/Rect";import{Text as Ro}from"konva/lib/shapes/Text";function _d(t,e){let i=ei(e.outline,e.holes),n=le(t.canvasBackground),o=[],r=new Map,s=0,a=K(e.outline),l=t.seatIndex?st(t.seatIndex,a).map(C=>t.seatById.get(C)).filter(C=>!!C):t.seats;for(let C of l)t.seatSection.has(C.id)||te(C,e.outline,e.holes)&&(o.push(C.id),r.set(C.categoryKey,(r.get(C.categoryKey)??0)+1),(t.statusById.get(C.id)??"free")==="free"&&s++);let c=e.color??ni([...r].map(([C,I])=>({hex:t.catColor.get(C)??"#6e7bff",w:I})),"#3a4358"),d=new Fd({listening:!1});t.bgLayer.add(d);let u=new Fd({listening:!1});d.add(u);let h=new gt({listening:!0});t.seatLayer.add(h);let f=u,m=Ad(t.chartDoc,e),y=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",p=He(e.outline,m.holes,{visible:!m.hidden,stroke:G(y,.5),strokeWidth:1,fill:G(y,.08),listening:!1},e.outlinePath);f.add(p);let g=He(e.outline,m.holes,{visible:!m.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:Ue,opacity:0,listening:!1},e.outlinePath);f.add(g);let b=e.labelPresentation?.labelStyle,S=b?.color,w=n.sectionInk,k=(b?.size??18)/18,v=new Lg({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});f.add(v);let x=new Ro({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*k,fontStyle:Te,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,w),listening:!1,perfectDrawEnabled:!1});x.offsetX(x.width()/2),x.offsetY(x.height()/2),f.add(x);let T=new Ro({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Te,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,w),opacity:0,listening:!1,perfectDrawEnabled:!1});f.add(T);let P=new Ro({x:i.x,y:i.y,text:B("map.seatsLeft",{count:s}),fontSize:12,fontStyle:vs,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),f.add(P),{id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...za(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(C=>t.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(o),shellFill:n.sectionFill,shellStroke:n.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!te(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},...e.labelPresentation?.rotation?{authoredLabelRotation:e.labelPresentation.rotation}:{},labelArea:Zo(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:y,outlinePoly:p,blockPoly:g,namePlate:v,nameLabel:x,numberLabel:T,subLabel:P,preferredInk:w,...S?{explicitInk:S}:{},labelScale:k,authoredLabelSize:b?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function Od(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=uo(o.map(d=>d.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=t.clusterLabels.boundsForSeats(o,s),l=Je(o,s);if(a?.singleBlock&&(!t.hasSections||r!=null)){let d=t.clusterLabels.diveTarget(a.bounds,a.anchor);if(d){t.focusRegion(d,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:yt(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};ho({stage:t.stage,box:l,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(c)})||t.focusRegion(l,{animate:i?.animate,durationMs:t.cameraGlideMs})}function yt(t){let e=Hc(Math.max(t.seatR,t.markerR));return Math.max(e,cl(t.markerR))}var Bd=.25;function Cg(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*Bd/Math.max(i.width,1e-6),n.height*Bd/Math.max(i.height,1e-6))}function Dd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=Nd(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 ho({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:yt(t)}),!0}function Nd(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Re(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function Hd(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&&Re(s,n)==="match"});return o.length&&Mo(t,o)||t.focusSection(e),!0}function Gd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Nd(t,i);if(!n.length)return null;let o=Math.max(24,t.seatR*3),r=Je(n,o),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht;return{spaces:n.length,sections:Ao(t,i),wholeVenue:a}}function Mo(t,e,i){let n=e.map(h=>t.seatById.get(h)).filter(h=>h!=null);if(!n.length)return!1;let o=t.seatPitch>0?t.seatPitch:t.seatR*2,r=Je(n,Math.max(24,t.seatR*3,o*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht)return!1;let a=uo(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=Cg(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(yt(t),u),d)}),!0}function Wd(t,e,i=!0,n){let o=t.sectionBounds(e);if(!o)return;let r=t.sectionMembers(e).map(d=>t.seatById.get(d)).filter(d=>d!=null),s=r.filter(d=>(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id)),a=s.length?s:r,l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,o,n,l);t.focusRegion(c?.bounds??o,{animate:i,minScale:c?.minScale,maxScale:yt(t),focusPaddingPx:l})}function Eo(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let n=Vd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,n),n}function Vd(t,e,i){return Rl(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function Ao(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?Eo(t,r):Vd(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 Pg=1800,Zt=class Zt{constructor(e,i={}){this.seatLabelPool=new Map;this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.canonicalSeatIds=new Set;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=so;this.effSelection=ft;this.colorblind=!1;this.cbHueByKey=new Map;this.colourOverride=null;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.sectionRungPinned=!1;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Di;this.seatPaintCache=null;this.selectionFocusId=null;this.selectionFocusKeep=null;this.hiddenPose=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.accessFreeBySection=new Map;this.categoryHighlight=null;this.seatHighlight=null;this.labelLayers={seatLabels:!0,rowLabels:!0};this.categoryColours=!0;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];this.landmarkBoxes=[];this.seatSection=new Map;this.unsectionedSeatGroup=null;this.catPrice=new Map;this.dimmedSections=new Set;this.sectionHeat=new Map;this.closedSections=new Set;this.focusedSectionId=null;this.focusMembership=new Map;this.focusMembershipKey=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.sectionFocusDim=null;this.cameraGestures=0;this.objectFloor=new Map;this.unsectionedSeatIds=null;this.tableFootprints=[];this.zoneColor=new Map;this.hasSections=!1;this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=Dc();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=co(J);this.bounds={x:0,y:0,width:1,height:1};this.cached=!1;this.dpr=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);this.assets=new ji;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.viewportSeats=null;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.gestureHits=new Yi(()=>{!this.destroyed&&!this.exportMode&&this.updateLabels()});this.rowLabelDwell=new Ui;this.readingFocusedFrame=!1;this.marquee=new $i({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,isSelectable:e=>this.isSelectable(e),applyBand:(e,i,n)=>{this.opts.onBand?.(e,i,n)||(n?this.deselect(e):this.selectMany(e))},selectionChanged:()=>{this.opts.onMarquee?.(this.getSelection())}});this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let n=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;n&&this.focusSeat(n);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let n=this.seatById.get(this.focusedId);n&&this.opts.onFocusSeat?.(n)}};this.focusRingLinger=null;this.cameraHostCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.selectionFollowUps=new qi(()=>{this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)});this.sectionBoundsMemo=new Map;this.interactionHostCache=null;this.seatLabelTargetScale=xc(()=>({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?Ne(i):void 0}}));this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let n=Ji.pixelRatio;if(this.exportMode&&(this.dpr=1),Ji.pixelRatio=this.dpr,this.stage=new Tg({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Xi(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",B("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Fo({listening:!this.exportMode}),this.seatLayer=new Fo({listening:!this.exportMode}),this.overlayLayer=new Fo({listening:!1}),this.exportMode||(this.gestureHits.wrap(this.bgLayer),this.gestureHits.wrap(this.seatLayer),this.gestureHits.listen(e),Ld(this.seatLayer)),this.labelGroup=new qt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new qt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Bi({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>pl(this.sellableUnit),pickableScale:()=>Fi(this.sellableUnit),categoryLabel:o=>this.catByKey.get(o)?.label??"",categoryColor:o=>this.categoryDisplayColor(o),categoryFilter:()=>this.categoryFilter,seatsPickable:()=>this.seatsPickable(),screenToWorld:o=>this.screenToWorld(o),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(o,r)=>this.focusRegion(o,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new zd({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:zi,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new zd({radius:J+3,stroke:"#38bdf8",strokeWidth:2.5,dash:[4,3],opacity:.95,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.focusRing),this.stage.add(this.bgLayer,this.seatLayer,this.overlayLayer),this.exportMode&&(Ji.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&Cd(o,r=>{this.rafId=r})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setRowBandPreview(e){this.rowBandPreview?.clear(),this.rowBandPreview=e?new Xt:null,this.rowBandZoomAnchor=null,this.hoverRing.visible(!1),this.updateLOD(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw()}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Ci({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.seatPriceLabel(e)??this.plainSeatPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),seatOwnedHold:e=>this.ownedHold.has(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new Ti({overlayLayer:this.overlayLayer,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,categoryColor:e=>this.categoryDisplayColor(e),seatCategoryKey:e=>this.seatById.get(e)?.categoryKey??null,isOwnedHold:e=>this.ownedHold.has(e),reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed})),this.breathCache}presentSeatHover(e,i,n,o){this.hoverCard.presentSeat(e,i,n,o)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Mi({container:this.container,labelFont:()=>this.labelFont(),canvasBackground:()=>this.canvasBackground,seatsPickable:()=>this.seatsPickable(),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionLabel:e=>this.sections.find(i=>i.logicalId===e)?.label??null,sectionMembers:e=>this.sectionMembers(e),hoveredSeatId:()=>this.hoveredId,hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,nearestSeat:e=>this.nearestSeatToScreen(e,pe,!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),seatPrice:e=>this.seatPriceLabel(e)??this.plainSeatPriceLabel(e.categoryKey),categoryColor:e=>this.categoryDisplayColor(e),categorySellable:e=>this.catByKey.get(e)?.notForSale!==!0,chartDoc:()=>this.chartDoc,seatFacts:e=>this.opts.hoverFacts?.(e)??null,seatCardHead:e=>this.opts.hoverCardHead?.(e)??null,sectionCardHead:(e,i)=>this.opts.hoverSectionHead?.(e,i)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Ii({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Dt(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let n=this.sectionTapAnchor(i,this.seatById.get(e.seatId)??{x:0,y:0});this.opts.onSectionTap?this.opts.onSectionTap(i,n):this.focusSection(i,{anchor:n})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(n=>n.id).filter(n=>{let o=this.seatSection.get(n);return!!o&&(o.logicalId===e||o.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(La({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null);if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let n=0,o=0;for(let r of i)n+=r.x,o+=r.y;return{x:n/i.length,y:o/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Ri({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let n of e.memberIds){if(!this.selection.has(n)&&!this.ownedHold.has(n))continue;let o=this.seatById.get(n);o&&i.push(o)}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>this.marquee.active(),marqueeShouldStart:e=>pc(e,{manageMode:this.opts.manageMode===!0,marqueeSelect:this.opts.marqueeSelect===!0}),beginMarquee:(e,i)=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box",i),updateMarquee:e=>this.marquee.update(e),finishMarquee:()=>this.marquee.finish(),cancelMarquee:()=>this.marquee.cancel(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,i){this.sectionBoundsMemo.clear(),this.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Xt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.sectionRungPinned=!1,this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??ti(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let a of e.floors)for(let l of a.objects)this.objectFloor.set(l.id,a.id),l.type==="section"&&l.logicalSectionId&&this.objectFloor.set(l.logicalSectionId,a.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.focusMembership.clear(),this.focusMembershipKey=null,this.unsectionedSeatIds=null,this.primaryFocalLabels.clear(),this.gaById.clear();for(let a of this.selectionMarkers.values())a.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),n||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,n||this.statusById.clear(),this.accessFreeBySection.clear(),n||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,n||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.seatHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasSections=o.objects.some(a=>a.type==="section");for(let a of e.zones??[])a.color&&this.zoneColor.set(a.id,a.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=ui(this.theme.seatScale)*J,this.container.style.background="",this.canvasBackground=this.resolveCanvasBackground(),this.container.style.background=this.canvasBackground,this.effSelection=this.resolveSelectionColor(),this.hoverRing.stroke(this.effSelection),this.hoverRing.radius(this.seatR+2),this.catColor.clear(),this.catByKey.clear(),this.catPrice.clear(),this.catOrder=e.categories.map(a=>a.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((a,l)=>{this.cbHueByKey.set(a,ki[l%ki.length])});for(let a of e.categories){this.catColor.set(a.key,a.color),this.catByKey.set(a.key,a);let l=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[a.key]?.min??a.price;typeof l=="number"&&this.catPrice.set(a.key,l)}this.tableFootprints=Bc(o.objects);for(let a of o.objects)a.type==="booth"&&this.boothDims.set(a.id,{width:a.width,height:a.height,rotation:a.rotation,...a.points&&a.points.length>=3?{points:a.points.map(l=>({x:l.x,y:l.y}))}:{},...It(a)?{}:{nameHidden:!0},...ze(a)?{nameSize:ze(a)}:{}});if(this.seats=We(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===e?this.seats:We(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=Ar(this.seats,{seatRadius:this.seatR}),this.seatPitch=al(this.seats),this.markerR=ll(this.seatR,this.seatPitch),this.sellableUnit=ul(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=rr(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new qt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?Id(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),gc(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=Pd({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Td({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&&Ze(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){if(this.viewportSeats){let n=this.viewportSeats;this.viewportSeats=null,e?n.finish():n.cancel()}let i=this.seatReveal;this.seatRevealPending=!1,i&&(this.seatReveal=null,e?i.finishNow():i.cancel(),this.seats.length&&!this.destroyed&&this.updateLabels())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:xt(e)};if(this.floorOverview&&e.floors.length>=2)return it(e)==="combined"?dr(e):cr(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...or(e),referenceImage:void 0,backgroundImage:xt(e)};let i=e.floors.find(n=>n.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:xt(i),floors:void 0}}floorBaseHeightMFor(){let e=this.chartDoc?.floors;return e?.length?e.find(i=>i.id===this.activeFloorId)?.baseHeightM??0:0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&!!this.chartDoc&&it(this.chartDoc)!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?ti(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let n=!1,o=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),n=!0),o){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),o.add(l))}}if(o&&o.size){for(let r of o)this.refreshSectionFill(r);this.bgLayer.batchDraw()}n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setSeatCategories(e){let i=!1,n=!1,o=new Set;for(let[s,a]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(a)||l.categoryKey===a)continue;l.categoryKey=a,i=!0;let c=this.circleById.get(s);c&&(this.paintSeat(c,s),n=!0);let d=this.seatSection.get(s);d&&o.add(d)}if(!i)return;let r=new Map((this.chartDoc?ti(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){if(!r.get(s.id)?.color){let l=new Map;for(let c of s.memberIds){let d=this.seatById.get(c)?.categoryKey;d&&l.set(d,(l.get(d)??0)+1)}s.baseFill=ni([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(o=>this.statusById.has(o))),n=new Set([...this.ownedHold,...i]);this.ownedHold=i,this.selectionFollowUps.batch(()=>{for(let o of n){let r=this.circleById.get(o);r&&this.paintSeat(r,o),this.syncSelectionMarker(o)}}),n.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let n=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=nc({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&&oc(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){this.opts.ownPriceRings?.(this,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<=os;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 od(e,i)}selectRow(e){let i=nd(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&&Kl(this.flashHost,n,i)}flashSection(e,i="#22a06b"){Xl(this.flashHost,this.sections.filter(n=>n.id===e||n.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed}}nearestSeat(e,i){let n=this.seatById.get(e);if(!n)return null;let o=n,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=a,c=l.x-o.x,d=l.y-o.y,u=c*i.x+d*i.y;if(u<=.5)continue;let h=Math.abs(c*i.y-d*i.x),f=u+h*2.5;f<s&&(s=f,r=a.id)}return r}focusSeat(e,i){let n=this.seatById.get(e);n&&(this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(n),this.focusRing.scale({x:1,y:1}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},Pg)),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(),ve*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=Tc(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&&Ze(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return Ic(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){return Cc(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return Mc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){bc(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(fl(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},gestureFrame:()=>this.gestureHits.bump(),framingViewport:()=>this.framingViewport(),constrainPan:(e,i)=>this.constrainPan(e,i),sectionBounds:e=>this.sectionBounds(e),effScale:()=>this.effScale(),settleView:()=>this.settleView(),afterViewChange:()=>this.afterViewChange(),scheduleViewChange:()=>this.scheduleViewChange(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),updateLOD:()=>this.updateLOD(),cancelGlide:()=>this.cancelGlide()}}refitCurrentView(e=!1){if(e){this.settleView();return}if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return Pc(this.stage)}setCameraPose(e){this.cancelGlide(),Rc(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.stepZoom(Zt.ZOOM_STEP)}zoomOut(){this.stepZoom(1/Zt.ZOOM_STEP)}stepZoom(e){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),Wi({stage:this.stage,reducedMotion:()=>this.reducedMotion,bounds:()=>this.zoomBounds(),apply:(i,n)=>this.zoomAbout(i,n)},e,Ki(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX();return{x:e.x*i+this.stage.x(),y:e.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let n of this.sections)this.refreshSectionFill(n);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale()),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((n,o)=>n===e[o])}setCommercialLimitedFilter(e){this.commercialLimitedFilter!==e&&(this.commercialLimitedFilter=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setCategoryFilter(e){let i=e===null?null:new Set(e);vl(i,this.categoryFilter)||(this.categoryFilter=i,this.lodScale=0,this.updateLOD(),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}applyGAFilterState(){this.clusterLabels.applyFilterDim(),this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){Qc({gaById:this.gaById,bgLayer:this.bgLayer,exportMode:this.exportMode,pickerMode:!!this.opts.gaPickerMode,selectionColor:this.effSelection,labelFont:()=>this.labelFont(),filteredOut:e=>!!(this.categoryFilter&&!this.categoryFilter.has(e)),dimmed:e=>qc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Q,effScale:()=>this.effScale(),labelLegible:e=>ye(e,this.effScale())})}setGAStates(e){jc(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){Od(this.focusFramingContext,e,i)}diveCeiling(){return yt(this.focusFramingContext)}focusAccessibleSeats(e){return Dd(this.focusFramingContext,e)}focusAccessibleSection(e,i){return Hd(this.focusFramingContext,e,i)}accessibleSpread(e){return Gd(this.focusFramingContext,e)}setViewMode(e){Md(e),this.afterViewChange()}getViewMode(){return"flat"}effScale(){return this.stage.scaleX()}destroy(){this.movingLabelTimer&&(clearTimeout(this.movingLabelTimer),this.movingLabelTimer=null),this.rowBandPreview?.clear(),this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.rafId&&cancelAnimationFrame(this.rafId),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.gestureHits.destroy(),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let n=this.seatSection.get(e);return i*(n&&this.sectionMatchesFocus(n)?1:Ie)}sectionScreenBounds(e){return Ka({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Q,i=[],n=96,o=this.stage.width(),r=this.stage.height();for(let s of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(s);a=c.x+c.width>=-n&&c.y+c.height>=-n&&c.x<=o+n&&c.y<=r+n}this.viewportSeats&&a&&(e||s.id===this.focusedSectionId||s.logicalId===this.focusedSectionId)&&i.push(s.id),s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0)}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let n of i.memberIds){let o=this.seatById.get(n);o&&e.push(o)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let n=this.seatById.get(i);n&&e.push(n)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let n=this.labelLiftGroups.get(i.id);return n||(n=new gt({listening:!1}),n.setViewportCulled(i.liftGroupSeat.isViewportCulled()),this.labelGroup.add(n),this.labelLiftGroups.set(i.id,n)),n}viewportPins(){return el([this.focusRing.visible()?this.focusedId:null,this.hoveredId],this.ownedHold,this.selection)}queueViewportPinSync(){!this.viewportSeats||this.viewportPinSync||(this.viewportPinSync=!0,queueMicrotask(()=>{this.viewportPinSync=!1,this.viewportSeats?.sync(this.viewportWanted,this.viewportPins())}))}startViewportSeats(){let e=new Map;this.viewportWanted=["__loose"];for(let i of this.seats){let n=this.seatSection.get(i.id)?.id??"__loose",o=e.get(n);o||e.set(n,o=[]),o.push(i)}this.viewportSeats=new Ei(e,{build:i=>this.renderSeats(i),remove:i=>{for(let n of i)for(let o of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])o.get(n.id)?.destroy(),o.delete(n.id);this.glyphMarkers=this.glyphMarkers.filter(n=>!!n.getParent())},draw:()=>{this.updateLOD(),this.updateLabels(),this.seatLayer.batchDraw()},schedule:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i),now:()=>performance.now(),sectionOf:i=>this.seatById.has(i)?this.seatSection.get(i)?.id??"__loose":void 0})}renderSeats(e=this.seats){ml({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/Se,o=new Ig({x:e.x,y:e.y,data:ot(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:li(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Xc(o),o}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,n]of this.accessGlyphById){let o=this.seatR*1.5/Se,s=this.accessGlyphFilterEmphasized(i)?Zr:qr,a=Math.max(o,s/(Se*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&&Pe(i,n)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode||i==="not_for_sale"&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${ce(i.min,this.currency)}\u2013${ce(i.max,this.currency)}`;let n=this.catPrice.get(e);return typeof n=="number"?ce(n,this.currency):null}plainSeatPriceLabel(e){let i=this.chartDoc?.seatPrices,n=this.catByKey.get(e);if(this.categoryPriceRanges===null||!i||!Object.keys(i).length||!n)return this.categoryPriceLabel(e);let o=n.tiers?.length?n.tiers.map(a=>a.price).filter(a=>typeof a=="number"):typeof n.price=="number"?[n.price]:[];if(!o.length)return this.categoryPriceLabel(e);let r=Math.min(...o),s=Math.max(...o);return s>r?`${ce(r,this.currency)}\u2013${ce(s,this.currency)}`:ce(r,this.currency)}seatPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.opts.seatPriceLabel?.(e);if(i!==void 0)return i;let n=Tn(this.chartDoc?.seatPrices,e.label);if(n===void 0)return null;let o=typeof n=="number"?[n]:Object.values(n.tiers);if(!o.length)return null;let r=Math.min(...o),s=Math.max(...o);return s>r?`${ce(r,this.currency)}\u2013${ce(s,this.currency)}`:ce(r,this.currency)}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,n])=>[i,{min:n.min,max:n.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let n=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof n=="number"&&this.catPrice.set(i.key,n)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.categoryColours?this.colourOverride?.[e]?this.colourOverride[e]:this.colorblind?this.cbHueByKey.get(e)??ki[0]:this.catColor.get(e)??"#6e7bff":Ha}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??je}seatLabelInk(e,i){let n=i.fill();return he(typeof n=="string"?n:"",e.labelStyle?.color,this.theme.seatLabelColor??je,Xe)}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?{...Ne(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){rc(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}repaintSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){e!==this.colorblind&&(this.colorblind=e,this.recolourCategories())}setCategoryColourOverride(e){this.colourOverride=e,this.recolourCategories()}recolourCategories(){this.repaintSeats();for(let e of this.sections)e.shellCategoryColor=this.dominantSellableColor(e.memberIds),this.refreshSectionFill(e);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}setDimmedSections(e){let i=new Set(e??[]);i.size===this.dimmedSections.size&&[...i].every(n=>this.dimmedSections.has(n))||(this.dimmedSections=i,this.repaintSeats(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(n=>this.closedSections.has(n))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(n=>n.id===e||n.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return Mo(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}}Wd(this.focusFramingContext,e,i,n)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=U}setSectionFocusDim(e){let i=this.sectionDimEnabled();this.sectionFocusDim=e,i!==e&&(e||this.dropFocusDim())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=ae}atVenueFit(){return this.fitPose!==""&&Ze(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active||this.viewportSeats&&this.seatLayer.opacity()===0?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=Fi(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(n=>n.id===e||n.logicalId===e);if(this.focusBackdrop=Yl(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Ul(this.focusBackdropHost,i);for(let n of this.selectionMarkers.values())n.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let n=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),o=2;return[{x:n.x-o,y:n.y-o},{x:n.x+n.width+o,y:n.y-o},{x:n.x+n.width+o,y:n.y+n.height+o},{x:n.x-o,y:n.y+n.height+o}]}):[]}}}repaintSectionsAndSeats(){this.repaintSeats();for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,n=-1/0,o=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>n&&(n=s),a>o&&(o=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,n-e),height:Math.max(1,o-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let n=this.isSectionClosed(i)||i.free<=0,o=i.memberIds.some(a=>this.selection.has(a)),r=o||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:o?"selected":n?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r,free:i.free,total:i.memberIds.length}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),n={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:n.x+this.stage.width()/2-i.x,y:n.y+this.stage.height()/2-i.y},n)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let n=this.stage.x(),o=this.stage.y(),r=this.constrainPan({x:n+e.x,y:o+e.y},{x:n,y:o}),s=r.x-n,a=r.y-o;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=u=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let h=Math.min(1,(u-l)/c),f=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:n+s*f,y:o+a*f}),this.scheduleViewChange(),this.stage.batchDraw(),h<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setSeatHighlight(e){Ga(this.readingAidsHost,e)}setLabelLayers(e){Wa(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Va(this.readingAidsHost,e)}refreshBlockPaint(){this.repaintSectionsAndSeats(),this.updateLOD()}getCategoryColours(){return this.categoryColours}get readingAidsHost(){return{seatHighlight:()=>this.seatHighlight,setSeatHighlightState:e=>{this.seatHighlight=e},labelLayers:()=>this.labelLayers,setLabelLayersState:e=>{this.labelLayers=e},repaintSeats:()=>this.repaintSeats(),updateLabels:()=>this.updateLabels(),draw:()=>{this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()},categoryColours:()=>this.categoryColours,setCategoryColoursState:e=>{this.categoryColours=e},repaintSectionsAndSeats:()=>this.repaintSectionsAndSeats()}}setCategoryHighlight(e){this.categoryHighlight!==e&&(this.categoryHighlight=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}renderBackground(e){let i=xt(e);i&&this.renderBackgroundImage(i);for(let n of e.objects)n.type==="decorImage"&&this.renderDecorImage(n);for(let n of e.objects)n.type==="section"&&this.renderSection(n);for(let n of e.objects)n.type==="shape"?this.renderShape(n):n.type==="gaArea"?this.renderGA(n):n.type==="table"?this.renderTable(n):n.type==="text"&&this.renderText(n);this.renderZones(e)}trackAssetImage(e,i,n,o){this.assets.track(e,i,n,o,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){pd(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){fd(this.objectDrawContext,e)}renderTable(e){md(this.objectDrawContext,e)}renderText(e){gd(this.objectDrawContext,e)}renderShape(e){bd(this.objectDrawContext,e)}renderGA(e){Sd(this.objectDrawContext,e)}renderSection(e){let i=_d(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){Pl(this.sectionLodPaintContext,e)}refreshSectionFill(e){El(this.sectionLodPaintContext,e)}isSectionClosed(e){return po(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Ns(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return Eo(this.focusFramingContext,e)}accessibleSections(e){return Ao(this.focusFramingContext,e)}get sectionLodPaintContext(){let e=new Set([...this.selection,...this.ownedHold].map(i=>this.seatSection.get(i)));return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:i=>e.has(i),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:i=>this.sectionAccessibleFree(i),blockPaint:this.opts.blockPaint,selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,glideInProgress:this.glideInProgress,sectionsPinned:this.sectionRungPinned,reducedMotion:this.reducedMotion,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){this.opts.manageMode||Qa({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:!!this.chartDoc&&it(this.chartDoc)==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX();return{x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i}}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),n=this.sections.find(o=>te(i,o.outline,o.holes));return n?n.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Gi(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let n of this.gaById.values())if(te(i,n.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||wo(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,pe,!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?Re(i,this.accessFilter)==="other":!1}toggleSeat(e){if(this.ownedHold.has(e)){let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i);return}if(this.selection.has(e)){this.setSelected(e,!1),this.effScale()>ie&&this.updateLabels();let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i)}else{if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);return}this.setSelected(e,!0),this.playSeatPickMoment(e);let i=this.seatById.get(e);i&&this.opts.onSelect?.(i)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?yn(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let n=yn(getComputedStyle(i).backgroundColor);if(n)return n;i=i.parentElement}}return so}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:H(this.canvasBackground)?nl:ft}setSelected(e,i,n=!1){let o=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());o&&(this.paintSeat(o,e),!n&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.queueViewportPinSync(),this.selectionFollowUps.request()}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){let i=this.sectionBoundsMemo;if(i.has(e))return i.get(e)??null;!i.size&&typeof queueMicrotask=="function"&&queueMicrotask(()=>i.clear());let n=this.measureSectionBounds(e);return typeof queueMicrotask=="function"&&i.set(e,n),n}measureSectionBounds(e){return qa({sections:this.sections,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,n,o)=>this.resolveAutomaticRowLabelPosition(i,n,o),rowLabelBox:(i,n)=>this.rowLabelBox(i,n)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(mt(this.stage,i,this.zoomBounds(),Kt(this.framingViewport(),this.focusedRowLabelGutter(e))),Gt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return Kc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return bl(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return gl(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(){hc(this.interactionHost)}handleSeatTap(e){uc(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=>ja({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=>wo(this.tableFootprints,this.seats,this.screenToWorld(e),this.effScale()),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,n)=>this.zoomAbout(e,i,n),panBy:(e,i)=>Sc(this.cameraHost,e,i),zoomBounds:()=>this.zoomBounds(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):Ki(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),n)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap??(this.opts.manageMode?()=>this.overview():void 0),onDeckTap:this.opts.onDeckTap}}zoomBounds(){return zt(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),yc(this.cameraHost,e,i,n)}cancelZoomSettle(){wc(this.cameraHost)}focusRegion(e,i){kc(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let n=performance.now();this.labelGroup.opacity(0);let o=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-n)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(o):0};this.labelFadeRaf=requestAnimationFrame(o)}cancelGlide(){Wt(this.stage),this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Q?"seats":this.sectionRungPinned?"sections":this.zones.length&&e<Ye?"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),sd(this.renderedQualityContext)}setRung(e){let i=this.sectionRungPinned;if(this.sectionRungPinned=e==="sections",e==="zones")this.cancelGlide(),this.zoomToFit();else{let n=this.framingViewport(),o=ed({rung:e,bounds:this.bounds,sections:this.sections,seats:this.seats,focusedSectionId:this.focusedSectionId,viewCentre:Ki(this.framingWorldRect()),width:n.width,height:n.height,seatScale:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),seatFloor:Math.min(this.rowBandPreview?this.rowBandPreview.detailScale*1.08:Q*1.1,this.zoomBounds().max)});this.focusRegion(o.bounds,o.minScale===void 0?void 0:{minScale:o.minScale})}(i||this.sectionRungPinned)&&this.updateLOD()}seatRungScale(){return Nc(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Kt(this.framingViewport(),o);return Gc({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:n})}releaseFocusOnPullBack(){this.rowBandPreview&&this.focusedSectionId&&this.effScale()>=Math.min(Q,this.sectionFrameScale(this.focusedSectionId)*.85)||mc({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Q))return;let o=(i&&e?this.sectionAt(e):null)??Xa({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!o||o===this.focusedSectionId||(this.focusedSectionId=o,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(o))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ie&&!this.rowBandPreview?.active||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},ns))}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)yd(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(Ol(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Q,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Q),()=>this.sectionFrameScale(this.focusedSectionId),r=>{let s=r.outline.map(a=>this.worldToScreen(a));return Math.max(...s.map(a=>a.x))>=0&&Math.min(...s.map(a=>a.x))<=this.stage.width()&&Math.max(...s.map(a=>a.y))>=0&&Math.min(...s.map(a=>a.y))<=this.stage.height()},()=>this.zoomBounds().max),this.owned.sync(e,this.getRung()),this.syncBeacons()):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e);let n=this.seatGlyphDetail;if(this.seatGlyphDetail=qs(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),n!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let r=this.seatLayer.opacity()>0;this.seatLayer.listening(r),!r&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let o=!this.exportMode&&!this.rowBandPreview?.active&&e<Q;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),o&&!this.cached&&this.seatLayer.opacity()===0){this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.seatLayer.listening(!1),this.hoveredId&&this.seatLayer.fire("mouseout");return}if(o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.viewportSeats||this.seatReveal||this.seatRevealPending||this.rowBandPreview?.active)return;if(this.seatLayer.opacity()===0){this.cached&&this.releaseSeatLayerBitmap(),this.cached=!1,this.seatLayer.listening(!1);return}this.updateSeatGroupVisibility();let e=q(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0,this.mountCachePending=!1}cacheSeatLayer(){this.destroyed||typeof document>"u"||(this.recacheTimer=null,this.rebuildSeatCache(),this.seatLayer.batchDraw())}releaseSeatLayerBitmap(){xd(Ji,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.gestureHits.flush(),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Q?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),n=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:n,width:Math.max(1,o-i),height:Math.max(1,r-n)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),n=Math.max(12,Math.min(36,Math.min(e,i)*.025)),o=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-n*2),a=Math.max(1,i-n*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};o(),o()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(o){let r=o instanceof Error?o.message:String(o);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let n=i.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");n.fillStyle=this.canvasBackground,n.fillRect(0,0,i.width,i.height);try{n.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ie):this.effScale(),i=[];for(let{node:n,backdrop:o,kind:r,showAt:s,area:a}of this.freeTextById.values()){if(r==="ga-label"||r==="ga-capacity"||a)continue;let l=r==="free-text"&&this.nodeBelongsToFocusedSection(n),c=r==="direct-landmark";if(c){let f=Number(n.getAttr("directLandmarkBaseFontSize"))||n.fontSize();n.setAttr("directLandmarkBaseFontSize",f),n.fontSize(Math.max(f,V/e)),i.push({node:n,backdrop:o,baseFontSize:f})}let d=s==="detail"&&!this.exportMode&&e<Ce,h=c||r==="stage"||l||!d&&ye(n.fontSize(),e);if(n.visible(h),o?.visible(h),!this.exportMode&&r==="free-text"){let f=Math.min(1,Ms/Math.max(n.fontSize()*e,1e-6));n.scale({x:f,y:f}),o?.scale({x:f,y:f})}}_c(i),Fc({freeTextById:this.freeTextById,focalLabels:this.primaryFocalLabels.keys(),seatIndex:this.seatIndex,bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,scale:e});for(let{node:n,fontSize:o}of this.iconNodeById.values())n.visible(this.nodeBelongsToFocusedSection(n)||ye(To(n,o,e),e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let n=this.focusMembership.get(e);if(n!==void 0)return n;let o=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(o.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=o.some(l=>te(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.sectionBoundsMemo.clear(),this.rowLabelDwell.reset(),this.rowLabelPlan=wd(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,sections:this.sections,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,n=ee){return $t(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return kd(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(){hl(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,labelLayers:()=>this.labelLayers,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),rowLabelDwell:this.rowLabelDwell,gesturing:()=>this.gestureHits.active,worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,markerR:this.markerR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,n)=>this.resolveAutomaticRowLabelPosition(e,i,n),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Jc({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===""||Ze(this.stage)===this.fitPose)&&e.width===n.width;r&&this.stage.position({x:this.stage.x()+(e.width-n.width)/2,y:this.stage.y()+(e.height-n.height)/2}),this.refitCurrentView(r)}};Zt.ZOOM_STEP=1.4;var _o=Zt;function Kd(t,e){return new _o(t,e)}function Rg(t,e){return t*2*.6*e>=6}function Mg(t,e){t._sceneFunc(e)}function Bo(t){let e=this,i=e.attrs;Mg(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Rg(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 Xd(t){return t.attrs.sceneFunc===Bo}function Yd(t){Xd(t)&&t.setAttr("sceneFunc",void 0)}function Eg(t,e,i,n){if(!e){Yd(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==Bo&&t.setAttr("sceneFunc",Bo)}import{Shape as Ag}from"konva/lib/Shape";var Fg="#8B5CF6",_g=(6.1-4.3)/4.3,Bg=1.25/4.3,Og=8,Ud=new WeakMap;function Dg(t,e,i,n){let o=t.seatR,r=i.getStage(),s=Math.abs(r?r.scaleX():1)||1;if(!e.size||o*2*s<Og)return;let a=o*_g,l=!1;n.beginPath();for(let c of e){let d=t.seatById.get(c),u=t.circleById.get(c);if(!d||!u||t.selection.has(c)||u.opacity()<.5||!u.isVisible())continue;let h=t.boothLabelById.has(c)?t.boothDims.get(d.rowId):void 0,f=h?Ne(h):void 0,m=(f?Math.hypot(f.width,f.height)/2:o)+a;n.moveTo(d.x+m,d.y),n.arc(d.x,d.y,m,0,Math.PI*2),l=!0}l&&(n.setAttr("strokeStyle",Fg),n.setAttr("lineWidth",o*Bg),n.stroke())}var Ng=(t,e)=>{let i=t,n=Ud.get(t);if(!n){let r={ids:new Set,chart:i.chartDoc,shape:new Ag({listening:!1,perfectDrawEnabled:!1,sceneFunc:s=>{r.chart===i.chartDoc&&Dg(i,r.ids,r.shape,s)}})};n=r,Ud.set(t,n),i.overlayLayer.add(n.shape),n.shape.moveToBottom()}n.chart!==i.chartDoc&&(n.ids.clear(),n.chart=i.chartDoc);let o=!1;for(let[r,s]of Object.entries(e))s?.kind==="priced"?i.seatById.has(r)&&!n.ids.has(r)&&(n.ids.add(r),o=!0):n.ids.delete(r)&&(o=!0);o&&n.shape.getLayer()?.batchDraw()};function $d(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 Oo(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=jd(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function qd(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 Zd(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 Qd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=jd(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 jd(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 Jd(t,e){return t.accessFilter?Re(e,t.accessFilter)==="other":!1}function eh(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=Hg(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&&Oo(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function Hg(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 th(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(ii(t).map(h=>[h.id,h])),c=gr(t),d=nt(t),u=hi(t);for(let h of e){n.set(h.label,h.id),o.set(h.label,h),r.set(h.id,h),a.push(h.id);let f=l.get(h.rowId),m=f&&"label"in f&&typeof f.label=="string"?f.label:void 0,y=f?.type==="row"?f.segmentedRow:void 0,p=y?.displayLabel??(f&&"displayLabel"in f&&typeof f.displayLabel=="string"&&f.displayLabel?f.displayLabel:m),g=i.get(h.rowId),b=f?.type==="table"?"table":f?.type==="booth"?"booth":"seat",S=p,w=y?.displayType?.trim()||(f&&"displayType"in f&&typeof f.displayType=="string"&&f.displayType.trim()?f.displayType.trim():void 0),k=h.displayLabel??h.label,v=k.split("-"),x=g||h.kind==="booth"?void 0:p&&k.startsWith(`${p}-`)?k.slice(p.length+1):v[v.length-1]??k;s.set(h.id,{objectId:h.rowId,objectType:b,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:x,...w?{displayType:w,rowType:w}:{},...Gg(f,h.sectionId?d.get(h.sectionId):void 0),...f?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function Gg(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 ih(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 nh(t,e,i,n=1){let o=br(t),r=nt(t);return Ct(t).map(s=>{let a=t.categories.find(d=>d.key===s.categoryKey),l=o.get(s.id),c=s.entrance?.trim()||(l?r.get(l):void 0);return{id:s.id,label:s.label,...s.displayLabel?{displayLabel:s.displayLabel}:{},...s.displayType?{displayType:s.displayType}:{},capacity:Math.max(0,Math.floor(s.capacity)),...Wg(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function Wg(t,e,i){let n=fn(t,i),o=mn(t,i),r=Lt(t),s=i===2&&n.length===1&&n[0]===t.label?un(t):null;if(s){let{min:l,max:c}=pn(t),d=e(t.label)==="free";return{available:d?c:0,bookingMode:s,minOccupancy:l,maxOccupancy:c,...r?{wheelchairPlaces:r,wheelchairAvailable:d?r:0}:{}}}let a=n.filter(l=>e(l)==="free");return{available:a.length,...r?{wheelchairPlaces:r,wheelchairAvailable:a.filter(l=>o.has(l)).length}:{}}}function oh(t,e,i){let n=Math.floor(e),o=fn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?un(t):null;if(r){let{min:d,max:u}=pn(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!Lt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=mn(t,i.modelVersion),a=o.filter(d=>!i.alreadyHeld.has(d)&&i.statusOf(d)==="free"),c=(i.wheelchairOnly?a.filter(d=>s.has(d)):[...a.filter(d=>!s.has(d)),...a.filter(d=>s.has(d))]).slice(0,n);return c.length===n?c.map(d=>({label:d})):null}function Vg(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 rh(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?Vg(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 sh(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 zg(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function ah(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=zg(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 MT=5e3,ET={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Kg(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 lh(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!Kg(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 AT(t){return t.lost.length>0||t.holdLapsed}function FT(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function ch(t,e,i=Date.now()){return e&&i<t+5e3}function dh(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 hh(t){if(!t?.zones?.length)return[];let e=new Set(yr(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 uh(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=We(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&&!Pe(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=Xr(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 Do=["background","rowLabelColor","textColor","selectionColor"];function ph(t,e){return!t||!e?!t&&!e:Do.every(i=>t[i]===e[i])}function St(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function en(t){return t==="blocked"?"not_for_sale":t==="unavailable"?"held":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function fh(t,e,i){let n=ur(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}var Ae=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function No(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function mh(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var tn=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,i){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let n=this.ref;this.pending=e.eventConfiguration(i).then(o=>{if(o.reference.id!==n.id||o.reference.version!==n.version||o.configuration.id!==n.id||o.configuration.version!==n.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return o.configuration})}return this.pending}};async function gh(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 Ae(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let u=r.find(m=>m.label===d);if(u&&(u.objectType==="ga"||u.quantity!=null||u.tierId!=null))return{label:d,tierId:u.tierId,...u.quantity!=null?{quantity:u.quantity}:{}};let h=t.labelToSeat.get(d),f=h?t.toSeat(h):null;return{label:d,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),c=await t.api.hold(t.key,l,i,t.hold_?.holdId);return t.setHold({holdId:c.holdId,labels:s,expiresAt:c.expiresAt,items:c.items}),t.hold_}catch(l){throw t.handle409Conflicts(l),l}}async function bh(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 yh(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 Sh(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 Ae(s);let a;try{if(t.hold_&&t.holdCovers(r))a=t.hold_.holdId;else{let c=t.hold_?.holdId,d=await t.api.hold(t.key,r.map(u=>{let h=t.labelToSeat.get(u),f=h?t.toSeat(h):null;return{label:u,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),n,c);a=d.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:d.expiresAt,items:d.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:u,reason:h}=St(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let f=new Set(u.map(p=>p.label)),m=t.idsForLabels(f);m.length&&(o.setStatus(m,"booked"),o.deselect(m),t.resetTableQuantitiesForLabels(f));let y=r.filter(p=>!f.has(p));y.length&&a&&t.api.release(t.key,y,a).catch(()=>{}),t.emitSelectionChange()}else a&&t.api.release(t.key,r,a).catch(()=>{});throw c}let l=t.idsForLabels(r);return l.length&&(o.setStatus(l,"booked"),o.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function vh(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 wh(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 kh(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function xh(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 Lh(t,e){let{status:i,conflicts:n}=St(e);if(i!==409||!n?.length)return;let o=t.renderer;if(!o)return;let r=t.idsForLabels(n.map(s=>s.label));r.length&&(o.deselect(r),o.setStatus(r,"held"),t.resetTableQuantitiesForLabels(n.map(s=>s.label))),t.emitSelectionChange()}function Ch(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 Th(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function Ih(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(ch(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function Ph(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 Yg(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Ug(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=>Yg(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function Mh(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")&&Ug(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 Eh(t){let{id:e,doc:i,seatById:n,groupedTableBySeatId:o}=t,r=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,u=new Set,h=0,f=0;for(let v of l){let x=n.get(v);if(!x)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(x)&&(f+=1);let T=o.get(v);if(T){if(u.has(T.label))continue;u.add(T.label),c.set(T.categoryKey,(c.get(T.categoryKey)??0)+T.maxOccupancy),t.statusOf(T.chairs[0]?.id??v)==="free"&&(h+=T.maxOccupancy,d.set(T.categoryKey,(d.get(T.categoryKey)??0)+T.maxOccupancy))}else c.set(x.categoryKey,(c.get(x.categoryKey)??0)+1),t.statusOf(v)==="free"&&(h++,d.set(x.categoryKey,(d.get(x.categoryKey)??0)+1))}let m=[...c.entries()].map(([v,x])=>{let T=i.categories.find(R=>R.key===v),P=T?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],L=P.length?P:typeof T?.price=="number"&&Number.isFinite(T.price)?[T.price]:[],C=L.length?Math.min(...L):void 0,I=L.length?Math.max(...L):void 0;return{key:v,count:x,label:T?.label??v,color:T?.color??"#6e7bff",...C!==void 0?{price:C,priceMin:C,priceMax:I}:{}}}).sort((v,x)=>(v.priceMin??1/0)-(x.priceMin??1/0)||v.key.localeCompare(x.key)),y=m.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),p=m.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),g=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,b=v=>{let x=null,T=0;for(let[P,L]of v)(L>T||L===T&&x!=null&&P<x)&&(x=P,T=L);return x},S=b(d)??b(c),k=(S?m.find(v=>v.key===S)?.color:void 0)??g?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:f}:{},label:a.displayLabel??a.label,zoneLabel:g?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:k,seatsLeft:h,...y.length?{priceMin:Math.min(...y),priceMax:Math.max(...p)}:{},categories:m}}var nn=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,i=!1){if(!i){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let n=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===n&&(this.inFlight=null)});return this.inFlight=n,n}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function Ah(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function Fh(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 Qg=!0,jg=!0,Jg="#f43f5e",eb=10,tb=15e3,_h=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new tn;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.inventoryModelVersion=1;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.connectFallback=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new nn;this.narrowLayout=!1;this.fitClearance=0;this.accessFilter=null;this.viewportInsets=null;this.accessStepAt=null;this.bandReturnPose=null;this.bandReturnSection=null;this.hintShown=!1;this.lastSnapshotAt=0;this.seatsBuilt=!1;this.pendingSnapshot=null;this.socketVersion=0;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=Ph(e.numberOfPlacesToSelect);let i=Rh(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,eb);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 Do){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return ph(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),n=this.getActiveFloorId(),o=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),n?{floorId:n}:void 0),this.applyRowBandPreview(e),o&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(o=>typeof o=="string");if(i.length===this.hidden.size&&i.every(o=>this.hidden.has(o)))return!1;this.hidden=new Set(i);let n=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),n&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(n=>typeof n=="string");return i.length===this.closedSections.size&&i.every(n=>this.closedSections.has(n))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(o=>o.id);let n=this.labelToId.get(e);return n?[n]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let o=this.visibleDoc(),r=Ct(o).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let o=this.groupedTablesByLabel.get(e.label);return{...o?.displayLabel&&o.displayLabel!==o.label?{displayLabel:o.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}let i=this.labelToSeat.get(e.label),n=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),n={},o=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:o(r)}),C=>({ok:!1,error:C,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:o(a)}),()=>({ok:!1,elapsed:o(a)})),c=await s;if(n.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=mh(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let u=performance.now();try{this.inventoryModelVersion=d.event.inventoryModelVersion===2?2:1;let C=Yr(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(C.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(C.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(C.flatMap(I=>I.chairs.map(R=>[R.id,I]))),this.tableQuantities=new Map(C.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=C.reduce((I,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(C){return this.emitError(C),null}this.expandedSeats=We(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=th(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=h.labelToId,this.labelToSeat=h.labelToSeat,this.seatById=h.seatById,this.seatContext=h.seatContext,this.allIds=h.allIds;for(let C of this.groupedTablesByLabel.values()){let I=C.chairs[0];I&&(this.labelToId.set(C.label,I.id),this.labelToSeat.set(C.label,I))}n.normalizeBuyerModel=o(u);let f=d.event.currency??this.opts.currency;this.currency=f??"USD";let m=performance.now(),y=Kd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:f,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(i),this.opts.onSeatsRevealed?.()},onSelect:C=>{this.handleRendererSelect(C)},onDeselect:C=>{this.handleRendererDeselect(C)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(C,I)=>{this.opts.onHover?.(C),this.opts.onSeatHover&&this.opts.onSeatHover(C?this.describeSeat(C,I):null)},onFocusSeat:this.opts.onFocusSeat,seatPriceLabel:C=>this.opts.seatPriceLabel?.(C),onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(C,I)=>this.previewSection(C,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:C=>this.opts.onSectionFocus?.(C==null||this.isSectionClosed(C)?null:this.sectionSummary(C)),onDeckTap:C=>this.handleDeckTap(C),onFps:this.opts.onFps});if(n.createRenderer=o(m),this.closed)return y.destroy(),null;this.renderer=y,this.viewportInsets&&y.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&y.setFitClearance?.(this.fitClearance);let p=null,g="free",b=[],S,w=await l;if(w.ok){let C=w.objects;this.hidden=new Set(C.hidden??[]),b=(C.closed??[]).filter(I=>typeof I=="string"),p=C.seats,g=C.default??"free",S=typeof C.fetchedAt=="number"?C.fetchedAt:void 0}if(n.loadStatuses=w.elapsed,this.closed)return y.destroy(),this.renderer=null,null;let k=performance.now();this.opts.categoryPriceRanges&&y.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),y.setChart(this.visibleDoc()),this.applyRowBandPreview(y),fh(y,d.doc,e.clientWidth),this.opts.colorblindSafe&&y.setColorblindSafe?.(!0),n.buildScene=o(k),this.closedSections=new Set(b);let v=performance.now();b.length&&y.setClosedSections?.(b),this.seatsBuilt=!0;let x=this.pendingSnapshot;this.pendingSnapshot=null;let T=Fh(x,p?{seats:p,default:g,fetchedAt:S}:null);T&&this.applySeatsMap(T.seats,T.default,T.source,T.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(v);let P=performance.now();y.forceDraw(),n.firstPaint=o(P);let L=performance.now();return w.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(L),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:No(d.event.status),venueSelling:d.event.venueSelling===!0,eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:f,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:n}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let n of this.renderer.getSelection()){let o=this.groupedTableBySeatId.get(n.id);o?i.has(o.label)||(i.add(o.label),e.push(this.toTableSeat(o))):e.push(this.toSeat(n))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let n of e){let o=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(o)o.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(o.label)||(this.tableQuantities.set(o.label,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(o.label));else{let r=this.seatById.has(n)?n:this.labelToId.get(n);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),n=new Set,o=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?o.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&n.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?o.push(c.label):n.add(l)}}if(o.length&&this.emitError(new Ae(Cn(o))),!n.size)return[];if(this.renderer?.select?.([...n]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...n]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(s=>!i.has(s.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let i=new Set(e);return this.select([...this.seatById.values()].filter(n=>i.has(n.categoryKey)).map(n=>n.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(n=>i.has(n.categoryKey)).map(n=>n.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(n=>typeof n=="string"&&!!n))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(n=>!this.isSelectableByPolicy(n.id)).map(n=>n.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),n=e??i.reduce((o,r)=>o+(r.quantity??1),0);return Mh(i,n,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(n=>n.id));return i.size>0&&Ln(this.seatById.values(),n=>e.getStatus(n),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let n=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(n){n.chairs.forEach(r=>e.add(r.id));continue}let o=this.seatById.has(i)?i:this.labelToId.get(i);o&&e.add(o)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let n=this.groupedTablesByLabel.get(e);if(!n)return!1;let o=n.mode==="whole"?n.capacity:Math.floor(i);if(!Number.isInteger(o)||o<n.minOccupancy||o>n.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??n.minOccupancy;return this.tableQuantities.set(e,o),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(n.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,n){let o=this.groupedTablesByLabel.get(e),r=this.hold_;if(!o||o.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.maxOccupancy)return null;if((r.items??[]).filter(d=>d.label!==e).reduce((d,u)=>d+(u.quantity??1),0)+s>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?s:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,n,r.holdId);return this.tableQuantities.set(e,s),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}setNarrowLayout(e){this.narrowLayout!==e&&(this.narrowLayout=e,this.renderer&&this.applyRowBandPreview(this.renderer))}rowBandsWanted(){return Qg&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(jg||!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 Ae(Cn([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(o=>o.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(o=>o.id)),this.opts.onSelect?.(i.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(i)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let i=this.groupedTableBySeatId.get(e.id),n=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(n)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(n)){this.opts.onDeselect?.(i?{...e,label:n}:e);return}i?(this.renderer?.deselect(i.chairs.map(o=>o.id)),this.hold_?.labels.includes(i.label)||(this.tableQuantities.set(i.label,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(i.label)),this.opts.onDeselect?.(i.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let i of e){let n=this.groupedTablesByLabel.get(i);n&&(this.tableQuantities.set(i,n.mode==="whole"?n.capacity:n.minOccupancy),n.mode==="variable"&&this.confirmedVariableTables.delete(i))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}hold(e,i){return gh(this,e,i)}resumeHold(e){return bh(this,e)}extendHold(e){return yh(this,e)}categoryAvailability(){return sh({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?nh(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(rh(this.getGAAreas(),this.gaSelected,{wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0}))}async holdGA(e,i,n={}){let o=this.visibleDoc();if(!o||!Number.isFinite(i)||i<1)return null;let r=Ct(o).find(d=>d.id===e);if(!r)return null;let s=oh(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 hh(this.visibleDoc())}pickPremiumBlock(e,i,n){return uh({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:n,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:o=>this.seatTierResolution(o).kind!=="invalid",statusOfLabel:o=>this.getStatus(this.labelToId.get(o)??"")??"free",isPremium:o=>!!this.labelToSeat.get(o)?.commercial?.premium})}async bestAvailable(e,i,n={}){let o=this.renderer;if(!o)return null;if(n.preferPremium){let r=this.pickPremiumBlock(e,i,n.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let s=r.map(d=>{let u=this.labelToSeat.get(d),h=u?this.toSeat(u):null;return{label:d,...h?.tierId?{tierId:h.tierId}:{}}}),a=await this.api.hold(this.key,s,n.ttlMs);o.clearSelection();let l=this.idsForLabels(r);l.length&&o.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...r],expiresAt:a.expiresAt,items:a.items});let c=r.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(s){let{status:a,reason:l}=St(s);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),s}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,i,n.zoneId,n.ttlMs);o.clearSelection();let s=this.idsForLabels(r.labels);s.length&&o.setStatus(s,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let a=r.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(r){let{status:s,reason:a}=St(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return Sh(this,e,i,n)}release(){return vh(this)}releaseLabels(e){return wh(this,e)}releaseConfirmed(e,i){return kh(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(o=>o.notForSale).map(o=>o.key));if(!i.size)return[];let n=[];for(let[o,r]of this.seatById)i.has(r.categoryKey)&&n.push(o);return n}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return ui(this._doc?.theme?.seatScale)*J*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){$d(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 Oo(this.pickerFocusContext,e)}accessibilitySpread(e){return qd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Qd(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Jd(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){eh(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);Zd(this.pickerFocusContext,e,n,i),this.opts.onSectionFocus?.(n)}sectionSummary(e){return!this.renderer||!this._doc?null:Eh({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=>Pe(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,e.label),currency:this.currency,...n,...r,...s};let d=this.ownTierPrice(e.label,c.tier);return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l.map(u=>this.ownTierPrice(e.label,u)),tierId:d.id,...n,...r,...s}}toTableSeat(e){let i=e.chairs[0],n=this.tiersFor(e.categoryKey)?.filter(s=>mi(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),o=this.tableTierResolution(e),r=o.kind==="resolved"?this.ownTierPrice(e.label,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,e.label),currency:this.currency,...n?{tiers:n.map(s=>this.ownTierPrice(e.label,s)),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,i){return(i?In(this._doc?.seatPrices,i,null):void 0)??this._doc?.categories.find(o=>o.key===e)?.price??0}ownTierPrice(e,i){let n=In(this._doc?.seatPrices,e,i.id);return n===void 0?i:{...i,price:n}}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=zr(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?mi(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(i=>i.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let i=e.chairs[0]?.id??"";return mi(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let n=this.seatById.get(e);if(!n)return;let o=this.tiersForSeat(n);if(o){if(i==null)this.seatTiers.delete(e);else if(o.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let n of e){let o=this.labelToSeat.get(n);o&&i.push(this.toSeat(o))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return Kr(this._doc,i.map(n=>({label:n.label,...n.tierId?{tierId:n.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?B("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let n=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),o=new Set(e.getSelection().map(s=>s.id));(n&&o.size?Ln(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(B("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return xh(this,e)}handle409Conflicts(e){Lh(this,e)}setHold(e,i="created"){Ch(this,e,i)}clearHold(){Th(this)}expireActiveHold(){return Ih(this)}applySeatsMap(e,i="free",n="http",o){n==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Ah(this.pendingSnapshot,{seats:e,default:i,source:n,...o===void 0?{}:{fetchedAt:o}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=o??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=en(i);this.allIds.length&&r.setStatus(this.allIds,a),r.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let l={free:[],held:[],booked:[],not_for_sale:[]};for(let[d,u]of Object.entries(e))l[en(u)].push(...this.idsForLabel(d));["free","held","booked","not_for_sale"].forEach(d=>{d!==a&&l[d].length&&r.setStatus(l[d],d)});let c=this.notForSaleCategorySeatIds();c.length&&r.setStatus(c,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:s})}snapshotIsFresh(e=5e3){return this.lastSnapshotAt>0&&Date.now()-this.lastSnapshotAt<e}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(i=>this.statusOf(i)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let i=this.socketVersion,n=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(n.seats,n.default??"free","http",n.fetchedAt)},e)}resync(e){return e?.reason==="connect"&&this.snapshotIsFresh()?Promise.resolve():this.resnapshot()}applyProjection(e){this.applySeatsMap(e.exceptions,e.default,"socket")}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,i=lh({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 ah(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=dh(()=>{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),onSales:e=>this.opts.onSalesNotice?.(e),onSections:(e,i)=>{let n=this.syncHidden(e),o=this.syncClosed(i);n&&this.resnapshot(),(n||o)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let n=Object.entries(e);if(n.length!==this.liveStatuses.size)return!0;for(let[o,r]of n)if(this.liveStatuses.get(o)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let n=e.some(s=>this.liveStatuses.get(s.label)!==s.status),o=new Map;for(let s of e){this.liveStatuses.set(s.label,s.status);let a=this.idsForLabel(s.label);if(!a.length)continue;let l=en(s.status);this.opts.flashOnLiveChange&&l!=="free"&&a.some(c=>(o.get(c)??i.getStatus(c))==="free")&&!this.hold_?.labels.includes(s.label)&&a.forEach(c=>i.flashSeat(c,Jg));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}let r=o;if(r?.type==="sales"){typeof r.state=="string"&&this.opts.onSalesNotice?.({state:r.state,revision:Number(r.revision)||0,changedAt:typeof r.changedAt=="number"?r.changedAt:null});return}if(!this.renderer||!o||typeof o!="object")return;let a=o;Array.isArray(a.hidden)&&this.syncHidden(a.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(a.closed)&&this.syncClosed(a.closed)&&this.opts.onStatusChange?.({changed:!0}),a.type!=="hidden"&&(a.seats&&typeof a.seats=="object"?this.applySeatsMap(a.seats):Array.isArray(a.changes)&&this.applyStatusChanges(a.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=ih(e,{baseMs:1e3,maxMs:tb,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var ib=5,nb=-1.1,Ho=35;function Go(t,e){let i=t-Fe,n=Math.atan2(ib-i,e)*180/Math.PI,o=Math.atan2(nb-i,e)*180/Math.PI;return o<-Ho&&(n+=-Ho-o,o=-Ho),{topPitch:n,basePitch:o}}var ne=2048,xe=1024,jt=er,D=Math.PI*2,ob=xe/180,wt=t=>(t+180)/360*ne,Z=t=>(90-t)/180*xe;function Hh(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 on=96,zo=360/on,rb=.6,Wo=[17,23,42];function Vo(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(Wo[0]-t[0])*n),r=Math.round(t[1]+(Wo[1]-t[1])*n),s=Math.round(t[2]+(Wo[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function Bh(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 de(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 Oh=new Map;function Dh(t){if(!t)return null;let e=Oh.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=de(n,.3,.42);return Oh.set(t,o),o}function sb(t,e,i,n){let o=new Array(on).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,u=Math.hypot(c,d)*jt;if(u<1.5||u>95)continue;let h=a.eyeHeightM??Fe,f=h-n;Math.abs(f)>r&&(r=Math.abs(f));let m=Math.atan2(f,u)*180/Math.PI,y=Math.atan2(h-Fe-n,u)*180/Math.PI,g=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,b=Math.min(on-1,Math.max(0,Math.floor((g+180)/zo))),S=m>34&&u<16,w=o[b];w?(m>w.top&&(w.top=m),y<w.base&&(w.base=y),u<w.nearM&&(w.nearM=u,w.tint=Dh(a.categoryKey)),w.overhead=w.overhead||S):o[b]={top:m,base:y,nearM:u,overhead:S,tint:Dh(a.categoryKey)}}return{bins:o,maxDelta:r}}function ab(t,e,i,n){for(let o=0;o<on;o++){let r=e[o];if(!r)continue;let s=-180+o*zo,a=i(s),l=i(s+zo);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),u=n(c),h=n(d);if(h<=u)continue;let f=r.nearM/95,m=r.tint,y=m?Bh([44,54,80],m,.34):[44,54,80],p=m?Bh([24,30,48],m,.28):[24,30,48],g=t.createLinearGradient(0,u,0,h);g.addColorStop(0,Vo(y,f)),g.addColorStop(.24,Vo(p,f)),g.addColorStop(1,Vo([10,13,22],f)),t.fillStyle=g,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-f*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,n(0))-u;if(S>8){let k=1-f*.4;for(let v=1;v<6;v++){let x=u+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*k})`,t.fillRect(a,x,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*k})`,t.fillRect(a,x+1.5,l-a+1,1.2)}}if(r.overhead){let w=n(Math.min(86,c+12)),k=t.createLinearGradient(0,w,0,u);k.addColorStop(0,"rgba(3,4,8,0.9)"),k.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=k,t.fillRect(a,w,l-a+1,u-w),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function lb(t,e,i){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let g of i){a++,g.sectionId&&s.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,w=Math.hypot(b,S)*jt;if(w<.5)continue;let k=Math.atan2(b,-S),v=Math.floor((k+Math.PI)/D*72);v<0?v=0:v>=72&&(v=71),o[v]=!0,w<r[v]&&(r[v]=w)}let l=0,c=[];for(let g=0;g<72;g++)o[g]&&(l++,c.push(r[g]));let d=l/72*360;c.sort((g,b)=>g-b);let u=c.length?c[c.length>>1]:0,h=c.length?c[Math.floor(c.length*.15)]??u:0,f=c.length?c[Math.floor(c.length*.85)]??u:0,m=h>.5?f/h:1,y=Hh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&u>11&&m>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:y,voidRadiusM:u,aspect:m}}var cb=5;function db(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,D),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,D),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,D),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,D),t.fill();break;default:break}}function hb(t,e,i,n,o){let r=n*.44,s=n*o.shoulderK,a=n*.66,l=n*1.68,c=n*5.4,d=`rgba(${o.clothing[0]},${o.clothing[1]},${o.clothing[2]},${o.alpha})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;t.save(),t.translate(e,i);let h=o.lean*n;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-h-n*.6,-s,l-h),t.quadraticCurveTo(-s*1.05,l+n*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+n*1.2,s,l+h),t.quadraticCurveTo(r*1.18,l+h-n*.6,r,a),t.closePath(),t.fill(),t.fillStyle=u,t.fillRect(-r*.82,n*.5,r*1.64,n*.9),t.save(),t.rotate(o.tilt),t.translate(o.turn*n,0),t.fillStyle=u,n>=18?(t.beginPath(),t.moveTo(-n*.9,-n*.15),t.quadraticCurveTo(-n*.96,-n*1.12,0,-n*1.06),t.quadraticCurveTo(n*.96,-n*1.12,n*.9,-n*.15),t.quadraticCurveTo(n*.86,n*.55,n*.36,n*.98),t.quadraticCurveTo(0,n*1.14,-n*.36,n*.98),t.quadraticCurveTo(-n*.86,n*.55,-n*.9,-n*.15),t.closePath(),t.fill(),n>=22&&(t.beginPath(),t.ellipse(-n*.9,n*.18,n*.13,n*.22,0,0,D),t.ellipse(n*.9,n*.18,n*.13,n*.22,0,0,D),t.fill())):(t.beginPath(),t.ellipse(0,0,n*.9,n*1.06,0,0,D),t.fill()),db(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 ub(t,e,i,n,o,r,s){t.fillStyle=`rgba(${o[0]},${o[1]},${o[2]},${s})`,t.beginPath(),t.moveTo(e-n*1.72,i+n*4),t.quadraticCurveTo(e-n*1.78,i+n*1.55,e-n*.46,i+n*1.02),t.lineTo(e-n*.4,i+n*.62),t.lineTo(e+n*.4,i+n*.62),t.lineTo(e+n*.46,i+n*1.02),t.quadraticCurveTo(e+n*1.78,i+n*1.55,e+n*1.72,i+n*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,n*.9,n*1.05,0,0,D),t.fill()}function Xo(t,e,i,n,o){let r=n*.1,s=i-n*.9,a=i-n*.74,l=i-n*.46,c=n*.13,d=n*.09,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,h=t.createRadialGradient(e,i,1,e,i,n*.24);h.addColorStop(0,"rgba(0,0,0,0.4)"),h.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=h,t.beginPath(),t.ellipse(e,i/.28,n*.24,n*.24,0,0,D),t.fill(),t.restore(),t.fillStyle=u,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+n*.02),t.lineTo(e+d*.1,l+n*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-n*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-n*.12,e+c,a),t.quadraticCurveTo(e,a-n*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=n*.055;let f=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,f),t.lineTo(e-d*.4,l-n*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-n*.04,n*.07,n*.09,-.5,0,D),t.fill()):o.pose===3?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=n*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-n*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,f),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,f),t.lineTo(e+c*.95,l+n*.02),t.stroke()),t.fillStyle=u,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,D),t.fill(),o.rimStrength>.01&&(t.strokeStyle=`rgba(${o.rim[0]},${o.rim[1]},${o.rim[2]},${(.6*o.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,n*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function rn(t,e,i,n,o,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,o);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-r,i),t.lineTo(n-s,o),t.lineTo(n+s,o),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function Yo(t,e,i,n,o){let r=t.createRadialGradient(e,i,0,e,i,n*3);r.addColorStop(0,`rgba(${o},0.9)`),r.addColorStop(.4,`rgba(${o},0.35)`),r.addColorStop(1,`rgba(${o},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,n*3,0,D),t.fill(),t.fillStyle=`rgba(${o},1)`,t.beginPath(),t.arc(e,i,n,0,D),t.fill()}function EI(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*jt),c=t.eyeHeightM??Fe,d=lb(t,e,i),u=Gh(d.seed),h=210+u()*150,f=de(220+(u()-.5)*60,.55,.82),m=`${f[0]},${f[1]},${f[2]}`,y=o.createLinearGradient(0,0,0,xe);y.addColorStop(0,"#080b12"),y.addColorStop(.42,"#12182c"),y.addColorStop(.5,"#1c2440"),y.addColorStop(.56,"#151b2c"),y.addColorStop(.78,"#171e30"),y.addColorStop(1,"#131829"),o.fillStyle=y,o.fillRect(0,0,ne,xe);let p=o.createLinearGradient(0,Z(-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,Z(-6),ne,xe-Z(-6));let g=Math.atan2(r,-s),b=sb(t,i,g,c),S=b.maxDelta>=rb;S&&ab(o,b.bins,wt,Z);let w=Math.max(.3,Math.min(1,1-(l-6)/60)),k=Go(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),x=Math.min(45,k.topPitch),T=k.basePitch;d.mode==="sport"?mb(o,l,c,d,w,h,m,u):d.mode==="arena"?fb(o,l,c,d,w,m,u):pb(o,v,x,T,w,h,m,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${m},0.8)`;for(let C=0;C<P;C++){let I=(C+.5)/P*ne,R=Z(d.mode==="sport"?58:54+C*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,D),o.fill()}gb(o,t,i,e,g,c,r,s,S,d);let L=o.createLinearGradient(0,0,0,xe);return L.addColorStop(0,"rgba(0,0,0,0.85)"),L.addColorStop(.12,"rgba(0,0,0,0)"),L.addColorStop(.9,"rgba(0,0,0,0)"),L.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=L,o.fillRect(0,0,ne,xe),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function pb(t,e,i,n,o,r,s,a){let l=wt(-e),c=wt(e),d=Z(i),u=Z(n),h=c-l,f=u-d,m=Z(Math.min(50,i+10)),y=h*(1.1+(1-o)*.5),p=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,y);p.addColorStop(0,"rgba(255, 214, 150, 0.34)"),p.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),p.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),p.addColorStop(1,"rgba(99, 102, 241, 0)"),t.fillStyle=p,t.fillRect(l-h*.6,d-f*1.2,h*2.2,f*3.4);let g=de(r,.62,.55),b=de(r+40,.7,.5),S=de(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,h,f),t.clip();let w=t.createLinearGradient(0,d,0,u);w.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),w.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),w.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=w,t.fillRect(l,d,h,f),t.globalAlpha=1;let k=t.createRadialGradient(ne/2,(d+u)/2,h*.12,ne/2,(d+u)/2,h*.62);k.addColorStop(0,"rgba(6,8,14,0)"),k.addColorStop(.7,"rgba(6,8,14,0.15)"),k.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=k,t.fillRect(l,d,h,f),t.restore();let v=3+Math.floor(a()*3),x=f*.46,T=u-f*.08;for(let A=0;A<v;A++){let _=(A+1)/(v+1),F=l+h*(.22+_*.56+(a()-.5)*.06);Xo(t,F,T,x*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:de(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-h*.5,m,h*.5,u-m),t.fillRect(c,m,h*.5,u-m);let P=h*.055+3,L=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,u),t.lineTo(l-L,m),t.lineTo(l+h*.012,m),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+P,u),t.lineTo(c+L,m),t.lineTo(c-h*.012,m),t.closePath(),t.fill(),t.fillRect(l-L,m,h+L*2,(u-m)*.12);let C=f*.14,I=m+(u-m)*.12;t.fillStyle="rgba(4,6,12,0.96)";let R=7;t.beginPath(),t.moveTo(l-L,I);for(let A=0;A<=R;A++){let _=l-L+(h+L*2)*A/R;t.quadraticCurveTo(_-(h+L*2)/R/2,I+C,_,I)}t.lineTo(c+L,I),t.lineTo(c+L,m),t.lineTo(l-L,m),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,I,1.5,u-I),t.fillRect(c,I,1.5,u-I),t.fillStyle="#0b0f18",t.fillRect(l-P,u-f*.05,h+P*2,f*.05+3);let M=t.createLinearGradient(0,u-f*.05,0,u+f*.12);M.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),M.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=M,t.fillRect(l-P,u-f*.05,h+P*2,f*.2);let E=3+Math.floor(a()*2);for(let A=0;A<E;A++){let _=(A+1)/(E+1),F=l+h*(_+(a()-.5)*.08),N=Z(Math.min(62,i+26)),oe=(a()-.5)*h*.16;rn(t,F,N,F+oe,u,4,h*.09,s,.16*(.7+o*.5)),Yo(t,F,N,2.4,s)}}function fb(t,e,i,n,o,r,s){let a=Math.min(e*.6,Math.max(3,n.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=ne/2,d=1.2,u=Math.max(e*.45,e-a),h=e+a,f=Math.atan2(d-i,u)*180/Math.PI,m=Math.atan2(d-i,h)*180/Math.PI,y=Math.atan2(-i,u)*180/Math.PI,p=Z(f),g=Z(m),b=Z(y),S=wt(l)-c,w=Math.max(6,(p-g)/2),k=(p+g)/2,v=t.createRadialGradient(c,b,4,c,b,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,g-w,S*5.2,b-g+w+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,k),t.ellipse(c,k,S,w,0,Math.PI,0,!1),t.lineTo(c+S,b),t.ellipse(c,b,S,w,0,0,Math.PI,!1),t.closePath(),t.fill();let x=t.createLinearGradient(0,k,0,b);x.addColorStop(0,`rgba(${r},0.14)`),x.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=x,t.fillRect(c-S,k,S*2,b-k);let T=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],P=T[Math.floor(s()*T.length)],L=s()<.5?-1:1,C=X=>c+X.u*L*S*.84,I=X=>k+X.v*w*.8,R=P.find(X=>X.lead)??P[0],M=C(R),E=t.createLinearGradient(0,k-w,0,k+w);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),t.fillStyle=E,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.fill();let A=t.createRadialGradient(M,k,2,M,k,S);A.addColorStop(0,`rgba(255,214,160,${(.5*o).toFixed(3)})`),A.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=A,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.stroke();let _=Math.max(24,(b-g)*1.3),F=P.length>=3?3:2;for(let X=0;X<F;X++){let Le=(-.62+X*.52+(s()-.5)*.12)*-L,Ge=c+Le*S*.7,kt=k-w*(.45+s()*.18),tt=S*(.07+s()*.04),hn=_*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Ge-tt/2,kt-hn,tt,hn),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Ge-tt/2,kt-hn,tt,1.5)}if(P.length>=3){let X=c-R.u*L*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(X,k-w*.34,S*.08,w*.1,0,0,D),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let X of[...P].sort((Le,Ge)=>Le.v-Ge.v)){let Le=.82+(X.v+1)*.14;Xo(t,C(X),I(X),_*Le*(X.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:X.pose,rim:de(40,.72,.8),rimStrength:X.lead?1.4:.9})}let N=Z(Math.min(60,m+34)),oe=w*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,N,S*1.15,oe,0,0,D),t.stroke();let W=4+Math.floor(s()*3);for(let X=0;X<W;X++){let Le=X/W*D,Ge=c+Math.cos(Le)*S*1.15,kt=N+Math.sin(Le)*oe;if(Math.sin(Le)>-.2){let tt=c+(s()-.5)*S*.8;rn(t,Ge,kt,tt,k,3,S*.32,r,.2*(.7+o*.4))}Yo(t,Ge,kt,3,r)}let O=Z(Math.min(52,m+24)),z=Math.max(60,S*.4),re=Math.max(24,z*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-z*.3,O-re/2),t.lineTo(c-z*.16,O-re*2.2),t.moveTo(c+z*.3,O-re/2),t.lineTo(c+z*.16,O-re*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-z/2,O-re/2,z,re);let an=t.createLinearGradient(0,O-re*.3,0,O+re*.42);an.addColorStop(0,`rgba(${r},0.5)`),an.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=an,t.fillRect(c-z*.42,O-re*.3,z*.84,re*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-z/2,O+re/2-2,z,2);let ln=t.createRadialGradient(c,O,4,c,O,z*1.1);ln.addColorStop(0,`rgba(${r},0.2)`),ln.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=ln,t.fillRect(c-z*1.1,O-z*.8,z*2.2,z*1.6);let cn=t.createRadialGradient(c,(N+k)/2,6,c,(N+k)/2,S*1.5);cn.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),cn.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=cn,t.fillRect(c-S*1.5,N-40,S*3,k-N+80),t.restore();let Vh=c+Math.sign(M-c||1)*S*.5;rn(t,Vh,N-oe*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let dn=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);dn.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),dn.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=dn,t.beginPath(),t.ellipse(M,I(R),S*.2,w*.24,0,0,D),t.fill(),t.restore()}function mb(t,e,i,n,o,r,s,a){let l=ne/2,c=Math.max(10,n.voidRadiusM),d=Math.max(2,e-c),u=e+c,h=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),f=Math.atan2(-i,d)*180/Math.PI,m=Math.atan2(-i,u)*180/Math.PI,y=Z(f),p=Z(m),g=wt(h)-l,b=(y+p)/2,S=Math.max(10,(y-p)/2),w=t.createRadialGradient(l,b,4,l,b,g);w.addColorStop(0,"#e8f0fb"),w.addColorStop(.7,"#b9c9e2"),w.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,b,g,S,0,0,D),t.clip(),t.fillStyle=w,t.fillRect(l-g,b-S,g*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,b-S),t.lineTo(l,b+S),t.moveTo(l-g*.5,b-S),t.lineTo(l-g*.5,b+S),t.moveTo(l+g*.5,b-S),t.lineTo(l+g*.5,b+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,b,S*.9,S*.5,0,0,D),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,b,g,S,0,0,D),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let C=0;C<5;C++){let I=l+(a()-.5)*g*1.4,R=b+(a()-.5)*S*1.1,M=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,R,M*.6,M,0,0,D),t.fill()}let k=t.createRadialGradient(l,b,4,l,b,g*1.4);k.addColorStop(0,"rgba(200,220,255,0.12)"),k.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(l-g*1.4,p-S,g*2.8,y-p+S*2),t.restore();let v=Z(Math.min(66,m+60)),x=Math.max(80,g*.7),T=x*.5,P=t.createRadialGradient(l,v,4,l,v,x*1.6);P.addColorStop(0,`rgba(${s},0.3)`),P.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=P,t.fillRect(l-x*1.6,v-x*1.2,x*3.2,x*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-x/2,v-T/2),t.lineTo(l+x/2,v-T/2),t.lineTo(l+x*.6,v),t.lineTo(l+x/2,v+T/2),t.lineTo(l-x/2,v+T/2),t.lineTo(l-x*.6,v),t.closePath(),t.fill();let L=r;for(let C=0;C<3;C++){let I=de(L+C*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=x*.26;t.fillRect(l-x*.42+C*(R+x*.06),v-T*.32,R,T*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let C=0;C<8;C++){let I=l-x*.6+x*1.2*C/7;t.beginPath(),t.arc(I,v+T*.62,2.4,0,D),t.fill()}}function gb(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let y of i){if(y.id===e.id)continue;let p=y.x-e.x,g=y.y-e.y,b=Math.hypot(p,g)*jt;if(d&&y.sectionId===d&&b<3&&p*s+g*a>0&&(u=!0),b<.3||b>32)continue;let w=((Math.atan2(p,-g)-o)*180/Math.PI+540)%360-180,k=l?(y.eyeHeightM??Fe)-r:0,v=Math.atan2(k-.28,b)*180/Math.PI;if(v>10&&b>5)continue;let x=0;for(let L=0;L<y.id.length;L++)x=x*31+y.id.charCodeAt(L)&65535;let T=.9+(x&15)/40,P=Math.min(78,Math.atan2(.16,b)*180/Math.PI*ob*T);P<1.2||h.push({hx:wt(w),hy:Z(v),r:P,d:b,hash:x})}h.sort((y,p)=>p.d-y.d);let f=[];{let y=[...h].sort((b,S)=>b.hy-S.hy),p=[],g=()=>{if(!p.length)return;let b=p.reduce((k,v)=>k+v.d,0)/p.length,S=p.reduce((k,v)=>k+v.hy,0)/p.length,w=p.reduce((k,v)=>k+v.r,0)/p.length;f.push({figs:p.sort((k,v)=>v.d-k.d),d:b,hy:S,r:w}),p=[]};for(let b of y){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),p.push(b)}g()}f.sort((y,p)=>p.d-y.d);let m=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let y of f){if(y.figs.length>=3&&y.r>=1.6&&y.r<26){let p=[],g=[...y.figs].sort((w,k)=>w.hx-k.hx),b=[];for(let w of g){let k=b[b.length-1];k&&w.hx-k.hx>Math.max(14,w.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(w)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-y.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let w of p){let k=w[0].hx-y.r*1.6,v=w[w.length-1].hx+y.r*1.6;t.beginPath(),t.roundRect(k,y.hy+y.r*.8,v-k,y.r*2.4,y.r*.8),t.fill()}}}for(let p of y.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),b=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+b,17+(p.hash>>4&6)+b,25+(p.hash>>4&6)+b],w=m[p.hash%m.length],k=[w[0]+b,w[1]+b,w[2]+b];if(p.r>=13){let v=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;hb(t,p.hx,p.hy,p.r,{tone:S,clothing:k,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%cb,rim:v,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?ub(t,p.hx,p.hy,p.r,k,S,g):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,D),t.fill(),t.beginPath(),t.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),t.fill())}}if(u){let y=Z(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,y,ne,xe-y),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let b=(g+.5)/p*ne;t.beginPath(),t.ellipse(b,y+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var ue=480,vt=270,Ko=50,et=30,Nh=t=>(t+Ko)/(2*Ko)*ue,Qt=t=>(et-t)/(2*et)*vt;function AI(t,e,i){let n=document.createElement("canvas");n.width=ue,n.height=vt;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*jt),l=Gh(Hh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=de(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=o.createLinearGradient(0,0,0,vt);h.addColorStop(0,"#080b12"),h.addColorStop(.44,"#151c32"),h.addColorStop(.5,"#1d2644"),h.addColorStop(.58,"#161c2e"),h.addColorStop(1,"#131829"),o.fillStyle=h,o.fillRect(0,0,ue,vt);let f=t.eyeHeightM??Fe,m=Go(f,a),y=Math.min(Ko-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(et-2,m.topPitch),g=Math.max(-et+2,m.basePitch),b=Nh(-y),S=Nh(y),w=Qt(p),k=Qt(g),v=S-b,x=k-w,T=Math.max(.35,Math.min(1,1-(a-6)/60)),P=Qt(Math.min(et-1,p+8)),L=o.createRadialGradient(ue/2,(w+k)/2,4,ue/2,(w+k)/2,v*1.15);L.addColorStop(0,"rgba(255,214,150,0.34)"),L.addColorStop(.28,"rgba(150,150,230,0.3)"),L.addColorStop(.6,"rgba(99,102,241,0.12)"),L.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=L,o.fillRect(b-v*.6,w-x*1.2,v*2.2,x*3.4);let C=de(c,.62,.55),I=de(c+40,.7,.5),R=de(c+70,.78,.52);o.save(),o.beginPath(),o.rect(b,w,v,x),o.clip();let M=o.createLinearGradient(0,w,0,k);M.addColorStop(0,`rgb(${C[0]},${C[1]},${C[2]})`),M.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),M.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),o.globalAlpha=.8,o.fillStyle=M,o.fillRect(b,w,v,x),o.globalAlpha=1;let E=o.createRadialGradient(ue/2,(w+k)/2,v*.12,ue/2,(w+k)/2,v*.6);E.addColorStop(0,"rgba(6,8,14,0)"),E.addColorStop(.7,"rgba(6,8,14,0.15)"),E.addColorStop(1,"rgba(5,6,11,0.9)"),o.fillStyle=E,o.fillRect(b,w,v,x),o.restore();let A=3,_=k-x*.08;for(let W=0;W<A;W++){let O=(W+1)/(A+1);Xo(o,b+v*(.24+O*.52),_,x*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:de(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(b-v*.5,P,v*.5,k-P),o.fillRect(S,P,v*.5,k-P);let F=v*.05+2,N=F*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(b,k),o.lineTo(b-F,k),o.lineTo(b-N,P),o.lineTo(b+v*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,k),o.lineTo(S+F,k),o.lineTo(S+N,P),o.lineTo(S-v*.012,P),o.closePath(),o.fill(),o.fillRect(b-N,P,v+N*2,(k-P)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(b-1.2,P,1.2,k-P),o.fillRect(S,P,1.2,k-P),o.fillStyle="#0b0f18",o.fillRect(b-F,k-x*.05,v+F*2,x*.05+2);let oe=o.createLinearGradient(0,k-x*.05,0,k+x*.14);oe.addColorStop(0,`rgba(255,206,140,${(.5*T).toFixed(3)})`),oe.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=oe,o.fillRect(b-F,k-x*.05,v+F*2,x*.22);for(let W=0;W<3;W++){let O=(W+1)/4,z=b+v*O,re=Qt(Math.min(et-1,p+20));rn(o,z,re,z+(l()-.5)*v*.14,k,3,v*.09,u,.17*T),Yo(o,z,re,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let W=0;W<8;W++)o.beginPath(),o.arc((W+.5)/8*ue,Qt(et-4-W%2*3),2.2,0,D),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,vt-26,ue,26),o.fillStyle="rgba(30,37,54,0.9)";for(let W=0;W<9;W++){let O=W*(ue/9)+ue/18;o.beginPath(),o.ellipse(O,vt-22,ue/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:n.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Wh=new Set(["en"]),sn=new Map;async function bb(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await Ur(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-M2TUVL75.js"),i=e[t];return i?await i():null}async function OI(t,e){let i=ca(t,e);if(i==="en"||Wh.has(i))return dt(i),i;if(!la.includes(i))return dt("en"),"en";try{let n=sn.get(i);n||(n=bb(i),sn.set(i,n));let o=await n;return sn.delete(i),o?(dt(i,o),Wh.add(i),i):(dt("en"),"en")}catch{return sn.delete(i),dt("en"),"en"}}export{wb as ACCESSIBILITY_RING_COLOR,$o as ACCESSIBILITY_TYPES,my as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,fy as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,Pb as BOOTH_TYPES,Sb as CHART_STORAGE_KEY,rS as CURRENCY_CHOICES,nS as DEFAULT_CURRENCY,Ab as DEFAULT_EVENT_INVENTORY_LIMIT,ET as EMPTY_AVAILABILITY_REFRESH,Ob as EVENT_CONFIGURATION_EXPORT_SCHEMA,Bb as EVENT_CONFIGURATION_SCHEMA,dy as FLOOR_COVER_LIMIT,ay as FLOOR_STACK_GAP_RATIO,py as FLOOR_STACK_MIN_SURFACE_PX,by as GA_UNIT_LABEL_PREFIX,MT as HOLD_CLOCK_SKEW_MS,Pn as LABEL_FADE_MS,Tb as LABEL_STYLE_MAX_SIZE,Cb as LABEL_STYLE_MIN_SIZE,Fb as LARGE_VENUE_INVENTORY_MODULE,Hy as LEGIBILITY_HYSTERESIS_PX,hy as LEVEL_CONTEXT_PREFIX,fS as LOCALE_NAMES,Eb as MAX_EVENT_INVENTORY,Sy as MAX_GA_CAPACITY,xy as MAX_ONE_PARTY_GUESTS,ci as MIN_POINTER_TARGET_PX,Ly as ONE_PARTY_LIMIT_MESSAGE,_h as PickerController,Ae as PickerSelectionError,_y as RENDERED_QUALITY_REPORT_VERSION,Ib as ROW_AISLE_SEATS,xb as SEAT_COMMERCIAL_MARKS,Py as SEAT_TYPE_ICON_BODY,gn as SEAT_TYPE_ICON_VIEWBOX,yb as STAGE_LABEL_STYLE_MAX_SIZE,Bu as SUPPORTED_LOCALES,Rb as SURROUNDINGS_SHAPE_ROLES,_o as SeatmapRenderer,Yb as TABLE_SEAT_OFFSET,Kb as TIER_HEIGHT_M,la as TRANSLATED_LOCALES,mr as UNGROUPED_ID,ah as accessNeedsFor,Iy as accessibilityLabelKey,vb as accessibilityMeta,kb as accessibilityRingColor,ii as allObjects,Sr as applyHidden,Eg as applyOrganizerSeatGlyph,No as asPickerSalesState,dh as attachVisibilityCatchUp,gy as automaticRoundTableRadius,Wb as canTransitionEventConfiguration,Hb as canonicalEventConfigurationJson,rr as chartBounds,Yd as clearOrganizerSeatGlyph,lr as combinedFloorZoneId,Rt as compactRowLabel,yr as computeSections,Ey as computeSectionsPerFloor,Kd as createRenderer,$r as crossesThreshold,Fu as currencyExponent,lS as currencySymbol,it as effectiveFloorOverview,_b as eventInventoryLimitFor,ty as expandBooth,We as expandChart,Zb as expandRow,qb as expandRowSlots,ey as expandTable,jb as expandTableSlots,ry as floorObjects,ly as floorStackPlacements,ti as floorsOf,vS as formatDate,aS as formatMinor,ce as formatMoney,_u as fromMinorUnits,Ct as gaAreasOf,pn as gaBoxBounds,un as gaBoxMode,ky as gaInventorySegments,vy as gaUnitLabel,Cy as gaUnitLabels,fn as gaUnitLabelsForModel,Lt as gaWheelchairPlaceCount,mn as gaWheelchairUnitLabels,EI as generateSeatPanorama,AI as generateSeatThumb,mS as getLocale,Ty as growJoinedGAInventory,Fy as hiddenObjectIds,Kg as holdHasLapsed,FT as holdRecoveryShape,Mn as hysteresisScale,ur as initialFloorMode,Gb as inspectEventConfigurationCompatibility,By as inspectRenderedQualityEvidence,yy as isGaUnitLabel,bS as isLocaleLoaded,Xd as isOrganizerGlyphPainted,Ay as isSectionHidden,Mb as layerOf,dr as layoutCombinedFloorPlan,cr as layoutFloorStack,hr as levelContextOutlines,OI as loadLocale,gS as localeDirection,uy as mainFloorId,zb as migrateLegacyEventConfigurations,sS as numberLocale,ny as objectCenter,yS as onLocaleChange,Ng as ownPriceRings,oy as owningSectionForObject,Nb as parseEventConfigurationExport,Db as parseEventConfigurationVersion,Jt as pointInPolygon,te as pointInPolygonWithHoles,iy as pointOnPolygonBoundary,ei as polygonLabelPoint,lh as reconcileAvailability,AT as refreshChangedSomething,Rn as renderedPx,oS as resolveCurrency,Vb as resolveEventConfigurationRollback,ca as resolveLocale,$b as rowInventoryCount,Ub as rowSeatPositions,Oy as seatBasePrice,Lb as seatCommercialMeta,pr as seatNoteRowModel,Tn as seatPriceEntry,In as seatPriceFor,Dy as seatPriceRange,fr as seatTypeIconBody,Ry as seatTypeIconSvg,nt as sectionEntrancesById,Xb as sectionGeometry,My as sectionIdentitiesById,gr as sectionLabelsById,br as sectionOwnersByObject,dt as setLocale,aa as setMoneyLocale,SS as setStringOverrides,ch as shouldWaitForHoldExpiry,or as stackFloors,cy as suggestedFloorOverview,B as t,ha as tCount,Jb as tableInventoryCount,Qb as tableSeatCountsBySide,sy as translateObject,nr as usableHoles,wy as validGAInventorySegments,Gy as zoomTowardPoint};
1
+ import{a as Cn,c as Tn,e as Xr,f as mi,h as Yr,j as Ur,m as $r}from"./chunk-ZYQXT5JP.js";import{a as By,b as ci,c as Oy}from"./chunk-GPZFVQXV.js";import{a as ly,b as dr,c as cy,d as hr,e as ur,f as nt,g as dy,h as hy,i as uy,j as pr,k as py,l as fy,m as fr,o as _r,r as at}from"./chunk-MRLWH6RC.js";import{d as qr}from"./chunk-TGHNVDWA.js";import{a as bn,b as Ry,c as gr,d as My}from"./chunk-YPVYZYMH.js";import{a as Py,b as mr,c as Rt,d as Nr,e as Hr,f as Gr,g as Wr}from"./chunk-WKWXU5QM.js";import{b as Fr,e as kn,i as ui,k as Kr}from"./chunk-FBXZWNND.js";import{b as di,f as Rr,h as st,i as Mr,j as Er,l as Ar}from"./chunk-4N5CHKHD.js";import{A as zr,b as Mt,c as pi,d as xn,e as Br,f as Or,g as Ln,l as Dr,n as fi,z as Vr}from"./chunk-33SRM2CP.js";import{A as Pr,B as Ye,C as wn,D as ai,E as Y,F as he,G as li,a as ge,b as xr,c as ze,e as be,f as oi,g as ri,h as Lr,i as It,j as Ke,k as Xe,l as V,n as Cr,p as Tr,q as Ir,s as ye,t as Se,w as rt,x as Pt,y as si}from"./chunk-JRZHC75P.js";import{a as my,b as gy,c as by,f as hi}from"./chunk-UNSAUDO2.js";import{b as lr,c as cr,l as xt}from"./chunk-M4NGX5NM.js";import{b as Sb,c as qo,d as vb,e as Zo,f as wb,g as kb,h as xb,i as Lb,j as Cb,k as Tb,l as Ib,m as Pb,n as Rb,o as Mb,p as Eb}from"./chunk-UEDS3HJ3.js";import{a as yy,b as Sy,c as vy,d as wy,e as ky,f as xy,g as Ly,h as Cy,i as pn,j as fn,k as Ty,l as mn,m as Lt,n as gn,o as Iy,p as Ct,q as br,r as Ey,s as ot,t as yr,u as Sr,v as vr,w as Ay,x as Fy,y as _y,z as wr}from"./chunk-UUIZHJYL.js";import{$a as ti,Ga as nr,Ia as or,J as Qo,Ka as Ub,L as jo,La as $b,Ma as qb,N as q,Na as Zb,Oa as Qb,Pa as jb,Qa as Jb,Ra as ey,Sa as ty,Ta as iy,Ua as Jt,Va as ny,Wa as rr,Xa as te,Ya as ei,Za as oy,_a as ry,ab as sy,ba as Jo,bb as ii,ca as er,cb as ay,d as Ab,da as tr,db as sr,e as Fb,eb as Ve,f as _b,fb as ar,g as Bb,h as Ob,i as Db,j as Nb,k as Hb,ka as ir,l as Gb,m as Wb,ma as Xb,n as Vb,o as zb,p as Kb,ua as _e,va as Yb}from"./chunk-YE4NP3XB.js";import"./chunk-S3VH7IDA.js";import{C as G,c as yn,h as Sn,m as Tt,o as kr,t as H,u as se,v as Be,w as j,x as ni,z as vn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";function In(t,e){return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function Pn(t,e,i){let n=In(t,e);if(n!==void 0)return typeof n=="number"?n:i&&Object.prototype.hasOwnProperty.call(n.tiers,i)?n.tiers[i]:void 0}function Dy(t,e){if(typeof t=="number")return t;let i=e?.tiers?.[0]?.id;return i!==void 0?t.tiers[i]:Object.values(t.tiers)[0]}function Ny(t){let e=1/0,i=-1/0;for(let n of Object.values(t??{}))for(let o of typeof n=="number"?[n]:Object.values(n.tiers))o<e&&(e=o),o>i&&(i=o);return e===1/0?null:{min:e,max:i}}var Gy=1,Rn=90;function Mn(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Zr(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 En(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 Wy(t){let{point:e,camera:i,scale:n,nextScale:o}=t;if(!Number.isFinite(n)||n<=0||!Number.isFinite(o))return{...i};let r=(e.x-i.x)/n,s=(e.y-i.y)/n;return{x:e.x-r*o,y:e.y-s*o}}import{Konva as Ji}from"konva/lib/Core";import{Stage as Ig}from"konva/lib/Stage";import{Layer as _o}from"konva/lib/Layer";import{Group as qt}from"konva/lib/Group";import{Circle as Xd}from"konva/lib/shapes/Circle";import{Group as $n}from"konva/lib/Group";import{Circle as Ne}from"konva/lib/shapes/Circle";import{Line as Qn}from"konva/lib/shapes/Line";import{Rect as qn}from"konva/lib/shapes/Rect";import{Text as ya}from"konva/lib/shapes/Text";var J=9,ve=.9,Q=.55*ve,ie=V/ge,lt=4,pe=14,Qr=10;var jr=14;var Ce=.45*ve,we=.9*ve,ae=(Ce+we)/2,Jr=Math.max(ve*1.1,we),ke=8,es=700,ee=2,ts=3,Et=V,Kh=12,Xh=12;function is(t){return t<U?Xh:Kh}var gi=.85,ns=V,At=64,Ue=.55*Ce,os=700,rs=120,ss=2500,as=420,ls=420,cs=1,$e=1,ds=2,ct=16,Oe=12,An=[.85,.72,.62],Yh=10,Uh=9;function bi(t){return t<U?Uh:Yh}var yi=13,Si=12,hs=0,us="600",ps="500",fs=8,ms=5,gs=10,bs=6,ys=8,Ss=.6,vs=.7,ws=[0,18,-18,36,-36,54,-54],Te="600",ks="500",U=640,xs=Te,Ls="400",De=0,Cs=14,Ts=.34,Is=.92,Ps=7,Rs=3;function vi(t){return Math.min(1,Math.max(Oe/ct,t/900))}function dt(t,e){return Math.max(Oe,t*vi(e))}var $h=.5,qh=1.15,Ms=2,Es=3,As=22,Zh=8,Qh=6;function Ft(t){return t<U?Qh:Zh}var Fn=.08;function _n(t,e,i,n,o=$h,r=Oe){let s=t*vi(e),a=Math.max(r*(1+Fn),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*qh);return Math.min(c,a*l)}var Fs=.1,_t=1.02;var wi=1.25;function _s(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var jh="#e5e7eb",Jh="#c7cbd1",eu="#6b7280",tu=["#6b7280","#5b6470","#4b5563","#374151"],iu=["#cbd5e1","#e2e8f0","#f8fafc"],nu="#d1d5db",ou="#b8bdc4",ru="#273142",su="#526078",au="#f1f5f9",lu="#374151",cu="#64748b",du="#111827",Bs="#6b7280",Os="#374151";var Ds="#4b5563",Ns=.4,Ie=.16,Hs="rgba(244,246,248,0.06)",ki=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Gs(t,e,i){let n=new Map;for(let s of t){let a=e(s);!a||i(a)||n.set(a,(n.get(a)??0)+1)}let o=null,r=0;for(let[s,a]of n)(a>r||a===r&&o!=null&&s<o)&&(o=s,r=a);return o}function le(t){return H(t)?{sectionFill:jh,sectionStroke:Jh,sectionInk:eu,focalFill:nu,focalStroke:ou}:{sectionFill:ru,sectionStroke:su,sectionInk:au,focalFill:lu,focalStroke:cu}}function Bn(t,e){let i=t.sectionFill,n=H(i),o=n?se(i,.6):vn(Be(i,.2),.85);switch(e){case"closed":return n?se(i,.4):Be(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Ws=.28,Vs=.42,hu=.55,uu=.7;function zs(t,e,i){let n=le(t),o=Bn(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=H(t);return{fill:j(o,i,r?Vs:Ws),stroke:G(i,r?uu:hu)}}var pu=.03;function Ks(t,e){let i=le(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>Bn(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&On(t,e)}function On(t,e){let i=yn(e);if(!i)return!1;let n=le(t),o=Math.max(Ws,Vs)+pu;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=yn(Bn(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 fu="#f8fafc",mu="#f4f6fb",gu="#111827",bu=.72;function Xs(t){let e=H(t),i=e?fu:du,n=e?gu:mu,o=j(n,i,1-bu);return{plate:i,ink:n,subInk:Tt(o,i)>=kr?o:n}}function Ys(t,e,i,n){if(e)return e;let o=H(i)?iu:tu;for(let r of[i,...o])if(Tt(r,t)>=n)return r;return he(t,e,i,n)}var yu=.45,Su=.3,vu=.1,wu=5;function Us(t,e,i){let n=H(e)?Be:se,o=vn(n(t,yu),Su);for(let r=0;r<wu;r+=1){if(Tt(o,e)>=i)return o;o=n(o,vu)}return Tt(o,e)>=i?o:he(e,null,o,i)}import{Shape as xu}from"konva/lib/Shape";import{Circle as Lu}from"konva/lib/shapes/Circle";import{Rect as Cu}from"konva/lib/shapes/Rect";var ku={M:2,L:2,Q:4,C:6,Z:0},Dn=new Map;function Nn(t){let e=Dn.get(t);if(e)return e;let i=st(t);if(!i)return Dn.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=ku[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 Dn.set(t,o),o}function $s(t,e,i,n=0,o=0){let r=Nn(e),s=Rr(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=Mr(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 qs(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var qe=class extends xu{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=Nn(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){qs(e,i),e.fillStrokeShape(this);return}e.beginPath(),$s(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){qs(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 Hn(t,e){return t==="circle"||!st(t)?null:new qe({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 Zs(t){let{x:e,y:i,radius:n}=t;return t.wheelchairBay?new Cu({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}):Hn(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new Lu({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Tu(t,e){return t*2*e>=16}function Qs(t,e,i,n){let o=Tu(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function xi(t){return t?.35:.3}function ea(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 Gn(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 ta=700,Iu=2400,Wn=12,ia=30,js=1,Pu=1.16,Js=.5,Ru=1;function Vn(t){return t*.61803398875%1}function na(t,e){let n=((t/Iu+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:js+(Pu-js)*o,opacity:Js+(Ru-Js)*o}}var ra;function sa(t){ra=t}function Mu(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var oa=new Map;function Eu(t,e){let i=t??ra,n=`${i??""}|${JSON.stringify(e)}`,o=oa.get(n);return o||(o=new Intl.DateTimeFormat(i,e),oa.set(n,o)),o}var Au={dateStyle:"medium",timeStyle:"short"};function aa(t,e={}){let{locale:i,...n}=e,o=Mu(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:Au;return Eu(i,r).format(o)}var oS="USD";function rS(t,e){return t?.trim()||e?.trim()||"USD"}var sS=["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"],Kn;function ca(t){Kn=t}function aS(){return Kn??"en"}var la=new Map;function zn(t,e,i,n){let o=n??Kn,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=la.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),la.set(r,s)),s}function ce(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return zn(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 zn(e,o,o,n).format(t)}var Fu={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 _u(t="USD"){return Fu[t.toUpperCase()]??2}function Bu(t,e="USD"){return t/10**_u(e)}function lS(t,e="USD",i){return ce(Bu(t,e),e,void 0,i)}function cS(t="USD"){return zn(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Bt={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired and the seats were released. Pick again.","picker.holdExpiredTitle":"Your seats were released","picker.holdExpiredBody":"Your hold time ran out and the seats went back on sale.","picker.holdExpiredRestart":"Choose seats again","picker.holdExpiredPickAgain":"Pick your seats again to continue. They may already be taken.","picker.releasedPair":"{first} \xB7 {second}","picker.releasedSeatPlace":"Section {section}, Row {row}, Seat {seat}","picker.releasedSeatRange":"Section {section}, Row {row}, Seats {from}\u2013{to}","picker.releasedInSection":"{seats} in Section {section}","picker.releasedInSections":"{seats} in Sections {sections}","picker.releasedGa":"{quantity} \xD7 {area}","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.testModeExplained":"Bookings here are not real and no card is charged","picker.findClosestSeatsTogether":"Find the closest seats together","picker.findSeatsTogether":"Find seats together","picker.addSeat":"Add seat","picker.removeSeat":"Remove seat","picker.added":"Added","picker.findSeats":"Find seats","picker.findBestSeats":"Find best seats","picker.displayOptions":"Display options","picker.closeVenueNavigation":"Close venue navigation","picker.orphanHint":"This leaves a single seat stranded. Consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.noWheelchairSpace":"NO WHEELCHAIR SPACE","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview: groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks: sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats: blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.aisleSeat":"Aisle seat","picker.boothType.inline":"Inline booth \xB7 1 open side","picker.boothType.corner":"Corner booth \xB7 2 open sides","picker.boothType.peninsula":"Peninsula booth \xB7 3 open sides","picker.boothType.island":"Island booth \xB7 4 open sides","picker.gaBookWholeArea":"Book the whole area","picker.gaBook":"Book","picker.noWheelchairSpace":"No wheelchair space","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count}. Showing best overall","picker.loading3d":"Building the 3D venue\u2026","picker.unavailable3d":"3D could not start. The seat map is still available.","picker.jumpToSection":"Jump to section","picker.salesClosedPill":"Sales are closed","picker.salesClosedCopy":"Ticket sales for this event have ended.","picker.salesNotOpenPill":"Sales haven\u2019t opened yet","picker.salesNotOpenCopy":"Tickets for this event aren\u2019t on sale yet.","picker.salesPausedPill":"Sales are paused","picker.salesPausedCopy":"Ticket sales are paused for now.","picker.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.salesCloseTitle":"Online sales have closed","picker.salesCloseVenue":"You can still buy tickets at the venue box office.","picker.salesCloseHeld.one":"Your {count} seat is still held for you. Finish paying to keep it.","picker.salesCloseHeld.other":"Your {count} seats are still held for you. Finish paying to keep them.","picker.salesCloseTap":"Seats can\u2019t be picked: online sales have closed","picker.salesCloseSwitch":"Online sales just closed. The seat map is now view-only.","picker.eventEndedTitle":"This event has ended","picker.eventEndedWhen":"It was on {date} at {time}.","picker.eventEndedToast":"This event has ended.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total}. You won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types. Tap one below to show just those seats.","picker.aboutTicketPrices":"About ticket prices","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now.","picker.accessExpiredTitle":"The seat map timed out","picker.accessInvalidBody":"You can still book anything shown as available. Contact whoever sent you here for access to the rest.","picker.accessInvalidTitle":"We couldn\u2019t verify your access","picker.accessPausedBody":"The organizer has paused this selection. Try again in a few minutes.","picker.accessPausedTitle":"These seats are on hold right now","picker.accessRefresh":"Refresh","picker.accessRetry":"Try again","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.idlePausedBody":"You were away for a while. Refresh to see which seats are free now.","picker.idlePausedTitle":"Your session expired","picker.idleRefresh":"Show latest seats","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addMinutes":"+{count} min","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Zones","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held. Please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.aboutBestSeats":"About finding seats together","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessSpreadHint":"{count} accessible spaces in {sections} sections \xB7 tap a highlighted section","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time. Please head to checkout now.","picker.savedSeatsNotRestored":"Your earlier seats could not be restored. Please choose again.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.dragToLookTouch":"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close","picker.dragToLookMouse":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party \xB7 {typeWord}","picker.fullScreen":"Full screen","picker.generalAdmission":"General admission","picker.guestCountCouldNotBeSecured":"That guest count could not be secured. Your current table hold is unchanged.","picker.guestCountNoLongerAvailable":"That guest count is no longer available. Your current hold is unchanged.","picker.guests":"Guests","picker.guestsCount":"{count} guests","picker.guestsCountEdit":"{count} guests \xB7 Edit","picker.held":"Held","picker.heldByOther":"Held by another buyer, may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.hidePanel":"Hide panel","picker.hideTicketPanel":"Hide the ticket panel","picker.holdSeatsAndCheckout":"Hold seats & checkout","picker.howOfferWorks":"How the {name} offer works","picker.interactive3dVenueView":"Interactive 3D venue view","picker.keepMine":"Keep mine","picker.labelNoLongerAvailable":"{label} is no longer available.","picker.labelRemoved":"{label} removed.","picker.labelRemovedFromHold":"{label} removed from your hold.","picker.labelRestored":"{label} restored.","picker.labelsNoLongerAvailable.one":"{labels} is no longer available. Choose another seat.","picker.labelsNoLongerAvailable.other":"{labels} are no longer available. Choose another group.","picker.leftCount.one":"{count} left","picker.leftCount.other":"{count} left","picker.levelNumber":"Level {number}","picker.levels":"Levels","picker.loadingSeatMap":"Loading seat map\u2026","picker.lookAroundLive3d":"Look around in live 3D","picker.manualTicketsRemovedNote":"Your manually selected tickets will be removed only after a new group is secured.","picker.map":"Map","picker.mapDidNotLoad":"The seat map didn\u2019t load","picker.eventUnavailableTitle":"This event isn\u2019t available","picker.eventUnavailable":"Tickets can\u2019t be booked here right now.","picker.maxTicketsForOrder":"You can select up to {count} tickets for this order.","picker.selectExactMore":"Select {count} more","picker.selectExactCount":"Select exactly {count} tickets","picker.selectMinimumMore":"Select {count} more","picker.adjustSeatSelection":"Adjust seat selection","picker.selectSeatsTogether":"Choose seats together in the same row and ticket category.","picker.minToMaxGuests":"{min} to {max} guests","picker.more":"More","picker.moreCount":"+{count} more","picker.showLess":"Show less","picker.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreTimeAdded":"More time added. Your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notForSale":"Not for sale","picker.notAvailable":"Not available","picker.seatUnavailableNote":"This seat isn't available.","picker.notForSaleExplanation":"This seat is not included in the current sale.","picker.numberOfGuests":"Number of guests","picker.offerDetailActive":"This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over.","picker.offerDetailUpcoming":"Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts.","picker.offerRemainingAvailable":"{count} available","picker.offerStarts":"starts {time}","picker.offerUntil":"until {time}","picker.oneSeatSaved":"1 seat saved","picker.oneSeatSavedChooseAnother":"One seat saved; choose another to compare","picker.openAuthored360":"Open venue 360\xB0","picker.openComparison":"Open comparison","picker.openComparisonOfSeats":"Open comparison of {count} seats","picker.openTicketPanel":"Open ticket panel","picker.peekFromPrice":"From {price}","picker.peekTicketsTotal.one":"{count} ticket \xB7 {total}","picker.peekTicketsTotal.other":"{count} tickets \xB7 {total}","picker.perGuestPrice":"{price} per guest","picker.pickYourSeats":"Pick your seats","picker.preferredTicketType":"Preferred ticket type","picker.preferredVenueZone":"Preferred venue zone","picker.priceNotSupplied":"Price not supplied","picker.removeHeldTicketLabel":"Remove held ticket {label}","picker.removeSeatLabel":"Remove {label}","picker.removeTicketsUntilOrFewer":"Remove tickets until your order has {count} or fewer.","picker.replaceCurrentChoices":"Replace your current choices?","picker.review":"Review","picker.row":"Row","picker.rowLabel":"Row {label}","picker.saveToCompare":"Save to compare","picker.savedForComparison":"Saved for comparison","picker.savedSeatComparison":"Saved seat comparison","picker.scheduledOffer":"Scheduled offer","picker.seat":"Seat","picker.seatCount.one":"{count} seat","picker.seatCount.other":"{count} seats","picker.seatJustTakenByAnother":"Seat {label} was just taken by another buyer.","picker.seatLabel":"Seat {label}","picker.seatNoLongerAvailable":"That seat is no longer available.","picker.seatNoLongerYours":"Some seats are no longer available to you. They have been removed from your order.","picker.seatNumberLower":"seat {label}","picker.seatSalesClosedForEvent":"Seat sales have closed for this event.","picker.maintenancePaused.one":"Booking is paused for maintenance. Please try again in about {count} minute.","picker.maintenancePaused.other":"Booking is paused for maintenance. Please try again in about {count} minutes.","picker.maintenancePausedShortly":"Booking is paused for a few minutes for maintenance. Please try again shortly.","picker.seatSelection":"Seat selection","picker.seatStatusLegend":"Seat status legend","picker.seatTaken":"Someone else took a seat you had picked. It has been removed from your order.","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.seeItIn3d":"See it in 3D","picker.select":"Select","picker.selectSeats":"Select seats","picker.selectTable":"Select table","picker.selectWholeTable":"Select whole table","picker.selected":"Selected","picker.selectingEllipsis":"Selecting\u2026","picker.showAllSeats":"Show all seats","picker.showAllTicketTypes":"Show all {count} ticket types","picker.showFewer":"Show fewer","picker.showLabelSeatsOnMap":"Show {label} seats on the map","picker.showTicketPanel":"Show the ticket panel","picker.sold":"Sold","picker.soldOutCopy":"No reserved seats are currently available for this event.","picker.soldOutEyebrow":"This event","picker.soldOutTitle":"Sold out","picker.soldSeatExplanation":"This seat has already been booked.","picker.statusAvailable":"available","picker.statusOnHold":"on hold","picker.statusTaken2":"taken","picker.table":"Table","picker.tableCapacity":"Table capacity","picker.tableUpdatedForGuests":"{label} updated for {count} guests.","picker.temporarilyHeld":"Temporarily held","picker.ticketPrices":"Ticket prices","picker.ticketTypeNotChanged":"That ticket type is not available for this seat. Your hold is unchanged.","picker.ticketTypeSoldOut":"That ticket type is sold out. Try another ticket type.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} ticket","picker.ticketsCount.other":"{count} tickets","picker.toggleColorblindColors":"Toggle colorblind-friendly colors","picker.total":"Total","picker.trayHintTapOrBest":"Tap a seat on the map, or let us pick the best available for you.","picker.aboutYourSeats":"How to choose seats","picker.trayHintTapOrStanding":"Tap a seat on the map or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating\u2026","picker.venueView":"Venue view","picker.recentreOnStage":"Recentre on the stage","picker.stopYourSeat":"Your seat","picker.stopYourRow":"Your row","picker.stopYourSection":"Your section","picker.stopWholeVenue":"Whole venue","picker.viewFromHere":"View from here","picker.viewFromYourSeat":"view from your seat","picker.fromYourSeat":"from your seat","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We\u2019ll choose the closest available group for you.","picker.willFindSeatsTogether":"We\u2019ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.fitWholeVenue":"Show whole venue","picker.dragToRotateVenue":"Drag to rotate the venue","picker.dragToMoveVenue":"Drag to move the venue","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & zones","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances","checkout.free":"Free","checkout.confirmBooking":"Confirm booking","checkout.price":"Price","checkout.freeNote":"This event is free. Nothing is charged.","checkout.confirmingBooking":"Confirming your booking\u2026","checkout.confirmingSeats":"Confirming your seats\u2026","checkout.busyRetryingBooking":"Busy right now. Still confirming your booking\u2026","checkout.busyRetryingPayment":"Busy right now. Still opening secure payment\u2026","checkout.busyFailedBooking":"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.busyFailedPayment":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.seatsUnavailable":"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.","checkout.title":"Checkout","checkout.back":"Back to seats","checkout.heldFor":"Seats held for {time}","checkout.yourOrder":"Your order","checkout.row":"Row {row}","checkout.seat":"Seat {seat}","checkout.quantity":"{label} \xD7 {count}","checkout.showAll":"Show all {count} seats","checkout.yourDetails":"Your details","checkout.email":"Email","checkout.emailHint":"Your tickets are sent here.","checkout.name":"Name","checkout.namePlaceholder":"Your name","checkout.optional":"Optional","checkout.forSomeoneElse":"Ticket for someone else?","checkout.holderYou":"You \xB7 {name}","checkout.holderYouPlain":"You","checkout.change":"Change","checkout.changeHolder":"Change the holder of {ticket}","checkout.addNames":"Add names for each ticket","checkout.questions":"A few questions","checkout.payWith":"Pay with","checkout.continue":"Continue to payment","checkout.continueTest":"Continue to test payment","checkout.tryAgain":"Try again","checkout.trust":"Secure payment on the organizer\u2019s payment page. We never see your card.","checkout.freeTrust":"Free booking. Nothing is charged.","checkout.testStrip":"No real charge \xB7 tickets not valid for entry","checkout.testStripFree":"Test booking \xB7 tickets not valid for entry","checkout.privacy":"The organizer and SeatLayer use your details to issue and manage your tickets.","checkout.privacyLink":"Privacy Policy","checkout.expiringSoon":"Your seats are held for {time}. Finish soon to keep them.","checkout.opening":"Opening secure payment\u2026","checkout.redirectTitle":"Taking you to secure payment","checkout.redirectBody":"You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.","checkout.waitingPayment":"Waiting for payment\u2026","checkout.dontClose":"Don\u2019t close this tab.","checkout.confirmingTitle":"Confirming your seats","checkout.paymentReceived":"Payment received. This usually takes a few seconds.","checkout.noNeedPayAgain":"You don\u2019t need to pay again.","checkout.stillConfirmingTitle":"Still confirming","checkout.stillConfirming":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.","checkout.nothingCharged":"Nothing was charged.","checkout.expiredTitle":"Your seats were released","checkout.expiredBody":"The hold on {seats} ran out before payment started.","checkout.chooseAgain":"Choose seats again","checkout.takenTitle":"Those seats were just taken","checkout.takenBody":"Someone booked {seats} while you were filling this in.","checkout.chooseOther":"Choose other seats","checkout.closedTitle":"Online sales closed before you booked","checkout.closedBody":"These seats weren\u2019t held for you when sales closed.","checkout.backToEvent":"Back to the event","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"],mS={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"},da=["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"],Du=new Set(["ar","fa","he"]),Xn={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"},Yn=new Map(Ou.map(t=>[t.toLowerCase(),t]));function Nu(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=Yn.get(e)??Xn[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=Yn.get(o)??Xn[o];if(r)return r}return Yn.get(n[0])??Xn[n[0]]}var Ze={en:Bt},Li={},fe="en";function ha(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=Nu(n);if(o)return o}return"en"}function gS(){return fe}function bS(t=fe){return Du.has(t)?"rtl":"ltr"}function yS(t){return!!Ze[t]}var Un=new Set;function SS(t){return Un.add(t),()=>{Un.delete(t)}}function ht(t,e){e&&(Ze[t]={...Ze[t],...e}),fe=Ze[t]?t:"en",ca(fe),sa(fe),typeof document<"u"&&(document.documentElement.lang=fe);for(let i of Un)i()}function vS(t){Li=t}var ua=/\{(\w+)\}/g;function B(t,e){let i=Li[t]??Ze[fe]?.[t]??Bt[t]??t;return e?i.replace(ua,(n,o)=>String(e[o]??`{${o}}`)):i}function pa(t,e,i){let n=new Intl.PluralRules(fe).select(e);return(Li[`${t}.${n}`]??Ze[fe]?.[`${t}.${n}`]??Bt[`${t}.${n}`]??Li[`${t}.other`]??Ze[fe]?.[`${t}.other`]??Bt[`${t}.other`]??t).replace(ua,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function wS(t,e){return aa(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:fe})}function ma(t,e,i,n=!1,o=!1){let r=t.displayLabel?.trim()||t.label;return o&&!n?{title:r,detail:B("picker.heldForYou"),sellable:!1}:n||e==="booked"||e==="held"||e==="not_for_sale"?{title:r,detail:B("picker.group.legendUnavailable"),sellable:!1}:{title:r,detail:i()??"",sellable:!0}}var ut=32,fa=70;function ga(t,e){let i=ut+6,n=t.y-fa;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+fa,e.height-i)}}var Zn=.8,Vu=Math.hypot(.46,.36),zu=.26,Ku=1.6,Xu=2*(1-Vu),wa="#0b1220",Sa="#ffffff";function va(t,e,i,n,o){let r=Math.min(Math.max(Ku,i*zu),i*Xu);return new Qn({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:wa,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function Yu(t){if(!(t instanceof qe)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&st(e)?e:null}var Uu=220,$u=.08,Ci=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,n){let o=n.get(e);if(n.delete(e),!i){this.retire(o);return}o?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=Y(typeof a=="string"?a:"",r.selectionColor(),Ye),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:Yu(r.seatShape(e)),h=r.seatRadius(),f=new $n({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});f.setAttrs({seatId:e,ringColor:l});let m={name:"selection-halo",stroke:G(r.categoryColor(s.categoryKey),xi(H(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;f.add(new qn({...m,width:d.width+p*2,height:d.height+p*2,offsetX:(d.width+p*2)/2,offsetY:(d.height+p*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else f.add(new Ne({...m,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let y={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(f.add(new qn({...y,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new qn({...y,stroke:ai(r.canvasBackground()),width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2.5,opacity:Zn}));else{let p=Math.max(0,d.width/2-14),g=-Math.max(0,d.height/2-14);f.add(new Ne({x:p,y:g,radius:10,fill:l,listening:!1})),f.add(new Qn({x:p,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:H(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(f,u,h,c,y);else{let p=Math.max(1,h-1.25),g=Math.min(2.5,Math.max(1.8,h*.22));if(f.add(new Ne({...y,radius:p,strokeWidth:g})),c)f.add(new Ne({...y,stroke:ai(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Zn}));else{let b=Math.max(0,p-g/2);f.add(va(0,0,b,Sa,!0))}}n.set(e,f),this.host.overlayLayer.add(f)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new Ne({...r,stroke:ai(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:Zn}));return}let l=Y(a,s.selectionColor(),Ye),c=Hn(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=Er(i,n);if(!d)return;let u=H(l)?wa:Sa;e.add(va(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))},ta))}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 Ne({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Gn(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,s),this.pulseHome().add(s);let a=i&&!n.isCached()?n.seatShape(e):void 0,l=performance.now(),c=()=>{a?.scale({x:1,y:1}),s.destroy(),this.pulses.get(e)===s&&this.pulses.delete(e),n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw()},d=u=>{if(n.isDestroyed()){c();return}s.getLayer()||this.pulseHome().add(s);let h=u-l,f=Gn(h/420);if(s.radius(r*f.radiusScale),s.opacity(f.opacity),a){let m=ea(h/320);a.scale({x:m,y:m})}n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw(),h<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{n.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(d)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let n=i.seatShape(e);if(!n)return;let o=performance.now(),r=()=>{n.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!n.getLayer()){r();return}let l=a-o,c=Math.min(1,l/Uu),d=1+$u*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 $n({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,pe),o=n?i.seat(n):void 0;if(!o){this.hideLoupe();return}let r=ma(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id),i.seatOwnedHold(o.id)),s=ga(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=o.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(o.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),n=Y(i,le(i).sectionInk),o=new $n({name:"touch-loupe",listening:!1,visible:!1});o.add(new Qn({points:[-7,ut-4,0,ut+12,7,ut-4],closed:!0,fill:i,stroke:G(n,.25),strokeWidth:1,listening:!1})),o.add(new Ne({radius:ut,fill:i,stroke:G(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new Ne({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new ya({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new ya({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:G(n,.72),listening:!1,perfectDrawEnabled:!1});return o.add(r),o.add(s),o.add(a),e.overlayLayer.add(o),o.moveToTop(),this.loupe={group:o,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as qu}from"konva/lib/Animation";var Zu=1e3/ia;function ka(t){return t.findOne(".selection-halo")??null}var Ti=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let n=[],o=0;for(let[s,a]of this.markers){let l=ka(a);if(l){if(this.paintHalo(s,l),o>=Wn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:Vn(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Wn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:Vn(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new qu(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let n=this.host,o=xi(H(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(G(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=ka(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<Zu)return!1;this.lastFrameAt=i;let n=i-this.startedAt;for(let o of this.targets){let{scale:r,opacity:s}=na(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 Qu}from"konva/lib/Group";import{Circle as jn}from"konva/lib/shapes/Circle";import{Text as ju}from"konva/lib/shapes/Text";var xa=28,Ju=12,ep="800",tp=44,La=1.6,Ca=1.95;function Ta(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 ip(t,e){return B("map.beaconAria",{seats:pa("picker.seatCount",t),name:e})}function np(t,e){let i=e*Ca,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 op="selection-beacon-ring",Ii=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),n=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(n===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=n,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let o=xa/2/i,r=Math.max(tp,Math.ceil(2*(o*Ca+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Qu({listening:!1,name:"selection-beacons"});for(let c of e){let d=np(c,o);l.add(new jn({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*La,fill:G(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new jn({name:op,x:c.anchor.x,y:c.anchor.y,radius:o*La,stroke:G(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new jn({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:G(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new ju({x:d.x,y:d.y,text:String(c.count),fontSize:Ju/i,fontStyle:ep,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)||xa;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",ip(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${o.x-n/2}px`,top:`${o.y-n/2}px`,width:`${n}px`,height:`${n}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function Ot(t,e,i){let n=t.width(),o=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=n*2,d=o*2;for(let u of e){let h=u.getClientRect();if(!(!(h.width>1)||!(h.height>1))){if(h.x<-c||h.y<-d||h.x+h.width>n+c||h.y+h.height>o+d)return null;h.x<r&&(r=h.x),h.y<s&&(s=h.y),h.x+h.width>a&&(a=h.x+h.width),h.y+h.height>l&&(l=h.y+h.height)}}if(i&&i.width>=0&&i.height>=0){let u=t.scaleX(),h=i.x*u+t.x(),f=i.y*u+t.y();h<r&&(r=h),f<s&&(s=f),h+i.width*u>a&&(a=h+i.width*u),f+i.height*u>l&&(l=f+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var Pi=8,rp=.02,Ia=1,Pa=.5;function Ra(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Ot(t,e,o);if(!s)return 0;Jn(t,s,r);let a=Math.min((r.width-2*Pi)/s.width,(r.height-2*Pi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>Pa?a:Math.min(a,sp(t.scaleX(),n));if(!(c>1+rp)&&!(l>Pa)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,u=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:u+(t.y()-u)*c});let h=Ot(t,e,o);return h&&Jn(t,h,r),c}function eo(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=Ot(t,e,n);return r?Jn(t,r,o):!1}function sp(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(Ia,e):Ia)/i}function Jn(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 ap}from"konva/lib/Group";import{Circle as Ma}from"konva/lib/shapes/Circle";import{Line as lp}from"konva/lib/shapes/Line";import{Text as cp}from"konva/lib/shapes/Text";var dp=6;function Dt(t){return H(t)?"#0b1220":"#ffffff"}function Ea(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",n=0,o=0;for(let r of e)n+=r.x,o+=r.y;return{count:e.length,centroid:{x:n/e.length,y:o/e.length},fill:i,ink:Dt(i)}}var Ri=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let n=Ea({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 ap({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Ea({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(dp/2/n,1);for(let y of a)o.add(new Ma({name:"owned-seat-dot",x:y.x,y:y.y,radius:c,fill:l.fill,stroke:G("#ffffff",.55),strokeWidth:Math.max(.5,c*.28),shadowColor:l.fill,shadowBlur:c*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(i!=="seats"||r.has(s.logicalId))continue;r.add(s.logicalId);let d=this.host.sections().filter(y=>y.logicalId===s.logicalId).reduce((y,p)=>y+this.host.ownedPoints(p).length,0),u=this.host.labelAnchor(s),h=11/n,f={x:u.x,y:u.y-h*2.1};o.add(new Ma({name:"owned-section-badge",x:f.x,y:f.y,radius:h,fill:l.fill,stroke:G(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new lp({x:f.x-h*.62,y:f.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:l.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new cp({x:f.x+h*.12,y:f.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:s.logicalId,centre:f,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};import{Text as hp}from"konva/lib/shapes/Text";var up=4;function Nt(t){return H(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function pp(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 Aa(t,e){t.padding(up),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),pp(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(),hp.prototype._sceneFunc.call(this,n)})}function Fa(t){return t?"seat":"section"}function _a(t){let e=new Set,i=0;for(let o of t.memberIds){let r=t.categoryKey(o);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(o)&&(i+=1)}let n=[];for(let o of t.categoryOrder)e.has(o)&&n.push({key:o,name:t.categoryLabel(o)||o,price:t.categoryPrice(o),color:t.categoryColor(o)});return n.length?i?{mode:"section",title:t.name,fields:[],rows:n,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("picker.group.legendUnavailable")}}function Ba(t){let e=t.place?.kind==="booth",i=e?"":mp(t.label,t.sectionLabel,t.rowLabel),n=t.place?{caption:t.place.typeWord?.trim()||B(e?"picker.booth":"picker.table"),value:t.place.name}:null,o=[t.sectionLabel,t.rowLabel?B("picker.rowLabel",{label:t.rowLabel}):null,n?n.value:null,i?B("picker.seatLabel",{label:i}):null].filter(Boolean).join(" \xB7 ")||t.label,r=[t.sectionLabel?{caption:B("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:B("picker.row"),value:t.rowLabel}:null,n,i?{caption:B("picker.seat"),value:i}:null].filter(c=>c!=null),s={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},a=mr(t).map(c=>{let d=B(c.titleKey);return{icon:c.icon,title:d===c.titleKey?c.titleFallback:d,tone:c.tone,...c.note?{note:c.note}:{}}}),l=t.facts??[];return{mode:"seat",title:o,fields:r,rows:[s],notes:a,facts:l,...l.length&&t.head?{head:t.head}:{},note:l.length?null:fp(t.status,t.closed)}}function fp(t,e){return e||t==="not_for_sale"?B("picker.notForSale"):t==="booked"?B("map.statusTaken"):t==="held"?B("map.statusHeld"):null}function mp(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 gp=16,bp=8;function Oa(t,e,i,n=gp){let o=bp,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 Da=16,to=14,Na=10.5,yp=14,Sp=12.5,Ha={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},vp={warn:"#d8a425",premium:"#e8c15a"},wp=.1,kp=.06,Ga={minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",boxShadow:"0 6px 20px rgba(2,6,23,0.22)",lineHeight:"1.35"},xp={minWidth:"",maxWidth:"",padding:"",overflow:"",borderRadius:"",boxShadow:"",lineHeight:"",background:"",backgroundColor:"",border:"",fontFamily:""},Mi=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.roomEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.presented=null;this.mount=null;this.presentedView=null;this.viewEl=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.aisleIds=new Set;this.aisleDoc=null;this.placeFacts=new Map;this.sectionEntrances=new Map;this.placeDoc=null;this.onPointerMove=e=>{if(this.fromPresenter(e))return;if(this.presented=null,this.mount=null,this.presentedView=null,e.pointerType!=="mouse"){this.hide();return}let i=this.host.container.getBoundingClientRect();this.cursor={x:e.clientX-i.left,y:e.clientY-i.top},this.schedule()};this.onPointerLeave=e=>{this.fromPresenter(e)||this.hide()};this.onPointerDown=e=>{e.pointerType!=="mouse"&&!this.fromPresenter(e)&&this.hide()};this.onWheel=e=>{this.cursor&&!this.fromPresenter(e)&&this.schedule()};this.host=e}attach(){this.attached||(this.attached=!0,this.host.container.addEventListener("pointermove",this.onPointerMove),this.host.container.addEventListener("pointerleave",this.onPointerLeave),this.host.container.addEventListener("pointerdown",this.onPointerDown),this.host.container.addEventListener("wheel",this.onWheel,{passive:!0}))}destroy(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0),this.host.container.removeEventListener("pointermove",this.onPointerMove),this.host.container.removeEventListener("pointerleave",this.onPointerLeave),this.host.container.removeEventListener("pointerdown",this.onPointerDown),this.host.container.removeEventListener("wheel",this.onWheel),this.attached=!1,this.cursor=null,this.root?.remove(),this.root=null,this.titleEl=null,this.rowsEl=null,this.notesEl=null,this.factsEl=null,this.noteEl=null,this.viewEl=null,this.signature=""}presentSeat(e,i,n,o){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),o!==void 0&&(this.presentedView=o),this.presented=e,this.mount=n,this.cursor=i,this.update()}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":e.head?[e.head.title,e.head.sub,...e.facts.map(i=>`${i.caption} ${i.value}`)].filter(Boolean).join(" | "):[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}fromPresenter(e){return!!this.mount&&e.target instanceof Node&&this.mount.contains(e.target)}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let n=this.host.hostCardOpen?.()?null:this.resolve(i);if(!n){this.hide(),this.lastUpdateMs=performance.now()-e;return}let o=this.ensureRoot(),r=`${n.mode}|${n.title}|${n.note??""}|${this.host.canvasBackground()}|`+n.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${n.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${n.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`+(n.head?`|${n.head.title}|${n.head.sub??""}|${n.head.tone??""}|${n.head.plate??""}`:"");r!==this.signature&&(this.signature=r,this.paint(n)),this.showView(this.presented?this.presentedView:null),this.model=n,o.style.display="block";let s=this.mount??this.host.container,a=Oa(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(Fa(this.host.seatsPickable())==="seat"){let a=this.host.hoveredSeatId()??this.host.nearestSeat(e);return a?this.seatModel(a):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;if(!i||n==null||this.host.sectionInteractive?.(i)===!1)return null;let o=this.host.sectionMembers(i),r=this.host.sectionCardHead?.(i,o)??null,s=_a({name:n||i,memberIds:o,categoryOrder:this.host.categoryOrder(),categoryKey:a=>this.host.seat(a)?.categoryKey??null,categoryLabel:a=>this.host.categoryLabel(a),categoryPrice:a=>this.host.categoryPrice(a),categoryColor:a=>this.host.categoryColor(a),categorySellable:a=>this.host.categorySellable(a),seatSellable:a=>this.host.seatSellable(a)});return r?{...s,head:r,facts:s.rows.map(a=>({caption:a.name,value:a.price??""}))}:s}seatModel(e){let i=this.host.seat(e);if(!i)return null;let n=this.host.seatStatus(e),o=this.host.seatFacts?.(e)??null;if((n!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!o?.length)return null;let s=this.host.seatSectionLabel(e),a=o?.length?this.host.seatCardHead?.(e)??null:null;return Ba({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.seatPrice?.(i)??this.host.categoryPrice(i.categoryKey),categoryColor:this.host.categoryColor(i.categoryKey),status:this.host.seatStatus(e),closed:this.host.seatClosed(e),...i.accessibility?.length?{accessibility:i.accessibility}:{},...i.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{},...i.commercial?{commercial:i.commercial}:{},...this.isAisleSeat(e)?{aisle:!0}:{},...this.placeOf(i),...o?.length?{facts:o}:{},...a?{head:a}:{}})}placeOf(e){let i=this.host.chartDoc();if(!i)return{};if(this.placeDoc!==i){this.placeDoc=i,this.placeFacts.clear(),this.sectionEntrances=ot(i);for(let r of ii(i))r.type!=="table"&&r.type!=="booth"||this.placeFacts.set(r.id,{kind:r.type,name:r.displayLabel?.trim()||r.label,...r.displayType?.trim()?{typeWord:r.displayType.trim()}:{},...r.type==="booth"&&r.boothType?{boothType:r.boothType}:{},...r.entrance?.trim()?{entrance:r.entrance.trim()}:{}})}let n=this.placeFacts.get(e.rowId);if(!n)return{};let o=n.entrance??(e.sectionId?this.sectionEntrances.get(e.sectionId):void 0);return{place:{kind:n.kind,name:n.name,...n.typeWord?{typeWord:n.typeWord}:{}},...n.boothType?{boothType:n.boothType}:{},...o?{entrance:o}:{}}}isAisleSeat(e){let i=this.host.chartDoc();return i?(this.aisleDoc!==i&&(this.aisleDoc=i,this.aisleIds=hi(i)),this.aisleIds.has(e)):!1}rowName(e,i){let n=this.host.chartDoc();if(!n)return null;if(this.rowNamesDoc!==n){this.rowNamesDoc=n,this.rowNames.clear();for(let r of n.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let o=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return o?Rt(o,i??void 0)||o:null}ensureRoot(){let e=this.mount??this.host.container;if(this.root)return this.root.parentElement!==e&&e.appendChild(this.root),this.root;let i=Nt(this.host.canvasBackground()),n=document.createElement("div");n.className="sl-hover-card",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",...Ga,background:i.plate,border:`1px solid ${i.stroke}`,fontFamily:this.host.labelFont(),zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Da}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:Y(i.plate,"#0b1220")});let r=document.createElement("div");Object.assign(r.style,{display:"flex",flexDirection:"column",gap:"0"});let s=document.createElement("div");Object.assign(s.style,{display:"none",flexDirection:"column",gap:"0"});let a=document.createElement("div");Object.assign(a.style,{fontSize:`${to}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:Y(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),n.append(o,r,s,l,a),e.appendChild(n),this.root=n,this.titleEl=o,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,n}paint(e){let i=this.ensureRoot();if(e.head)return this.paintRoomCard(i,e,e.head);this.roomEl&&this.leaveRoomCard(i);let n=Nt(this.host.canvasBackground());i.style.background=n.plate,i.style.border=`1px solid ${n.stroke}`;let o=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=Y(n.plate,"#0b1220");if(o.replaceChildren(),o.style.color=l,o.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;o.style.display="flex",o.style.padding="0";for(let[d,u]of e.fields.entries()){let h=document.createElement("div");Object.assign(h.style,{flex:u.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${n.stroke}`:"none"});let f=document.createElement("div");f.textContent=u.caption,Object.assign(f.style,{fontSize:`${Na}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let m=document.createElement("div");m.textContent=u.value,Object.assign(m.style,{marginTop:"2px",fontSize:`${Da}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(f,m),o.append(h)}}else o.style.display="block",o.style.padding="10px 15px 9px",o.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${to}px`,fontWeight:"700",background:c.color,color:wn(c.color)});let u=document.createElement("span");u.textContent=c.name;let h=document.createElement("span");h.textContent=c.price??"",d.append(u,h),r.appendChild(d)}this.paintNotes(s,e,n,l),this.paintFacts(this.factsEl,e,n,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=Y(n.plate,"#0b1220")}paintRoomCard(e,i,n){e.classList.add("room"),Object.assign(e.style,xp);for(let c of[this.titleEl,this.rowsEl,this.notesEl,this.factsEl,this.noteEl])c&&(c.style.display="none");let o=this.roomEl;o||(o=document.createElement("div"),e.appendChild(o),this.roomEl=o),o.style.display="block";let r=document.createElement("div");if(r.className="slhc-head",n.plate){let c=document.createElement("span");c.className="slhc-plate",c.innerHTML=n.plate,r.appendChild(c)}let s=document.createElement("div"),a=document.createElement("b");if(a.className="slhc-title",a.textContent=n.title,s.appendChild(a),n.sub){let c=document.createElement("span");c.className="slhc-sub",c.textContent=n.sub,n.tone&&(c.style.color=n.tone),s.appendChild(c)}r.appendChild(s);let l=i.facts.map(c=>{let d=document.createElement("div");d.className="slhc-row";let u=document.createElement("span");u.textContent=c.caption;let h=document.createElement("b");return h.textContent=c.value,d.append(u,h),d});o.replaceChildren(r,...l)}leaveRoomCard(e){e.classList.remove("room"),this.roomEl?.remove(),this.roomEl=null,this.rowsEl&&(this.rowsEl.style.display="flex"),Object.assign(e.style,{...Ga,fontFamily:this.host.labelFont()})}paintFacts(e,i,n,o){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${n.stroke}`,color:o});for(let[r,s]of i.facts.entries()){let a=document.createElement("div");Object.assign(a.style,{flex:"1 1 auto",padding:"8px 12px 9px",textAlign:"center",borderLeft:r?`1px solid ${n.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${Na}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:`${to}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=wn(n.plate)==="#ffffff"?Ha.onDark:Ha.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,vp[s.tone],wp):j(n.plate,o,kp),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=gr(s.icon),Object.assign(u.style,{flex:"none",marginTop:"1px"});let h=document.createElement("div");Object.assign(h.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let f=document.createElement("div");if(f.textContent=s.title,Object.assign(f.style,{fontSize:`${yp}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(f),s.note){let m=document.createElement("div");m.textContent=s.note,Object.assign(m.style,{fontSize:`${Sp}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(m)}d.append(u,h),e.appendChild(d)}}};var Wa="#1f9d6b";function Lp(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 Va(t,e){let i=e?new Set(e):null;Lp(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function za(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 Ka(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function K(t){let e=Fr(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 pt(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 ft(t,e,i,n,o,r){let s=n*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let u=e*(d/6-.5),h=i*(c/4-.5),f={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!te(f,o,r))return!1}return!0}function Xa(t,e,i){let n=K(t),o={x:n.x+n.width/2,y:n.y+n.height/2},r=te(o,t,e)?[o,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:n.x+n.width*c/12,y:n.y+n.height*l/12};te(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:Qo(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 Ya(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return K(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function Cp(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 Ua(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=Cp(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 Tp}from"konva/lib/shapes/Text";function io(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 me=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),io(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/At),n=Math.floor((e.x+Math.max(0,e.width))/At),o=Math.floor(e.y/At),r=Math.floor((e.y+Math.max(0,e.height))/At),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var no=new WeakMap;function je(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=no.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},no.set(t,e);let i=()=>{let n=no.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var $a=new WeakMap,qa=new WeakMap;function Za(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 Tp({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 Ip(t){let e=t.labelFont(),i=je(),n=qa.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new me,r=Za(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(),qa.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function Pp(t){let e=Ip(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(),je(),t.seatR,i]),o=$a.get(t.rowLabelPlan);if(o?.key===n&&o.seats===t.seatById)return o.boxes;let r=new me;for(let l of i)r.insert(l);let s=Za(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(),$a.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function Qa(t,e){let i=t.sections.filter(m=>m.id===e||m.logicalId===e),n=i.map(m=>K(m.outline));if(!n.length)return null;let o=Math.min(...n.map(m=>m.x)),r=Math.min(...n.map(m=>m.y)),s=Math.max(...n.map(m=>m.x+m.width)),a=Math.max(...n.map(m=>m.y+m.height)),l=new Set(i.flatMap(m=>m.memberIds));for(let m of l){let y=t.seatById.get(m);y&&(o=Math.min(o,y.x-t.seatR),r=Math.min(r,y.y-t.seatR),s=Math.max(s,y.x+t.seatR),a=Math.max(a,y.y+t.seatR))}let c=m=>{[m.x,m.y,m.width,m.height].every(Number.isFinite)&&(o=Math.min(o,m.x),r=Math.min(r,m.y),s=Math.max(s,m.x+m.width),a=Math.max(a,m.y+m.height))},d=m=>{let y={x:m.x+m.width/2,y:m.y+m.height/2};return i.some(p=>te(y,p.outline,p.holes))};for(let{node:m,backdrop:y}of t.freeTextById.values()){let p=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),y&&c(y.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:m}of t.iconNodeById.values()){let y=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(y)&&c(y)}let u=Pp(t);t.rowLabelPlan.forEach((m,y)=>{(m.focusKeys??[]).some(g=>g===e||i.some(b=>g===b.id||g===b.logicalId))&&c(u[y])});let h=Math.max(s-o,a-r),f=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-f,y:r-f,width:Math.max(1,s-o+f*2),height:Math.max(1,a-r+f*2)}}import{Rect as Rp}from"konva/lib/shapes/Rect";import{Text as ja}from"konva/lib/shapes/Text";var oo="\0";function Mp(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 Ep(t,e){let i=t.filter(f=>Number.isFinite(f.centroid.x)&&Number.isFinite(f.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let n=i.map(f=>({member:f,weight:Math.max(1,Mp(f.outline))})),o=n.reduce((f,m)=>f+m.weight,0),r=n.reduce((f,m)=>({x:f.x+m.member.centroid.x*m.weight/o,y:f.y+m.member.centroid.y*m.weight/o}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(f=>{let m={x:f.centroid.x-e.x,y:f.centroid.y-e.y},y={x:f.centroid.x-r.x,y:f.centroid.y-r.y};return{member:f,depth:m.x*l.x+m.y*l.y,lateral:Math.abs(y.x*-l.y+y.y*l.x)}}).sort((f,m)=>m.depth-f.depth||f.member.id.localeCompare(m.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(f=>f.depth>=u);return h.sort((f,m)=>f.lateral-m.lateral||m.depth-f.depth||f.member.id.localeCompare(m.member.id)),h[0].member}function Ap(t){let i=[...B("map.fromPrice",{price:oo}).toLocaleLowerCase()],n=i.findIndex(o=>o!==oo&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(oo).join(t)}function Fp(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function _p(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>Fp(n.label,i))}function Ja(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Xs(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&&!_p(o.label,r))continue;let s=r[0];for(let w of r)w.centroid.y<s.centroid.y&&(s=w);t.derivedFloorGroups&&(s=Ep(r,o.focalPoint??e.focalPoint)??s);let a=1/0,l=-1/0,c=1/0,d=-1/0;for(let w of r)for(let k of w.outline)k.x<a&&(a=k.x),k.x>l&&(l=k.x),k.y<c&&(c=k.y),k.y>d&&(d=k.y);let u=isFinite(a)&&l>a?l-a:0,h=!t.derivedFloorGroups&&isFinite(c),f=h?(a+l)/2:s.centroid.x,m=h?c:s.centroid.y,y=1/0,p=1/0;for(let w of r)for(let k of w.memberIds){let v=t.seatById.get(k),x=v&&t.catPrice.get(v.categoryKey);!v||typeof x!="number"||(v.accessible||v.accessibility?.length?p=Math.min(p,x):y=Math.min(y,x))}isFinite(y)||(y=p);let g=new Rp({x:f,y:m,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(g);let b=new ja({x:f,y:m,text:o.label,fontSize:yi,fontStyle:us,letterSpacing:0,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1});b.offsetX(b.width()/2),b.offsetY(b.height()/2),t.bgLayer.add(b);let S=null;isFinite(y)&&(S=new ja({x:f,y:m,text:Ap(ce(y,t.currency)),fontSize:Si,fontStyle:ps,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),S.offsetX(S.width()/2),t.bgLayer.add(S)),t.zones.push({id:o.id,anchor:{x:f,y:m},back:g,background:t.canvasBackground,name:o.label,spanWorld:u,aboveZone:h,area:isFinite(a)?{x:a,y:c,width:l-a,height:d-c}:void 0,label:b,sub:S})}}function el(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&&nt(n)==="combined"&&!n.zones?.length?n.floors?.find(d=>dr(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 Bp=new Set,tl=16,Op=5,Ei=class{constructor(e,i,n=8e3){this.chunks=e;this.host=i;this.warmSeats=n;this.wanted=new Set;this.built=new Map;this.loose=new Map;this.located=new Map;this.queue=[];this.pinQueue=[];this.frame=0;this.stepping=!1;this.stopped=!1}locate(e){let i=this.located.get(e);if(i===void 0){i=null;let n=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let o of n){let r=o===void 0?-1:this.chunks.get(o)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:o,seat:this.chunks.get(o)[r],index:r};break}}this.located.set(e,i)}return i??void 0}isResident(e){let i=this.locate(e);return!!i&&(this.loose.has(e)||(this.built.get(i.section)??0)>i.index)}sync(e,i=Bp){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,tl)){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+tl,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 il(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 Yp}from"konva/lib/shapes/Circle";import{Line as Up}from"konva/lib/shapes/Line";import{Rect as $p}from"konva/lib/shapes/Rect";import{Text as qp}from"konva/lib/shapes/Text";function Pe(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Re(t,e){return Pe(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var nl=.35,ol=.7,Je="#0b1220",mt="#ffffff",rl="#0b1220",ro="#232c40",sl="#8b93a7";function so(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var ao="#f7f8fb";import{Text as ll}from"konva/lib/shapes/Text";var al="500",Dp=2.5;function Np(t,e){return t>=ie||e&&t>=gi}function Hp(t){return t.effectiveScale<gi?!1:t.focusActive||t.stageWidth<U}function Gp(t,e,i){return i&&e>=gi?Math.max(t,ns/Math.max(e,1e-4)):t}function Wp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=V/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(lt,r),s)}function lo(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function cl(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 dl(t,e){return e>0?Math.min(t,e/2):t}function hl(t){return Ai(co(t))}function co(t){let e=lo(t,!1),i=lo(J,!1),n=e>0?i/e:1;return ge/Math.max(1,n)}function Ai(t){return V/Math.max(t,1e-4)/En(1,!1,V)}function ul(t){return Ai(t)*wi}function Vp(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function pl(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=Hp({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:En(e,t.labelsWereVisible(),V),o=t.labelLayers(),r=o.seatLabels&&Np(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=g=>{let b=t.worldToScreen({x:g.x(),y:g.y()}),S=g.width()*e,w=g.height()*e;return b.x-S/2>=0&&b.y-w/2>=0&&b.x+S/2<=t.stage.width()&&b.y+w/2<=t.stage.height()};for(let[g,b]of t.boothLabelById){let S=t.circleById.get(g);b.visible(ye(b.fontSize(),n)&&!!S?.isVisible()&&t.focusedSeatOpacity(g,S?.getAbsoluteOpacity()??1)>=.5&&s(b))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0,c=t.rowLabelDwell,d=t.gesturing?.()??!1,u=performance.now();if(c?.begin(),r)for(let g of t.visibleSeatCandidates()){if(g.kind==="booth")continue;let b=t.worldToScreen(g);if(b.x<-20||b.x>t.stage.width()+20||b.y<-20||b.y>t.stage.height()+20||t.accessGlyphById.has(g.id)&&t.accessGlyphShouldShow(g.id))continue;let S=t.circleById.get(g.id);if(!S?.isVisible()){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let w=t.statusById.get(g.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(g.id)&&(w==="booked"||w==="not_for_sale"||w==="held"&&!t.ownedHold.has(g.id))){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(g.id)){t.seatLabelDrops.set(g.id,"selection-tick");continue}if(S&&t.opts.organizerGlyph?.isPainted(S)){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.focusedSeatOpacity(g.id,S.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let x=Gp(ge*t.seatLabelScale(g),e,i),T=si(g.displayLabel??g.label),P=S?t.seatLabelInk(g,S):t.seatPreferredLabelInk(g),L=t.seatLabelPool.get(g.id);L?(L.position({x:g.x,y:g.y}),L.text(T),L.fontSize(x),L.fontFamily(t.labelFont()),L.fill(P),L.offset({x:0,y:0}),L.scale({x:1,y:1})):(L=new ll({x:g.x,y:g.y,text:T,fontSize:x,fontStyle:al,fontFamily:t.labelFont(),fill:P,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(g.id,L));let C=lo(t.seatR,i);if(L.fontSize(Wp({authoredFontSize:x,measuredWidth:L.width(),maxWidth:C,effectiveScale:e})),L.width()>C+.01){t.seatLabelDrops.set(g.id,"label-overflows-marker");continue}if(!ye(L.fontSize(),e)){t.seatLabelDrops.set(g.id,"below-minimum-size");continue}if(L.offsetX(L.width()/2),L.offsetY(L.height()/2),Vp(t,g.id,L),!s(L)){t.seatLabelDrops.set(g.id,"outside-viewport");continue}if(!(c&&!c.admit(`seat:${g.id}`,u,d))&&(a.add(g.id),t.seatLabelById.set(g.id,L),++l>=os))break}for(let[g,b]of t.seatLabelPool)a.has(g)||(b.destroy(),t.seatLabelPool.delete(g));let h=new me;for(let{node:g}of t.freeTextById.values()){if(!g.isVisible())continue;let b=g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:b.x-ee,y:b.y-ee,width:b.width+ee*2,height:b.height+ee*2})}let f=new me,m=null,y=()=>{if(m)return m;m=new me;for(let g of t.seatLabelById.values()){if(!g.isVisible())continue;let b=g.getClientRect({skipShadow:!0,skipStroke:!0});m.insert({x:b.x,y:b.y,width:b.width,height:b.height})}return m},p=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Dp;if(o.rowLabels)for(let g of zp(t.rowLabelPlan)){let b=t.rowLabelPlan[g],S=t.focusedSectionId!=null&&b.focusKeys?.includes(t.focusedSectionId),w=Math.max(e,1e-4),k=S?Math.max(b.fontSize,Et/w):b.fontSize,v=Math.max(Math.min(k,is(t.stage.width())/w),S?Et/w:0);if(!r&&(!S||!p)||!S&&!ye(v,n))continue;let x=t.worldToScreen({x:b.x,y:b.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let T=new ll({x:b.x,y:b.y,text:b.text,fontSize:v,fontStyle:al,fontFamily:t.labelFont(),fill:b.ink,rotation:b.rotation,opacity:b.opacity,shadowColor:"#05070c",shadowBlur:b.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:b.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});b.pill&&Aa(T,b.pill),T.offsetX(T.width()/2),T.offsetY(T.height()/2);let P=t.resolveAutomaticRowLabelPosition(T,b,h);T.position(P),T.setAttr("rowLabel",!0),b.rowKey&&T.setAttr("rowKey",b.rowKey),T.setAttr("focusKeys",b.focusKeys??[]),t.rowLabelGroup.add(T);let L=T.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,I=L.x<C?C-L.x:L.x+L.width>t.stage.width()-C?t.stage.width()-C-L.x-L.width:0,R=L.y<C?C-L.y:L.y+L.height>t.stage.height()-C?t.stage.height()-C-L.y-L.height:0,M=P;if(I||R){let _=t.labelGroup.getAbsoluteTransform(),F=_.point(P);if(M=_.copy().invert().point({x:F.x+I,y:F.y+R}),b.automaticAway&&Math.abs((M.x-P.x)*-b.automaticAway.y+(M.y-P.y)*b.automaticAway.x)>(t.markerR??t.seatR)){T.destroy();continue}T.position(M);let N=T.getClientRect({skipShadow:!0,skipStroke:!0});if(y().collisionCount({x:N.x,y:N.y,width:N.width,height:N.height})>0){T.destroy();continue}}let E=t.rowLabelBox(T,M),A=ts/w;if(f.collisionCount({x:E.x-A/2,y:E.y-A/2,width:E.width+A,height:E.height+A})>0){T.destroy();continue}if(b.automaticAway&&h.collisionCount(E)>0){T.destroy();continue}if(c&&!c.admit(`row:${g}`,u,d)){T.destroy();continue}h.insert(E),f.insert(E)}c?.end(),t.overlayLayer.batchDraw()}function zp(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 ho(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:co(e)}}function Kp(t){let e=He(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:J*2,labelFontSize:be({width:e.width,height:e.height,text:t.label})}}function He(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 fl(t,e){let i=ho(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?Kp({...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 Xp(t){return ul(t.labelFontSize)}function ml(t){return Ai(t.labelFontSize)}function Fi(t){let e=Math.max(t.diameter,1e-4);return Math.max(ae,ci/e)}function gl(t){return Math.max(Xp(t),Fi(t)*wi)}function bl(t){for(let e of t.seats){if(e.kind==="booth"){Zp(t,e);continue}let i=t.seatContainer(e.id),n=Zs({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:Ar(e.glyph,t.catByKey.get(e.categoryKey)),wheelchairBay:e.wheelchairSpaceType==="no-seat"});if(n instanceof qe&&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 Yp({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Pt(e.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(e.id,o),i.add(o)}if(rt(e.accessibility??[])){let o=t.buildAccessGlyph(e,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(e.id,o),i.add(o)}}}}function Zp(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 Up({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 $p({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 qp({x:o,y:r,text:a,fontSize:n.nameSize??be({...He(n),text:a}),fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??Je,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 yl(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 wf}from"konva/lib/shapes/Circle";import{Group as zl}from"konva/lib/Group";import{Rect as kf}from"konva/lib/shapes/Rect";import{Text as xf}from"konva/lib/shapes/Text";var Me=1.12;function gt(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*Me),o.height/(e.height*Me));return q(r,i.min,i.max)}var Ht=.55;function Gt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function uo(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??_t,a=e.scaleX(),l=gt(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 vl(t,e,i,n){let o=q(e,n.min,n.max),r=t.scaleX();if(o===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.setAttrs({scaleX:o,scaleY:o,x:i.x-s*o,y:i.y-a*o}),!0}function wl(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*Me),s.height/(e.height*Me)),l=n??i.min,c=q(Math.max(a,l),i.min,Math.max(l,Gt(i,r)));t.scale({x:c,y:c}),t.position({x:s.x+s.width/2-(e.x+e.width/2)*c,y:s.y+s.height/2-(e.y+e.height/2)*c})}function kl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function po(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 xl(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Qp="500",jp=11;function Jp(t){let e=dt(jp,t),i=bi(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var ef=4;function tf(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let n=i[0];for(let o of i)o.length>=n.length&&(n=o);return n}return e}function Ll(t,e,i){let n=t.numberLabel,o=tf(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.fontStyle(i<U?Qp:Te),n.visible(!0),n.rotation(0);let r=ef/e;for(let s of Jp(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),ft(a,n.width()+r,n.height()+r,0,t.outline,t.holes))return!0}return n.position(t.centroid),!1}function Cl(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(G(e.outlineTint,.5)),e.outlinePoly.fill(G(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(G(n,.72+i*.25)),e.outlinePoly.fill(G(n,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(n),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function fo(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function El(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&&Pe(s,e)&&(o+=1)}return o}function Al(t,e){return fo(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Fs?"nearly-gone":"normal"}function Fl(t,e){let i=Al(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=zs(t.canvasBackground,i,n?null:o?o.tint??null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(i==="sold-out"?B("map.soldOut"):B("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function _l(t,e){return j(e,H(t)?"#ffffff":"#000000",Ts)}function mo(t,e,i=0){let n=Cs-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function nf(t,e){return Bl(t,e)!=null}function Bl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function Ol(t,e,i){let n=mo(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 of(t,e,i){let n=Ol(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(Ls),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*De:0)}function rf(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var sf=.05;function Dl(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<=sf}function Nl(t,e){let i,n;t.reducedMotion?(i=e<=Ce?1:0,n=e<=Ue?1:0):(i=q((we-e)/(we-Ce),0,1),n=q((Ce-e)/(Ce-Ue),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Q;o&&(i=1),(!t.zones.length||t.sectionsPinned)&&(n=0),t.seatLayer.opacity(Dl(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>Fn);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<U,c=l&&o&&t.zones.length===0,d=le(t.canvasBackground),u=q((i-.2)/.8,0,1),h=new Set(t.zones.map(p=>p.id)),f=new Set,m;for(let p of t.sections){let g=t.hasFocusDimOverlay?1:a&&p.id!==a&&p.logicalId!==a&&p.zone!==a?Ie:1,b=Bl(t,p);b&&p.zone&&f.add(p.zone);let S=Math.min(g,xl(p.memberCategoryKeys,t.categoryFilter)?Ie:1,t.accessFilterActive&&!b?Ie:1);p.outlinePoly.opacity(o?0:(1-i)*S),p.blockPoly.opacity(cs*i*S);let w=t.sectionIsOwned(p);p.blockPoly.stroke(w?t.selectionColor:p.shellStroke||d.sectionStroke),p.blockPoly.strokeWidth((w?ds:$e)/Math.max(r,1e-4));let k=p.blockPoly.fill(),v=typeof k=="string"?k:p.baseFill,x=!!p.shellCategoryColor&&!p.explicitInk&&["normal","nearly-gone"].includes(Al(t,p)),T=x?Us(p.shellCategoryColor,v,4.5):Ys(v,p.explicitInk,p.preferredInk,Cr);p.nameLabel.fill(T),p.subLabel.fill(T),of(p,l,b);let P=p.zone!=null&&h.has(p.zone);s&&(u>.01||p.externalLabel)&&(m??=cf(t.sections),hf(t,p,r,Ol(p,l,b),!P&&m));let L=b||!P?1:1-n;p.nameLabel.opacity(p.nameLabelFits?(p.externalLabel?1:u)*L*S:0),p.subLabel.opacity(0);let C=c&&!p.nameLabelFits,I=P&&n>.01;s&&(p.numberLabelFits=(I||C)&&Ll(p,r,t.stageWidth)),p.numberLabelFits&&p.numberLabel.fill(x?T:he(v,p.explicitInk,p.preferredInk)),p.numberLabel.opacity(p.numberLabelFits?(C?u:I?n:0)*S:0);let R=p.nameLabel.opacity(),M=p.numberLabel.opacity();if(R>.05&&M>.05){let E=Math.min(1*S,R+M);R>=M?(p.nameLabel.opacity(E),p.numberLabel.opacity(0)):(p.numberLabel.opacity(E),p.nameLabel.opacity(0))}}let y=n;for(let p of t.zones){let g=t.accessFilterActive&&!f.has(p.id)?Ie:1,b=p.label.visible()?y*g:0;p.back.opacity(b),p.label.opacity(b),p.sub&&p.sub.opacity(Tl(t,p)?0:b),s&&uf(t,p,r)}if(!t.glideInProgress&&(u>.01||y>.01)){lf(t,r),af(t.sections);for(let p of t.zones){let g=p.label.opacity();p.back.opacity(g),p.sub&&p.sub.opacity(Tl(t,p)?0:g)}}(y>.01||c)&&Cl(t.sections);for(let p of t.sections)rf(p);t.bgLayer.batchDraw()}function Tl(t,e){return t.stageWidth<U||!e.sub||!e.sub.visible()}function af(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let n=i.filter(o=>o.nameLabel.opacity()>.05).sort((o,r)=>{let s=K(o.outline),a=K(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function lf(t,e){let n=[],o=u=>{let h=t.worldToScreen({x:u.x(),y:u.y()}),f=K(pt({x:0,y:0},u.width()*e,u.height()*e,u.rotation()));return{x:h.x-f.width/2,y:h.y-f.height/2,w:f.width,h:f.height}};for(let u of t.zones){if(u.label.opacity()<=.05)continue;let h=u.back.getAbsolutePosition(),f=u.back.width()*e,m=u.back.height()*e;n.push({node:u.label,tier:2,section:!1,zone:u,box:{x:h.x-f/2,y:h.y-m/2,w:f,h:m}})}for(let u of t.sections){if(u.nameLabel.opacity()>.05){let h=nf(t,u)?-1:1;n.push({node:u.nameLabel,tier:h,section:!0,area:u.labelArea,box:o(u.nameLabel)})}u.numberLabel.opacity()>.05&&n.push({node:u.numberLabel,tier:1,section:!1,area:u.labelArea,box:o(u.numberLabel)})}let r=t.landmarks.map(u=>{let h=t.worldToScreen({x:u.x,y:u.y}),f=t.worldToScreen({x:u.x+u.width,y:u.y+u.height});return{x:Math.min(h.x,f.x),y:Math.min(h.y,f.y),w:Math.abs(f.x-h.x),h:Math.abs(f.y-h.y)}});if(n.length<2&&!r.length)return;n.sort((u,h)=>u.tier-h.tier||(h.area??0)-(u.area??0)||u.box.y-h.box.y||u.box.x-h.box.x);let s=[...r],a=u=>s.some(h=>u.x<h.x+h.w+4&&h.x<u.x+u.w+4&&u.y<h.y+h.h+4&&h.y<u.y+u.h+4),l=n.some(u=>u.zone)?gf(t):[],c=t.bgLayer.getStage()?.height()??1/0,d=u=>!a(u)&&!l.some(h=>mf(u,h,2))&&u.x>=6&&u.x+u.w<=t.stageWidth-6&&u.y>=Hl&&u.y+u.h<=c-6;for(let u of n){if(u.zone){let f=bf(t,u.zone,u.box,d);f?s.push(f):u.node.opacity(0);continue}if(!a(u.box)){s.push(u.box);continue}let h=!1;if(u.section){let f=u.node.fontSize(),m=u.node.y(),y=u.node.letterSpacing()>0;for(let p of An){let g=f*p;if(g*e<Ft(t.stageWidth))break;Ee(u.node,g,m),y&&(u.node.letterSpacing(u.node.fontSize()*De),u.node.offsetX(u.node.width()/2));let b=o(u.node);if(!a(b)){s.push(b),h=!0;break}}h||(Ee(u.node,f,m),y&&(u.node.letterSpacing(u.node.fontSize()*De),u.node.offsetX(u.node.width()/2)))}h||u.node.opacity(0)}}function Ee(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}var Il=8;function cf(t){if(t.length<=Il)return!0;let e=new Set;for(let i of t)if(e.add(i.logicalId),e.size>Il)return!1;return!0}function df(t,e,i){let n=K(t);return be({width:n.width*i,height:n.height*i,text:e})}function hf(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<U,s=Ft(t.stageWidth),a=_n(ct*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&Dl(t)?Math.max(a,df(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Ee(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,f]of n.entries()){e.nameLabel.text(f);let m=K(e.outline),y=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:m.height>m.width*Es?[0,-90]:[0];for(let p of y)for(let g of e.labelAnchors)for(let b=c;b>=s;b-=1){e.nameLabel.rotation(p),Ee(e.nameLabel,b/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*De),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(g);let S=Ms/i;if(ft(g,e.nameLabel.width()+S,e.nameLabel.height()+S,p,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=h>0;return}}}e.nameLabel.text(n[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Ee(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*De),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=K(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function 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 uf(t,e,i){let n=vi(t.stageWidth),o=t.stageWidth<U,r=e.sub!=null&&!o,s=(o?fs:gs)*n/i,a=(o?ms:bs)*n/i,l=_n(yi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Ee(e.label,l/i,e.anchor.y),r&&(Ee(e.sub,dt(Si,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*hs),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*Ss/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*vs-s*2:1/0,u=Math.min(c,d),h=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&h()>u&&(r=!1),h()>u)for(let x of An){let T=Math.max(Oe,l*x);if(T>=e.label.fontSize()*i-.001||(Ee(e.label,T/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(Pl(e.label,e.name,Math.max(u,1)),pf(e.label.text())<ff(e.name)&&Pl(e.label,e.name,Math.max(c,1)),Ee(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){Rl(e);return}e.label.visible(!0),e.back.visible(!0);let f=r?3*n/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let m=Math.max(e.label.width(),r?e.sub.width():0)+s*2,y=e.label.height()+(r?f+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(f+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+f)/2),e.back.position(e.anchor),e.back.size({width:m,height:y}),e.back.offset({x:m/2,y:y/2}),e.back.cornerRadius(ys*n/i),e.back.strokeWidth(1/i),e.aboveZone&&_i(e,0,-(y/2+4*n/i));let p=e.back.getAbsolutePosition(),g=6,b=m*i;if(b>t.stageWidth-g*2){Rl(e);return}let S=b/2,k=(q(p.x,g+S,t.stageWidth-g-S)-p.x)/i;Math.abs(k)>.001&&_i(e,k,0);let v=Hl+y*i/2;p.y<v&&_i(e,0,(v-p.y)/i)}function pf(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function ff(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function Rl(t){t.label.visible(!1),t.label.opacity(0),t.back.visible(!1),t.back.opacity(0),t.sub&&(t.sub.visible(!1),t.sub.opacity(0))}function _i(t,e,i){t.label.x(t.label.x()+e),t.label.y(t.label.y()+i),t.sub&&(t.sub.x(t.sub.x()+e),t.sub.y(t.sub.y()+i)),t.back.x(t.back.x()+e),t.back.y(t.back.y()+i)}var Hl=62;function mf(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 gf(t){return t.sections.map(e=>{let i=K(e.outline),n=t.worldToScreen({x:i.x,y:i.y}),o=t.worldToScreen({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(n.x,o.x),y:Math.min(n.y,o.y),w:Math.abs(o.x-n.x),h:Math.abs(o.y-n.y)}})}function bf(t,e,i,n){let o=[i];if(e.area){let a=t.worldToScreen({x:e.area.x,y:e.area.y}),l=t.worldToScreen({x:e.area.x+e.area.width,y:e.area.y+e.area.height}),c=(a.x+l.x)/2-i.w/2,d=(a.y+l.y)/2-i.h/2;o.push({...i,x:c,y:l.y+6},{...i,x:a.x-6-i.w,y:d},{...i,x:l.x+6,y:d})}for(let s of ws)s!==0&&o.push({...i,y:i.y+s});let r=t.stageScaleX||1;for(let s of o)if(n(s))return s!==i&&_i(e,(s.x-i.x)/r,(s.y-i.y)/r),s;return null}function yf(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 yo(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=yf(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function go(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 bo(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 Gl(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 Sf(t){if(!t.length)return 0;let e=Gl(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,go(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return Gl(i)+e}function So(t,e){if(!t.length)return[];let i=Sf(t)*(e?.gapRows??2),n=e?.minRows??2,o=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((h,f)=>h.bounds.y-f.bounds.y||h.bounds.x-f.bounds.x||h.id.localeCompare(f.id)),d=[];for(let h of c){let f=d.find(m=>go(m.bounds,h.bounds)<=i);f?(f.bounds=bo(f.bounds,h.bounds),f.rowIds.push(h.id),f.seatCount+=h.seatCount):d.push({categoryKey:a,bounds:{...h.bounds},rowIds:[h.id],seatCount:h.seatCount})}let u=!0;for(;u&&d.length>1;){u=!1;e:for(let h=0;h<d.length;h+=1)for(let f=h+1;f<d.length;f+=1)if(!(go(d[h].bounds,d[f].bounds)>i)){d[h].bounds=bo(d[h].bounds,d[f].bounds),d[h].rowIds.push(...d[f].rowIds),d[h].seatCount+=d[f].seatCount,d.splice(f,1),u=!0;break e}}for(let h of d)h.rowIds.length<n&&h.seatCount<o||(h.rowIds.sort(),s.push(h))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function Wl(t){let e=null;for(let i of t)e=e?bo(e,i.bounds):{...i.bounds};return e}function Vl(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 Xl(t){return t*.3}function Kl(t){return Xl(t)*2+t*.42}var Bi=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey="";this.pressOnChart=!0}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.pressOnChart=!0,this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=So(yo(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=le(i),o=_l(i,i),r=Y(o,n.sectionInk),s=new zl({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 zl({listening:!1}),u=new kf({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:$e,opacity:Is,listening:!1,perfectDrawEnabled:!1}),h=new wf({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),f=new xf({...c,text:l,fontSize:ct,fontStyle:Te,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(f),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:f,label:l})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,n=this.host.exportMode||this.host.seatsPickable()&&e<ae||e>=this.host.readableScale();return this.revealed=n||Zr(Mn(i,e),Mn(i,ae),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.revealed||this.capOnePerCategory(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.host.screenToWorld(e),n=this.clusterAt(i);if(!n)return!1;let o=this.host.seatR()*2,r={x:n.bounds.x-o,y:n.bounds.y-o,width:n.bounds.width+o*2,height:n.bounds.height+o*2},s=this.host.stage;if(gt(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*_t)return!1;let l=this.diveTarget(r,null,i);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i,n){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),a=gt(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*Me),d=r.height/(l*Me);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?Cf(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=_s(i,this.host.pickableScale());if(n==null||n<=i*_t)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Me),a=r.height/(n*Me);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=Vl(this.all,e);if(i)return i;if(!this.visible)return null;for(let n of this.labels){if(!n.pill.visible())continue;let o=n.plate.width()/2,r=n.plate.height()/2;if(Math.abs(e.x-n.text.x())<=o&&Math.abs(e.y-n.text.y())<=r)return n.cluster}return null}size(e,i){let n=Math.max(e,1e-4),o=i<U,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=dt(ct,i),a=Ps/n,l=Rs/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:f}=c;d.text(mo(c.label,o)),d.fontStyle(o?xs:Te);let m=s,y=0;for(;d.fontSize(Math.max(1,m/n)),d.letterSpacing(d.fontSize()*De),y=Kl(d.fontSize())+d.width()+a*2,!(y<=f.bounds.width||m<=Oe);)m=Math.max(Oe,m-1);let p={x:f.bounds.x+f.bounds.width/2,y:f.bounds.y+f.bounds.height/2},g=d.height()+l*2,b=y-a*2,S=p.x-b/2;h.radius(Xl(d.fontSize())),h.position({x:S+h.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Kl(d.fontSize()),y:p.y}),u.size({width:y,height:g}),u.offset({x:y/2,y:g/2}),u.cornerRadius(g/2),u.strokeWidth($e/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=yo(e,this.host.seatR()),o=So(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=Wl(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)}},Lf=.18;function Cf(t,e){let i=(n,o,r)=>{let s=o*Lf;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 Tf}from"konva/lib/shapes/Circle";import{Line as If}from"konva/lib/shapes/Line";function Yl(t,e,i){let n=t.seatRadius(),o=new Tf({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 Ul(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 If({x:r.x,y:r.y,points:o.flatMap(u=>[u.x-r.x,u.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=u=>{if(t.isDestroyed()||!s.getLayer())return;let h=Math.max(0,Math.min(1,(u-l)/c)),m=1+(1-Math.pow(1-h,3))*.04;s.scale({x:m,y:m}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Ff}from"konva/lib/Group";import{Shape as _f}from"konva/lib/Shape";import{Group as Pf}from"konva/lib/Group";import{Shape as Rf}from"konva/lib/Shape";function Mf(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 Af(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 Af(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 Ge(t,e,i,n){let o=kn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new Rf({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return Mf(l,h,r);l.moveTo(h[0].x,h[0].y);for(let f=1;f<h.length;f+=1)l.lineTo(h[f].x,h[f].y);l.closePath()}};n?(h=>{l.moveTo(h.start.x,h.start.y);let f=h.start;for(let m of h.segments)m.kind==="line"?l.lineTo(m.end.x,m.end.y):m.kind==="arc"?l.arc(m.center.x,m.center.y,m.radius,Math.atan2(f.y-m.center.y,f.x-m.center.x),Math.atan2(m.end.y-m.center.y,m.end.x-m.center.x),!m.clockwise):l.bezierCurveTo(m.control1.x,m.control1.y,m.control2.x,m.control2.y,m.end.x,m.end.y),f=m.end;l.closePath()})(n):d(t);for(let h of rr(e)){let f=kn(h)>0;d(f===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=Ef(t,n);return s.getSelfRect=()=>({...a}),s}var bt=class extends Pf{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 $l(t,e){if(!e.length)return null;let i=new Ff({listening:!1});for(let n of e)i.add(Ge(n.outline,n.holes,{fill:Hs,stroke:G("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function ql(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 _f({fill:t.canvasBackground,opacity:1-Ie,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 Bf=.2;function Zl(t,e){return t.startsWith("#")?j(e,t,Bf):t}var tc=.5,$=Math.SQRT1_2,Of="#f3f4f6",Ql=4;function Df(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?tc:Math.min(1,Math.max(0,e))}function Nf(t){return t==="booked"||t==="not_for_sale"?Os:Bs}function jl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Jl(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 Hf(t,e,i){let n=Jl(t),o=Jl(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(jl(n,a)*(1-r)+jl(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function ec(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 Gf(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-Ql;o<=Ql;o++){let r=o*n*2,s=r+n,a=r*$,l=-r*$,c=s*$,d=-s*$;t.moveTo(a+i*$,l+i*$),t.lineTo(a-i*$,l-i*$),t.lineTo(c-i*$,d-i*$),t.lineTo(c+i*$,d+i*$),t.closePath()}t.clip()}function Oi(t,e){t._sceneFunc(e)}function ic(t){let e=this,i=e.attrs,n=i.markRadius||1,o=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(n*2*s<16){i.fill=i.markMidtone??o,Oi(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??tc))*n;t.save(),ec(t,l,n,1),i.fill=i.markBase??o,Oi(e,t),t.restore(),t.save(),ec(t,l,n,-1),i.fill=i.markFill??o,Oi(e,t),i.markHatch&&(Gf(t,n),i.fill=Of,Oi(e,t)),t.restore(),i.fill=o}function Wf(t,e,i,n,o,r){let s=Df(e),a=Nf(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=Hf(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(ic)}function Vf(t){t.setAttr("sceneFunc",void 0)}function Ni(t){return t.attrs.sceneFunc===ic}var Di=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let n=new Set;for(let[o,r]of Object.entries(e))i.has(o)&&(r&&r.kind==="partial"?(this.marks.set(o,r),n.add(o)):this.marks.delete(o)&&n.add(o));return n}paint(e,i,n,o,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Ni(e)&&Vf(e);return}Wf(e,l,n,o,r,s)}};var nc="#9ca3af";var zf="#f4b740",Kf="#854d0e",Xf="#1a1200",Yf="#f1f4f9",Uf="#1a2234",$f="#475569",qf="#c3cbdc";function Zf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function oc(t,e=!1,i=!1){if(!Zf(t))return null;if(e){if(t==="not_for_sale"){let n=i?qf:$f;return{fill:i?Uf:Yf,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:nc,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:zf,stroke:Kf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:Xf}}return{fill:nc,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function rc(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 sc(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Hi=Object.freeze([]),Qf=.18;function ac(t,e,i){let n=t.seat(i),o=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(n.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Hi),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=o==="held"&&t.isOwnedHold(i),u=t.organizer?.()??!1,h=d?null:oc(o,u,u&&!H(l));if(h?(e.fill(h.fill),e.stroke(h.stroke),e.strokeWidth(h.strokeWidth),e.dash(h.dash),e.opacity(h.opacity),h.scale!==1&&e.scale({x:h.scale,y:h.scale})):d?(e.fill(se(s,c===mt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===mt?se(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Ni(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(h?"":n.displayLabel??n.label);let L=t.boothExtent(n.rowId);a.fontSize(L?.nameSize??(L?be({...L,text:n.displayLabel??n.label}):ze)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Je),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let f=o==="free"||o==="held"&&!t.isOwnedHold(i),m=()=>{let L=e.fill();typeof L=="string"&&e.fill(Zl(L,l))},y=t.accessFilter();if(y&&f&&!r){let L=Re(n,y);L==="other"?(m(),e.opacity(Math.min(e.opacity(),nl))):L==="companion"&&e.opacity(Math.min(e.opacity(),ol))}let p=t.categoryHighlight();p&&o==="free"&&!r&&n.categoryKey!==p&&e.opacity(.25);let g=t.seatHighlight();g&&!r&&!g.has(i)&&e.opacity(Math.min(e.opacity(),Qf));let b=t.categoryFilter();b&&f&&!r&&!b.has(n.categoryKey)&&(m(),e.opacity(.22)),t.commercialLimitedFilter()&&o==="free"&&!r&&(n.commercial?.restrictedView||n.commercial?.obstructedView)&&e.opacity(.22);let S=t.dimmedSections();if(S.size){let L=t.seatSection(i);(L?S.has(L.id)||S.has(L.logicalId)||L.zone!=null&&S.has(L.zone):S.has(br))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Ds),e.stroke(""),e.strokeWidth(0),e.dash(Hi),e.opacity(Ns),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let w=t.boothLabel(i)??t.seatLabel(i);if(w){w.fill(t.seatLabelInk(n,e));let L=!a&&(r||d);w.visible(ye(w.fontSize(),t.effScale())&&e.opacity()>=.5&&!L)}let k=t.organizerGlyph,v=h?.glyph??null,x=Ni(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(k&&v&&!x){let L=a?t.boothExtent(n.rowId):void 0,C=L?Math.min(L.width,L.height)/2:t.seatRadius();k.apply(e,v,h.glyphInk??"",C),a||w?.visible(!1)}else k?.isPainted(e)&&k.clear(e);let T=t.accessGlyph(i);if(T){let L=e.fill();T.fill(li(typeof L=="string"?L:"")),T.opacity(e.opacity()),T.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function Gi(t,e){let i=null,n=1/0;for(let[o,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),u=Math.abs(e.x-a),h=Math.abs(e.y-l);if(u>c||h>d)continue;let f=u*u+h*h;f<n&&(n=f,i=o)}return i}var jf=Math.log(1.15)/100,Jf=.01,em=220,tm=50;function dc(){return{kind:null,at:-1/0}}function lc(t,e,i){return e===1?t*33:e===2?t*i:t}function hc(t,e,i,n=800){let o=lc(t.deltaX,t.deltaMode,n),r=lc(t.deltaY,t.deltaMode,n),s=i-e.at<em&&e.kind!==null,a,l=t.deltaX===0&&Number.isInteger(t.deltaY)&&Math.abs(t.deltaY)>=tm;return(t.ctrlKey||t.metaKey)&&!(t.deltaMode!==0||l)?a="pinch":t.ctrlKey||t.metaKey?a="notch":s&&e.kind!=="pinch"?a=e.kind:t.deltaMode!==0||l?a="notch":a="pan",e.kind=a,e.at=i,a==="pan"?{kind:"pan",dx:o,dy:r}:a==="pinch"?{kind:"zoom",factor:cc(Math.exp(-r*Jf),.8,1.25),eased:!1}:{kind:"zoom",factor:cc(Math.exp(-r*jf),.5,2),eased:!0}}function cc(t,e,i){return Math.min(i,Math.max(e,t))}var yt=new WeakMap;function Wt(t){let e=yt.get(t);e&&(e.raf&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.raf),yt.delete(t))}function Wi(t,e,i){let{min:n,max:o}=t.bounds(),r=t.stage.scaleX(),s=yt.get(t.stage),a=s?.raf?s.target:r,l=Math.min(o,Math.max(n,a*e));if(t.reducedMotion()||typeof requestAnimationFrame!="function"){Wt(t.stage),t.apply(l,i);return}if(s?.raf){s.target=l,s.point=i;return}if(Math.abs(Math.log(l/r))<.002)return;let c={target:l,point:i,raf:0,last:performance.now()};yt.set(t.stage,c);let d=u=>{let h=yt.get(t.stage);if(h!==c)return;let f=Math.max(0,u-h.last);h.last=u;let m=t.stage.scaleX(),y=Math.log(h.target/m),p=1-Math.exp(-f/55),g=Math.abs(y*(1-p))<.002,b=g?h.target:m*Math.exp(y*p);t.apply(b,h.point);let S=Math.abs(b-m)>1e-9&&t.stage.scaleX()===m;if(g||S){yt.delete(t.stage);return}h.raf=requestAnimationFrame(d)};c.raf=requestAnimationFrame(d)}function Vi(t){return t?.getAttr?.("seatId")??void 0}var zi=.85,im=.38,nm=Object.freeze([3,3]);function om(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function uc(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function rm(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(Vt(t)||(t.clusterLabels.setPressLandsOnChart(!uc(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}var sm=Object.freeze([2,2]);function am(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,pe),l=a?t.seat(a):void 0;if(!a||!l){r();return}a!==o&&(o=a,t.hoverRing.position(l),t.hoverRing.opacity(zi),t.hoverRing.dash(sm),t.hoverRing.visible(!0),t.overlayLayer.batchDraw())};return{move(a){e=a,i||(i=requestAnimationFrame(s))},hide(){e=null,r()},onSeat(a){n=a,a&&(o=null)}}}var Vt=t=>t.seatsPickable()||t.manageSeatHits();function pc(t){t.attachHoverCard();let e=rm(t),i=am(t);t.seatLayer.on("click tap",o=>{if(t.moved()>ke||t.isGhostClick(o))return;let r=Vi(o.target);r&&Vt(t)&&t.handleSeatTap(r)}),t.seatLayer.on("mouseover",o=>{let r=Vi(o.target);if(!r)return;let s=t.seat(r);if(!s)return;i.onSeat(!0),t.setHoveredId(r);let a=lm(t,r);t.hoverRing.position(s),t.hoverRing.opacity(a==="muted"?im:zi),t.hoverRing.dash(a==="muted"?nm:Hi),t.hoverRing.visible(a!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(a==="full"),t.onHover?.(s,{mark:t.seatMark(r),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{i.onSeat(!1),t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let o=t.stage.getPointerPosition();o&&(e(o),i.move(o))}),t.stage.on("mouseleave",()=>i.hide());let n=dc();t.stage.on("wheel",o=>{o.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let r=t.container.getBoundingClientRect(),s={x:o.evt.clientX-r.left,y:o.evt.clientY-r.top},a=hc(o.evt,n,performance.now(),t.stage.height());a.kind==="pan"&&t.panBy?t.panBy(a.dx,a.dy):a.kind==="zoom"&&a.eased&&t.zoomBounds?Wi({stage:t.stage,reducedMotion:t.reducedMotion,bounds:t.zoomBounds,apply:(l,c)=>t.zoomAbout(l,c,"frame")},a.factor,s):a.kind==="zoom"&&t.zoomAbout(t.stage.scaleX()*a.factor,s,"frame"),e(s)}),t.stage.on("click tap",o=>{if(t.moved()>ke||t.isGhostClick(o))return;let r=t.stage.getPointerPosition();if(!r)return;if(t.sectionCount()){let a=t.ownedBadgeAt(t.screenToWorld(r));if(a&&t.focusOwnedSeats(a))return}if(!(Vi(o.target)&&Vt(t))){let a=Gi(t.selectionMarkers(),r);if(a){t.focusSeats([a],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(r))return;if(t.rowLabelAt&&t.selectRow){let a=t.rowLabelAt(r);if(a){t.selectRow(a);return}}if(!t.cached()){if(Vi(o.target)&&Vt(t))return;if(Vt(t)){let a=t.focusedSectionId(),l=t.manageSeatHits(),c=t.nearestSeatToScreen(r,pe),d=c?t.seatSection(c):null;if(c&&(!a||l||d&&t.sectionMatchesFocus(d))){t.handleSeatTap(c);return}let u=c?null:t.nearestSeatToScreen(r,pe,!0),h=u?t.seatSection(u):null;if(u&&(!a||l||h&&t.sectionMatchesFocus(h))){t.handleSeatTap(u);return}if(a&&t.onBackdropTap&&!t.floorOverview()){let m=t.sectionAt(r);if(m&&t.sectionInteractive?.(m)===!1)return;if(m&&m!==a){let y=t.sectionTapAnchor(m,t.screenToWorld(r));t.onSectionTap?t.onSectionTap(m,y):t.focusSection(m,{anchor:y})}else m||t.onBackdropTap();return}if(a||l)return;let f=t.sectionCount()?om(t,r):null;if(!f||t.effScale()>=ie||t.sectionFrameScale(f)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let a=t.floorOverview()?t.sectionAt(r):null,l=(a?t.objectFloor(a):null)??t.deckFloorAt();if(l){t.onDeckTap(l);return}}if(t.sectionCount()){let a=t.screenToWorld(r),l=t.ownedBadgeAt(a);if(l&&t.focusOwnedSeats(l)||!l&&uc(t,r))return;let c=l??t.sectionAt(r);if(c){let d=t.sectionTapAnchor(c,a);t.onSectionTap?t.onSectionTap(c,d):t.focusSection(c,{anchor:d});return}if(!t.pressLandsOnChart(r))return}if(!t.seatsPickable()){let a=t.tableAt?.(r);if(a?.length&&t.focusSeats(a,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(r)||t.clusterLabels.glideTowardTap(r))return;let s=Math.max(ve*1.2,t.stage.scaleX()*2.5);t.zoomAbout(s,r)})}function fc(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 lm(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function mc(t,e){return!e.manageMode||!e.marqueeSelect?!1:t.pointerType!=="touch"&&t.button===0}var gc=450;function bc(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<ae}import{Path as Pg}from"konva/lib/shapes/Path";import{Group as cm}from"konva/lib/Group";import{Line as dm}from"konva/lib/shapes/Line";import{Text as hm}from"konva/lib/shapes/Text";function yc(t,e,i,n){if(!e||!n)return;let o=pr(e,i);if(!o.length)return;let r=new cm({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new dm({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 hm({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 um=10;function pm(t){let e=t.framingViewport();if(t.stage.width()>=U||t.exportMode())return e;let i=um;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 Sc(t){Wt(t.stage);let e=pm(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=mm(t);s&&t.setFitScale(fm);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=Ra(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<ae?ae*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);l>0&&l!==1&&t.setFitScale(t.fitScale()*l),l>0&&(t.afterViewChange(),eo(t.stage,[t.bgLayer,t.seatLayer],e,i)),gm(t,e),t.setFitPose(Qe(t.stage))}t.stage.batchDraw()}var fm=Q*(1-1e-6);function mm(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Q&&e<ve}function gm(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=Ot(t.stage,[t.bgLayer,t.seatLayer],n);if(!o)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&o.x+o.width<=e.x+e.width-r)return;let s=e.height-i;if(o.height<=s){eo(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+Pi-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function zt(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,Ue*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function vc(t,e,i,n="now"){let o=t.stage.position();vl(t.stage,e,i,zt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.gestureFrame?.(),t.updateSeatGroupVisibility(),kc(t)):t.afterViewChange(),t.stage.batchDraw())}function wc(t,e,i){let n=t.stage.position();t.stage.position(t.constrainPan({x:n.x-e,y:n.y-i},n)),t.gestureFrame?.(),t.updateSeatGroupVisibility(),kc(t),t.stage.batchDraw()}function kc(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function xc(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function bm(t,e,i,n,o=0){wl(t.stage,e,zt(t),i,Kt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function Lc(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){bm(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Kt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=zt(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=q(Math.max(d,u),a,Math.max(u,Gt({min:a,max:l},i?.maxScale))),f=o.x+r/2-(n.x+n.width/2)*h,m=o.y+s/2-(n.y+n.height/2)*h,y=t.stage.scaleX(),p=t.stage.x(),g=t.stage.y();if(Math.abs(h-y)<1e-4&&Math.abs(f-p)<.5&&Math.abs(m-g)<.5){t.settleView();return}let b=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let w=k=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(k-b)/S),x=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,T=y+(h-y)*x;t.stage.setAttrs({scaleX:T,scaleY:T,x:p+(f-p)*x,y:g+(m-g)*x}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(w)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(w))}function Kt(t,e){let i=Math.max(0,Math.min(e,t.width/3,t.height/3));return i===0?t:{x:t.x+i,y:t.y+i,width:t.width-i*2,height:t.height-i*2}}import{Text as ym}from"konva/lib/shapes/Text";function Cc(t){let e=new WeakMap;return()=>{let i=t(),n=i.labelFont(),o=je(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===n&&r.generation===o)return r.value;let s=Sm(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function Sm(t){let e=1/0,i=new ym({fontSize:ge,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?be({...u,text:s.displayLabel??s.label}):ze);continue}let a=ge*t.seatLabelScale(s),l=si(s.displayLabel??s.label),c=o.get(a);c||o.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>n?Math.max(lt,a*n/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=lt)break}i.destroy();let r=Number.isFinite(e)?e:ze;return V/Math.max(lt,r)}function Ic(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:Tc(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:Tc(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function Tc(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 vo={top:0,right:0,bottom:0,left:0};function Pc(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)}:{...vo}}var vm=.7;function Rc(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,f,m)=>{let y=h+f,p=m*vm;if(y<=p||y<=0)return[h,f];let g=p/y;return[h*g,f*g]},[l,c]=a(s,o,t),[d,u]=a(n,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-u)}}function Mc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function Ec(t,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(t.scale({x:e.scale,y:e.scale}),t.position({x:e.x,y:e.y}),!0)}function Ki(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Ac(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 wo(t,e,i,n,o,r,s){if(!e)return{box:{x:i,y:n,width:0,height:0},fitWidth:0,fitHeight:0,x:i,y:n,baseFontSize:o,insideInk:r,fill:s};let a=((t??0)%180+180)%180,l=a*Math.PI/180,c=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=e.x+e.width/2,h=e.y+e.height/2,f=e.width*c+e.height*d,m=e.width*d+e.height*c,y={x:u-f/2,y:h-m/2,width:f,height:m},p=a===0?[e.width,e.height]:a===90?[e.height,e.width]:[Math.min(e.width,e.height),Math.min(e.width,e.height)];return{box:y,fitWidth:p[0],fitHeight:p[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var Fc=V,wm=3,km=.5;function xm(t){return Y(t,H(t)?"#475569":"#cbd5e1")}function _c(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function Lm(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=Fc){let u=t.measure(n.baseFontSize);return i.occupied.insert(_c(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=Fc/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*km)return{visible:!1,reason:"shape-too-small"};let a=wm/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=_c(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 Bc(t){let e=[],i=new me,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&&at(o,a,{mode:"overlap"}).length>0,occupied:i},s=xm(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=Lm({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);Cm(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function Cm(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 Oc(t){let e=t.map((n,o)=>({text:n,order:o})).filter(({text:n})=>n.node.visible()).sort((n,o)=>o.text.baseFontSize-n.text.baseFontSize||n.order-o.order),i=[];for(let{text:n}of e){let o=n.node.getClientRect({skipShadow:!0,skipStroke:!0}),r=n.node.fontSize()>n.baseFontSize;if(i.some(s=>(r||s.floored)&&io(o,s.box))){n.node.visible(!1),n.backdrop?.visible(!1);continue}i.push({box:o,floored:r})}}function Dc(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 ko(t,e,i,n){let o=Tm(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 Tm(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,ci/2/n),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!o||a<o.distance)&&(o={table:r,distance:a})}return o?.table??null}function Hc(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?ls:as}function Gc(t){return Math.max(t*1.05,Jr,Q*1.3)}var Im=42;function Wc(t){return Im/(2*Math.max(t,1e-4))}function et(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 y of r){let p=(y.x-c.x)**2+(y.y-c.y)**2;p<u&&(d=y,u=p)}let h=e/(s*a),f=i/(s*a),m=et(r,0);return{bounds:{x:Nc(d.x,h,m.x,m.width),y:Nc(d.y,f,m.y,m.height),width:h,height:f},minScale:s}}function Nc(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 Rm}from"konva/lib/Shape";var zc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},Pm=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=zc(o);if(!(r&&r>0)||s==null)continue;let a=Pm(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=zc(l),d=Math.hypot(a.seat.x-l.x,a.seat.y-l.y),u=e.get(a.seat.rowId),h=Math.max(1e-6,u*1e-6);(c==null||a.index!==c+1||d<=h||d>u*1.5)&&s()}r.push(a.seat)}s()}return n}var Xt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15;this.paints=new Map}get active(){return this.entries.length>0}paint(e,i){let n=`${e}|${i}`,o=this.paints.get(n);return o===void 0&&(this.paints.size>512&&this.paints.clear(),o=G(e,i),this.paints.set(n,o)),o}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,n,o,r,s,a,l,c=()=>1,d=()=>!1,u=()=>1/0){if(!l||!e||!n){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let m of[...e.objects,...(e.floors??[]).flatMap(y=>y.objects)])m.type==="row"&&this.spacing.set(m.id,m.seatSpacing)}if(this.focusKey!==n&&(this.focusKey=n,this.detailScale=Math.min(Math.max(1.15,c()*1.15),u()*.9)),o>=this.detailScale){this.clear();return}let h=i.filter(m=>m.id===n||m.logicalId===n||d(m)),f=h.map(m=>m.id).join("|");if(!(this.key===f&&this.active)){this.clear(),this.key=f;for(let m of h){if(m.memberIds.length>2e3||m.memberIds.some(g=>!a.has(g)||!this.spacing.has(s.get(g)?.rowId??"")))continue;let y=Kc(m.memberIds.map(g=>s.get(g)).filter(Boolean),this.spacing);if(!y.length||y.reduce((g,b)=>g+b.seats.length,0)!==m.memberIds.length)continue;let p=new Rm({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:g=>{let b=g._context,S=p.getStage(),w=S&&S.width()<=U?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;b.save(),b.lineWidth=w*2,b.lineCap="round",b.lineJoin="round";let k=v=>{let x=a.get(v.id);return this.paint(String(x.fill()),x.opacity())};for(let v of y){let x=v.points;if(x.length===1){b.fillStyle=k(v.seats[0]),b.beginPath(),b.arc(x[0].x,x[0].y,w,0,Math.PI*2),b.fill();continue}let T=v.seats.map(k),P=(R,M)=>{let E=Math.hypot(M.x-R.x,M.y-R.y);return{x:-(M.y-R.y)/E,y:(M.x-R.x)/E}},L=x.map((R,M)=>{let E=x[Math.max(0,M-1)],A=x[Math.min(x.length-1,M+1)];return Math.hypot(A.x-E.x,A.y-E.y)>.001?P(E,A):P(x[M],x[M+1]??x[M-1])}),C=(R,M,E)=>({x:R.x+M.x*w*E,y:R.y+M.y*w*E}),I=0;for(;I<x.length;){let R=I;for(;R+1<x.length&&T[R+1]===T[I];)R++;let M=I===0?x[0]:{x:(x[I-1].x+x[I].x)/2,y:(x[I-1].y+x[I].y)/2},E=R===x.length-1?x[R]:{x:(x[R].x+x[R+1].x)/2,y:(x[R].y+x[R+1].y)/2},A=I===0?L[0]:P(x[I-1],x[I]),_=R===x.length-1?L[R]:P(x[R],x[R+1]),F=[M,...x.slice(I,R+1),E],N=[A,...L.slice(I,R+1),_],oe=F.map((O,z)=>C(O,N[z],1)),W=F.map((O,z)=>C(O,N[z],-1));b.fillStyle=T[I],b.beginPath(),b.moveTo(oe[0].x,oe[0].y);for(let O of oe.slice(1))b.lineTo(O.x,O.y);if(R===x.length-1){let O=Math.atan2(_.y,_.x);b.arc(E.x,E.y,w,O,O-Math.PI,!0)}else b.lineTo(W[W.length-1].x,W[W.length-1].y);for(let O of W.slice(0,-1).reverse())b.lineTo(O.x,O.y);if(I===0){let O=Math.atan2(-A.y,-A.x);b.arc(M.x,M.y,w,O,O-Math.PI,!0)}b.closePath(),b.fill(),I=R+1}}b.restore()}});this.entries.push({section:m,shape:p,opacity:m.liftGroupSeat.opacity(),listening:m.liftGroupSeat.listening()}),m.liftGroupBg.add(p),m.liftGroupSeat.opacity(0),m.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as Mm}from"konva/lib/shapes/Text";var Xc=new WeakMap,Em=(t,e)=>{let i=new Mm({text:t,fontSize:Et,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function Yc(t,e,i,n=Em){let o=Xc.get(t);o||Xc.set(t,o=new Map);let r=`${e}\0${je()}`,s=o.get(r);s||o.set(r,s=new Map);let a=s.get(i);if(a!==void 0)return a;let l=0;for(let d of t){if(!d.focusKeys?.includes(i))continue;let u=n(d.text,e);l=Math.max(l,u.width,u.height)}let c=l>0?Math.ceil(l+V+ee*2+6):0;return s.set(i,c),c}function Uc(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 xo=1e6;function Am(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function Lo(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Xi=class{constructor(e,i=Am()){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(!Lo(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(xo+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(Lo(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(xo+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!Lo(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(xo+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<es}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))},gc)));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=q(this.pinch.startScale*(o/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=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 Fm}from"konva/lib/shapes/Circle";import{Group as _m}from"konva/lib/Group";import{Line as Bm}from"konva/lib/shapes/Line";import{Text as Om}from"konva/lib/shapes/Text";var Dm=11,Nm=.3,Hm=.08;function Qc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function Gm(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?B("map.soldOut"):t.wheelchairFree!=null?t.wheelchairFree<=0?B("map.noWheelchairSpace"):B("map.seatsLeft",{count:t.wheelchairFree}):B("map.seatsLeft",{count:t.available})}function jc(t,e){return e&&t.available!=null&&t.available<=0}function Wm(t,e){return jc(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function Jc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=Wm(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?Xe*Hm:o?Xe*Nm:Xe),e.polygon.listening(!t.exportMode&&!n&&!i&&!jc(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),Vm(t,e,o,r,n,t.dimmed(e.categoryKey))}}function Vm(t,e,i,n,o,r){if(e.capacityNode){let s=Gm(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}zm(t,e,o||r),n>0&&!o?$m(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var Co=9,$c=.86;function zm(t,e,i){Km(t,e,i),To(e)}function To(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/Se;e.scale({x:o,y:o}),e.offset({x:Se/2,y:Se/2}),e.position({x:i.x()-i.width()/2-n*.7,y:i.y()-i.offsetY()+i.height()/2}),e.visible(!0)}function Km(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=Xm(e,r),a=qc(n,e.nameSize??oi,s.width*$c,r),l=qc(o,ri,s.width*$c,r),c=a!=null,d=l!=null&&(n?c&&a+l+Co<=s.height:l<=s.height);Zc(n,c?a:null,e.labelPoint.y-Co/r,r),Zc(o,d?l:null,n?e.labelPoint.y+Co/r:e.labelPoint.y,r)}function Xm(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 qc(t,e,i,n){if(!t||!t.text())return null;t.fontSize(e/n);let o=t.width()*n;if(o<=i||o<=0)return e;let r=e*(i/o);return r>=V?r:null}function Zc(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 Ym=.72;function Um(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*Ym;return{x:n+r,y:o-r}}function $m(t,e,i,n){let o=Dm;if(!e.chip){let a=new _m({listening:!1});a.add(new Fm({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new Bm({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 Om({x:o*.12,y:-o*.5,text:String(i),fontSize:o,fontStyle:"800",fontFamily:t.labelFont(),listening:!1,perfectDrawEnabled:!1});a.add(l),t.bgLayer.add(a),e.chip=a,e.chipText=l}let r=Dt(t.selectionColor),s=e.chip.findOne(".ga-chip-disc");s?.fill(t.selectionColor),s?.stroke(G(r,.35)),e.chip.findOne(".ga-chip-tick")?.stroke(r),e.chipText&&(e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText.fill(r)),e.chip.position(Um(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function ed(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 td(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 qm(t){let{sections:e,viewCentre:i,focusedSectionId:n}=t;if(n){let s=e.findIndex(a=>a.id===n||a.logicalId===n);if(s>=0)return s}let o=-1,r=1/0;return e.forEach((s,a)=>{if(s.outline.length<3)return;let l=K(s.outline),c=i.x>=l.x&&i.x<=l.x+l.width&&i.y>=l.y&&i.y<=l.y+l.height,d=l.x+l.width/2-i.x,u=l.y+l.height/2-i.y,h=(c?0:1e12)+d*d+u*u;h<r&&(o=a,r=h)}),o}function Zm(t){let{rung:e,viewCentre:i,target:n,width:o,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(f=>{let m=K(f.outline);return{x:m.x+m.width/2,y:m.y+m.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(f=>Math.abs(f.x-i.x)<=d&&Math.abs(f.y-i.y)<=u)){let f=c.reduce((m,y)=>{let p=(y.x-i.x)**2+(y.y-i.y)**2;return p<m.distance?{point:y,distance:p}:m},{point:c[0],distance:1/0});s=f.point.x,a=f.point.y}}let l=e==="seats"?t.seats.filter(c=>c.kind!=="booth"):[];if(l.length>0){let c=l[0],d=1/0;for(let u of l){let h=u.x-i.x,f=u.y-i.y,m=h*h+f*f;m<d&&(c=u,d=m)}s=c.x,a=c.y}return{x:s,y:a}}function id(t){if(t.rung==="sections")return{bounds:t.bounds};let e=qm(t);if(e>=0)return{bounds:K(t.sections[e].outline),minScale:t.seatFloor};let i=t.seatScale,{x:n,y:o}=Zm({...t,rung:"seats",target:i}),r=t.width/(i*1.12),s=t.height/(i*1.12);return{bounds:{x:n-r/2,y:o-s/2,width:r,height:s}}}var nd=["pointerdown","pointermove","mousedown","mousemove","touchstart","click"],Yi=class{constructor(e=()=>{}){this.onEnd=e;this.until=0;this.timer=null;this.holding=!1;this.stale=new Set;this.flushNow=()=>this.flush();this.container=null}get active(){return this.holding}listen(e){this.container=e;for(let i of nd)e.addEventListener(i,this.flushNow,{capture:!0,passive:!0})}wrap(e){let i=e.drawHit;e.drawHit=((n,o)=>this.active&&!n?(this.stale.add(e),e):i.call(e,n,o))}bump(){typeof setTimeout=="function"&&(this.holding=!0,this.until=performance.now()+120,this.timer||this.arm(120))}arm(e){this.timer=setTimeout(()=>{this.timer=null;let i=this.until-performance.now();if(i>1){this.arm(i);return}this.flush()},e)}flush(){let e=this.holding;if(this.holding=!1,this.timer&&(clearTimeout(this.timer),this.timer=null),this.stale.size){let i=[...this.stale];this.stale.clear();for(let n of i)n.getStage()&&n.drawHit()}e&&this.onEnd()}destroy(){if(this.timer&&clearTimeout(this.timer),this.timer=null,this.holding=!1,this.stale.clear(),this.container)for(let e of nd)this.container.removeEventListener(e,this.flushNow,{capture:!0});this.container=null}};var Ui=class{constructor(){this.since=new Map;this.shown=new Set;this.wanted=new Set}begin(){this.wanted=new Set}admit(e,i,n){this.wanted.add(e);let o=this.since.get(e);return o===void 0&&(o=i,this.since.set(e,i)),!n||this.shown.has(e)||i-o>=150?(this.shown.add(e),!0):!1}end(){for(let e of[...this.since.keys()])this.wanted.has(e)||(this.since.delete(e),this.shown.delete(e))}reset(){this.since.clear(),this.shown.clear(),this.wanted.clear()}};function od(t,e,i,n){if(t.length<3)return[];let o=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<o&&(o=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-o)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e)d.x<o||d.x>r||d.y<s||d.y>a||Jt(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function Qm(t){return t.logicalRowId??t.rowId}function rd(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(Qm(o)!==t||!i(o.id)||n.push(o.id));return n}function sd(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 jm}from"konva/lib/shapes/Line";import{Rect as Jm}from"konva/lib/shapes/Rect";var $i=class{constructor(e){this.host=e;this.box=null;this.lasso=null;this.remove=!1}active(){return this.box!==null||this.lasso!==null}begin(e,i,n=!1){this.cancel(),this.remove=n;let o=this.host.screenToWorld(e),r=this.host.stageScale()||1,s={stroke:n?"#d64545":this.host.selectionColor(),strokeWidth:1.5/r,dash:[5/r,4/r],fill:n?"rgba(214,69,69,0.10)":"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let a=new jm({...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 Jm({...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(od(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)}),h=>Jt(h,l));return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let n=Math.min(i.start.x,i.cur.x),o=Math.max(i.start.x,i.cur.x),r=Math.min(i.start.y,i.cur.y),s=Math.max(i.start.y,i.cur.y);if((o-n)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats())l.x<n||l.x>o||l.y<r||l.y>s||this.host.isSelectable(l.id)&&a.push(l.id);this.apply(a,l=>l.x>=n&&l.x<=o&&l.y>=r&&l.y<=s)}apply(e,i){this.host.applyBand(e,i,this.remove),this.host.selectionChanged()}};var qi=class{constructor(e){this.sync=e;this.depth=0;this.pending=!1}request(){if(this.depth>0){this.pending=!0;return}this.sync()}batch(e){this.depth+=1;try{return e()}finally{this.depth-=1,this.depth===0&&this.pending&&(this.pending=!1,this.sync())}}};import{Rect as ad}from"konva/lib/shapes/Rect";import{Text as eg}from"konva/lib/shapes/Text";function ld(t){let e=t.effScale(),i=t.stage.scaleX(),n={width:t.stage.width(),height:t.stage.height()},o=p=>Math.round(p*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(p=>[String(p.getAttr("seatId")??""),String(p.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(p=>{let g=t.circleById.get(p.id),b=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=p.kind==="booth"?ze:ge*t.seatLabelScale(p),w=o((b?.fontSize()??S)*e),k=t.worldToScreen(p),v=b?b.width()*i:0,x=b?b.height()*e:0,T=k.x-v/2<0||k.x+v/2>n.width||k.y-x/2<0||k.y+x/2>n.height,P=t.focusedSeatOpacity(p.id,g?.getAbsoluteOpacity()??0),L=t.seatSection.get(p.id),C=!!b?.isVisible()&&P>=.5&&!T,I;C||(P<.5?I="dimmed-or-unavailable":w<V?I="below-minimum-size":T?I="outside-viewport":b?I="renderer-hidden":I=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=g instanceof ad?g.width()*i:t.seatR*2*e,M=g instanceof ad?g.height()*e:t.seatR*2*e,E=2*(t.seatR*e+pe),A=g?.fill(),_=b?.fill(),F=t.accessGlyphById.get(p.id),N=F?.getAbsoluteScale();return{seatId:p.id,label:p.label,kind:p.kind==="booth"?"booth":"seat",markerShape:p.kind==="booth"?"booth":p.wheelchairSpaceType==="no-seat"?"square":"circle",...p.wheelchairSpaceType?{wheelchairSpaceType:p.wheelchairSpaceType}:{},categoryKey:p.categoryKey,...L?{sectionId:L.id}:{},...L?.zone?{zoneId:L.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:C,renderedFontPx:w,fill:typeof A=="string"?A:"",ink:typeof _=="string"?_:g?t.seatLabelInk(p,g):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:o(P),...F?{accessibilityMarker:{glyphVisible:F.isVisible(),glyphWidthPx:o(Se*Math.abs(N?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!g?.isVisible()&&!!g?.isListening()&&t.isSelectable(p.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),E))},screenCenter:{x:o(k.x),y:o(k.y)},...C?{screenBox:{x:o(k.x-v/2),y:o(k.y-x/2),width:o(v),height:o(x)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(p=>p.visible).length,l=(p,g,b,S,w,k,v)=>{let x=pt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),T=K(x.map(M=>t.worldToScreen(M))),P=o(S.opacity()),L=S.fill(),C=T.x+T.width<0||T.x>n.width||T.y+T.height<0||T.y>n.height,I=S.isVisible()&&P>.05&&!C,R=k?ft({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),k.outline,k.holes):void 0;return{id:p,kind:g,role:b,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:P,fill:w,ink:typeof L=="string"?L:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(T.x),y:o(T.y),width:o(T.width),height:o(T.height)}}:{}}},c=p=>{let g=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof g=="string"&&g)return g;let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},d=p=>{let g=p.blockPoly.fill();return typeof g=="string"?g:p.baseFill},u=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,Ft(n.width))),...t.sections.map(p=>l(`${p.id}:availability`,"section","availability",p.subLabel,c(p),p)),...t.sections.map(p=>l(`${p.id}:number`,"section","number",p.numberLabel,d(p),p,bi(n.width))),...t.zones.flatMap(p=>[l(p.id,"zone","name",p.label,p.background),...p.sub?[l(`${p.id}:price`,"zone","price",p.sub,p.background)]:[]])],h=[...t.gaById].map(([p,g])=>{let b=g.points.map(C=>t.worldToScreen(C)),S=Math.min(...b.map(C=>C.x)),w=Math.min(...b.map(C=>C.y)),k=Math.max(...b.map(C=>C.x)),v=Math.max(...b.map(C=>C.y)),x=k<0||S>n.width||v<0||w>n.height,T=o(g.polygon.opacity()),P=T>=.1&&!x,L=g.polygon.fill();return{areaId:p,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:P,interactive:g.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:g.effectiveBackground,...P?{screenBox:{x:o(S),y:o(w),width:o(k-S),height:o(v-w)}}:{}}}),f=[...t.freeTextById].map(([p,g])=>{let{node:b,kind:S}=g,w=g.plate&&g.plate.opacity()>.05?g.plate.fill():null,k=typeof w=="string"&&w?w:g.background,v=t.worldToScreen({x:b.x(),y:b.y()}),x=b.width()*i,T=b.height()*e,P=v.x-b.offsetX()*i,L=v.y-b.offsetY()*e,C=o(b.fontSize()*e),I=P+x<0||P>n.width||L+T<0||L>n.height,R=b.isVisible()&&!I,M=b.fill(),E=o(b.getAbsoluteOpacity()),A;return R||(C<V?A="below-minimum-size":I?A="outside-viewport":A="renderer-hidden"),{objectId:g.objectId??p,kind:S,text:b.text(),visible:R,renderedFontPx:C,ink:typeof M=="string"?M:"",background:k,opacity:E,...R?{screenBox:{x:o(P),y:o(L),width:o(x),height:o(T)}}:{},...A?{hiddenReason:A}:{}}}),m=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof eg).map(p=>{let g=p.getClientRect({skipShadow:!0,skipStroke:!0}),b=g.x+g.width<0||g.x>n.width||g.y+g.height<0||g.y>n.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!b,renderedFontPx:o(p.fontSize()*e),ink:typeof S=="string"?S:"",...b?{}:{screenBox:{x:o(g.x),y:o(g.y),width:o(g.width),height:o(g.height)}}}}),y=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:V,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((p,g)=>p+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(p=>String(p.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:t.effSelection,focusedSectionId:t.focusedSectionId,focusBackdropVisible:!!t.focusBackdrop?.isVisible(),categoryFilterKeys:t.categoryFilter?[...t.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(p=>{let g=p.blockPoly.fill();return typeof g!="string"||!On(t.canvasBackground,g)}).length,tintedSectionShells:y.filter(p=>{let g=p.blockPoly.fill();return typeof g=="string"&&Ks(t.canvasBackground,g)}).length,visibleCategoryDetailOutlines:t.sections.filter(p=>p.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(p=>p.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(p=>p.sectionId!=null&&p.polygon.opacity()>.05).length},labels:s,gaAreas:h,hierarchyLabels:u,freeTextLabels:f,rowLabels:m}}import{Circle as dg}from"konva/lib/shapes/Circle";import{Ellipse as hg}from"konva/lib/shapes/Ellipse";import{Line as ug}from"konva/lib/shapes/Line";import{Arrow as pg}from"konva/lib/shapes/Arrow";import{Path as fg}from"konva/lib/shapes/Path";import{Rect as Yt}from"konva/lib/shapes/Rect";import{Text as Ro}from"konva/lib/shapes/Text";import{Image as fd}from"konva/lib/shapes/Image";import{Group as cd}from"konva/lib/Group";import{Circle as tg}from"konva/lib/shapes/Circle";import{Path as ig}from"konva/lib/shapes/Path";function ng(t,e){let i=e?.trim();return i&&i.toLowerCase()!==Dr?i:Mt[t.group]}var dd=new WeakMap;function Zi(t){let{icon:e,size:i}=t,n=ng(e,t.color),o=H(n)&&n!==Mt[e.group]?Tr:pi,r=H(t.background)?0:i*xn.ringRatio,s=t.listening??!1,a=new cd({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new tg({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:Ir,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*xn.glyphScale,c=new ig({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/Ln,scaleY:l/Ln,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),dd.set(a,{glyph:c,icon:e}),a}function Io(t,e,i){let n=t instanceof cd?dd.get(t):void 0;if(n?.icon.solidLarge){let o=Br(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function hd(t,e,i){let n=fi("wheelchair"),o=Wr(t);if(!n||!o)return null;let r=Gr(e),s=Zi({icon:n,x:o.x-r/2,y:o.y-r/2,size:r,background:i,listening:!1});return s.name("step-free-route-mark"),s}import{Group as og}from"konva/lib/Group";import{Path as rg}from"konva/lib/shapes/Path";import{Rect as sg}from"konva/lib/shapes/Rect";import{Text as ag}from"konva/lib/shapes/Text";function lg(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function cg(t,e,i={}){let n=t.height??40,o=t.width??n*3,r=(t.x??0)+o/2,s=(t.y??0)+n/2,a=n*.46,l=pi,c=new ag({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?Or("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,f=u+h+c.width(),m=Math.max(o,f+n),y=new og({name:"gate-sign",x:r,y:s,rotation:lg(t.rotation??0),listening:i.hitTarget===!0});y.add(new sg({name:"gate-sign-pill",x:-m/2,y:-n/2,width:m,height:n,cornerRadius:n/2,fill:t.fill??Mt.navigation,stroke:l,strokeWidth:Math.max(1,n*.05),opacity:i.organizerOnly?.55:1,dash:i.organizerOnly?[n*.2,n*.12]:void 0,listening:i.hitTarget===!0,perfectDrawEnabled:!1}));let p=-f/2;return d&&(y.add(new rg({name:"gate-sign-step-free",data:d,x:p,y:-u/2,scaleX:u/24,scaleY:u/24,fill:l,listening:!1,perfectDrawEnabled:!1})),p+=u+h),c.position({x:p,y:-c.height()/2}),y.add(c),y.setAttr("gateSignHeight",n),{group:y,fontSize:a,bounds:{x:r-m/2,y:s-n/2,width:m,height:n}}}function ud(t,e){if(e.gate.hideFromBuyers)return;let i=cg(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 md(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 fd({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 gd(t,e){let i=new window.Image,n=new fd({image:i,x:e.x+e.width/2,y:e.y+e.height/2,offsetX:e.width/2,offsetY:e.height/2,width:e.width,height:e.height,rotation:e.rotation??0,opacity:q(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(n):t.bgLayer.add(n),e.role&&t.landmarkBoxes.push(K(pt({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 bd(t,e){let i=e.fill??t.theme.decorFill??ro,n=se(i,.12);if(e.shape==="round")t.bgLayer.add(new dg({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:n,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Yt({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:n,strokeWidth:1.5,cornerRadius:4,listening:!1}))}if(!It(e))return;let o=Ut(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,Y(i,t.theme.textColor??"#cbd5e1"),Ke(e)??Lr,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var mg=8,gg=6;function bg(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(mg,e*.35),o=Math.max(gg,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function yd(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??Y(i,t.theme.textColor??sl),o=e.semanticKind==="icon"?fi(e.iconKey):void 0;if(o){let d=Zi({icon:o,x:e.position.x,y:e.position.y,size:e.fontSize,rotation:e.rotation,color:e.color,background:t.canvasBackground});t.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),t.bgLayer.add(d);return}let r=e.background?.padding??0,s=e.opacity??1,a=cr(e),l=new Ro({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:so(e.bold,e.italic,"600"),fill:n,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;e.background&&(c=new Yt({x:e.position.x,y:e.position.y,...bg(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 Sd(t,e){if(Kr(e)){ud(t,e);return}let i=e.fill??t.theme.decorFill??ro,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=lr(e),a=le(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?se(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?q(e.opacity,.1,1):1,f=0,m=0,y=null;if(c&&e.points&&e.points.length>=2){f=e.points.reduce((k,v)=>k+v.x,0)/e.points.length,m=e.points.reduce((k,v)=>k+v.y,0)/e.points.length;let p=Vr(e),g=zr(u),b=Nr(e),S=new pg({points:e.points.flatMap(k=>[k.x,k.y]),closed:!1,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:u,opacity:h,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path",...b?{dash:Hr(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let w=b?hd(e,u,t.canvasBackground):null;w&&t.bgLayer.add(w)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=n?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Be(l,.3),1,se(l,.12)]}:{fill:l};f=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Yt({x:f,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:u,cornerRadius:q(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){f=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height};let p=n?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Be(l,.3),1,se(l,.12)]}:{fill:l};t.bgLayer.add(new hg({x:f,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:u,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=er(e),g=K(p);f=e.points.reduce((w,k)=>w+k.x,0)/e.points.length,m=e.points.reduce((w,k)=>w+k.y,0)/e.points.length,y=g;let b=n?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,Be(l,.3),1,se(l,.12)]}:{fill:l},S=Ge(p,tr(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},Jo(e)??void 0);S.setAttrs({x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,...b}),t.bgLayer.add(S)}y&&e.role&&t.landmarkBoxes.push(y);for(let p of or(e))t.bgLayer.add(new ug({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:p.ink??nr,fill:p.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(n){let{node:p,spec:g}=Sg(t,f,m,e.label,l,y,e.labelStyle);t.primaryFocalLabels.set(p,g),t.freeTextById.set(e.id,{node:p,background:l,plate:g.plate,kind:"stage"})}else if(r){let p=o||s,g=Y(l,p?"#e6e9f0":"#9aa3b5"),b=Ut(t,t.bgLayer,e.label,f,m,g,p?18:12,!1);p&&t.primaryFocalLabels.set(b,{targetPx:18,trackingRatio:0,ink:String(b.fill()??""),plateInk:String(b.fill()??""),plate:new Yt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:b,background:l,kind:"decor",...p?{}:{area:wo(e.rotation,y,f,m,12,g,l)}})}else{let p=Y(l,"#cbd5e1"),g=Ut(t,t.bgLayer,e.label,f,m,p,16,!0);t.freeTextById.set(e.id,{node:g,background:l,kind:"decor",area:wo(e.rotation,y,f,m,16,p,l)})}}var Po=22,pd=V,Qi=6,yg=.5;function Sg(t,e,i,n,o,r,s){let a=s?.size??Po,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??Y(o,l),d=r?r.x+r.width/2:e,u=r?r.y+r.height/2:i,h=vg(t.canvasBackground,o),f=new Yt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(f);let m=new Ro({x:d,y:u,text:n,fontSize:a,fontStyle:so(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/Po),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return m.offsetX(m.width()/2),m.offsetY(m.height()/2),t.bgLayer.add(m),{node:m,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/Po,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??Y(h,l),plate:f}}}function vg(t,e){return j(e,H(t)?"#ffffff":"#000000",.34)}function vd(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(pd,e.targetPx*yg)*s)/r,c=g=>{t.letterSpacing(g*e.trackingRatio),n(t,g)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=qo(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-Qi*2,height:(u?d.width:d.height)-Qi*2},f=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(f<1&&(l=Math.max(pd/r,l*f),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let y=(u?t.height():t.width())+Qi*2,p=(u?t.width():t.height())+Qi;e.plate.size({width:y,height:p}),e.plate.offset({x:y/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function wd(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=Pr(i,n,Xe),r=t.theme.textColor??"#e6e9f0",s=Y(o,r),a=Ge(e.points,e.holes,{fill:i,opacity:Xe,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",y=>{t.isGhostClick(y)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=ei(e.points,e.holes),c=t.sections.find(y=>te(l,y.outline,y.holes)),d=Ke(e)??oi,u=It(e)?Ut(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Ut(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,ri,!1);u&&t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:u,background:o,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:o,kind:"ga-capacity",categoryKey:e.categoryKey});let f=Lt(e)>0?new fg({data:rt(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;f&&t.bgLayer.add(f);let m={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:i,labelPoint:l,labelNode:u,...Ke(e)!==void 0?{nameSize:d}:{},capacityNode:h,...f?{wheelchairGlyph:f}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,m),To(m)}function Ut(t,e,i,n,o,r,s,a){let l=new Ro({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 xd(t,e){let i=[],n=e.canvasBackground,o=new Map,r=(h,f)=>{let m=o.get(h)??[];m.push(f),o.set(h,m)};for(let h of e.seats){if(h.kind==="booth")continue;let f=h.logicalRowId??h.rowId;r(f,h),f!==h.rowId&&r(h.rowId,h)}let s=(e.sections??[]).filter(h=>h.outline?.length>=3).map(h=>{let f=h.outline.map(y=>y.x),m=h.outline.map(y=>y.y);return{section:h,minX:Math.min(...f),minY:Math.min(...m),maxX:Math.max(...f),maxY:Math.max(...m)}}),a=(h,f,m,y)=>{let p=e.seatR+12+y*6;return s.filter(g=>g.section!==h&&f+p>=g.minX&&f-p<=g.maxX&&m+p>=g.minY&&m-p<=g.maxY).map(g=>g.section.outline)},l=h=>h.logicalSeatIndex??Number(h.id.split(":").pop()??0);for(let h of t.objects){if(h.type!=="row")continue;let f=h.segmentedRow?.repeatLabelOnComponents===!0;if(h.segmentedRow&&!f&&h.segmentedRow.componentIndex!==0)continue;let m=f?h.labelPresentation:h.segmentedRow?.labelPresentation??h.labelPresentation;if(m?.visible===!1||m?.positionPreset==="none")continue;let y=h.segmentedRow&&!f?h.segmentedRow.groupId:h.id,p=(o.get(y)??[]).slice().sort((_,F)=>l(_)-l(F));if(!p.length)continue;let g=p[0],b=p[p.length-1],S=m?.labelStyle,w=m?.style==="pill"?Nt(n):null,k=w?w.plate:n,v=he(k,S?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Ye),x=S?.size??xr,T=m?.rotation??0,P=e.objectFilteredOut(h)?.15:1,L=p.reduce((_,F)=>_??e.seatSection.get(F.id),void 0),I=h.segmentedRow?.displayLabel??h.displayLabel??Rt(h.label,L?.label);if(!I)continue;let R=L?[...new Set([L.id,L.logicalId,L.zone].filter(_=>!!_))]:void 0,M=(_,F,N)=>i.push({text:I,x:_,y:F,rotation:T,fontSize:x,ink:v,opacity:P,rowKey:y,...w?{pill:w}:{},...R?.length?{focusKeys:R}:{},...N?{automaticAway:N}:{},...N&&L?.outline?.length?{outline:L.outline}:{},...N&&L?.outline?.length&&s.length?{neighbourOutlines:a(L,_,F,x)}:{}});if(m?.position){M(m.position.x,m.position.y);continue}let E=e.seatR+12,A=m?.positionPreset??"start";if(A==="start"||A==="both"){let _=h.rotation*Math.PI/180,F={x:-Math.cos(_),y:-Math.sin(_)};M(g.x+F.x*E,g.y+F.y*E,F)}if(A==="end"||A==="both"){let _=(h.rotation+h.curve)*Math.PI/180,F={x:Math.cos(_),y:Math.sin(_)};M(b.x+F.x*E,b.y+F.y*E,F)}}let c=(e.seatR+12)*2.2,d=[],u=new Map;for(let h of i){let f=u.get(h.text),m=f?.find(y=>Math.hypot(y.x-h.x,y.y-h.y)<=c);if(m){m.x=(m.x+h.x)/2,m.y=(m.y+h.y)/2;continue}d.push(h),f?f.push(h):u.set(h.text,[h])}return d}function $t(t,e,i=ee){let n=t.rotation()*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=(t.width()*o+t.height()*r)/2+i,a=(t.width()*r+t.height()*o)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function Ld(t,e,i,n){let o=e.automaticAway;if(!o)return{x:e.x,y:e.y};let r={x:e.x,y:e.y},s={x:-o.y,y:o.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=e.outline,c=m=>l?kd(l,m):0;if(l){let m={...r},y=!1;for(let g=1;g<=12&&c($t(t,r))>0;g++)r.x+=o.x*a/4,r.y+=o.y*a/4,y=!0;let p=$t(t,r);y&&e.neighbourOutlines?.some(g=>kd(g,p)>0||wg(r,g))&&(r.x=m.x,r.y=m.y,l=void 0)}let d=[{x:0,y:0}];for(let m=1;m<=4;m++){let y=a*m;d.push({x:s.x*y,y:s.y*y},{x:-s.x*y,y:-s.y*y},{x:o.x*y,y:o.y*y},{x:(o.x+s.x)*y,y:(o.y+s.y)*y},{x:(o.x-s.x)*y,y:(o.y-s.y)*y})}let u=r,h=1/0,f=1/0;for(let m of d){let y={x:r.x+m.x,y:r.y+m.y},p=$t(t,y),b=(n?at(n,p,{mode:"overlap"}).length:0)+i.collisionCount(p)+c(p),S=Math.hypot(m.x,m.y);if((b<h||b===h&&S<f)&&(u=y,h=b,f=S),b===0)break}return u}function kd(t,e){let i=0;for(let n=0;n<t.length;n++)kg(t[n],t[(n+1)%t.length],e)&&i++;return i}function wg(t,e){let i=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){let r=e[n],s=e[o];r.y>t.y!=s.y>t.y&&t.x<(s.x-r.x)*(t.y-r.y)/(s.y-r.y)+r.x&&(i=!i)}return i}function kg(t,e,i){let n=e.x-t.x,o=e.y-t.y,r=0,s=1,a=[[-n,t.x-i.x],[n,i.x+i.width-t.x],[-o,t.y-i.y],[o,i.y+i.height-t.y]];for(let[l,c]of a){if(l===0){if(c<0)return!1;continue}let d=c/l;if(l<0?r=Math.max(r,d):s=Math.min(s,d),r>s)return!1}return!0}var ji=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,n,o,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(u),l())},u=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(u),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&o(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&o()}).catch(()=>{s===this.generationCount&&this.errors.push(`${n} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${n} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function Cd(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 Td(t){let e=t.drawScene;t.drawScene=((i,n,...o)=>!i&&t.opacity()===0?(t.getCanvas().getContext().clear(),t):e.call(t,i,n,...o))}function 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 xg(t){return t<0?0:t>1?1:t}function Pd(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,n=t.reducedMotion===!0,o=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},u=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},h=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,p()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,p()},16)}},f=()=>{a||s||(a=!0,u(),t.done())},m=p=>{for(let g=c.length-1;g>=0;g--){let b=c[g],S=n?1:xg((p-b.startedAt)/160);t.fade(b.work,S),S>=1&&c.splice(g,1)}return c.length>0},y=()=>{if(s)return;let p=e(),g=p;for(;r<t.chunks.length&&(r===0||e()-g<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,n?1:0),n||c.push({work:S.work,startedAt:p+(r-1)*o}),e()-g>=i)break}let b=m(p);t.draw(),r<t.chunks.length||b?h(y):f()};return h(y),{cancel(){if(!a){s=!0,u();for(let p of c)t.fade(p.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let p=t.chunks[r++];t.build(p.work)}for(let p of t.chunks)t.fade(p.work,1);c.length=0,t.draw(),f()}},get done(){return a}}}var Lg={width:40,height:30,rotation:0};function Rd(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)??Lg;if(l.points&&l.points.length>=3){for(let m of l.points)s.x+m.x<i&&(i=s.x+m.x),s.y+m.y<n&&(n=s.y+m.y),s.x+m.x>o&&(o=s.x+m.x),s.y+m.y>r&&(r=s.y+m.y);continue}let c=l.rotation*Math.PI/180,d=l.width/2,u=l.height/2,h=Math.abs(d*Math.cos(c))+Math.abs(u*Math.sin(c)),f=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-f<n&&(n=s.y-f),s.x+h>o&&(o=s.x+h),s.y+f>r&&(r=s.y+f);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<n&&(n=s.y-a),s.x+a>o&&(o=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:n,width:o-i,height:r-n}:null}function Md(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 Ed=!1;function Ad(t){return t&&t!=="flat"&&!Ed&&(Ed=!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 Fd=(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 _d(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=>Fd(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=>Fd(c,d.outline)))}}import{Group as Bd}from"konva/lib/Group";import{Rect as Cg}from"konva/lib/shapes/Rect";import{Text as Mo}from"konva/lib/shapes/Text";function Od(t,e){let i=ei(e.outline,e.holes),n=le(t.canvasBackground),o=[],r=new Map,s=0,a=K(e.outline),l=t.seatIndex?at(t.seatIndex,a).map(C=>t.seatById.get(C)).filter(C=>!!C):t.seats;for(let C of l)t.seatSection.has(C.id)||te(C,e.outline,e.holes)&&(o.push(C.id),r.set(C.categoryKey,(r.get(C.categoryKey)??0)+1),(t.statusById.get(C.id)??"free")==="free"&&s++);let c=e.color??ni([...r].map(([C,I])=>({hex:t.catColor.get(C)??"#6e7bff",w:I})),"#3a4358"),d=new Bd({listening:!1});t.bgLayer.add(d);let u=new Bd({listening:!1});d.add(u);let h=new bt({listening:!0});t.seatLayer.add(h);let f=u,m=_d(t.chartDoc,e),y=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",p=Ge(e.outline,m.holes,{visible:!m.hidden,stroke:G(y,.5),strokeWidth:1,fill:G(y,.08),listening:!1},e.outlinePath);f.add(p);let g=Ge(e.outline,m.holes,{visible:!m.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:$e,opacity:0,listening:!1},e.outlinePath);f.add(g);let b=e.labelPresentation?.labelStyle,S=b?.color,w=n.sectionInk,k=(b?.size??18)/18,v=new Cg({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});f.add(v);let x=new 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*k,fontStyle:Te,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,w),listening:!1,perfectDrawEnabled:!1});x.offsetX(x.width()/2),x.offsetY(x.height()/2),f.add(x);let T=new Mo({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Te,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,w),opacity:0,listening:!1,perfectDrawEnabled:!1});f.add(T);let P=new Mo({x:i.x,y:i.y,text:B("map.seatsLeft",{count:s}),fontSize:12,fontStyle:ks,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),f.add(P),{id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...Xa(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(C=>t.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(o),shellFill:n.sectionFill,shellStroke:n.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!te(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},...e.labelPresentation?.rotation?{authoredLabelRotation:e.labelPresentation.rotation}:{},labelArea:jo(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:y,outlinePoly:p,blockPoly:g,namePlate:v,nameLabel:x,numberLabel:T,subLabel:P,preferredInk:w,...S?{explicitInk:S}:{},labelScale:k,authoredLabelSize:b?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function Nd(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=po(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=et(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:St(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};uo({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 St(t){let e=Wc(Math.max(t.seatR,t.markerR));return Math.max(e,hl(t.markerR))}var Dd=.25;function Tg(t,e){if(e.length===0)return 1/0;let i=et([...e],t.sellableUnit.diameter/2),n=t.framingViewport();return Math.min(n.width*Dd/Math.max(i.width,1e-6),n.height*Dd/Math.max(i.height,1e-6))}function Hd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=Gd(t,i);if(!n.length)return!1;t.clearSectionFocus();let o=Math.max(24,t.seatR*3),r=et(n,o),s={x:r.x+r.width/2,y:r.y+r.height/2};return uo({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:St(t)}),!0}function Gd(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Re(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function Wd(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&&Re(s,n)==="match"});return o.length&&Eo(t,o)||t.focusSection(e),!0}function Vd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Gd(t,i);if(!n.length)return null;let o=Math.max(24,t.seatR*3),r=et(n,o),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht;return{spaces:n.length,sections:Fo(t,i),wholeVenue:a}}function Eo(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=et(n,Math.max(24,t.seatR*3,o*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht)return!1;let a=po(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=Tg(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(St(t),u),d)}),!0}function zd(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:St(t),focusPaddingPx:l})}function Ao(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let n=Kd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,n),n}function Kd(t,e,i){return El(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function Fo(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?Ao(t,r):Kd(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 Rg=1800,Zt=class Zt{constructor(e,i={}){this.seatLabelPool=new Map;this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.canonicalSeatIds=new Set;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=ao;this.effSelection=mt;this.colorblind=!1;this.cbHueByKey=new Map;this.colourOverride=null;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.sectionRungPinned=!1;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Di;this.seatPaintCache=null;this.selectionFocusId=null;this.selectionFocusKeep=null;this.hiddenPose=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.accessFreeBySection=new Map;this.categoryHighlight=null;this.seatHighlight=null;this.labelLayers={seatLabels:!0,rowLabels:!0};this.categoryColours=!0;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];this.landmarkBoxes=[];this.seatSection=new Map;this.unsectionedSeatGroup=null;this.catPrice=new Map;this.dimmedSections=new Set;this.sectionHeat=new Map;this.closedSections=new Set;this.focusedSectionId=null;this.focusMembership=new Map;this.focusMembershipKey=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.sectionFocusDim=null;this.cameraGestures=0;this.objectFloor=new Map;this.unsectionedSeatIds=null;this.tableFootprints=[];this.zoneColor=new Map;this.hasSections=!1;this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=Hc();this.fitScale=1;this.fitPose="";this.viewportInsets={...vo};this.fitClearance={bottom:0,width:0};this.seatR=J;this.markerR=J;this.seatPitch=0;this.sellableUnit=ho(J);this.bounds={x:0,y:0,width:1,height:1};this.cached=!1;this.dpr=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);this.assets=new ji;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.viewportSeats=null;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.gestureHits=new Yi(()=>{!this.destroyed&&!this.exportMode&&this.updateLabels()});this.rowLabelDwell=new Ui;this.readingFocusedFrame=!1;this.marquee=new $i({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,isSelectable:e=>this.isSelectable(e),applyBand:(e,i,n)=>{this.opts.onBand?.(e,i,n)||(n?this.deselect(e):this.selectMany(e))},selectionChanged:()=>{this.opts.onMarquee?.(this.getSelection())}});this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let n=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;n&&this.focusSeat(n);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let n=this.seatById.get(this.focusedId);n&&this.opts.onFocusSeat?.(n)}};this.focusRingLinger=null;this.cameraHostCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.selectionFollowUps=new qi(()=>{this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)});this.sectionBoundsMemo=new Map;this.interactionHostCache=null;this.seatLabelTargetScale=Cc(()=>({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?He(i):void 0}}));this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let n=Ji.pixelRatio;if(this.exportMode&&(this.dpr=1),Ji.pixelRatio=this.dpr,this.stage=new Ig({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Xi(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",B("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new _o({listening:!this.exportMode}),this.seatLayer=new _o({listening:!this.exportMode}),this.overlayLayer=new _o({listening:!1}),this.exportMode||(this.gestureHits.wrap(this.bgLayer),this.gestureHits.wrap(this.seatLayer),this.gestureHits.listen(e),Td(this.seatLayer)),this.labelGroup=new qt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new qt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Bi({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>ml(this.sellableUnit),pickableScale:()=>Fi(this.sellableUnit),categoryLabel:o=>this.catByKey.get(o)?.label??"",categoryColor:o=>this.categoryDisplayColor(o),categoryFilter:()=>this.categoryFilter,seatsPickable:()=>this.seatsPickable(),screenToWorld:o=>this.screenToWorld(o),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(o,r)=>this.focusRegion(o,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new Xd({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:zi,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Xd({radius:J+3,stroke:"#38bdf8",strokeWidth:2.5,dash:[4,3],opacity:.95,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.focusRing),this.stage.add(this.bgLayer,this.seatLayer,this.overlayLayer),this.exportMode&&(Ji.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&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 Xt:null,this.rowBandZoomAnchor=null,this.hoverRing.visible(!1),this.updateLOD(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw()}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Ci({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.seatPriceLabel(e)??this.plainSeatPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),seatOwnedHold:e=>this.ownedHold.has(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new Ti({overlayLayer:this.overlayLayer,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,categoryColor:e=>this.categoryDisplayColor(e),seatCategoryKey:e=>this.seatById.get(e)?.categoryKey??null,isOwnedHold:e=>this.ownedHold.has(e),reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed})),this.breathCache}presentSeatHover(e,i,n,o){this.hoverCard.presentSeat(e,i,n,o)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Mi({container:this.container,labelFont:()=>this.labelFont(),canvasBackground:()=>this.canvasBackground,seatsPickable:()=>this.seatsPickable(),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionLabel:e=>this.sections.find(i=>i.logicalId===e)?.label??null,sectionMembers:e=>this.sectionMembers(e),hoveredSeatId:()=>this.hoveredId,hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,nearestSeat:e=>this.nearestSeatToScreen(e,pe,!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),seatPrice:e=>this.seatPriceLabel(e)??this.plainSeatPriceLabel(e.categoryKey),categoryColor:e=>this.categoryDisplayColor(e),categorySellable:e=>this.catByKey.get(e)?.notForSale!==!0,chartDoc:()=>this.chartDoc,seatFacts:e=>this.opts.hoverFacts?.(e)??null,seatCardHead:e=>this.opts.hoverCardHead?.(e)??null,sectionCardHead:(e,i)=>this.opts.hoverSectionHead?.(e,i)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Ii({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Dt(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let n=this.sectionTapAnchor(i,this.seatById.get(e.seatId)??{x:0,y:0});this.opts.onSectionTap?this.opts.onSectionTap(i,n):this.focusSection(i,{anchor:n})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(n=>n.id).filter(n=>{let o=this.seatSection.get(n);return!!o&&(o.logicalId===e||o.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(Ta({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null);if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let n=0,o=0;for(let r of i)n+=r.x,o+=r.y;return{x:n/i.length,y:o/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Ri({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let n of e.memberIds){if(!this.selection.has(n)&&!this.ownedHold.has(n))continue;let o=this.seatById.get(n);o&&i.push(o)}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>this.marquee.active(),marqueeShouldStart:e=>mc(e,{manageMode:this.opts.manageMode===!0,marqueeSelect:this.opts.marqueeSelect===!0}),beginMarquee:(e,i)=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box",i),updateMarquee:e=>this.marquee.update(e),finishMarquee:()=>this.marquee.finish(),cancelMarquee:()=>this.marquee.cancel(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,i){this.sectionBoundsMemo.clear(),this.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Xt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.sectionRungPinned=!1,this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??ti(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let a of e.floors)for(let l of a.objects)this.objectFloor.set(l.id,a.id),l.type==="section"&&l.logicalSectionId&&this.objectFloor.set(l.logicalSectionId,a.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.focusMembership.clear(),this.focusMembershipKey=null,this.unsectionedSeatIds=null,this.primaryFocalLabels.clear(),this.gaById.clear();for(let a of this.selectionMarkers.values())a.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),n||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,n||this.statusById.clear(),this.accessFreeBySection.clear(),n||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,n||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.seatHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasSections=o.objects.some(a=>a.type==="section");for(let a of e.zones??[])a.color&&this.zoneColor.set(a.id,a.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=ui(this.theme.seatScale)*J,this.container.style.background="",this.canvasBackground=this.resolveCanvasBackground(),this.container.style.background=this.canvasBackground,this.effSelection=this.resolveSelectionColor(),this.hoverRing.stroke(this.effSelection),this.hoverRing.radius(this.seatR+2),this.catColor.clear(),this.catByKey.clear(),this.catPrice.clear(),this.catOrder=e.categories.map(a=>a.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((a,l)=>{this.cbHueByKey.set(a,ki[l%ki.length])});for(let a of e.categories){this.catColor.set(a.key,a.color),this.catByKey.set(a.key,a);let l=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[a.key]?.min??a.price;typeof l=="number"&&this.catPrice.set(a.key,l)}this.tableFootprints=Dc(o.objects);for(let a of o.objects)a.type==="booth"&&this.boothDims.set(a.id,{width:a.width,height:a.height,rotation:a.rotation,...a.points&&a.points.length>=3?{points:a.points.map(l=>({x:l.x,y:l.y}))}:{},...It(a)?{}:{nameHidden:!0},...Ke(a)?{nameSize:Ke(a)}:{}});if(this.seats=Ve(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===e?this.seats:Ve(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=_r(this.seats,{seatRadius:this.seatR}),this.seatPitch=cl(this.seats),this.markerR=dl(this.seatR,this.seatPitch),this.sellableUnit=fl(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=ar(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new qt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?Rd(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),yc(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=Md({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Pd({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,n)=>i.group.opacity(n),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.afterViewChange(),this.fitPose&&Qe(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){if(this.viewportSeats){let n=this.viewportSeats;this.viewportSeats=null,e?n.finish():n.cancel()}let i=this.seatReveal;this.seatRevealPending=!1,i&&(this.seatReveal=null,e?i.finishNow():i.cancel(),this.seats.length&&!this.destroyed&&this.updateLabels())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:xt(e)};if(this.floorOverview&&e.floors.length>=2)return nt(e)==="combined"?ur(e):hr(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...sr(e),referenceImage:void 0,backgroundImage:xt(e)};let i=e.floors.find(n=>n.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:xt(i),floors:void 0}}floorBaseHeightMFor(){let e=this.chartDoc?.floors;return e?.length?e.find(i=>i.id===this.activeFloorId)?.baseHeightM??0:0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&!!this.chartDoc&&nt(this.chartDoc)!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?ti(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let n=!1,o=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),n=!0),o){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),o.add(l))}}if(o&&o.size){for(let r of o)this.refreshSectionFill(r);this.bgLayer.batchDraw()}n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setSeatCategories(e){let i=!1,n=!1,o=new Set;for(let[s,a]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(a)||l.categoryKey===a)continue;l.categoryKey=a,i=!0;let c=this.circleById.get(s);c&&(this.paintSeat(c,s),n=!0);let d=this.seatSection.get(s);d&&o.add(d)}if(!i)return;let r=new Map((this.chartDoc?ti(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){if(!r.get(s.id)?.color){let l=new Map;for(let c of s.memberIds){let d=this.seatById.get(c)?.categoryKey;d&&l.set(d,(l.get(d)??0)+1)}s.baseFill=ni([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(o=>this.statusById.has(o))),n=new Set([...this.ownedHold,...i]);this.ownedHold=i,this.selectionFollowUps.batch(()=>{for(let o of n){let r=this.circleById.get(o);r&&this.paintSeat(r,o),this.syncSelectionMarker(o)}}),n.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let n=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=rc({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&&sc(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){this.opts.ownPriceRings?.(this,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<=ss;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 sd(e,i)}selectRow(e){let i=rd(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&&Yl(this.flashHost,n,i)}flashSection(e,i="#22a06b"){Ul(this.flashHost,this.sections.filter(n=>n.id===e||n.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed}}nearestSeat(e,i){let n=this.seatById.get(e);if(!n)return null;let o=n,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=a,c=l.x-o.x,d=l.y-o.y,u=c*i.x+d*i.y;if(u<=.5)continue;let h=Math.abs(c*i.y-d*i.x),f=u+h*2.5;f<s&&(s=f,r=a.id)}return r}focusSeat(e,i){let n=this.seatById.get(e);n&&(this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(n),this.focusRing.scale({x:1,y:1}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},Rg)),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(),ve*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=Pc(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 Ic(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return Ac(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){Sc(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(gl(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},gestureFrame:()=>this.gestureHits.bump(),framingViewport:()=>this.framingViewport(),constrainPan:(e,i)=>this.constrainPan(e,i),sectionBounds:e=>this.sectionBounds(e),effScale:()=>this.effScale(),settleView:()=>this.settleView(),afterViewChange:()=>this.afterViewChange(),scheduleViewChange:()=>this.scheduleViewChange(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),updateLOD:()=>this.updateLOD(),cancelGlide:()=>this.cancelGlide()}}refitCurrentView(e=!1){if(e){this.settleView();return}if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return Mc(this.stage)}setCameraPose(e){this.cancelGlide(),Ec(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.stepZoom(Zt.ZOOM_STEP)}zoomOut(){this.stepZoom(1/Zt.ZOOM_STEP)}stepZoom(e){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),Wi({stage:this.stage,reducedMotion:()=>this.reducedMotion,bounds:()=>this.zoomBounds(),apply:(i,n)=>this.zoomAbout(i,n)},e,Ki(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX();return{x:e.x*i+this.stage.x(),y:e.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let n of this.sections)this.refreshSectionFill(n);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale()),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((n,o)=>n===e[o])}setCommercialLimitedFilter(e){this.commercialLimitedFilter!==e&&(this.commercialLimitedFilter=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setCategoryFilter(e){let i=e===null?null:new Set(e);kl(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(){Jc({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=>Qc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Q,effScale:()=>this.effScale(),labelLegible:e=>ye(e,this.effScale())})}setGAStates(e){ed(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){Nd(this.focusFramingContext,e,i)}diveCeiling(){return St(this.focusFramingContext)}focusAccessibleSeats(e){return Hd(this.focusFramingContext,e)}focusAccessibleSection(e,i){return Wd(this.focusFramingContext,e,i)}accessibleSpread(e){return Vd(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.gestureHits.destroy(),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let n=this.seatSection.get(e);return i*(n&&this.sectionMatchesFocus(n)?1:Ie)}sectionScreenBounds(e){return Ya({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Q,i=[],n=96,o=this.stage.width(),r=this.stage.height();for(let s of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(s);a=c.x+c.width>=-n&&c.y+c.height>=-n&&c.x<=o+n&&c.y<=r+n}this.viewportSeats&&a&&(e||s.id===this.focusedSectionId||s.logicalId===this.focusedSectionId)&&i.push(s.id),s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0)}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let n of i.memberIds){let o=this.seatById.get(n);o&&e.push(o)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let n=this.seatById.get(i);n&&e.push(n)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let n=this.labelLiftGroups.get(i.id);return n||(n=new bt({listening:!1}),n.setViewportCulled(i.liftGroupSeat.isViewportCulled()),this.labelGroup.add(n),this.labelLiftGroups.set(i.id,n)),n}viewportPins(){return il([this.focusRing.visible()?this.focusedId:null,this.hoveredId],this.ownedHold,this.selection)}queueViewportPinSync(){!this.viewportSeats||this.viewportPinSync||(this.viewportPinSync=!0,queueMicrotask(()=>{this.viewportPinSync=!1,this.viewportSeats?.sync(this.viewportWanted,this.viewportPins())}))}startViewportSeats(){let e=new Map;this.viewportWanted=["__loose"];for(let i of this.seats){let n=this.seatSection.get(i.id)?.id??"__loose",o=e.get(n);o||e.set(n,o=[]),o.push(i)}this.viewportSeats=new Ei(e,{build:i=>this.renderSeats(i),remove:i=>{for(let n of i)for(let o of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])o.get(n.id)?.destroy(),o.delete(n.id);this.glyphMarkers=this.glyphMarkers.filter(n=>!!n.getParent())},draw:()=>{this.updateLOD(),this.updateLabels(),this.seatLayer.batchDraw()},schedule:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i),now:()=>performance.now(),sectionOf:i=>this.seatById.has(i)?this.seatSection.get(i)?.id??"__loose":void 0})}renderSeats(e=this.seats){bl({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/Se,o=new Pg({x:e.x,y:e.y,data:rt(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:li(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Uc(o),o}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,n]of this.accessGlyphById){let o=this.seatR*1.5/Se,s=this.accessGlyphFilterEmphasized(i)?jr:Qr,a=Math.max(o,s/(Se*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&&Pe(i,n)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode||i==="not_for_sale"&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${ce(i.min,this.currency)}\u2013${ce(i.max,this.currency)}`;let n=this.catPrice.get(e);return typeof n=="number"?ce(n,this.currency):null}plainSeatPriceLabel(e){let i=this.chartDoc?.seatPrices,n=this.catByKey.get(e);if(this.categoryPriceRanges===null||!i||!Object.keys(i).length||!n)return this.categoryPriceLabel(e);let o=n.tiers?.length?n.tiers.map(a=>a.price).filter(a=>typeof a=="number"):typeof n.price=="number"?[n.price]:[];if(!o.length)return this.categoryPriceLabel(e);let r=Math.min(...o),s=Math.max(...o);return s>r?`${ce(r,this.currency)}\u2013${ce(s,this.currency)}`:ce(r,this.currency)}seatPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.opts.seatPriceLabel?.(e);if(i!==void 0)return i;let n=In(this.chartDoc?.seatPrices,e.label);if(n===void 0)return null;let o=typeof n=="number"?[n]:Object.values(n.tiers);if(!o.length)return null;let r=Math.min(...o),s=Math.max(...o);return s>r?`${ce(r,this.currency)}\u2013${ce(s,this.currency)}`:ce(r,this.currency)}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,n])=>[i,{min:n.min,max:n.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let n=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof n=="number"&&this.catPrice.set(i.key,n)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.categoryColours?this.colourOverride?.[e]?this.colourOverride[e]:this.colorblind?this.cbHueByKey.get(e)??ki[0]:this.catColor.get(e)??"#6e7bff":Wa}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Je}seatLabelInk(e,i){let n=i.fill();return he(typeof n=="string"?n:"",e.labelStyle?.color,this.theme.seatLabelColor??Je,Ye)}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?{...He(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){ac(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}repaintSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){e!==this.colorblind&&(this.colorblind=e,this.recolourCategories())}setCategoryColourOverride(e){this.colourOverride=e,this.recolourCategories()}recolourCategories(){this.repaintSeats();for(let e of this.sections)e.shellCategoryColor=this.dominantSellableColor(e.memberIds),this.refreshSectionFill(e);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}setDimmedSections(e){let i=new Set(e??[]);i.size===this.dimmedSections.size&&[...i].every(n=>this.dimmedSections.has(n))||(this.dimmedSections=i,this.repaintSeats(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(n=>this.closedSections.has(n))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(n=>n.id===e||n.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return Eo(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}}zd(this.focusFramingContext,e,i,n)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=U}setSectionFocusDim(e){let i=this.sectionDimEnabled();this.sectionFocusDim=e,i!==e&&(e||this.dropFocusDim())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=ae}atVenueFit(){return this.fitPose!==""&&Qe(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active||this.viewportSeats&&this.seatLayer.opacity()===0?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=Fi(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(n=>n.id===e||n.logicalId===e);if(this.focusBackdrop=$l(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=ql(this.focusBackdropHost,i);for(let n of this.selectionMarkers.values())n.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let n=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),o=2;return[{x:n.x-o,y:n.y-o},{x:n.x+n.width+o,y:n.y-o},{x:n.x+n.width+o,y:n.y+n.height+o},{x:n.x-o,y:n.y+n.height+o}]}):[]}}}repaintSectionsAndSeats(){this.repaintSeats();for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,n=-1/0,o=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>n&&(n=s),a>o&&(o=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,n-e),height:Math.max(1,o-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let n=this.isSectionClosed(i)||i.free<=0,o=i.memberIds.some(a=>this.selection.has(a)),r=o||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:o?"selected":n?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r,free:i.free,total:i.memberIds.length}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),n={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:n.x+this.stage.width()/2-i.x,y:n.y+this.stage.height()/2-i.y},n)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let n=this.stage.x(),o=this.stage.y(),r=this.constrainPan({x:n+e.x,y:o+e.y},{x:n,y:o}),s=r.x-n,a=r.y-o;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=u=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let h=Math.min(1,(u-l)/c),f=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:n+s*f,y:o+a*f}),this.scheduleViewChange(),this.stage.batchDraw(),h<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setSeatHighlight(e){Va(this.readingAidsHost,e)}setLabelLayers(e){za(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Ka(this.readingAidsHost,e)}refreshBlockPaint(){this.repaintSectionsAndSeats(),this.updateLOD()}getCategoryColours(){return this.categoryColours}get readingAidsHost(){return{seatHighlight:()=>this.seatHighlight,setSeatHighlightState:e=>{this.seatHighlight=e},labelLayers:()=>this.labelLayers,setLabelLayersState:e=>{this.labelLayers=e},repaintSeats:()=>this.repaintSeats(),updateLabels:()=>this.updateLabels(),draw:()=>{this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()},categoryColours:()=>this.categoryColours,setCategoryColoursState:e=>{this.categoryColours=e},repaintSectionsAndSeats:()=>this.repaintSectionsAndSeats()}}setCategoryHighlight(e){this.categoryHighlight!==e&&(this.categoryHighlight=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}renderBackground(e){let i=xt(e);i&&this.renderBackgroundImage(i);for(let n of e.objects)n.type==="decorImage"&&this.renderDecorImage(n);for(let n of e.objects)n.type==="section"&&this.renderSection(n);for(let n of e.objects)n.type==="shape"?this.renderShape(n):n.type==="gaArea"?this.renderGA(n):n.type==="table"?this.renderTable(n):n.type==="text"&&this.renderText(n);this.renderZones(e)}trackAssetImage(e,i,n,o){this.assets.track(e,i,n,o,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){md(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){gd(this.objectDrawContext,e)}renderTable(e){bd(this.objectDrawContext,e)}renderText(e){yd(this.objectDrawContext,e)}renderShape(e){Sd(this.objectDrawContext,e)}renderGA(e){wd(this.objectDrawContext,e)}renderSection(e){let i=Od(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){Fl(this.sectionLodPaintContext,e)}isSectionClosed(e){return fo(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Gs(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return Ao(this.focusFramingContext,e)}accessibleSections(e){return Fo(this.focusFramingContext,e)}get sectionLodPaintContext(){let e=new Set([...this.selection,...this.ownedHold].map(i=>this.seatSection.get(i)));return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:i=>e.has(i),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:i=>this.sectionAccessibleFree(i),blockPaint:this.opts.blockPaint,selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,glideInProgress:this.glideInProgress,sectionsPinned:this.sectionRungPinned,reducedMotion:this.reducedMotion,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){this.opts.manageMode||Ja({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:!!this.chartDoc&&nt(this.chartDoc)==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX();return{x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i}}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),n=this.sections.find(o=>te(i,o.outline,o.holes));return n?n.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Gi(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let n of this.gaById.values())if(te(i,n.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||ko(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,pe,!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?Re(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 ao}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:H(this.canvasBackground)?rl:mt}setSelected(e,i,n=!1){let o=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());o&&(this.paintSeat(o,e),!n&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.queueViewportPinSync(),this.selectionFollowUps.request()}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){let i=this.sectionBoundsMemo;if(i.has(e))return i.get(e)??null;!i.size&&typeof queueMicrotask=="function"&&queueMicrotask(()=>i.clear());let n=this.measureSectionBounds(e);return typeof queueMicrotask=="function"&&i.set(e,n),n}measureSectionBounds(e){return Qa({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(gt(this.stage,i,this.zoomBounds(),Kt(this.framingViewport(),this.focusedRowLabelGutter(e))),Gt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return Yc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return Sl(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return yl(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(){pc(this.interactionHost)}handleSeatTap(e){fc(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=>el({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=>ko(this.tableFootprints,this.seats,this.screenToWorld(e),this.effScale()),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,n)=>this.zoomAbout(e,i,n),panBy:(e,i)=>wc(this.cameraHost,e,i),zoomBounds:()=>this.zoomBounds(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):Ki(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),n)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap??(this.opts.manageMode?()=>this.overview():void 0),onDeckTap:this.opts.onDeckTap}}zoomBounds(){return zt(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),vc(this.cameraHost,e,i,n)}cancelZoomSettle(){xc(this.cameraHost)}focusRegion(e,i){Lc(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let n=performance.now();this.labelGroup.opacity(0);let o=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-n)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(o):0};this.labelFadeRaf=requestAnimationFrame(o)}cancelGlide(){Wt(this.stage),this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Q?"seats":this.sectionRungPinned?"sections":this.zones.length&&e<Ue?"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),ld(this.renderedQualityContext)}setRung(e){let i=this.sectionRungPinned;if(this.sectionRungPinned=e==="sections",e==="zones")this.cancelGlide(),this.zoomToFit();else{let n=this.framingViewport(),o=id({rung:e,bounds:this.bounds,sections:this.sections,seats:this.seats,focusedSectionId:this.focusedSectionId,viewCentre:Ki(this.framingWorldRect()),width:n.width,height:n.height,seatScale:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),seatFloor:Math.min(this.rowBandPreview?this.rowBandPreview.detailScale*1.08:Q*1.1,this.zoomBounds().max)});this.focusRegion(o.bounds,o.minScale===void 0?void 0:{minScale:o.minScale})}(i||this.sectionRungPinned)&&this.updateLOD()}seatRungScale(){return Gc(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Kt(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(Q,this.sectionFrameScale(this.focusedSectionId)*.85)||bc({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Q))return;let o=(i&&e?this.sectionAt(e):null)??Ua({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!o||o===this.focusedSectionId||(this.focusedSectionId=o,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(o))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ie&&!this.rowBandPreview?.active||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},rs))}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)vd(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(Nl(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Q,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Q),()=>this.sectionFrameScale(this.focusedSectionId),r=>{let s=r.outline.map(a=>this.worldToScreen(a));return Math.max(...s.map(a=>a.x))>=0&&Math.min(...s.map(a=>a.x))<=this.stage.width()&&Math.max(...s.map(a=>a.y))>=0&&Math.min(...s.map(a=>a.y))<=this.stage.height()},()=>this.zoomBounds().max),this.owned.sync(e,this.getRung()),this.syncBeacons()):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e);let n=this.seatGlyphDetail;if(this.seatGlyphDetail=Qs(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),n!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let r=this.seatLayer.opacity()>0;this.seatLayer.listening(r),!r&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let o=!this.exportMode&&!this.rowBandPreview?.active&&e<Q;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),o&&!this.cached&&this.seatLayer.opacity()===0){this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.seatLayer.listening(!1),this.hoveredId&&this.seatLayer.fire("mouseout");return}if(o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.viewportSeats||this.seatReveal||this.seatRevealPending||this.rowBandPreview?.active)return;if(this.seatLayer.opacity()===0){this.cached&&this.releaseSeatLayerBitmap(),this.cached=!1,this.seatLayer.listening(!1);return}this.updateSeatGroupVisibility();let e=q(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0,this.mountCachePending=!1}cacheSeatLayer(){this.destroyed||typeof document>"u"||(this.recacheTimer=null,this.rebuildSeatCache(),this.seatLayer.batchDraw())}releaseSeatLayerBitmap(){Cd(Ji,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.gestureHits.flush(),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Q?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),n=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:n,width:Math.max(1,o-i),height:Math.max(1,r-n)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),n=Math.max(12,Math.min(36,Math.min(e,i)*.025)),o=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-n*2),a=Math.max(1,i-n*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};o(),o()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(o){let r=o instanceof Error?o.message:String(o);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let n=i.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");n.fillStyle=this.canvasBackground,n.fillRect(0,0,i.width,i.height);try{n.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ie):this.effScale(),i=[];for(let{node:n,backdrop:o,kind:r,showAt:s,area:a}of this.freeTextById.values()){if(r==="ga-label"||r==="ga-capacity"||a)continue;let l=r==="free-text"&&this.nodeBelongsToFocusedSection(n),c=r==="direct-landmark";if(c){let f=Number(n.getAttr("directLandmarkBaseFontSize"))||n.fontSize();n.setAttr("directLandmarkBaseFontSize",f),n.fontSize(Math.max(f,V/e)),i.push({node:n,backdrop:o,baseFontSize:f})}let d=s==="detail"&&!this.exportMode&&e<Ce,h=c||r==="stage"||l||!d&&ye(n.fontSize(),e);if(n.visible(h),o?.visible(h),!this.exportMode&&r==="free-text"){let f=Math.min(1,As/Math.max(n.fontSize()*e,1e-6));n.scale({x:f,y:f}),o?.scale({x:f,y:f})}}Oc(i),Bc({freeTextById:this.freeTextById,focalLabels:this.primaryFocalLabels.keys(),seatIndex:this.seatIndex,bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,scale:e});for(let{node:n,fontSize:o}of this.iconNodeById.values())n.visible(this.nodeBelongsToFocusedSection(n)||ye(Io(n,o,e),e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let n=this.focusMembership.get(e);if(n!==void 0)return n;let o=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(o.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=o.some(l=>te(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.sectionBoundsMemo.clear(),this.rowLabelDwell.reset(),this.rowLabelPlan=xd(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,sections:this.sections,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,n=ee){return $t(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return Ld(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(){pl(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,labelLayers:()=>this.labelLayers,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),rowLabelDwell:this.rowLabelDwell,gesturing:()=>this.gestureHits.active,worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,markerR:this.markerR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,n)=>this.resolveAutomaticRowLabelPosition(e,i,n),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=td({width:this.container.clientWidth,height:this.container.clientHeight,stageWidth:this.stage.width(),stageHeight:this.stage.height()});if(e==="hidden"){this.hiddenPose??=this.getCameraPose();return}let i=this.hiddenPose;if(this.hiddenPose=null,e==="unchanged"){i&&this.setCameraPose(i);return}let n={width:this.stage.width(),height:this.stage.height()};this.stage.size(e),i&&this.setCameraPose(i);let r=!(this.fitPose===""||Qe(this.stage)===this.fitPose)&&e.width===n.width;r&&this.stage.position({x:this.stage.x()+(e.width-n.width)/2,y:this.stage.y()+(e.height-n.height)/2}),this.refitCurrentView(r)}};Zt.ZOOM_STEP=1.4;var Bo=Zt;function Yd(t,e){return new Bo(t,e)}function Mg(t,e){return t*2*.6*e>=6}function Eg(t,e){t._sceneFunc(e)}function Oo(t){let e=this,i=e.attrs;Eg(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Mg(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 Ud(t){return t.attrs.sceneFunc===Oo}function $d(t){Ud(t)&&t.setAttr("sceneFunc",void 0)}function Ag(t,e,i,n){if(!e){$d(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==Oo&&t.setAttr("sceneFunc",Oo)}import{Shape as Fg}from"konva/lib/Shape";var _g="#8B5CF6",Bg=(6.1-4.3)/4.3,Og=1.25/4.3,Dg=8,qd=new WeakMap;function Ng(t,e,i,n){let o=t.seatR,r=i.getStage(),s=Math.abs(r?r.scaleX():1)||1;if(!e.size||o*2*s<Dg)return;let a=o*Bg,l=!1;n.beginPath();for(let c of e){let d=t.seatById.get(c),u=t.circleById.get(c);if(!d||!u||t.selection.has(c)||u.opacity()<.5||!u.isVisible())continue;let h=t.boothLabelById.has(c)?t.boothDims.get(d.rowId):void 0,f=h?He(h):void 0,m=(f?Math.hypot(f.width,f.height)/2:o)+a;n.moveTo(d.x+m,d.y),n.arc(d.x,d.y,m,0,Math.PI*2),l=!0}l&&(n.setAttr("strokeStyle",_g),n.setAttr("lineWidth",o*Og),n.stroke())}var Hg=(t,e)=>{let i=t,n=qd.get(t);if(!n){let r={ids:new Set,chart:i.chartDoc,shape:new Fg({listening:!1,perfectDrawEnabled:!1,sceneFunc:s=>{r.chart===i.chartDoc&&Ng(i,r.ids,r.shape,s)}})};n=r,qd.set(t,n),i.overlayLayer.add(n.shape),n.shape.moveToBottom()}n.chart!==i.chartDoc&&(n.ids.clear(),n.chart=i.chartDoc);let o=!1;for(let[r,s]of Object.entries(e))s?.kind==="priced"?i.seatById.has(r)&&!n.ids.has(r)&&(n.ids.add(r),o=!0):n.ids.delete(r)&&(o=!0);o&&n.shape.getLayer()?.batchDraw()};function Zd(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 Do(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=eh(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function Qd(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 jd(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 Jd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=eh(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 eh(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 th(t,e){return t.accessFilter?Re(e,t.accessFilter)==="other":!1}function ih(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=Gg(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&&Do(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function Gg(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}var No=["background","rowLabelColor","textColor","selectionColor"];function nh(t,e){return!t||!e?!t&&!e:No.every(i=>t[i]===e[i])}function Ae(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function en(t,e){if(!e)return!1;let{status:i,conflicts:n,reason:o}=Ae(t);return i!==409?!1:o==="hold_not_active"?!0:!o&&!n?.length&&t?.message==="conflict"}function tn(t){return t==="blocked"?"not_for_sale":t==="unavailable"?"held":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function oh(t,e,i){let n=fr(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}function rh(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(ii(t).map(h=>[h.id,h])),c=yr(t),d=ot(t),u=hi(t);for(let h of e){n.set(h.label,h.id),o.set(h.label,h),r.set(h.id,h),a.push(h.id);let f=l.get(h.rowId),m=f&&"label"in f&&typeof f.label=="string"?f.label:void 0,y=f?.type==="row"?f.segmentedRow:void 0,p=y?.displayLabel??(f&&"displayLabel"in f&&typeof f.displayLabel=="string"&&f.displayLabel?f.displayLabel:m),g=i.get(h.rowId),b=f?.type==="table"?"table":f?.type==="booth"?"booth":"seat",S=p,w=y?.displayType?.trim()||(f&&"displayType"in f&&typeof f.displayType=="string"&&f.displayType.trim()?f.displayType.trim():void 0),k=h.displayLabel??h.label,v=k.split("-"),x=g||h.kind==="booth"?void 0:p&&k.startsWith(`${p}-`)?k.slice(p.length+1):v[v.length-1]??k;s.set(h.id,{objectId:h.rowId,objectType:b,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:x,...w?{displayType:w,rowType:w}:{},...Wg(f,h.sectionId?d.get(h.sectionId):void 0),...f?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function Wg(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 sh(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 ah(t,e,i,n=1){let o=Sr(t),r=ot(t);return Ct(t).map(s=>{let a=t.categories.find(d=>d.key===s.categoryKey),l=o.get(s.id),c=s.entrance?.trim()||(l?r.get(l):void 0);return{id:s.id,label:s.label,...s.displayLabel?{displayLabel:s.displayLabel}:{},...s.displayType?{displayType:s.displayType}:{},capacity:Math.max(0,Math.floor(s.capacity)),...Vg(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function Vg(t,e,i){let n=mn(t,i),o=gn(t,i),r=Lt(t),s=i===2&&n.length===1&&n[0]===t.label?pn(t):null;if(s){let{min:l,max:c}=fn(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 lh(t,e,i){let n=Math.floor(e),o=mn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?pn(t):null;if(r){let{min:d,max:u}=fn(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!Lt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=gn(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 zg(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 ch(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?zg(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 dh(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 Kg(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function hh(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=Kg(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?Zo.filter(r=>n.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var FT=5e3,_T={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Xg(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 uh(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!Xg(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 BT(t){return t.lost.length>0||t.holdLapsed}function OT(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function ph(t,e,i=Date.now()){return e&&i<t+5e3}function fh(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 mh(t){if(!t?.zones?.length)return[];let e=new Set(vr(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 gh(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=Ve(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&&!Pe(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=Ur(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 Fe=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function Ho(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function bh(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var nn=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 Go(t,e,i,n=!1){if(!t.renderer)return null;let r=e??t.getSelection().map(d=>d.label),s=t.hold_?.items??[],a=[...new Set([...s.map(d=>d.label),...r])];if(!a.length)return null;let l=t.ticketIssue(a);if(l)throw new Fe(l);if(t.hold_&&t.holdCovers(a))return t.hold_;let c=t.hold_?.holdId;try{let d=a.map(h=>{let f=s.find(p=>p.label===h);if(f&&(f.objectType==="ga"||f.quantity!=null||f.tierId!=null))return{label:h,tierId:f.tierId,...f.quantity!=null?{quantity:f.quantity}:{}};let m=t.labelToSeat.get(h),y=m?t.toSeat(m):null;return{label:h,...y?.tierId?{tierId:y.tierId}:{},...t.tableQuantityRequest(y)}}),u=await t.api.hold(t.key,d,i,c);return t.setHold({holdId:u.holdId,labels:a,expiresAt:u.expiresAt,items:u.items}),t.hold_}catch(d){if(!n&&en(d,!!c)&&(t.clearHold(),!Ae(d).conflicts?.length))return Go(t,r,i,!0);throw t.handle409Conflicts(d),d}}async function yh(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 Sh(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 vh(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 Fe(s);let a;try{if(t.hold_&&t.holdCovers(r))a=t.hold_.holdId;else{let c=t.hold_?.holdId,d=r.map(h=>{let f=t.labelToSeat.get(h),m=f?t.toSeat(f):null;return{label:h,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),u;try{u=await t.api.hold(t.key,d,n,c)}catch(h){if(!en(h,!!c)||Ae(h).conflicts?.length)throw h;t.clearHold(),u=await t.api.hold(t.key,d,n)}a=u.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:u.expiresAt,items:u.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:u,reason:h}=Ae(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let f=new Set(u.map(p=>p.label)),m=t.idsForLabels(f);m.length&&(o.setStatus(m,"booked"),o.deselect(m),t.resetTableQuantitiesForLabels(f));let y=r.filter(p=>!f.has(p));y.length&&a&&t.api.release(t.key,y,a).catch(()=>{}),t.emitSelectionChange()}else a&&t.api.release(t.key,r,a).catch(()=>{});throw c}let l=t.idsForLabels(r);return l.length&&(o.setStatus(l,"booked"),o.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function wh(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 kh(t,e){let i=t.hold_;if(!i)return!0;let n=e.filter(l=>i.labels.includes(l));if(!n.length)return!0;try{let l=await t.api.release(t.key,n,i.holdId);if(!t.releaseConfirmed(l,n))return await t.resnapshot(),!1}catch(l){return t.emitError(l),!1}let o=t.hold_;if(o?.holdId!==i.holdId)return!0;let r=o.labels.filter(l=>!n.includes(l)),s=o.items?.filter(l=>!n.includes(l.label));r.length?t.setHold({...o,labels:r,items:s}):t.clearHold(),t.resetTableQuantitiesForLabels(n);let a=t.idsForLabels(n);return a.length&&(t.renderer?.deselect(a),t.renderer?.setStatus(a,"free")),!0}function xh(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function Lh(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 Ch(t,e){let{status:i,conflicts:n}=Ae(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 Ph(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(ph(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function Rh(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function Mh(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 Ug(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function $g(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=>Ug(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function Eh(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")&&$g(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=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,u=new Set,h=0,f=0;for(let v of l){let x=n.get(v);if(!x)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(x)&&(f+=1);let T=o.get(v);if(T){if(u.has(T.label))continue;u.add(T.label),c.set(T.categoryKey,(c.get(T.categoryKey)??0)+T.maxOccupancy),t.statusOf(T.chairs[0]?.id??v)==="free"&&(h+=T.maxOccupancy,d.set(T.categoryKey,(d.get(T.categoryKey)??0)+T.maxOccupancy))}else c.set(x.categoryKey,(c.get(x.categoryKey)??0)+1),t.statusOf(v)==="free"&&(h++,d.set(x.categoryKey,(d.get(x.categoryKey)??0)+1))}let m=[...c.entries()].map(([v,x])=>{let T=i.categories.find(R=>R.key===v),P=T?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],L=P.length?P:typeof T?.price=="number"&&Number.isFinite(T.price)?[T.price]:[],C=L.length?Math.min(...L):void 0,I=L.length?Math.max(...L):void 0;return{key:v,count:x,label:T?.label??v,color:T?.color??"#6e7bff",...C!==void 0?{price:C,priceMin:C,priceMax:I}:{}}}).sort((v,x)=>(v.priceMin??1/0)-(x.priceMin??1/0)||v.key.localeCompare(x.key)),y=m.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),p=m.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),g=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,b=v=>{let x=null,T=0;for(let[P,L]of v)(L>T||L===T&&x!=null&&P<x)&&(x=P,T=L);return x},S=b(d)??b(c),k=(S?m.find(v=>v.key===S)?.color:void 0)??g?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:f}:{},label:a.displayLabel??a.label,zoneLabel:g?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:k,seatsLeft:h,...y.length?{priceMin:Math.min(...y),priceMax:Math.max(...p)}:{},categories:m}}var on=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 Fh(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function _h(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 jg=!0,Jg=!0,eb="#f43f5e",tb=10,ib=15e3,Bh=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new nn;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 on;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=Rh(e.numberOfPlacesToSelect);let i=Mh(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,tb);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=wr(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let n of No){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return nh(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),n=this.getActiveFloorId(),o=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),n?{floorId:n}:void 0),this.applyRowBandPreview(e),o&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(o=>typeof o=="string");if(i.length===this.hidden.size&&i.every(o=>this.hidden.has(o)))return!1;this.hidden=new Set(i);let n=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),n&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(n=>typeof n=="string");return i.length===this.closedSections.size&&i.every(n=>this.closedSections.has(n))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(o=>o.id);let n=this.labelToId.get(e);return n?[n]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let o=this.visibleDoc(),r=Ct(o).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let o=this.groupedTablesByLabel.get(e.label);return{...o?.displayLabel&&o.displayLabel!==o.label?{displayLabel:o.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}let i=this.labelToSeat.get(e.label),n=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),n={},o=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:o(r)}),C=>({ok:!1,error:C,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:o(a)}),()=>({ok:!1,elapsed:o(a)})),c=await s;if(n.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=bh(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let u=performance.now();try{this.inventoryModelVersion=d.event.inventoryModelVersion===2?2:1;let C=$r(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(C.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(C.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(C.flatMap(I=>I.chairs.map(R=>[R.id,I]))),this.tableQuantities=new Map(C.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=C.reduce((I,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(C){return this.emitError(C),null}this.expandedSeats=Ve(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=rh(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=h.labelToId,this.labelToSeat=h.labelToSeat,this.seatById=h.seatById,this.seatContext=h.seatContext,this.allIds=h.allIds;for(let C of this.groupedTablesByLabel.values()){let I=C.chairs[0];I&&(this.labelToId.set(C.label,I.id),this.labelToSeat.set(C.label,I))}n.normalizeBuyerModel=o(u);let f=d.event.currency??this.opts.currency;this.currency=f??"USD";let m=performance.now(),y=Yd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:f,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(i),this.opts.onSeatsRevealed?.()},onSelect:C=>{this.handleRendererSelect(C)},onDeselect:C=>{this.handleRendererDeselect(C)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(C,I)=>{this.opts.onHover?.(C),this.opts.onSeatHover&&this.opts.onSeatHover(C?this.describeSeat(C,I):null)},onFocusSeat:this.opts.onFocusSeat,seatPriceLabel:C=>this.opts.seatPriceLabel?.(C),onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(C,I)=>this.previewSection(C,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:C=>this.opts.onSectionFocus?.(C==null||this.isSectionClosed(C)?null:this.sectionSummary(C)),onDeckTap:C=>this.handleDeckTap(C),onFps:this.opts.onFps});if(n.createRenderer=o(m),this.closed)return y.destroy(),null;this.renderer=y,this.viewportInsets&&y.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&y.setFitClearance?.(this.fitClearance);let p=null,g="free",b=[],S,w=await l;if(w.ok){let C=w.objects;this.hidden=new Set(C.hidden??[]),b=(C.closed??[]).filter(I=>typeof I=="string"),p=C.seats,g=C.default??"free",S=typeof C.fetchedAt=="number"?C.fetchedAt:void 0}if(n.loadStatuses=w.elapsed,this.closed)return y.destroy(),this.renderer=null,null;let k=performance.now();this.opts.categoryPriceRanges&&y.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),y.setChart(this.visibleDoc()),this.applyRowBandPreview(y),oh(y,d.doc,e.clientWidth),this.opts.colorblindSafe&&y.setColorblindSafe?.(!0),n.buildScene=o(k),this.closedSections=new Set(b);let v=performance.now();b.length&&y.setClosedSections?.(b),this.seatsBuilt=!0;let x=this.pendingSnapshot;this.pendingSnapshot=null;let T=_h(x,p?{seats:p,default:g,fetchedAt:S}:null);T&&this.applySeatsMap(T.seats,T.default,T.source,T.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(v);let P=performance.now();y.forceDraw(),n.firstPaint=o(P);let L=performance.now();return w.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(L),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Ho(d.event.status),venueSelling:d.event.venueSelling===!0,eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:f,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:n}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let n of this.renderer.getSelection()){let o=this.groupedTableBySeatId.get(n.id);o?i.has(o.label)||(i.add(o.label),e.push(this.toTableSeat(o))):e.push(this.toSeat(n))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let n of e){let o=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(o)o.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(o.label)||(this.tableQuantities.set(o.label,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(o.label));else{let r=this.seatById.has(n)?n:this.labelToId.get(n);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),n=new Set,o=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?o.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&n.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?o.push(c.label):n.add(l)}}if(o.length&&this.emitError(new Fe(Tn(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 Eh(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&&Cn(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 jg&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(Jg||!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 Fe(Tn([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 Go(this,e,i)}resumeHold(e){return yh(this,e)}extendHold(e){return Sh(this,e)}categoryAvailability(){return dh({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?ah(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(ch(this.getGAAreas(),this.gaSelected,{wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0}))}async holdGA(e,i,n={}){let o=this.visibleDoc();if(!o||!Number.isFinite(i)||i<1)return null;let r=Ct(o).find(d=>d.id===e);if(!r)return null;let s=lh(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 mh(this.visibleDoc())}pickPremiumBlock(e,i,n){return gh({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}=Ae(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}=Ae(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return vh(this,e,i,n)}release(){return wh(this)}releaseLabels(e){return kh(this,e)}releaseConfirmed(e,i){return xh(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(o=>o.notForSale).map(o=>o.key));if(!i.size)return[];let n=[];for(let[o,r]of this.seatById)i.has(r.categoryKey)&&n.push(o);return n}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return ui(this._doc?.theme?.seatScale)*J*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){Zd(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 Do(this.pickerFocusContext,e)}accessibilitySpread(e){return Qd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Jd(this.pickerFocusContext,e)}accessibilityFilterDims(e){return th(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){ih(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);jd(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=>Pe(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,e.label),currency:this.currency,...n,...r,...s};let d=this.ownTierPrice(e.label,c.tier);return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l.map(u=>this.ownTierPrice(e.label,u)),tierId:d.id,...n,...r,...s}}toTableSeat(e){let i=e.chairs[0],n=this.tiersFor(e.categoryKey)?.filter(s=>mi(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),o=this.tableTierResolution(e),r=o.kind==="resolved"?this.ownTierPrice(e.label,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,e.label),currency:this.currency,...n?{tiers:n.map(s=>this.ownTierPrice(e.label,s)),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,i){return(i?Pn(this._doc?.seatPrices,i,null):void 0)??this._doc?.categories.find(o=>o.key===e)?.price??0}ownTierPrice(e,i){let n=Pn(this._doc?.seatPrices,e,i.id);return n===void 0?i:{...i,price:n}}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=Xr(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?mi(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(i=>i.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let i=e.chairs[0]?.id??"";return mi(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let n=this.seatById.get(e);if(!n)return;let o=this.tiersForSeat(n);if(o){if(i==null)this.seatTiers.delete(e);else if(o.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let n of e){let o=this.labelToSeat.get(n);o&&i.push(this.toSeat(o))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return Yr(this._doc,i.map(n=>({label:n.label,...n.tierId?{tierId:n.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?B("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let n=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),o=new Set(e.getSelection().map(s=>s.id));(n&&o.size?Cn(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(B("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return Lh(this,e)}handle409Conflicts(e){Ch(this,e)}setHold(e,i="created"){Th(this,e,i)}clearHold(){Ih(this)}expireActiveHold(){return Ph(this)}applySeatsMap(e,i="free",n="http",o){n==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Fh(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=tn(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[tn(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=uh({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 hh(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=fh(()=>{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),onSales:e=>this.opts.onSalesNotice?.(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=tn(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,eb));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}let r=o;if(r?.type==="sales"){typeof r.state=="string"&&this.opts.onSalesNotice?.({state:r.state,revision:Number(r.revision)||0,changedAt:typeof r.changedAt=="number"?r.changedAt:null});return}if(!this.renderer||!o||typeof o!="object")return;let a=o;Array.isArray(a.hidden)&&this.syncHidden(a.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(a.closed)&&this.syncClosed(a.closed)&&this.opts.onStatusChange?.({changed:!0}),a.type!=="hidden"&&(a.seats&&typeof a.seats=="object"?this.applySeatsMap(a.seats):Array.isArray(a.changes)&&this.applyStatusChanges(a.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=sh(e,{baseMs:1e3,maxMs:ib,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var nb=5,ob=-1.1,Wo=35;function Vo(t,e){let i=t-_e,n=Math.atan2(nb-i,e)*180/Math.PI,o=Math.atan2(ob-i,e)*180/Math.PI;return o<-Wo&&(n+=-Wo-o,o=-Wo),{topPitch:n,basePitch:o}}var ne=2048,xe=1024,jt=ir,D=Math.PI*2,rb=xe/180,wt=t=>(t+180)/360*ne,Z=t=>(90-t)/180*xe;function Gh(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 Wh(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 rn=96,Xo=360/rn,sb=.6,zo=[17,23,42];function Ko(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(zo[0]-t[0])*n),r=Math.round(t[1]+(zo[1]-t[1])*n),s=Math.round(t[2]+(zo[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function Oh(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 de(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 Dh=new Map;function Nh(t){if(!t)return null;let e=Dh.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=de(n,.3,.42);return Dh.set(t,o),o}function ab(t,e,i,n){let o=new Array(rn).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,u=Math.hypot(c,d)*jt;if(u<1.5||u>95)continue;let h=a.eyeHeightM??_e,f=h-n;Math.abs(f)>r&&(r=Math.abs(f));let m=Math.atan2(f,u)*180/Math.PI,y=Math.atan2(h-_e-n,u)*180/Math.PI,g=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,b=Math.min(rn-1,Math.max(0,Math.floor((g+180)/Xo))),S=m>34&&u<16,w=o[b];w?(m>w.top&&(w.top=m),y<w.base&&(w.base=y),u<w.nearM&&(w.nearM=u,w.tint=Nh(a.categoryKey)),w.overhead=w.overhead||S):o[b]={top:m,base:y,nearM:u,overhead:S,tint:Nh(a.categoryKey)}}return{bins:o,maxDelta:r}}function lb(t,e,i,n){for(let o=0;o<rn;o++){let r=e[o];if(!r)continue;let s=-180+o*Xo,a=i(s),l=i(s+Xo);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),u=n(c),h=n(d);if(h<=u)continue;let f=r.nearM/95,m=r.tint,y=m?Oh([44,54,80],m,.34):[44,54,80],p=m?Oh([24,30,48],m,.28):[24,30,48],g=t.createLinearGradient(0,u,0,h);g.addColorStop(0,Ko(y,f)),g.addColorStop(.24,Ko(p,f)),g.addColorStop(1,Ko([10,13,22],f)),t.fillStyle=g,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-f*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,n(0))-u;if(S>8){let k=1-f*.4;for(let v=1;v<6;v++){let x=u+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*k})`,t.fillRect(a,x,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*k})`,t.fillRect(a,x+1.5,l-a+1,1.2)}}if(r.overhead){let w=n(Math.min(86,c+12)),k=t.createLinearGradient(0,w,0,u);k.addColorStop(0,"rgba(3,4,8,0.9)"),k.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=k,t.fillRect(a,w,l-a+1,u-w),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function cb(t,e,i){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let g of i){a++,g.sectionId&&s.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,w=Math.hypot(b,S)*jt;if(w<.5)continue;let k=Math.atan2(b,-S),v=Math.floor((k+Math.PI)/D*72);v<0?v=0:v>=72&&(v=71),o[v]=!0,w<r[v]&&(r[v]=w)}let l=0,c=[];for(let g=0;g<72;g++)o[g]&&(l++,c.push(r[g]));let d=l/72*360;c.sort((g,b)=>g-b);let u=c.length?c[c.length>>1]:0,h=c.length?c[Math.floor(c.length*.15)]??u:0,f=c.length?c[Math.floor(c.length*.85)]??u:0,m=h>.5?f/h:1,y=Gh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&u>11&&m>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:y,voidRadiusM:u,aspect:m}}var db=5;function hb(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,D),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,D),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,D),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,D),t.fill();break;default:break}}function ub(t,e,i,n,o){let r=n*.44,s=n*o.shoulderK,a=n*.66,l=n*1.68,c=n*5.4,d=`rgba(${o.clothing[0]},${o.clothing[1]},${o.clothing[2]},${o.alpha})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;t.save(),t.translate(e,i);let h=o.lean*n;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-h-n*.6,-s,l-h),t.quadraticCurveTo(-s*1.05,l+n*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+n*1.2,s,l+h),t.quadraticCurveTo(r*1.18,l+h-n*.6,r,a),t.closePath(),t.fill(),t.fillStyle=u,t.fillRect(-r*.82,n*.5,r*1.64,n*.9),t.save(),t.rotate(o.tilt),t.translate(o.turn*n,0),t.fillStyle=u,n>=18?(t.beginPath(),t.moveTo(-n*.9,-n*.15),t.quadraticCurveTo(-n*.96,-n*1.12,0,-n*1.06),t.quadraticCurveTo(n*.96,-n*1.12,n*.9,-n*.15),t.quadraticCurveTo(n*.86,n*.55,n*.36,n*.98),t.quadraticCurveTo(0,n*1.14,-n*.36,n*.98),t.quadraticCurveTo(-n*.86,n*.55,-n*.9,-n*.15),t.closePath(),t.fill(),n>=22&&(t.beginPath(),t.ellipse(-n*.9,n*.18,n*.13,n*.22,0,0,D),t.ellipse(n*.9,n*.18,n*.13,n*.22,0,0,D),t.fill())):(t.beginPath(),t.ellipse(0,0,n*.9,n*1.06,0,0,D),t.fill()),hb(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 pb(t,e,i,n,o,r,s){t.fillStyle=`rgba(${o[0]},${o[1]},${o[2]},${s})`,t.beginPath(),t.moveTo(e-n*1.72,i+n*4),t.quadraticCurveTo(e-n*1.78,i+n*1.55,e-n*.46,i+n*1.02),t.lineTo(e-n*.4,i+n*.62),t.lineTo(e+n*.4,i+n*.62),t.lineTo(e+n*.46,i+n*1.02),t.quadraticCurveTo(e+n*1.78,i+n*1.55,e+n*1.72,i+n*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,n*.9,n*1.05,0,0,D),t.fill()}function Uo(t,e,i,n,o){let r=n*.1,s=i-n*.9,a=i-n*.74,l=i-n*.46,c=n*.13,d=n*.09,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,h=t.createRadialGradient(e,i,1,e,i,n*.24);h.addColorStop(0,"rgba(0,0,0,0.4)"),h.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=h,t.beginPath(),t.ellipse(e,i/.28,n*.24,n*.24,0,0,D),t.fill(),t.restore(),t.fillStyle=u,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+n*.02),t.lineTo(e+d*.1,l+n*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-n*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-n*.12,e+c,a),t.quadraticCurveTo(e,a-n*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=n*.055;let f=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,f),t.lineTo(e-d*.4,l-n*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-n*.04,n*.07,n*.09,-.5,0,D),t.fill()):o.pose===3?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=n*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-n*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,f),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,f),t.lineTo(e+c*.95,l+n*.02),t.stroke()),t.fillStyle=u,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,D),t.fill(),o.rimStrength>.01&&(t.strokeStyle=`rgba(${o.rim[0]},${o.rim[1]},${o.rim[2]},${(.6*o.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,n*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function sn(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 $o(t,e,i,n,o){let r=t.createRadialGradient(e,i,0,e,i,n*3);r.addColorStop(0,`rgba(${o},0.9)`),r.addColorStop(.4,`rgba(${o},0.35)`),r.addColorStop(1,`rgba(${o},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,n*3,0,D),t.fill(),t.fillStyle=`rgba(${o},1)`,t.beginPath(),t.arc(e,i,n,0,D),t.fill()}function FI(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*jt),c=t.eyeHeightM??_e,d=cb(t,e,i),u=Wh(d.seed),h=210+u()*150,f=de(220+(u()-.5)*60,.55,.82),m=`${f[0]},${f[1]},${f[2]}`,y=o.createLinearGradient(0,0,0,xe);y.addColorStop(0,"#080b12"),y.addColorStop(.42,"#12182c"),y.addColorStop(.5,"#1c2440"),y.addColorStop(.56,"#151b2c"),y.addColorStop(.78,"#171e30"),y.addColorStop(1,"#131829"),o.fillStyle=y,o.fillRect(0,0,ne,xe);let p=o.createLinearGradient(0,Z(-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,Z(-6),ne,xe-Z(-6));let g=Math.atan2(r,-s),b=ab(t,i,g,c),S=b.maxDelta>=sb;S&&lb(o,b.bins,wt,Z);let w=Math.max(.3,Math.min(1,1-(l-6)/60)),k=Vo(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),x=Math.min(45,k.topPitch),T=k.basePitch;d.mode==="sport"?gb(o,l,c,d,w,h,m,u):d.mode==="arena"?mb(o,l,c,d,w,m,u):fb(o,v,x,T,w,h,m,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${m},0.8)`;for(let C=0;C<P;C++){let I=(C+.5)/P*ne,R=Z(d.mode==="sport"?58:54+C*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,D),o.fill()}bb(o,t,i,e,g,c,r,s,S,d);let L=o.createLinearGradient(0,0,0,xe);return L.addColorStop(0,"rgba(0,0,0,0.85)"),L.addColorStop(.12,"rgba(0,0,0,0)"),L.addColorStop(.9,"rgba(0,0,0,0)"),L.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=L,o.fillRect(0,0,ne,xe),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function fb(t,e,i,n,o,r,s,a){let l=wt(-e),c=wt(e),d=Z(i),u=Z(n),h=c-l,f=u-d,m=Z(Math.min(50,i+10)),y=h*(1.1+(1-o)*.5),p=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,y);p.addColorStop(0,"rgba(255, 214, 150, 0.34)"),p.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),p.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),p.addColorStop(1,"rgba(99, 102, 241, 0)"),t.fillStyle=p,t.fillRect(l-h*.6,d-f*1.2,h*2.2,f*3.4);let g=de(r,.62,.55),b=de(r+40,.7,.5),S=de(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,h,f),t.clip();let w=t.createLinearGradient(0,d,0,u);w.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),w.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),w.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=w,t.fillRect(l,d,h,f),t.globalAlpha=1;let k=t.createRadialGradient(ne/2,(d+u)/2,h*.12,ne/2,(d+u)/2,h*.62);k.addColorStop(0,"rgba(6,8,14,0)"),k.addColorStop(.7,"rgba(6,8,14,0.15)"),k.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=k,t.fillRect(l,d,h,f),t.restore();let v=3+Math.floor(a()*3),x=f*.46,T=u-f*.08;for(let A=0;A<v;A++){let _=(A+1)/(v+1),F=l+h*(.22+_*.56+(a()-.5)*.06);Uo(t,F,T,x*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:de(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-h*.5,m,h*.5,u-m),t.fillRect(c,m,h*.5,u-m);let P=h*.055+3,L=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,u),t.lineTo(l-L,m),t.lineTo(l+h*.012,m),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+P,u),t.lineTo(c+L,m),t.lineTo(c-h*.012,m),t.closePath(),t.fill(),t.fillRect(l-L,m,h+L*2,(u-m)*.12);let C=f*.14,I=m+(u-m)*.12;t.fillStyle="rgba(4,6,12,0.96)";let R=7;t.beginPath(),t.moveTo(l-L,I);for(let A=0;A<=R;A++){let _=l-L+(h+L*2)*A/R;t.quadraticCurveTo(_-(h+L*2)/R/2,I+C,_,I)}t.lineTo(c+L,I),t.lineTo(c+L,m),t.lineTo(l-L,m),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,I,1.5,u-I),t.fillRect(c,I,1.5,u-I),t.fillStyle="#0b0f18",t.fillRect(l-P,u-f*.05,h+P*2,f*.05+3);let M=t.createLinearGradient(0,u-f*.05,0,u+f*.12);M.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),M.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=M,t.fillRect(l-P,u-f*.05,h+P*2,f*.2);let E=3+Math.floor(a()*2);for(let A=0;A<E;A++){let _=(A+1)/(E+1),F=l+h*(_+(a()-.5)*.08),N=Z(Math.min(62,i+26)),oe=(a()-.5)*h*.16;sn(t,F,N,F+oe,u,4,h*.09,s,.16*(.7+o*.5)),$o(t,F,N,2.4,s)}}function mb(t,e,i,n,o,r,s){let a=Math.min(e*.6,Math.max(3,n.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=ne/2,d=1.2,u=Math.max(e*.45,e-a),h=e+a,f=Math.atan2(d-i,u)*180/Math.PI,m=Math.atan2(d-i,h)*180/Math.PI,y=Math.atan2(-i,u)*180/Math.PI,p=Z(f),g=Z(m),b=Z(y),S=wt(l)-c,w=Math.max(6,(p-g)/2),k=(p+g)/2,v=t.createRadialGradient(c,b,4,c,b,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,g-w,S*5.2,b-g+w+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,k),t.ellipse(c,k,S,w,0,Math.PI,0,!1),t.lineTo(c+S,b),t.ellipse(c,b,S,w,0,0,Math.PI,!1),t.closePath(),t.fill();let x=t.createLinearGradient(0,k,0,b);x.addColorStop(0,`rgba(${r},0.14)`),x.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=x,t.fillRect(c-S,k,S*2,b-k);let T=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],P=T[Math.floor(s()*T.length)],L=s()<.5?-1:1,C=X=>c+X.u*L*S*.84,I=X=>k+X.v*w*.8,R=P.find(X=>X.lead)??P[0],M=C(R),E=t.createLinearGradient(0,k-w,0,k+w);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),t.fillStyle=E,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.fill();let A=t.createRadialGradient(M,k,2,M,k,S);A.addColorStop(0,`rgba(255,214,160,${(.5*o).toFixed(3)})`),A.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=A,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,k,S,w,0,0,D),t.stroke();let _=Math.max(24,(b-g)*1.3),F=P.length>=3?3:2;for(let X=0;X<F;X++){let Le=(-.62+X*.52+(s()-.5)*.12)*-L,We=c+Le*S*.7,kt=k-w*(.45+s()*.18),it=S*(.07+s()*.04),un=_*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(We-it/2,kt-un,it,un),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(We-it/2,kt-un,it,1.5)}if(P.length>=3){let X=c-R.u*L*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(X,k-w*.34,S*.08,w*.1,0,0,D),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let X of[...P].sort((Le,We)=>Le.v-We.v)){let Le=.82+(X.v+1)*.14;Uo(t,C(X),I(X),_*Le*(X.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:X.pose,rim:de(40,.72,.8),rimStrength:X.lead?1.4:.9})}let N=Z(Math.min(60,m+34)),oe=w*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,N,S*1.15,oe,0,0,D),t.stroke();let W=4+Math.floor(s()*3);for(let X=0;X<W;X++){let Le=X/W*D,We=c+Math.cos(Le)*S*1.15,kt=N+Math.sin(Le)*oe;if(Math.sin(Le)>-.2){let it=c+(s()-.5)*S*.8;sn(t,We,kt,it,k,3,S*.32,r,.2*(.7+o*.4))}$o(t,We,kt,3,r)}let O=Z(Math.min(52,m+24)),z=Math.max(60,S*.4),re=Math.max(24,z*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-z*.3,O-re/2),t.lineTo(c-z*.16,O-re*2.2),t.moveTo(c+z*.3,O-re/2),t.lineTo(c+z*.16,O-re*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-z/2,O-re/2,z,re);let ln=t.createLinearGradient(0,O-re*.3,0,O+re*.42);ln.addColorStop(0,`rgba(${r},0.5)`),ln.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=ln,t.fillRect(c-z*.42,O-re*.3,z*.84,re*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-z/2,O+re/2-2,z,2);let cn=t.createRadialGradient(c,O,4,c,O,z*1.1);cn.addColorStop(0,`rgba(${r},0.2)`),cn.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=cn,t.fillRect(c-z*1.1,O-z*.8,z*2.2,z*1.6);let dn=t.createRadialGradient(c,(N+k)/2,6,c,(N+k)/2,S*1.5);dn.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),dn.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=dn,t.fillRect(c-S*1.5,N-40,S*3,k-N+80),t.restore();let zh=c+Math.sign(M-c||1)*S*.5;sn(t,zh,N-oe*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let hn=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);hn.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),hn.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=hn,t.beginPath(),t.ellipse(M,I(R),S*.2,w*.24,0,0,D),t.fill(),t.restore()}function gb(t,e,i,n,o,r,s,a){let l=ne/2,c=Math.max(10,n.voidRadiusM),d=Math.max(2,e-c),u=e+c,h=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),f=Math.atan2(-i,d)*180/Math.PI,m=Math.atan2(-i,u)*180/Math.PI,y=Z(f),p=Z(m),g=wt(h)-l,b=(y+p)/2,S=Math.max(10,(y-p)/2),w=t.createRadialGradient(l,b,4,l,b,g);w.addColorStop(0,"#e8f0fb"),w.addColorStop(.7,"#b9c9e2"),w.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,b,g,S,0,0,D),t.clip(),t.fillStyle=w,t.fillRect(l-g,b-S,g*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,b-S),t.lineTo(l,b+S),t.moveTo(l-g*.5,b-S),t.lineTo(l-g*.5,b+S),t.moveTo(l+g*.5,b-S),t.lineTo(l+g*.5,b+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,b,S*.9,S*.5,0,0,D),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,b,g,S,0,0,D),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let C=0;C<5;C++){let I=l+(a()-.5)*g*1.4,R=b+(a()-.5)*S*1.1,M=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,R,M*.6,M,0,0,D),t.fill()}let k=t.createRadialGradient(l,b,4,l,b,g*1.4);k.addColorStop(0,"rgba(200,220,255,0.12)"),k.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(l-g*1.4,p-S,g*2.8,y-p+S*2),t.restore();let v=Z(Math.min(66,m+60)),x=Math.max(80,g*.7),T=x*.5,P=t.createRadialGradient(l,v,4,l,v,x*1.6);P.addColorStop(0,`rgba(${s},0.3)`),P.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=P,t.fillRect(l-x*1.6,v-x*1.2,x*3.2,x*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-x/2,v-T/2),t.lineTo(l+x/2,v-T/2),t.lineTo(l+x*.6,v),t.lineTo(l+x/2,v+T/2),t.lineTo(l-x/2,v+T/2),t.lineTo(l-x*.6,v),t.closePath(),t.fill();let L=r;for(let C=0;C<3;C++){let I=de(L+C*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=x*.26;t.fillRect(l-x*.42+C*(R+x*.06),v-T*.32,R,T*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let C=0;C<8;C++){let I=l-x*.6+x*1.2*C/7;t.beginPath(),t.arc(I,v+T*.62,2.4,0,D),t.fill()}}function bb(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let y of i){if(y.id===e.id)continue;let p=y.x-e.x,g=y.y-e.y,b=Math.hypot(p,g)*jt;if(d&&y.sectionId===d&&b<3&&p*s+g*a>0&&(u=!0),b<.3||b>32)continue;let w=((Math.atan2(p,-g)-o)*180/Math.PI+540)%360-180,k=l?(y.eyeHeightM??_e)-r:0,v=Math.atan2(k-.28,b)*180/Math.PI;if(v>10&&b>5)continue;let x=0;for(let L=0;L<y.id.length;L++)x=x*31+y.id.charCodeAt(L)&65535;let T=.9+(x&15)/40,P=Math.min(78,Math.atan2(.16,b)*180/Math.PI*rb*T);P<1.2||h.push({hx:wt(w),hy:Z(v),r:P,d:b,hash:x})}h.sort((y,p)=>p.d-y.d);let f=[];{let y=[...h].sort((b,S)=>b.hy-S.hy),p=[],g=()=>{if(!p.length)return;let b=p.reduce((k,v)=>k+v.d,0)/p.length,S=p.reduce((k,v)=>k+v.hy,0)/p.length,w=p.reduce((k,v)=>k+v.r,0)/p.length;f.push({figs:p.sort((k,v)=>v.d-k.d),d:b,hy:S,r:w}),p=[]};for(let b of y){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),p.push(b)}g()}f.sort((y,p)=>p.d-y.d);let m=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let y of f){if(y.figs.length>=3&&y.r>=1.6&&y.r<26){let p=[],g=[...y.figs].sort((w,k)=>w.hx-k.hx),b=[];for(let w of g){let k=b[b.length-1];k&&w.hx-k.hx>Math.max(14,w.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(w)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-y.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let w of p){let k=w[0].hx-y.r*1.6,v=w[w.length-1].hx+y.r*1.6;t.beginPath(),t.roundRect(k,y.hy+y.r*.8,v-k,y.r*2.4,y.r*.8),t.fill()}}}for(let p of y.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),b=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+b,17+(p.hash>>4&6)+b,25+(p.hash>>4&6)+b],w=m[p.hash%m.length],k=[w[0]+b,w[1]+b,w[2]+b];if(p.r>=13){let v=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;ub(t,p.hx,p.hy,p.r,{tone:S,clothing:k,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%db,rim:v,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?pb(t,p.hx,p.hy,p.r,k,S,g):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,D),t.fill(),t.beginPath(),t.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),t.fill())}}if(u){let y=Z(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,y,ne,xe-y),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let b=(g+.5)/p*ne;t.beginPath(),t.ellipse(b,y+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var ue=480,vt=270,Yo=50,tt=30,Hh=t=>(t+Yo)/(2*Yo)*ue,Qt=t=>(tt-t)/(2*tt)*vt;function _I(t,e,i){let n=document.createElement("canvas");n.width=ue,n.height=vt;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*jt),l=Wh(Gh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=de(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=o.createLinearGradient(0,0,0,vt);h.addColorStop(0,"#080b12"),h.addColorStop(.44,"#151c32"),h.addColorStop(.5,"#1d2644"),h.addColorStop(.58,"#161c2e"),h.addColorStop(1,"#131829"),o.fillStyle=h,o.fillRect(0,0,ue,vt);let f=t.eyeHeightM??_e,m=Vo(f,a),y=Math.min(Yo-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(tt-2,m.topPitch),g=Math.max(-tt+2,m.basePitch),b=Hh(-y),S=Hh(y),w=Qt(p),k=Qt(g),v=S-b,x=k-w,T=Math.max(.35,Math.min(1,1-(a-6)/60)),P=Qt(Math.min(tt-1,p+8)),L=o.createRadialGradient(ue/2,(w+k)/2,4,ue/2,(w+k)/2,v*1.15);L.addColorStop(0,"rgba(255,214,150,0.34)"),L.addColorStop(.28,"rgba(150,150,230,0.3)"),L.addColorStop(.6,"rgba(99,102,241,0.12)"),L.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=L,o.fillRect(b-v*.6,w-x*1.2,v*2.2,x*3.4);let C=de(c,.62,.55),I=de(c+40,.7,.5),R=de(c+70,.78,.52);o.save(),o.beginPath(),o.rect(b,w,v,x),o.clip();let M=o.createLinearGradient(0,w,0,k);M.addColorStop(0,`rgb(${C[0]},${C[1]},${C[2]})`),M.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),M.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),o.globalAlpha=.8,o.fillStyle=M,o.fillRect(b,w,v,x),o.globalAlpha=1;let E=o.createRadialGradient(ue/2,(w+k)/2,v*.12,ue/2,(w+k)/2,v*.6);E.addColorStop(0,"rgba(6,8,14,0)"),E.addColorStop(.7,"rgba(6,8,14,0.15)"),E.addColorStop(1,"rgba(5,6,11,0.9)"),o.fillStyle=E,o.fillRect(b,w,v,x),o.restore();let A=3,_=k-x*.08;for(let W=0;W<A;W++){let O=(W+1)/(A+1);Uo(o,b+v*(.24+O*.52),_,x*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:de(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(b-v*.5,P,v*.5,k-P),o.fillRect(S,P,v*.5,k-P);let F=v*.05+2,N=F*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(b,k),o.lineTo(b-F,k),o.lineTo(b-N,P),o.lineTo(b+v*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,k),o.lineTo(S+F,k),o.lineTo(S+N,P),o.lineTo(S-v*.012,P),o.closePath(),o.fill(),o.fillRect(b-N,P,v+N*2,(k-P)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(b-1.2,P,1.2,k-P),o.fillRect(S,P,1.2,k-P),o.fillStyle="#0b0f18",o.fillRect(b-F,k-x*.05,v+F*2,x*.05+2);let oe=o.createLinearGradient(0,k-x*.05,0,k+x*.14);oe.addColorStop(0,`rgba(255,206,140,${(.5*T).toFixed(3)})`),oe.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=oe,o.fillRect(b-F,k-x*.05,v+F*2,x*.22);for(let W=0;W<3;W++){let O=(W+1)/4,z=b+v*O,re=Qt(Math.min(tt-1,p+20));sn(o,z,re,z+(l()-.5)*v*.14,k,3,v*.09,u,.17*T),$o(o,z,re,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let W=0;W<8;W++)o.beginPath(),o.arc((W+.5)/8*ue,Qt(tt-4-W%2*3),2.2,0,D),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,vt-26,ue,26),o.fillStyle="rgba(30,37,54,0.9)";for(let W=0;W<9;W++){let O=W*(ue/9)+ue/18;o.beginPath(),o.ellipse(O,vt-22,ue/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:n.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Vh=new Set(["en"]),an=new Map;async function yb(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await qr(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-M2TUVL75.js"),i=e[t];return i?await i():null}async function NI(t,e){let i=ha(t,e);if(i==="en"||Vh.has(i))return ht(i),i;if(!da.includes(i))return ht("en"),"en";try{let n=an.get(i);n||(n=yb(i),an.set(i,n));let o=await n;return an.delete(i),o?(ht(i,o),Vh.add(i),i):(ht("en"),"en")}catch{return an.delete(i),ht("en"),"en"}}export{kb as ACCESSIBILITY_RING_COLOR,Zo as ACCESSIBILITY_TYPES,gy as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,my as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,Rb as BOOTH_TYPES,vb as CHART_STORAGE_KEY,sS as CURRENCY_CHOICES,oS as DEFAULT_CURRENCY,Fb as DEFAULT_EVENT_INVENTORY_LIMIT,_T as EMPTY_AVAILABILITY_REFRESH,Db as EVENT_CONFIGURATION_EXPORT_SCHEMA,Ob as EVENT_CONFIGURATION_SCHEMA,hy as FLOOR_COVER_LIMIT,ly as FLOOR_STACK_GAP_RATIO,fy as FLOOR_STACK_MIN_SURFACE_PX,yy as GA_UNIT_LABEL_PREFIX,FT as HOLD_CLOCK_SKEW_MS,Rn as LABEL_FADE_MS,Ib as LABEL_STYLE_MAX_SIZE,Tb as LABEL_STYLE_MIN_SIZE,_b as LARGE_VENUE_INVENTORY_MODULE,Gy as LEGIBILITY_HYSTERESIS_PX,uy as LEVEL_CONTEXT_PREFIX,mS as LOCALE_NAMES,Ab as MAX_EVENT_INVENTORY,vy as MAX_GA_CAPACITY,Ly as MAX_ONE_PARTY_GUESTS,ci as MIN_POINTER_TARGET_PX,Cy as ONE_PARTY_LIMIT_MESSAGE,Bh as PickerController,Fe as PickerSelectionError,By as RENDERED_QUALITY_REPORT_VERSION,Pb as ROW_AISLE_SEATS,Lb as SEAT_COMMERCIAL_MARKS,Ry as SEAT_TYPE_ICON_BODY,bn as SEAT_TYPE_ICON_VIEWBOX,Sb as STAGE_LABEL_STYLE_MAX_SIZE,Ou as SUPPORTED_LOCALES,Mb as SURROUNDINGS_SHAPE_ROLES,Bo as SeatmapRenderer,Ub as TABLE_SEAT_OFFSET,Xb as TIER_HEIGHT_M,da as TRANSLATED_LOCALES,br as UNGROUPED_ID,hh as accessNeedsFor,Py as accessibilityLabelKey,wb as accessibilityMeta,xb as accessibilityRingColor,ii as allObjects,wr as applyHidden,Ag as applyOrganizerSeatGlyph,Ho as asPickerSalesState,fh as attachVisibilityCatchUp,by as automaticRoundTableRadius,Vb as canTransitionEventConfiguration,Gb as canonicalEventConfigurationJson,ar as chartBounds,$d as clearOrganizerSeatGlyph,dr as combinedFloorZoneId,Rt as compactRowLabel,vr as computeSections,Ay as computeSectionsPerFloor,Yd as createRenderer,Zr as crossesThreshold,_u as currencyExponent,cS as currencySymbol,nt as effectiveFloorOverview,Bb as eventInventoryLimitFor,iy as expandBooth,Ve as expandChart,Qb as expandRow,Zb as expandRowSlots,ty as expandTable,Jb as expandTableSlots,sy as floorObjects,cy as floorStackPlacements,ti as floorsOf,wS as formatDate,lS as formatMinor,ce as formatMoney,Bu as fromMinorUnits,Ct as gaAreasOf,fn as gaBoxBounds,pn as gaBoxMode,xy as gaInventorySegments,wy as gaUnitLabel,Ty as gaUnitLabels,mn as gaUnitLabelsForModel,Lt as gaWheelchairPlaceCount,gn as gaWheelchairUnitLabels,FI as generateSeatPanorama,_I as generateSeatThumb,gS as getLocale,Iy as growJoinedGAInventory,_y as hiddenObjectIds,Xg as holdHasLapsed,OT as holdRecoveryShape,En as hysteresisScale,fr as initialFloorMode,Wb as inspectEventConfigurationCompatibility,Oy as inspectRenderedQualityEvidence,en as isDeadHoldRefusal,Sy as isGaUnitLabel,yS as isLocaleLoaded,Ud as isOrganizerGlyphPainted,Fy as isSectionHidden,Eb as layerOf,ur as layoutCombinedFloorPlan,hr as layoutFloorStack,pr as levelContextOutlines,NI as loadLocale,bS as localeDirection,py as mainFloorId,Kb as migrateLegacyEventConfigurations,aS as numberLocale,oy as objectCenter,SS as onLocaleChange,Hg as ownPriceRings,ry as owningSectionForObject,Hb as parseEventConfigurationExport,Nb as parseEventConfigurationVersion,Jt as pointInPolygon,te as pointInPolygonWithHoles,ny as pointOnPolygonBoundary,ei as polygonLabelPoint,uh as reconcileAvailability,BT as refreshChangedSomething,Mn as renderedPx,rS as resolveCurrency,zb as resolveEventConfigurationRollback,ha as resolveLocale,qb as rowInventoryCount,$b as rowSeatPositions,Dy as seatBasePrice,Cb as seatCommercialMeta,mr as seatNoteRowModel,In as seatPriceEntry,Pn as seatPriceFor,Ny as seatPriceRange,gr as seatTypeIconBody,My as seatTypeIconSvg,ot as sectionEntrancesById,Yb as sectionGeometry,Ey as sectionIdentitiesById,yr as sectionLabelsById,Sr as sectionOwnersByObject,ht as setLocale,ca as setMoneyLocale,vS as setStringOverrides,ph as shouldWaitForHoldExpiry,sr as stackFloors,dy as suggestedFloorOverview,B as t,pa as tCount,ey as tableInventoryCount,jb as tableSeatCountsBySide,ay as translateObject,rr as usableHoles,ky as validGAInventorySegments,Wy as zoomTowardPoint};