@seatlayer/core 0.68.1 → 0.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/ar-R52D47QC.js +1 -0
  2. package/dist/be-P34NRZPF.js +1 -0
  3. package/dist/bg-4TEE6DSQ.js +1 -0
  4. package/dist/ca-V4A6DRPR.js +1 -0
  5. package/dist/{categoryInventory-DLDU-RSw.d.ts → categoryInventory-BiUDSvBt.d.ts} +1 -1
  6. package/dist/{categoryInventory-DZapeGK6.d.cts → categoryInventory-DBqgM5in.d.cts} +1 -1
  7. package/dist/{chunk-6JWYLLWU.js → chunk-5AHUGRHH.js} +1 -1
  8. package/dist/{chunk-RMNTGICO.js → chunk-652LV66L.js} +1 -1
  9. package/dist/{chunk-BV6FHURE.js → chunk-7OJ6SB6V.js} +1 -1
  10. package/dist/{chunk-HZT2U5IY.js → chunk-A27USMF7.js} +1 -1
  11. package/dist/{chunk-YYRUKI7A.js → chunk-AWPHGLTU.js} +1 -1
  12. package/dist/{chunk-WZ6ZNPNT.js → chunk-UHPX2P7O.js} +1 -1
  13. package/dist/{chunk-QYZ3P5L6.js → chunk-WXWJZ5DO.js} +1 -1
  14. package/dist/chunk-X3K36XZM.js +1 -0
  15. package/dist/core/chart-ops/index.cjs +1 -1
  16. package/dist/core/chart-ops/index.d.cts +4 -4
  17. package/dist/core/chart-ops/index.d.ts +4 -4
  18. package/dist/core/chart-ops/index.js +1 -1
  19. package/dist/core/inventory/index.d.cts +4 -4
  20. package/dist/core/inventory/index.d.ts +4 -4
  21. package/dist/core/inventory/index.js +1 -1
  22. package/dist/core/layout/index.cjs +1 -1
  23. package/dist/core/layout/index.d.cts +4 -4
  24. package/dist/core/layout/index.d.ts +4 -4
  25. package/dist/core/layout/index.js +1 -1
  26. package/dist/core/quality/index.d.cts +3 -3
  27. package/dist/core/quality/index.d.ts +3 -3
  28. package/dist/core/render-assets/index.d.cts +1 -1
  29. package/dist/core/render-assets/index.d.ts +1 -1
  30. package/dist/core/render-assets/index.js +1 -1
  31. package/dist/core/seatConfidence.d.cts +1 -1
  32. package/dist/core/seatConfidence.d.ts +1 -1
  33. package/dist/core/sections/index.d.cts +5 -5
  34. package/dist/core/sections/index.d.ts +5 -5
  35. package/dist/core/sections/index.js +1 -1
  36. package/dist/cs-GR5H3ZRU.js +1 -0
  37. package/dist/cy-XWYNMRNE.js +1 -0
  38. package/dist/da-NOYMEVP6.js +1 -0
  39. package/dist/de-LFHFC2XO.js +1 -0
  40. package/dist/el-AS3436E6.js +1 -0
  41. package/dist/es-IWBWYUHH.js +1 -0
  42. package/dist/et-VV7YGFEV.js +1 -0
  43. package/dist/{eventConfigurations-kZpADDdx.d.ts → eventConfigurations-CA2XhDig.d.ts} +1 -1
  44. package/dist/{eventConfigurations-C_dst7Ro.d.cts → eventConfigurations-Csdxe89O.d.cts} +1 -1
  45. package/dist/fa-JYLN4BIM.js +1 -0
  46. package/dist/fi-TXRN726I.js +1 -0
  47. package/dist/fr-PKEU6NKI.js +1 -0
  48. package/dist/he-H53ZPEAF.js +1 -0
  49. package/dist/hr-AIG6RMUY.js +1 -0
  50. package/dist/hu-KE64252D.js +1 -0
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.cts +259 -94
  53. package/dist/index.d.ts +259 -94
  54. package/dist/index.js +1 -1
  55. package/dist/it-GVT7VIKV.js +1 -0
  56. package/dist/ja-WMRRUDVD.js +1 -0
  57. package/dist/ku-77V6NTW7.js +1 -0
  58. package/dist/{labeling-Br0U7E-5.d.ts → labeling-CxZWjZBN.d.ts} +1 -1
  59. package/dist/{labeling-B07AFOvn.d.cts → labeling-DG-Sc8VW.d.cts} +1 -1
  60. package/dist/{layout-BjkVhn52.d.cts → layout-BxJIZjPm.d.cts} +19 -5
  61. package/dist/{layout-BdeBpWf8.d.ts → layout-C6YaCOnZ.d.ts} +19 -5
  62. package/dist/localeLoaders-2KZHFEV7.js +1 -0
  63. package/dist/lt-7ICKT4ED.js +1 -0
  64. package/dist/lv-NTO2456Y.js +1 -0
  65. package/dist/nl-IYEEWC4A.js +1 -0
  66. package/dist/no-CKH6R5N2.js +1 -0
  67. package/dist/pl-ALK57HKB.js +1 -0
  68. package/dist/pt-EYFSXBVZ.js +1 -0
  69. package/dist/{renderedQuality-Dn6GyPPj.d.ts → renderedQuality-CWwy14lb.d.ts} +1 -1
  70. package/dist/{renderedQuality-C-L_RuPB.d.cts → renderedQuality-CgBQYezj.d.cts} +1 -1
  71. package/dist/{renderer-BGmZn_bq.d.ts → renderer-DIcDImOu.d.ts} +85 -4
  72. package/dist/{renderer-BHInJ52w.d.cts → renderer-DmG3C8vD.d.cts} +85 -4
  73. package/dist/ro-EUFVCBVY.js +1 -0
  74. package/dist/ru-XAIYWENX.js +1 -0
  75. package/dist/{sections-DCRfHaw4.d.ts → sections-87qiciyN.d.ts} +1 -1
  76. package/dist/{sections-BjzyfqGZ.d.cts → sections-Bb0L9lDT.d.cts} +1 -1
  77. package/dist/{segmentedRowModel-jfYcGWPd.d.cts → segmentedRowModel-BqiM0U65.d.cts} +1 -1
  78. package/dist/{segmentedRowModel-DQggl3UO.d.ts → segmentedRowModel-CEP6crcl.d.ts} +1 -1
  79. package/dist/sk-QIOFO4TV.js +1 -0
  80. package/dist/sl-37I57K2X.js +1 -0
  81. package/dist/sr-HE5DILFD.js +1 -0
  82. package/dist/sv-7SVBFLY3.js +1 -0
  83. package/dist/{ticketRestrictions-CtgOd-2p.d.ts → ticketRestrictions-B_qXQobd.d.ts} +2 -2
  84. package/dist/{ticketRestrictions-mnICaF5t.d.cts → ticketRestrictions-Bj8PBX_x.d.cts} +2 -2
  85. package/dist/tr-JNA4YJEJ.js +1 -0
  86. package/dist/{types-BjTzKc2D.d.cts → types-DNztpn7q.d.cts} +9 -0
  87. package/dist/{types-BjTzKc2D.d.ts → types-DNztpn7q.d.ts} +9 -0
  88. package/dist/uk-2723G7DI.js +1 -0
  89. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  90. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  91. package/dist/view3d/index.cjs +31 -31
  92. package/dist/view3d/index.d.cts +86 -4
  93. package/dist/view3d/index.d.ts +86 -4
  94. package/dist/view3d/index.js +29 -29
  95. package/dist/zh-Hans-ONBXTDHV.js +1 -0
  96. package/dist/zh-Hant-LVTMHA6P.js +1 -0
  97. package/package.json +1 -1
  98. package/dist/ar-QWMSVFMH.js +0 -1
  99. package/dist/be-3GMEVW5Q.js +0 -1
  100. package/dist/bg-W46PKTS7.js +0 -1
  101. package/dist/ca-FS3NR6VL.js +0 -1
  102. package/dist/chunk-I6DNJFRF.js +0 -1
  103. package/dist/cs-I4AKSFRV.js +0 -1
  104. package/dist/cy-ABRR65RX.js +0 -1
  105. package/dist/da-HNKK3PNG.js +0 -1
  106. package/dist/de-QUOPPJF7.js +0 -1
  107. package/dist/el-DUXSH2LY.js +0 -1
  108. package/dist/es-57EA3CTI.js +0 -1
  109. package/dist/et-RBSHG6OS.js +0 -1
  110. package/dist/fa-MJIJUBSS.js +0 -1
  111. package/dist/fi-HKF3AVOV.js +0 -1
  112. package/dist/fr-4U5K5VNS.js +0 -1
  113. package/dist/he-MIVDM6KS.js +0 -1
  114. package/dist/hr-G7RZP6DQ.js +0 -1
  115. package/dist/hu-QZE26B6N.js +0 -1
  116. package/dist/it-L2XL6VR7.js +0 -1
  117. package/dist/ja-Q64SRIIE.js +0 -1
  118. package/dist/ku-OG466MA5.js +0 -1
  119. package/dist/localeLoaders-V5HTIO2J.js +0 -1
  120. package/dist/lt-P2CZWZZL.js +0 -1
  121. package/dist/lv-IRHTS7ME.js +0 -1
  122. package/dist/nl-6WSAK5IB.js +0 -1
  123. package/dist/no-3G67YZZR.js +0 -1
  124. package/dist/pl-DUYWY7BZ.js +0 -1
  125. package/dist/pt-FNIRQMIZ.js +0 -1
  126. package/dist/ro-BBYEYZIK.js +0 -1
  127. package/dist/ru-NMG7W5QE.js +0 -1
  128. package/dist/sk-HI2H44DR.js +0 -1
  129. package/dist/sl-RBLBICUL.js +0 -1
  130. package/dist/sr-SNARC3RS.js +0 -1
  131. package/dist/sv-R7ZWBQIL.js +0 -1
  132. package/dist/tr-2JJXM4IM.js +0 -1
  133. package/dist/uk-GTBKSNLF.js +0 -1
  134. package/dist/zh-Hans-4V7ZG3GP.js +0 -1
  135. package/dist/zh-Hant-XWV277CF.js +0 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as ri,b as bs,d as ni,f as Ss,g as Tt,i as vs,k as ks}from"./chunk-RMNTGICO.js";import{b as is,e as vt,g as ss,h as fe,i as ie,j as os,k as rs,l as kt,m as ns}from"./chunk-QYZ3P5L6.js";import{a as za,b as Ka}from"./chunk-MR2O5WC7.js";import{b as ws}from"./chunk-FOYQOIWG.js";import{a as la,b as ca,c as ha,d as da,e as ua,f as pa,g as fa,h as ma,i as ga}from"./chunk-WZ6ZNPNT.js";import{a as ue,b as es,c as Re,d as gt,e as yt,f as Se,g as J,m as pe,n as re,q as si,r as bt,t as ts,u as St,v as q,w as oi}from"./chunk-GXMGOWKB.js";import{b as Ee,f as ds,g as us,m as ps,x as fs,y as ms}from"./chunk-JBGLFOJO.js";import{a as Fa,b as Da,c as _a,d as Oa,e as Ga,f as ft,g as Ha,h as Ke,i as Na,j as Qi,k as ei,l as Va,m as Wa,n as ji}from"./chunk-HZT2U5IY.js";import{c as gs,e as ys}from"./chunk-T2LWVOQ3.js";import{a as jn,b as Jn,c as ea,d as ta,e as Jt,f as ia,g as sa,h as oa,i as ra,j as na,k as aa,p as $e,s as hs}from"./chunk-YYRUKI7A.js";import{b as wt,f as as,h as Lt,i as ls,k as cs}from"./chunk-UL5OIGIF.js";import{Aa as Ea,Ba as Xi,Ca as Aa,Da as $i,Ea as Yi,Fa as qi,Ga as Ui,Ha as Ba,Ia as ze,Ja as Zi,W as zi,X as xe,Y as ya,ea as U,fa as Ki,ga as dt,ka as ba,la as Sa,ma as va,na as ka,oa as wa,pa as La,qa as Ta,ra as Ca,s as Vi,sa as Ia,ta as Ma,u as Wi,ua as Pa,va as te,w as N,wa as ut,xa,ya as Ra,za as pt}from"./chunk-I6DNJFRF.js";import{B as oe,h as ti,s as Xe,t as me,u as de,v as mt,w as ii,y as Ji}from"./chunk-CXF32VPG.js";import"./chunk-CRCGO52K.js";import{Konva as Wt}from"konva/lib/Core";import{Stage as Pn}from"konva/lib/Stage";import{Layer as xi}from"konva/lib/Layer";import{Group as Te}from"konva/lib/Group";import{Circle as Ce}from"konva/lib/shapes/Circle";import{Rect as rt}from"konva/lib/shapes/Rect";import{Line as nt}from"konva/lib/shapes/Line";import{Text as Ie}from"konva/lib/shapes/Text";import{Path as xn}from"konva/lib/shapes/Path";import{Image as Rn}from"konva/lib/shapes/Image";import{Shape as En}from"konva/lib/Shape";var Ct=1.12;function ai(i){return{x:i.width()/2,y:i.height()/2}}function Ls(i,e,t){if(e.width<=0||e.height<=0)return i.scaleX();let s=Math.min(i.width()/(e.width*Ct),i.height()/(e.height*Ct));return N(s,t.min,t.max)}function Ts(i,e,t,s){let o=N(e,s.min,s.max),r=i.scaleX();if(o===r)return!1;let n=(t.x-i.x())/r,a=(t.y-i.y())/r;return i.scale({x:o,y:o}),i.position({x:t.x-n*o,y:t.y-a*o}),!0}function Cs(i,e,t,s){let o=Math.min(i.width()/(e.width*Ct),i.height()/(e.height*Ct)),r=N(Math.max(o,s??t.min),t.min,t.max);i.scale({x:r,y:r}),i.position({x:i.width()/2-(e.x+e.width/2)*r,y:i.height()/2-(e.y+e.height/2)*r})}var Ms;function Ps(i){Ms=i}function gr(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var Is=new Map;function yr(i,e){let t=i??Ms,s=`${t??""}|${JSON.stringify(e)}`,o=Is.get(s);return o||(o=new Intl.DateTimeFormat(t,e),Is.set(s,o)),o}var br={dateStyle:"medium",timeStyle:"short"};function xs(i,e={}){let{locale:t,...s}=e,o=gr(i);if(!Number.isFinite(o))return"";let r=Object.keys(s).length?s:br;return yr(t,r).format(o)}var qa="USD",Ua=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],Es;function As(i){Es=i}var Rs=new Map;function It(i,e,t,s){let o=s??Es,r=`${o??""}|${i}|${e??"auto"}|${t??"auto"}`,n=Rs.get(r);return n||(n=new Intl.NumberFormat(o,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),Rs.set(r,n)),n}function li(i,e="USD",t,s){if(typeof t=="object"){let r=t;try{return It(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(i)}catch(n){if(r.fallback)return r.fallback(i,e);throw n}}let o=t??(Number.isInteger(i)?0:void 0);return It(e,o,o,s).format(i)}function Sr(i="USD"){try{return It(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function vr(i,e="USD"){return i/10**Sr(e)}function Za(i,e="USD",t){return li(vr(i,e),e,void 0,t)}function Qa(i="USD"){return It(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var Ye={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired \u2014 the seats were released. Pick again.","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.orphanHint":"This leaves a single seat stranded \u2014 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.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview \u2014 groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks \u2014 sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats \u2014 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.overview":"Overview","picker.entrance":"Entrance","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.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count} \u2014 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.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.holdReassurance":"Yours for {time} \u2014 you won\u2019t be charged yet.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total} \u2014 you won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types \u2014 tap one below to show just those seats.","picker.findTogetherInstead":"Find seats together instead","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours.","picker.accessExpiredTitle":"Your access session has ended","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.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.accessiblePhysicalSeat":"Accessible physical seat","picker.addTime":"Add time","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Areas","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.change":"Change","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 \u2014 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.collapseTicketPanel":"Collapse ticket panel","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 \u2014 please head to checkout now.","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.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.fitToScreen":"Fit to screen","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.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.heldTicketsReleased":"Held tickets released. Choose your new seats.","picker.heldTicketsRestored":"Your held tickets have been restored.","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.liveAvailability":"Live availability \u2014 seats update in real time","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.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.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreSelectedCount":"{count} more selected","picker.moreTimeAdded":"More time added \u2014 your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notChargedYet":"You won\u2019t be charged yet.","picker.notForSale":"Not for sale","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.releaseHeldTickets":"Release held tickets and choose different seats","picker.releasingEllipsis":"Releasing\u2026","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.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.seatsHeldForNeedMoreTime":"Your seats are held for <b>{time}</b>. Need more time?","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsJustTakenInCategory.one":"{count} seat just taken in {label} \xB7 {left} left","picker.seatsJustTakenInCategory.other":"{count} seats just taken in {label} \xB7 {left} left","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSecured":"Seats secured","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.securedCount":"{count} secured","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.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.trayHintTapOrStanding":"Tap a seat on the map \u2014 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.viewFromHere":"View from here","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.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & areas","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances"};var kr=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],sl={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",hr:"Hrvatski",hu:"Magyar",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",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",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},Bs=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],wr=new Set(["ar","fa","he"]),ci={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",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"},hi=new Map(kr.map(i=>[i.toLowerCase(),i]));function Lr(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=hi.get(e)??ci[e];if(t)return t;let s=e.split("-");if(s.length>=2){let o=`${s[0]}-${s[1]}`,r=hi.get(o)??ci[o];if(r)return r}return hi.get(s[0])??ci[s[0]]}var ve={en:Ye},Mt={},se="en";function Fs(i,e){let t=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let s of[i,e,...t]){if(!s)continue;let o=Lr(s);if(o)return o}return"en"}function ol(){return se}function rl(i=se){return wr.has(i)?"rtl":"ltr"}function nl(i){return!!ve[i]}function Ae(i,e){e&&(ve[i]={...ve[i],...e}),se=ve[i]?i:"en",As(se),Ps(se),typeof document<"u"&&(document.documentElement.lang=se)}function al(i){Mt=i}var Ds=/\{(\w+)\}/g;function Z(i,e){let t=Mt[i]??ve[se]?.[i]??Ye[i]??i;return e?t.replace(Ds,(s,o)=>String(e[o]??`{${o}}`)):t}function ll(i,e,t){let s=new Intl.PluralRules(se).select(e);return(Mt[`${i}.${s}`]??ve[se]?.[`${i}.${s}`]??Ye[`${i}.${s}`]??Mt[`${i}.other`]??ve[se]?.[`${i}.other`]??Ye[`${i}.other`]??i).replace(Ds,(n,a)=>String({count:e,...t}[a]??`{${a}}`))}function cl(i,e){return xs(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:se})}var qe=9,ke=.9,ne=.55*ke,ae=J/ue,Ue=4,Pt=14,_s=10,Os=14,ge=.45*ke,Be=.9*ke,Gs=Math.max(ke*1.1,Be),we=8,Hs=700,Q=2,Ns=J,di=.85,Vs=J,Ze=64,Fe=.55*ge,ui=700,Ws=2500,xt=-11.5,Qe=.58,zs=320,Ks=650,Xs=420,$s=1,Rt=1,pi=16,je=12,Ys=[.85,.72,.62],Et=15,At=12,fi="600",mi="500",Le=640;function gi(i){return Math.min(1,Math.max(je/pi,i/900))}function Bt(i,e){return Math.max(je,i*gi(e))}var qs=.1;import{Shape as Cr}from"konva/lib/Shape";import{Circle as Ir}from"konva/lib/shapes/Circle";import{Rect as Mr}from"konva/lib/shapes/Rect";var Tr={M:2,L:2,Q:4,C:6,Z:0},yi=new Map;function bi(i){let e=yi.get(i);if(e)return e;let t=Lt(i);if(!t)return yi.set(i,[]),[];let s=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<s.length;){let n=s[r++],a=Tr[n];if(a===void 0||r+a>s.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let l=s.slice(r,r+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);r+=a,n==="M"||n==="L"?o.push({command:n,points:l}):n==="Q"?o.push({command:n,points:l}):n==="C"?o.push({command:n,points:l}):o.push({command:"Z",points:[]})}return yi.set(i,o),o}function Us(i,e,t,s=0,o=0){let r=bi(e),n=as(e).bounds;if(!r.length||!n||!(t>0))return!1;let a=ls(n,t);i.save(),i.translate(s,o),i.scale(a.scale,a.scale),i.translate(-a.centreX,-a.centreY);for(let l of r)l.command==="M"?i.moveTo(l.points[0],l.points[1]):l.command==="L"?i.lineTo(l.points[0],l.points[1]):l.command==="Q"?i.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?i.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):i.closePath();return i.restore(),!0}function Zs(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var Je=class extends Cr{_sceneFunc(e){let t=this.attrs.seatRadius||1,s=this.attrs.seatGlyph,o=bi(s),r=this.attrs.seatGlyphDetail,n;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;n=t*2*c>=16}else n=r;if(!o.length||!n){Zs(e,t),e.fillStrokeShape(this);return}e.beginPath(),Us(e,s,t),e.fillStrokeShape(this)}_hitFunc(e){Zs(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function Pr(i,e){return i==="circle"||!Lt(i)?null:new Je({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:i,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Qs(i){let{x:e,y:t,radius:s}=i;return i.wheelchairBay?new Mr({x:e,y:t,width:s*2,height:s*2,offsetX:s,offsetY:s,cornerRadius:2,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Pr(i.glyph,{x:e,y:t,radius:s,detail:i.detail,fill:i.fill})??new Ir({x:e,y:t,radius:s,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function xr(i,e){return i*2*e>=16}function js(i,e,t,s){let o=xr(e,t);if(o===s||!i.length)return o;for(let r of i)r.setAttr("seatGlyphDetail",o);return o}var Rr="#e5e7eb",Er="#c7cbd1",Ar="#595f69",Br="#d1d5db",Fr="#b8bdc4",Dr="#273142",_r="#526078",Or="#f1f5f9",Gr="#374151",Hr="#64748b",Si="#111827",Ft="#6b7280",De="#374151",Js="#4b5563",eo="#4b5563",to=.4,_e=.16,io="rgba(244,246,248,0.06)",Dt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function le(i){return Xe(i)?{sectionFill:Rr,sectionStroke:Er,sectionInk:Ar,focalFill:Br,focalStroke:Fr}:{sectionFill:Dr,sectionStroke:_r,sectionInk:Or,focalFill:Gr,focalStroke:Hr}}function Oe(i,e){let t=i.sectionFill,s=Ji(de(t,.2),.85);switch(e){case"closed":return de(t,.12);case"sold-out":return s;case"nearly-gone":return mt(t,s,.4);default:return t}}var ao=.5,V=Math.SQRT1_2,Nr="#f3f4f6",so=4;function Vr(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?ao:Math.min(1,Math.max(0,e))}function Wr(i){return i==="booked"||i==="not_for_sale"?De:Ft}function oo(i,e){return Number.parseInt(i.slice(e,e+2),16)}function ro(i){let e=i.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,t,s,o]=e.toLowerCase();return`#${t}${t}${s}${s}${o}${o}`}function zr(i,e,t){let s=ro(i),o=ro(e);if(!s||!o)return i;let r=Math.min(1,Math.max(0,t)),n="#";for(let a=1;a<7;a+=2){let l=Math.round(oo(s,a)*(1-r)+oo(o,a)*r);n+=l.toString(16).padStart(2,"0")}return n}function no(i,e,t,s){let o=t*4,r=e*V,n=-e*V,a=s*V*2*o,l=s*-V*2*o,c=r+o*V,h=n+o*V,p=r-o*V,u=n-o*V;i.beginPath(),i.moveTo(c,h),i.lineTo(p,u),i.lineTo(p+a,u+l),i.lineTo(c+a,h+l),i.closePath(),i.clip()}function Kr(i,e){let t=e*4,s=Math.max(e*.45,1);i.beginPath();for(let o=-so;o<=so;o++){let r=o*s*2,n=r+s,a=r*V,l=-r*V,c=n*V,h=-n*V;i.moveTo(a+t*V,l+t*V),i.lineTo(a-t*V,l-t*V),i.lineTo(c-t*V,h-t*V),i.lineTo(c+t*V,h+t*V),i.closePath()}i.clip()}function _t(i,e){i._sceneFunc(e)}function lo(i){let e=this,t=e.attrs,s=t.markRadius||1,o=t.fill,r=e.getStage(),n=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(s*2*n<16){t.fill=t.markMidtone??o,_t(e,i),t.fill=o;return}let l=(1-2*(t.markFraction??ao))*s;i.save(),no(i,l,s,1),t.fill=t.markBase??o,_t(e,i),i.restore(),i.save(),no(i,l,s,-1),t.fill=t.markFill??o,_t(e,i),t.markHatch&&(Kr(i,s),t.fill=Nr,_t(e,i)),i.restore(),t.fill=o}function Xr(i,e,t,s,o,r){let n=Vr(e),a=Wr(t),l=i.attrs;l.markFraction=n,l.markBase=s,l.markFill=a,l.markMidtone=zr(s,a,1-n),l.markHatch=r,l.markRadius=o>0?o:1,i.fill(l.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(lo)}function $r(i){i.setAttr("sceneFunc",void 0)}function Yr(i){return i.attrs.sceneFunc===lo}var Ot=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,t){let s=new Set;for(let[o,r]of Object.entries(e))t.has(o)&&(r&&r.kind==="partial"?(this.marks.set(o,r),s.add(o)):this.marks.delete(o)&&s.add(o));return s}paint(e,t,s,o,r,n,a){let l=a?void 0:this.marks.get(t);if(!l){Yr(e)&&$r(e);return}Xr(e,l,s,o,r,n)}};function qr(i,e){return i.x<e.x+e.width&&e.x<i.x+i.width&&i.y<e.y+e.height&&e.y<i.y+i.height}var Ge=class{constructor(){this.cells=new Map}insert(e){for(let t of this.keys(e)){let s=this.cells.get(t);s?s.push(e):this.cells.set(t,[e])}}collisionCount(e){let t=new Set,s=0;for(let o of this.keys(e))for(let r of this.cells.get(o)??[])t.has(r)||(t.add(r),qr(e,r)&&s++);return s}keys(e){let t=Math.floor(e.x/Ze),s=Math.floor((e.x+Math.max(0,e.width))/Ze),o=Math.floor(e.y/Ze),r=Math.floor((e.y+Math.max(0,e.height))/Ze),n=[];for(let a=o;a<=r;a++)for(let l=t;l<=s;l++)n.push(`${l}:${a}`);return n}};function K(i){let e=hs(i);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 Gt(i,e,t,s){let o=s*Math.PI/180,r=Math.cos(o),n=Math.sin(o);return[{x:-e/2,y:-t/2},{x:e/2,y:-t/2},{x:e/2,y:t/2},{x:-e/2,y:t/2}].map(a=>({x:i.x+a.x*r-a.y*n,y:i.y+a.x*n+a.y*r}))}function Ht(i,e,t,s,o,r){let n=s*Math.PI/180,a=Math.cos(n),l=Math.sin(n);for(let c=0;c<=4;c++)for(let h=0;h<=6;h++){let p=e*(h/6-.5),u=t*(c/4-.5),m={x:i.x+p*a-u*l,y:i.y+p*l+u*a};if(!te(m,o,r))return!1}return!0}function co(i,e,t){let s=K(i),o=[t];for(let n=1;n<12;n+=1)for(let a=1;a<12;a+=1){let l={x:s.x+s.width*a/12,y:s.y+s.height*n/12};te(l,i,e)&&o.push(l)}let r=[i,...e];return o.map(n=>({point:n,room:Vi(n,r)})).sort((n,a)=>a.room-n.room).map(n=>n.point).filter((n,a,l)=>a===l.findIndex(c=>Math.abs(c.x-n.x)<1e-6&&Math.abs(c.y-n.y)<1e-6))}import{Group as Ur}from"konva/lib/Group";import{Shape as Zr}from"konva/lib/Shape";function Qr(i,e,t){let s=e.length,o={x:(e[s-1].x+e[0].x)/2,y:(e[s-1].y+e[0].y)/2};i.moveTo(o.x,o.y);for(let r=0;r<s;r+=1){let n=e[r],a=e[(r+1)%s],l=e[(r-1+s)%s],c=Math.min(Math.hypot(n.x-l.x,n.y-l.y)/2,Math.hypot(a.x-n.x,a.y-n.y)/2);i.arcTo(n.x,n.y,a.x,a.y,Math.max(0,Math.min(t,c)))}i.closePath()}function He(i,e,t,s){let o=$e(i)>0,r=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new Zr({...t,sceneFunc(n,a){n.beginPath();let l=h=>{if(h.length){if(r>0&&h.length>=3)return Qr(n,h,r);n.moveTo(h[0].x,h[0].y);for(let p=1;p<h.length;p+=1)n.lineTo(h[p].x,h[p].y);n.closePath()}};s?(h=>{n.moveTo(h.start.x,h.start.y);let p=h.start;for(let u of h.segments)u.kind==="line"?n.lineTo(u.end.x,u.end.y):u.kind==="arc"?n.arc(u.center.x,u.center.y,u.radius,Math.atan2(p.y-u.center.y,p.x-u.center.x),Math.atan2(u.end.y-u.center.y,u.end.x-u.center.x),!u.clockwise):n.bezierCurveTo(u.control1.x,u.control1.y,u.control2.x,u.control2.y,u.end.x,u.end.y),p=u.end;n.closePath()})(s):l(i);for(let h of e??[]){let p=$e(h)>0;l(p===o?[...h].reverse():h)}n.fillStrokeShape(a)},perfectDrawEnabled:!1})}var et=class extends Ur{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(t){t!==this.viewportCulled&&(this.viewportCulled=t,t||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...t){return this.viewportCulled?this:super.drawScene(...t)}drawHit(...t){return this.viewportCulled?this:super.drawHit(...t)}_clearSelfAndDescendantCache(t){if(!this.viewportCulled){super._clearSelfAndDescendantCache(t);return}this._clearCache(t)}};var vi=1e6;function jr(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var Nt=class{constructor(e,t=jr()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.lastTapAt=0;this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button)};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let t=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,t)&&this.applyPointerMove(t)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let s=e.changedTouches.item(t);s&&this.beginPointer(vi+s.identifier,this.toLocal(s.clientX,s.clientY),"touch",0)}};this.onTouchMove=e=>{e.preventDefault();let t=null;for(let s=0;s<e.changedTouches.length;s+=1){let o=e.changedTouches.item(s);if(!o)continue;let r=this.toLocal(o.clientX,o.clientY);this.updatePointer(vi+o.identifier,r)&&(t=r)}t&&this.applyPointerMove(t)};this.onTouchEnd=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let s=e.changedTouches.item(t);s&&this.endPointer(vi+s.identifier)}};this.host=e,this.useWebKitTouchEvents=t}get moved(){return this.movedPx}attach(){let{container:e}=this.host;e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;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<Hs}toLocal(e,t){let s=this.host.container.getBoundingClientRect();return{x:e-s.left,y:t-s.top}}beginPointer(e,t,s,o){if(this.host.cancelGlide(),this.pointers.set(e,t),this.pointers.size===1)this.movedPx=0,this.pinch=null,this.panStart=t,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:s,button:o})?(this.host.beginMarquee(t),this.panLast=null):this.panLast=t;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee();let[r,n]=[...this.pointers.values()],a={x:(r.x+n.x)/2,y:(r.y+n.y)/2},l=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(n.x-r.x,n.y-r.y),startScale:l,worldMid:{x:(a.x-this.host.stage.x())/l,y:(a.y-this.host.stage.y())/l}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+1}}updatePointer(e,t){return this.pointers.has(e)?(this.pointers.set(e,t),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(t.x-this.panStart.x,t.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=we+1),!0):!1}applyPointerMove(e){if(this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[t,s]=[...this.pointers.values()],o=Math.hypot(s.x-t.x,s.y-t.y);if(this.pinch.startDist<1)return;let r={x:(t.x+s.x)/2,y:(t.y+s.y)/2},{min:n,max:a}=this.host.zoomBounds(),l=N(this.pinch.startScale*(o/this.pinch.startDist),n,a);this.host.stage.scale({x:l,y:l}),this.host.stage.position({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(e.x-this.panLast.x),y:this.host.stage.y()+(e.y-this.panLast.y)}),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.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.host.afterViewChange())}}};import{Circle as Jr}from"konva/lib/shapes/Circle";import{Group as en}from"konva/lib/Group";import{Text as tn}from"konva/lib/shapes/Text";var ho=13,sn=15,on=.3,rn=.08;function mo(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function nn(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?Z("map.soldOut"):Z("map.seatsLeft",{count:i.available})}function an(i,e){return e&&i.available!=null&&i.available<=0}function go(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),s=i.overviewHidden(e),o=an(e,i.pickerMode),r=i.pickerMode?e.selected??0:0;e.polygon.opacity(s?0:i.dimmed(e.categoryKey)?Se*rn:o?Se*on:Se),e.polygon.listening(!i.exportMode&&!s&&!t&&!o),e.polygon.stroke(r>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),ln(i,e,o,r,s,i.dimmed(e.categoryKey))}}function ln(i,e,t,s,o,r){if(e.capacityNode){let n=nn(e,i.pickerMode);e.capacityNode.text()!==n&&(e.capacityNode.text(n),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}cn(i,e,o||r),s>0&&!o?dn(i,e,s):e.chip&&e.chip.visible(!1)}var ki=9,uo=.86;function cn(i,e,t){let{labelNode:s,capacityNode:o}=e;if(!s&&!o)return;let r=Math.max(i.effScale(),1e-4);if(t){s?.visible(!1),o?.visible(!1);return}if(!i.pickerMode){s?.visible(i.labelLegible(s.fontSize())),o?.visible(i.labelLegible(o.fontSize()));return}let n=hn(e,r),a=po(s,gt,n.width*uo,r),l=po(o,yt,n.width*uo,r),c=a!=null,h=l!=null&&c&&a+l+ki<=n.height;fo(s,c?a:null,e.labelPoint.y-ki/r,r),fo(o,h?l:null,e.labelPoint.y+ki/r,r)}function hn(i,e){let t=1/0,s=-1/0,o=1/0,r=-1/0;for(let n of i.points)n.x<t&&(t=n.x),n.x>s&&(s=n.x),n.y<o&&(o=n.y),n.y>r&&(r=n.y);return Number.isFinite(t)?{width:(s-t)*e,height:(r-o)*e}:{width:0,height:0}}function po(i,e,t,s){if(!i||!i.text())return null;i.fontSize(e/s);let o=i.width()*s;if(o<=t||o<=0)return e;let r=e*(t/o);return r>=J?r:null}function fo(i,e,t,s){if(i){if(e==null){i.visible(!1);return}i.fontSize(e/s),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t),i.visible(!0)}}function dn(i,e,t){if(!e.chip){let s=new en({x:e.labelPoint.x,y:e.labelPoint.y-ho-16,listening:!1}),o=new Jr({radius:ho,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),r=new tn({text:String(t),fontSize:sn,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});s.add(o),s.add(r),i.bgLayer.add(s),e.chip=s,e.chipText=r}e.chipText&&e.chipText.text()!==String(t)&&e.chipText.text(String(t)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function yo(i,e){let t=!1;for(let[s,o]of Object.entries(e)){let r=i.get(s);r&&(o.available!==void 0&&r.available!==o.available&&(r.available=o.available,t=!0),o.selected!==void 0&&r.selected!==o.selected&&(r.selected=o.selected,t=!0))}return t}function bo(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function So(i,e){let t=null;for(let s of i){let o=e.get(s)?.logicalId;if(!o||t!=null&&t!==o)return null;t=o}return t}function vo(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}import{Rect as ko}from"konva/lib/shapes/Rect";import{Text as un}from"konva/lib/shapes/Text";function wo(i){let e=i.effScale(),t=i.stage.scaleX(),s={width:i.stage.width(),height:i.stage.height()},o=d=>Math.round(d*100)/100,r=new Map(i.overlayLayer.find(".selection-ring").map(d=>[String(d.getAttr("seatId")??""),String(d.getAttr("ringColor")??i.effSelection)])),n=i.seats.map(d=>{let g=i.circleById.get(d.id),b=i.boothLabelById.get(d.id)??i.seatLabelById.get(d.id),S=i.viewMode==="perspective"?i.perspectiveSeatScale.get(d.id)??1:1,k=(i.viewMode==="perspective"?t:e)*S,w=d.kind==="booth"?Re:ue*i.seatLabelScale(d),T=i.viewMode==="perspective"&&d.kind!=="booth"?e*S:k,C=o((b?.fontSize()??w)*T),P=i.worldToScreen(d),M=b?b.width()*t*S:0,v=b?b.height()*(i.viewMode==="perspective"&&d.kind==="booth"?t:e)*S:0,L=P.x-M/2<0||P.x+M/2>s.width||P.y-v/2<0||P.y+v/2>s.height,x=i.focusedSeatOpacity(d.id,g?.getAbsoluteOpacity()??0),I=i.seatSection.get(d.id),R=!!b?.isVisible()&&x>=.5&&!L,E;R||(x<.5?E="dimmed-or-unavailable":C<J?E="below-minimum-size":L?E="outside-viewport":b?E="renderer-hidden":E="clutter-or-fit");let B=g instanceof ko?g.width()*t*S:i.seatR*2*k,z=g instanceof ko?g.height()*(i.viewMode==="perspective"?t:e)*S:i.seatR*2*k,O=2*(i.seatR*k+Pt),D=g?.fill(),X=b?.fill(),F=i.accessGlyphById.get(d.id),G=F?.getAbsoluteScale();return{seatId:d.id,label:d.label,kind:d.kind==="booth"?"booth":"seat",markerShape:d.kind==="booth"?"booth":d.wheelchairSpaceType==="no-seat"?"square":"circle",...d.wheelchairSpaceType?{wheelchairSpaceType:d.wheelchairSpaceType}:{},categoryKey:d.categoryKey,...I?{sectionId:I.id}:{},...I?.zone?{zoneId:I.zone}:{},status:i.statusById.get(d.id)??"free",selected:i.selection.has(d.id),visible:R,renderedFontPx:C,fill:typeof D=="string"?D:"",ink:typeof X=="string"?X:g?i.seatLabelInk(d,g):i.seatPreferredLabelInk(d),...r.has(d.id)?{selectionRingColor:r.get(d.id)}:{},opacity:o(x),...F?{accessibilityMarker:{glyphVisible:F.isVisible(),glyphWidthPx:o(re*Math.abs(G?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(d.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(d.id)&&!!g?.isVisible()&&!!g?.isListening()&&i.isSelectable(d.id),directWidthPx:o(B),directHeightPx:o(z),effectiveMinimumPx:o(Math.max(Math.min(B,z),O))},screenCenter:{x:o(P.x),y:o(P.y)},...R?{screenBox:{x:o(P.x-M/2),y:o(P.y-v/2),width:o(M),height:o(v)}}:{},...E?{hiddenReason:E}:{}}}),a=n.filter(d=>d.visible).length,l=(d,g,b,S,k,w)=>{let T=Gt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),C=w&&w.liftWorld>0?i.isoLiftLocal(w.liftWorld):{x:0,y:0},P=K(T.map(R=>i.worldToScreen({x:R.x+C.x,y:R.y+C.y}))),M=o(S.opacity()),v=S.fill(),L=P.x+P.width<0||P.x>s.width||P.y+P.height<0||P.y>s.height,x=S.isVisible()&&M>.05&&!L,I=w?Ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:d,kind:g,role:b,label:S.text(),visible:x,renderedFontPx:o(S.fontSize()*t),opacity:M,fill:k,ink:typeof v=="string"?v:"",...I==null?{}:{fitsContainer:I},...x?{screenBox:{x:o(P.x),y:o(P.y),width:o(P.width),height:o(P.height)}}:{}}},c=[...i.sections.map(d=>{let g=d.blockPoly.fill();return l(d.id,"section","name",d.nameLabel,typeof g=="string"?g:d.baseFill,d)}),...i.sections.map(d=>{let g=d.blockPoly.fill();return l(`${d.id}:availability`,"section","availability",d.subLabel,typeof g=="string"?g:d.baseFill,d)}),...i.zones.flatMap(d=>[l(d.id,"zone","name",d.label,d.background),...d.sub?[l(`${d.id}:price`,"zone","price",d.sub,d.background)]:[]])],h=[...i.gaById].map(([d,g])=>{let b=g.points.map(L=>i.worldToScreen(L)),S=Math.min(...b.map(L=>L.x)),k=Math.min(...b.map(L=>L.y)),w=Math.max(...b.map(L=>L.x)),T=Math.max(...b.map(L=>L.y)),C=w<0||S>s.width||T<0||k>s.height,P=o(g.polygon.opacity()),M=P>=.1&&!C,v=g.polygon.fill();return{areaId:d,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:M,interactive:g.polygon.listening(),opacity:P,fill:typeof v=="string"?v:"",effectiveBackground:g.effectiveBackground,...M?{screenBox:{x:o(S),y:o(k),width:o(w-S),height:o(T-k)}}:{}}}),p=[...i.freeTextById].map(([d,g])=>{let{node:b,background:S,kind:k}=g,w=i.worldToScreen({x:b.x(),y:b.y()}),T=b.width()*t,C=b.height()*e,P=w.x-b.offsetX()*t,M=w.y-b.offsetY()*e,v=o(b.fontSize()*e),L=P+T<0||P>s.width||M+C<0||M>s.height,x=b.isVisible()&&!L,I=b.fill(),R=o(b.getAbsoluteOpacity()),E;return x||(v<J?E="below-minimum-size":L?E="outside-viewport":E="renderer-hidden"),{objectId:g.objectId??d,kind:k,text:b.text(),visible:x,renderedFontPx:v,ink:typeof I=="string"?I:"",background:S,opacity:R,...x?{screenBox:{x:o(P),y:o(M),width:o(T),height:o(C)}}:{},...E?{hiddenReason:E}:{}}}),u=i.labelGroup.find(d=>d.getAttr("rowLabel")===!0).filter(d=>d instanceof un).map(d=>{let g=d.getClientRect({skipShadow:!0,skipStroke:!0}),b=g.x+g.width<0||g.x>s.width||g.y+g.height<0||g.y>s.height,S=d.fill();return{text:d.text(),visible:d.isVisible()&&!b,renderedFontPx:o(d.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)}}}}),m=le(i.canvasBackground),f=new Set(["normal","nearly-gone","sold-out","closed"].map(d=>Oe(m,d).toLowerCase())),y=i.sections.filter(d=>d.blockPoly.opacity()>.05);return{viewport:s,projection:i.viewMode,...i.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:i.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:i.canvasBackground,effectiveScale:o(e),rung:i.getRung(),minimumVisibleLabelPx:J,totalLabelledBookableUnits:n.length,visibleLabels:a,hiddenLabels:n.length-a,totalBookableUnits:n.length+h.reduce((d,g)=>d+g.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(d=>String(d.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:i.effSelection,focusedSectionId:i.focusedSectionId,focusBackdropVisible:!!i.focusBackdrop?.isVisible(),categoryFilterKeys:i.categoryFilter?[...i.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(d=>{let g=d.blockPoly.fill();return typeof g!="string"||!f.has(g.toLowerCase())}).length,visibleCategoryDetailOutlines:i.sections.filter(d=>d.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(d=>d.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(d=>d.sectionId!=null&&d.polygon.opacity()>.05).length},labels:n,gaAreas:h,hierarchyLabels:c,freeTextLabels:p,rowLabels:u}}import{Circle as pn}from"konva/lib/shapes/Circle";import{Ellipse as fn}from"konva/lib/shapes/Ellipse";import{Line as Mo}from"konva/lib/shapes/Line";import{Arrow as mn}from"konva/lib/shapes/Arrow";import{Path as gn}from"konva/lib/shapes/Path";import{Rect as Ti}from"konva/lib/shapes/Rect";import{Text as Ci}from"konva/lib/shapes/Text";import{Image as yn}from"konva/lib/shapes/Image";function wi(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}var Vt="#0b1220",tt="#ffffff",Lo="#0b1220",To="#232c40",Co="#8b93a7";function Io(i,e,t="normal"){let s=i?"bold":t;return e?`italic ${s}`.trim():s}var Li="#f7f8fb";function Po(i,e){let t=new window.Image,s=new yn({image:t,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:N(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?i.fgDecorGroup.add(s):i.bgLayer.add(s),i.trackAssetImage(t,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let o=s.getLayer();o&&o.batchDraw()})}function xo(i,e){if(e.shape==="round")i.bgLayer.add(new pn({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,listening:!1}));else{let s=e.width??80,o=e.height??50;i.bgLayer.add(new Ti({x:e.center.x,y:e.center.y,width:s,height:o,offsetX:s/2,offsetY:o/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}let t=it(i,i.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);i.freeTextById.set(e.id,{node:t,background:"#232c40",kind:"table"})}function Ro(i,e){let t=e.background?.color??i.canvasBackground,s=e.color??i.theme.textColor??Co,o=e.semanticKind==="icon"?ps(e.iconKey):void 0;if(o){let c=e.fontSize/24,h=new gn({x:e.position.x,y:e.position.y,data:o,rotation:e.rotation,scaleX:c,scaleY:c,stroke:q(t,s),strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});i.iconNodeById.set(e.id,{node:h,fontSize:e.fontSize}),i.bgLayer.add(h);return}let r=e.background?.padding??0,n=e.opacity??1,a=new Ci({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Io(e.bold,e.italic,"600"),fill:q(t,s),fontFamily:e.fontFamily??i.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:n,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),l;e.background&&(l=new Ti({x:e.position.x,y:e.position.y,width:a.width(),height:a.height(),rotation:e.rotation,fill:e.background.color,opacity:n*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(l)),i.freeTextById.set(e.id,{node:a,backdrop:l,background:t,kind:"free-text"}),i.bgLayer.add(a)}function Eo(i,e){let t=e.fill??i.theme.decorFill??To,s=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!s,n=le(i.canvasBackground),a=o?n.focalFill:t,l=e.kind==="line"||e.kind==="polyline",c=e.stroke?.color??(s?me(a,.28):o?n.focalStroke:l?"#9aa3b5":void 0),h=e.stroke?.width??(s?1:o||l?2:0),p=e.opacity!=null?N(e.opacity,.1,1):1,u=0,m=0;if(l&&e.points&&e.points.length>=2){u=e.points.reduce((g,b)=>g+b.x,0)/e.points.length,m=e.points.reduce((g,b)=>g+b.y,0)/e.points.length;let f=fs(e),y=ms(h),d=new mn({points:e.points.flatMap(g=>[g.x,g.y]),closed:!1,x:u,y:m,offsetX:u,offsetY:m,rotation:e.rotation??0,stroke:c,fill:c,strokeWidth:h,opacity:p,lineCap:f.lineCap,lineJoin:f.lineJoin,pointerAtBeginning:f.startEnding==="arrow",pointerAtEnding:f.endEnding==="arrow",...y,listening:!1,name:"buyer-shape-open-path"});d.setAttr("shapeObjectId",e.id),i.bgLayer.add(d)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let f=s?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,de(a,.3),1,me(a,.12)]}:{fill:a};u=e.x+e.width/2,m=e.y+e.height/2,i.bgLayer.add(new Ti({x:u,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...f,stroke:c,strokeWidth:h,cornerRadius:N(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:p,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){u=e.x+e.width/2,m=e.y+e.height/2;let f=s?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,de(a,.3),1,me(a,.12)]}:{fill:a};i.bgLayer.add(new fn({x:u,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...f,stroke:c,strokeWidth:h,opacity:p,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let f=e.points.flatMap(g=>[g.x,g.y]),y=K(e.points);u=e.points.reduce((g,b)=>g+b.x,0)/e.points.length,m=e.points.reduce((g,b)=>g+b.y,0)/e.points.length;let d=s?{fillLinearGradientStartPoint:{x:0,y:y.y},fillLinearGradientEndPoint:{x:0,y:y.y+y.height},fillLinearGradientColorStops:[0,de(a,.3),1,me(a,.12)]}:{fill:a};i.bgLayer.add(new Mo({points:f,closed:!0,x:u,y:m,offsetX:u,offsetY:m,rotation:e.rotation??0,...d,stroke:c,strokeWidth:h,opacity:p,listening:!1}))}for(let f of ys(e))i.bgLayer.add(new Mo({points:f.points.flatMap(y=>[y.x,y.y]),closed:f.closed,x:u,y:m,offsetX:u,offsetY:m,rotation:e.rotation??0,stroke:f.ink??gs,fill:f.fill,strokeWidth:2,opacity:p*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(s){let f=bn(i,u,m,e.label,a);i.primaryFocalLabels.set(f,22),i.freeTextById.set(e.id,{node:f,background:a,kind:"stage"})}else if(r){let f=it(i,i.bgLayer,e.label,u,m,o?q(a,"#e6e9f0"):"#9aa3b5",o?18:12,!1);o&&i.primaryFocalLabels.set(f,18),i.freeTextById.set(e.id,{node:f,background:a,kind:"decor"})}else{let f=it(i,i.bgLayer,e.label,u,m,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:f,background:a,kind:"decor"})}}function bn(i,e,t,s,o){let r=q(o,"#e6e9f0"),n=new Ci({x:e,y:t,text:s.toUpperCase(),fontSize:22,fontStyle:"700",letterSpacing:4,fontFamily:i.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return n.offsetX(n.width()/2),n.offsetY(n.height()/2),i.bgLayer.add(n),n}function Ao(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",s=i.canvasBackground,o=ts(t,s,Se),r=i.theme.textColor??"#e6e9f0",n=q(o,r),a=He(e.points,e.holes,{fill:t,opacity:Se,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",u=>{i.isGhostClick(u)||i.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{i.container.style.cursor="pointer"}),a.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(a);let l=ut(e.points,e.holes),c=i.sections.find(u=>te(l,u.outline,u.holes)),h=it(i,i.bgLayer,e.displayLabel??e.label,l.x,l.y-8,n,gt,!1),p=it(i,i.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,n,yt,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:h,background:o,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:p,background:o,kind:"ga-capacity",categoryKey:e.categoryKey}),i.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:t,labelPoint:l,labelNode:h,capacityNode:p,...c?{sectionId:c.logicalId}:{}})}function it(i,e,t,s,o,r,n,a){let l=new Ci({x:s,y:o,text:t,fontSize:n,fontStyle:a?"700":"500",fontFamily:i.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function Bo(i,e){let t=[],s=e.theme.background??"#f7f8fb",o=new Map,r=(c,h)=>{let p=o.get(c)??[];p.push(h),o.set(c,p)};for(let c of e.seats){if(c.kind==="booth")continue;let h=c.logicalRowId??c.rowId;r(h,c),h!==c.rowId&&r(c.rowId,c)}let n=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of i.objects){if(c.type!=="row")continue;let h=c.segmentedRow?.repeatLabelOnComponents===!0;if(c.segmentedRow&&!h&&c.segmentedRow.componentIndex!==0)continue;let p=h?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(p?.visible===!1||p?.positionPreset==="none")continue;let u=c.segmentedRow&&!h?c.segmentedRow.groupId:c.id,m=(o.get(u)??[]).slice().sort((R,E)=>n(R)-n(E));if(!m.length)continue;let f=m[0],y=m[m.length-1],d=p?.labelStyle,g=q(s,d?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",St),b=d?.size??es,S=p?.rotation??0,k=e.objectFilteredOut(c)?.15:1,w=e.seatSection.get(f.id),T=c.segmentedRow?.displayLabel??c.displayLabel,C=w?.label.trim(),P=C&&c.label.toLocaleLowerCase("en-US").startsWith(`${C.toLocaleLowerCase("en-US")} `)?c.label.slice(C.length).trim():"",M=T??(/^[\p{L}\p{N}]{1,4}$/u.test(P)?P:c.label),v=w?[...new Set([w.id,w.logicalId,w.zone].filter(R=>!!R))]:void 0,L=(R,E,B)=>t.push({text:M,x:R,y:E,rotation:S,fontSize:b,ink:g,opacity:k,...v?.length?{focusKeys:v}:{},...B?{automaticAway:B}:{}});if(p?.position){L(p.position.x,p.position.y);continue}let x=e.seatR+12,I=p?.positionPreset??"start";if(I==="start"||I==="both"){let R=c.rotation*Math.PI/180,E={x:-Math.cos(R),y:-Math.sin(R)};L(f.x+E.x*x,f.y+E.y*x,E)}if(I==="end"||I==="both"){let R=(c.rotation+c.curve)*Math.PI/180,E={x:Math.cos(R),y:Math.sin(R)};L(y.x+E.x*x,y.y+E.y*x,E)}}let a=(e.seatR+12)*2.2,l=[];for(let c of t){let h=l.find(p=>p.text===c.text&&Math.hypot(p.x-c.x,p.y-c.y)<=a);if(h){h.x=(h.x+c.x)/2,h.y=(h.y+c.y)/2;continue}l.push(c)}return l}function Ii(i,e,t=Q){let s=i.rotation()*Math.PI/180,o=Math.abs(Math.cos(s)),r=Math.abs(Math.sin(s)),n=(i.width()*o+i.height()*r)/2+t,a=(i.width()*r+i.height()*o)/2+t;return{x:e.x-n,y:e.y-a,width:n*2,height:a*2}}function Fo(i,e,t,s){let o={x:e.x,y:e.y},r=e.automaticAway;if(!r)return o;let n={x:-r.y,y:r.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let u=1;u<=4;u++){let m=a*u;l.push({x:n.x*m,y:n.y*m},{x:-n.x*m,y:-n.y*m},{x:r.x*m,y:r.y*m},{x:(r.x+n.x)*m,y:(r.y+n.y)*m},{x:(r.x-n.x)*m,y:(r.y-n.y)*m})}let c=o,h=1/0,p=1/0;for(let u of l){let m={x:o.x+u.x,y:o.y+u.y},f=Ii(i,m),d=(s?vt(s,f,{mode:"overlap"}).length:0)+t.collisionCount(f),g=Math.hypot(u.x,u.y);if((d<h||d===h&&g<p)&&(c=m,h=d,p=g),d===0)break}return c}function Do(i,e){let t=i.sectionHeat.get(e.id)??i.sectionHeat.get(e.logicalId)??(e.zone?i.sectionHeat.get(e.zone):void 0);if(t==null||t<=0){e.outlinePoly.stroke(oe(e.outlineTint,.5)),e.outlinePoly.fill(oe(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let s=mt("#f4b740","#ef4444",t);e.outlinePoly.stroke(oe(s,.72+t*.25)),e.outlinePoly.fill(oe(s,.08+t*.13)),e.outlinePoly.strokeWidth(2+t*3.5),e.outlinePoly.shadowColor(s),e.outlinePoly.shadowBlur(4+t*12),e.outlinePoly.shadowOpacity(.25+t*.45)}function Mi(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function Pi(i,e){return Mi(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*qs?"nearly-gone":"normal"}function _o(i,e){let t=Pi(i,e);e.blockPoly.fill(Oe(le(i.canvasBackground),t)),e.subLabel.text(t==="sold-out"?Z("map.soldOut"):Z("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Oo(i,e){let t,s;i.reducedMotion?(t=e<=ge?1:0,s=e<=Fe?1:0):(t=N((Be-e)/(Be-ge),0,1),s=N((ge-e)/(ge-Fe),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,s=0);let o=!i.floorOverview&&!i.focusedSectionId&&e<ne;o&&(t=1),i.zones.length||(s=0);let r=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(o||r?0:1-t);let n=i.stageScaleX,a=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);a&&i.setLodScale(e);let l=i.focusedSectionId,c=le(i.canvasBackground),h=N((t-.2)/.8,0,1);for(let u of i.sections){let m=i.hasFocusDimOverlay?1:l&&u.id!==l&&u.logicalId!==l&&u.zone!==l?_e:1,f=Math.min(m,vo(u.memberCategoryKeys,i.categoryFilter)?_e:1);u.outlinePoly.opacity(o?0:(1-t)*f),u.blockPoly.opacity($s*t*f),u.blockPoly.stroke(c.sectionStroke),u.blockPoly.strokeWidth(Rt/Math.max(n,1e-4));let y=u.blockPoly.fill(),d=q(typeof y=="string"?y:u.baseFill,u.preferredInk);u.nameLabel.fill(d),u.subLabel.fill(d),a&&h>.01&&kn(i,u,n),u.nameLabel.opacity(u.nameLabelFits?h*(1-s)*f:0),u.subLabel.opacity(0)}let p=s*(1-i.isoT);for(let u of i.zones)u.back.opacity(p),u.label.opacity(p),u.sub&&u.sub.opacity(i.stageWidth<Le?0:p),a&&wn(i,u,n);if(!i.glideInProgress&&(h>.01||p>.01)){vn(i,n),Sn(i.sections);for(let u of i.zones){let m=u.label.opacity();u.back.opacity(m),u.sub&&u.sub.opacity(i.stageWidth<Le?0:m)}}i.bgLayer.batchDraw()}function Sn(i){let e=new Map;for(let t of i)(e.get(t.logicalId)??e.set(t.logicalId,[]).get(t.logicalId)).push(t);for(let t of e.values()){if(t.length<2)continue;let s=t.filter(o=>o.nameLabel.opacity()>.05).sort((o,r)=>{let n=K(o.outline),a=K(r.outline);return a.width*a.height-n.width*n.height});for(let o of s.slice(1))o.nameLabel.opacity(0)}}function vn(i,e){let s=[],o=a=>{let l=i.worldToScreen({x:a.x(),y:a.y()}),c=K(Gt({x:0,y:0},a.width()*e,a.height()*e,a.rotation()));return{x:l.x-c.width/2,y:l.y-c.height/2,w:c.width,h:c.height}};for(let a of i.zones){if(a.label.opacity()<=.05)continue;let l=a.back.getAbsolutePosition(),c=a.back.width()*e,h=a.back.height()*e;s.push({node:a.label,tier:0,section:!1,box:{x:l.x-c/2,y:l.y-h/2,w:c,h}})}for(let a of i.sections)a.nameLabel.opacity()>.05&&s.push({node:a.nameLabel,tier:1,section:!0,area:a.labelArea,box:o(a.nameLabel)});if(s.length<2)return;s.sort((a,l)=>a.tier-l.tier||(l.area??0)-(a.area??0)||a.box.y-l.box.y||a.box.x-l.box.x);let r=[],n=a=>r.some(l=>a.x<l.x+l.w+4&&l.x<a.x+a.w+4&&a.y<l.y+l.h+4&&l.y<a.y+a.h+4);for(let a of s){if(!n(a.box)){r.push(a.box);continue}let l=!1;if(a.section){let c=a.node.fontSize(),h=a.node.y();for(let p of Ys){let u=c*p;if(u*e<je)break;st(a.node,u,h);let m=o(a.node);if(!n(m)){r.push(m),l=!0;break}}l||st(a.node,c,h)}l||a.node.opacity(0)}}function st(i,e,t){i.fontSize(Math.max(1,e)),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t)}function kn(i,e,t){e.subLabelFits=!1;let s=Bt(pi*e.labelScale,i.stageWidth),o=je;for(let r=s;r>=o;r-=1)for(let n of[0,-90]){e.nameLabel.rotation(n),st(e.nameLabel,r/t,e.nameLabel.y());for(let a of e.labelAnchors){e.nameLabel.position(a);let l=8/t;if(Ht(a,e.nameLabel.width()+l,e.nameLabel.height()+l,n,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function wn(i,e,t){let s=gi(i.stageWidth),o=e.sub!=null&&i.stageWidth>=Le,r=i.stageWidth<Le,n=(r?7:10)*s/t,a=(r?4:6)*s/t,l=o?3*s/t:0;st(e.label,Bt(Et,i.stageWidth)/t,e.anchor.y),e.label.x(e.anchor.x),o&&st(e.sub,Bt(At,i.stageWidth)/t,e.anchor.y),o&&e.sub.x(e.anchor.x);let c=Math.max(e.label.width(),o?e.sub.width():0)+n*2,h=e.label.height()+(o?l+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(o?(l+e.sub.height())/2:0)),o&&e.sub.y(e.anchor.y+(e.label.height()+l)/2),e.back.position(e.anchor),e.back.size({width:c,height:h}),e.back.offset({x:c/2,y:h/2}),e.back.cornerRadius(7*s/t),e.back.strokeWidth(1/t);let p=e.back.getAbsolutePosition(),u=6,m=c*t;if(m>i.stageWidth-u*2){e.label.opacity(0),e.back.opacity(0),e.sub&&e.sub.opacity(0);return}let f=m/2,d=(N(p.x,u+f,i.stageWidth-u-f)-p.x)/t;Math.abs(d)>.001&&(e.label.x(e.label.x()+d),e.sub&&e.sub.x(e.sub.x()+d),e.back.x(e.back.x()+d));let g=62+h*t/2;if(p.y<g){let b=(g-p.y)/t;e.label.y(e.label.y()+b),e.sub&&e.sub.y(e.sub.y()+b),e.back.y(e.back.y()+b)}}import{Group as Ln}from"konva/lib/Group";import{Line as Go}from"konva/lib/shapes/Line";import{Rect as Tn}from"konva/lib/shapes/Rect";import{Text as Ho}from"konva/lib/shapes/Text";function Cn(i,e){return i>=ae||e&&i>=di}function In(i,e,t){return t&&e>=di?Math.max(i,Vs/Math.max(e,1e-4)):i}function Mn(i,e){return Math.max(1,i*2-(e?1:3))}function No(i){let e=i.exportMode?Math.max(i.effScale(),ae):i.effScale(),t=Cn(e,i.focusedSectionId!=null),s=n=>{let a=n.getClientRect({skipShadow:!0,skipStroke:!0});return a.x>=0&&a.y>=0&&a.x+a.width<=i.stage.width()&&a.y+a.height<=i.stage.height()};for(let[n,a]of i.boothLabelById){let l=i.circleById.get(n);a.visible(pe(a.fontSize(),e)&&!!l?.isVisible()&&i.focusedSeatOpacity(n,l?.getAbsoluteOpacity()??1)>=.5&&s(a))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear();let o=0;if(t)for(let n of i.visibleSeatCandidates()){if(n.kind==="booth")continue;let a=i.worldToScreen(n);if(a.x<-20||a.x>i.stage.width()+20||a.y<-20||a.y>i.stage.height()+20||i.accessGlyphById.has(n.id)&&i.accessGlyphShouldShow(n.id))continue;let l=i.circleById.get(n.id);if(!l?.isVisible()||i.focusedSeatOpacity(n.id,l.getAbsoluteOpacity())<.5)continue;let c=i.statusById.get(n.id)??"free",h=i.renderedSeatPoint(n),p=i.viewMode==="perspective"?i.perspectiveSeatScale.get(n.id)??1:1;if(!i.hasSeatMark(n.id)&&(c==="booked"||c==="held"&&!i.ownedHold.has(n.id)&&!i.opts.manageMode)){let g=new Ln({x:h.x,y:h.y,listening:!1});if(g.scale({x:p,y:p}),c==="held"?(g.add(new Tn({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),g.add(new Go({points:[-2.4,-.8,-2.4,-2.7,-1.2,-4,0,-4.35,1.2,-4,2.4,-2.7,2.4,-.8],stroke:"#ffffff",strokeWidth:1.2,lineCap:"round",lineJoin:"round",listening:!1}))):g.add(new Go({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1})),i.seatLabelContainer(n.id).add(g),++o>=ui)break;continue}let m=i.seatMatchesFocus(n.id),f=In(ue*i.seatLabelScale(n),e,m),y=new Ho({x:h.x,y:h.y,text:bt(n.displayLabel??n.label),fontSize:f,fontStyle:"600",fontFamily:i.labelFont(),fill:l?i.seatLabelInk(n,l):i.seatPreferredLabelInk(n),listening:!1,perfectDrawEnabled:!1}),d=Mn(i.seatR,m);if(y.width()>d&&y.fontSize(Math.max(Ue,f*d/y.width())),y.width()>d+.01){y.destroy();continue}if(!pe(y.fontSize(),e)){y.destroy();continue}if(y.offsetX(y.width()/2),y.offsetY(y.height()/2),y.scale({x:p,y:p}),i.seatLabelContainer(n.id).add(y),!s(y)){y.destroy();continue}if(i.seatLabelById.set(n.id,y),++o>=ui)break}let r=new Ge;for(let{node:n}of i.freeTextById.values()){if(!n.isVisible())continue;let a=n.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});r.insert({x:a.x-Q,y:a.y-Q,width:a.width+Q*2,height:a.height+Q*2})}for(let n of i.rowLabelPlan){let a=i.focusedSectionId!=null&&n.focusKeys?.includes(i.focusedSectionId),l=a?Math.max(n.fontSize,Ns/Math.max(e,1e-4)):n.fontSize;if(!a&&!pe(l,e))continue;let c=i.worldToScreen({x:n.x,y:n.y});if(c.x<-40||c.x>i.stage.width()+40||c.y<-40||c.y>i.stage.height()+40)continue;let h=new Ho({x:n.x,y:n.y,text:n.text,fontSize:l,fontStyle:"700",fontFamily:i.labelFont(),fill:n.ink,rotation:n.rotation,opacity:n.opacity,shadowColor:"#05070c",shadowBlur:n.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:n.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2);let p=i.resolveAutomaticRowLabelPosition(h,n,r);h.position(p),h.setAttr("rowLabel",!0),i.labelGroup.add(h);let u=h.getClientRect({skipShadow:!0,skipStroke:!0}),m=6,f=u.x<m?m-u.x:u.x+u.width>i.stage.width()-m?i.stage.width()-m-u.x-u.width:0,y=u.y<m?m-u.y:u.y+u.height>i.stage.height()-m?i.stage.height()-m-u.y-u.height:0,d=p;if(f||y){let b=i.labelGroup.getAbsoluteTransform(),S=b.point(p);d=b.copy().invert().point({x:S.x+f,y:S.y+y}),h.position(d)}let g=i.rowLabelBox(h,d);if(n.automaticAway&&r.collisionCount(g)>0){h.destroy();continue}r.insert(g)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function ot(i){return{th:xt*Math.PI/180*i.isoT,sg:1-(1-Qe)*i.isoT}}function Vo(i,e){let{th:t,sg:s}=ot(e),o=e.centre,r=i.x-o.x,n=i.y-o.y,a=r*Math.cos(t)-n*Math.sin(t),l=(r*Math.sin(t)+n*Math.cos(t))*s;return{x:o.x+a,y:o.y+l}}function Wo(i,e){let{th:t,sg:s}=ot(e),o=e.centre,r=i.x-o.x,a=(i.y-o.y)/s,l=r*Math.cos(t)+a*Math.sin(t),c=-r*Math.sin(t)+a*Math.cos(t);return{x:o.x+l,y:o.y+c}}function zo(i,e){let{th:t,sg:s}=ot(e),o=i*e.isoT;return{x:-(o/s)*Math.sin(t),y:-(o/s)*Math.cos(t)}}function Ko(i,e,t){let s=ns(e);i.offset(t),i.position(ie(e,t)),i.rotation(s.rotationDeg),i.scale({x:s.scaleX,y:s.scaleY}),i.skewX(s.skewX),i.skewY(0)}function Xo(i){i.position({x:0,y:0}),i.offset({x:0,y:0}),i.scale({x:1,y:1}),i.rotation(0),i.skewX(0),i.skewY(0)}function $o(i,e){let t=Math.hypot(e.x-i.surfaceFocal.x,e.y-i.surfaceFocal.y),s=Math.max(0,t-i.frontDistanceWorld);return i.liftWorld+s*Math.tan(i.rakeDeg*Math.PI/180)}function Yo(i,e,t){return i.perspectiveAffine?ie(i.perspectiveAffine,e):ie(t,e)}function qo(i,e){return e?ie(e,i):i}function Uo(i,e){let t=0;for(let p of i.seats){let u=Math.max(0,(p.eyeHeightM??U)-U);t=Math.max(t,u*xe)}for(let p of i.objects)p.type==="section"&&(t=Math.max(t,dt(p,{floorBaseHeightM:i.floorBaseHeightMFor(p.id)}).height*xe));let s=ss(i.bounds,t),o=kt(s,s.target),r=os(o);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let n=1/0,a=1/0,l=-1/0,c=-1/0;for(let p of i.seats){let u=Math.max(0,(p.eyeHeightM??U)-U),m=fe(s,p,u*xe),f={x:m.x,y:m.y};e.seatProjected.set(p.id,f),e.seatLocal.set(p.id,ie(r,f)),e.seatDepth.set(p.id,m.depth),e.seatScale.set(p.id,m.scale),n=Math.min(n,m.x),a=Math.min(a,m.y),l=Math.max(l,m.x),c=Math.max(c,m.y)}for(let p of[{x:i.bounds.x,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y+i.bounds.height},{x:i.bounds.x,y:i.bounds.y+i.bounds.height}]){let u=fe(s,p,0);n=Math.min(n,u.x),a=Math.min(a,u.y),l=Math.max(l,u.x),c=Math.max(c,u.y)}let h=Math.max(24,i.seatR*3);return{camera:s,baseAffine:o,baseInverse:r,bounds:Number.isFinite(n)?{x:n-h,y:a-h,width:Math.max(1,l-n+h*2),height:Math.max(1,c-a+h*2)}:null}}function Zo(i,e,t){let s=t?[...t].map(o=>i.seatById.get(o)).filter(o=>!!o):e?i.seats:[...i.perspectiveAppliedSeats].map(o=>i.seatById.get(o)).filter(o=>!!o);for(let o of s){if(e&&i.perspectiveAppliedSeats.has(o.id))continue;let r=e?i.perspectiveSeatProjected.get(o.id)??o:o,n=e?i.perspectiveSeatScale.get(o.id)??1:1,a=i.circleById.get(o.id);a?.position(r),a?.scale({x:n,y:n});let l=i.accessRingById.get(o.id);l?.position(r),l?.scale({x:n,y:n});let c=i.accessGlyphById.get(o.id);if(c){let p=i.seatR*1.5/re;c.position(r),c.scale({x:p*n,y:p*n})}let h=i.boothLabelById.get(o.id);h?.position(r),h?.scale({x:n,y:n}),e&&i.perspectiveAppliedSeats.add(o.id)}e||i.perspectiveAppliedSeats.clear()}function Ri(i){return i?.getAttr?.("seatId")??void 0}var at=class at{constructor(e,t={}){this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;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=Li;this.effSelection=tt;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.catOrder=[];this.selection=new Set;this.selectionMarkers=new Map;this.ownedHold=new Set;this.seatMarks=new Ot;this.selectionFocusId=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.categoryHighlight=null;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];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.focusBackdrop=null;this.focusDimOverlay=null;this.objectFloor=new Map;this.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=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=typeof navigator<"u"&&navigator.maxTouchPoints>0?Xs:Ks;this.fitScale=1;this.seatR=qe;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.assetGeneration=0;this.assetPromises=[];this.assetErrors=[];this.assetCancels=new Set;this.rafId=0;this.frames=0;this.lastFpsAt=0;this.recacheTimer=null;this.resizeObs=null;this.viewChangeRaf=0;this.marquee=null;this.marqueeCur=null;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 t=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(t){e.preventDefault();let s=this.focusedId?this.nearestSeat(this.focusedId,t):this.seats[0]?.id??null;s&&this.focusSeat(s);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let s=this.seatById.get(this.focusedId);s&&this.opts.onFocusSeat?.(s)}};this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...t},this.exportMode=t.exportMode===!0,this.currency=t.currency;let s=Wt.pixelRatio;this.exportMode&&(this.dpr=1),Wt.pixelRatio=this.dpr,this.stage=new Pn({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Nt(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",Z("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new xi({listening:!this.exportMode}),this.seatLayer=new xi({listening:!this.exportMode}),this.overlayLayer=new xi({listening:!1}),this.labelGroup=new Te({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new Te({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.hoverRing=new Ce({radius:qe+2,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Ce({radius:qe+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&&(Wt.pixelRatio=s),this.exportMode||(this.wireInteraction(),this.startFpsLoop()),!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),marqueeActive:()=>!!this.marquee,marqueeShouldStart:e=>!!(this.opts.manageMode&&this.opts.marqueeSelect&&e.pointerType!=="touch"&&e.button===0&&this.getRung()==="seats"),beginMarquee:e=>this.beginMarquee(e),updateMarquee:e=>this.updateMarquee(e),finishMarquee:()=>this.finishMarquee(),cancelMarquee:()=>this.cancelMarquee()}}setChart(e,t){if(e!==this.chartDoc&&(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.chartDoc=e,this.activeFloorId=t?.floorId??pt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let o of e.floors)for(let r of o.objects)this.objectFloor.set(r.id,o.id),r.type==="section"&&r.logicalSectionId&&this.objectFloor.set(r.logicalSectionId,o.id);let s=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),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.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.primaryFocalLabels.clear(),this.gaById.clear();for(let o of this.selectionMarkers.values())o.destroy();this.selectionMarkers.clear(),this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.statusById.clear(),this.selection.clear(),this.seatById.clear(),this.seatIndex=null,this.cached=!1,this.accessFilter=null,this.sections=[],this.zones=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasBoothText=!1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.isoT=0,this.isoTarget=0,this.viewMode="flat",this.perspectiveCamera=null,this.perspectiveBaseAffine=null,this.perspectiveBaseInverse=null,this.perspectiveSeatLocal.clear(),this.perspectiveSeatProjected.clear(),this.perspectiveSeatDepth.clear(),this.perspectiveSeatScale.clear(),this.perspectiveAppliedSeats.clear(),this.perspectiveBounds=null,this.resetLayerTransforms(),this.hasSections=s.objects.some(o=>o.type==="section");for(let o of e.zones??[])o.color&&this.zoneColor.set(o.id,o.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=N(this.theme.seatScale??1,.7,1.6)*qe,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(o=>o.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((o,r)=>{this.cbHueByKey.set(o,Dt[r%Dt.length])});for(let o of e.categories)this.catColor.set(o.key,o.color),this.catByKey.set(o.key,o),typeof o.price=="number"&&this.catPrice.set(o.key,o.price);for(let o of s.objects)o.type==="booth"&&this.boothDims.set(o.id,{width:o.width,height:o.height,rotation:o.rotation,...o.points&&o.points.length>=3?{points:o.points.map(r=>({x:r.x,y:r.y}))}:{}});this.seats=ze(s,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let o of this.seats)this.seatById.set(o.id,o),this.statusById.set(o.id,"free");this.seatIndex=is(this.seats,{seatRadius:this.seatR}),this.bounds=Zi(s),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(s),this.renderBackground(s),this.unsectionedSeatGroup=new Te({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup),this.renderSeats(),this.buildRowLabelPlan(s),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.zoomToFit()}floorView(e){if(!e.floors||!e.floors.length)return{...e,referenceImage:void 0,backgroundImage:Ee(e)};if(this.floorOverview&&e.floors.length>=2)return{...qi(e)?Ui(e):Yi(e),referenceImage:void 0,backgroundImage:Ee(e)};if(this.stacked&&e.floors.length>=2)return{...$i(e),referenceImage:void 0,backgroundImage:Ee(e)};let t=e.floors.find(s=>s.id===this.activeFloorId)??e.floors[0];return{...e,objects:t.objects,focalPoint:t.focalPoint,referenceImage:void 0,backgroundImage:Ee(t),floors:void 0}}floorBaseHeightMFor(e){let t=this.chartDoc?.floors;if(!t?.length)return 0;let s=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return t.find(o=>o.id===s)?.baseHeightM??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}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?pt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,t){let s=!1,o=this.hasSections?new Set:null;for(let r of e){if(!this.statusById.has(r))continue;let n=this.statusById.get(r);this.statusById.set(r,t);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),s=!0),o){let l=this.seatSection.get(r);l&&(n==="free"!=(t==="free")&&(l.free+=t==="free"?1:-1),o.add(l))}}if(o&&o.size){for(let r of o)this.refreshSectionFill(r);this.bgLayer.batchDraw()}s&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels())}setSeatCategories(e){let t=!1,s=new Set;for(let[r,n]of Object.entries(e)){let a=this.seatById.get(r);if(!a||!this.catColor.has(n)||a.categoryKey===n)continue;a.categoryKey=n;let l=this.circleById.get(r);l&&(this.paintSeat(l,r),t=!0);let c=this.seatSection.get(r);c&&s.add(c)}if(!t)return;let o=new Map((this.chartDoc?pt(this.chartDoc):[]).flatMap(r=>r.objects).filter(r=>r.type==="section").map(r=>[r.id,r]));for(let r of s){if(!o.get(r.id)?.color){let a=new Map;for(let l of r.memberIds){let c=this.seatById.get(l)?.categoryKey;c&&a.set(c,(a.get(c)??0)+1)}r.baseFill=ii([...a].map(([l,c])=>({hex:this.catColor.get(l)??"#6e7bff",w:c})),"#3a4358")}this.refreshSectionFill(r)}s.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels()}setOwnedHold(e){let t=new Set((e??[]).filter(o=>this.statusById.has(o))),s=new Set([...this.ownedHold,...t]);this.ownedHold=t;for(let o of s){let r=this.circleById.get(o);r&&this.paintSeat(r,o),this.syncSelectionMarker(o)}s.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let t=e&&this.selection.has(e)?e:null;if(t===this.selectionFocusId)return;let s=this.selectionFocusId;this.selectionFocusId=t;for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}s&&this.syncSelectionMarker(s),t&&this.syncSelectionMarker(t);for(let[o,r]of this.selectionMarkers)r.opacity(!t||o===t?1:.2);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}setSeatMarks(e){let t=this.seatMarks.merge(e,this.statusById);for(let s of t){let o=this.circleById.get(s);o&&this.paintSeat(o,s)}t.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 t of this.selection){let s=this.seatById.get(t);s&&e.push(s)}return e}clearSelection(){let e=[...this.selection];for(let t of e)this.setSelected(t,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let t=[];for(let s of e){if(this.selection.has(s)||!this.isSelectable(s))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(s,!0,!0);let o=this.seatById.get(s);o&&t.push(o)}return t.length&&this.overlayLayer.batchDraw(),t}setManageInteraction(e){this.marquee&&this.cancelMarquee(),this.gestures.resetPan(),this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let t=[...this.selection].filter(s=>!this.isSelectable(s));t.length&&this.deselect(t),!e.manageMode&&this.selection.size&&this.clearSelection(),this.container.style.cursor="default",this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[t,s]of Object.entries(e??{}))Number.isFinite(s)&&this.sectionHeat.set(t,Math.max(0,Math.min(1,s)));for(let t of this.sections)this.refreshSectionHeat(t);this.bgLayer.batchDraw()}deselect(e){let t=!1;for(let s of e)this.selection.has(s)&&(this.setSelected(s,!1,!0),t=!0);t&&this.overlayLayer.batchDraw()}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let t of this.seats)this.isSelectable(t.id)&&e.push(t.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let t=new Set(e),s=[];for(let o of this.seats)t.has(o.label)&&this.isSelectable(o.id)&&s.push(o.id);return this.selectMany(s)}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 t=[],s=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(s.has(r)||(s.add(r),!this.isSelectable(r)))continue;let n=this.seatById.get(r);n&&t.push(n)}return t}selectMany(e){let t=e.filter(o=>!this.selection.has(o));if(!t.length)return this.getSelection();let s=this.selection.size+t.length<=Ws;for(let o of t)if(s)this.setSelected(o,!0,!0);else{this.selection.add(o);let r=this.circleById.get(o);r&&this.paintSeat(r,o)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let t=this.screenToWorld(e),s=this.stage.scaleX()||1,o=new rt({x:t.x,y:t.y,width:0,height:0,stroke:this.effSelection,strokeWidth:1.5/s,dash:[5/s,4/s],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.overlayLayer.add(o),this.marquee={start:t,rect:o},this.marqueeCur=t,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let t=this.screenToWorld(e),{start:s,rect:o}=this.marquee;o.setAttrs({x:Math.min(s.x,t.x),y:Math.min(s.y,t.y),width:Math.abs(t.x-s.x),height:Math.abs(t.y-s.y)}),this.marqueeCur=t,this.overlayLayer.batchDraw()}cancelMarquee(){this.marquee&&(this.marquee.rect.destroy(),this.marquee=null,this.marqueeCur=null,this.overlayLayer.batchDraw())}finishMarquee(){let e=this.marquee;if(this.marquee=null,!e)return;e.rect.destroy(),this.overlayLayer.batchDraw();let t=this.marqueeCur??e.start;this.marqueeCur=null;let s=Math.min(e.start.x,t.x),o=Math.max(e.start.x,t.x),r=Math.min(e.start.y,t.y),n=Math.max(e.start.y,t.y),a=this.stage.scaleX()||1;if((o-s)*a<4&&(n-r)*a<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let l=[];for(let c of this.seats){let h=this.renderedSeatPoint(c);h.x<s||h.x>o||h.y<r||h.y>n||this.isSelectable(c.id)&&l.push(c.id)}this.selectMany(l),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let s=this.seatById.get(e);if(!s)return;let o=this.renderedSeatPoint(s),r=new Ce({x:o.x,y:o.y,radius:this.seatR,stroke:t,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;r.scale({x:n,y:n}),this.overlayLayer.add(r);let a=performance.now(),l=620,c=h=>{if(!r.getLayer())return;let p=Math.min(1,(h-a)/l);r.radius(this.seatR*(1+p*1.8)),r.opacity(.9*(1-p)),this.overlayLayer.batchDraw(),p<1?requestAnimationFrame(c):(r.destroy(),this.overlayLayer.batchDraw())};requestAnimationFrame(c)}flashSection(e,t="#22a06b"){let s=this.sections.filter(o=>o.id===e||o.zone===e);if(s.length)for(let o of s){let r=this.viewMode==="perspective"&&o.perspectiveAffine?o.outline.map(u=>this.perspectiveLocalPoint(this.projectedSectionPoint(o,u))):o.outline.map(u=>{let m=o.liftWorld>0?this.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:u.x+m.x,y:u.y+m.y}}),n=r.reduce((u,m)=>({x:u.x+m.x,y:u.y+m.y}),{x:0,y:0});n.x/=r.length,n.y/=r.length;let a=new nt({x:n.x,y:n.y,points:r.flatMap(u=>[u.x-n.x,u.y-n.y]),closed:!0,stroke:t,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:t,shadowBlur:14,shadowOpacity:.7});this.overlayLayer.add(a),this.overlayLayer.batchDraw();let l=()=>{a.getLayer()&&(a.destroy(),this.overlayLayer.batchDraw())};if(this.reducedMotion||typeof document<"u"&&document.hidden){setTimeout(l,520);continue}let c=performance.now(),h=820,p=u=>{if(this.destroyed||!a.getLayer())return;let m=Math.min(1,(u-c)/h),y=1+(1-Math.pow(1-m,3))*.04;a.scale({x:y,y}),a.opacity(.92*(1-m)),this.overlayLayer.batchDraw(),m<1?requestAnimationFrame(p):l()};requestAnimationFrame(p)}}nearestSeat(e,t){let s=this.seatById.get(e);if(!s)return null;let o=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(s.id)??s:s,r=null,n=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-o.x,h=l.y-o.y,p=c*t.x+h*t.y;if(p<=.5)continue;let u=Math.abs(c*t.y-h*t.x),m=p+u*2.5;m<n&&(n=m,r=a.id)}return r}focusSeat(e){let t=this.seatById.get(e);if(!t)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(t));let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:s,y:s}),this.focusRing.visible(!0),this.ensureVisible(t),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(t)}ensureVisible(e){let t=this.stage.width(),s=this.stage.height(),o=Math.max(this.stage.scaleX(),ke*1.2),r=this.worldToScreen(e),n=70,a=r.x<n||r.x>t-n||r.y<n||r.y>s-n;if(this.stage.scaleX()<o||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ie(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:o,y:o}),this.stage.position({x:t/2-c.x*o,y:s/2-c.y*o}),this.afterViewChange(),this.stage.batchDraw()}}zoomToFit(){let e=this.stage.width(),t=this.stage.height(),s=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(e/s.width,t/s.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let r=e/s.width<=t/s.height,n=s.height*this.fitScale;r&&n<.55*t&&(this.fitScale=Math.min(this.fitScale*1.3,.62*t/s.height))}let o=this.fitScale;this.stage.scale({x:o,y:o}),this.stage.position({x:(e-s.width*o)/2-s.x*o,y:(t-s.height*o)/2-s.y*o}),this.afterViewChange(),this.stage.batchDraw()}refitCurrentView(){if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}zoomIn(){this.zoomAbout(this.stage.scaleX()*at.ZOOM_STEP,ai(this.stage))}zoomOut(){this.zoomAbout(this.stage.scaleX()/at.ZOOM_STEP,ai(this.stage))}zoomOutLevel(){let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e),"section"):"venue":this.getRung()==="seats"?(this.setRung("sections"),"sections"):(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let t of this.gaById.values())e+=t.capacity;return e}worldToScreen(e){let t=this.stage.scaleX(),s=e.id,o=typeof s=="string"?this.seatById.get(s):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=o?this.perspectiveSeatProjected.get(o.id)??ie(this.perspectiveBaseAffine,e):ie(this.perspectiveBaseAffine,e);return{x:a.x*t+this.stage.x(),y:a.y*t+this.stage.y()}}let r=o?this.renderedSeatPoint(o):e,n=this.isoT===0?r:this.isoForward(r);return{x:n.x*t+this.stage.x(),y:n.y*t+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let t=e===null?null:[...e];if(!this.sameAccessFilter(t)){this.accessFilter=t,this.updateAccessGlyphs(this.effScale());for(let s of this.seats){let o=this.circleById.get(s.id);o&&this.paintSeat(o,s.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let t=this.accessFilter;return t===null||e===null?t===e:t.length===e.length&&t.every((s,o)=>s===e[o])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(let t of this.seats){let s=this.circleById.get(t.id);s&&this.paintSeat(s,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){let t=e===null?null:new Set(e);if(!bo(t,this.categoryFilter)){this.categoryFilter=t;for(let s of this.seats){let o=this.circleById.get(s.id);o&&this.paintSeat(o,s.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}applyGAFilterState(){this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){go({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=>mo(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<ne,effScale:()=>this.effScale(),labelLegible:e=>pe(e,this.effScale())})}setGAStates(e){yo(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,t){this.setGAStates({[e]:t})}focusCategories(e,t){if(!e?.length){this.focusRegion(this.bounds,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let s=new Set(e),o=this.seats.filter(y=>!s.has(y.categoryKey)||this.seatInClosedSection(y.id)?!1:(this.statusById.get(y.id)??"free")==="free"||this.ownedHold.has(y.id));if(!o.length)return;let r=So(o.map(y=>y.id),this.seatSection);r&&this.focusSection(r);let n=1/0,a=-1/0,l=1/0,c=-1/0;for(let y of o){let d=this.renderedSeatPoint(y);n=Math.min(n,d.x),a=Math.max(a,d.x),l=Math.min(l,d.y),c=Math.max(c,d.y)}let h=Math.max(24,this.seatR*3);n-=h,a+=h,l-=h,c+=h;let p=Math.max(40,a-n),u=Math.max(40,c-l),m={x:n,y:l,width:p,height:u},f=this.narrowSeatDetailFocus(o,m);this.focusRegion(f?.bounds??m,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:f?.minScale})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let t=e==="isometric"?1:0,s=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=t,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),s){this.isoT=t,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=t,this.applyIso(),this.afterViewChange();return}let o=this.isoT;if(o===t){this.applyIso(),this.afterViewChange();return}let r=performance.now(),n=a=>{if(this.destroyed)return;let l=Math.min(1,(a-r)/zs),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=o+(this.isoTarget-o)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(n):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(n)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}isoParams(){return ot(this.isoState)}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),t=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,t)}return this.stage.scaleX()*(1-(1-Qe)*this.isoT)}isoForward(e){return Vo(e,this.isoState)}isoInverse(e){return Wo(e,this.isoState)}buildPerspectiveProjection(e){let t=Uo({seats:this.seats,objects:e.objects,bounds:this.bounds,seatR:this.seatR,floorBaseHeightMFor:s=>this.floorBaseHeightMFor(s)},{seatLocal:this.perspectiveSeatLocal,seatProjected:this.perspectiveSeatProjected,seatDepth:this.perspectiveSeatDepth,seatScale:this.perspectiveSeatScale});this.perspectiveCamera=t.camera,this.perspectiveBaseAffine=t.baseAffine,this.perspectiveBaseInverse=t.baseInverse,this.perspectiveBounds=t.bounds}setContainerAffine(e,t,s){Ko(e,t,s)}resetContainerTransform(e){Xo(e)}sectionSurfaceHeight(e,t){return $o(e,t)}projectedSectionPoint(e,t){return Yo(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return qo(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return zo(e,this.isoState)}resetLayerTransforms(e=!0){let t=e?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let s of t)s.position({x:0,y:0}),s.offset({x:0,y:0}),s.scale({x:1,y:1}),s.rotation(0),s.skewX(0),s.skewY(0)}resetSectionProjection(e=!0){for(let t of this.sections){this.resetContainerTransform(t.rootGroupBg),this.resetContainerTransform(t.liftGroupBg),e&&this.resetContainerTransform(t.liftGroupSeat),t.rootGroupBg.zIndex(t.bgZIndex),e&&t.liftGroupSeat.zIndex(t.seatZIndex);let s=this.labelLiftGroups.get(t.id);s&&e&&this.resetContainerTransform(s),t.perspectiveAffine=void 0,t.perspectiveCorrection=void 0,t.perspectiveDepth=void 0}}get seatAnchorContext(){return{seats:this.seats,seatById:this.seatById,seatR:this.seatR,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,perspectiveAppliedSeats:this.perspectiveAppliedSeats,circleById:this.circleById,accessRingById:this.accessRingById,accessGlyphById:this.accessGlyphById,boothLabelById:this.boothLabelById}}applyExactSeatAnchors(e,t){Zo(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,s=this.perspectiveBaseAffine,o=this.perspectiveBaseInverse;if(!t||!s||!o)return;let r=this.seats.length>2500&&this.sections.length>0;this.cached&&!r&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let a of[this.bgLayer,this.overlayLayer])this.setContainerAffine(a,s,t.target);this.perspectiveAppliedSeats.clear(),r||this.applyExactSeatAnchors(!0);for(let a of this.sections){let l=p=>this.sectionSurfaceHeight(a,p),c=kt(t,a.centroid,l),h=rs(o,c);a.perspectiveAffine=c,a.perspectiveCorrection=h,a.perspectiveDepth=fe(t,a.centroid,l(a.centroid)).depth,this.setContainerAffine(a.liftGroupBg,h,a.centroid);for(let p=0;p<a.sideFaces.length;p++){let u=a.outline[p],m=a.outline[(p+1)%a.outline.length],f=this.perspectiveLocalPoint(fe(t,u,0)),y=this.perspectiveLocalPoint(fe(t,m,0)),d=this.perspectiveLocalPoint(fe(t,m,l(m))),g=this.perspectiveLocalPoint(fe(t,u,l(u)));a.sideFaces[p].points([f.x,f.y,y.x,y.y,d.x,d.y,g.x,g.y]),a.sideFaces[p].opacity(.9)}}let n=[...this.sections].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of n)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),r||this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyIso(){if(this.resetSectionProjection(),this.applyExactSeatAnchors(!1),this.isoT===0)this.resetLayerTransforms();else{let{th:t,sg:s}=this.isoParams(),o=Math.cos(t),r=s*Math.sin(t),n=-Math.sin(t),a=s*Math.cos(t),l=Math.sqrt(o*o+r*r),c=o*a-r*n,h=Math.atan2(r,o)*180/Math.PI,p=l,u=c/l,m=(o*n+r*a)/c,f=this.isoCentre;for(let y of[this.bgLayer,this.seatLayer,this.overlayLayer])y.position({x:f.x,y:f.y}),y.offset({x:f.x,y:f.y}),y.rotation(h),y.scaleX(p),y.scaleY(u),y.skewX(m),y.skewY(0)}this.applyUprightLabels(),this.applyElevation(),this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyUprightLabels(){let e=xt*this.isoT,t=1/(1-(1-Qe)*this.isoT),s=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let o of s){let r=o.find("Text");for(let n of r){let a=n.getAttr("uprightBase");a==null&&(a=n.rotation(),n.setAttr("uprightBase",a)),n.rotation(a-e),n.scaleX(1),n.scaleY(t),n.skewX(0)}}}applyElevation(){let e=this.isoT;for(let t of this.sections){if(t.liftWorld<=0)continue;let s=this.isoLiftLocal(t.liftWorld);t.liftGroupBg?.position(s),t.liftGroupSeat.position(s),this.labelLiftGroups.get(t.id)?.position(s);let o=.9*e;for(let r=0;r<t.sideFaces.length;r++){let n=t.sideFaces[r],a=t.outline[r],l=t.outline[(r+1)%t.outline.length];n.points([a.x,a.y,l.x,l.y,l.x+s.x,l.y+s.y,a.x+s.x,a.y+s.y]),n.opacity(o)}}this.syncSeatOverlayPositions()}destroy(){this.destroyed=!0,this.cancelAssetLoads(),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),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 t=this.focusedSectionId;return t==null||e.id===t||e.logicalId===t||e.zone===t}focusedSeatOpacity(e,t){if(!this.focusedSectionId)return t;let s=this.seatSection.get(e);return t*(s&&this.sectionMatchesFocus(s)?1:_e)}sectionScreenBounds(e){if(this.viewMode==="perspective"&&e.perspectiveAffine){let n=this.stage.scaleX(),a=this.stage.x(),l=this.stage.y();return K(e.outline.map(c=>{let h=this.projectedSectionPoint(e,c);return{x:h.x*n+a,y:h.y*n+l}}))}let t=e.liftWorld>0?this.isoLiftLocal(e.liftWorld):{x:0,y:0},s=this.stage.scaleX(),o=this.stage.x(),r=this.stage.y();return K(e.outline.map(n=>{let a={x:n.x+t.x,y:n.y+t.y},l=this.isoT===0?a:this.isoForward(a);return{x:l.x*s+o,y:l.y*s+r}}))}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=ne,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,s=96,o=this.stage.width(),r=this.stage.height();for(let n of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(n);a=c.x+c.width>=-s&&c.y+c.height>=-s&&c.x<=o+s&&c.y<=r+s,a&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,n.memberIds)}n.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(n.id)?.setViewportCulled(!a)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,this.seats.filter(n=>!this.seatSection.has(n.id)).map(n=>n.id))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let t of this.sections)if(!t.liftGroupSeat.isViewportCulled())for(let s of t.memberIds){let o=this.seatById.get(s);o&&e.push(o)}for(let t of this.seats)this.seatSection.has(t.id)||e.push(t);return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}renderedSeatPoint(e){if(this.viewMode==="perspective")return this.perspectiveSeatLocal.get(e.id)??e;let t=this.seatSection.get(e.id);if(!t||t.liftWorld<=0||this.isoT===0)return e;let s=this.isoLiftLocal(t.liftWorld);return{x:e.x+s.x,y:e.y+s.y}}seatLabelContainer(e){let t=this.seatSection.get(e);if(!t)return this.labelGroup;let s=this.labelLiftGroups.get(t.id);return s||(s=new et({listening:!1}),s.setViewportCulled(t.liftGroupSeat.isViewportCulled()),s.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(t.liftWorld)),this.labelGroup.add(s),this.labelLiftGroups.set(t.id,s)),s}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:t,y:t})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:t,y:t})}}for(let[e,t]of this.selectionMarkers){let s=this.seatById.get(e);if(s){t.position(this.renderedSeatPoint(s));let o=this.viewMode==="perspective"?this.perspectiveSeatScale.get(s.id)??1:1;t.scale({x:o,y:o})}}}renderSeats(){let e=[...this.seats].sort((t,s)=>(this.perspectiveSeatDepth.get(s.id)??0)-(this.perspectiveSeatDepth.get(t.id)??0));for(let t of e){if(t.kind==="booth"){this.renderBoothUnit(t);continue}let s=this.seatContainer(t.id),o=Qs({x:t.x,y:t.y,radius:this.seatR,detail:this.seatGlyphDetail,glyph:cs(t.glyph,this.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(o instanceof Je&&this.glyphMarkers.push(o),o.setAttr("seatId",t.id),this.circleById.set(t.id,o),this.paintSeat(o,t.id),s.add(o),t.accessible){if(t.wheelchairSpaceType!=="no-seat"){let r=new Ce({x:t.x,y:t.y,radius:this.seatR+1.5,stroke:Jt(t.accessibility),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.accessRingById.set(t.id,r),s.add(r)}if(t.accessibility?.includes("wheelchair")&&si(t.accessibility)){let r=this.buildAccessGlyph(t,typeof o.fill()=="string"?o.fill():"");this.accessGlyphById.set(t.id,r),s.add(r)}}}}renderBoothUnit(e){let t=this.seatContainer(e.id),s=this.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},o=e.x,r=e.y,n;s.points&&s.points.length>=3?(n=new nt({x:e.x,y:e.y,points:s.points.flatMap(l=>[l.x,l.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),o=e.x+s.points.reduce((l,c)=>l+c.x,0)/s.points.length,r=e.y+s.points.reduce((l,c)=>l+c.y,0)/s.points.length):n=new rt({x:e.x,y:e.y,width:s.width,height:s.height,offsetX:s.width/2,offsetY:s.height/2,rotation:s.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),n.setAttr("seatId",e.id),this.circleById.set(e.id,n),t.add(n);let a=new Ie({x:o,y:r,text:e.displayLabel??e.label,fontSize:Re,fontStyle:"600",fontFamily:this.labelFont(),fill:this.theme.seatLabelColor??Vt,listening:!1,perfectDrawEnabled:!1});a.offsetX(a.width()/2),a.offsetY(a.height()/2),a.visible(!1),this.hasBoothText=!0,this.boothLabelById.set(e.id,a),t.add(a),this.paintSeat(n,e.id)}buildAccessGlyph(e,t){let s=this.seatR*1.5/re;return new xn({x:e.x,y:e.y,data:si(e.accessibility??[])??"",offsetX:re/2,offsetY:re/2,scaleX:s,scaleY:s,fill:oi(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1})}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[t,s]of this.accessGlyphById){let o=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1,r=this.seatR*1.5/re*o,a=this.accessGlyphFilterEmphasized(t)?Os:_s,l=Math.max(r,a/(re*Math.max(e,.001)));s.scale({x:l,y:l}),s.visible(this.accessGlyphShouldShow(t))}}accessGlyphFilterEmphasized(e){let t=this.seatById.get(e),s=this.accessFilter;return!!t&&s!==null&&!!t.accessibility?.includes("wheelchair")&&(s.length===0||s.includes("wheelchair"))&&wi(t,s)}accessGlyphShouldShow(e){return this.accessGlyphById.has(e)&&this.accessGlyphEligible(e)}accessGlyphEligible(e){let t=this.statusById.get(e)??"free";return!(t==="booked"||t==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??Dt[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Vt}seatLabelInk(e,t){let s=t.fill();return q(typeof s=="string"?s:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let s=this.seatById.get(t),o=this.statusById.get(t)??"free",r=this.selection.has(t),n=this.categoryDisplayColor(s.categoryKey),a=this.boothLabelById.get(t);switch(e.dash([]),e.strokeWidth(0),e.stroke(""),e.opacity(1),o){case"free":e.fill(r&&this.effSelection===tt?me(n,.28):n);break;case"held":this.ownedHold.has(t)?(e.fill(me(n,this.effSelection===tt?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(Ft);break;case"booked":this.colorblind?(e.fill("rgba(0,0,0,0)"),e.stroke(De),e.strokeWidth(1.5),e.opacity(.9)):(e.fill(De),e.opacity(.45));break;case"not_for_sale":e.fill(De),e.stroke(Js),e.strokeWidth(1),e.dash([2,2]);break}if(this.seatMarks.paint(e,t,o,n,this.seatR,this.colorblind,this.seatInClosedSection(t)),s.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Jt(s.accessibility)),e.strokeWidth(r?3:2),e.dash([3,2])),a&&(a.text(o==="booked"?"SOLD":o==="held"?"HELD":s.label),a.fontSize(o==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(s.rowId)?.width??40)/6)),a.fontStyle(o==="free"?"600":"800"),a.fill(o==="free"?this.theme.seatLabelColor??Vt:"#ffffff"),a.offsetX(a.width()/2),a.offsetY(a.height()/2)),this.accessFilter&&o==="free"&&!r&&!wi(s,this.accessFilter)&&e.opacity(.25),this.categoryHighlight&&o==="free"&&!r&&s.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&o==="free"&&!r&&!this.categoryFilter.has(s.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&o==="free"&&!r&&(s.commercial?.restrictedView||s.commercial?.obstructedView)&&e.opacity(.22),this.dimmedSections.size){let h=this.seatSection.get(t);(h?this.dimmedSections.has(h.id)||this.dimmedSections.has(h.logicalId)||h.zone!=null&&this.dimmedSections.has(h.zone):this.dimmedSections.has(Qi))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(eo),e.stroke(""),e.strokeWidth(0),e.dash([]),e.opacity(to)),this.selectionFocusId&&t!==this.selectionFocusId&&e.opacity(Math.min(e.opacity(),.16));let l=this.boothLabelById.get(t)??this.seatLabelById.get(t);l&&(l.fill(this.seatLabelInk(s,e)),l.visible(pe(l.fontSize(),this.effScale())&&e.opacity()>=.5));let c=this.accessGlyphById.get(t);if(c){let h=e.fill();c.fill(oi(typeof h=="string"?h:"")),c.opacity(e.opacity()),c.visible(this.accessGlyphShouldShow(t))}this.accessRingById.get(t)?.opacity(e.opacity())}seatInClosedSection(e){if(!this.closedSections.size)return!1;let t=this.seatSection.get(e);return!!t&&(this.closedSections.has(t.id)||this.closedSections.has(t.logicalId)||t.zone!=null&&this.closedSections.has(t.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(let t of this.seats){let s=this.circleById.get(t.id);s&&this.paintSeat(s,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let t=new Set(e??[]);if(!(t.size===this.dimmedSections.size&&[...t].every(s=>this.dimmedSections.has(s)))){this.dimmedSections=t;for(let s of this.seats){let o=this.circleById.get(s.id);o&&this.paintSeat(o,s.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){let t=new Set(e??[]);t.size===this.closedSections.size&&[...t].every(s=>this.closedSections.has(s))||(this.closedSections=t,this.repaintSectionsAndSeats())}focusSection(e){this.sections.some(t=>t.id===e||t.logicalId===e)&&(this.focusedSectionId=e,this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),this.focusSectionCamera(e))}focusSectionCamera(e,t=!0){let s=this.sectionBounds(e);if(!s)return;let o=this.sectionMembers(e).map(a=>this.seatById.get(a)).filter(a=>a!=null),r=o.filter(a=>(this.statusById.get(a.id)??"free")==="free"||this.ownedHold.has(a.id)),n=this.narrowSeatDetailFocus(r.length?r:o,s);this.focusRegion(n?.bounds??s,{animate:t,minScale:n?.minScale})}releaseSectionFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,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}drawFocusBackdrop(e){this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null);let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(!t.length)return;let s=new Te({listening:!1});for(let o of t){let r=this.viewMode==="perspective"&&o.perspectiveAffine,n=r?o.outline.map(l=>this.perspectiveLocalPoint(this.projectedSectionPoint(o,l))):o.outline,a=r?o.holes.map(l=>l.map(c=>this.perspectiveLocalPoint(this.projectedSectionPoint(o,c)))):o.holes;s.add(He(n,a,{fill:io,stroke:oe("#ffffff",.1),strokeWidth:1,listening:!1},r?void 0:o.outlinePath))}this.bgLayer.add(s),s.moveToTop(),this.focusBackdrop=s,this.drawFocusDimOverlay(t)}drawFocusDimOverlay(e){this.focusDimOverlay?.destroy();let s=Math.max(this.bounds.width,this.bounds.height,1)*4+1e3,o=[{x:this.bounds.x-s,y:this.bounds.y-s},{x:this.bounds.x+this.bounds.width+s,y:this.bounds.y-s},{x:this.bounds.x+this.bounds.width+s,y:this.bounds.y+this.bounds.height+s},{x:this.bounds.x-s,y:this.bounds.y+this.bounds.height+s}],r=new En({fill:this.canvasBackground,opacity:1-_e,listening:!1,perfectDrawEnabled:!1,sceneFunc:(n,a)=>{let l=c=>{if(c.length){n.moveTo(c[0].x,c[0].y);for(let h=1;h<c.length;h++)n.lineTo(c[h].x,c[h].y);n.closePath()}};n.beginPath(),l(o);for(let c of e){let h=this.viewMode==="perspective"&&c.perspectiveAffine?c.outline.map(p=>this.perspectiveLocalPoint(this.projectedSectionPoint(c,p))):c.outline.map(p=>{let u=c.liftWorld>0?this.isoLiftLocal(c.liftWorld):{x:0,y:0};return{x:p.x+u.x,y:p.y+u.y}});l($e(h)>0?[...h].reverse():h)}n.fillStrokeShape(a)}});this.overlayLayer.add(r),r.moveToTop();for(let n of this.selectionMarkers.values())n.moveToTop();this.hoverRing.moveToTop(),this.focusRing.moveToTop(),this.focusDimOverlay=r}repaintSectionsAndSeats(){for(let e of this.seats){let t=this.circleById.get(e.id);t&&this.paintSeat(t,e.id)}for(let e of this.sections)e.blockPoly.fill(this.sectionBlockFill(e));this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),t=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}}getWorldBounds(){let e=1/0,t=1/0,s=-1/0,o=-1/0,r=(n,a)=>{n<e&&(e=n),a<t&&(t=a),n>s&&(s=n),a>o&&(o=a)};for(let n of this.seats)r(n.x,n.y);for(let n of this.sections)for(let a of n.outline)r(a.x,a.y);for(let n of this.gaById.values())for(let a of n.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:t,width:Math.max(1,s-e),height:Math.max(1,o-t)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(t=>{let s=this.isSectionClosed(t)||t.free<=0,o=t.memberIds.some(n=>this.selection.has(n)),r=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(n=>({...n})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:o?"selected":s?"inactive":"available",active:r}});return{sections:e,seats:e.length?[]:this.seats.map(t=>({x:t.x,y:t.y,categoryKey:t.categoryKey,state:this.selection.has(t.id)?"selected":this.statusById.get(t.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let t=this.worldToScreen(e);this.stage.position({x:this.stage.x()+this.stage.width()/2-t.x,y:this.stage.y()+this.stage.height()/2-t.y}),this.afterViewChange(),this.stage.batchDraw()}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(let t of this.seats){let s=this.circleById.get(t.id);s&&this.paintSeat(s,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){let t=Ee(e);t&&this.renderBackgroundImage(t);for(let s of e.objects)s.type==="decorImage"&&this.renderDecorImage(s);for(let s of e.objects)s.type==="section"&&this.renderSection(s);for(let s of e.objects)s.type==="shape"?this.renderShape(s):s.type==="gaArea"?this.renderGA(s):s.type==="table"?this.renderTable(s):s.type==="text"&&this.renderText(s);this.renderZones(e)}trackAssetImage(e,t,s,o){let r=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let n=new Promise(a=>{let l=!1,c=()=>{l||(l=!0,this.assetCancels.delete(h),a())},h=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(h),e.onload=()=>{if(!this.exportMode){r===this.assetGeneration&&o(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{r===this.assetGeneration&&o()}).catch(()=>{r===this.assetGeneration&&this.assetErrors.push(`${s} could not be decoded.`)}).finally(c)},e.onerror=()=>{r===this.assetGeneration&&this.assetErrors.push(`${s} could not be loaded.`),c()},e.src=t});this.assetPromises.push(n)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){if(!e.url||e.visible===!1)return;let t=new window.Image;this.trackAssetImage(t,e.url,"Buyer background image",()=>{let s=t.naturalWidth||4,o=t.naturalHeight||3,r=e.crop??{x:0,y:0,width:1,height:1},n=Math.max(0,Math.min(.99,r.x)),a=Math.max(0,Math.min(.99,r.y)),l={x:n,y:a,width:Math.max(.01,Math.min(1-n,r.width)),height:Math.max(.01,Math.min(1-a,r.height))},c=e.width,h=c*(o*l.height/(s*l.width)),p=new Rn({image:t,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:h/2,width:c,height:h,rotation:e.rotation??0,crop:{x:l.x*s,y:l.y*o,width:l.width*s,height:l.height*o},opacity:e.opacity,listening:!1});this.bgLayer.add(p),p.moveToBottom(),this.bgLayer.batchDraw()})}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,labelFont:()=>this.labelFont(),trackAssetImage:(e,t,s,o)=>this.trackAssetImage(e,t,s,o),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){Po(this.objectDrawContext,e)}renderTable(e){xo(this.objectDrawContext,e)}renderText(e){Ro(this.objectDrawContext,e)}renderShape(e){Eo(this.objectDrawContext,e)}renderGA(e){Ao(this.objectDrawContext,e)}renderSection(e){let t=ut(e.outline,e.holes),s=le(this.canvasBackground),o=[],r=new Map,n=0,a=K(e.outline),l=this.seatIndex?vt(this.seatIndex,a).map(I=>this.seatById.get(I)).filter(I=>!!I):this.seats;for(let I of l)this.seatSection.has(I.id)||te(I,e.outline,e.holes)&&(o.push(I.id),r.set(I.categoryKey,(r.get(I.categoryKey)??0)+1),(this.statusById.get(I.id)??"free")==="free"&&n++);let c=e.color??ii([...r].map(([I,R])=>({hex:this.catColor.get(I)??"#6e7bff",w:R})),"#3a4358"),h=Ki(e.elevation),p=dt(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),u=p.height*xe,m=new Te({listening:!1});this.bgLayer.add(m);let f=new Te({listening:!1});m.add(f);let y=new et({listening:!0});this.seatLayer.add(y);let d=[];if(u>0){let I=de(this.zoneColor.get(e.zone??"")??c,.42);for(let R=0;R<e.outline.length;R++){let E=new nt({points:[],closed:!0,fill:I,stroke:oe("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});d.push(E),m.add(E)}}f.moveToTop();let g=f,b=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=He(e.outline,e.holes,{stroke:oe(b,.5),strokeWidth:1,fill:oe(b,.08),listening:!1},e.outlinePath);g.add(S);let k=He(e.outline,e.holes,{fill:s.sectionFill,stroke:s.sectionStroke,strokeWidth:Rt,opacity:0,listening:!1},e.outlinePath);g.add(k);let w=e.labelPresentation?.labelStyle,T=w?.color??s.sectionInk,C=(w?.size??18)/18,P=new Ie({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*C,fontStyle:fi,fontFamily:this.labelFont(),fill:q(s.sectionFill,T),listening:!1,perfectDrawEnabled:!1});P.offsetX(P.width()/2),P.offsetY(P.height()/2),g.add(P);let M=new Ie({x:t.x,y:t.y,text:Z("map.seatsLeft",{count:n}),fontSize:12,fontStyle:mi,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:s.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});M.offsetX(M.width()/2),g.add(M);let v={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:t,labelAnchors:co(e.outline,e.holes??[],t),memberCategoryKeys:new Set(o.map(I=>this.seatById.get(I)?.categoryKey).filter(Boolean)),labelArea:Wi(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:n,baseFill:c,outlineTint:b,outlinePoly:S,blockPoly:k,nameLabel:P,subLabel:M,preferredInk:T,labelScale:C,nameLabelFits:!1,subLabelFits:!0,elevation:h,liftWorld:u,rakeDeg:p.rake,surfaceFocal:o.length?{...this.seatById.get(o[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:m,bgZIndex:m.zIndex(),seatZIndex:y.zIndex(),liftGroupBg:f,liftGroupSeat:y,sideFaces:d},L=o.map(I=>this.seatById.get(I)).filter(I=>!!I),x=L.length?L:e.outline;v.frontDistanceWorld=Math.min(...x.map(I=>Math.hypot(I.x-v.surfaceFocal.x,I.y-v.surfaceFocal.y)));for(let I of o)this.seatSection.set(I,v);this.refreshSectionFill(v),this.refreshSectionHeat(v),this.sections.push(v)}refreshSectionHeat(e){Do(this.sectionLodPaintContext,e)}refreshSectionFill(e){_o(this.sectionLodPaintContext,e)}isSectionClosed(e){return Mi(this.sectionLodPaintContext,e)}sectionAvailabilityState(e){return Pi(this.sectionLodPaintContext,e)}sectionBlockFill(e){return Oe(le(this.canvasBackground),this.sectionAvailabilityState(e))}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.floorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){if(!e.zones?.length||!this.sections.length)return;let t=new Map;for(let s of this.sections)s.zone&&(t.get(s.zone)??t.set(s.zone,[]).get(s.zone)).push(s);for(let s of e.zones){let o=t.get(s.id);if(!o||!o.length)continue;let r=o[0];for(let u of o)u.centroid.y<r.centroid.y&&(r=u);let n=r.centroid.x,a=r.centroid.y,l=1/0;for(let u of o)for(let m of u.memberIds){let f=this.seatById.get(m),y=f&&this.catPrice.get(f.categoryKey);typeof y=="number"&&y<l&&(l=y)}let c=new rt({x:n,y:a,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:Si,stroke:s.color??r.outlineTint,strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});this.bgLayer.add(c);let h=new Ie({x:n,y:a,text:s.label.toUpperCase(),fontSize:Et,fontStyle:fi,letterSpacing:.5,fontFamily:this.labelFont(),fill:"#f4f6fb",opacity:0,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2),this.bgLayer.add(h);let p=null;isFinite(l)&&(p=new Ie({x:n,y:a,text:Z("map.fromPrice",{price:li(l,this.currency)}),fontSize:At,fontStyle:mi,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:"#cbd5e1",opacity:0,listening:!1,perfectDrawEnabled:!1}),p.offsetX(p.width()/2),this.bgLayer.add(p)),this.zones.push({id:s.id,anchor:{x:n,y:a},back:c,background:Si,label:h,sub:p})}}screenToWorld(e){let t=this.stage.scaleX(),s={x:(e.x-this.stage.x())/t,y:(e.y-this.stage.y())/t};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?ie(this.perspectiveBaseInverse,s):this.isoT===0?s:this.isoInverse(s)}sectionAt(e){if(!this.sections.length)return null;let t=this.screenToWorld(e),s=this.sections.find(o=>{if(this.viewMode==="perspective"&&o.perspectiveAffine)return te(t,o.outline.map(n=>this.perspectiveLocalPoint(this.projectedSectionPoint(o,n))),o.holes.map(n=>n.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(o,a)))));let r=o.liftWorld>0?this.isoLiftLocal(o.liftWorld):{x:0,y:0};return te({x:t.x-r.x,y:t.y-r.y},o.outline,o.holes)});return s?s.logicalId:null}sectionMembers(e){return[...new Set(this.sections.filter(t=>t.id===e||t.logicalId===e||t.zone===e).flatMap(t=>t.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)?!1:(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")}toggleSeat(e){if(this.selection.has(e)){this.setSelected(e,!1);let t=this.seatById.get(e);t&&this.opts.onDeselect?.(t)}else{if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);return}this.setSelected(e,!0);let t=this.seatById.get(e);t&&this.opts.onSelect?.(t)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?ti(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let s=ti(getComputedStyle(t).backgroundColor);if(s)return s;t=t.parentElement}}return Li}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:Xe(this.canvasBackground)?Lo:tt}setSelected(e,t,s=!1){let o=this.circleById.get(e);t?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),o&&(this.paintSeat(o,e),!s&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){if(this.selectionMarkers.get(e)?.destroy(),this.selectionMarkers.delete(e),!this.selection.has(e)&&!this.ownedHold.has(e))return;let t=this.seatById.get(e);if(!t)return;let s=this.circleById.get(e)?.fill(),o=q(typeof s=="string"?s:"",this.effSelection,St),r=this.selectionFocusId===e,n=this.boothDims.get(t.rowId),a=this.renderedSeatPoint(t),l=new Te({name:"selection-ring",x:a.x,y:a.y,rotation:n?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:this.selectionFocusId&&!r?.2:1});if(this.viewMode==="perspective"){let h=this.perspectiveSeatScale.get(e)??1;l.scale({x:h,y:h})}l.setAttrs({seatId:e,ringColor:o});let c={stroke:o,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(n)if(l.add(new rt({...c,width:n.width,height:n.height,offsetX:n.width/2,offsetY:n.height/2,cornerRadius:4,strokeWidth:r?4:3})),r)l.add(new rt({...c,width:n.width+10,height:n.height+10,offsetX:(n.width+10)/2,offsetY:(n.height+10)/2,cornerRadius:7,strokeWidth:2,opacity:.55}));else{let h=Math.max(0,n.width/2-14),p=-Math.max(0,n.height/2-14);l.add(new Ce({x:h,y:p,radius:10,fill:o,listening:!1})),l.add(new nt({x:h,y:p,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:Xe(o)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else l.add(new Ce({...c,radius:Math.max(1,this.seatR-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,this.seatR*.22))})),r?l.add(new Ce({...c,radius:this.seatR+2,strokeWidth:2,opacity:.55})):l.add(new nt({points:[-this.seatR*.52,0,-this.seatR*.12,this.seatR*.4,this.seatR*.6,-this.seatR*.46],stroke:"#ffffff",strokeWidth:Math.max(2.6,this.seatR*.34),lineCap:"round",lineJoin:"round",shadowColor:"#0b1220",shadowBlur:1.5,shadowOpacity:.55,listening:!1}));this.selectionMarkers.set(e,l),this.overlayLayer.add(l)}sectionBounds(e){let t=this.sections.filter(f=>f.id===e||f.logicalId===e),s=t.map(f=>{if(this.viewMode==="perspective"&&f.perspectiveAffine)return K(f.outline.map(g=>this.projectedSectionPoint(f,g)));let y=f.liftWorld>0?this.isoLiftLocal(f.liftWorld):{x:0,y:0},d=f.outline.map(g=>{let b={x:g.x+y.x,y:g.y+y.y};return this.isoT===0?b:this.isoForward(b)});return K(d)});if(!s.length)return null;let o=Math.min(...s.map(f=>f.x)),r=Math.min(...s.map(f=>f.y)),n=Math.max(...s.map(f=>f.x+f.width)),a=Math.max(...s.map(f=>f.y+f.height)),l=new Set(t.flatMap(f=>f.memberIds));for(let f of l){let y=this.seatById.get(f);if(!y)continue;let d=this.renderedSeatPoint(y);o=Math.min(o,d.x-this.seatR),r=Math.min(r,d.y-this.seatR),n=Math.max(n,d.x+this.seatR),a=Math.max(a,d.y+this.seatR)}let c=f=>{[f.x,f.y,f.width,f.height].every(Number.isFinite)&&(o=Math.min(o,f.x),r=Math.min(r,f.y),n=Math.max(n,f.x+f.width),a=Math.max(a,f.y+f.height))},h=f=>{let y={x:f.x+f.width/2,y:f.y+f.height/2};return t.some(d=>te(y,d.outline,d.holes))};for(let{node:f,backdrop:y}of this.freeTextById.values()){let d=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});h(d)&&(c(d),y&&c(y.getClientRect({relativeTo:this.bgLayer,skipShadow:!0})))}for(let{node:f}of this.iconNodeById.values()){let y=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});h(y)&&c(y)}let p=new Ge;for(let{node:f}of this.freeTextById.values()){let y=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0,skipStroke:!0});p.insert({x:y.x-Q,y:y.y-Q,width:y.width+Q*2,height:y.height+Q*2})}for(let f of this.rowLabelPlan){let y=(f.focusKeys??[]).some(S=>S===e||t.some(k=>S===k.id||S===k.logicalId)),d=new Ie({text:f.text,fontSize:f.fontSize,fontStyle:"700",fontFamily:this.labelFont(),rotation:f.rotation,listening:!1});d.offsetX(d.width()/2),d.offsetY(d.height()/2);let g=this.resolveAutomaticRowLabelPosition(d,f,p),b=this.rowLabelBox(d,g);y&&c(b),p.insert(b),d.destroy()}let u=Math.max(n-o,a-r),m=Math.max(this.seatR*2,Math.min(24,u*.025));return{x:o-m,y:r-m,width:Math.max(1,n-o+m*2),height:Math.max(1,a-r+m*2)}}sectionFrameScale(e){let t=this.sectionBounds(e);return t?Ls(this.stage,t,this.zoomBounds()):this.stage.scaleX()}handleSeatTap(e){if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let t=this.objectFloor.get(this.seatById.get(e)?.rowId??"");if(t){this.opts.onDeckTap(t);return}}if(this.effScale()<ae&&this.sections.length){let t=this.seatSection.get(e);if(t){let s=this.focusedSectionId===t.logicalId,o=this.sectionFrameScale(t.logicalId)>this.stage.scaleX()*1.02;if(!s&&o){this.opts.onSectionTap?this.opts.onSectionTap(t.logicalId):this.focusSection(t.logicalId);return}}}this.seatMarks.has(e)&&this.opts.onHover?.(this.seatById.get(e)??null,{mark:this.seatMarks.get(e)}),this.toggleSeat(e)}nearestSeatToScreen(e,t){let s=null,o=1/0,r=this.stage.scaleX()||1;for(let n of this.seats){if(!this.selection.has(n.id)&&!this.isSelectable(n.id))continue;let a=this.worldToScreen(n),l=this.viewMode==="perspective"?this.perspectiveSeatScale.get(n.id)??1:1,c=this.seatR*r*l+t,h=Math.hypot(a.x-e.x,a.y-e.y);h<=c&&h<o&&(o=h,s=n.id)}return s}wireInteraction(){this.seatLayer.on("click tap",e=>{if(this.moved>we||this.isGhostClick(e))return;let t=Ri(e.target);t&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=Ri(e.target);if(!t)return;let s=this.seatById.get(t);if(!s)return;this.hoveredId=t,this.hoverRing.position(this.renderedSeatPoint(s));let o=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:o,y:o}),this.hoverRing.visible(!0),this.overlayLayer.batchDraw(),this.container.style.cursor="pointer",this.opts.onHover?.(s,{mark:this.seatMarks.get(t)})}),this.seatLayer.on("mouseout",()=>{this.hoveredId=null,this.hoverRing.visible(!1),this.overlayLayer.batchDraw(),this.container.style.cursor="default",this.opts.onHover?.(null,{mark:null})}),this.stage.on("wheel",e=>{e.evt.preventDefault(),this.releaseSectionFocusDim();let t=this.container.getBoundingClientRect(),s={x:e.evt.clientX-t.left,y:e.evt.clientY-t.top},o=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*N(o,.5,2),s)}),this.stage.on("click tap",e=>{if(this.moved>we||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(Ri(e.target))return;let o=this.nearestSeatToScreen(t,Pt);o&&this.handleSeatTap(o);return}if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let o=this.floorOverview?this.sectionAt(t):null,r=(o?this.objectFloor.get(o):null)??this.deckFloorAt();if(r){this.opts.onDeckTap(r);return}}if(this.sections.length){let o=this.sectionAt(t);if(o){this.opts.onSectionTap?this.opts.onSectionTap(o):this.focusRegion(o);return}}let s=Math.max(ke*1.2,this.stage.scaleX()*2.5);this.zoomAbout(s,t)})}deckFloorAt(){if(!this.objectFloor.size)return null;let e=this.stage.getPointerPosition();if(!e)return null;let t=this.screenToWorld(e),s=null,o=1/0;for(let r of this.seats){let n=this.renderedSeatPoint(r),a=n.x-t.x,l=n.y-t.y,c=a*a+l*l;c<o&&(o=c,s=r.rowId)}return s?this.objectFloor.get(s)??null:null}zoomBounds(){let e=.5*this.fitScale;return this.zones.length&&(e=Math.min(e,Fe*.9)),{min:e,max:Math.max(10*this.fitScale,4)}}zoomAbout(e,t){Ts(this.stage,e,t,this.zoomBounds())&&(this.afterViewChange(),this.stage.batchDraw())}zoomToBounds(e,t){Cs(this.stage,e,this.zoomBounds(),t),this.afterViewChange(),this.stage.batchDraw()}focusRegion(e,t){let s=typeof e=="string"?this.sectionBounds(e):e;if(!s)return;if(this.cancelGlide(),t?.animate===!1||this.reducedMotion){this.zoomToBounds(s,t?.minScale);return}let o=this.stage.width(),r=this.stage.height(),{min:n,max:a}=this.zoomBounds(),l=1.12,c=Math.min(o/(s.width*l),r/(s.height*l)),h=N(Math.max(c,t?.minScale??n),n,a),p=o/2-(s.x+s.width/2)*h,u=r/2-(s.y+s.height/2)*h,m=this.stage.scaleX(),f=this.stage.x(),y=this.stage.y();if(Math.abs(h-m)<1e-4&&Math.abs(p-f)<.5&&Math.abs(u-y)<.5){this.afterViewChange();return}let d=performance.now(),g=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let b=S=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let k=Math.min(1,(S-d)/g),w=k<.5?4*k*k*k:1-Math.pow(-2*k+2,3)/2,T=m+(h-m)*w;this.stage.scale({x:T,y:T}),this.stage.position({x:f+(p-f)*w,y:y+(u-y)*w}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),k<1?this.glideRaf=requestAnimationFrame(b):(this.glideRaf=0,this.glideInProgress=!1,this.afterViewChange())};this.glideRaf=requestAnimationFrame(b)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=ne?"seats":this.zones.length&&e<Fe?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(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,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,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,t)=>this.focusedSeatOpacity(e,t),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return wo(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(ge+ne)/2:this.seatRungScale(),s=this.stage.width(),o=this.stage.height(),r=this.getVisibleWorldRect(),n={x:r.x+r.width/2,y:r.y+r.height/2},a=n.x,l=n.y;if(e==="sections"&&this.sections.length>0){let u=this.sections.map(d=>{let g=K(d.outline);return{x:g.x+g.width/2,y:g.y+g.height/2}}),m=s/(t*2),f=o/(t*2);if(!u.some(d=>Math.abs(d.x-n.x)<=m&&Math.abs(d.y-n.y)<=f)){let d=u.reduce((g,b)=>{let S=(b.x-n.x)**2+(b.y-n.y)**2;return S<g.distance?{point:b,distance:S}:g},{point:u[0],distance:1/0});a=d.point.x,l=d.point.y}}let c=e==="seats"?this.seats.filter(u=>u.kind!=="booth"):[];if(c.length>0){let u=c[0],m=1/0;for(let f of c){let y=f.x-n.x,d=f.y-n.y,g=y*y+d*d;g<m&&(u=f,m=g)}a=u.x,l=u.y}let h=s/(t*1.12),p=o/(t*1.12);this.focusRegion({x:a-h/2,y:l-p/2,width:h,height:p})}seatRungScale(){return Math.max(this.seatLabelTargetScale()*1.05,Gs,ne*1.3)}narrowSeatDetailFocus(e,t){if(this.stage.width()>=Le||!e.length)return null;let s=this.seatRungScale(),o=1.12;if(Math.min(this.stage.width()/(t.width*o),this.stage.height()/(t.height*o))>=s)return null;let n=this.getVisibleWorldRect(),a={x:n.x+n.width/2,y:n.y+n.height/2},l=this.renderedSeatPoint(e[0]),c=1/0;for(let u of e){let m=this.renderedSeatPoint(u),f=(m.x-a.x)**2+(m.y-a.y)**2;f<c&&(l=m,c=f)}let h=this.stage.width()/(s*o),p=this.stage.height()/(s*o);return{bounds:{x:l.x-h/2,y:l.y-p/2,width:h,height:p},minScale:s}}seatLabelTargetScale(){let e=Re,t=new Ie({fontSize:ue,fontStyle:"600",fontFamily:this.labelFont(),listening:!1}),s=this.seatR*2-3;for(let o of this.seats){if(o.kind==="booth"){e=Math.min(e,Re);continue}let r=ue*this.seatLabelScale(o);t.fontSize(r),t.text(bt(o.displayLabel??o.label));let n=t.width()>s?Math.max(Ue,r*s/t.width()):r;e=Math.min(e,n)}return t.destroy(),J/Math.max(Ue,e)}afterViewChange(){this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}scheduleViewChange(){this.exportMode||this.viewChangeRaf||(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()}))}sizeLabel(e,t,s){e.fontSize(Math.max(1,t)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(s)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),Be+.01,ae):this.effScale(),t=Math.max(e,1e-4);for(let[r,n]of this.primaryFocalLabels)this.sizeLabel(r,n/t,r.y());this.hasSections?Oo(this.sectionLodPaintContext,e):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=js(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let s=!this.exportMode&&e<ne;if(this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&s){this.seatLayer.listening(!1);return}s&&!this.cached?this.cacheSeatLayer():!s&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){this.updateSeatGroupVisibility();let e=N(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0}cacheSeatLayer(){this.rebuildSeatCache(),this.seatLayer.batchDraw()}releaseSeatLayerBitmap(){let e=this.seatLayer,t=e._cache.get("canvas");t&&(Wt.Util.releaseCanvas(t.scene._canvas,t.filter._canvas,t.hit._canvas),e._cache.delete("canvas"))}forceDraw(){this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<ne?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){let e=this.assetGeneration,t=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assetPromises.slice(),...t?[t.ready.then(()=>{}),t.load("700 24px Inter").then(()=>{}),t.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assetGeneration)throw new Error("The chart changed while its export assets were loading.");if(this.assetErrors.length)throw new Error(`Export stopped because ${this.assetErrors.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(n=>n.getClientRect({relativeTo:this.stage})).filter(n=>n.width>0&&n.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(n=>n.x)),s=Math.min(...e.map(n=>n.y)),o=Math.max(...e.map(n=>n.x+n.width)),r=Math.max(...e.map(n=>n.y+n.height));return{x:t,y:s,width:Math.max(1,o-t),height:Math.max(1,r-s)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),t=this.stage.height(),s=Math.max(12,Math.min(36,Math.min(e,t)*.025)),o=()=>{let r=this.exportSceneBounds(),n=Math.max(1,e-s*2),a=Math.max(1,t-s*2),l=Math.min(n/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:(t-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 t=document.createElement("canvas");t.width=this.stage.width(),t.height=this.stage.height();let s=t.getContext("2d");if(!s)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");s.fillStyle=this.canvasBackground,s.fillRect(0,0,t.width,t.height);try{s.drawImage(e,0,0)}finally{e.width=1,e.height=1}return t}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ae):this.effScale();for(let{node:t,backdrop:s,kind:o}of this.freeTextById.values()){if(o==="ga-label"||o==="ga-capacity")continue;let n=o==="free-text"&&this.nodeBelongsToFocusedSection(t)||pe(t.fontSize(),e);t.visible(n),s?.visible(n)}for(let{node:t,fontSize:s}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||pe(s,e))}nodeBelongsToFocusedSection(e){let t=this.focusedSectionId;if(!t)return!1;let s=this.sections.filter(n=>n.id===t||n.logicalId===t||n.zone===t);if(!s.length)return!1;let o=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),r={x:o.x+o.width/2,y:o.y+o.height/2};return s.some(n=>te(r,n.outline,n.holes))}buildRowLabelPlan(e){this.rowLabelPlan=Bo(e,{theme:this.theme,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,s=Q){return Ii(e,t,s)}resolveAutomaticRowLabelPosition(e,t,s){return Fo(e,t,s,this.seatIndex)}objectFilteredOut(e){let t=e.categoryKey;return t?!!(this.categoryHighlight&&t!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(t)):!1}updateLabels(){No(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),seatMatchesFocus:e=>{let t=this.seatSection.get(e);return!!(this.focusedSectionId&&t&&this.sectionMatchesFocus(t))},labelGroup:this.labelGroup,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,t,s)=>this.resolveAutomaticRowLabelPosition(e,t,s),rowLabelBox:(e,t)=>this.rowLabelBox(e,t),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){let e=this.container.clientWidth||1,t=this.container.clientHeight||1;e===this.stage.width()&&t===this.stage.height()||(this.stage.size({width:e,height:t}),this.refitCurrentView())}startFpsLoop(){let e=t=>{this.lastFpsAt||(this.lastFpsAt=t),this.frames++;let s=t-this.lastFpsAt;s>=1e3&&(this.opts.onFps?.(Math.round(this.frames*1e3/s)),this.frames=0,this.lastFpsAt=t),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}};at.ZOOM_STEP=1.4;var Ei=at;function Qo(i,e){return new Ei(i,e)}function jo(i,e={}){let{baseMs:t=1e3,factor:s=2,maxMs:o=1/0,jitter:r=0,random:n=Math.random}=e,a=Math.min(t*s**Math.max(0,i),o);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*n())}function Jo(i,e,t){return Ke(i).map(s=>{let o=i.categories.find(r=>r.key===s.categoryKey);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)),available:ft(s).filter(r=>t(r)==="free").length,categoryKey:s.categoryKey,tiers:o?.tiers,price:o?.tiers?.[0]?.price??o?.price??0,currency:e}})}function er(i,e){let t={};for(let s of i)t[s.id]=e?{available:s.available,selected:e.get(s.id)??0}:{available:s.available};return t}function tr(i){let e={};for(let[t,s]of i.seatById)i.groupedTableBySeatId.has(t)||i.closedMembers.has(t)||(i.statusOf(t)??"free")==="free"&&(e[s.categoryKey]=(e[s.categoryKey]??0)+1);for(let t of i.groupedTablesByLabel.values()){if(t.chairs.some(o=>i.closedMembers.has(o.id)))continue;let s=t.chairs[0];s&&(i.statusOf(s.id)??"free")==="free"&&(e[t.categoryKey]=(e[t.categoryKey]??0)+t.maxOccupancy)}for(let t of i.gaAreas??[])e[t.categoryKey]=(e[t.categoryKey]??0)+t.available;return e}var Ai=["background","rowLabelColor","textColor","selectionColor"];function ir(i,e){return!i||!e?!i&&!e:Ai.every(t=>i[t]===e[t])}function lt(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function zt(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}var ye=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function sr(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var Kt=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,t){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let s=this.ref;this.pending=e.eventConfiguration(t).then(o=>{if(o.reference.id!==s.id||o.reference.version!==s.version||o.configuration.id!==s.id||o.configuration.version!==s.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return o.configuration})}return this.pending}};function or(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function rr(i,e,t,s){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let o=[],r=0,n=!1,a=!1;for(let c of t??[])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")n=!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}),n&&o.push({type:"consecutiveSeats"}),a&&o.push({type:"noOrphanSeats"}),i!=null&&r>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??i??Math.max(s,r)));if(i!=null&&l<i)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:i??l}}function An(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Bn(i){if(i.length<=1)return!1;let e=i[0]?.objectId,t=i[0]?.categoryKey;if(!e||i.some(o=>o.objectId!==e||o.categoryKey!==t))return!0;let s=i.map(o=>An(o.id)).sort((o,r)=>o-r);return s.some((o,r)=>o<0||r>0&&o!==s[r-1]+1)}function nr(i,e,t,s,o){let r=s.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,n=t??r,a=[];return t!=null&&e!==t&&a.push("numberOfPlacesToSelect"),r&&e<r&&a.push("minimumSelectedPlaces"),s.some(l=>l.type==="consecutiveSeats")&&Bn(i)&&a.push("consecutiveSeats"),s.some(l=>l.type==="noOrphanSeats")&&o()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:n,remaining:Math.max(0,n-e),seats:i,violations:a}}var Fn=10,Dn=15e3,ar=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new Kt;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.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.onVisibilityChange=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=or(e.numberOfPlacesToSelect);let t=rr(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Fn);this.selectionValidators=t.validators,this.maxSelection=t.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(s=>typeof s=="string"&&!!s))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=ji(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let s of Ai){let o=this.mapTheme[s];o&&(t[s]=o)}return{...e,theme:t}}setMapTheme(e){return ir(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let t=e.getSelection().map(r=>r.id),s=this.getActiveFloorId(),o=e.isFloorOverview?.()??!1;return e.setChart(this.visibleDoc(),s?{floorId:s}:void 0),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),t.length&&e.select?.(t),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let t=e.filter(o=>typeof o=="string");if(t.length===this.hidden.size&&t.every(o=>this.hidden.has(o)))return!1;this.hidden=new Set(t);let s=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),s&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let t=(e??[]).filter(s=>typeof s=="string");return t.length===this.closedSections.size&&t.every(s=>this.closedSections.has(s))?!1:(this.closedSections=new Set(t),this.renderer?.setClosedSections?.(t),!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 t=this.groupedTablesByLabel.get(e);if(t)return t.chairs.map(o=>o.id);let s=this.labelToId.get(e);return s?[s]:[]}idsForLabels(e){return[...new Set([...e].flatMap(t=>this.idsForLabel(t)))]}tableSelection(e){let t=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return t?this.toTableSeat(t):null}lineItemDisplay(e){if(e.objectType==="ga"){let o=this.visibleDoc(),r=Ke(o).find(n=>n.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 t=this.labelToSeat.get(e.label),s=t?this.seatContext.get(t.id):void 0;return{...t?.displayLabel?{displayLabel:t.displayLabel}:{},...s?.displayType?{displayType:s.displayType}:{}}}async render(e){if(this.renderer)return null;let t=performance.now(),s={},o=v=>Math.round((performance.now()-v)*100)/100;this.closed=!1;let r=performance.now(),n=(async()=>this.api.chart(this.key))().then(v=>({ok:!0,res:v,elapsed:o(r)}),v=>({ok:!1,error:v,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(v=>({ok:!0,objects:v,elapsed:o(a)}),()=>({ok:!1,elapsed:o(a)})),c=await n;if(s.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let h=c.res;if(this.closed)return null;this._doc=sr(h.doc,h.event.eventConfiguration),this.eventConfiguration.reset(h.event.eventConfiguration);let p=performance.now();try{let v=ks(h.doc,h.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(v.map(L=>[L.objectId,L])),this.groupedTablesByLabel=new Map(v.map(L=>[L.label,L])),this.groupedTableBySeatId=new Map(v.flatMap(L=>L.chairs.map(x=>[x.id,L]))),this.tableQuantities=new Map(v.map(L=>[L.label,L.mode==="whole"?L.capacity:L.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=v.reduce((L,x)=>L+Math.max(0,x.chairs.length-1),0)}catch(v){return this.emitError(v),null}this.labelToId=new Map,this.labelToSeat=new Map,this.seatById=new Map,this.seatContext=new Map,this.allIds=[];let u=new Map(Xi(h.doc).map(v=>[v.id,v])),m=ei(h.doc),f=new Map([...m.sections,...m.ungrouped?[m.ungrouped]:[]].map(v=>[v.id,v.label]));this.expandedSeats=ze(h.doc);for(let v of this.expandedSeats){this.labelToId.set(v.label,v.id),this.labelToSeat.set(v.label,v),this.seatById.set(v.id,v),this.allIds.push(v.id);let L=u.get(v.rowId),x=L&&"label"in L&&typeof L.label=="string"?L.label:void 0,I=L?.type==="row"?L.segmentedRow:void 0,R=I?.displayLabel??(L&&"displayLabel"in L&&typeof L.displayLabel=="string"&&L.displayLabel?L.displayLabel:x),E=this.groupedTablesByObject.get(v.rowId),B=L?.type==="table"?"table":L?.type==="booth"?"booth":"seat",z=R,O=I?.displayType?.trim()||(L&&"displayType"in L&&typeof L.displayType=="string"&&L.displayType.trim()?L.displayType.trim():void 0),D=v.displayLabel??v.label,X=D.split("-"),F=E||v.kind==="booth"?void 0:R&&D.startsWith(`${R}-`)?D.slice(R.length+1):X[X.length-1]??D;this.seatContext.set(v.id,{objectId:v.rowId,objectType:B,sectionLabel:f.get(m.objectToSection.get(v.rowId)??""),rowLabel:z,seatNumber:F,...O?{displayType:O,rowType:O}:{}})}for(let v of this.groupedTablesByLabel.values()){let L=v.chairs[0];L&&(this.labelToId.set(v.label,L.id),this.labelToSeat.set(v.label,L))}s.normalizeBuyerModel=o(p);let y=h.event.currency??this.opts.currency;this.currency=y??"USD";let d=performance.now(),g=Qo(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:y,onSelect:v=>{this.handleRendererSelect(v)},onDeselect:v=>{this.handleRendererDeselect(v)},onSelectionLimit:this.opts.onSelectionLimit,onHover:v=>{this.opts.onHover?.(v),this.opts.onSeatHover&&this.opts.onSeatHover(v?this.describeSeat(v):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:v=>this.handleSectionTap(v),onDeckTap:v=>this.handleDeckTap(v),onFps:this.opts.onFps});if(s.createRenderer=o(d),this.closed)return g.destroy(),null;this.renderer=g;let b=null,S="free",k=[],w=await l;if(w.ok){let v=w.objects;this.hidden=new Set(v.hidden??[]),k=(v.closed??[]).filter(L=>typeof L=="string"),b=v.seats,S=v.default??"free"}if(s.loadStatuses=w.elapsed,this.closed)return g.destroy(),this.renderer=null,null;let T=performance.now();g.setChart(this.visibleDoc()),(h.doc.floors?.length??0)>1&&g.setFloorOverview?.(!0),this.opts.colorblindSafe&&g.setColorblindSafe?.(!0),s.buildScene=o(T),this.closedSections=new Set(k);let C=performance.now();k.length&&g.setClosedSections?.(k),b&&this.applySeatsMap(b,S),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),s.applyInitialState=o(C);let P=performance.now();g.forceDraw(),s.firstPaint=o(P);let M=performance.now();return this.attachVisibilityListener(),this.connect(),s.startRealtime=o(M),s.controllerTotal=o(t),{doc:h.doc,salesClosed:!!h.event.salesClosed,eventName:h.event.name,venue:h.event.venue,startsAt:h.event.startsAt,timezone:h.event.timezone??null,currency:y,mode:h.event.mode??"live",locale:h.event.locale??null,posterUrl:h.event.posterUrl??null,performanceProfile:s}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let s of this.renderer.getSelection()){let o=this.groupedTableBySeatId.get(s.id);o?t.has(o.label)||(t.add(o.label),e.push(this.toTableSeat(o))):e.push(this.toSeat(s))}return e}seatDetails(e){let t=this.seatById.get(e);return t?this.describeSeat(t):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let t=new Set;for(let s of e){let o=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(o)o.chairs.forEach(r=>t.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(s)?s:this.labelToId.get(s);r&&t.add(r)}}this.renderer?.deselect([...t]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let t=new Set(this.getSelection().map(n=>n.label)),s=new Set,o=[];for(let n of e){let a=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(a)this.tableTierResolution(a).kind==="invalid"?o.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&s.add(c.id)});else{let l=this.seatById.has(n)?n:this.labelToId.get(n);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?o.push(c.label):s.add(l)}}if(o.length&&this.emitError(new ye(ni(o))),!s.size)return[];if(this.renderer?.select?.([...s]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...s]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(n=>!t.has(n.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let t=new Set(e);return this.select([...this.seatById.values()].filter(s=>t.has(s.categoryKey)).map(s=>s.id))}deselectCategories(e){let t=new Set(e);this.deselect(this.getSelection().filter(s=>t.has(s.categoryKey)).map(s=>s.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(s=>typeof s=="string"&&!!s))],this.rebuildSelectableSeatIds();let t=this.renderer?.getSelection().filter(s=>!this.isSelectableByPolicy(s.id)).map(s=>s.id)??[];t.length&&this.deselect(t)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let t=this.getSelection(),s=e??t.reduce((o,r)=>o+(r.quantity??1),0);return nr(t,s,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let t=new Set(e.getSelection().map(s=>s.id));return t.size>0&&ri(this.seatById.values(),s=>e.getStatus(s),t).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let t of this.selectableObjectRefs){let s=this.groupedTableBySeatId.get(t)??this.groupedTablesByLabel.get(t);if(s){s.chairs.forEach(r=>e.add(r.id));continue}let o=this.seatById.has(t)?t:this.labelToId.get(t);o&&e.add(o)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,t){let s=this.groupedTablesByLabel.get(e);if(!s)return!1;let o=s.mode==="whole"?s.capacity:Math.floor(t);if(!Number.isInteger(o)||o<s.minOccupancy||o>s.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??s.minOccupancy;return this.tableQuantities.set(e,o),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(s.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,s){let o=this.groupedTablesByLabel.get(e),r=this.hold_;if(!o||o.mode!=="variable"||!r?.labels.includes(e))return null;let n=Math.floor(t);if(!Number.isInteger(n)||n<o.minOccupancy||n>o.maxOccupancy)return null;if((r.items??[]).filter(h=>h.label!==e).reduce((h,p)=>h+(p.quantity??1),0)+n>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(h=>({label:h.label,tierId:h.tierId,quantity:h.label===e?n:h.quantity}));if(!l.some(h=>h.label===e))return null;let c=await this.api.hold(this.key,l,s,r.holdId);return this.tableQuantities.set(e,n),this.setHold({holdId:c.holdId,labels:l.map(h=>h.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,t)=>e+(t.quantity??1),0)}handleRendererSelect(e){let t=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(t?t.chairs.map(o=>o.id):[e.id]),this.emitSelectionChange();return}if((t?this.tableTierResolution(t):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(t?t.chairs.map(o=>o.id):[e.id]),this.emitError(new ye(ni([t?.label??e.label]))),this.emitSelectionChange();return}if(t){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(t.chairs.map(o=>o.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(t.chairs.map(o=>o.id)),this.opts.onSelect?.(t.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(t)),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 t=this.groupedTableBySeatId.get(e.id);t?(this.renderer?.deselect(t.chairs.map(s=>s.id)),this.hold_?.labels.includes(t.label)||(this.tableQuantities.set(t.label,t.mode==="whole"?t.capacity:t.minOccupancy),t.mode==="variable"&&this.confirmedVariableTables.delete(t.label)),this.opts.onDeselect?.(t.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 t of e){let s=this.groupedTablesByLabel.get(t);s&&(this.tableQuantities.set(t,s.mode==="whole"?s.capacity:s.minOccupancy),s.mode==="variable"&&this.confirmedVariableTables.delete(t))}}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}}async hold(e,t){if(!this.renderer)return null;let o=e??this.getSelection().map(l=>l.label),r=(this.hold_?.items??[]).filter(l=>l.objectType==="ga"),n=[...new Set([...r.map(l=>l.label),...o])];if(!n.length)return null;let a=this.ticketIssue(n);if(a)throw new ye(a);if(this.hold_&&this.holdCovers(n))return this.hold_;try{let l=n.map(h=>{let p=r.find(f=>f.label===h);if(p)return{label:h,tierId:p.tierId,quantity:p.quantity};let u=this.labelToSeat.get(h),m=u?this.toSeat(u):null;return{label:h,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),c=await this.api.hold(this.key,l,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:n,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(l){throw this.handle409Conflicts(l),l}}async resumeHold(e){if(this.closed||!e||!this.api.resume)return null;let t=await this.api.resume(this.key,e);if(this.closed)return null;let s=[...new Set(t.items.map(o=>o.label))];return s.length?(this.setHold({holdId:t.holdId,labels:s,expiresAt:t.expiresAt,items:t.items},"restored"),this.hold_):null}async extendHold(e){let t=this.hold_;if(!t||!this.api.extend)return null;try{let s=await this.api.extend(this.key,t.holdId,e);return this.hold_?.holdId!==t.holdId?this.hold_:(this.setHold({holdId:t.holdId,labels:t.labels,expiresAt:s.expiresAt,items:t.items}),this.hold_)}catch{return null}}categoryAvailability(){return tr({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,t=this.renderer;if(!t||!this.closedSections.size)return e;for(let s of this.closedSections)for(let o of t.sectionMembers?.(s)??[])e.add(o);return e}getGAAreas(){let e=this.visibleDoc();return e?Jo(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(er(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,s={}){let o=this.visibleDoc();if(!o||!Number.isFinite(t)||t<1)return null;let r=Ke(o).find(h=>h.id===e);if(!r)return null;let n=ft(r).filter(h=>!this.hold_?.labels.includes(h)&&this.statusOf(h)==="free").slice(0,Math.floor(t));if(n.length!==Math.floor(t))return null;let a=new Map;for(let h of this.hold_?.items??[])a.set(h.label,{label:h.label,tierId:h.tierId,quantity:h.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let h of this.hold_.seats)a.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{}});for(let h of this.getSelection())a.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{},...this.tableQuantityRequest(h)});for(let h of n)a.set(h,{label:h,...s.tierId?{tierId:s.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,s.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(h=>h.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(){let e=this.visibleDoc();if(!e?.zones?.length)return[];let t=new Set(ei(e).sections.filter(s=>s.seatCount>0&&!!s.zone).map(s=>s.zone));return e.zones.filter(s=>t.has(s.id)).map(s=>({id:s.id,label:s.label}))}pickPremiumBlock(e,t,s){let o=this.visibleDoc();if(!o?.objects?.length)return null;let r=o.focalPoint??{x:0,y:0},n=new Set(this.groupedTablesByObject.keys()),a=ze(o).filter(u=>!n.has(u.rowId)),l=new Set(this.hold_?.labels??[]),c=new Set;for(let u of a){if(l.has(u.label)||this.seatTierResolution(u).kind==="invalid")continue;let m=this.labelToId.get(u.label);((m?this.getStatus(m):void 0)??"free")==="free"&&c.add(u.label)}let h=bs(a,c,{qty:e,categoryKey:t,zoneId:s,focal:r,preferPremium:!0});return h.labels.length!==e?null:h.labels.every(u=>this.labelToSeat.get(u)?.commercial?.premium)?[...h.labels]:null}async bestAvailable(e,t,s={}){let o=this.renderer;if(!o)return null;if(s.preferPremium){let r=this.pickPremiumBlock(e,t,s.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let n=r.map(h=>{let p=this.labelToSeat.get(h),u=p?this.toSeat(p):null;return{label:h,...u?.tierId?{tierId:u.tierId}:{}}}),a=await this.api.hold(this.key,n,s.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(h=>this.labelToSeat.get(h)).filter(h=>!!h).map(h=>this.toSeat(h));return this.opts.onSelectionChange?.(c),this.hold_}catch(n){let{status:a,reason:l}=lt(n);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),n}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,t,s.zoneId,s.ttlMs);o.clearSelection();let n=this.idsForLabels(r.labels);n.length&&o.setStatus(n,"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:n,reason:a}=lt(r);throw n===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}async book(e,t,s){let o=this.renderer;if(!o)return null;if(!this.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let r=t??this.getSelection().map(c=>c.label);if(!r.length)return null;let n=this.ticketIssue(r);if(n)throw new ye(n);let a;try{if(this.hold_&&this.holdCovers(r))a=this.hold_.holdId;else{let c=this.hold_?.holdId,h=await this.api.hold(this.key,r.map(p=>{let u=this.labelToSeat.get(p),m=u?this.toSeat(u):null;return{label:p,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),s,c);a=h.holdId,this.setHold({holdId:a,labels:[...r],expiresAt:h.expiresAt,items:h.items})}await this.api.book(this.key,r,a,e)}catch(c){let{status:h,conflicts:p,reason:u}=lt(c);if(this.clearHold(),h===409&&u==="event_closed")this.opts.onSalesClosed?.();else if(h===409&&p?.length){let m=new Set(p.map(d=>d.label)),f=this.idsForLabels(m);f.length&&(o.setStatus(f,"booked"),o.deselect(f),this.resetTableQuantitiesForLabels(m));let y=r.filter(d=>!m.has(d));y.length&&a&&this.api.release(this.key,y,a).catch(()=>{}),this.emitSelectionChange()}else a&&this.api.release(this.key,r,a).catch(()=>{});throw c}let l=this.idsForLabels(r);return l.length&&(o.setStatus(l,"booked"),o.deselect(l)),this.clearHold(),this.resetTableQuantitiesForLabels(r),this.emitSelectionChange(),this.opts.onBook?.(e),r}async release(){let e=this.hold_;if(!e)return!0;try{let s=await this.api.release(this.key,e.labels,e.holdId);if(!this.releaseConfirmed(s,e.labels))return await this.resnapshot(),!1}catch(s){return this.emitError(s),!1}if(this.hold_?.holdId!==e.holdId)return!0;this.clearHold(),this.resetTableQuantitiesForLabels(e.labels);let t=this.idsForLabels(e.labels);return t.length&&(this.renderer?.deselect(t),this.renderer?.setStatus(t,"free")),!0}async releaseLabels(e){let t=this.hold_;if(!t)return!0;let s=e.filter(a=>t.labels.includes(a));if(!s.length)return!0;try{let a=await this.api.release(this.key,s,t.holdId);if(!this.releaseConfirmed(a,s))return await this.resnapshot(),!1}catch(a){return this.emitError(a),!1}if(this.hold_?.holdId!==t.holdId)return!0;let o=t.labels.filter(a=>!s.includes(a)),r=t.items?.filter(a=>!s.includes(a.label));o.length?this.setHold({...t,labels:o,items:r}):this.clearHold(),this.resetTableQuantitiesForLabels(s);let n=this.idsForLabels(s);return n.length&&(this.renderer?.deselect(n),this.renderer?.setStatus(n,"free")),!0}releaseConfirmed(e,t){let s=e?.released;return!Array.isArray(s)||t.every(o=>s.includes(o))}setStatus(e,t){this.renderer?.setStatus(e,t)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let t=new Set(e.categories.filter(o=>o.notForSale).map(o=>o.key));if(!t.size)return[];let s=[];for(let[o,r]of this.seatById)t.has(r.categoryKey)&&s.push(o);return s}flashSeat(e,t){this.renderer?.flashSeat(e,t)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let t=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&t&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){this.renderer?.setAccessibilityFilter?.(e)}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let t=this.renderer;!t?.setActiveFloor||e===t.getActiveFloorId?.()&&!t.isFloorOverview?.()||(t.setFloorOverview?.(!1),t.setStacked?.(!1),t.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let t=this.renderer;!t?.setStacked||e===t.isStacked?.()||(t.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let t=this.renderer;!t?.setFloorOverview||e===t.isFloorOverview?.()||(t.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let t=this.renderer;t&&(t.setViewMode?.("flat"),t.setFloorOverview?.(!1),t.setStacked?.(!1),t.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}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){let t=this.renderer;if(t){if(t.clearSectionFocus?.(),this.opts.onSectionFocus?.(null),e?.length){let s=this.floorForCategories(e);s&&this.setFloor(s)}t.focusCategories?t.focusCategories(e):t.zoomToFit()}}floorForCategories(e){let t=this._doc;if(!t?.floors||t.floors.length<2)return null;let s=new Set(e),o=a=>a.some(l=>l.type==="row"&&(s.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&s.has(c.categoryKey)))||l.type==="gaArea"&&s.has(l.categoryKey)),r=this.getActiveFloorId(),n=t.floors.find(a=>a.id===r);return n&&o(n.objects)?null:t.floors.find(a=>o(a.objects))?.id??null}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){this.handleSectionTap(e)}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}handleSectionTap(e){let t=this.renderer;if(t){if(t.focusSection?t.focusSection(e):t.focusRegion?.(e),this.isSectionClosed(e)){this.opts.onSectionFocus?.(null);return}this.opts.onSectionFocus?.(this.sectionSummary(e))}}sectionSummary(e){let t=this.renderer,s=this._doc;if(!t||!s)return null;let o=s.objects.find(f=>f.type==="section"&&f.id===e);if(!o)return null;let r=t.sectionMembers?.(e)??[],n=new Map,a=new Set,l=0;for(let f of r){let y=this.seatById.get(f);if(!y)continue;let d=this.groupedTableBySeatId.get(f);if(d){if(a.has(d.label))continue;a.add(d.label),n.set(d.categoryKey,(n.get(d.categoryKey)??0)+d.maxOccupancy),t.getStatus(d.chairs[0]?.id??f)==="free"&&(l+=d.maxOccupancy)}else n.set(y.categoryKey,(n.get(y.categoryKey)??0)+1),t.getStatus(f)==="free"&&l++}let c=[...n.entries()].map(([f,y])=>{let d=s.categories.find(k=>k.key===f),g=d?.tiers?.length?d.tiers.map(k=>k.price):[d?.price??0],b=Math.min(...g),S=Math.max(...g);return{key:f,count:y,label:d?.label??f,color:d?.color??"#6e7bff",price:b,priceMin:b,priceMax:S}}).sort((f,y)=>f.price-y.price),h=c.map(f=>f.priceMin),p=c.map(f=>f.priceMax),u=o.zone?s.zones?.find(f=>f.id===o.zone):void 0,m=o.color??u?.color??c[0]?.color??"#6e7bff";return{id:e,label:o.displayLabel??o.label,zoneLabel:u?.label??"",...o.entrance&&o.entrance.trim()?{entrance:o.entrance.trim()}:{},color:m,seatsLeft:l,priceMin:h.length?Math.min(...h):0,priceMax:p.length?Math.max(...p):0,categories:c}}destroy(){if(this.closed=!0,this.detachVisibilityListener(),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 t=this.groupedTableBySeatId.get(e.id);if(t)return this.toTableSeat(t);let s=e.commercial?{commercial:e.commercial}:void 0,o=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,n=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...s,...r,...n};let h=c.tier;return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:h.price,currency:this.currency,tiers:l,tierId:h.id,...s,...r,...n}}toTableSeat(e){let t=e.chairs[0],s=this.tiersFor(e.categoryKey)?.filter(n=>Tt(this._doc,this.tableTierSeat(e),n.id).kind==="resolved"),o=this.tableTierResolution(e),r=o.kind==="resolved"?o.tier:void 0;return{id:t?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:t?this.seatContext.get(t.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...s?{tiers: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(n=>n.id)}}describeSeat(e){let t=this._doc?.categories.find(s=>s.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:t?.label??e.categoryKey,categoryColor:t?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(t=>t.key===e)?.price??0}tiersFor(e){let t=this._doc?.categories.find(s=>s.key===e)?.tiers;return t&&t.length?t:void 0}tiersForSeat(e){if(!this._doc)return;let t=Ss(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?Tt(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(t=>t.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let t=e.chairs[0]?.id??"";return Tt(this._doc,this.tableTierSeat(e),this.seatTiers.get(t))}setSeatTier(e,t){let s=this.seatById.get(e);if(!s)return;let o=this.tiersForSeat(s);if(o){if(t==null)this.seatTiers.delete(e);else if(o.some(r=>r.id===t))this.seatTiers.set(e,t);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let t=[];for(let s of e){let o=this.labelToSeat.get(s);o&&t.push(this.toSeat(o))}return t}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 t=e?this.seatsForLabels(e):this.getSelection();return vs(this._doc,t.map(s=>({label:s.label,...s.tierId?{tierId:s.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let t=this.ticketIssue();if(t){this.hintShown=!0,this.opts.onHint(t.code==="companion_pair_required"?Z("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let s=new Set(e.getSelection().map(r=>r.id));(s.size?ri(this.seatById.values(),r=>e.getStatus(r),s):[]).length>0?(this.hintShown=!0,this.opts.onHint(Z("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){let t=this.hold_;if(!t||t.labels.length!==e.length||!e.every(r=>t.labels.includes(r)))return!1;let s=new Map((t.items??[]).map(r=>[r.label,r.tierId])),o=new Map((t.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let n=this.labelToSeat.get(r),a=n?this.toSeat(n):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||this.confirmedVariableTables.has(r))&&(!o.has(r)||o.get(r)===a.quantity))&&(!s.has(r)||s.get(r)===l)})}handle409Conflicts(e){let{status:t,conflicts:s}=lt(e);if(t!==409||!s?.length)return;let o=this.renderer;if(!o)return;let r=this.idsForLabels(s.map(n=>n.label));r.length&&(o.deselect(r),o.setStatus(r,"held"),this.resetTableQuantitiesForLabels(s.map(n=>n.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let r of e.items??[])this.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(this.tableQuantities.set(r.label,r.quantity),this.groupedTablesByLabel.get(r.label)?.mode==="variable"&&this.confirmedVariableTables.add(r.label));let s={...e,seats:this.seatsForLabels(e.labels)};this.hold_=s,this.renderer?.setOwnedHold?.(this.idsForLabels(s.labels)),this.expiryTimer&&clearTimeout(this.expiryTimer);let o=Math.max(0,s.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},o),t==="restored"?this.opts.onHoldRestored?.(s):this.opts.onHold?.(s)}clearHold(){this.hold_=null,this.renderer?.setOwnedHold?.(null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null)}async expireActiveHold(){let e=this.hold_;if(e){try{let t=await this.api.objects(this.key);if(this.hold_?.holdId!==e.holdId)return;this.applySeatsMap(t.seats,t.default??"free")}catch{this.hold_?.holdId===e.holdId&&(this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},2e3));return}if(this.hold_?.holdId===e.holdId){if(e.labels.some(t=>this.statusOf(t)==="held")){this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},1e3);return}this.clearHold(),this.opts.onHoldExpired?.()}}}applySeatsMap(e,t="free"){let s=this.renderer;if(!s)return;this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=t;let o=zt(t);this.allIds.length&&s.setStatus(this.allIds,o),s.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let r={free:[],held:[],booked:[],not_for_sale:[]};for(let[a,l]of Object.entries(e))r[zt(l)].push(...this.idsForLabel(a));["free","held","booked","not_for_sale"].forEach(a=>{a!==o&&r[a].length&&s.setStatus(r[a],a)});let n=this.notForSaleCategorySeatIds();n.length&&s.setStatus(n,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(t=>this.statusOf(t)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}async resnapshot(){try{let e=await this.api.objects(this.key);this.applySeatsMap(e.seats,e.default??"free")}catch{}}async refresh(){await this.resnapshot()}attachVisibilityListener(){if(this.onVisibilityChange||typeof document>"u"||typeof document.addEventListener!="function")return;let e=()=>{this.closed||document.visibilityState==="visible"&&this.resnapshot().then(()=>{this.closed||this.renderer?.forceDraw()})};this.onVisibilityChange=e,document.addEventListener("visibilitychange",e)}detachVisibilityListener(){this.onVisibilityChange&&(typeof document<"u"&&typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onVisibilityChange=null)}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applySeatsMap(e.exceptions,e.default),resync:()=>this.resnapshot(),onSections:(e,t)=>{let s=this.syncHidden(e),o=this.syncClosed(t);s&&this.resnapshot(),(s||o)&&this.opts.onStatusChange?.()}}}applyStatusChanges(e){let t=this.renderer;if(t){for(let s of e){this.liveStatuses.set(s.label,s.status);let o=this.idsForLabel(s.label);if(!o.length)continue;let r=zt(s.status);this.opts.flashOnLiveChange&&r!=="free"&&o.some(n=>t.getStatus(n)==="free")&&!this.hold_?.labels.includes(s.label)&&o.forEach(n=>t.flashSeat(n,r==="held"?"#f4b740":"#f43f5e")),t.setStatus(o,r)}this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&t.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let s=null;try{s=this.api.createRealtime(this.key,this.realtimeSink())}catch{s=null}if(s){this.realtime=s,s.start();return}}if(this.realtime)return;let t;try{let s=this.api.socketProtocols?.(this.key);t=s&&s.length?new WebSocket(e,s):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=t,t.onopen=()=>{this.attempt=0,this.resnapshot()},t.onmessage=s=>{let o;try{o=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}if(!this.renderer||!o||typeof o!="object")return;let n=o;Array.isArray(n.hidden)&&this.syncHidden(n.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(n.closed)&&this.syncClosed(n.closed)&&this.opts.onStatusChange?.(),n.type!=="hidden"&&(n.seats&&typeof n.seats=="object"?this.applySeatsMap(n.seats):Array.isArray(n.changes)&&this.applyStatusChanges(n.changes))},t.onclose=()=>{this.ws===t&&(this.ws=null),this.scheduleReconnect()},t.onerror=()=>{try{t.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=jo(e,{baseMs:1e3,maxMs:Dn,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var _n=5,On=-1.1,Bi=35;function Fi(i,e){let t=i-U,s=Math.atan2(_n-t,e)*180/Math.PI,o=Math.atan2(On-t,e)*180/Math.PI;return o<-Bi&&(s+=-Bi-o,o=-Bi),{topPitch:s,basePitch:o}}var $=2048,ce=1024,ht=zi,A=Math.PI*2,Gn=ce/180,Ve=i=>(i+180)/360*$,W=i=>(90-i)/180*ce;function ur(i){let e=2166136261;for(let t=0;t<i.length;t++)e^=i.charCodeAt(t),e=Math.imul(e,16777619);return e>>>0}function pr(i){let e=i>>>0;return()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var Xt=96,Oi=360/Xt,Hn=.6,Di=[17,23,42];function _i(i,e,t=1){let s=Math.max(0,Math.min(.58,e)),o=Math.round(i[0]+(Di[0]-i[0])*s),r=Math.round(i[1]+(Di[1]-i[1])*s),n=Math.round(i[2]+(Di[2]-i[2])*s);return`rgba(${o},${r},${n},${t})`}function lr(i,e,t){return[Math.round(i[0]+(e[0]-i[0])*t),Math.round(i[1]+(e[1]-i[1])*t),Math.round(i[2]+(e[2]-i[2])*t)]}function j(i,e,t){let s=(1-Math.abs(2*t-1))*e,o=(i%360+360)%360/60,r=s*(1-Math.abs(o%2-1)),n=0,a=0,l=0;o<1?[n,a,l]=[s,r,0]:o<2?[n,a,l]=[r,s,0]:o<3?[n,a,l]=[0,s,r]:o<4?[n,a,l]=[0,r,s]:o<5?[n,a,l]=[r,0,s]:[n,a,l]=[s,0,r];let c=t-s/2;return[Math.round((n+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var cr=new Map;function hr(i){if(!i)return null;let e=cr.get(i);if(e)return e;let t=2166136261;for(let r=0;r<i.length;r++)t^=i.charCodeAt(r),t=Math.imul(t,16777619);let s=(t>>>0)%360,o=j(s,.3,.42);return cr.set(i,o),o}function Nn(i,e,t,s){let o=new Array(Xt).fill(null),r=0,n=i.sectionId;for(let a of e){if(a.id===i.id)continue;let l=a.sectionId;if(!l||n&&l===n)continue;let c=a.x-i.x,h=a.y-i.y,p=Math.hypot(c,h)*ht;if(p<1.5||p>95)continue;let u=a.eyeHeightM??U,m=u-s;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,p)*180/Math.PI,y=Math.atan2(u-U-s,p)*180/Math.PI,g=((Math.atan2(c,-h)-t)*180/Math.PI+540)%360-180,b=Math.min(Xt-1,Math.max(0,Math.floor((g+180)/Oi))),S=f>34&&p<16,k=o[b];k?(f>k.top&&(k.top=f),y<k.base&&(k.base=y),p<k.nearM&&(k.nearM=p,k.tint=hr(a.categoryKey)),k.overhead=k.overhead||S):o[b]={top:f,base:y,nearM:p,overhead:S,tint:hr(a.categoryKey)}}return{bins:o,maxDelta:r}}function Vn(i,e,t,s){for(let o=0;o<Xt;o++){let r=e[o];if(!r)continue;let n=-180+o*Oi,a=t(n),l=t(n+Oi);if(!(l>a))continue;let c=Math.min(72,r.top),h=Math.min(r.base,-4),p=s(c),u=s(h);if(u<=p)continue;let m=r.nearM/95,f=r.tint,y=f?lr([44,54,80],f,.34):[44,54,80],d=f?lr([24,30,48],f,.28):[24,30,48],g=i.createLinearGradient(0,p,0,u);g.addColorStop(0,_i(y,m)),g.addColorStop(.24,_i(d,m)),g.addColorStop(1,_i([10,13,22],m)),i.fillStyle=g,i.fillRect(a,p,l-a+1,u-p),i.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,i.fillRect(a,p,l-a+1,1.5);let S=Math.min(u,s(0))-p;if(S>8){let w=1-m*.4;for(let T=1;T<6;T++){let C=p+S*T/6;i.fillStyle=`rgba(0,0,0,${.16*w})`,i.fillRect(a,C,l-a+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(a,C+1.5,l-a+1,1.2)}}if(r.overhead){let k=s(Math.min(86,c+12)),w=i.createLinearGradient(0,k,0,p);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=w,i.fillRect(a,k,l-a+1,p-k),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(a,p-1.5,l-a+1,1.5)}}}function Wn(i,e,t){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),n=new Set,a=0;for(let g of t){a++,g.sectionId&&n.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,k=Math.hypot(b,S)*ht;if(k<.5)continue;let w=Math.atan2(b,-S),T=Math.floor((w+Math.PI)/A*72);T<0?T=0:T>=72&&(T=71),o[T]=!0,k<r[T]&&(r[T]=k)}let l=0,c=[];for(let g=0;g<72;g++)o[g]&&(l++,c.push(r[g]));let h=l/72*360;c.sort((g,b)=>g-b);let p=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??p:0,m=c.length?c[Math.floor(c.length*.85)]??p:0,f=u>.5?m/u:1,y=ur(`${a}|${[...n].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),d;return h>=300&&p>11&&f>1.35?d="sport":h>=285?d="arena":d="proscenium",{mode:d,seed:y,voidRadiusM:p,aspect:f}}var zn=5;function Kn(i,e,t){switch(t){case 1:i.beginPath(),i.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,A),i.fill();break;case 2:i.beginPath(),i.ellipse(0,-e*1.02,e*.42,e*.42,0,0,A),i.fill(),i.beginPath(),i.ellipse(0,-e*.2,e*.98,e*1.02,0,0,A),i.fill();break;case 3:i.beginPath(),i.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,A),i.fill(),i.beginPath(),i.ellipse(0,-e*.52,e*1.22,e*.24,0,0,A),i.fill();break;case 4:i.beginPath(),i.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,A),i.fill(),i.beginPath(),i.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,A),i.fill(),i.beginPath(),i.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,A),i.fill();break;default:break}}function Xn(i,e,t,s,o){let r=s*.44,n=s*o.shoulderK,a=s*.66,l=s*1.68,c=s*5.4,h=`rgba(${o.clothing[0]},${o.clothing[1]},${o.clothing[2]},${o.alpha})`,p=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;i.save(),i.translate(e,t);let u=o.lean*s;i.fillStyle=h,i.beginPath(),i.moveTo(-r,a),i.quadraticCurveTo(-r*1.18,l-u-s*.6,-n,l-u),i.quadraticCurveTo(-n*1.05,l+s*1.2,-n*.94,c),i.lineTo(n*.94,c),i.quadraticCurveTo(n*1.05,l+s*1.2,n,l+u),i.quadraticCurveTo(r*1.18,l+u-s*.6,r,a),i.closePath(),i.fill(),i.fillStyle=p,i.fillRect(-r*.82,s*.5,r*1.64,s*.9),i.save(),i.rotate(o.tilt),i.translate(o.turn*s,0),i.fillStyle=p,s>=18?(i.beginPath(),i.moveTo(-s*.9,-s*.15),i.quadraticCurveTo(-s*.96,-s*1.12,0,-s*1.06),i.quadraticCurveTo(s*.96,-s*1.12,s*.9,-s*.15),i.quadraticCurveTo(s*.86,s*.55,s*.36,s*.98),i.quadraticCurveTo(0,s*1.14,-s*.36,s*.98),i.quadraticCurveTo(-s*.86,s*.55,-s*.9,-s*.15),i.closePath(),i.fill(),s>=22&&(i.beginPath(),i.ellipse(-s*.9,s*.18,s*.13,s*.22,0,0,A),i.ellipse(s*.9,s*.18,s*.13,s*.22,0,0,A),i.fill())):(i.beginPath(),i.ellipse(0,0,s*.9,s*1.06,0,0,A),i.fill()),Kn(i,s,o.hair),o.rim>.01&&(i.strokeStyle=`rgba(245,205,150,${(.5*o.rim).toFixed(3)})`,i.lineWidth=Math.max(1,s*.14),i.beginPath(),i.ellipse(0,-s*.06,s*.86,s*1,0,Math.PI*1.12,Math.PI*1.9),i.stroke()),i.restore(),o.rim>.01&&(i.strokeStyle=`rgba(240,200,150,${(.28*o.rim).toFixed(3)})`,i.lineWidth=Math.max(1,s*.12),i.beginPath(),i.moveTo(-n*.8,l-s*.05),i.quadraticCurveTo(-r,l-s*.75,0,l-s*.82),i.quadraticCurveTo(r,l-s*.75,n*.8,l-s*.05),i.stroke()),i.restore()}function $n(i,e,t,s,o,r,n){i.fillStyle=`rgba(${o[0]},${o[1]},${o[2]},${n})`,i.beginPath(),i.moveTo(e-s*1.72,t+s*4),i.quadraticCurveTo(e-s*1.78,t+s*1.55,e-s*.46,t+s*1.02),i.lineTo(e-s*.4,t+s*.62),i.lineTo(e+s*.4,t+s*.62),i.lineTo(e+s*.46,t+s*1.02),i.quadraticCurveTo(e+s*1.78,t+s*1.55,e+s*1.72,t+s*4),i.closePath(),i.fill(),i.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${n})`,i.beginPath(),i.ellipse(e,t,s*.9,s*1.05,0,0,A),i.fill()}function Hi(i,e,t,s,o){let r=s*.1,n=t-s*.9,a=t-s*.74,l=t-s*.46,c=s*.13,h=s*.09,p=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,u=i.createRadialGradient(e,t,1,e,t,s*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=u,i.beginPath(),i.ellipse(e,t/.28,s*.24,s*.24,0,0,A),i.fill(),i.restore(),i.fillStyle=p,i.beginPath(),i.moveTo(e-h,l),i.lineTo(e-h*.7,t),i.lineTo(e-h*.1,t),i.lineTo(e-h*.1,l+s*.02),i.lineTo(e+h*.1,l+s*.02),i.lineTo(e+h*.1,t),i.lineTo(e+h*.7,t),i.lineTo(e+h,l),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,a),i.quadraticCurveTo(e-c*.9,l-s*.12,e-h,l),i.lineTo(e+h,l),i.quadraticCurveTo(e+c*.9,l-s*.12,e+c,a),i.quadraticCurveTo(e,a-s*.05,e-c,a),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=p,i.lineWidth=s*.055;let m=a+s*.02;o.pose===1?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*1.5,t-s*1.02),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.5,t-s*1.02),i.stroke()):o.pose===2?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e+h*1.4,l-s*.02),i.moveTo(e+c*.8,m),i.lineTo(e-h*.4,l-s*.06),i.stroke(),i.fillStyle=p,i.beginPath(),i.ellipse(e+h*1.5,l-s*.04,s*.07,s*.09,-.5,0,A),i.fill()):o.pose===3?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*.2,n+r*.6),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.1,l),i.stroke(),i.lineWidth=s*.02,i.beginPath(),i.moveTo(e-c*.2,n+r*.9),i.lineTo(e-c*.2,t-s*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,m),i.lineTo(e-c*.95,l+s*.02),i.moveTo(e+c*.85,m),i.lineTo(e+c*.95,l+s*.02),i.stroke()),i.fillStyle=p,i.fillRect(e-r*.34,n+r*.6,r*.68,r*.9),i.beginPath(),i.ellipse(e,n,r*.86,r*1.05,0,0,A),i.fill(),o.rimStrength>.01&&(i.strokeStyle=`rgba(${o.rim[0]},${o.rim[1]},${o.rim[2]},${(.6*o.rimStrength).toFixed(3)})`,i.lineWidth=Math.max(1,s*.02),i.beginPath(),i.moveTo(e-c,a),i.lineTo(e-r*.6,n+r*.4),i.moveTo(e-r*.7,n),i.ellipse(e,n,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function $t(i,e,t,s,o,r,n,a,l){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,o);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-r,t),i.lineTo(s-n,o),i.lineTo(s+n,o),i.lineTo(e+r,t),i.closePath(),i.fill(),i.restore()}function Ni(i,e,t,s,o){let r=i.createRadialGradient(e,t,0,e,t,s*3);r.addColorStop(0,`rgba(${o},0.9)`),r.addColorStop(.4,`rgba(${o},0.35)`),r.addColorStop(1,`rgba(${o},0)`),i.fillStyle=r,i.beginPath(),i.arc(e,t,s*3,0,A),i.fill(),i.fillStyle=`rgba(${o},1)`,i.beginPath(),i.arc(e,t,s,0,A),i.fill()}function dd(i,e,t){let s=document.createElement("canvas");s.width=$,s.height=ce;let o=s.getContext("2d"),r=e.x-i.x,n=e.y-i.y,a=Math.hypot(r,n),l=Math.max(2,a*ht),c=i.eyeHeightM??U,h=Wn(i,e,t),p=pr(h.seed),u=210+p()*150,m=j(220+(p()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,y=o.createLinearGradient(0,0,0,ce);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,$,ce);let d=o.createLinearGradient(0,W(-6),0,ce);d.addColorStop(0,"rgba(30, 37, 56, 0)"),d.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),d.addColorStop(1,"rgba(22, 28, 44, 0.12)"),o.fillStyle=d,o.fillRect(0,W(-6),$,ce-W(-6));let g=Math.atan2(r,-n),b=Nn(i,t,g,c),S=b.maxDelta>=Hn;S&&Vn(o,b.bins,Ve,W);let k=Math.max(.3,Math.min(1,1-(l-6)/60)),w=Fi(c,l),T=Math.min(80,Math.atan2(4,l)*180/Math.PI),C=Math.min(45,w.topPitch),P=w.basePitch;h.mode==="sport"?Un(o,l,c,h,k,u,f,p):h.mode==="arena"?qn(o,l,c,h,k,f,p):Yn(o,T,C,P,k,u,f,p);let M=h.mode==="sport"?34:24+Math.floor(p()*8);o.fillStyle=`rgba(${f},0.8)`;for(let L=0;L<M;L++){let x=(L+.5)/M*$,I=W(h.mode==="sport"?58:54+L*7%3*6);o.beginPath(),o.arc(x,I,h.mode==="sport"?2.6:3.2,0,A),o.fill()}Zn(o,i,t,e,g,c,r,n,S,h);let v=o.createLinearGradient(0,0,0,ce);return v.addColorStop(0,"rgba(0,0,0,0.85)"),v.addColorStop(.12,"rgba(0,0,0,0)"),v.addColorStop(.9,"rgba(0,0,0,0)"),v.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=v,o.fillRect(0,0,$,ce),{url:s.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function Yn(i,e,t,s,o,r,n,a){let l=Ve(-e),c=Ve(e),h=W(t),p=W(s),u=c-l,m=p-h,f=W(Math.min(50,t+10)),y=u*(1.1+(1-o)*.5),d=i.createRadialGradient($/2,(h+p)/2,8,$/2,(h+p)/2,y);d.addColorStop(0,"rgba(255, 214, 150, 0.34)"),d.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),d.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),d.addColorStop(1,"rgba(99, 102, 241, 0)"),i.fillStyle=d,i.fillRect(l-u*.6,h-m*1.2,u*2.2,m*3.4);let g=j(r,.62,.55),b=j(r+40,.7,.5),S=j(r+70,.78,.52);i.save(),i.beginPath(),i.rect(l,h,u,m),i.clip();let k=i.createLinearGradient(0,h,0,p);k.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),k.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),k.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=k,i.fillRect(l,h,u,m),i.globalAlpha=1;let w=i.createRadialGradient($/2,(h+p)/2,u*.12,$/2,(h+p)/2,u*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=w,i.fillRect(l,h,u,m),i.restore();let T=3+Math.floor(a()*3),C=m*.46,P=p-m*.08;for(let B=0;B<T;B++){let z=(B+1)/(T+1),O=l+u*(.22+z*.56+(a()-.5)*.06);Hi(i,O,P,C*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:j(r+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(l-u*.5,f,u*.5,p-f),i.fillRect(c,f,u*.5,p-f);let M=u*.055+3,v=M*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(l,p),i.lineTo(l-M,p),i.lineTo(l-v,f),i.lineTo(l+u*.012,f),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,p),i.lineTo(c+M,p),i.lineTo(c+v,f),i.lineTo(c-u*.012,f),i.closePath(),i.fill(),i.fillRect(l-v,f,u+v*2,(p-f)*.12);let L=m*.14,x=f+(p-f)*.12;i.fillStyle="rgba(4,6,12,0.96)";let I=7;i.beginPath(),i.moveTo(l-v,x);for(let B=0;B<=I;B++){let z=l-v+(u+v*2)*B/I;i.quadraticCurveTo(z-(u+v*2)/I/2,x+L,z,x)}i.lineTo(c+v,x),i.lineTo(c+v,f),i.lineTo(l-v,f),i.closePath(),i.fill(),i.fillStyle=`rgba(${n},0.12)`,i.fillRect(l-1.5,x,1.5,p-x),i.fillRect(c,x,1.5,p-x),i.fillStyle="#0b0f18",i.fillRect(l-M,p-m*.05,u+M*2,m*.05+3);let R=i.createLinearGradient(0,p-m*.05,0,p+m*.12);R.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),R.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=R,i.fillRect(l-M,p-m*.05,u+M*2,m*.2);let E=3+Math.floor(a()*2);for(let B=0;B<E;B++){let z=(B+1)/(E+1),O=l+u*(z+(a()-.5)*.08),D=W(Math.min(62,t+26)),X=(a()-.5)*u*.16;$t(i,O,D,O+X,p,4,u*.09,n,.16*(.7+o*.5)),Ni(i,O,D,2.4,n)}}function qn(i,e,t,s,o,r,n){let a=Math.min(e*.6,Math.max(3,s.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=$/2,h=1.2,p=Math.max(e*.45,e-a),u=e+a,m=Math.atan2(h-t,p)*180/Math.PI,f=Math.atan2(h-t,u)*180/Math.PI,y=Math.atan2(-t,p)*180/Math.PI,d=W(m),g=W(f),b=W(y),S=Ve(l)-c,k=Math.max(6,(d-g)/2),w=(d+g)/2,T=i.createRadialGradient(c,b,4,c,b,S*2.6);T.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),T.addColorStop(.5,"rgba(150,140,190,0.08)"),T.addColorStop(1,"rgba(40,44,60,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=T,i.fillRect(c-S*2.6,g-k,S*5.2,b-g+k+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-S,w),i.ellipse(c,w,S,k,0,Math.PI,0,!1),i.lineTo(c+S,b),i.ellipse(c,b,S,k,0,0,Math.PI,!1),i.closePath(),i.fill();let C=i.createLinearGradient(0,w,0,b);C.addColorStop(0,`rgba(${r},0.14)`),C.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=C,i.fillRect(c-S,w,S*2,b-w);let P=[[{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}]],M=P[Math.floor(n()*P.length)],v=n()<.5?-1:1,L=_=>c+_.u*v*S*.84,x=_=>w+_.v*k*.8,I=M.find(_=>_.lead)??M[0],R=L(I),E=i.createLinearGradient(0,w-k,0,w+k);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),i.fillStyle=E,i.beginPath(),i.ellipse(c,w,S,k,0,0,A),i.fill();let B=i.createRadialGradient(R,w,2,R,w,S);B.addColorStop(0,`rgba(255,214,160,${(.5*o).toFixed(3)})`),B.addColorStop(1,"rgba(255,214,160,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=B,i.beginPath(),i.ellipse(c,w,S,k,0,0,A),i.fill(),i.restore(),i.strokeStyle=`rgba(${r},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,k,0,0,A),i.stroke();let z=Math.max(24,(b-g)*1.3),O=M.length>=3?3:2;for(let _=0;_<O;_++){let he=(-.62+_*.52+(n()-.5)*.12)*-v,be=c+he*S*.7,We=w-k*(.45+n()*.18),Pe=S*(.07+n()*.04),jt=z*(.26+n()*.12);i.fillStyle="#0a0e18",i.fillRect(be-Pe/2,We-jt,Pe,jt),i.fillStyle=`rgba(${r},0.3)`,i.fillRect(be-Pe/2,We-jt,Pe,1.5)}if(M.length>=3){let _=c-I.u*v*S*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(_,w-k*.34,S*.08,k*.1,0,0,A),i.fill(),i.strokeStyle=`rgba(${r},0.35)`,i.lineWidth=1,i.stroke()}for(let _ of[...M].sort((he,be)=>he.v-be.v)){let he=.82+(_.v+1)*.14;Hi(i,L(_),x(_),z*he*(_.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:_.pose,rim:j(40,.72,.8),rimStrength:_.lead?1.4:.9})}let D=W(Math.min(60,f+34)),X=k*1.1+6;i.strokeStyle="rgba(60,68,92,0.85)",i.lineWidth=3,i.beginPath(),i.ellipse(c,D,S*1.15,X,0,0,A),i.stroke();let F=4+Math.floor(n()*3);for(let _=0;_<F;_++){let he=_/F*A,be=c+Math.cos(he)*S*1.15,We=D+Math.sin(he)*X;if(Math.sin(he)>-.2){let Pe=c+(n()-.5)*S*.8;$t(i,be,We,Pe,w,3,S*.32,r,.2*(.7+o*.4))}Ni(i,be,We,3,r)}let G=W(Math.min(52,f+24)),H=Math.max(60,S*.4),Y=Math.max(24,H*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-H*.3,G-Y/2),i.lineTo(c-H*.16,G-Y*2.2),i.moveTo(c+H*.3,G-Y/2),i.lineTo(c+H*.16,G-Y*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-H/2,G-Y/2,H,Y);let qt=i.createLinearGradient(0,G-Y*.3,0,G+Y*.42);qt.addColorStop(0,`rgba(${r},0.5)`),qt.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=qt,i.fillRect(c-H*.42,G-Y*.3,H*.84,Y*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-H/2,G+Y/2-2,H,2);let Ut=i.createRadialGradient(c,G,4,c,G,H*1.1);Ut.addColorStop(0,`rgba(${r},0.2)`),Ut.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=Ut,i.fillRect(c-H*1.1,G-H*.8,H*2.2,H*1.6);let Zt=i.createRadialGradient(c,(D+w)/2,6,c,(D+w)/2,S*1.5);Zt.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),Zt.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=Zt,i.fillRect(c-S*1.5,D-40,S*3,w-D+80),i.restore();let mr=c+Math.sign(R-c||1)*S*.5;$t(i,mr,D-X*.4,R,x(I),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let Qt=i.createRadialGradient(R,x(I),1,R,x(I),S*.2);Qt.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),Qt.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=Qt,i.beginPath(),i.ellipse(R,x(I),S*.2,k*.24,0,0,A),i.fill(),i.restore()}function Un(i,e,t,s,o,r,n,a){let l=$/2,c=Math.max(10,s.voidRadiusM),h=Math.max(2,e-c),p=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),m=Math.atan2(-t,h)*180/Math.PI,f=Math.atan2(-t,p)*180/Math.PI,y=W(m),d=W(f),g=Ve(u)-l,b=(y+d)/2,S=Math.max(10,(y-d)/2),k=i.createRadialGradient(l,b,4,l,b,g);k.addColorStop(0,"#e8f0fb"),k.addColorStop(.7,"#b9c9e2"),k.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(l,b,g,S,0,0,A),i.clip(),i.fillStyle=k,i.fillRect(l-g,b-S,g*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(l,b-S),i.lineTo(l,b+S),i.moveTo(l-g*.5,b-S),i.lineTo(l-g*.5,b+S),i.moveTo(l+g*.5,b-S),i.lineTo(l+g*.5,b+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(l,b,S*.9,S*.5,0,0,A),i.stroke(),i.restore(),i.strokeStyle="rgba(210,225,245,0.6)",i.lineWidth=2.5,i.beginPath(),i.ellipse(l,b,g,S,0,0,A),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let L=0;L<5;L++){let x=l+(a()-.5)*g*1.4,I=b+(a()-.5)*S*1.1,R=Math.max(2,S*.06);i.beginPath(),i.ellipse(x,I,R*.6,R,0,0,A),i.fill()}let w=i.createRadialGradient(l,b,4,l,b,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=w,i.fillRect(l-g*1.4,d-S,g*2.8,y-d+S*2),i.restore();let T=W(Math.min(66,f+60)),C=Math.max(80,g*.7),P=C*.5,M=i.createRadialGradient(l,T,4,l,T,C*1.6);M.addColorStop(0,`rgba(${n},0.3)`),M.addColorStop(1,`rgba(${n},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=M,i.fillRect(l-C*1.6,T-C*1.2,C*3.2,C*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(l-C/2,T-P/2),i.lineTo(l+C/2,T-P/2),i.lineTo(l+C*.6,T),i.lineTo(l+C/2,T+P/2),i.lineTo(l-C/2,T+P/2),i.lineTo(l-C*.6,T),i.closePath(),i.fill();let v=r;for(let L=0;L<3;L++){let x=j(v+L*30,.5,.5);i.fillStyle=`rgba(${x[0]},${x[1]},${x[2]},0.75)`;let I=C*.26;i.fillRect(l-C*.42+L*(I+C*.06),T-P*.32,I,P*.64)}i.fillStyle=`rgba(${n},0.9)`;for(let L=0;L<8;L++){let x=l-C*.6+C*1.2*L/7;i.beginPath(),i.arc(x,T+P*.62,2.4,0,A),i.fill()}}function Zn(i,e,t,s,o,r,n,a,l,c){let h=e.sectionId,p=!1,u=[];for(let y of t){if(y.id===e.id)continue;let d=y.x-e.x,g=y.y-e.y,b=Math.hypot(d,g)*ht;if(h&&y.sectionId===h&&b<3&&d*n+g*a>0&&(p=!0),b<.3||b>32)continue;let k=((Math.atan2(d,-g)-o)*180/Math.PI+540)%360-180,w=l?(y.eyeHeightM??U)-r:0,T=Math.atan2(w-.28,b)*180/Math.PI;if(T>10&&b>5)continue;let C=0;for(let v=0;v<y.id.length;v++)C=C*31+y.id.charCodeAt(v)&65535;let P=.9+(C&15)/40,M=Math.min(78,Math.atan2(.16,b)*180/Math.PI*Gn*P);M<1.2||u.push({hx:Ve(k),hy:W(T),r:M,d:b,hash:C})}u.sort((y,d)=>d.d-y.d);let m=[];{let y=[...u].sort((b,S)=>b.hy-S.hy),d=[],g=()=>{if(!d.length)return;let b=d.reduce((w,T)=>w+T.d,0)/d.length,S=d.reduce((w,T)=>w+T.hy,0)/d.length,k=d.reduce((w,T)=>w+T.r,0)/d.length;m.push({figs:d.sort((w,T)=>T.d-w.d),d:b,hy:S,r:k}),d=[]};for(let b of y){let S=d[d.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),d.push(b)}g()}m.sort((y,d)=>d.d-y.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let y of m){if(y.figs.length>=3&&y.r>=1.6&&y.r<26){let d=[],g=[...y.figs].sort((k,w)=>k.hx-w.hx),b=[];for(let k of g){let w=b[b.length-1];w&&k.hx-w.hx>Math.max(14,k.r*7)&&(b.length>=3&&d.push(b),b=[]),b.push(k)}b.length>=3&&d.push(b);let S=Math.min(.42,.5*(1-y.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let k of d){let w=k[0].hx-y.r*1.6,T=k[k.length-1].hx+y.r*1.6;i.beginPath(),i.roundRect(w,y.hy+y.r*.8,T-w,y.r*2.4,y.r*.8),i.fill()}}}for(let d of y.figs){let g=d.d<12?.95:d.d<17?Math.max(.66,.95-(d.d-12)/18):Math.max(.3,.68-(d.d-17)/34),b=Math.round((1-Math.min(1,d.d/16))*10),S=[14+(d.hash>>4&6)+b,17+(d.hash>>4&6)+b,25+(d.hash>>4&6)+b],k=f[d.hash%f.length],w=[k[0]+b,k[1]+b,k[2]+b];if(d.r>=13){let T=d.d<9?.16*(1-d.d/9)+(c.mode==="proscenium"?.06:0):0;Xn(i,d.hx,d.hy,d.r,{tone:S,clothing:w,alpha:g,tilt:((d.hash>>2&7)-3.5)*.018,shoulderK:1.72+(d.hash>>5&7)/22,hair:d.hash%zn,rim:T,turn:((d.hash>>8&7)-3.5)*.034,lean:((d.hash>>10&3)-1.5)*.09})}else d.r>=5.5?$n(i,d.hx,d.hy,d.r,w,S,g):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,i.beginPath(),i.arc(d.hx,d.hy,d.r,0,A),i.fill(),i.beginPath(),i.ellipse(d.hx,d.hy+d.r*1.4,d.r*1.85,d.r*.95,0,Math.PI,0,!0),i.fill())}}if(p){let y=W(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,y,$,ce-y),i.fillStyle="rgba(24, 30, 46, 0.9)";let d=16;for(let g=0;g<d;g++){let b=(g+.5)/d*$;i.beginPath(),i.ellipse(b,y+6,$/d*.42,22,0,Math.PI,0,!0),i.fill()}}}var ee=480,Ne=270,Gi=50,Me=30,dr=i=>(i+Gi)/(2*Gi)*ee,ct=i=>(Me-i)/(2*Me)*Ne;function ud(i,e,t){let s=document.createElement("canvas");s.width=ee,s.height=Ne;let o=s.getContext("2d"),r=e.x-i.x,n=e.y-i.y,a=Math.max(2,Math.hypot(r,n)*ht),l=pr(ur(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,h=j(220+(l()-.5)*60,.55,.82),p=`${h[0]},${h[1]},${h[2]}`,u=o.createLinearGradient(0,0,0,Ne);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),o.fillStyle=u,o.fillRect(0,0,ee,Ne);let m=i.eyeHeightM??U,f=Fi(m,a),y=Math.min(Gi-2,Math.atan2(4,a)*180/Math.PI),d=Math.min(Me-2,f.topPitch),g=Math.max(-Me+2,f.basePitch),b=dr(-y),S=dr(y),k=ct(d),w=ct(g),T=S-b,C=w-k,P=Math.max(.35,Math.min(1,1-(a-6)/60)),M=ct(Math.min(Me-1,d+8)),v=o.createRadialGradient(ee/2,(k+w)/2,4,ee/2,(k+w)/2,T*1.15);v.addColorStop(0,"rgba(255,214,150,0.34)"),v.addColorStop(.28,"rgba(150,150,230,0.3)"),v.addColorStop(.6,"rgba(99,102,241,0.12)"),v.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=v,o.fillRect(b-T*.6,k-C*1.2,T*2.2,C*3.4);let L=j(c,.62,.55),x=j(c+40,.7,.5),I=j(c+70,.78,.52);o.save(),o.beginPath(),o.rect(b,k,T,C),o.clip();let R=o.createLinearGradient(0,k,0,w);R.addColorStop(0,`rgb(${L[0]},${L[1]},${L[2]})`),R.addColorStop(.5,`rgb(${x[0]},${x[1]},${x[2]})`),R.addColorStop(1,`rgb(${I[0]},${I[1]},${I[2]})`),o.globalAlpha=.8,o.fillStyle=R,o.fillRect(b,k,T,C),o.globalAlpha=1;let E=o.createRadialGradient(ee/2,(k+w)/2,T*.12,ee/2,(k+w)/2,T*.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,k,T,C),o.restore();let B=3,z=w-C*.08;for(let F=0;F<B;F++){let G=(F+1)/(B+1);Hi(o,b+T*(.24+G*.52),z,C*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:j(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(b-T*.5,M,T*.5,w-M),o.fillRect(S,M,T*.5,w-M);let O=T*.05+2,D=O*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(b,w),o.lineTo(b-O,w),o.lineTo(b-D,M),o.lineTo(b+T*.012,M),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,w),o.lineTo(S+O,w),o.lineTo(S+D,M),o.lineTo(S-T*.012,M),o.closePath(),o.fill(),o.fillRect(b-D,M,T+D*2,(w-M)*.13),o.fillStyle=`rgba(${p},0.12)`,o.fillRect(b-1.2,M,1.2,w-M),o.fillRect(S,M,1.2,w-M),o.fillStyle="#0b0f18",o.fillRect(b-O,w-C*.05,T+O*2,C*.05+2);let X=o.createLinearGradient(0,w-C*.05,0,w+C*.14);X.addColorStop(0,`rgba(255,206,140,${(.5*P).toFixed(3)})`),X.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=X,o.fillRect(b-O,w-C*.05,T+O*2,C*.22);for(let F=0;F<3;F++){let G=(F+1)/4,H=b+T*G,Y=ct(Math.min(Me-1,d+20));$t(o,H,Y,H+(l()-.5)*T*.14,w,3,T*.09,p,.17*P),Ni(o,H,Y,1.8,p)}o.fillStyle=`rgba(${p},0.75)`;for(let F=0;F<8;F++)o.beginPath(),o.arc((F+.5)/8*ee,ct(Me-4-F%2*3),2.2,0,A),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,Ne-26,ee,26),o.fillStyle="rgba(30,37,54,0.9)";for(let F=0;F<9;F++){let G=F*(ee/9)+ee/18;o.beginPath(),o.ellipse(G,Ne-22,ee/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:s.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var fr=new Set(["en"]),Yt=new Map;async function Qn(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(ws(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-V5HTIO2J.js"),t=e[i];return t?await t():null}async function gd(i,e){let t=Fs(i,e);if(t==="en"||fr.has(t))return Ae(t),t;if(!Bs.includes(t))return Ae("en"),"en";try{let s=Yt.get(t);s||(s=Qn(t),Yt.set(t,s));let o=await s;return Yt.delete(t),o?(Ae(t,o),fr.add(t),t):(Ae("en"),"en")}catch{return Yt.delete(t),Ae("en"),"en"}}export{ta as ACCESSIBILITY_RING_COLOR,Jn as ACCESSIBILITY_TYPES,jn as CHART_STORAGE_KEY,Ua as CURRENCY_CHOICES,qa as DEFAULT_CURRENCY,ca as EVENT_CONFIGURATION_EXPORT_SCHEMA,la as EVENT_CONFIGURATION_SCHEMA,ra as LABEL_STYLE_MAX_SIZE,oa as LABEL_STYLE_MIN_SIZE,sl as LOCALE_NAMES,Da as MAX_EVENT_INVENTORY,Fa as MAX_GA_CAPACITY,ar as PickerController,ye as PickerSelectionError,za as RENDERED_QUALITY_REPORT_VERSION,ia as SEAT_COMMERCIAL_MARKS,kr as SUPPORTED_LOCALES,na as SURROUNDINGS_SHAPE_ROLES,Ei as SeatmapRenderer,ba as TABLE_SEAT_OFFSET,ya as TIER_HEIGHT_M,Bs as TRANSLATED_LOCALES,Qi as UNGROUPED_ID,ea as accessibilityMeta,Jt as accessibilityRingColor,Xi as allObjects,ji as applyHidden,fa as canTransitionEventConfiguration,ua as canonicalEventConfigurationJson,Zi as chartBounds,ei as computeSections,Qo as createRenderer,Sr as currencyExponent,Qa as currencySymbol,Ma as expandBooth,ze as expandChart,wa as expandRow,ka as expandRowSlots,Ia as expandTable,Ta as expandTableSlots,Ea as floorObjects,Ba as floorOverviewTranslations,pt as floorsOf,qi as floorsShareFootprint,cl as formatDate,Za as formatMinor,li as formatMoney,vr as fromMinorUnits,Ke as gaAreasOf,Ga as gaInventorySegments,_a as gaUnitLabel,ft as gaUnitLabels,dd as generateSeatPanorama,ud as generateSeatThumb,ol as getLocale,Ha as growJoinedGAInventory,Wa as hiddenObjectIds,pa as inspectEventConfigurationCompatibility,Ka as inspectRenderedQualityEvidence,Na as isGaUnitLabel,nl as isLocaleLoaded,Va as isSectionHidden,aa as layerOf,Yi as layoutFloorOverview,Ui as layoutFloorRings,gd as loadLocale,rl as localeDirection,ga as migrateLegacyEventConfigurations,xa as objectCenter,Ra as owningSectionForObject,da as parseEventConfigurationExport,ha as parseEventConfigurationVersion,Pa as pointInPolygon,te as pointInPolygonWithHoles,ut as polygonLabelPoint,ma as resolveEventConfigurationRollback,Fs as resolveLocale,va as rowInventoryCount,Sa as rowSeatPositions,sa as seatCommercialMeta,dt as sectionGeometry,Ae as setLocale,As as setMoneyLocale,al as setStringOverrides,$i as stackFloors,Z as t,ll as tCount,Ca as tableInventoryCount,La as tableSeatCountsBySide,Aa as translateObject,Oa as validGAInventorySegments};
1
+ import{a as fi,b as Fo,d as mi,f as Oo,g as At,i as Do,k as Go}from"./chunk-652LV66L.js";import{b as Lo,e as Rt,g as To,h as ye,i as ne,j as Co,k as Po,l as Et,m as Io}from"./chunk-WXWJZ5DO.js";import{a as rd,b as ad}from"./chunk-MR2O5WC7.js";import{b as Ho}from"./chunk-FOYQOIWG.js";import{a as Cc,b as Pc,c as Ic,d as xc,e as Mc,f as Rc,g as Ec,h as Ac,i as _c}from"./chunk-UHPX2P7O.js";import{a as fe,b as go,c as Te,d as Lt,e as Tt,f as Ce,g as Z,m as me,n as ve,q as Ct,r as Pt,t as bo,u as It,v as X,w as pi}from"./chunk-GXMGOWKB.js";import{b as De,f as xo,g as Mo,m as Ro,x as Eo,y as Ao}from"./chunk-JBGLFOJO.js";import{a as Qc,b as jc,c as Jc,d as ed,e as td,f as wt,g as id,h as qe,i as od,j as uo,k as kt,l as sd,m as nd,n as po}from"./chunk-A27USMF7.js";import{c as _o,e as Bo}from"./chunk-T2LWVOQ3.js";import{a as mc,b as yc,c as gc,d as bc,e as gt,f as Sc,g as vc,h as wc,i as kc,j as Lc,k as Tc,p as So,s as Ze}from"./chunk-AWPHGLTU.js";import{b as xt,f as vo,h as Mt,i as wo,k as ko}from"./chunk-UL5OIGIF.js";import{Aa as $c,Ba as no,Ca as qc,Da as ro,Ea as ao,Fa as lo,Ga as co,Ha as Zc,Ia as $e,Ja as ho,W as oo,X as Oe,Y as Bc,ea as ee,fa as so,ga as bt,ka as Fc,la as Oc,ma as Dc,na as Gc,oa as Hc,pa as Nc,qa as Wc,ra as Vc,s as to,sa as zc,ta as Kc,u as io,ua as Xc,va as ie,w as G,wa as St,xa as Yc,ya as Uc,za as vt}from"./chunk-X3K36XZM.js";import{B,c as di,h as hi,l as fo,n as mo,s as U,t as Se,u as ue,v as pe,w as ui,y as yo}from"./chunk-CXF32VPG.js";import"./chunk-CRCGO52K.js";import{Konva as Jt}from"konva/lib/Core";import{Stage as Yl}from"konva/lib/Stage";import{Layer as Vi}from"konva/lib/Layer";import{Group as ut}from"konva/lib/Group";import{Circle as kr}from"konva/lib/shapes/Circle";import{Group as Ci}from"konva/lib/Group";import{Circle as Re}from"konva/lib/shapes/Circle";import{Line as Pi}from"konva/lib/shapes/Line";import{Rect as Ii}from"konva/lib/shapes/Rect";import{Text as Ns}from"konva/lib/shapes/Text";var Qe=9,Pe=.9,re=.55*Pe,ae=Z/fe,je=4,Ie=14,No=10,Wo=14,ge=.45*Pe,be=.9*Pe,Vo=(ge+be)/2,zo=Math.max(Pe*1.1,be),we=8,Ko=700,Q=2,Xo=Z,_t=.85,Yo=Z,Je=64,Ge=.55*ge,yi=700,Uo=2500,Bt=-11.5,et=.58,$o=320,qo=650,Zo=420,Qo=1,Ft=1,jo=2,gi=16,He=12,Jo=[.85,.72,.62],Ot=15,Dt=12,es=.01,ts=10,is=6,os=12,ss=8,ns=8,rs=.6,as=.6,ls=[0,18,-18,36,-36,54,-54],Ne="600",Gt="500",oe=640,cs="700",tt=.02,ds=14,hs=.34,us=.92,bi=7,ps=3,fs=6;function Si(i){return Math.min(1,Math.max(He/gi,i/900))}function Ht(i,e){return Math.max(He,i*Si(e))}var ms=.1;var Yr="#e5e7eb",Ur="#c7cbd1",$r="#595f69",qr="#d1d5db",Zr="#b8bdc4",Qr="#273142",jr="#526078",Jr="#f1f5f9",ea="#374151",ta="#64748b",ia="#111827",Nt="#6b7280",it="#374151";var ys="#4b5563",gs=.4,xe=.16,bs="rgba(244,246,248,0.06)",Wt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function le(i){return U(i)?{sectionFill:Yr,sectionStroke:Ur,sectionInk:$r,focalFill:qr,focalStroke:Zr}:{sectionFill:Qr,sectionStroke:jr,sectionInk:Jr,focalFill:ea,focalStroke:ta}}function vi(i,e){let t=i.sectionFill,o=yo(ue(t,.2),.85);switch(e){case"closed":return ue(t,.12);case"sold-out":return o;case"nearly-gone":return pe(t,o,.4);default:return t}}var Ss=.28,vs=.32,oa=.55,sa=.7;function ws(i,e,t){let o=le(i),s=vi(o,e);if(!t||e==="sold-out"||e==="closed")return{fill:s,stroke:o.sectionStroke};let n=U(i);return{fill:pe(s,t,n?vs:Ss),stroke:B(t,n?sa:oa)}}var na=.03;function ks(i,e){let t=le(i);return!["normal","nearly-gone","sold-out","closed"].map(s=>vi(t,s).toLowerCase()).includes(e.trim().toLowerCase())&&wi(i,e)}function wi(i,e){let t=di(e);if(!t)return!1;let o=le(i),s=Math.max(Ss,vs)+na;return["normal","nearly-gone","sold-out","closed"].some(n=>{let r=di(vi(o,n));return r?Math.max(Math.abs(r[0]-t[0]),Math.abs(r[1]-t[1]),Math.abs(r[2]-t[2]))/255<=s:!1})}var ra="#f8fafc",aa="#f4f6fb",la="#111827",ca=.72;function Ls(i){let e=U(i),t=e?ra:ia,o=e?la:aa,s=pe(o,t,1-ca);return{plate:t,ink:o,subInk:fo(s,t)>=mo?s:o}}function Ts(i){return i?.35:.3}function Cs(i){if(i<=0||i>=1)return 1;let e=1.25-1;if(i<.45){let o=i/.45;return 1+e*(1-(1-o)**2)}let t=(i-.45)/(1-.45);return 1+e*Math.cos(t*Math.PI*1.5)*(1-t)**2}function ki(i){let e=i<=0?0:i>=1?1:i,t=1-(1-e)**3;return{radiusScale:1+(2.5-1)*t,opacity:.55*(1-e)}}var Is;function xs(i){Is=i}function da(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var Ps=new Map;function ha(i,e){let t=i??Is,o=`${t??""}|${JSON.stringify(e)}`,s=Ps.get(o);return s||(s=new Intl.DateTimeFormat(t,e),Ps.set(o,s)),s}var ua={dateStyle:"medium",timeStyle:"short"};function Ms(i,e={}){let{locale:t,...o}=e,s=da(i);if(!Number.isFinite(s))return"";let n=Object.keys(o).length?o:ua;return ha(t,n).format(s)}var fd="USD",md=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],Es;function As(i){Es=i}var Rs=new Map;function Vt(i,e,t,o){let s=o??Es,n=`${s??""}|${i}|${e??"auto"}|${t??"auto"}`,r=Rs.get(n);return r||(r=new Intl.NumberFormat(s,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),Rs.set(n,r)),r}function ot(i,e="USD",t,o){if(typeof t=="object"){let n=t;try{return Vt(e,n.minimumFractionDigits,n.maximumFractionDigits,n.locale).format(i)}catch(r){if(n.fallback)return n.fallback(i,e);throw r}}let s=t??(Number.isInteger(i)?0:void 0);return Vt(e,s,s,o).format(i)}function pa(i="USD"){try{return Vt(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function fa(i,e="USD"){return i/10**pa(e)}function yd(i,e="USD",t){return ot(fa(i,e),e,void 0,t)}function gd(i="USD"){return Vt(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var st={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired \u2014 the seats were released. Pick again.","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.orphanHint":"This leaves a single seat stranded \u2014 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.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview \u2014 groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks \u2014 sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats \u2014 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":"Overview","picker.entrance":"Entrance","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","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.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count} \u2014 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.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.holdReassurance":"Yours for {time} \u2014 you won\u2019t be charged yet.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total} \u2014 you won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types \u2014 tap one below to show just those seats.","picker.findTogetherInstead":"Find seats together instead","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours.","picker.accessExpiredTitle":"Your access session has ended","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.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.accessiblePhysicalSeat":"Accessible physical seat","picker.addTime":"Add time","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Areas","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.change":"Change","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 \u2014 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.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","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 \u2014 please head to checkout now.","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.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.fitToScreen":"Fit to screen","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 \u2014 may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.heldTicketsReleased":"Held tickets released. Choose your new seats.","picker.heldTicketsRestored":"Your held tickets have been restored.","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.liveAvailability":"Live availability \u2014 seats update in real time","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.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.moreSelectedCount":"{count} more selected","picker.moreTimeAdded":"More time added \u2014 your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notChargedYet":"You won\u2019t be charged yet.","picker.notForSale":"Not for sale","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.releaseHeldTickets":"Release held tickets and choose different seats","picker.releasingEllipsis":"Releasing\u2026","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.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.seatsHeldForNeedMoreTime":"Your seats are held for <b>{time}</b>. Need more time?","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsJustTakenInCategory.one":"{count} seat just taken in {label} \xB7 {left} left","picker.seatsJustTakenInCategory.other":"{count} seats just taken in {label} \xB7 {left} left","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSecured":"Seats secured","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.securedCount":"{count} secured","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.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.trayHintTapOrStanding":"Tap a seat on the map \u2014 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.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & areas","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances"};var ma=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],Ld={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",hr:"Hrvatski",hu:"Magyar",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",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",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},_s=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],ya=new Set(["ar","fa","he"]),Li={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",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"},Ti=new Map(ma.map(i=>[i.toLowerCase(),i]));function ga(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=Ti.get(e)??Li[e];if(t)return t;let o=e.split("-");if(o.length>=2){let s=`${o[0]}-${o[1]}`,n=Ti.get(s)??Li[s];if(n)return n}return Ti.get(o[0])??Li[o[0]]}var Me={en:st},zt={},ce="en";function Bs(i,e){let t=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[i,e,...t]){if(!o)continue;let s=ga(o);if(s)return s}return"en"}function Td(){return ce}function Cd(i=ce){return ya.has(i)?"rtl":"ltr"}function Pd(i){return!!Me[i]}function We(i,e){e&&(Me[i]={...Me[i],...e}),ce=Me[i]?i:"en",As(ce),xs(ce),typeof document<"u"&&(document.documentElement.lang=ce)}function Id(i){zt=i}var Fs=/\{(\w+)\}/g;function Y(i,e){let t=zt[i]??Me[ce]?.[i]??st[i]??i;return e?t.replace(Fs,(o,s)=>String(e[s]??`{${s}}`)):t}function xd(i,e,t){let o=new Intl.PluralRules(ce).select(e);return(zt[`${i}.${o}`]??Me[ce]?.[`${i}.${o}`]??st[`${i}.${o}`]??zt[`${i}.other`]??Me[ce]?.[`${i}.other`]??st[`${i}.other`]??i).replace(Fs,(r,a)=>String({count:e,...t}[a]??`{${a}}`))}function Md(i,e){return Ms(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:ce})}function Ds(i,e,t,o=!1){let s=i.displayLabel?.trim()||i.label;return o?{title:s,detail:Y("map.statusTaken"),sellable:!1}:e==="booked"?{title:s,detail:Y("map.statusTaken"),sellable:!1}:e==="held"?{title:s,detail:Y("map.statusHeld"),sellable:!1}:{title:s,detail:t()??"",sellable:!0}}var Ve=32,Os=70;function Gs(i,e){let t=Ve+6,o=i.y-Os;return{x:Math.min(Math.max(i.x,t),Math.max(t,e.width-t)),y:o>=t?o:Math.min(i.y+Os,e.height-t)}}var wa=220,ka=.08,Kt=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.host=e}syncMarker(e,t,o){let s=o.get(e);if(o.delete(e),!t){this.retire(s);return}s?.destroy();let n=this.host,r=n.seat(e);if(!r)return;let a=n.seatShape(e)?.fill(),l=X(typeof a=="string"?a:"",n.selectionColor(),It),c=n.selectionFocusId()===e,d=n.boothDims(r.rowId),h=n.seatRadius(),p=n.seatPoint(r),m=new Ci({name:"selection-ring",x:p.x,y:p.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:n.selectionFocusId()&&!c?.2:1});if(n.viewMode()==="perspective"){let f=n.perspectiveSeatScale(e);m.scale({x:f,y:f})}m.setAttrs({seatId:e,ringColor:l});let y={name:"selection-halo",stroke:B(n.categoryColor(r.categoryKey),Ts(U(n.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let f=h*1.2;m.add(new Ii({...y,width:d.width+f*2,height:d.height+f*2,offsetX:(d.width+f*2)/2,offsetY:(d.height+f*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else m.add(new Re({...y,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let u={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(m.add(new Ii({...u,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)m.add(new Ii({...u,width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2,opacity:.55}));else{let f=Math.max(0,d.width/2-14),b=-Math.max(0,d.height/2-14);m.add(new Re({x:f,y:b,radius:10,fill:l,listening:!1})),m.add(new Pi({x:f,y:b,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:U(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else m.add(new Re({...u,radius:Math.max(1,h-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,h*.22))})),c?m.add(new Re({...u,radius:h+2,strokeWidth:2,opacity:.55})):m.add(new Pi({points:[-h*.52,0,-h*.12,h*.4,h*.6,-h*.46],stroke:"#ffffff",strokeWidth:Math.max(2.6,h*.34),lineCap:"round",lineJoin:"round",shadowColor:"#0b1220",shadowBlur:1.5,shadowOpacity:.55,listening:!1}));o.set(e,m),this.host.overlayLayer.add(m)}retire(e){let t=this.host;if(!e)return;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),s=n=>{if(t.isDestroyed()||!e.getLayer()){e.destroy();return}let r=Math.min(1,(n-o)/160);e.opacity(1-r),t.overlayLayer.batchDraw(),r<1?requestAnimationFrame(s):(e.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(s)}play(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden)return;let o=t.seat(e);if(!o)return;let s=t.seatRadius(),n=t.seatPoint(o);this.pulses.get(e)?.destroy();let r=new Re({name:"selection-pulse",x:n.x,y:n.y,radius:s,stroke:t.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,s*.24),opacity:ki(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,r),this.pulseHome().add(r);let a=t.isCached()?void 0:t.seatShape(e),l=performance.now(),c=()=>{a?.scale({x:1,y:1}),r.destroy(),this.pulses.get(e)===r&&this.pulses.delete(e),t.overlayLayer.batchDraw(),a&&!t.isCached()&&t.seatLayer.batchDraw()},d=h=>{if(t.isDestroyed()){c();return}r.getLayer()||this.pulseHome().add(r);let p=h-l,m=ki(p/420);if(r.radius(s*m.radiusScale),r.opacity(m.opacity),a){let y=Cs(p/320);a.scale({x:y,y})}t.overlayLayer.batchDraw(),a&&!t.isCached()&&t.seatLayer.batchDraw(),p<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{t.isDestroyed()||requestAnimationFrame(d)})}nudge(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||t.isCached()||typeof document<"u"&&document.hidden)return;let o=t.seatShape(e);if(!o)return;let s=performance.now(),n=()=>{o.scale({x:1,y:1}),t.seatLayer.batchDraw()},r=a=>{if(t.isDestroyed()||t.isCached()||!o.getLayer()){n();return}let l=a-s,c=Math.min(1,l/wa),d=1+ka*Math.sin(Math.PI*c);o.scale({x:d,y:d}),t.seatLayer.batchDraw(),c<1?requestAnimationFrame(r):n()};requestAnimationFrame(r)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Ci({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 t=this.host;if(t.isExportMode()||t.isDestroyed())return;let o=t.nearestSeat(e,Ie),s=o?t.seat(o):void 0;if(!s){this.hideLoupe();return}let n=Ds(s,t.seatStatus(s.id),()=>t.priceLabel(s),t.seatClosed(s.id)),r=Gs(e,{width:t.stage.width(),height:t.stage.height()}),a=1/(t.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=s.id,l.group.position(t.screenToWorld(r)),l.group.scale({x:a,y:a}),l.group.opacity(n.sellable?1:.75),l.group.visible(!0),l.disc.fill(t.categoryColor(s.categoryKey)),l.title.text(n.title),l.title.offsetX(l.title.width()/2),l.detail.text(n.detail),l.detail.offsetX(l.detail.width()/2),t.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,t=e.canvasBackground(),o=X(t,le(t).sectionInk),s=new Ci({name:"touch-loupe",listening:!1,visible:!1});s.add(new Pi({points:[-7,Ve-4,0,Ve+12,7,Ve-4],closed:!0,fill:t,stroke:B(o,.25),strokeWidth:1,listening:!1})),s.add(new Re({radius:Ve,fill:t,stroke:B(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let n=new Re({y:-15,radius:6,fill:"#6e7bff",listening:!1}),r=new Ns({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),a=new Ns({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:B(o,.72),listening:!1,perfectDrawEnabled:!1});return s.add(n),s.add(r),s.add(a),e.overlayLayer.add(s),s.moveToTop(),this.loupe={group:s,title:r,detail:a,disc:n,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}};function Ws(i,e){let t=i.width(),o=i.height(),s=1/0,n=1/0,r=-1/0,a=-1/0;for(let l of e){let c=l.getClientRect();if(!(!(c.width>1)||!(c.height>1))){if(c.x<-8||c.y<-8||c.x+c.width>t+8||c.y+c.height>o+8)return null;c.x<s&&(s=c.x),c.y<n&&(n=c.y),c.x+c.width>r&&(r=c.x+c.width),c.y+c.height>a&&(a=c.y+c.height)}}return isFinite(s)?{x:s,y:n,width:r-s,height:a-n}:null}var Vs=8,La=.5;function Ks(i,e){let t=Ws(i,e);if(!t)return 0;zs(i,t);let o=Math.min((i.width()-2*Vs)/t.width,(i.height()-2*Vs)/t.height);if(!(Math.max(t.width-i.width(),t.height-i.height())>La)||!(o>0))return 1;let n=i.width()/2,r=i.height()/2;i.scale({x:i.scaleX()*o,y:i.scaleY()*o}),i.position({x:n+(i.x()-n)*o,y:r+(i.y()-r)*o});let a=Ws(i,e);return a&&zs(i,a),o}function zs(i,e){let t=i.width()/2-(e.x+e.width/2),o=i.height()/2-(e.y+e.height/2);return t===0&&o===0?!1:(i.position({x:i.x()+t,y:i.y()+o}),!0)}function xi(i){return`${i.x()},${i.y()},${i.scaleX()}`}import{Group as Ta}from"konva/lib/Group";import{Circle as Xs}from"konva/lib/shapes/Circle";import{Line as Ca}from"konva/lib/shapes/Line";import{Text as Pa}from"konva/lib/shapes/Text";var Ia=6;function xa(i){return U(i)?"#0b1220":"#ffffff"}function Ys(i){let{points:e}=i;if(!e.length)return null;let t=i.categoryColor??"#6e7bff",o=0,s=0;for(let n of e)o+=n.x,s+=n.y;return{count:e.length,centroid:{x:o/e.length,y:s/e.length},fill:t,ink:xa(t)}}var Xt=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let t of this.host.sections()){if(t.logicalId!==e&&t.id!==e)continue;let o=Ys({points:this.host.ownedPoints(t),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let t of this.badges)if(Math.hypot(e.x-t.centre.x,e.y-t.centre.y)<=t.radius)return t.id;return null}sync(e){if(this.group?.destroy(),this.group=null,this.badges=[],e>=be){this.host.overlayLayer.batchDraw();return}let t=Math.max(this.host.stageScale(),1e-4),o=new Ta({listening:!1,name:"owned-sections"}),s=new Set;for(let n of this.host.sections()){let r=this.host.ownedPoints(n),a=Ys({points:r,categoryColor:this.host.sectionColor(n)});if(!a)continue;let l=Math.max(Ia/2/t,1);for(let y of r)o.add(new Xs({name:"owned-seat-dot",x:y.x,y:y.y,radius:l,fill:a.fill,stroke:B("#ffffff",.55),strokeWidth:Math.max(.5,l*.28),shadowColor:a.fill,shadowBlur:l*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(s.has(n.logicalId))continue;s.add(n.logicalId);let c=this.host.sections().filter(y=>y.logicalId===n.logicalId).reduce((y,u)=>y+this.host.ownedPoints(u).length,0),d=this.host.labelAnchor(n),h=11/t,p={x:d.x,y:d.y-h*2.1};o.add(new Xs({name:"owned-section-badge",x:p.x,y:p.y,radius:h,fill:a.fill,stroke:B(a.ink,.35),strokeWidth:1/t,listening:!1,perfectDrawEnabled:!1})),o.add(new Ca({x:p.x-h*.62,y:p.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:a.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new Pa({x:p.x+h*.12,y:p.y-h*.5,text:String(c),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:a.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:n.logicalId,centre:p,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};function N(i){let e=So(i);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 ze(i,e,t,o){let s=o*Math.PI/180,n=Math.cos(s),r=Math.sin(s);return[{x:-e/2,y:-t/2},{x:e/2,y:-t/2},{x:e/2,y:t/2},{x:-e/2,y:t/2}].map(a=>({x:i.x+a.x*n-a.y*r,y:i.y+a.x*r+a.y*n}))}function Yt(i,e,t,o,s,n){let r=o*Math.PI/180,a=Math.cos(r),l=Math.sin(r);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let h=e*(d/6-.5),p=t*(c/4-.5),m={x:i.x+h*a-p*l,y:i.y+h*l+p*a};if(!ie(m,s,n))return!1}return!0}function Us(i,e,t){let o=N(i),s=[t];for(let r=1;r<12;r+=1)for(let a=1;a<12;a+=1){let l={x:o.x+o.width*a/12,y:o.y+o.height*r/12};ie(l,i,e)&&s.push(l)}let n=[i,...e];return s.map(r=>({point:r,room:to(r,n)})).sort((r,a)=>a.room-r.room).map(r=>r.point).filter((r,a,l)=>a===l.findIndex(c=>Math.abs(c.x-r.x)<1e-6&&Math.abs(c.y-r.y)<1e-6))}function $s(i,e){let{stageScale:t,stageX:o,stageY:s}=i;if(i.viewMode==="perspective"&&e.perspectiveAffine)return N(e.outline.map(r=>{let a=i.projectedSectionPoint(e,r);return{x:a.x*t+o,y:a.y*t+s}}));let n=e.liftWorld>0?i.isoLiftLocal(e.liftWorld):{x:0,y:0};return N(e.outline.map(r=>{let a={x:r.x+n.x,y:r.y+n.y},l=i.isoT===0?a:i.isoForward(a);return{x:l.x*t+o,y:l.y*t+s}}))}function Ma(i,e){let t=i.width*i.height;if(t<=0)return 0;let o=Math.max(0,Math.min(i.x+i.width,e.width)-Math.max(i.x,0)),s=Math.max(0,Math.min(i.y+i.height,e.height)-Math.max(i.y,0));return o*s/t}function qs(i){let{current:e,viewport:t}=i,o=new Map;for(let a of i.sections){let l=Ma(a.bounds,t)*a.members;l<=0||o.set(a.logicalId,(o.get(a.logicalId)??0)+l)}if(!o.size)return e;let s=null,n=0;for(let[a,l]of o)l>n&&(n=l,s=a);if(!s||s===e)return e;let r=e!=null?o.get(e)??0:0;return n>r*1.35?s:e}import{Text as Ea}from"konva/lib/shapes/Text";function Ra(i,e){return i.x<e.x+e.width&&e.x<i.x+i.width&&i.y<e.y+e.height&&e.y<i.y+i.height}var Ke=class{constructor(){this.cells=new Map}insert(e){for(let t of this.keys(e)){let o=this.cells.get(t);o?o.push(e):this.cells.set(t,[e])}}collisionCount(e){let t=new Set,o=0;for(let s of this.keys(e))for(let n of this.cells.get(s)??[])t.has(n)||(t.add(n),Ra(e,n)&&o++);return o}keys(e){let t=Math.floor(e.x/Je),o=Math.floor((e.x+Math.max(0,e.width))/Je),s=Math.floor(e.y/Je),n=Math.floor((e.y+Math.max(0,e.height))/Je),r=[];for(let a=s;a<=n;a++)for(let l=t;l<=o;l++)r.push(`${l}:${a}`);return r}};function Zs(i,e){let t=i.sections.filter(y=>y.id===e||y.logicalId===e),o=t.map(y=>{if(i.viewMode==="perspective"&&y.perspectiveAffine)return N(y.outline.map(b=>i.projectedSectionPoint(y,b)));let u=y.liftWorld>0?i.isoLiftLocal(y.liftWorld):{x:0,y:0},f=y.outline.map(b=>{let g={x:b.x+u.x,y:b.y+u.y};return i.isoT===0?g:i.isoForward(g)});return N(f)});if(!o.length)return null;let s=Math.min(...o.map(y=>y.x)),n=Math.min(...o.map(y=>y.y)),r=Math.max(...o.map(y=>y.x+y.width)),a=Math.max(...o.map(y=>y.y+y.height)),l=new Set(t.flatMap(y=>y.memberIds));for(let y of l){let u=i.seatById.get(y);if(!u)continue;let f=i.renderedSeatPoint(u);s=Math.min(s,f.x-i.seatR),n=Math.min(n,f.y-i.seatR),r=Math.max(r,f.x+i.seatR),a=Math.max(a,f.y+i.seatR)}let c=y=>{[y.x,y.y,y.width,y.height].every(Number.isFinite)&&(s=Math.min(s,y.x),n=Math.min(n,y.y),r=Math.max(r,y.x+y.width),a=Math.max(a,y.y+y.height))},d=y=>{let u={x:y.x+y.width/2,y:y.y+y.height/2};return t.some(f=>ie(u,f.outline,f.holes))};for(let{node:y,backdrop:u}of i.freeTextById.values()){let f=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(f)&&(c(f),u&&c(u.getClientRect({relativeTo:i.bgLayer,skipShadow:!0})))}for(let{node:y}of i.iconNodeById.values()){let u=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(u)&&c(u)}let h=new Ke;for(let{node:y}of i.freeTextById.values()){let u=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:u.x-Q,y:u.y-Q,width:u.width+Q*2,height:u.height+Q*2})}for(let y of i.rowLabelPlan){let u=(y.focusKeys??[]).some(S=>S===e||t.some(v=>S===v.id||S===v.logicalId)),f=new Ea({text:y.text,fontSize:y.fontSize,fontStyle:"700",fontFamily:i.labelFont(),rotation:y.rotation,listening:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2);let b=i.resolveAutomaticRowLabelPosition(f,y,h),g=i.rowLabelBox(f,b);u&&c(g),h.insert(g),f.destroy()}let p=Math.max(r-s,a-n),m=Math.max(i.seatR*2,Math.min(24,p*.025));return{x:s-m,y:n-m,width:Math.max(1,r-s+m*2),height:Math.max(1,a-n+m*2)}}import{Rect as Aa}from"konva/lib/shapes/Rect";import{Text as Qs}from"konva/lib/shapes/Text";function js(i,e){if(!e.zones?.length||!i.sections.length)return;let t=Ls(i.canvasBackground),o=new Map;for(let s of i.sections)s.zone&&(o.get(s.zone)??o.set(s.zone,[]).get(s.zone)).push(s);for(let s of e.zones){let n=o.get(s.id);if(!n||!n.length)continue;let r=n[0];for(let m of n)m.centroid.y<r.centroid.y&&(r=m);let a=r.centroid.x,l=r.centroid.y,c=1/0;for(let m of n)for(let y of m.memberIds){let u=i.seatById.get(y),f=u&&i.catPrice.get(u.categoryKey);typeof f=="number"&&f<c&&(c=f)}let d=new Aa({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:t.plate,stroke:B(s.color??r.outlineTint,rs),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(d);let h=new Qs({x:a,y:l,text:s.label.toUpperCase(),fontSize:Ot,fontStyle:Ne,letterSpacing:.5,fontFamily:i.labelFont(),fill:t.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2),i.bgLayer.add(h);let p=null;isFinite(c)&&(p=new Qs({x:a,y:l,text:Y("map.fromPrice",{price:ot(c,i.currency)}),fontSize:Dt,fontStyle:Gt,fontFamily:i.labelFont(),fill:t.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),p.offsetX(p.width()/2),i.bgLayer.add(p)),i.zones.push({id:s.id,anchor:{x:a,y:l},back:d,background:t.plate,name:s.label.toUpperCase(),label:h,sub:p})}}import{Circle as Ha}from"konva/lib/shapes/Circle";import{Line as Na}from"konva/lib/shapes/Line";import{Rect as Wa}from"konva/lib/shapes/Rect";import{Text as Va}from"konva/lib/shapes/Text";function Ee(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}function Mi(i,e){return Ee(i,e)?"match":i.accessibility?.includes("companion")?"companion":"other"}var Js=.35,en=.7,nt="#0b1220",rt="#ffffff",tn="#0b1220",on="#232c40",sn="#8b93a7";function nn(i,e,t="normal"){let o=i?"bold":t;return e?`italic ${o}`.trim():o}var Ri="#f7f8fb";import{Shape as Ba}from"konva/lib/Shape";import{Circle as Fa}from"konva/lib/shapes/Circle";import{Rect as Oa}from"konva/lib/shapes/Rect";var _a={M:2,L:2,Q:4,C:6,Z:0},Ei=new Map;function Ai(i){let e=Ei.get(i);if(e)return e;let t=Mt(i);if(!t)return Ei.set(i,[]),[];let o=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],s=[],n=0;for(;n<o.length;){let r=o[n++],a=_a[r];if(a===void 0||n+a>o.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let l=o.slice(n,n+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);n+=a,r==="M"||r==="L"?s.push({command:r,points:l}):r==="Q"?s.push({command:r,points:l}):r==="C"?s.push({command:r,points:l}):s.push({command:"Z",points:[]})}return Ei.set(i,s),s}function rn(i,e,t,o=0,s=0){let n=Ai(e),r=vo(e).bounds;if(!n.length||!r||!(t>0))return!1;let a=wo(r,t);i.save(),i.translate(o,s),i.scale(a.scale,a.scale),i.translate(-a.centreX,-a.centreY);for(let l of n)l.command==="M"?i.moveTo(l.points[0],l.points[1]):l.command==="L"?i.lineTo(l.points[0],l.points[1]):l.command==="Q"?i.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?i.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):i.closePath();return i.restore(),!0}function an(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var at=class extends Ba{_sceneFunc(e){let t=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,s=Ai(o),n=this.attrs.seatGlyphDetail,r;if(n===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;r=t*2*c>=16}else r=n;if(!s.length||!r){an(e,t),e.fillStrokeShape(this);return}e.beginPath(),rn(e,o,t),e.fillStrokeShape(this)}_hitFunc(e){an(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 Da(i,e){return i==="circle"||!Mt(i)?null:new at({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:i,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function ln(i){let{x:e,y:t,radius:o}=i;return i.wheelchairBay?new Oa({x:e,y:t,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Da(i.glyph,{x:e,y:t,radius:o,detail:i.detail,fill:i.fill})??new Fa({x:e,y:t,radius:o,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Ga(i,e){return i*2*e>=16}function cn(i,e,t,o){let s=Ga(e,t);if(s===o||!i.length)return s;for(let n of i)n.setAttr("seatGlyphDetail",s);return s}function dn(i){let e=[...i.seats].sort((t,o)=>(i.perspectiveSeatDepth.get(o.id)??0)-(i.perspectiveSeatDepth.get(t.id)??0));for(let t of e){if(t.kind==="booth"){za(i,t);continue}let o=i.seatContainer(t.id),s=ln({x:t.x,y:t.y,radius:i.seatR,detail:i.seatGlyphDetail,glyph:ko(t.glyph,i.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(s instanceof at&&i.glyphMarkers.push(s),s.setAttr("seatId",t.id),i.circleById.set(t.id,s),i.paintSeat(s,t.id),o.add(s),t.accessible){if(t.wheelchairSpaceType!=="no-seat"){let n=new Ha({x:t.x,y:t.y,radius:i.seatR+1.5,stroke:gt(t.accessibility),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});i.accessRingById.set(t.id,n),o.add(n)}if(t.accessibility?.includes("wheelchair")&&Ct(t.accessibility)){let n=i.buildAccessGlyph(t,typeof s.fill()=="string"?s.fill():"");i.accessGlyphById.set(t.id,n),o.add(n)}}}}function za(i,e){let t=i.seatContainer(e.id),o=i.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},s=e.x,n=e.y,r;o.points&&o.points.length>=3?(r=new Na({x:e.x,y:e.y,points:o.points.flatMap(l=>[l.x,l.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s=e.x+o.points.reduce((l,c)=>l+c.x,0)/o.points.length,n=e.y+o.points.reduce((l,c)=>l+c.y,0)/o.points.length):r=new Wa({x:e.x,y:e.y,width:o.width,height:o.height,offsetX:o.width/2,offsetY:o.height/2,rotation:o.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),r.setAttr("seatId",e.id),i.circleById.set(e.id,r),t.add(r);let a=new Va({x:s,y:n,text:e.displayLabel??e.label,fontSize:Te,fontStyle:"600",fontFamily:i.labelFont(),fill:i.theme.seatLabelColor??nt,listening:!1,perfectDrawEnabled:!1});a.offsetX(a.width()/2),a.offsetY(a.height()/2),a.visible(!1),i.setHasBoothText(),i.boothLabelById.set(e.id,a),t.add(a),i.paintSeat(r,e.id)}function hn(i,e,t,o){let s=null,n=1/0,r=i.stage.scaleX()||1;for(let a of i.seats){if(!o?.includeUnavailable&&!i.selection.has(a.id)&&!i.isSelectable(a.id))continue;let l=i.worldToScreen(a),c=i.viewMode==="perspective"?i.perspectiveSeatScale.get(a.id)??1:1,d=i.seatR*r*c+t,h=Math.hypot(l.x-e.x,l.y-e.y);h<=d&&h<n&&(n=h,s=a.id)}return s}function un(i){if(!i.objectFloor.size)return null;let e=i.stage.getPointerPosition();if(!e)return null;let t=i.screenToWorld(e),o=null,s=1/0;for(let n of i.seats){let r=i.renderedSeatPoint(n),a=r.x-t.x,l=r.y-t.y,c=a*a+l*l;c<s&&(s=c,o=n.rowId)}return o?i.objectFloor.get(o)??null:null}import{Circle as Ka}from"konva/lib/shapes/Circle";import{Line as Xa}from"konva/lib/shapes/Line";function pn(i,e,t,o){let s=i.seatRadius(),n=new Ka({x:t.x,y:t.y,radius:s,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),r=i.viewMode()==="perspective"?i.perspectiveSeatScale(e):1;n.scale({x:r,y:r}),i.overlayLayer.add(n);let a=performance.now(),l=620,c=d=>{if(!n.getLayer())return;let h=Math.min(1,(d-a)/l);n.radius(s*(1+h*1.8)),n.opacity(.9*(1-h)),i.overlayLayer.batchDraw(),h<1?requestAnimationFrame(c):(n.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(c)}function fn(i,e,t){for(let o of e){let s=i.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(h=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,h))):o.outline.map(h=>{let p=o.liftWorld>0?i.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:h.x+p.x,y:h.y+p.y}}),n=s.reduce((h,p)=>({x:h.x+p.x,y:h.y+p.y}),{x:0,y:0});n.x/=s.length,n.y/=s.length;let r=new Xa({x:n.x,y:n.y,points:s.flatMap(h=>[h.x-n.x,h.y-n.y]),closed:!0,stroke:t,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:t,shadowBlur:14,shadowOpacity:.7});i.overlayLayer.add(r),i.overlayLayer.batchDraw();let a=()=>{r.getLayer()&&(r.destroy(),i.overlayLayer.batchDraw())};if(i.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=h=>{if(i.isDestroyed()||!r.getLayer())return;let p=Math.min(1,(h-l)/c),y=1+(1-Math.pow(1-p,3))*.04;r.scale({x:y,y}),r.opacity(.92*(1-p)),i.overlayLayer.batchDraw(),p<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as qa}from"konva/lib/Group";import{Shape as Za}from"konva/lib/Shape";import{Group as Ya}from"konva/lib/Group";import{Shape as Ua}from"konva/lib/Shape";function $a(i,e,t){let o=e.length,s={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};i.moveTo(s.x,s.y);for(let n=0;n<o;n+=1){let r=e[n],a=e[(n+1)%o],l=e[(n-1+o)%o],c=Math.min(Math.hypot(r.x-l.x,r.y-l.y)/2,Math.hypot(a.x-r.x,a.y-r.y)/2);i.arcTo(r.x,r.y,a.x,a.y,Math.max(0,Math.min(t,c)))}i.closePath()}function Ae(i,e,t,o){let s=Ze(i)>0,n=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new Ua({...t,sceneFunc(r,a){r.beginPath();let l=d=>{if(d.length){if(n>0&&d.length>=3)return $a(r,d,n);r.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h+=1)r.lineTo(d[h].x,d[h].y);r.closePath()}};o?(d=>{r.moveTo(d.start.x,d.start.y);let h=d.start;for(let p of d.segments)p.kind==="line"?r.lineTo(p.end.x,p.end.y):p.kind==="arc"?r.arc(p.center.x,p.center.y,p.radius,Math.atan2(h.y-p.center.y,h.x-p.center.x),Math.atan2(p.end.y-p.center.y,p.end.x-p.center.x),!p.clockwise):r.bezierCurveTo(p.control1.x,p.control1.y,p.control2.x,p.control2.y,p.end.x,p.end.y),h=p.end;r.closePath()})(o):l(i);for(let d of e??[]){let h=Ze(d)>0;l(h===s?[...d].reverse():d)}r.fillStrokeShape(a)},perfectDrawEnabled:!1})}var lt=class extends Ya{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(t){t!==this.viewportCulled&&(this.viewportCulled=t,t||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...t){return this.viewportCulled?this:super.drawScene(...t)}drawHit(...t){return this.viewportCulled?this:super.drawHit(...t)}_clearSelfAndDescendantCache(t){if(!this.viewportCulled){super._clearSelfAndDescendantCache(t);return}this._clearCache(t)}};function mn(i,e){if(!e.length)return null;let t=new qa({listening:!1});for(let o of e){let s=i.viewMode==="perspective"&&o.perspectiveAffine,n=s?o.outline.map(a=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,a))):o.outline,r=s?o.holes.map(a=>a.map(l=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,l)))):o.holes;t.add(Ae(n,r,{fill:bs,stroke:B("#ffffff",.1),strokeWidth:1,listening:!1},s?void 0:o.outlinePath))}return i.bgLayer.add(t),t.moveToTop(),t}function yn(i,e){let{bounds:t}=i,s=Math.max(t.width,t.height,1)*4+1e3,n=[{x:t.x-s,y:t.y-s},{x:t.x+t.width+s,y:t.y-s},{x:t.x+t.width+s,y:t.y+t.height+s},{x:t.x-s,y:t.y+t.height+s}],r=new Za({fill:i.canvasBackground,opacity:1-xe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=d=>{if(d.length){a.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h++)a.lineTo(d[h].x,d[h].y);a.closePath()}};a.beginPath(),c(n);for(let d of e){let h=i.viewMode==="perspective"&&d.perspectiveAffine?d.outline.map(p=>i.perspectiveLocalPoint(i.projectedSectionPoint(d,p))):d.outline.map(p=>{let m=d.liftWorld>0?i.isoLiftLocal(d.liftWorld):{x:0,y:0};return{x:p.x+m.x,y:p.y+m.y}});c(Ze(h)>0?[...h].reverse():h)}a.fillStrokeShape(l)}});return i.overlayLayer.add(r),r.moveToTop(),r}import{Rect as Lr}from"konva/lib/shapes/Rect";import{Line as Ul}from"konva/lib/shapes/Line";import{Text as zi}from"konva/lib/shapes/Text";import{Path as $l}from"konva/lib/shapes/Path";var Ut=1.12;function _i(i){return{x:i.width()/2,y:i.height()/2}}function gn(i,e,t){if(e.width<=0||e.height<=0)return i.scaleX();let o=Math.min(i.width()/(e.width*Ut),i.height()/(e.height*Ut));return G(o,t.min,t.max)}function bn(i,e,t,o){let s=G(e,o.min,o.max),n=i.scaleX();if(s===n)return!1;let r=(t.x-i.x())/n,a=(t.y-i.y())/n;return i.scale({x:s,y:s}),i.position({x:t.x-r*s,y:t.y-a*s}),!0}function Sn(i,e,t,o){let s=Math.min(i.width()/(e.width*Ut),i.height()/(e.height*Ut)),n=G(Math.max(s,o??t.min),t.min,t.max);i.scale({x:n,y:n}),i.position({x:i.width()/2-(e.x+e.width/2)*n,y:i.height()/2-(e.y+e.height/2)*n})}function vn(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Zo:qo}function wn(i){return Math.max(i*1.05,zo,re*1.3)}function kn(i,e){let t=1/0,o=-1/0,s=1/0,n=-1/0;for(let r of i)t=Math.min(t,r.x),o=Math.max(o,r.x),s=Math.min(s,r.y),n=Math.max(n,r.y);return t-=e,o+=e,s-=e,n+=e,{x:t,y:s,width:Math.max(40,o-t),height:Math.max(40,n-s)}}function Ln(i){let{stageWidth:e,stageHeight:t,fullBounds:o,visibleBounds:s,seatPoints:n,minScale:r}=i;if(e>=oe||!n.length)return null;let a=1.12;if(Math.min(e/(o.width*a),t/(o.height*a))>=r)return null;let c=i.tapAnchor??{x:s.x+s.width/2,y:s.y+s.height/2},d=n[0],h=1/0;for(let y of n){let u=(y.x-c.x)**2+(y.y-c.y)**2;u<h&&(d=y,h=u)}let p=e/(r*a),m=t/(r*a);return{bounds:{x:d.x-p/2,y:d.y-m/2,width:p,height:m},minScale:r}}var xn=.5,H=Math.SQRT1_2,Qa="#f3f4f6",Tn=4;function ja(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?xn:Math.min(1,Math.max(0,e))}function Ja(i){return i==="booked"||i==="not_for_sale"?it:Nt}function Cn(i,e){return Number.parseInt(i.slice(e,e+2),16)}function Pn(i){let e=i.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,t,o,s]=e.toLowerCase();return`#${t}${t}${o}${o}${s}${s}`}function el(i,e,t){let o=Pn(i),s=Pn(e);if(!o||!s)return i;let n=Math.min(1,Math.max(0,t)),r="#";for(let a=1;a<7;a+=2){let l=Math.round(Cn(o,a)*(1-n)+Cn(s,a)*n);r+=l.toString(16).padStart(2,"0")}return r}function In(i,e,t,o){let s=t*4,n=e*H,r=-e*H,a=o*H*2*s,l=o*-H*2*s,c=n+s*H,d=r+s*H,h=n-s*H,p=r-s*H;i.beginPath(),i.moveTo(c,d),i.lineTo(h,p),i.lineTo(h+a,p+l),i.lineTo(c+a,d+l),i.closePath(),i.clip()}function tl(i,e){let t=e*4,o=Math.max(e*.45,1);i.beginPath();for(let s=-Tn;s<=Tn;s++){let n=s*o*2,r=n+o,a=n*H,l=-n*H,c=r*H,d=-r*H;i.moveTo(a+t*H,l+t*H),i.lineTo(a-t*H,l-t*H),i.lineTo(c-t*H,d-t*H),i.lineTo(c+t*H,d+t*H),i.closePath()}i.clip()}function $t(i,e){i._sceneFunc(e)}function Mn(i){let e=this,t=e.attrs,o=t.markRadius||1,s=t.fill,n=e.getStage(),r=Math.abs((n?n.scaleX():1)*(e.scaleX()||1))||1;if(o*2*r<16){t.fill=t.markMidtone??s,$t(e,i),t.fill=s;return}let l=(1-2*(t.markFraction??xn))*o;i.save(),In(i,l,o,1),t.fill=t.markBase??s,$t(e,i),i.restore(),i.save(),In(i,l,o,-1),t.fill=t.markFill??s,$t(e,i),t.markHatch&&(tl(i,o),t.fill=Qa,$t(e,i)),i.restore(),t.fill=s}function il(i,e,t,o,s,n){let r=ja(e),a=Ja(t),l=i.attrs;l.markFraction=r,l.markBase=o,l.markFill=a,l.markMidtone=el(o,a,1-r),l.markHatch=n,l.markRadius=s>0?s:1,i.fill(l.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(Mn)}function ol(i){i.setAttr("sceneFunc",void 0)}function Bi(i){return i.attrs.sceneFunc===Mn}var qt=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,t){let o=new Set;for(let[s,n]of Object.entries(e))t.has(s)&&(n&&n.kind==="partial"?(this.marks.set(s,n),o.add(s)):this.marks.delete(s)&&o.add(s));return o}paint(e,t,o,s,n,r,a){let l=a?void 0:this.marks.get(t);if(!l){Bi(e)&&ol(e);return}il(e,l,o,s,n,r)}};function Zt(i){let e=i.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(i.offsetX(e.x+e.width/2),i.offsetY(e.y+e.height/2))}var Rn=.85,sl=[2,2],nl=1,En=.6;function rl(i){return U(i)?"#334155":"#e2e8f0"}function An(i,e,t){return i==="held"?{fill:Nt,stroke:rl(e),strokeWidth:nl,dash:[...sl],opacity:1,scale:1}:i==="booked"||i==="not_for_sale"?t?{fill:"rgba(0,0,0,0)",stroke:it,strokeWidth:1.5,dash:[],opacity:.9,scale:Rn}:{fill:it,stroke:"",strokeWidth:0,dash:[],opacity:i==="booked"?.45:.6,scale:Rn}:null}var Fi=1e6;function al(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var Qt=class{constructor(e,t=al()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.lastTapAt=0;this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button)};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let t=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,t)&&this.applyPointerMove(t)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.beginPointer(Fi+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}};this.onTouchMove=e=>{e.preventDefault();let t=null;for(let o=0;o<e.changedTouches.length;o+=1){let s=e.changedTouches.item(o);if(!s)continue;let n=this.toLocal(s.clientX,s.clientY);this.updatePointer(Fi+s.identifier,n)&&(t=n)}t&&this.applyPointerMove(t)};this.onTouchEnd=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.endPointer(Fi+o.identifier)}};this.host=e,this.useWebKitTouchEvents=t}get moved(){return this.movedPx}attach(){let{container:e}=this.host;e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;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<Ko}toLocal(e,t){let o=this.host.container.getBoundingClientRect();return{x:e-o.left,y:t-o.top}}beginPointer(e,t,o,s){if(this.host.cancelGlide(),this.pointers.set(e,t),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(t),this.pinch=null,this.panStart=t,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:s})?(this.host.beginMarquee(t),this.panLast=null):this.panLast=t;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[n,r]=[...this.pointers.values()],a={x:(n.x+r.x)/2,y:(n.y+r.y)/2},l=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(r.x-n.x,r.y-n.y),startScale:l,worldMid:{x:(a.x-this.host.stage.x())/l,y:(a.y-this.host.stage.y())/l}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+1}}updatePointer(e,t){return this.pointers.has(e)?(this.pointers.set(e,t),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(t.x-this.panStart.x,t.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=we+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>we?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[t,o]=[...this.pointers.values()],s=Math.hypot(o.x-t.x,o.y-t.y);if(this.pinch.startDist<1)return;let n={x:(t.x+o.x)/2,y:(t.y+o.y)/2},{min:r,max:a}=this.host.zoomBounds(),l=G(this.pinch.startScale*(s/this.pinch.startDist),r,a);this.host.stage.scale({x:l,y:l}),this.host.stage.position({x:n.x-this.pinch.worldMid.x*l,y:n.y-this.pinch.worldMid.y*l}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(e.x-this.panLast.x),y:this.host.stage.y()+(e.y-this.panLast.y)}),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.endTouchProbe(),this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as ll}from"konva/lib/shapes/Circle";import{Group as cl}from"konva/lib/Group";import{Text as dl}from"konva/lib/shapes/Text";var _n=13,hl=15,ul=.3,pl=.08;function Dn(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function fl(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?Y("map.soldOut"):Y("map.seatsLeft",{count:i.available})}function ml(i,e){return e&&i.available!=null&&i.available<=0}function Gn(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),o=i.overviewHidden(e),s=ml(e,i.pickerMode),n=i.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:i.dimmed(e.categoryKey)?Ce*pl:s?Ce*ul:Ce),e.polygon.listening(!i.exportMode&&!o&&!t&&!s),e.polygon.stroke(n>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(n>0?3:1.5),yl(i,e,s,n,o,i.dimmed(e.categoryKey))}}function yl(i,e,t,o,s,n){if(e.capacityNode){let r=fl(e,i.pickerMode);e.capacityNode.text()!==r&&(e.capacityNode.text(r),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}gl(i,e,s||n),o>0&&!s?Sl(i,e,o):e.chip&&e.chip.visible(!1)}var Oi=9,Bn=.86;function gl(i,e,t){let{labelNode:o,capacityNode:s}=e;if(!o&&!s)return;let n=Math.max(i.effScale(),1e-4);if(t){o?.visible(!1),s?.visible(!1);return}if(!i.pickerMode){o?.visible(i.labelLegible(o.fontSize())),s?.visible(i.labelLegible(s.fontSize()));return}let r=bl(e,n),a=Fn(o,Lt,r.width*Bn,n),l=Fn(s,Tt,r.width*Bn,n),c=a!=null,d=l!=null&&c&&a+l+Oi<=r.height;On(o,c?a:null,e.labelPoint.y-Oi/n,n),On(s,d?l:null,e.labelPoint.y+Oi/n,n)}function bl(i,e){let t=1/0,o=-1/0,s=1/0,n=-1/0;for(let r of i.points)r.x<t&&(t=r.x),r.x>o&&(o=r.x),r.y<s&&(s=r.y),r.y>n&&(n=r.y);return Number.isFinite(t)?{width:(o-t)*e,height:(n-s)*e}:{width:0,height:0}}function Fn(i,e,t,o){if(!i||!i.text())return null;i.fontSize(e/o);let s=i.width()*o;if(s<=t||s<=0)return e;let n=e*(t/s);return n>=Z?n:null}function On(i,e,t,o){if(i){if(e==null){i.visible(!1);return}i.fontSize(e/o),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t),i.visible(!0)}}function Sl(i,e,t){if(!e.chip){let o=new cl({x:e.labelPoint.x,y:e.labelPoint.y-_n-16,listening:!1}),s=new ll({radius:_n,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),n=new dl({text:String(t),fontSize:hl,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(s),o.add(n),i.bgLayer.add(o),e.chip=o,e.chipText=n}e.chipText&&e.chipText.text()!==String(t)&&e.chipText.text(String(t)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function Hn(i,e){let t=!1;for(let[o,s]of Object.entries(e)){let n=i.get(o);n&&(s.available!==void 0&&n.available!==s.available&&(n.available=s.available,t=!0),s.selected!==void 0&&n.selected!==s.selected&&(n.selected=s.selected,t=!0))}return t}function Nn(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function Wn(i,e){let t=null;for(let o of i){let s=e.get(o)?.logicalId;if(!s||t!=null&&t!==s)return null;t=s}return t}function Vn(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}import{Rect as zn}from"konva/lib/shapes/Rect";import{Text as vl}from"konva/lib/shapes/Text";function Kn(i){let e=i.effScale(),t=i.stage.scaleX(),o={width:i.stage.width(),height:i.stage.height()},s=u=>Math.round(u*100)/100,n=new Map(i.overlayLayer.find(".selection-ring").map(u=>[String(u.getAttr("seatId")??""),String(u.getAttr("ringColor")??i.effSelection)])),r=i.seats.map(u=>{let f=i.circleById.get(u.id),b=i.boothLabelById.get(u.id)??i.seatLabelById.get(u.id),g=i.viewMode==="perspective"?i.perspectiveSeatScale.get(u.id)??1:1,S=(i.viewMode==="perspective"?t:e)*g,v=u.kind==="booth"?Te:fe*i.seatLabelScale(u),w=i.viewMode==="perspective"&&u.kind!=="booth"?e*g:S,k=s((b?.fontSize()??v)*w),T=i.worldToScreen(u),C=b?b.width()*t*g:0,L=b?b.height()*(i.viewMode==="perspective"&&u.kind==="booth"?t:e)*g:0,I=T.x-C/2<0||T.x+C/2>o.width||T.y-L/2<0||T.y+L/2>o.height,x=i.focusedSeatOpacity(u.id,f?.getAbsoluteOpacity()??0),M=i.seatSection.get(u.id),R=!!b?.isVisible()&&x>=.5&&!I,P;R||(x<.5?P="dimmed-or-unavailable":k<Z?P="below-minimum-size":I?P="outside-viewport":b?P="renderer-hidden":P="clutter-or-fit");let A=f instanceof zn?f.width()*t*g:i.seatR*2*S,_=f instanceof zn?f.height()*(i.viewMode==="perspective"?t:e)*g:i.seatR*2*S,j=2*(i.seatR*S+Ie),V=f?.fill(),z=b?.fill(),J=i.accessGlyphById.get(u.id),O=J?.getAbsoluteScale();return{seatId:u.id,label:u.label,kind:u.kind==="booth"?"booth":"seat",markerShape:u.kind==="booth"?"booth":u.wheelchairSpaceType==="no-seat"?"square":"circle",...u.wheelchairSpaceType?{wheelchairSpaceType:u.wheelchairSpaceType}:{},categoryKey:u.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:i.statusById.get(u.id)??"free",selected:i.selection.has(u.id),visible:R,renderedFontPx:k,fill:typeof V=="string"?V:"",ink:typeof z=="string"?z:f?i.seatLabelInk(u,f):i.seatPreferredLabelInk(u),...n.has(u.id)?{selectionRingColor:n.get(u.id)}:{},opacity:s(x),...J?{accessibilityMarker:{glyphVisible:J.isVisible(),glyphWidthPx:s(ve*Math.abs(O?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(u.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(u.id)&&!!f?.isVisible()&&!!f?.isListening()&&i.isSelectable(u.id),directWidthPx:s(A),directHeightPx:s(_),effectiveMinimumPx:s(Math.max(Math.min(A,_),j))},screenCenter:{x:s(T.x),y:s(T.y)},...R?{screenBox:{x:s(T.x-C/2),y:s(T.y-L/2),width:s(C),height:s(L)}}:{},...P?{hiddenReason:P}:{}}}),a=r.filter(u=>u.visible).length,l=(u,f,b,g,S,v)=>{let w=ze({x:g.x(),y:g.y()},g.width(),g.height(),g.rotation()),k=v&&v.liftWorld>0?i.isoLiftLocal(v.liftWorld):{x:0,y:0},T=N(w.map(R=>i.worldToScreen({x:R.x+k.x,y:R.y+k.y}))),C=s(g.opacity()),L=g.fill(),I=T.x+T.width<0||T.x>o.width||T.y+T.height<0||T.y>o.height,x=g.isVisible()&&C>.05&&!I,M=v?Yt({x:g.x(),y:g.y()},g.width(),g.height(),g.rotation(),v.outline,v.holes):void 0;return{id:u,kind:f,role:b,label:g.text(),visible:x,renderedFontPx:s(g.fontSize()*t),opacity:C,fill:S,ink:typeof L=="string"?L:"",...M==null?{}:{fitsContainer:M},...x?{screenBox:{x:s(T.x),y:s(T.y),width:s(T.width),height:s(T.height)}}:{}}},c=u=>{let f=u.namePlate.fill();if(u.namePlate.opacity()>.05&&typeof f=="string"&&f)return f;let b=u.blockPoly.fill();return typeof b=="string"?b:u.baseFill},d=[...i.sections.map(u=>l(u.id,"section","name",u.nameLabel,c(u),u)),...i.sections.map(u=>l(`${u.id}:availability`,"section","availability",u.subLabel,c(u),u)),...i.zones.flatMap(u=>[l(u.id,"zone","name",u.label,u.background),...u.sub?[l(`${u.id}:price`,"zone","price",u.sub,u.background)]:[]])],h=[...i.gaById].map(([u,f])=>{let b=f.points.map(I=>i.worldToScreen(I)),g=Math.min(...b.map(I=>I.x)),S=Math.min(...b.map(I=>I.y)),v=Math.max(...b.map(I=>I.x)),w=Math.max(...b.map(I=>I.y)),k=v<0||g>o.width||w<0||S>o.height,T=s(f.polygon.opacity()),C=T>=.1&&!k,L=f.polygon.fill();return{areaId:u,label:f.label,capacity:f.capacity,categoryKey:f.categoryKey,...f.sectionId?{sectionId:f.sectionId}:{},visible:C,interactive:f.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:f.effectiveBackground,...C?{screenBox:{x:s(g),y:s(S),width:s(v-g),height:s(w-S)}}:{}}}),p=[...i.freeTextById].map(([u,f])=>{let{node:b,background:g,kind:S}=f,v=i.worldToScreen({x:b.x(),y:b.y()}),w=b.width()*t,k=b.height()*e,T=v.x-b.offsetX()*t,C=v.y-b.offsetY()*e,L=s(b.fontSize()*e),I=T+w<0||T>o.width||C+k<0||C>o.height,x=b.isVisible()&&!I,M=b.fill(),R=s(b.getAbsoluteOpacity()),P;return x||(L<Z?P="below-minimum-size":I?P="outside-viewport":P="renderer-hidden"),{objectId:f.objectId??u,kind:S,text:b.text(),visible:x,renderedFontPx:L,ink:typeof M=="string"?M:"",background:g,opacity:R,...x?{screenBox:{x:s(T),y:s(C),width:s(w),height:s(k)}}:{},...P?{hiddenReason:P}:{}}}),m=i.labelGroup.find(u=>u.getAttr("rowLabel")===!0).filter(u=>u instanceof vl).map(u=>{let f=u.getClientRect({skipShadow:!0,skipStroke:!0}),b=f.x+f.width<0||f.x>o.width||f.y+f.height<0||f.y>o.height,g=u.fill();return{text:u.text(),visible:u.isVisible()&&!b,renderedFontPx:s(u.fontSize()*e),ink:typeof g=="string"?g:"",...b?{}:{screenBox:{x:s(f.x),y:s(f.y),width:s(f.width),height:s(f.height)}}}}),y=i.sections.filter(u=>u.blockPoly.opacity()>.05);return{viewport:o,projection:i.viewMode,...i.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:i.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:i.canvasBackground,effectiveScale:s(e),rung:i.getRung(),minimumVisibleLabelPx:Z,totalLabelledBookableUnits:r.length,visibleLabels:a,hiddenLabels:r.length-a,totalBookableUnits:r.length+h.reduce((u,f)=>u+f.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(u=>String(u.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:i.effSelection,focusedSectionId:i.focusedSectionId,focusBackdropVisible:!!i.focusBackdrop?.isVisible(),categoryFilterKeys:i.categoryFilter?[...i.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(u=>{let f=u.blockPoly.fill();return typeof f!="string"||!wi(i.canvasBackground,f)}).length,tintedSectionShells:y.filter(u=>{let f=u.blockPoly.fill();return typeof f=="string"&&ks(i.canvasBackground,f)}).length,visibleCategoryDetailOutlines:i.sections.filter(u=>u.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(u=>u.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(u=>u.sectionId!=null&&u.polygon.opacity()>.05).length},labels:r,gaAreas:h,hierarchyLabels:d,freeTextLabels:p,rowLabels:m}}import{Circle as wl}from"konva/lib/shapes/Circle";import{Ellipse as kl}from"konva/lib/shapes/Ellipse";import{Line as Xn}from"konva/lib/shapes/Line";import{Arrow as Ll}from"konva/lib/shapes/Arrow";import{Path as Tl}from"konva/lib/shapes/Path";import{Rect as ct}from"konva/lib/shapes/Rect";import{Text as Gi}from"konva/lib/shapes/Text";import{Image as Yn}from"konva/lib/shapes/Image";function Un(i,e){if(!e.url||e.visible===!1)return;let t=new window.Image;i.trackAssetImage(t,e.url,"Buyer background image",()=>{let o=t.naturalWidth||4,s=t.naturalHeight||3,n=e.crop??{x:0,y:0,width:1,height:1},r=Math.max(0,Math.min(.99,n.x)),a=Math.max(0,Math.min(.99,n.y)),l={x:r,y:a,width:Math.max(.01,Math.min(1-r,n.width)),height:Math.max(.01,Math.min(1-a,n.height))},c=e.width,d=c*(s*l.height/(o*l.width)),h=new Yn({image:t,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*o,y:l.y*s,width:l.width*o,height:l.height*s},opacity:e.opacity,listening:!1});i.bgLayer.add(h),h.moveToBottom(),i.bgLayer.batchDraw()})}function $n(i,e){let t=new window.Image,o=new Yn({image:t,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:G(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?i.fgDecorGroup.add(o):i.bgLayer.add(o),e.role&&i.landmarkBoxes.push(N(ze({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),i.trackAssetImage(t,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let s=o.getLayer();s&&s.batchDraw()})}function qn(i,e){if(e.shape==="round")i.bgLayer.add(new wl({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,listening:!1}));else{let o=e.width??80,s=e.height??50;i.bgLayer.add(new ct({x:e.center.x,y:e.center.y,width:o,height:s,offsetX:o/2,offsetY:s/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}let t=dt(i,i.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);i.freeTextById.set(e.id,{node:t,background:"#232c40",kind:"table"})}var Cl=8,Pl=6;function Zn(i,e){let t=e.background?.color??i.canvasBackground,o=X(t,e.color??i.theme.textColor??sn),s=e.semanticKind==="icon"?Ro(e.iconKey):void 0;if(s){let c=e.fontSize/24,d=new Tl({x:e.position.x,y:e.position.y,data:s,rotation:e.rotation,scaleX:c,scaleY:c,stroke:X(t,o),strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});i.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),i.bgLayer.add(d);return}let n=e.background?.padding??0,r=e.opacity??1,a=new Gi({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:nn(e.bold,e.italic,"600"),fill:X(t,o),fontFamily:e.fontFamily??i.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:n,opacity:r,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),l;if(e.background){let c=a.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),d=Math.max(Cl,e.fontSize*.35),h=Math.max(Pl,e.fontSize*.28);l=new ct({x:e.position.x,y:e.position.y,offsetX:-(c.x-d),offsetY:-(c.y-h),width:c.width+d*2,height:c.height+h*2,rotation:e.rotation,fill:e.background.color,opacity:r*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(l)}i.freeTextById.set(e.id,{node:a,backdrop:l,background:t,kind:"free-text"}),i.bgLayer.add(a)}function Qn(i,e){let t=e.fill??i.theme.decorFill??on,o=e.role==="stage",s=e.role==="reference-focal",n=!!e.role&&!o,r=le(i.canvasBackground),a=s?r.focalFill:t,l=e.kind==="line"||e.kind==="polyline",c=e.stroke?.color??(o?Se(a,.28):s?r.focalStroke:l?"#9aa3b5":void 0),d=e.stroke?.width??(o?1:s||l?2:0),h=e.opacity!=null?G(e.opacity,.1,1):1,p=0,m=0,y=null;if(l&&e.points&&e.points.length>=2){p=e.points.reduce((g,S)=>g+S.x,0)/e.points.length,m=e.points.reduce((g,S)=>g+S.y,0)/e.points.length;let u=Eo(e),f=Ao(d),b=new Ll({points:e.points.flatMap(g=>[g.x,g.y]),closed:!1,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:c,fill:c,strokeWidth:d,opacity:h,lineCap:u.lineCap,lineJoin:u.lineJoin,pointerAtBeginning:u.startEnding==="arrow",pointerAtEnding:u.endEnding==="arrow",...f,listening:!1,name:"buyer-shape-open-path"});b.setAttr("shapeObjectId",e.id),i.bgLayer.add(b)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let u=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};p=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height},i.bgLayer.add(new ct({x:p,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...u,stroke:c,strokeWidth:d,cornerRadius:G(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){p=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height};let u=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};i.bgLayer.add(new kl({x:p,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...u,stroke:c,strokeWidth:d,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let u=e.points.flatMap(g=>[g.x,g.y]),f=N(e.points);p=e.points.reduce((g,S)=>g+S.x,0)/e.points.length,m=e.points.reduce((g,S)=>g+S.y,0)/e.points.length,y=f;let b=o?{fillLinearGradientStartPoint:{x:0,y:f.y},fillLinearGradientEndPoint:{x:0,y:f.y+f.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};i.bgLayer.add(new Xn({points:u,closed:!0,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,...b,stroke:c,strokeWidth:d,opacity:h,listening:!1}))}y&&e.role&&i.landmarkBoxes.push(y);for(let u of Bo(e))i.bgLayer.add(new Xn({points:u.points.flatMap(f=>[f.x,f.y]),closed:u.closed,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:u.ink??_o,fill:u.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:u,spec:f}=xl(i,p,m,e.label,a,y);i.primaryFocalLabels.set(u,f),i.freeTextById.set(e.id,{node:u,background:a,kind:"stage"})}else if(n){let u=dt(i,i.bgLayer,e.label,p,m,s?X(a,"#e6e9f0"):"#9aa3b5",s?18:12,!1);s&&i.primaryFocalLabels.set(u,{targetPx:18,trackingRatio:0,ink:String(u.fill()??""),plateInk:String(u.fill()??""),plate:new ct({width:0,height:0,opacity:0,listening:!1})}),i.freeTextById.set(e.id,{node:u,background:a,kind:"decor"})}else{let u=dt(i,i.bgLayer,e.label,p,m,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:u,background:a,kind:"decor"})}}var Di=22,Il=Z,jt=6;function xl(i,e,t,o,s,n){let r=X(s,i.theme.textColor??"#e6e9f0"),a=n?n.x+n.width/2:e,l=n?n.y+n.height/2:t,c=Ml(i.canvasBackground,s),d=new ct({x:a,y:l,width:0,height:0,cornerRadius:4,fill:c,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(d);let h=new Gi({x:a,y:l,text:o.toUpperCase(),fontSize:Di,fontStyle:"700",letterSpacing:4,fontFamily:i.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return h.offsetX(h.width()/2),h.offsetY(h.height()/2),i.bgLayer.add(h),{node:h,spec:{targetPx:Di,...n?{bounds:n}:{},trackingRatio:4/Di,ink:r,plateInk:X(c,i.theme.textColor??"#e6e9f0"),plate:d}}}function Ml(i,e){return pe(e,U(i)?"#ffffff":"#000000",.34)}function jn(i,e,t,o){let s=Math.max(t,1e-4),n=e.targetPx/s,r=m=>{i.letterSpacing(m*e.trackingRatio),o(i,m)};r(n);let a=e.bounds;if(!a){e.plate.opacity(0),i.fill(e.ink);return}let l={width:a.width-jt*2,height:a.height-jt*2},c=Math.min(1,l.width/Math.max(i.width(),1e-6),l.height/Math.max(i.height(),1e-6));if(c<1&&(n=Math.max(Il/s,n*c),r(n)),i.width()<=l.width&&i.height()<=l.height){e.plate.opacity(0),i.fill(e.ink);return}let h=i.width()+jt*2,p=i.height()+jt;e.plate.size({width:h,height:p}),e.plate.offset({x:h/2,y:p/2}),e.plate.opacity(1),i.fill(e.plateInk)}function Jn(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",o=i.canvasBackground,s=bo(t,o,Ce),n=i.theme.textColor??"#e6e9f0",r=X(s,n),a=Ae(e.points,e.holes,{fill:t,opacity:Ce,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",p=>{i.isGhostClick(p)||i.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{i.container.style.cursor="pointer"}),a.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(a);let l=St(e.points,e.holes),c=i.sections.find(p=>ie(l,p.outline,p.holes)),d=dt(i,i.bgLayer,e.displayLabel??e.label,l.x,l.y-8,r,Lt,!1),h=dt(i,i.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,r,Tt,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:d,background:s,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:s,kind:"ga-capacity",categoryKey:e.categoryKey}),i.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:s,strokeColor:t,labelPoint:l,labelNode:d,capacityNode:h,...c?{sectionId:c.logicalId}:{}})}function dt(i,e,t,o,s,n,r,a){let l=new Gi({x:o,y:s,text:t,fontSize:r,fontStyle:a?"700":"500",fontFamily:i.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function er(i,e){let t=[],o=e.theme.background??"#f7f8fb",s=new Map,n=(c,d)=>{let h=s.get(c)??[];h.push(d),s.set(c,h)};for(let c of e.seats){if(c.kind==="booth")continue;let d=c.logicalRowId??c.rowId;n(d,c),d!==c.rowId&&n(c.rowId,c)}let r=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of i.objects){if(c.type!=="row")continue;let d=c.segmentedRow?.repeatLabelOnComponents===!0;if(c.segmentedRow&&!d&&c.segmentedRow.componentIndex!==0)continue;let h=d?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(h?.visible===!1||h?.positionPreset==="none")continue;let p=c.segmentedRow&&!d?c.segmentedRow.groupId:c.id,m=(s.get(p)??[]).slice().sort((P,A)=>r(P)-r(A));if(!m.length)continue;let y=m[0],u=m[m.length-1],f=h?.labelStyle,b=X(o,f?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",It),g=f?.size??go,S=h?.rotation??0,v=e.objectFilteredOut(c)?.15:1,w=e.seatSection.get(y.id),k=c.segmentedRow?.displayLabel??c.displayLabel,T=w?.label.trim(),C=T&&c.label.toLocaleLowerCase("en-US").startsWith(`${T.toLocaleLowerCase("en-US")} `)?c.label.slice(T.length).trim():"",L=k??(/^[\p{L}\p{N}]{1,4}$/u.test(C)?C:c.label),I=w?[...new Set([w.id,w.logicalId,w.zone].filter(P=>!!P))]:void 0,x=(P,A,_)=>t.push({text:L,x:P,y:A,rotation:S,fontSize:g,ink:b,opacity:v,...I?.length?{focusKeys:I}:{},..._?{automaticAway:_}:{}});if(h?.position){x(h.position.x,h.position.y);continue}let M=e.seatR+12,R=h?.positionPreset??"start";if(R==="start"||R==="both"){let P=c.rotation*Math.PI/180,A={x:-Math.cos(P),y:-Math.sin(P)};x(y.x+A.x*M,y.y+A.y*M,A)}if(R==="end"||R==="both"){let P=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(P),y:Math.sin(P)};x(u.x+A.x*M,u.y+A.y*M,A)}}let a=(e.seatR+12)*2.2,l=[];for(let c of t){let d=l.find(h=>h.text===c.text&&Math.hypot(h.x-c.x,h.y-c.y)<=a);if(d){d.x=(d.x+c.x)/2,d.y=(d.y+c.y)/2;continue}l.push(c)}return l}function Hi(i,e,t=Q){let o=i.rotation()*Math.PI/180,s=Math.abs(Math.cos(o)),n=Math.abs(Math.sin(o)),r=(i.width()*s+i.height()*n)/2+t,a=(i.width()*n+i.height()*s)/2+t;return{x:e.x-r,y:e.y-a,width:r*2,height:a*2}}function tr(i,e,t,o){let s={x:e.x,y:e.y},n=e.automaticAway;if(!n)return s;let r={x:-n.y,y:n.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let p=1;p<=4;p++){let m=a*p;l.push({x:r.x*m,y:r.y*m},{x:-r.x*m,y:-r.y*m},{x:n.x*m,y:n.y*m},{x:(n.x+r.x)*m,y:(n.y+r.y)*m},{x:(n.x-r.x)*m,y:(n.y-r.y)*m})}let c=s,d=1/0,h=1/0;for(let p of l){let m={x:s.x+p.x,y:s.y+p.y},y=Hi(i,m),f=(o?Rt(o,y,{mode:"overlap"}).length:0)+t.collisionCount(y),b=Math.hypot(p.x,p.y);if((f<d||f===d&&b<h)&&(c=m,d=f,h=b),f===0)break}return c}function ir(i,e){let t=i.sectionHeat.get(e.id)??i.sectionHeat.get(e.logicalId)??(e.zone?i.sectionHeat.get(e.zone):void 0);if(t==null||t<=0){e.outlinePoly.stroke(B(e.outlineTint,.5)),e.outlinePoly.fill(B(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=pe("#f4b740","#ef4444",t);e.outlinePoly.stroke(B(o,.72+t*.25)),e.outlinePoly.fill(B(o,.08+t*.13)),e.outlinePoly.strokeWidth(2+t*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+t*12),e.outlinePoly.shadowOpacity(.25+t*.45)}function Wi(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function or(i,e){return Wi(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*ms?"nearly-gone":"normal"}function sr(i,e){let t=or(i,e),o=i.accessFilterActive&&i.sectionAccessibleFree(e)<=0,s=ws(i.canvasBackground,t,o?null:e.shellCategoryColor);e.shellFill=s.fill,e.shellStroke=s.stroke,e.blockPoly.fill(s.fill),e.blockPoly.stroke(s.stroke),e.subLabel.text(t==="sold-out"?Y("map.soldOut"):Y("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Rl(i,e){return pe(e,U(i)?"#ffffff":"#000000",hs)}function El(i,e,t=0){let o=ds-t;return!e||i.length<=o?i:`${i.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function Al(i,e){return i.accessFilterActive&&i.sectionAccessibleFree(e)>0}function _l(i,e,t){let o=Al(i,e),s=El(e.label,t,o?2:0),n=o?`\u267F ${s}`:s;e.nameLabel.text()!==n&&e.nameLabel.text(n),e.nameLabel.fontStyle(t?cs:Ne),e.nameLabel.letterSpacing(t?e.nameLabel.fontSize()*tt:0)}function Bl(i,e,t){let o=i.stageWidth<oe,s=e.nameLabel.opacity();if(!o||s<=.05||!e.nameLabel.visible()){e.namePlate.opacity(0),e.subLabel.opacity(0);return}let n=e.nameLabel.rotation(),r=n===0&&or(i,e)==="sold-out",a=bi/t,l=ps/t,c=r?2/t:0,d={x:e.nameLabel.x(),y:e.nameLabel.y()},h=e.nameLabel.height(),p=0;r?(_e(e.subLabel,He/t,d.y),p=e.subLabel.height(),e.subLabel.rotation(0),e.subLabel.x(d.x),e.subLabel.y(d.y+h/2+c+p/2),e.subLabel.opacity(s)):e.subLabel.opacity(0);let m=r?c+p:0,y=Math.max(e.nameLabel.width(),r?e.subLabel.width():0)+a*2,u=h+m+l*2;e.namePlate.position({x:d.x,y:d.y+m/2}),e.namePlate.rotation(n),e.namePlate.size({width:y,height:u}),e.namePlate.offset({x:y/2,y:u/2}),e.namePlate.cornerRadius(fs/t),e.namePlate.opacity(s*us)}function nr(i,e){let t,o;i.reducedMotion?(t=e<=ge?1:0,o=e<=Ge?1:0):(t=G((be-e)/(be-ge),0,1),o=G((ge-e)/(ge-Ge),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,o=0);let s=!i.floorOverview&&!i.focusedSectionId&&e<re;s&&(t=1),i.zones.length||(o=0);let n=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(s||n?0:1-t);let r=i.stageScaleX,a=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);a&&i.setLodScale(e);let l=i.focusedSectionId,c=i.stageWidth<oe,d=le(i.canvasBackground),h=G((t-.2)/.8,0,1);for(let m of i.sections){let y=i.hasFocusDimOverlay?1:l&&m.id!==l&&m.logicalId!==l&&m.zone!==l?xe:1,u=Math.min(y,Vn(m.memberCategoryKeys,i.categoryFilter)?xe:1);m.outlinePoly.opacity(s?0:(1-t)*u),m.blockPoly.opacity(Qo*t*u);let f=i.sectionIsOwned(m);m.blockPoly.stroke(f?i.selectionColor:m.shellStroke||d.sectionStroke),m.blockPoly.strokeWidth((f?jo:Ft)/Math.max(r,1e-4));let b=m.blockPoly.fill(),g=typeof b=="string"?b:m.baseFill,S=c?Rl(i.canvasBackground,g):null;S&&m.namePlate.fill(S);let v=X(S??g,m.preferredInk);m.nameLabel.fill(v),m.subLabel.fill(v),_l(i,m,c),a&&h>.01&&Dl(i,m,r),m.nameLabel.opacity(m.nameLabelFits?h*(1-o)*u:0),m.subLabel.opacity(0)}let p=o*(1-i.isoT);for(let m of i.zones)m.back.opacity(p),m.label.opacity(p),m.sub&&m.sub.opacity(i.stageWidth<oe?0:p),a&&Hl(i,m,r);if(!i.glideInProgress&&(h>.01||p>.01)){Ol(i,r),Fl(i.sections);for(let m of i.zones){let y=m.label.opacity();m.back.opacity(y),m.sub&&m.sub.opacity(i.stageWidth<oe?0:y)}}for(let m of i.sections)Bl(i,m,r);i.bgLayer.batchDraw()}function Fl(i){let e=new Map;for(let t of i)(e.get(t.logicalId)??e.set(t.logicalId,[]).get(t.logicalId)).push(t);for(let t of e.values()){if(t.length<2)continue;let o=t.filter(s=>s.nameLabel.opacity()>.05).sort((s,n)=>{let r=N(s.outline),a=N(n.outline);return a.width*a.height-r.width*r.height});for(let s of o.slice(1))s.nameLabel.opacity(0)}}function Ol(i,e){let o=[],s=l=>{let c=i.worldToScreen({x:l.x(),y:l.y()}),d=N(ze({x:0,y:0},l.width()*e,l.height()*e,l.rotation()));return{x:c.x-d.width/2,y:c.y-d.height/2,w:d.width,h:d.height}};for(let l of i.zones){if(l.label.opacity()<=.05)continue;let c=l.back.getAbsolutePosition(),d=l.back.width()*e,h=l.back.height()*e;o.push({node:l.label,tier:0,section:!1,zone:l,box:{x:c.x-d/2,y:c.y-h/2,w:d,h}})}for(let l of i.sections)l.nameLabel.opacity()>.05&&o.push({node:l.nameLabel,tier:1,section:!0,area:l.labelArea,box:s(l.nameLabel)});let n=i.landmarks.map(l=>{let c=i.worldToScreen({x:l.x,y:l.y}),d=i.worldToScreen({x:l.x+l.width,y:l.y+l.height});return{x:Math.min(c.x,d.x),y:Math.min(c.y,d.y),w:Math.abs(d.x-c.x),h:Math.abs(d.y-c.y)}});if(o.length<2&&!n.length)return;o.sort((l,c)=>l.tier-c.tier||(c.area??0)-(l.area??0)||l.box.y-c.box.y||l.box.x-c.box.x);let r=[...n],a=l=>r.some(c=>l.x<c.x+c.w+4&&c.x<l.x+l.w+4&&l.y<c.y+c.h+4&&c.y<l.y+l.h+4);for(let l of o){if(!a(l.box)){r.push(l.box);continue}let c=!1;if(l.zone)for(let d of ls){if(d===0)continue;let h={...l.box,y:l.box.y+d};if(!a(h)){Ni(l.zone,0,d/e),r.push(h),c=!0;break}}if(l.section){let d=l.node.fontSize(),h=l.node.y(),p=l.node.letterSpacing()>0;for(let m of Jo){let y=d*m;if(y*e<He)break;_e(l.node,y,h),p&&(l.node.letterSpacing(l.node.fontSize()*tt),l.node.offsetX(l.node.width()/2));let u=s(l.node);if(!a(u)){r.push(u),c=!0;break}}c||(_e(l.node,d,h),p&&(l.node.letterSpacing(l.node.fontSize()*tt),l.node.offsetX(l.node.width()/2)))}c||l.node.opacity(0)}}function _e(i,e,t){i.fontSize(Math.max(1,e)),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t)}function Dl(i,e,t){e.subLabelFits=!1;let o=i.stageWidth<oe,s=o?bi*2:0,n=Ht(gi*e.labelScale,i.stageWidth),r=He;for(let a=n;a>=r;a-=1)for(let l of[0,-90]){e.nameLabel.rotation(l),_e(e.nameLabel,a/t,e.nameLabel.y()),o&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*tt),e.nameLabel.offsetX(e.nameLabel.width()/2));for(let c of e.labelAnchors){e.nameLabel.position(c);let d=(8+s)/t;if(Yt(c,e.nameLabel.width()+d,e.nameLabel.height()+d,l,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function Gl(i,e,t){let o=s=>(i.text(s),i.width());if(!(o(e)<=t)){for(let s=e.length-1;s>=1;s-=1)if(o(`${e.slice(0,s).trimEnd()}\u2026`)<=t)return;o("\u2026")}}function Hl(i,e,t){let o=Si(i.stageWidth),s=e.sub!=null&&i.stageWidth>=oe,n=i.stageWidth<oe,r=(n?ts:os)*o/t,a=(n?is:ss)*o/t,l=s?3*o/t:0;if(e.label.text(e.name),_e(e.label,Ht(Ot,i.stageWidth)/t,e.anchor.y),n){let g=i.stageWidth*as/t-r*2;Gl(e.label,e.name,Math.max(g,1)),_e(e.label,e.label.fontSize(),e.anchor.y)}e.label.x(e.anchor.x),s&&(_e(e.sub,Ht(Dt,i.stageWidth)/t,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*es),e.sub.offsetX(e.sub.width()/2),e.sub.x(e.anchor.x));let c=Math.max(e.label.width(),s?e.sub.width():0)+r*2,d=e.label.height()+(s?l+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(s?(l+e.sub.height())/2:0)),s&&e.sub.y(e.anchor.y+(e.label.height()+l)/2),e.back.position(e.anchor),e.back.size({width:c,height:d}),e.back.offset({x:c/2,y:d/2}),e.back.cornerRadius(ns*o/t),e.back.strokeWidth(1/t);let h=e.back.getAbsolutePosition(),p=6,m=c*t;if(m>i.stageWidth-p*2){e.label.opacity(0),e.back.opacity(0),e.sub&&e.sub.opacity(0);return}let y=m/2,f=(G(h.x,p+y,i.stageWidth-p-y)-h.x)/t;Math.abs(f)>.001&&Ni(e,f,0);let b=62+d*t/2;h.y<b&&Ni(e,0,(b-h.y)/t)}function Ni(i,e,t){i.label.x(i.label.x()+e),i.label.y(i.label.y()+t),i.sub&&(i.sub.x(i.sub.x()+e),i.sub.y(i.sub.y()+t)),i.back.x(i.back.x()+e),i.back.y(i.back.y()+t)}function rr(i,e){let t=e,o=t._cache.get("canvas");o&&(i.Util.releaseCanvas(o.scene._canvas,o.filter._canvas,o.hit._canvas),t._cache.delete("canvas"))}function ar(i,e){let t=0,o=0,s=n=>{t||(t=n),o+=1;let r=n-t;r>=1e3&&(i(Math.round(o*1e3/r)),o=0,t=n),e(requestAnimationFrame(s))};e(requestAnimationFrame(s))}import{Group as Nl}from"konva/lib/Group";import{Line as lr}from"konva/lib/shapes/Line";import{Rect as Wl}from"konva/lib/shapes/Rect";import{Text as cr}from"konva/lib/shapes/Text";function Vl(i,e){return i>=ae||e&&i>=_t}function zl(i){return i.effectiveScale<_t?!1:i.focusActive||i.stageWidth<oe}function Kl(i,e,t){return t&&e>=_t?Math.max(i,Yo/Math.max(e,1e-4)):i}function Xl(i,e){return Math.max(1,i*2-(e?1:3))}function dr(i){let e=i.exportMode?Math.max(i.effScale(),ae):i.effScale(),t=zl({effectiveScale:e,focusActive:i.focusedSectionId!=null,stageWidth:i.stage.width()}),o=Vl(e,t),s=a=>{let l=a.getClientRect({skipShadow:!0,skipStroke:!0});return l.x>=0&&l.y>=0&&l.x+l.width<=i.stage.width()&&l.y+l.height<=i.stage.height()};for(let[a,l]of i.boothLabelById){let c=i.circleById.get(a);l.visible(me(l.fontSize(),e)&&!!c?.isVisible()&&i.focusedSeatOpacity(a,c?.getAbsoluteOpacity()??1)>=.5&&s(l))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear();let n=0;if(o)for(let a of i.visibleSeatCandidates()){if(a.kind==="booth")continue;let l=i.worldToScreen(a);if(l.x<-20||l.x>i.stage.width()+20||l.y<-20||l.y>i.stage.height()+20||i.accessGlyphById.has(a.id)&&i.accessGlyphShouldShow(a.id))continue;let c=i.circleById.get(a.id);if(!c?.isVisible()||i.focusedSeatOpacity(a.id,c.getAbsoluteOpacity())<.5)continue;let d=i.statusById.get(a.id)??"free",h=i.renderedSeatPoint(a),p=i.viewMode==="perspective"?i.perspectiveSeatScale.get(a.id)??1:1;if(!i.hasSeatMark(a.id)&&(d==="booked"||d==="held"&&!i.ownedHold.has(a.id)&&!i.opts.manageMode)){let b=new Nl({x:h.x,y:h.y,listening:!1});if(b.scale({x:p,y:p}),d==="held"?(b.add(new Wl({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),b.add(new lr({points:[-2.4,-.8,-2.4,-2.7,-1.2,-4,0,-4.35,1.2,-4,2.4,-2.7,2.4,-.8],stroke:"#ffffff",strokeWidth:1.2,lineCap:"round",lineJoin:"round",listening:!1}))):(b.opacity(En),b.add(new lr({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1}))),Zt(b),i.seatLabelContainer(a.id).add(b),++n>=yi)break;continue}let y=Kl(fe*i.seatLabelScale(a),e,t),u=new cr({x:h.x,y:h.y,text:Pt(a.displayLabel??a.label),fontSize:y,fontStyle:"600",fontFamily:i.labelFont(),fill:c?i.seatLabelInk(a,c):i.seatPreferredLabelInk(a),listening:!1,perfectDrawEnabled:!1}),f=Xl(i.seatR,t);if(u.width()>f&&u.fontSize(Math.max(je,y*f/u.width())),u.width()>f+.01){u.destroy();continue}if(!me(u.fontSize(),e)){u.destroy();continue}if(u.offsetX(u.width()/2),u.offsetY(u.height()/2),u.scale({x:p,y:p}),i.seatLabelContainer(a.id).add(u),!s(u)){u.destroy();continue}if(i.seatLabelById.set(a.id,u),++n>=yi)break}let r=new Ke;for(let{node:a}of i.freeTextById.values()){if(!a.isVisible())continue;let l=a.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});r.insert({x:l.x-Q,y:l.y-Q,width:l.width+Q*2,height:l.height+Q*2})}for(let a of i.rowLabelPlan){let l=i.focusedSectionId!=null&&a.focusKeys?.includes(i.focusedSectionId),c=l?Math.max(a.fontSize,Xo/Math.max(e,1e-4)):a.fontSize;if(!l&&!me(c,e))continue;let d=i.worldToScreen({x:a.x,y:a.y});if(d.x<-40||d.x>i.stage.width()+40||d.y<-40||d.y>i.stage.height()+40)continue;let h=new cr({x:a.x,y:a.y,text:a.text,fontSize:c,fontStyle:"700",fontFamily:i.labelFont(),fill:a.ink,rotation:a.rotation,opacity:a.opacity,shadowColor:"#05070c",shadowBlur:a.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:a.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2);let p=i.resolveAutomaticRowLabelPosition(h,a,r);h.position(p),h.setAttr("rowLabel",!0),i.labelGroup.add(h);let m=h.getClientRect({skipShadow:!0,skipStroke:!0}),y=6,u=m.x<y?y-m.x:m.x+m.width>i.stage.width()-y?i.stage.width()-y-m.x-m.width:0,f=m.y<y?y-m.y:m.y+m.height>i.stage.height()-y?i.stage.height()-y-m.y-m.height:0,b=p;if(u||f){let S=i.labelGroup.getAbsoluteTransform(),v=S.point(p);b=S.copy().invert().point({x:v.x+u,y:v.y+f}),h.position(b)}let g=i.rowLabelBox(h,b);if(a.automaticAway&&r.collisionCount(g)>0){h.destroy();continue}r.insert(g)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function hr(i){let e=i.now??(()=>typeof performance<"u"?performance.now():Date.now()),t=i.budgetMs??8,o=i.reducedMotion===!0,s=i.chunks.length>1?Math.min(30,Math.max(0,840/(i.chunks.length-1))):0,n=0,r=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},h=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},p=f=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,f()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,f()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,f()},16)}},m=()=>{a||r||(a=!0,h(),i.done())},y=f=>{for(let b=c.length-1;b>=0;b--){let g=c[b],S=o?1:Math.min(1,(f-g.startedAt)/160);i.fade(g.work,S),S>=1&&c.splice(b,1)}return c.length>0},u=()=>{if(r)return;let f=e(),b=f;for(;n<i.chunks.length&&(n===0||e()-b<t);){let S=i.chunks[n++];if(i.build(S.work),i.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:f+(n-1)*s}),e()-b>=t)break}let g=y(f);i.draw(),n<i.chunks.length||g?p(u):m()};return p(u),{cancel(){if(!a){r=!0,h();for(let f of c)i.fade(f.work,1);c.length=0}},finishNow(){if(!(r||a)){for(;n<i.chunks.length;){let f=i.chunks[n++];i.build(f.work)}for(let f of i.chunks)i.fade(f.work,1);c.length=0,i.draw(),m()}},get done(){return a}}}function ht(i){return{th:Bt*Math.PI/180*i.isoT,sg:1-(1-et)*i.isoT}}function ur(i,e){let{th:t,sg:o}=ht(e),s=e.centre,n=i.x-s.x,r=i.y-s.y,a=n*Math.cos(t)-r*Math.sin(t),l=(n*Math.sin(t)+r*Math.cos(t))*o;return{x:s.x+a,y:s.y+l}}function pr(i,e){let{th:t,sg:o}=ht(e),s=e.centre,n=i.x-s.x,a=(i.y-s.y)/o,l=n*Math.cos(t)+a*Math.sin(t),c=-n*Math.sin(t)+a*Math.cos(t);return{x:s.x+l,y:s.y+c}}function fr(i,e){let{th:t,sg:o}=ht(e),s=i*e.isoT;return{x:-(s/o)*Math.sin(t),y:-(s/o)*Math.cos(t)}}function mr(i,e,t){let o=Io(e);i.offset(t),i.position(ne(e,t)),i.rotation(o.rotationDeg),i.scale({x:o.scaleX,y:o.scaleY}),i.skewX(o.skewX),i.skewY(0)}function yr(i){i.position({x:0,y:0}),i.offset({x:0,y:0}),i.scale({x:1,y:1}),i.rotation(0),i.skewX(0),i.skewY(0)}function gr(i,e){let t=Math.hypot(e.x-i.surfaceFocal.x,e.y-i.surfaceFocal.y),o=Math.max(0,t-i.frontDistanceWorld);return i.liftWorld+o*Math.tan(i.rakeDeg*Math.PI/180)}function br(i,e,t){return i.perspectiveAffine?ne(i.perspectiveAffine,e):ne(t,e)}function Sr(i,e){return e?ne(e,i):i}function vr(i,e){let t=0;for(let h of i.seats){let p=Math.max(0,(h.eyeHeightM??ee)-ee);t=Math.max(t,p*Oe)}for(let h of i.objects)h.type==="section"&&(t=Math.max(t,bt(h,{floorBaseHeightM:i.floorBaseHeightMFor(h.id)}).height*Oe));let o=To(i.bounds,t),s=Et(o,o.target),n=Co(s);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let r=1/0,a=1/0,l=-1/0,c=-1/0;for(let h of i.seats){let p=Math.max(0,(h.eyeHeightM??ee)-ee),m=ye(o,h,p*Oe),y={x:m.x,y:m.y};e.seatProjected.set(h.id,y),e.seatLocal.set(h.id,ne(n,y)),e.seatDepth.set(h.id,m.depth),e.seatScale.set(h.id,m.scale),r=Math.min(r,m.x),a=Math.min(a,m.y),l=Math.max(l,m.x),c=Math.max(c,m.y)}for(let h of[{x:i.bounds.x,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y+i.bounds.height},{x:i.bounds.x,y:i.bounds.y+i.bounds.height}]){let p=ye(o,h,0);r=Math.min(r,p.x),a=Math.min(a,p.y),l=Math.max(l,p.x),c=Math.max(c,p.y)}let d=Math.max(24,i.seatR*3);return{camera:o,baseAffine:s,baseInverse:n,bounds:Number.isFinite(r)?{x:r-d,y:a-d,width:Math.max(1,l-r+d*2),height:Math.max(1,c-a+d*2)}:null}}function wr(i,e,t){let o=t?[...t].map(s=>i.seatById.get(s)).filter(s=>!!s):e?i.seats:[...i.perspectiveAppliedSeats].map(s=>i.seatById.get(s)).filter(s=>!!s);for(let s of o){if(e&&i.perspectiveAppliedSeats.has(s.id))continue;let n=e?i.perspectiveSeatProjected.get(s.id)??s:s,r=e?i.perspectiveSeatScale.get(s.id)??1:1,a=i.circleById.get(s.id);a?.position(n),a?.scale({x:r,y:r});let l=i.accessRingById.get(s.id);l?.position(n),l?.scale({x:r,y:r});let c=i.accessGlyphById.get(s.id);if(c){let h=i.seatR*1.5/ve;c.position(n),c.scale({x:h*r,y:h*r})}let d=i.boothLabelById.get(s.id);d?.position(n),d?.scale({x:r,y:r}),e&&i.perspectiveAppliedSeats.add(s.id)}e||i.perspectiveAppliedSeats.clear()}function Ki(i){return i?.getAttr?.("seatId")??void 0}var Tr=Object.freeze([]),pt=class pt{constructor(e,t={}){this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;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=Ri;this.effSelection=rt;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.catOrder=[];this.selection=new Set;this.selectionMarkers=new Map;this.momentsCache=null;this.ownedCache=null;this.ownedHold=new Set;this.seatMarks=new qt;this.selectionFocusId=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.categoryHighlight=null;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.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.objectFloor=new Map;this.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=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=vn();this.fitScale=1;this.fitPose="";this.seatR=Qe;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.assetGeneration=0;this.assetPromises=[];this.assetErrors=[];this.assetCancels=new Set;this.seatReveal=null;this.seatRevealPending=!1;this.progressiveSeatFloor=800;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.marquee=null;this.marqueeCur=null;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 t=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(t){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,t):this.seats[0]?.id??null;o&&this.focusSeat(o);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let o=this.seatById.get(this.focusedId);o&&this.opts.onFocusSeat?.(o)}};this.seatAnchorContextCache=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...t},this.exportMode=t.exportMode===!0,this.loadingReveal=t.loadingReveal??"progressive",this.onSeatsRevealed=t.onSeatsRevealed,this.currency=t.currency;let o=Jt.pixelRatio;if(this.exportMode&&(this.dpr=1),Jt.pixelRatio=this.dpr,this.stage=new Yl({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Qt(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",Y("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Vi({listening:!this.exportMode}),this.seatLayer=new Vi({listening:!this.exportMode}),this.overlayLayer=new Vi({listening:!1}),this.labelGroup=new ut({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new ut({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.hoverRing=new kr({radius:Qe+2,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new kr({radius:Qe+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&&(Jt.pixelRatio=o),!this.exportMode){this.wireInteraction();let s=this.opts.onFps;s&&ar(s,n=>{this.rafId=n})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Kt({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(),viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),seatPoint:e=>this.renderedSeatPoint(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>{let t=this.catPrice.get(e.categoryKey);return typeof t=="number"?ot(t,this.currency):null},seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,t)=>this.nearestSeatToScreen(e,t)})),this.momentsCache}get owned(){return this.ownedCache||(this.ownedCache=new Xt({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>({x:e.nameLabel.x(),y:e.nameLabel.y()}),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,t){return this.owned.anchorFor(e)??t}ownedSeatPoints(e){let t=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let s=this.seatById.get(o);s&&t.push(this.renderedSeatPoint(s))}return t}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),marqueeActive:()=>!!this.marquee,marqueeShouldStart:e=>!!(this.opts.manageMode&&this.opts.marqueeSelect&&e.pointerType!=="touch"&&e.button===0&&this.getRung()==="seats"),beginMarquee:e=>this.beginMarquee(e),updateMarquee:e=>this.updateMarquee(e),finishMarquee:()=>this.finishMarquee(),cancelMarquee:()=>this.cancelMarquee(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,t){if(e!==this.chartDoc&&(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=t?.floorId??vt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let n of e.floors)for(let r of n.objects)this.objectFloor.set(r.id,n.id),r.type==="section"&&r.logicalSectionId&&this.objectFloor.set(r.logicalSectionId,n.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),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.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.primaryFocalLabels.clear(),this.gaById.clear();for(let n of this.selectionMarkers.values())n.destroy();this.selectionMarkers.clear(),this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.statusById.clear(),this.seatAnchorContextCache=null,this.selection.clear(),this.seatById.clear(),this.seatIndex=null,this.cached=!1,this.accessFilter=null,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.hasBoothText=!1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.isoT=0,this.isoTarget=0,this.viewMode="flat",this.perspectiveCamera=null,this.perspectiveBaseAffine=null,this.perspectiveBaseInverse=null,this.perspectiveSeatLocal.clear(),this.perspectiveSeatProjected.clear(),this.perspectiveSeatDepth.clear(),this.perspectiveSeatScale.clear(),this.perspectiveAppliedSeats.clear(),this.perspectiveBounds=null,this.resetLayerTransforms(),this.hasSections=o.objects.some(n=>n.type==="section");for(let n of e.zones??[])n.color&&this.zoneColor.set(n.id,n.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=G(this.theme.seatScale??1,.7,1.6)*Qe,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(n=>n.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((n,r)=>{this.cbHueByKey.set(n,Wt[r%Wt.length])});for(let n of e.categories)this.catColor.set(n.key,n.color),this.catByKey.set(n.key,n),typeof n.price=="number"&&this.catPrice.set(n.key,n.price);for(let n of o.objects)n.type==="booth"&&this.boothDims.set(n.id,{width:n.width,height:n.height,rotation:n.rotation,...n.points&&n.points.length>=3?{points:n.points.map(r=>({x:r.x,y:r.y}))}:{}});this.seats=$e(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let n of this.seats)this.seatById.set(n.id,n),this.statusById.set(n.id,"free");this.seatIndex=Lo(this.seats,{seatRadius:this.seatR}),this.bounds=ho(o,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(o),this.renderBackground(o),this.unsectionedSeatGroup=new ut({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let s=this.seatRevealWanted();this.seatRevealPending=s,s||this.renderSeats(),this.buildRowLabelPlan(o),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.mountCachePending=!s,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=this.viewportCentreInChartSpace(),t=new Map,o=[];for(let n of this.seats){let r=this.seatSection.get(n.id);if(!r){o.push(n);continue}let a=t.get(r.id);a?a.push(n):t.set(r.id,[n])}let s=[...t.entries()].map(([n,r])=>{let a=this.sections.find(l=>l.id===n);return{id:n,work:{seats:r,group:a.liftGroupSeat},distance:Math.hypot(a.centroid.x-e.x,a.centroid.y-e.y)}}).sort((n,r)=>n.distance-r.distance);o.length&&this.unsectionedSeatGroup&&s.push({id:"",work:{seats:o,group:this.unsectionedSeatGroup},distance:1/0}),this.seatReveal=hr({chunks:s.map(n=>({id:n.id,work:n.work})),build:n=>this.renderSeats(n.seats),fade:(n,r)=>n.group.opacity(r),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.updateLOD(),this.fitPose&&xi(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){let t=this.seatReveal;this.seatRevealPending=!1,t&&(this.seatReveal=null,e?t.finishNow():t.cancel())}floorView(e){if(!e.floors||!e.floors.length)return{...e,referenceImage:void 0,backgroundImage:De(e)};if(this.floorOverview&&e.floors.length>=2)return{...lo(e)?co(e):ao(e),referenceImage:void 0,backgroundImage:De(e)};if(this.stacked&&e.floors.length>=2)return{...ro(e),referenceImage:void 0,backgroundImage:De(e)};let t=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:t.objects,focalPoint:t.focalPoint,referenceImage:void 0,backgroundImage:De(t),floors:void 0}}floorBaseHeightMFor(e){let t=this.chartDoc?.floors;if(!t?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return t.find(s=>s.id===o)?.baseHeightM??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}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?vt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,t){let o=!1,s=this.hasSections?new Set:null;for(let n of e){if(!this.statusById.has(n))continue;let r=this.statusById.get(n);this.statusById.set(n,t);let a=this.circleById.get(n);if(a&&(this.paintSeat(a,n),o=!0),s){let l=this.seatSection.get(n);l&&(r==="free"!=(t==="free")&&(l.free+=t==="free"?1:-1),s.add(l))}}if(s&&s.size){for(let n of s)this.refreshSectionFill(n);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels())}setSeatCategories(e){let t=!1,o=new Set;for(let[n,r]of Object.entries(e)){let a=this.seatById.get(n);if(!a||!this.catColor.has(r)||a.categoryKey===r)continue;a.categoryKey=r;let l=this.circleById.get(n);l&&(this.paintSeat(l,n),t=!0);let c=this.seatSection.get(n);c&&o.add(c)}if(!t)return;let s=new Map((this.chartDoc?vt(this.chartDoc):[]).flatMap(n=>n.objects).filter(n=>n.type==="section").map(n=>[n.id,n]));for(let n of o){if(!s.get(n.id)?.color){let a=new Map;for(let l of n.memberIds){let c=this.seatById.get(l)?.categoryKey;c&&a.set(c,(a.get(c)??0)+1)}n.baseFill=ui([...a].map(([l,c])=>({hex:this.catColor.get(l)??"#6e7bff",w:c})),"#3a4358")}n.shellCategoryColor=this.dominantSellableColor(n.memberIds),this.refreshSectionFill(n)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels()}setOwnedHold(e){let t=new Set((e??[]).filter(s=>this.statusById.has(s))),o=new Set([...this.ownedHold,...t]);this.ownedHold=t;for(let s of o){let n=this.circleById.get(s);n&&this.paintSeat(n,s),this.syncSelectionMarker(s)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let t=e&&this.selection.has(e)?e:null;if(t===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=t;for(let s of this.seats){let n=this.circleById.get(s.id);n&&this.paintSeat(n,s.id)}o&&this.syncSelectionMarker(o),t&&this.syncSelectionMarker(t);for(let[s,n]of this.selectionMarkers)n.opacity(!t||s===t?1:.2);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}setSeatMarks(e){let t=this.seatMarks.merge(e,this.statusById);for(let o of t){let s=this.circleById.get(o);s&&this.paintSeat(s,o)}t.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 t of this.selection){let o=this.seatById.get(t);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let t of e)this.setSelected(t,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let t=[];for(let o of e){if(this.selection.has(o)||!this.isSelectable(o))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(o,!0,!0);let s=this.seatById.get(o);s&&t.push(s)}return t.length&&this.overlayLayer.batchDraw(),t}setManageInteraction(e){this.marquee&&this.cancelMarquee(),this.gestures.resetPan(),this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let t=[...this.selection].filter(o=>!this.isSelectable(o));t.length&&this.deselect(t),!e.manageMode&&this.selection.size&&this.clearSelection(),this.container.style.cursor="default",this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[t,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(t,Math.max(0,Math.min(1,o)));for(let t of this.sections)this.refreshSectionHeat(t);this.bgLayer.batchDraw()}deselect(e){let t=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),t=!0);t&&this.overlayLayer.batchDraw()}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let t of this.seats)this.isSelectable(t.id)&&e.push(t.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let t=new Set(e),o=[];for(let s of this.seats)t.has(s.label)&&this.isSelectable(s.id)&&o.push(s.id);return this.selectMany(o)}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 t=[],o=new Set;for(let s of this.sections)if(!(s.id!==e&&s.logicalId!==e&&s.zone!==e))for(let n of s.memberIds){if(o.has(n)||(o.add(n),!this.isSelectable(n)))continue;let r=this.seatById.get(n);r&&t.push(r)}return t}selectMany(e){let t=e.filter(s=>!this.selection.has(s));if(!t.length)return this.getSelection();let o=this.selection.size+t.length<=Uo;for(let s of t)if(o)this.setSelected(s,!0,!0);else{this.selection.add(s);let n=this.circleById.get(s);n&&this.paintSeat(n,s)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let t=this.screenToWorld(e),o=this.stage.scaleX()||1,s=new Lr({x:t.x,y:t.y,width:0,height:0,stroke:this.effSelection,strokeWidth:1.5/o,dash:[5/o,4/o],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.overlayLayer.add(s),this.marquee={start:t,rect:s},this.marqueeCur=t,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let t=this.screenToWorld(e),{start:o,rect:s}=this.marquee;s.setAttrs({x:Math.min(o.x,t.x),y:Math.min(o.y,t.y),width:Math.abs(t.x-o.x),height:Math.abs(t.y-o.y)}),this.marqueeCur=t,this.overlayLayer.batchDraw()}cancelMarquee(){this.marquee&&(this.marquee.rect.destroy(),this.marquee=null,this.marqueeCur=null,this.overlayLayer.batchDraw())}finishMarquee(){let e=this.marquee;if(this.marquee=null,!e)return;e.rect.destroy(),this.overlayLayer.batchDraw();let t=this.marqueeCur??e.start;this.marqueeCur=null;let o=Math.min(e.start.x,t.x),s=Math.max(e.start.x,t.x),n=Math.min(e.start.y,t.y),r=Math.max(e.start.y,t.y),a=this.stage.scaleX()||1;if((s-o)*a<4&&(r-n)*a<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let l=[];for(let c of this.seats){let d=this.renderedSeatPoint(c);d.x<o||d.x>s||d.y<n||d.y>r||this.isSelectable(c.id)&&l.push(c.id)}this.selectMany(l),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let o=this.seatById.get(e);o&&pn(this.flashHost,e,this.renderedSeatPoint(o),t)}flashSection(e,t="#22a06b"){fn(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),t)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,t){let o=this.seatById.get(e);if(!o)return null;let s=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,n=null,r=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-s.x,d=l.y-s.y,h=c*t.x+d*t.y;if(h<=.5)continue;let p=Math.abs(c*t.y-d*t.x),m=h+p*2.5;m<r&&(r=m,n=a.id)}return n}focusSeat(e){let t=this.seatById.get(e);if(!t)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(t));let o=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:o,y:o}),this.focusRing.visible(!0),this.ensureVisible(t),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(t)}ensureVisible(e){let t=this.stage.width(),o=this.stage.height(),s=Math.max(this.stage.scaleX(),Pe*1.2),n=this.worldToScreen(e),r=70,a=n.x<r||n.x>t-r||n.y<r||n.y>o-r;if(this.stage.scaleX()<s||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ne(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:s,y:s}),this.stage.position({x:t/2-c.x*s,y:o/2-c.y*s}),this.afterViewChange(),this.stage.batchDraw()}}zoomToFit(){let e=this.stage.width(),t=this.stage.height(),o=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(e/o.width,t/o.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let n=e/o.width<=t/o.height,r=o.height*this.fitScale;n&&r<.55*t&&(this.fitScale=Math.min(this.fitScale*1.3,.62*t/o.height))}let s=this.fitScale;if(this.stage.scale({x:s,y:s}),this.stage.position({x:(e-o.width*s)/2-o.x*s,y:(t-o.height*s)/2-o.y*s}),this.settleView(),!this.exportMode){let n=Ks(this.stage,[this.bgLayer,this.seatLayer]);n>0&&n!==1&&(this.fitScale*=n),n>0&&this.afterViewChange(),this.fitPose=xi(this.stage)}this.stage.batchDraw()}refitCurrentView(){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()}zoomIn(){this.zoomAbout(this.stage.scaleX()*pt.ZOOM_STEP,_i(this.stage))}zoomOut(){this.zoomAbout(this.stage.scaleX()/pt.ZOOM_STEP,_i(this.stage))}zoomOutLevel(){let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e),"section"):"venue":this.getRung()==="seats"?(this.setRung("sections"),"sections"):(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let t of this.gaById.values())e+=t.capacity;return e}worldToScreen(e){let t=this.stage.scaleX(),o=e.id,s=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=s?this.perspectiveSeatProjected.get(s.id)??ne(this.perspectiveBaseAffine,e):ne(this.perspectiveBaseAffine,e);return{x:a.x*t+this.stage.x(),y:a.y*t+this.stage.y()}}let n=s?this.renderedSeatPoint(s):e,r=this.isoT===0?n:this.isoForward(n);return{x:r.x*t+this.stage.x(),y:r.y*t+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let t=e===null?null:[...e];if(!this.sameAccessFilter(t)){this.accessFilter=t;for(let o of this.sections)this.refreshSectionFill(o);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale());for(let o of this.seats){let s=this.circleById.get(o.id);s&&this.paintSeat(s,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let t=this.accessFilter;return t===null||e===null?t===e:t.length===e.length&&t.every((o,s)=>o===e[s])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){let t=e===null?null:new Set(e);if(!Nn(t,this.categoryFilter)){this.categoryFilter=t;for(let o of this.seats){let s=this.circleById.get(o.id);s&&this.paintSeat(s,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}applyGAFilterState(){this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){Gn({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=>Dn(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<re,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){Hn(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,t){this.setGAStates({[e]:t})}focusCategories(e,t){if(!e?.length){this.focusRegion(this.bounds,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let o=new Set(e),s=this.seats.filter(d=>!o.has(d.categoryKey)||this.seatInClosedSection(d.id)?!1:(this.statusById.get(d.id)??"free")==="free"||this.ownedHold.has(d.id));if(!s.length)return;let n=Wn(s.map(d=>d.id),this.seatSection);n&&this.focusSection(n);let r=Math.max(24,this.seatR*3),a=s.map(d=>this.renderedSeatPoint(d)),l=kn(a,r),c=this.narrowSeatDetailFocus(a,l);this.focusRegion(c?.bounds??l,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:c?.minScale})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let t=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=t,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=t,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=t,this.applyIso(),this.afterViewChange();return}let s=this.isoT;if(s===t){this.applyIso(),this.afterViewChange();return}let n=performance.now(),r=a=>{if(this.destroyed)return;let l=Math.min(1,(a-n)/$o),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=s+(this.isoTarget-s)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(r):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(r)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}isoParams(){return ht(this.isoState)}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),t=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,t)}return this.stage.scaleX()*(1-(1-et)*this.isoT)}isoForward(e){return ur(e,this.isoState)}isoInverse(e){return pr(e,this.isoState)}buildPerspectiveProjection(e){let t=vr({seats:this.seats,objects:e.objects,bounds:this.bounds,seatR:this.seatR,floorBaseHeightMFor:o=>this.floorBaseHeightMFor(o)},{seatLocal:this.perspectiveSeatLocal,seatProjected:this.perspectiveSeatProjected,seatDepth:this.perspectiveSeatDepth,seatScale:this.perspectiveSeatScale});this.perspectiveCamera=t.camera,this.perspectiveBaseAffine=t.baseAffine,this.perspectiveBaseInverse=t.baseInverse,this.perspectiveBounds=t.bounds}setContainerAffine(e,t,o){mr(e,t,o)}resetContainerTransform(e){yr(e)}sectionSurfaceHeight(e,t){return gr(e,t)}projectedSectionPoint(e,t){return br(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return Sr(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return fr(e,this.isoState)}resetLayerTransforms(e=!0){let t=e?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let o of t)o.position({x:0,y:0}),o.offset({x:0,y:0}),o.scale({x:1,y:1}),o.rotation(0),o.skewX(0),o.skewY(0)}resetSectionProjection(e=!0){for(let t of this.sections){this.resetContainerTransform(t.rootGroupBg),this.resetContainerTransform(t.liftGroupBg),e&&this.resetContainerTransform(t.liftGroupSeat),t.rootGroupBg.zIndex(t.bgZIndex),e&&t.liftGroupSeat.zIndex(t.seatZIndex);let o=this.labelLiftGroups.get(t.id);o&&e&&this.resetContainerTransform(o),t.perspectiveAffine=void 0,t.perspectiveCorrection=void 0,t.perspectiveDepth=void 0}}get seatAnchorContext(){return this.seatAnchorContextCache??={seats:this.seats,seatById:this.seatById,seatR:this.seatR,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,perspectiveAppliedSeats:this.perspectiveAppliedSeats,circleById:this.circleById,accessRingById:this.accessRingById,accessGlyphById:this.accessGlyphById,boothLabelById:this.boothLabelById}}applyExactSeatAnchors(e,t){wr(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,o=this.perspectiveBaseAffine,s=this.perspectiveBaseInverse;if(!t||!o||!s)return;let n=this.seats.length>2500&&this.sections.length>0;this.cached&&!n&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let a of[this.bgLayer,this.overlayLayer])this.setContainerAffine(a,o,t.target);this.perspectiveAppliedSeats.clear(),n||this.applyExactSeatAnchors(!0);for(let a of this.sections){let l=h=>this.sectionSurfaceHeight(a,h),c=Et(t,a.centroid,l),d=Po(s,c);a.perspectiveAffine=c,a.perspectiveCorrection=d,a.perspectiveDepth=ye(t,a.centroid,l(a.centroid)).depth,this.setContainerAffine(a.liftGroupBg,d,a.centroid);for(let h=0;h<a.sideFaces.length;h++){let p=a.outline[h],m=a.outline[(h+1)%a.outline.length],y=this.perspectiveLocalPoint(ye(t,p,0)),u=this.perspectiveLocalPoint(ye(t,m,0)),f=this.perspectiveLocalPoint(ye(t,m,l(m))),b=this.perspectiveLocalPoint(ye(t,p,l(p)));a.sideFaces[h].points([y.x,y.y,u.x,u.y,f.x,f.y,b.x,b.y]),a.sideFaces[h].opacity(.9)}}let r=[...this.sections].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of r)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),n||this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyIso(){if(this.resetSectionProjection(),this.applyExactSeatAnchors(!1),this.isoT===0)this.resetLayerTransforms();else{let{th:t,sg:o}=this.isoParams(),s=Math.cos(t),n=o*Math.sin(t),r=-Math.sin(t),a=o*Math.cos(t),l=Math.sqrt(s*s+n*n),c=s*a-n*r,d=Math.atan2(n,s)*180/Math.PI,h=l,p=c/l,m=(s*r+n*a)/c,y=this.isoCentre;for(let u of[this.bgLayer,this.seatLayer,this.overlayLayer])u.position({x:y.x,y:y.y}),u.offset({x:y.x,y:y.y}),u.rotation(d),u.scaleX(h),u.scaleY(p),u.skewX(m),u.skewY(0)}this.applyUprightLabels(),this.applyElevation(),this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyUprightLabels(){let e=Bt*this.isoT,t=1/(1-(1-et)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let s of o){let n=s.find("Text");for(let r of n){let a=r.getAttr("uprightBase");a==null&&(a=r.rotation(),r.setAttr("uprightBase",a)),r.rotation(a-e),r.scaleX(1),r.scaleY(t),r.skewX(0)}}}applyElevation(){let e=this.isoT;for(let t of this.sections){if(t.liftWorld<=0)continue;let o=this.isoLiftLocal(t.liftWorld);t.liftGroupBg?.position(o),t.liftGroupSeat.position(o),this.labelLiftGroups.get(t.id)?.position(o);let s=.9*e;for(let n=0;n<t.sideFaces.length;n++){let r=t.sideFaces[n],a=t.outline[n],l=t.outline[(n+1)%t.outline.length];r.points([a.x,a.y,l.x,l.y,l.x+o.x,l.y+o.y,a.x+o.x,a.y+o.y]),r.opacity(s)}}this.syncSeatOverlayPositions()}destroy(){this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),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 t=this.focusedSectionId;return t==null||e.id===t||e.logicalId===t||e.zone===t}focusedSeatOpacity(e,t){if(!this.focusedSectionId||!this.focusDimOverlay)return t;let o=this.seatSection.get(e);return t*(o&&this.sectionMatchesFocus(o)?1:xe)}sectionScreenBounds(e){return $s({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=re,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,s=this.stage.width(),n=this.stage.height();for(let r of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(r);a=c.x+c.width>=-o&&c.y+c.height>=-o&&c.x<=s+o&&c.y<=n+o,a&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,r.memberIds)}r.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(r.id)?.setViewportCulled(!a)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,this.seats.filter(r=>!this.seatSection.has(r.id)).map(r=>r.id))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let t of this.sections)if(!t.liftGroupSeat.isViewportCulled())for(let o of t.memberIds){let s=this.seatById.get(o);s&&e.push(s)}for(let t of this.seats)this.seatSection.has(t.id)||e.push(t);return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}renderedSeatPoint(e){if(this.viewMode==="perspective")return this.perspectiveSeatLocal.get(e.id)??e;let t=this.seatSection.get(e.id);if(!t||t.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(t.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let t=this.seatSection.get(e);if(!t)return this.labelGroup;let o=this.labelLiftGroups.get(t.id);return o||(o=new lt({listening:!1}),o.setViewportCulled(t.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(t.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(t.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:t,y:t})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:t,y:t})}}for(let[e,t]of this.selectionMarkers){let o=this.seatById.get(e);if(o){t.position(this.renderedSeatPoint(o));let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;t.scale({x:s,y:s})}}}renderSeats(e=this.seats){dn({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,setHasBoothText:()=>{this.hasBoothText=!0},circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,perspectiveSeatDepth:this.perspectiveSeatDepth,seatContainer:t=>this.seatContainer(t),buildAccessGlyph:(t,o)=>this.buildAccessGlyph(t,o),paintSeat:(t,o)=>this.paintSeat(t,o),labelFont:()=>this.labelFont()})}buildAccessGlyph(e,t){let o=this.seatR*1.5/ve,s=new $l({x:e.x,y:e.y,data:Ct(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:pi(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Zt(s),s}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[t,o]of this.accessGlyphById){let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1,n=this.seatR*1.5/ve*s,a=this.accessGlyphFilterEmphasized(t)?Wo:No,l=Math.max(n,a/(ve*Math.max(e,.001)));o.scale({x:l,y:l}),o.visible(this.accessGlyphShouldShow(t))}}accessGlyphFilterEmphasized(e){let t=this.seatById.get(e),o=this.accessFilter;return!!t&&o!==null&&!!t.accessibility?.includes("wheelchair")&&(o.length===0||o.includes("wheelchair"))&&Ee(t,o)}accessGlyphShouldShow(e){return this.accessGlyphById.has(e)&&this.accessGlyphEligible(e)}accessGlyphEligible(e){let t=this.statusById.get(e)??"free";return!(t==="booked"||t==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??Wt[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??nt}seatLabelInk(e,t){let o=t.fill();return X(typeof o=="string"?o:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let o=this.seatById.get(t),s=this.statusById.get(t)??"free",n=this.selection.has(t),r=this.categoryDisplayColor(o.categoryKey),a=this.boothLabelById.get(t);e.dash(Tr),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let l=s==="held"&&this.ownedHold.has(t),c=l?null:An(s,this.canvasBackground,this.colorblind);if(c?(e.fill(c.fill),e.stroke(c.stroke),e.strokeWidth(c.strokeWidth),e.dash(c.dash),e.opacity(c.opacity),c.scale!==1&&e.scale({x:c.scale,y:c.scale})):l?(e.fill(Se(r,this.effSelection===rt?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(n&&this.effSelection===rt?Se(r,.28):r),this.seatMarks.paint(e,t,s,r,this.seatR,this.colorblind,this.seatInClosedSection(t)),Bi(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&s==="free"&&(e.stroke(gt(o.accessibility)),e.strokeWidth(n?3:2),e.dash([3,2])),a&&(a.text(s==="booked"?"SOLD":s==="held"?"HELD":o.label),a.fontSize(s==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(o.rowId)?.width??40)/6)),a.fontStyle(s==="free"?"600":"800"),a.fill(s==="free"?this.theme.seatLabelColor??nt:"#ffffff"),a.offsetX(a.width()/2),a.offsetY(a.height()/2)),this.accessFilter&&s==="free"&&!n){let p=Mi(o,this.accessFilter);p==="other"?e.opacity(Js):p==="companion"&&e.opacity(en)}if(this.categoryHighlight&&s==="free"&&!n&&o.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&s==="free"&&!n&&!this.categoryFilter.has(o.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&s==="free"&&!n&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22),this.dimmedSections.size){let p=this.seatSection.get(t);(p?this.dimmedSections.has(p.id)||this.dimmedSections.has(p.logicalId)||p.zone!=null&&this.dimmedSections.has(p.zone):this.dimmedSections.has(uo))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(ys),e.stroke(""),e.strokeWidth(0),e.dash(Tr),e.opacity(gs),e.scale({x:1,y:1})),this.selectionFocusId&&t!==this.selectionFocusId&&e.opacity(Math.min(e.opacity(),.16));let d=this.boothLabelById.get(t)??this.seatLabelById.get(t);d&&(d.fill(this.seatLabelInk(o,e)),d.visible(me(d.fontSize(),this.effScale())&&e.opacity()>=.5));let h=this.accessGlyphById.get(t);if(h){let p=e.fill();h.fill(pi(typeof p=="string"?p:"")),h.opacity(e.opacity()),h.visible(this.accessGlyphShouldShow(t))}this.accessRingById.get(t)?.opacity(e.opacity())}seatInClosedSection(e){if(!this.closedSections.size)return!1;let t=this.seatSection.get(e);return!!t&&(this.closedSections.has(t.id)||this.closedSections.has(t.logicalId)||t.zone!=null&&this.closedSections.has(t.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}for(let t of this.sections)t.shellCategoryColor=this.dominantSellableColor(t.memberIds),this.refreshSectionFill(t);this.bgLayer.batchDraw(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let t=new Set(e??[]);if(!(t.size===this.dimmedSections.size&&[...t].every(o=>this.dimmedSections.has(o)))){this.dimmedSections=t;for(let o of this.seats){let s=this.circleById.get(o.id);s&&this.paintSeat(s,o.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){let t=new Set(e??[]);t.size===this.closedSections.size&&[...t].every(o=>this.closedSections.has(o))||(this.closedSections=t,this.repaintSectionsAndSeats())}focusSection(e,t){this.sections.some(o=>o.id===e||o.logicalId===e)&&(this.focusedSectionId=e,this.focusAnchor=t?.anchor??null,this.focusRoams=!1,this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),this.focusSectionCamera(e,!0,t?.anchor))}focusSectionCamera(e,t=!0,o){let s=this.sectionBounds(e);if(!s)return;let n=this.sectionMembers(e).map(c=>this.seatById.get(c)).filter(c=>c!=null),r=n.filter(c=>(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id)),a=(r.length?r:n).map(c=>this.renderedSeatPoint(c)),l=this.narrowSeatDetailFocus(a,s,o);this.focusRegion(l?.bounds??s,{animate:t,minScale:l?.minScale})}releaseSectionFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusRoams=!0,this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}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.focusedSectionId||this.floorOverview?!0:this.effScale()>=Vo}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=mn(this.focusBackdropHost,t),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=yn(this.focusBackdropHost,t);for(let o of this.selectionMarkers.values())o.moveToTop();this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,viewMode:this.viewMode,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}repaintSectionsAndSeats(){for(let e of this.seats){let t=this.circleById.get(e.id);t&&this.paintSeat(t,e.id)}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}),t=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}}getWorldBounds(){let e=1/0,t=1/0,o=-1/0,s=-1/0,n=(r,a)=>{r<e&&(e=r),a<t&&(t=a),r>o&&(o=r),a>s&&(s=a)};for(let r of this.seats)n(r.x,r.y);for(let r of this.sections)for(let a of r.outline)n(a.x,a.y);for(let r of this.gaById.values())for(let a of r.points)n(a.x,a.y);return Number.isFinite(e)?{x:e,y:t,width:Math.max(1,o-e),height:Math.max(1,s-t)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(t=>{let o=this.isSectionClosed(t)||t.free<=0,s=t.memberIds.some(a=>this.selection.has(a)),n=s||t.memberIds.some(a=>this.ownedHold.has(a)),r=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(a=>({...a})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:s?"selected":o?"inactive":"available",active:r,paint:{fill:t.shellFill,stroke:t.shellStroke},owned:n}});return{sections:e,seats:e.length?[]:this.seats.map(t=>({x:t.x,y:t.y,categoryKey:t.categoryKey,state:this.selection.has(t.id)?"selected":this.statusById.get(t.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let t=this.worldToScreen(e);this.stage.position({x:this.stage.x()+this.stage.width()/2-t.x,y:this.stage.y()+this.stage.height()/2-t.y}),this.afterViewChange(),this.stage.batchDraw()}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){let t=De(e);t&&this.renderBackgroundImage(t);for(let o of e.objects)o.type==="decorImage"&&this.renderDecorImage(o);for(let o of e.objects)o.type==="section"&&this.renderSection(o);for(let o of e.objects)o.type==="shape"?this.renderShape(o):o.type==="gaArea"?this.renderGA(o):o.type==="table"?this.renderTable(o):o.type==="text"&&this.renderText(o);this.renderZones(e)}trackAssetImage(e,t,o,s){let n=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let r=new Promise(a=>{let l=!1,c=()=>{l||(l=!0,this.assetCancels.delete(d),a())},d=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(d),e.onload=()=>{if(!this.exportMode){n===this.assetGeneration&&s(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{n===this.assetGeneration&&s()}).catch(()=>{n===this.assetGeneration&&this.assetErrors.push(`${o} could not be decoded.`)}).finally(c)},e.onerror=()=>{n===this.assetGeneration&&this.assetErrors.push(`${o} could not be loaded.`),c()},e.src=t});this.assetPromises.push(r)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){Un(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,t,o,s)=>this.trackAssetImage(e,t,o,s),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){$n(this.objectDrawContext,e)}renderTable(e){qn(this.objectDrawContext,e)}renderText(e){Zn(this.objectDrawContext,e)}renderShape(e){Qn(this.objectDrawContext,e)}renderGA(e){Jn(this.objectDrawContext,e)}renderSection(e){let t=St(e.outline,e.holes),o=le(this.canvasBackground),s=[],n=new Map,r=0,a=N(e.outline),l=this.seatIndex?Rt(this.seatIndex,a).map(P=>this.seatById.get(P)).filter(P=>!!P):this.seats;for(let P of l)this.seatSection.has(P.id)||ie(P,e.outline,e.holes)&&(s.push(P.id),n.set(P.categoryKey,(n.get(P.categoryKey)??0)+1),(this.statusById.get(P.id)??"free")==="free"&&r++);let c=e.color??ui([...n].map(([P,A])=>({hex:this.catColor.get(P)??"#6e7bff",w:A})),"#3a4358"),d=so(e.elevation),h=bt(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),p=h.height*Oe,m=new ut({listening:!1});this.bgLayer.add(m);let y=new ut({listening:!1});m.add(y);let u=new lt({listening:!0});this.seatLayer.add(u);let f=[];if(p>0){let P=ue(this.zoneColor.get(e.zone??"")??c,.42);for(let A=0;A<e.outline.length;A++){let _=new Ul({points:[],closed:!0,fill:P,stroke:B("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});f.push(_),m.add(_)}}y.moveToTop();let b=y,g=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=Ae(e.outline,e.holes,{stroke:B(g,.5),strokeWidth:1,fill:B(g,.08),listening:!1},e.outlinePath);b.add(S);let v=Ae(e.outline,e.holes,{fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Ft,opacity:0,listening:!1},e.outlinePath);b.add(v);let w=e.labelPresentation?.labelStyle,k=w?.color??o.sectionInk,T=(w?.size??18)/18,C=new Lr({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});b.add(C);let L=new zi({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*T,fontStyle:Ne,fontFamily:this.labelFont(),fill:X(o.sectionFill,k),listening:!1,perfectDrawEnabled:!1});L.offsetX(L.width()/2),L.offsetY(L.height()/2),b.add(L);let I=new zi({x:t.x,y:t.y,text:Y("map.seatsLeft",{count:r}),fontSize:12,fontStyle:Gt,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});I.offsetX(I.width()/2),b.add(I);let x={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:t,labelAnchors:Us(e.outline,e.holes??[],t),memberCategoryKeys:new Set(s.map(P=>this.seatById.get(P)?.categoryKey).filter(Boolean)),shellCategoryColor:this.dominantSellableColor(s),shellFill:o.sectionFill,shellStroke:o.sectionStroke,labelArea:io(e.outline,e.holes),zone:e.zone,memberIds:s,total:s.length,free:r,baseFill:c,outlineTint:g,outlinePoly:S,blockPoly:v,namePlate:C,nameLabel:L,subLabel:I,preferredInk:k,labelScale:T,nameLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:p,rakeDeg:h.rake,surfaceFocal:s.length?{...this.seatById.get(s[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:m,bgZIndex:m.zIndex(),seatZIndex:u.zIndex(),liftGroupBg:y,liftGroupSeat:u,sideFaces:f},M=s.map(P=>this.seatById.get(P)).filter(P=>!!P),R=M.length?M:e.outline;x.frontDistanceWorld=Math.min(...R.map(P=>Math.hypot(P.x-x.surfaceFocal.x,P.y-x.surfaceFocal.y)));for(let P of s)this.seatSection.set(P,x);this.refreshSectionFill(x),this.refreshSectionHeat(x),this.sections.push(x)}refreshSectionHeat(e){ir(this.sectionLodPaintContext,e)}refreshSectionFill(e){sr(this.sectionLodPaintContext,e)}isSectionClosed(e){return Wi(this.sectionLodPaintContext,e)}dominantSellableColor(e){let t=new Map;for(let n of e){let r=this.seatById.get(n)?.categoryKey;!r||this.catByKey.get(r)?.notForSale||t.set(r,(t.get(r)??0)+1)}let o=null,s=0;for(let[n,r]of t)(r>s||r===s&&o!=null&&n<o)&&(o=n,s=r);return o?this.categoryDisplayColor(o):null}sectionAccessibleFree(e){let t=this.accessFilter;if(!t)return 0;let o=0;for(let s of e.memberIds){if((this.statusById.get(s)??"free")!=="free")continue;let n=this.seatById.get(s);n&&Ee(n,t)&&(o+=1)}return o}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:e=>e.memberIds.some(t=>this.selection.has(t)||this.ownedHold.has(t)),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:e=>this.sectionAccessibleFree(e),selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.floorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){js({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let t=this.stage.scaleX(),o={x:(e.x-this.stage.x())/t,y:(e.y-this.stage.y())/t};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?ne(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let t=this.screenToWorld(e),o=this.sections.find(s=>{if(this.viewMode==="perspective"&&s.perspectiveAffine)return ie(t,s.outline.map(r=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,r))),s.holes.map(r=>r.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,a)))));let n=s.liftWorld>0?this.isoLiftLocal(s.liftWorld):{x:0,y:0};return ie({x:t.x-n.x,y:t.y-n.y},s.outline,s.holes)});return o?o.logicalId:null}sectionMembers(e){return[...new Set(this.sections.filter(t=>t.id===e||t.logicalId===e||t.zone===e).flatMap(t=>t.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 t=this.seatById.get(e);return t?Mi(t,this.accessFilter)==="other":!1}toggleSeat(e){if(this.selection.has(e)){this.setSelected(e,!1);let t=this.seatById.get(e);t&&this.opts.onDeselect?.(t)}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 t=this.seatById.get(e);t&&this.opts.onSelect?.(t)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?hi(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let o=hi(getComputedStyle(t).backgroundColor);if(o)return o;t=t.parentElement}}return Ri}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:U(this.canvasBackground)?tn:rt}setSelected(e,t,o=!1){let s=this.circleById.get(e);t?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),s&&(this.paintSeat(s,e),!o&&!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.hasSections&&this.owned.sync(this.effScale())}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return Zs({sections:this.sections,viewMode:this.viewMode,isoT:this.isoT,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,projectedSectionPoint:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t),renderedSeatPoint:t=>this.renderedSeatPoint(t),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(t,o,s)=>this.resolveAutomaticRowLabelPosition(t,o,s),rowLabelBox:(t,o)=>this.rowLabelBox(t,o)},e)}sectionFrameScale(e){let t=this.sectionBounds(e);return t?gn(this.stage,t,this.zoomBounds()):this.stage.scaleX()}handleSeatTap(e){if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let o=this.objectFloor.get(this.seatById.get(e)?.rowId??"");if(o){this.opts.onDeckTap(o);return}}if(this.effScale()<ae&&this.sections.length){let o=this.seatSection.get(e);if(o){let s=this.focusedSectionId===o.logicalId,n=this.sectionFrameScale(o.logicalId)>this.stage.scaleX()*1.02;if(!s&&n){let r=this.seatById.get(e),a=r?this.renderedSeatPoint(r):void 0;this.opts.onSectionTap?this.opts.onSectionTap(o.logicalId,a):this.focusSection(o.logicalId,{anchor:a});return}}}if(!(this.selection.has(e)||this.isSelectable(e))){let o=this.seatById.get(e)??null;o&&(this.opts.onHover?.(o,{mark:this.seatMarks.get(e)??null,interaction:"press",unavailable:!0,...this.hiddenByAccessFilter(e)?{filteredOut:!0}:{}}),this.moments.nudge(e));return}this.seatMarks.has(e)&&this.opts.onHover?.(this.seatById.get(e)??null,{mark:this.seatMarks.get(e),interaction:"press"}),this.toggleSeat(e)}deckFloorAt(){return un(this.screenPickingHost)}nearestSeatToScreen(e,t,o=!1){return hn(this.screenPickingHost,e,t,{includeUnavailable:o})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,viewMode:this.viewMode,selection:this.selection,objectFloor:this.objectFloor,perspectiveSeatScale:this.perspectiveSeatScale,renderedSeatPoint:e=>this.renderedSeatPoint(e),screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){this.seatLayer.on("click tap",e=>{if(this.moved>we||this.isGhostClick(e))return;let t=Ki(e.target);t&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=Ki(e.target);if(!t)return;let o=this.seatById.get(t);if(!o)return;this.hoveredId=t,this.hoverRing.position(this.renderedSeatPoint(o));let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:s,y:s}),this.hoverRing.visible(!0),this.overlayLayer.batchDraw(),this.container.style.cursor="pointer",this.opts.onHover?.(o,{mark:this.seatMarks.get(t),interaction:"hover"})}),this.seatLayer.on("mouseout",()=>{this.hoveredId=null,this.hoverRing.visible(!1),this.overlayLayer.batchDraw(),this.container.style.cursor="default",this.opts.onHover?.(null,{mark:null})}),this.stage.on("wheel",e=>{e.evt.preventDefault(),this.releaseSectionFocusDim();let t=this.container.getBoundingClientRect(),o={x:e.evt.clientX-t.left,y:e.evt.clientY-t.top},s=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*G(s,.5,2),o)}),this.stage.on("click tap",e=>{if(this.moved>we||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(Ki(e.target))return;if(this.seatsRevealed()){let s=this.focusedSectionId,n=this.nearestSeatToScreen(t,Ie),r=n?this.seatSection.get(n):null;if(n&&(!s||r&&this.sectionMatchesFocus(r))){this.handleSeatTap(n);return}let a=n?null:this.nearestSeatToScreen(t,Ie,!0),l=a?this.seatSection.get(a):null;if(a&&(!s||l&&this.sectionMatchesFocus(l))){this.handleSeatTap(a);return}if(s&&this.opts.onBackdropTap&&!this.floorOverview){let d=this.sectionAt(t);if(d&&d!==s){let h=this.sectionTapAnchor(d,this.screenToWorld(t));this.opts.onSectionTap?this.opts.onSectionTap(d,h):this.focusSection(d,{anchor:h})}else d||this.opts.onBackdropTap();return}if(s)return;let c=this.sections.length?this.sectionAt(t):null;if(!c||this.effScale()>=ae||this.sectionFrameScale(c)<=this.stage.scaleX()*1.02)return}}if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let s=this.floorOverview?this.sectionAt(t):null,n=(s?this.objectFloor.get(s):null)??this.deckFloorAt();if(n){this.opts.onDeckTap(n);return}}if(this.sections.length){let s=this.screenToWorld(t),n=this.owned.badgeAt(s)??this.sectionAt(t);if(n){let r=this.sectionTapAnchor(n,s);this.opts.onSectionTap?this.opts.onSectionTap(n,r):this.focusSection(n,{anchor:r});return}}let o=Math.max(Pe*1.2,this.stage.scaleX()*2.5);this.zoomAbout(o,t)})}zoomBounds(){let e=.5*this.fitScale;return this.zones.length&&(e=Math.min(e,Ge*.9)),{min:e,max:Math.max(10*this.fitScale,4)}}zoomAbout(e,t){bn(this.stage,e,t,this.zoomBounds())&&(this.afterViewChange(),this.stage.batchDraw())}zoomToBounds(e,t){Sn(this.stage,e,this.zoomBounds(),t),this.settleView(),this.stage.batchDraw()}focusRegion(e,t){let o=typeof e=="string"?this.sectionBounds(e):e;if(!o)return;if(this.cancelGlide(),t?.animate===!1||this.reducedMotion){this.zoomToBounds(o,t?.minScale);return}let s=this.stage.width(),n=this.stage.height(),{min:r,max:a}=this.zoomBounds(),l=1.12,c=Math.min(s/(o.width*l),n/(o.height*l)),d=G(Math.max(c,t?.minScale??r),r,a),h=s/2-(o.x+o.width/2)*d,p=n/2-(o.y+o.height/2)*d,m=this.stage.scaleX(),y=this.stage.x(),u=this.stage.y();if(Math.abs(d-m)<1e-4&&Math.abs(h-y)<.5&&Math.abs(p-u)<.5){this.settleView();return}let f=performance.now(),b=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let g=S=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let v=Math.min(1,(S-f)/b),w=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,k=m+(d-m)*w;this.stage.scale({x:k,y:k}),this.stage.position({x:y+(h-y)*w,y:u+(p-u)*w}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),v<1?this.glideRaf=requestAnimationFrame(g):(this.glideRaf=0,this.glideInProgress=!1,this.settleView())};this.glideRaf=requestAnimationFrame(g)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=re?"seats":this.zones.length&&e<Ge?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(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,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,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,t)=>this.focusedSeatOpacity(e,t),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),Kn(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(ge+re)/2:this.seatRungScale(),o=this.stage.width(),s=this.stage.height(),n=this.getVisibleWorldRect(),r={x:n.x+n.width/2,y:n.y+n.height/2},a=r.x,l=r.y;if(e==="sections"&&this.sections.length>0){let p=this.sections.map(f=>{let b=N(f.outline);return{x:b.x+b.width/2,y:b.y+b.height/2}}),m=o/(t*2),y=s/(t*2);if(!p.some(f=>Math.abs(f.x-r.x)<=m&&Math.abs(f.y-r.y)<=y)){let f=p.reduce((b,g)=>{let S=(g.x-r.x)**2+(g.y-r.y)**2;return S<b.distance?{point:g,distance:S}:b},{point:p[0],distance:1/0});a=f.point.x,l=f.point.y}}let c=e==="seats"?this.seats.filter(p=>p.kind!=="booth"):[];if(c.length>0){let p=c[0],m=1/0;for(let y of c){let u=y.x-r.x,f=y.y-r.y,b=u*u+f*f;b<m&&(p=y,m=b)}a=p.x,l=p.y}let d=o/(t*1.12),h=s/(t*1.12);this.focusRegion({x:a-d/2,y:l-h/2,width:d,height:h})}seatRungScale(){return wn(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,t,o){return Ln({stageWidth:this.stage.width(),stageHeight:this.stage.height(),fullBounds:t,seatPoints:e,visibleBounds:this.getVisibleWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){let e=Te,t=new zi({fontSize:fe,fontStyle:"600",fontFamily:this.labelFont(),listening:!1}),o=this.seatR*2-3;for(let s of this.seats){if(s.kind==="booth"){e=Math.min(e,Te);continue}let n=fe*this.seatLabelScale(s);t.fontSize(n),t.text(Pt(s.displayLabel??s.label));let r=t.width()>o?Math.max(je,n*o/t.width()):n;e=Math.min(e,r)}return t.destroy(),Z/Math.max(je,e)}afterViewChange(){this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){if(!this.focusRoams||!this.focusedSectionId||this.floorOverview)return;let e=qs({sections:this.sections.map(t=>({logicalId:t.logicalId,members:t.memberIds.length,bounds:this.sectionScreenBounds(t)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!e||e===this.focusedSectionId||(this.focusedSectionId=e,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(e))}scheduleViewChange(){this.exportMode||this.viewChangeRaf||(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()}))}sizeLabel(e,t,o){e.fontSize(Math.max(1,t)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),be+.01,ae):this.effScale(),t=Math.max(e,1e-4);for(let[n,r]of this.primaryFocalLabels)jn(n,r,t,(a,l)=>{this.sizeLabel(a,l,a.y())});this.hasSections?(nr(this.sectionLodPaintContext,e),this.owned.sync(e)):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=cn(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&e<re;if(this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&o){this.seatLayer.listening(!1);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.seatReveal||this.seatRevealPending)return;this.updateSeatGroupVisibility();let e=G(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.rebuildSeatCache(),this.seatLayer.batchDraw()}releaseSeatLayerBitmap(){rr(Jt,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<re?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.assetGeneration,t=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assetPromises.slice(),...t?[t.ready.then(()=>{}),t.load("700 24px Inter").then(()=>{}),t.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assetGeneration)throw new Error("The chart changed while its export assets were loading.");if(this.assetErrors.length)throw new Error(`Export stopped because ${this.assetErrors.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(r=>r.getClientRect({relativeTo:this.stage})).filter(r=>r.width>0&&r.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(r=>r.x)),o=Math.min(...e.map(r=>r.y)),s=Math.max(...e.map(r=>r.x+r.width)),n=Math.max(...e.map(r=>r.y+r.height));return{x:t,y:o,width:Math.max(1,s-t),height:Math.max(1,n-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),t=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,t)*.025)),s=()=>{let n=this.exportSceneBounds(),r=Math.max(1,e-o*2),a=Math.max(1,t-o*2),l=Math.min(r/n.width,a/n.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-n.width*l)/2-n.x*l,y:(t-n.height*l)/2-n.y*l}),this.afterViewChange()};s(),s()}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(s){let n=s instanceof Error?s.message:String(s);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${n}`)}let t=document.createElement("canvas");t.width=this.stage.width(),t.height=this.stage.height();let o=t.getContext("2d");if(!o)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");o.fillStyle=this.canvasBackground,o.fillRect(0,0,t.width,t.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return t}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ae):this.effScale();for(let{node:t,backdrop:o,kind:s}of this.freeTextById.values()){if(s==="ga-label"||s==="ga-capacity")continue;let r=s==="free-text"&&this.nodeBelongsToFocusedSection(t)||me(t.fontSize(),e);t.visible(r),o?.visible(r)}for(let{node:t,fontSize:o}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||me(o,e))}nodeBelongsToFocusedSection(e){let t=this.focusedSectionId;if(!t)return!1;let o=this.sections.filter(r=>r.id===t||r.logicalId===t||r.zone===t);if(!o.length)return!1;let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),n={x:s.x+s.width/2,y:s.y+s.height/2};return o.some(r=>ie(n,r.outline,r.holes))}buildRowLabelPlan(e){this.rowLabelPlan=er(e,{theme:this.theme,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,o=Q){return Hi(e,t,o)}resolveAutomaticRowLabelPosition(e,t,o){return tr(e,t,o,this.seatIndex)}objectFilteredOut(e){let t=e.categoryKey;return t?!!(this.categoryHighlight&&t!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(t)):!1}updateLabels(){dr(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),labelGroup:this.labelGroup,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,t,o)=>this.resolveAutomaticRowLabelPosition(e,t,o),rowLabelBox:(e,t)=>this.rowLabelBox(e,t),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){let e=this.container.clientWidth||1,t=this.container.clientHeight||1;e===this.stage.width()&&t===this.stage.height()||(this.stage.size({width:e,height:t}),this.refitCurrentView())}};pt.ZOOM_STEP=1.4;var Xi=pt;function Cr(i,e){return new Xi(i,e)}function Pr(i,e,t){let o=new Map,s=new Map,n=new Map,r=new Map,a=[],l=new Map(no(i).map(h=>[h.id,h])),c=kt(i),d=new Map([...c.sections,...c.ungrouped?[c.ungrouped]:[]].map(h=>[h.id,h.label]));for(let h of e){o.set(h.label,h.id),s.set(h.label,h),n.set(h.id,h),a.push(h.id);let p=l.get(h.rowId),m=p&&"label"in p&&typeof p.label=="string"?p.label:void 0,y=p?.type==="row"?p.segmentedRow:void 0,u=y?.displayLabel??(p&&"displayLabel"in p&&typeof p.displayLabel=="string"&&p.displayLabel?p.displayLabel:m),f=t.get(h.rowId),b=p?.type==="table"?"table":p?.type==="booth"?"booth":"seat",g=u,S=y?.displayType?.trim()||(p&&"displayType"in p&&typeof p.displayType=="string"&&p.displayType.trim()?p.displayType.trim():void 0),v=h.displayLabel??h.label,w=v.split("-"),k=f||h.kind==="booth"?void 0:u&&v.startsWith(`${u}-`)?v.slice(u.length+1):w[w.length-1]??v;r.set(h.id,{objectId:h.rowId,objectType:b,sectionLabel:d.get(c.objectToSection.get(h.rowId)??""),rowLabel:g,seatNumber:k,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:s,seatById:n,seatContext:r,allIds:a}}function Ir(i,e={}){let{baseMs:t=1e3,factor:o=2,maxMs:s=1/0,jitter:n=0,random:r=Math.random}=e,a=Math.min(t*o**Math.max(0,i),s);if(n<=0)return a;let l=Math.min(1,n);return a*(1-l+l*r())}function xr(i,e,t){return qe(i).map(o=>{let s=i.categories.find(n=>n.key===o.categoryKey);return{id:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},capacity:Math.max(0,Math.floor(o.capacity)),available:wt(o).filter(n=>t(n)==="free").length,categoryKey:o.categoryKey,tiers:s?.tiers,price:s?.tiers?.[0]?.price??s?.price??0,currency:e}})}function Mr(i,e){let t={};for(let o of i)t[o.id]=e?{available:o.available,selected:e.get(o.id)??0}:{available:o.available};return t}function Rr(i){let e={};for(let[t,o]of i.seatById)i.groupedTableBySeatId.has(t)||i.closedMembers.has(t)||(i.statusOf(t)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let t of i.groupedTablesByLabel.values()){if(t.chairs.some(s=>i.closedMembers.has(s.id)))continue;let o=t.chairs[0];o&&(i.statusOf(o.id)??"free")==="free"&&(e[t.categoryKey]=(e[t.categoryKey]??0)+t.maxOccupancy)}for(let t of i.gaAreas??[])e[t.categoryKey]=(e[t.categoryKey]??0)+t.available;return e}var Yi=["background","rowLabelColor","textColor","selectionColor"];function Er(i,e){return!i||!e?!i&&!e:Yi.every(t=>i[t]===e[t])}function ft(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function ei(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}var ke=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function Ar(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var ti=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,t){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(t).then(s=>{if(s.reference.id!==o.id||s.reference.version!==o.version||s.configuration.id!==o.id||s.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return s.configuration})}return this.pending}};function _r(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function Br(i,e,t,o){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let s=[],n=0,r=!1,a=!1;for(let c of t??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");n=Math.max(n,Number(c.minimum))}else if(c?.type==="consecutiveSeats")r=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(n&&s.push({type:"minimumSelectedPlaces",minimum:n}),r&&s.push({type:"consecutiveSeats"}),a&&s.push({type:"noOrphanSeats"}),i!=null&&n>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??i??Math.max(o,n)));if(i!=null&&l<i)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<n)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:s,maxSelection:i??l}}function ql(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Zl(i){if(i.length<=1)return!1;let e=i[0]?.objectId,t=i[0]?.categoryKey;if(!e||i.some(s=>s.objectId!==e||s.categoryKey!==t))return!0;let o=i.map(s=>ql(s.id)).sort((s,n)=>s-n);return o.some((s,n)=>s<0||n>0&&s!==o[n-1]+1)}function Fr(i,e,t,o,s){let n=o.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,r=t??n,a=[];return t!=null&&e!==t&&a.push("numberOfPlacesToSelect"),n&&e<n&&a.push("minimumSelectedPlaces"),o.some(l=>l.type==="consecutiveSeats")&&Zl(i)&&a.push("consecutiveSeats"),o.some(l=>l.type==="noOrphanSeats")&&s()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:r,remaining:Math.max(0,r-e),seats:i,violations:a}}function Or(i){let{id:e,doc:t,seatById:o,groupedTableBySeatId:s}=i,n=t.objects.find(f=>f.type==="section"&&f.id===e);if(!n)return null;let r=i.sectionMembers(e),a=new Map,l=new Set,c=0,d=0;for(let f of r){let b=o.get(f);if(!b)continue;i.matchesAccessFilter&&i.statusOf(f)==="free"&&i.matchesAccessFilter(b)&&(d+=1);let g=s.get(f);if(g){if(l.has(g.label))continue;l.add(g.label),a.set(g.categoryKey,(a.get(g.categoryKey)??0)+g.maxOccupancy),i.statusOf(g.chairs[0]?.id??f)==="free"&&(c+=g.maxOccupancy)}else a.set(b.categoryKey,(a.get(b.categoryKey)??0)+1),i.statusOf(f)==="free"&&c++}let h=[...a.entries()].map(([f,b])=>{let g=t.categories.find(k=>k.key===f),S=g?.tiers?.length?g.tiers.map(k=>k.price):[g?.price??0],v=Math.min(...S),w=Math.max(...S);return{key:f,count:b,label:g?.label??f,color:g?.color??"#6e7bff",price:v,priceMin:v,priceMax:w}}).sort((f,b)=>f.price-b.price),p=h.map(f=>f.priceMin),m=h.map(f=>f.priceMax),y=n.zone?t.zones?.find(f=>f.id===n.zone):void 0,u=n.color??y?.color??h[0]?.color??"#6e7bff";return{id:e,...i.matchesAccessFilter?{accessibleLeft:d}:{},label:n.displayLabel??n.label,zoneLabel:y?.label??"",...n.entrance&&n.entrance.trim()?{entrance:n.entrance.trim()}:{},color:u,seatsLeft:c,priceMin:p.length?Math.min(...p):0,priceMax:m.length?Math.max(...m):0,categories:h}}var Ql=10,jl=15e3,Dr=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new ti;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.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.onVisibilityChange=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.accessFilter=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=_r(e.numberOfPlacesToSelect);let t=Br(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Ql);this.selectionValidators=t.validators,this.maxSelection=t.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(o=>typeof o=="string"&&!!o))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=po(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let o of Yi){let s=this.mapTheme[o];s&&(t[o]=s)}return{...e,theme:t}}setMapTheme(e){return Er(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let t=e.getSelection().map(n=>n.id),o=this.getActiveFloorId(),s=e.isFloorOverview?.()??!1;return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),s&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),t.length&&e.select?.(t),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let t=e.filter(s=>typeof s=="string");if(t.length===this.hidden.size&&t.every(s=>this.hidden.has(s)))return!1;this.hidden=new Set(t);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let t=(e??[]).filter(o=>typeof o=="string");return t.length===this.closedSections.size&&t.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(t),this.renderer?.setClosedSections?.(t),!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 t=this.groupedTablesByLabel.get(e);if(t)return t.chairs.map(s=>s.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(t=>this.idsForLabel(t)))]}tableSelection(e){let t=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return t?this.toTableSeat(t):null}lineItemDisplay(e){if(e.objectType==="ga"){let s=this.visibleDoc(),n=qe(s).find(r=>r.id===e.objectId);return{...n?.displayLabel?{displayLabel:n.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}if(e.objectType==="table"){let s=this.groupedTablesByLabel.get(e.label);return{...s?.displayLabel&&s.displayLabel!==s.label?{displayLabel:s.displayLabel}:{},...s?.displayType?{displayType:s.displayType}:{}}}let t=this.labelToSeat.get(e.label),o=t?this.seatContext.get(t.id):void 0;return{...t?.displayLabel?{displayLabel:t.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let t=performance.now(),o={},s=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let n=performance.now(),r=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:s(n)}),C=>({ok:!1,error:C,elapsed:s(n)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:s(a)}),()=>({ok:!1,elapsed:s(a)})),c=await r;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Ar(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let h=performance.now();try{let C=Go(d.doc,d.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(C.map(L=>[L.objectId,L])),this.groupedTablesByLabel=new Map(C.map(L=>[L.label,L])),this.groupedTableBySeatId=new Map(C.flatMap(L=>L.chairs.map(I=>[I.id,L]))),this.tableQuantities=new Map(C.map(L=>[L.label,L.mode==="whole"?L.capacity:L.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=C.reduce((L,I)=>L+Math.max(0,I.chairs.length-1),0)}catch(C){return this.emitError(C),null}this.expandedSeats=$e(d.doc);let p=Pr(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=p.labelToId,this.labelToSeat=p.labelToSeat,this.seatById=p.seatById,this.seatContext=p.seatContext,this.allIds=p.allIds;for(let C of this.groupedTablesByLabel.values()){let L=C.chairs[0];L&&(this.labelToId.set(C.label,L.id),this.labelToSeat.set(C.label,L))}o.normalizeBuyerModel=s(h);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let y=performance.now(),u=Cr(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=s(t),this.opts.onSeatsRevealed?.()},onSelect:C=>{this.handleRendererSelect(C)},onDeselect:C=>{this.handleRendererDeselect(C)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(C,L)=>{this.opts.onHover?.(C),this.opts.onSeatHover&&this.opts.onSeatHover(C?this.describeSeat(C,L):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(C,L)=>this.handleSectionTap(C,L),onBackdropTap:()=>this.overview(),onFocusedSectionChange:C=>this.opts.onSectionFocus?.(this.isSectionClosed(C)?null:this.sectionSummary(C)),onDeckTap:C=>this.handleDeckTap(C),onFps:this.opts.onFps});if(o.createRenderer=s(y),this.closed)return u.destroy(),null;this.renderer=u;let f=null,b="free",g=[],S=await l;if(S.ok){let C=S.objects;this.hidden=new Set(C.hidden??[]),g=(C.closed??[]).filter(L=>typeof L=="string"),f=C.seats,b=C.default??"free"}if(o.loadStatuses=S.elapsed,this.closed)return u.destroy(),this.renderer=null,null;let v=performance.now();u.setChart(this.visibleDoc()),(d.doc.floors?.length??0)>1&&u.setFloorOverview?.(!0),this.opts.colorblindSafe&&u.setColorblindSafe?.(!0),o.buildScene=s(v),this.closedSections=new Set(g);let w=performance.now();g.length&&u.setClosedSections?.(g),f&&this.applySeatsMap(f,b),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=s(w);let k=performance.now();u.forceDraw(),o.firstPaint=s(k);let T=performance.now();return this.attachVisibilityListener(),this.connect(),o.startRealtime=s(T),o.controllerTotal=s(t),{doc:d.doc,salesClosed:!!d.event.salesClosed,eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:m,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let o of this.renderer.getSelection()){let s=this.groupedTableBySeatId.get(o.id);s?t.has(s.label)||(t.add(s.label),e.push(this.toTableSeat(s))):e.push(this.toSeat(o))}return e}seatDetails(e){let t=this.seatById.get(e);return t?this.describeSeat(t):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let t=new Set;for(let o of e){let s=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(s)s.chairs.forEach(n=>t.add(n.id)),this.hold_?.labels.includes(s.label)||(this.tableQuantities.set(s.label,s.mode==="whole"?s.capacity:s.minOccupancy),s.mode==="variable"&&this.confirmedVariableTables.delete(s.label));else{let n=this.seatById.has(o)?o:this.labelToId.get(o);n&&t.add(n)}}this.renderer?.deselect([...t]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let t=new Set(this.getSelection().map(r=>r.label)),o=new Set,s=[];for(let r of e){let a=this.groupedTableBySeatId.get(r)??this.groupedTablesByLabel.get(r);if(a)this.tableTierResolution(a).kind==="invalid"?s.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let l=this.seatById.has(r)?r:this.labelToId.get(r);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?s.push(c.label):o.add(l)}}if(s.length&&this.emitError(new ke(mi(s))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let n=this.getSelection().filter(r=>!t.has(r.label));return n.length&&this.emitSelectionChange(),n}selectCategories(e){let t=new Set(e);return this.select([...this.seatById.values()].filter(o=>t.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let t=new Set(e);this.deselect(this.getSelection().filter(o=>t.has(o.categoryKey)).map(o=>o.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(o=>typeof o=="string"&&!!o))],this.rebuildSelectableSeatIds();let t=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];t.length&&this.deselect(t)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let t=this.getSelection(),o=e??t.reduce((s,n)=>s+(n.quantity??1),0);return Fr(t,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let t=new Set(e.getSelection().map(o=>o.id));return t.size>0&&fi(this.seatById.values(),o=>e.getStatus(o),t).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let t of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(t)??this.groupedTablesByLabel.get(t);if(o){o.chairs.forEach(n=>e.add(n.id));continue}let s=this.seatById.has(t)?t:this.labelToId.get(t);s&&e.add(s)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,t){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let s=o.mode==="whole"?o.capacity:Math.floor(t);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.maxOccupancy)return!1;let n=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,s),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,n),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,o){let s=this.groupedTablesByLabel.get(e),n=this.hold_;if(!s||s.mode!=="variable"||!n?.labels.includes(e))return null;let r=Math.floor(t);if(!Number.isInteger(r)||r<s.minOccupancy||r>s.maxOccupancy)return null;if((n.items??[]).filter(d=>d.label!==e).reduce((d,h)=>d+(h.quantity??1),0)+r>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(n.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?r:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,o,n.holdId);return this.tableQuantities.set(e,r),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,t)=>e+(t.quantity??1),0)}handleRendererSelect(e){let t=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(t?t.chairs.map(s=>s.id):[e.id]),this.emitSelectionChange();return}if((t?this.tableTierResolution(t):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(t?t.chairs.map(s=>s.id):[e.id]),this.emitError(new ke(mi([t?.label??e.label]))),this.emitSelectionChange();return}if(t){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(t.chairs.map(s=>s.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(t.chairs.map(s=>s.id)),this.opts.onSelect?.(t.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(t)),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 t=this.groupedTableBySeatId.get(e.id);t?(this.renderer?.deselect(t.chairs.map(o=>o.id)),this.hold_?.labels.includes(t.label)||(this.tableQuantities.set(t.label,t.mode==="whole"?t.capacity:t.minOccupancy),t.mode==="variable"&&this.confirmedVariableTables.delete(t.label)),this.opts.onDeselect?.(t.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 t of e){let o=this.groupedTablesByLabel.get(t);o&&(this.tableQuantities.set(t,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(t))}}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}}async hold(e,t){if(!this.renderer)return null;let s=e??this.getSelection().map(l=>l.label),n=(this.hold_?.items??[]).filter(l=>l.objectType==="ga"),r=[...new Set([...n.map(l=>l.label),...s])];if(!r.length)return null;let a=this.ticketIssue(r);if(a)throw new ke(a);if(this.hold_&&this.holdCovers(r))return this.hold_;try{let l=r.map(d=>{let h=n.find(y=>y.label===d);if(h)return{label:d,tierId:h.tierId,quantity:h.quantity};let p=this.labelToSeat.get(d),m=p?this.toSeat(p):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),c=await this.api.hold(this.key,l,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:r,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(l){throw this.handle409Conflicts(l),l}}async resumeHold(e){if(this.closed||!e||!this.api.resume)return null;let t=await this.api.resume(this.key,e);if(this.closed)return null;let o=[...new Set(t.items.map(s=>s.label))];return o.length?(this.setHold({holdId:t.holdId,labels:o,expiresAt:t.expiresAt,items:t.items},"restored"),this.hold_):null}async extendHold(e){let t=this.hold_;if(!t||!this.api.extend)return null;try{let o=await this.api.extend(this.key,t.holdId,e);return this.hold_?.holdId!==t.holdId?this.hold_:(this.setHold({holdId:t.holdId,labels:t.labels,expiresAt:o.expiresAt,items:t.items}),this.hold_)}catch{return null}}categoryAvailability(){return Rr({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,t=this.renderer;if(!t||!this.closedSections.size)return e;for(let o of this.closedSections)for(let s of t.sectionMembers?.(o)??[])e.add(s);return e}getGAAreas(){let e=this.visibleDoc();return e?xr(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Mr(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,o={}){let s=this.visibleDoc();if(!s||!Number.isFinite(t)||t<1)return null;let n=qe(s).find(d=>d.id===e);if(!n)return null;let r=wt(n).filter(d=>!this.hold_?.labels.includes(d)&&this.statusOf(d)==="free").slice(0,Math.floor(t));if(r.length!==Math.floor(t))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 r)a.set(d,{label:d,...o.tierId?{tierId:o.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,o.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(){let e=this.visibleDoc();if(!e?.zones?.length)return[];let t=new Set(kt(e).sections.filter(o=>o.seatCount>0&&!!o.zone).map(o=>o.zone));return e.zones.filter(o=>t.has(o.id)).map(o=>({id:o.id,label:o.label}))}pickPremiumBlock(e,t,o){let s=this.visibleDoc();if(!s?.objects?.length)return null;let n=s.focalPoint??{x:0,y:0},r=new Set(this.groupedTablesByObject.keys()),a=$e(s).filter(p=>!r.has(p.rowId)),l=new Set(this.hold_?.labels??[]),c=new Set;for(let p of a){if(l.has(p.label)||this.seatTierResolution(p).kind==="invalid"||this.accessFilter&&!Ee(p,this.accessFilter))continue;let m=this.labelToId.get(p.label);((m?this.getStatus(m):void 0)??"free")==="free"&&c.add(p.label)}let d=Fo(a,c,{qty:e,categoryKey:t,zoneId:o,focal:n,preferPremium:!0});return d.labels.length!==e?null:d.labels.every(p=>this.labelToSeat.get(p)?.commercial?.premium)?[...d.labels]:null}async bestAvailable(e,t,o={}){let s=this.renderer;if(!s)return null;if(o.preferPremium){let n=this.pickPremiumBlock(e,t,o.zoneId);if(n){if(this.hold_&&!await this.release())return null;try{let r=n.map(d=>{let h=this.labelToSeat.get(d),p=h?this.toSeat(h):null;return{label:d,...p?.tierId?{tierId:p.tierId}:{}}}),a=await this.api.hold(this.key,r,o.ttlMs);s.clearSelection();let l=this.idsForLabels(n);l.length&&s.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...n],expiresAt:a.expiresAt,items:a.items});let c=n.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(r){let{status:a,reason:l}=ft(r);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),r}}}if(this.hold_&&!await this.release())return null;try{let n=await this.api.bestAvailable(this.key,e,t,o.zoneId,o.ttlMs);s.clearSelection();let r=this.idsForLabels(n.labels);r.length&&s.setStatus(r,"held"),this.setHold({holdId:n.holdId,labels:[...n.labels],expiresAt:n.expiresAt,items:n.items});let a=n.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(n){let{status:r,reason:a}=ft(n);throw r===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),n}}async book(e,t,o){let s=this.renderer;if(!s)return null;if(!this.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let n=t??this.getSelection().map(c=>c.label);if(!n.length)return null;let r=this.ticketIssue(n);if(r)throw new ke(r);let a;try{if(this.hold_&&this.holdCovers(n))a=this.hold_.holdId;else{let c=this.hold_?.holdId,d=await this.api.hold(this.key,n.map(h=>{let p=this.labelToSeat.get(h),m=p?this.toSeat(p):null;return{label:h,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),o,c);a=d.holdId,this.setHold({holdId:a,labels:[...n],expiresAt:d.expiresAt,items:d.items})}await this.api.book(this.key,n,a,e)}catch(c){let{status:d,conflicts:h,reason:p}=ft(c);if(this.clearHold(),d===409&&p==="event_closed")this.opts.onSalesClosed?.();else if(d===409&&h?.length){let m=new Set(h.map(f=>f.label)),y=this.idsForLabels(m);y.length&&(s.setStatus(y,"booked"),s.deselect(y),this.resetTableQuantitiesForLabels(m));let u=n.filter(f=>!m.has(f));u.length&&a&&this.api.release(this.key,u,a).catch(()=>{}),this.emitSelectionChange()}else a&&this.api.release(this.key,n,a).catch(()=>{});throw c}let l=this.idsForLabels(n);return l.length&&(s.setStatus(l,"booked"),s.deselect(l)),this.clearHold(),this.resetTableQuantitiesForLabels(n),this.emitSelectionChange(),this.opts.onBook?.(e),n}async release(){let e=this.hold_;if(!e)return!0;try{let o=await this.api.release(this.key,e.labels,e.holdId);if(!this.releaseConfirmed(o,e.labels))return await this.resnapshot(),!1}catch(o){return this.emitError(o),!1}if(this.hold_?.holdId!==e.holdId)return!0;this.clearHold(),this.resetTableQuantitiesForLabels(e.labels);let t=this.idsForLabels(e.labels);return t.length&&(this.renderer?.deselect(t),this.renderer?.setStatus(t,"free")),!0}async releaseLabels(e){let t=this.hold_;if(!t)return!0;let o=e.filter(a=>t.labels.includes(a));if(!o.length)return!0;try{let a=await this.api.release(this.key,o,t.holdId);if(!this.releaseConfirmed(a,o))return await this.resnapshot(),!1}catch(a){return this.emitError(a),!1}if(this.hold_?.holdId!==t.holdId)return!0;let s=t.labels.filter(a=>!o.includes(a)),n=t.items?.filter(a=>!o.includes(a.label));s.length?this.setHold({...t,labels:s,items:n}):this.clearHold(),this.resetTableQuantitiesForLabels(o);let r=this.idsForLabels(o);return r.length&&(this.renderer?.deselect(r),this.renderer?.setStatus(r,"free")),!0}releaseConfirmed(e,t){let o=e?.released;return!Array.isArray(o)||t.every(s=>o.includes(s))}setStatus(e,t){this.renderer?.setStatus(e,t)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let t=new Set(e.categories.filter(s=>s.notForSale).map(s=>s.key));if(!t.size)return[];let o=[];for(let[s,n]of this.seatById)t.has(n.categoryKey)&&o.push(s);return o}flashSeat(e,t){this.renderer?.flashSeat(e,t)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let t=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&t&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){this.accessFilter=e===null?null:[...e],this.renderer?.setAccessibilityFilter?.(e);let t=this.renderer?.getFocusedSection?.()??null;t&&this.opts.onSectionFocus?.(this.sectionSummary(t))}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let t=this.renderer;!t?.setActiveFloor||e===t.getActiveFloorId?.()&&!t.isFloorOverview?.()||(t.setFloorOverview?.(!1),t.setStacked?.(!1),t.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let t=this.renderer;!t?.setStacked||e===t.isStacked?.()||(t.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let t=this.renderer;!t?.setFloorOverview||e===t.isFloorOverview?.()||(t.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let t=this.renderer;t&&(t.setViewMode?.("flat"),t.setFloorOverview?.(!1),t.setStacked?.(!1),t.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()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){let t=this.renderer;if(t){if(t.clearSectionFocus?.(),this.opts.onSectionFocus?.(null),e?.length){let o=this.floorForCategories(e);o&&this.setFloor(o)}t.focusCategories?t.focusCategories(e):t.zoomToFit()}}floorForCategories(e){let t=this._doc;if(!t?.floors||t.floors.length<2)return null;let o=new Set(e),s=a=>a.some(l=>l.type==="row"&&(o.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||l.type==="gaArea"&&o.has(l.categoryKey)),n=this.getActiveFloorId(),r=t.floors.find(a=>a.id===n);return r&&s(r.objects)?null:t.floors.find(a=>s(a.objects))?.id??null}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,t){this.handleSectionTap(e,t)}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}handleSectionTap(e,t){let o=this.renderer;if(o){if(o.focusSection?o.focusSection(e,t?{anchor:t}:void 0):o.focusRegion?.(e),this.isSectionClosed(e)){this.opts.onSectionFocus?.(null);return}this.opts.onSectionFocus?.(this.sectionSummary(e))}}sectionSummary(e){return!this.renderer||!this._doc?null:Or({id:e,doc:this._doc,sectionMembers:t=>this.renderer?.sectionMembers?.(t)??[],statusOf:t=>this.renderer?.getStatus(t)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:t=>Ee(t,this.accessFilter)}:{}})}destroy(){if(this.closed=!0,this.detachVisibilityListener(),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 t=this.groupedTableBySeatId.get(e.id);if(t)return this.toTableSeat(t);let o=e.commercial?{commercial:e.commercial}:void 0,s=e.displayLabel?{displayLabel:e.displayLabel}:void 0,n=e.accessibility?.length?{accessibility:e.accessibility}:void 0,r=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,...s,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...n,...r};let d=c.tier;return{id:e.id,label:e.label,...s,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...o,...n,...r}}toTableSeat(e){let t=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(r=>At(this._doc,this.tableTierSeat(e),r.id).kind==="resolved"),s=this.tableTierResolution(e),n=s.kind==="resolved"?s.tier:void 0;return{id:t?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:t?this.seatContext.get(t.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:n?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:n?.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(r=>r.id)}}describeSeat(e,t){let o=this._doc?.categories.find(s=>s.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:o?.label??e.categoryKey,categoryColor:o?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...t?.interaction?{interaction:t.interaction}:{},...t?.unavailable?{unavailable:!0}:{},...t?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(t=>t.key===e)?.price??0}tiersFor(e){let t=this._doc?.categories.find(o=>o.key===e)?.tiers;return t&&t.length?t:void 0}tiersForSeat(e){if(!this._doc)return;let t=Oo(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?At(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(t=>t.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let t=e.chairs[0]?.id??"";return At(this._doc,this.tableTierSeat(e),this.seatTiers.get(t))}setSeatTier(e,t){let o=this.seatById.get(e);if(!o)return;let s=this.tiersForSeat(o);if(s){if(t==null)this.seatTiers.delete(e);else if(s.some(n=>n.id===t))this.seatTiers.set(e,t);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let t=[];for(let o of e){let s=this.labelToSeat.get(o);s&&t.push(this.toSeat(s))}return t}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 t=e?this.seatsForLabels(e):this.getSelection();return Do(this._doc,t.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let t=this.ticketIssue();if(t){this.hintShown=!0,this.opts.onHint(t.code==="companion_pair_required"?Y("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=new Set(e.getSelection().map(n=>n.id));(o.size?fi(this.seatById.values(),n=>e.getStatus(n),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(Y("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){let t=this.hold_;if(!t||t.labels.length!==e.length||!e.every(n=>t.labels.includes(n)))return!1;let o=new Map((t.items??[]).map(n=>[n.label,n.tierId])),s=new Map((t.items??[]).map(n=>[n.label,n.quantity??1]));return e.every(n=>{let r=this.labelToSeat.get(n),a=r?this.toSeat(r):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||this.confirmedVariableTables.has(n))&&(!s.has(n)||s.get(n)===a.quantity))&&(!o.has(n)||o.get(n)===l)})}handle409Conflicts(e){let{status:t,conflicts:o}=ft(e);if(t!==409||!o?.length)return;let s=this.renderer;if(!s)return;let n=this.idsForLabels(o.map(r=>r.label));n.length&&(s.deselect(n),s.setStatus(n,"held"),this.resetTableQuantitiesForLabels(o.map(r=>r.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let n of e.items??[])this.groupedTablesByLabel.has(n.label)&&n.quantity!=null&&(this.tableQuantities.set(n.label,n.quantity),this.groupedTablesByLabel.get(n.label)?.mode==="variable"&&this.confirmedVariableTables.add(n.label));let o={...e,seats:this.seatsForLabels(e.labels)};this.hold_=o,this.renderer?.setOwnedHold?.(this.idsForLabels(o.labels)),this.expiryTimer&&clearTimeout(this.expiryTimer);let s=Math.max(0,o.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},s),t==="restored"?this.opts.onHoldRestored?.(o):this.opts.onHold?.(o)}clearHold(){this.hold_=null,this.renderer?.setOwnedHold?.(null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null)}async expireActiveHold(){let e=this.hold_;if(e){try{let t=await this.api.objects(this.key);if(this.hold_?.holdId!==e.holdId)return;this.applySeatsMap(t.seats,t.default??"free")}catch{this.hold_?.holdId===e.holdId&&(this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},2e3));return}if(this.hold_?.holdId===e.holdId){if(e.labels.some(t=>this.statusOf(t)==="held")){this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},1e3);return}this.clearHold(),this.opts.onHoldExpired?.()}}}applySeatsMap(e,t="free"){let o=this.renderer;if(!o)return;this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=t;let s=ei(t);this.allIds.length&&o.setStatus(this.allIds,s),o.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let n={free:[],held:[],booked:[],not_for_sale:[]};for(let[a,l]of Object.entries(e))n[ei(l)].push(...this.idsForLabel(a));["free","held","booked","not_for_sale"].forEach(a=>{a!==s&&n[a].length&&o.setStatus(n[a],a)});let r=this.notForSaleCategorySeatIds();r.length&&o.setStatus(r,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(t=>this.statusOf(t)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}async resnapshot(){try{let e=await this.api.objects(this.key);this.applySeatsMap(e.seats,e.default??"free")}catch{}}async refresh(){await this.resnapshot()}attachVisibilityListener(){if(this.onVisibilityChange||typeof document>"u"||typeof document.addEventListener!="function")return;let e=()=>{this.closed||document.visibilityState==="visible"&&this.resnapshot().then(()=>{this.closed||this.renderer?.forceDraw()})};this.onVisibilityChange=e,document.addEventListener("visibilitychange",e)}detachVisibilityListener(){this.onVisibilityChange&&(typeof document<"u"&&typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onVisibilityChange=null)}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applySeatsMap(e.exceptions,e.default),resync:()=>this.resnapshot(),onSections:(e,t)=>{let o=this.syncHidden(e),s=this.syncClosed(t);o&&this.resnapshot(),(o||s)&&this.opts.onStatusChange?.()}}}applyStatusChanges(e){let t=this.renderer;if(t){for(let o of e){this.liveStatuses.set(o.label,o.status);let s=this.idsForLabel(o.label);if(!s.length)continue;let n=ei(o.status);this.opts.flashOnLiveChange&&n!=="free"&&s.some(r=>t.getStatus(r)==="free")&&!this.hold_?.labels.includes(o.label)&&s.forEach(r=>t.flashSeat(r,n==="held"?"#f4b740":"#f43f5e")),t.setStatus(s,n)}this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&t.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let o=null;try{o=this.api.createRealtime(this.key,this.realtimeSink())}catch{o=null}if(o){this.realtime=o,o.start();return}}if(this.realtime)return;let t;try{let o=this.api.socketProtocols?.(this.key);t=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=t,t.onopen=()=>{this.attempt=0,this.resnapshot()},t.onmessage=o=>{let s;try{s=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!s||typeof s!="object")return;let r=s;Array.isArray(r.hidden)&&this.syncHidden(r.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(r.closed)&&this.syncClosed(r.closed)&&this.opts.onStatusChange?.(),r.type!=="hidden"&&(r.seats&&typeof r.seats=="object"?this.applySeatsMap(r.seats):Array.isArray(r.changes)&&this.applyStatusChanges(r.changes))},t.onclose=()=>{this.ws===t&&(this.ws=null),this.scheduleReconnect()},t.onerror=()=>{try{t.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Ir(e,{baseMs:1e3,maxMs:jl,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var Jl=5,ec=-1.1,Ui=35;function $i(i,e){let t=i-ee,o=Math.atan2(Jl-t,e)*180/Math.PI,s=Math.atan2(ec-t,e)*180/Math.PI;return s<-Ui&&(o+=-Ui-s,s=-Ui),{topPitch:o,basePitch:s}}var $=2048,de=1024,yt=oo,E=Math.PI*2,tc=de/180,Ye=i=>(i+180)/360*$,W=i=>(90-i)/180*de;function Vr(i){let e=2166136261;for(let t=0;t<i.length;t++)e^=i.charCodeAt(t),e=Math.imul(e,16777619);return e>>>0}function zr(i){let e=i>>>0;return()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var ii=96,Qi=360/ii,ic=.6,qi=[17,23,42];function Zi(i,e,t=1){let o=Math.max(0,Math.min(.58,e)),s=Math.round(i[0]+(qi[0]-i[0])*o),n=Math.round(i[1]+(qi[1]-i[1])*o),r=Math.round(i[2]+(qi[2]-i[2])*o);return`rgba(${s},${n},${r},${t})`}function Gr(i,e,t){return[Math.round(i[0]+(e[0]-i[0])*t),Math.round(i[1]+(e[1]-i[1])*t),Math.round(i[2]+(e[2]-i[2])*t)]}function te(i,e,t){let o=(1-Math.abs(2*t-1))*e,s=(i%360+360)%360/60,n=o*(1-Math.abs(s%2-1)),r=0,a=0,l=0;s<1?[r,a,l]=[o,n,0]:s<2?[r,a,l]=[n,o,0]:s<3?[r,a,l]=[0,o,n]:s<4?[r,a,l]=[0,n,o]:s<5?[r,a,l]=[n,0,o]:[r,a,l]=[o,0,n];let c=t-o/2;return[Math.round((r+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var Hr=new Map;function Nr(i){if(!i)return null;let e=Hr.get(i);if(e)return e;let t=2166136261;for(let n=0;n<i.length;n++)t^=i.charCodeAt(n),t=Math.imul(t,16777619);let o=(t>>>0)%360,s=te(o,.3,.42);return Hr.set(i,s),s}function oc(i,e,t,o){let s=new Array(ii).fill(null),n=0,r=i.sectionId;for(let a of e){if(a.id===i.id)continue;let l=a.sectionId;if(!l||r&&l===r)continue;let c=a.x-i.x,d=a.y-i.y,h=Math.hypot(c,d)*yt;if(h<1.5||h>95)continue;let p=a.eyeHeightM??ee,m=p-o;Math.abs(m)>n&&(n=Math.abs(m));let y=Math.atan2(m,h)*180/Math.PI,u=Math.atan2(p-ee-o,h)*180/Math.PI,b=((Math.atan2(c,-d)-t)*180/Math.PI+540)%360-180,g=Math.min(ii-1,Math.max(0,Math.floor((b+180)/Qi))),S=y>34&&h<16,v=s[g];v?(y>v.top&&(v.top=y),u<v.base&&(v.base=u),h<v.nearM&&(v.nearM=h,v.tint=Nr(a.categoryKey)),v.overhead=v.overhead||S):s[g]={top:y,base:u,nearM:h,overhead:S,tint:Nr(a.categoryKey)}}return{bins:s,maxDelta:n}}function sc(i,e,t,o){for(let s=0;s<ii;s++){let n=e[s];if(!n)continue;let r=-180+s*Qi,a=t(r),l=t(r+Qi);if(!(l>a))continue;let c=Math.min(72,n.top),d=Math.min(n.base,-4),h=o(c),p=o(d);if(p<=h)continue;let m=n.nearM/95,y=n.tint,u=y?Gr([44,54,80],y,.34):[44,54,80],f=y?Gr([24,30,48],y,.28):[24,30,48],b=i.createLinearGradient(0,h,0,p);b.addColorStop(0,Zi(u,m)),b.addColorStop(.24,Zi(f,m)),b.addColorStop(1,Zi([10,13,22],m)),i.fillStyle=b,i.fillRect(a,h,l-a+1,p-h),i.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,i.fillRect(a,h,l-a+1,1.5);let S=Math.min(p,o(0))-h;if(S>8){let w=1-m*.4;for(let k=1;k<6;k++){let T=h+S*k/6;i.fillStyle=`rgba(0,0,0,${.16*w})`,i.fillRect(a,T,l-a+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(a,T+1.5,l-a+1,1.2)}}if(n.overhead){let v=o(Math.min(86,c+12)),w=i.createLinearGradient(0,v,0,h);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=w,i.fillRect(a,v,l-a+1,h-v),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(a,h-1.5,l-a+1,1.5)}}}function nc(i,e,t){let s=new Array(72).fill(!1),n=new Array(72).fill(1/0),r=new Set,a=0;for(let b of t){a++,b.sectionId&&r.add(b.sectionId);let g=b.x-e.x,S=b.y-e.y,v=Math.hypot(g,S)*yt;if(v<.5)continue;let w=Math.atan2(g,-S),k=Math.floor((w+Math.PI)/E*72);k<0?k=0:k>=72&&(k=71),s[k]=!0,v<n[k]&&(n[k]=v)}let l=0,c=[];for(let b=0;b<72;b++)s[b]&&(l++,c.push(n[b]));let d=l/72*360;c.sort((b,g)=>b-g);let h=c.length?c[c.length>>1]:0,p=c.length?c[Math.floor(c.length*.15)]??h:0,m=c.length?c[Math.floor(c.length*.85)]??h:0,y=p>.5?m/p:1,u=Vr(`${a}|${[...r].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),f;return d>=300&&h>11&&y>1.35?f="sport":d>=285?f="arena":f="proscenium",{mode:f,seed:u,voidRadiusM:h,aspect:y}}var rc=5;function ac(i,e,t){switch(t){case 1:i.beginPath(),i.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,E),i.fill();break;case 2:i.beginPath(),i.ellipse(0,-e*1.02,e*.42,e*.42,0,0,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.2,e*.98,e*1.02,0,0,E),i.fill();break;case 3:i.beginPath(),i.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.52,e*1.22,e*.24,0,0,E),i.fill();break;case 4:i.beginPath(),i.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,E),i.fill(),i.beginPath(),i.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,E),i.fill();break;default:break}}function lc(i,e,t,o,s){let n=o*.44,r=o*s.shoulderK,a=o*.66,l=o*1.68,c=o*5.4,d=`rgba(${s.clothing[0]},${s.clothing[1]},${s.clothing[2]},${s.alpha})`,h=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`;i.save(),i.translate(e,t);let p=s.lean*o;i.fillStyle=d,i.beginPath(),i.moveTo(-n,a),i.quadraticCurveTo(-n*1.18,l-p-o*.6,-r,l-p),i.quadraticCurveTo(-r*1.05,l+o*1.2,-r*.94,c),i.lineTo(r*.94,c),i.quadraticCurveTo(r*1.05,l+o*1.2,r,l+p),i.quadraticCurveTo(n*1.18,l+p-o*.6,n,a),i.closePath(),i.fill(),i.fillStyle=h,i.fillRect(-n*.82,o*.5,n*1.64,o*.9),i.save(),i.rotate(s.tilt),i.translate(s.turn*o,0),i.fillStyle=h,o>=18?(i.beginPath(),i.moveTo(-o*.9,-o*.15),i.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),i.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),i.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),i.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),i.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),i.closePath(),i.fill(),o>=22&&(i.beginPath(),i.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,E),i.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,E),i.fill())):(i.beginPath(),i.ellipse(0,0,o*.9,o*1.06,0,0,E),i.fill()),ac(i,o,s.hair),s.rim>.01&&(i.strokeStyle=`rgba(245,205,150,${(.5*s.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.14),i.beginPath(),i.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),i.stroke()),i.restore(),s.rim>.01&&(i.strokeStyle=`rgba(240,200,150,${(.28*s.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.12),i.beginPath(),i.moveTo(-r*.8,l-o*.05),i.quadraticCurveTo(-n,l-o*.75,0,l-o*.82),i.quadraticCurveTo(n,l-o*.75,r*.8,l-o*.05),i.stroke()),i.restore()}function cc(i,e,t,o,s,n,r){i.fillStyle=`rgba(${s[0]},${s[1]},${s[2]},${r})`,i.beginPath(),i.moveTo(e-o*1.72,t+o*4),i.quadraticCurveTo(e-o*1.78,t+o*1.55,e-o*.46,t+o*1.02),i.lineTo(e-o*.4,t+o*.62),i.lineTo(e+o*.4,t+o*.62),i.lineTo(e+o*.46,t+o*1.02),i.quadraticCurveTo(e+o*1.78,t+o*1.55,e+o*1.72,t+o*4),i.closePath(),i.fill(),i.fillStyle=`rgba(${n[0]},${n[1]},${n[2]},${r})`,i.beginPath(),i.ellipse(e,t,o*.9,o*1.05,0,0,E),i.fill()}function Ji(i,e,t,o,s){let n=o*.1,r=t-o*.9,a=t-o*.74,l=t-o*.46,c=o*.13,d=o*.09,h=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`,p=i.createRadialGradient(e,t,1,e,t,o*.24);p.addColorStop(0,"rgba(0,0,0,0.4)"),p.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=p,i.beginPath(),i.ellipse(e,t/.28,o*.24,o*.24,0,0,E),i.fill(),i.restore(),i.fillStyle=h,i.beginPath(),i.moveTo(e-d,l),i.lineTo(e-d*.7,t),i.lineTo(e-d*.1,t),i.lineTo(e-d*.1,l+o*.02),i.lineTo(e+d*.1,l+o*.02),i.lineTo(e+d*.1,t),i.lineTo(e+d*.7,t),i.lineTo(e+d,l),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,a),i.quadraticCurveTo(e-c*.9,l-o*.12,e-d,l),i.lineTo(e+d,l),i.quadraticCurveTo(e+c*.9,l-o*.12,e+c,a),i.quadraticCurveTo(e,a-o*.05,e-c,a),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=h,i.lineWidth=o*.055;let m=a+o*.02;s.pose===1?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*1.5,t-o*1.02),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.5,t-o*1.02),i.stroke()):s.pose===2?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e+d*1.4,l-o*.02),i.moveTo(e+c*.8,m),i.lineTo(e-d*.4,l-o*.06),i.stroke(),i.fillStyle=h,i.beginPath(),i.ellipse(e+d*1.5,l-o*.04,o*.07,o*.09,-.5,0,E),i.fill()):s.pose===3?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*.2,r+n*.6),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.1,l),i.stroke(),i.lineWidth=o*.02,i.beginPath(),i.moveTo(e-c*.2,r+n*.9),i.lineTo(e-c*.2,t-o*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,m),i.lineTo(e-c*.95,l+o*.02),i.moveTo(e+c*.85,m),i.lineTo(e+c*.95,l+o*.02),i.stroke()),i.fillStyle=h,i.fillRect(e-n*.34,r+n*.6,n*.68,n*.9),i.beginPath(),i.ellipse(e,r,n*.86,n*1.05,0,0,E),i.fill(),s.rimStrength>.01&&(i.strokeStyle=`rgba(${s.rim[0]},${s.rim[1]},${s.rim[2]},${(.6*s.rimStrength).toFixed(3)})`,i.lineWidth=Math.max(1,o*.02),i.beginPath(),i.moveTo(e-c,a),i.lineTo(e-n*.6,r+n*.4),i.moveTo(e-n*.7,r),i.ellipse(e,r,n*.84,n*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function oi(i,e,t,o,s,n,r,a,l){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,s);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-n,t),i.lineTo(o-r,s),i.lineTo(o+r,s),i.lineTo(e+n,t),i.closePath(),i.fill(),i.restore()}function eo(i,e,t,o,s){let n=i.createRadialGradient(e,t,0,e,t,o*3);n.addColorStop(0,`rgba(${s},0.9)`),n.addColorStop(.4,`rgba(${s},0.35)`),n.addColorStop(1,`rgba(${s},0)`),i.fillStyle=n,i.beginPath(),i.arc(e,t,o*3,0,E),i.fill(),i.fillStyle=`rgba(${s},1)`,i.beginPath(),i.arc(e,t,o,0,E),i.fill()}function hm(i,e,t){let o=document.createElement("canvas");o.width=$,o.height=de;let s=o.getContext("2d"),n=e.x-i.x,r=e.y-i.y,a=Math.hypot(n,r),l=Math.max(2,a*yt),c=i.eyeHeightM??ee,d=nc(i,e,t),h=zr(d.seed),p=210+h()*150,m=te(220+(h()-.5)*60,.55,.82),y=`${m[0]},${m[1]},${m[2]}`,u=s.createLinearGradient(0,0,0,de);u.addColorStop(0,"#080b12"),u.addColorStop(.42,"#12182c"),u.addColorStop(.5,"#1c2440"),u.addColorStop(.56,"#151b2c"),u.addColorStop(.78,"#171e30"),u.addColorStop(1,"#131829"),s.fillStyle=u,s.fillRect(0,0,$,de);let f=s.createLinearGradient(0,W(-6),0,de);f.addColorStop(0,"rgba(30, 37, 56, 0)"),f.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),f.addColorStop(1,"rgba(22, 28, 44, 0.12)"),s.fillStyle=f,s.fillRect(0,W(-6),$,de-W(-6));let b=Math.atan2(n,-r),g=oc(i,t,b,c),S=g.maxDelta>=ic;S&&sc(s,g.bins,Ye,W);let v=Math.max(.3,Math.min(1,1-(l-6)/60)),w=$i(c,l),k=Math.min(80,Math.atan2(4,l)*180/Math.PI),T=Math.min(45,w.topPitch),C=w.basePitch;d.mode==="sport"?uc(s,l,c,d,v,p,y,h):d.mode==="arena"?hc(s,l,c,d,v,y,h):dc(s,k,T,C,v,p,y,h);let L=d.mode==="sport"?34:24+Math.floor(h()*8);s.fillStyle=`rgba(${y},0.8)`;for(let x=0;x<L;x++){let M=(x+.5)/L*$,R=W(d.mode==="sport"?58:54+x*7%3*6);s.beginPath(),s.arc(M,R,d.mode==="sport"?2.6:3.2,0,E),s.fill()}pc(s,i,t,e,b,c,n,r,S,d);let I=s.createLinearGradient(0,0,0,de);return I.addColorStop(0,"rgba(0,0,0,0.85)"),I.addColorStop(.12,"rgba(0,0,0,0)"),I.addColorStop(.9,"rgba(0,0,0,0)"),I.addColorStop(1,"rgba(0,0,0,0.55)"),s.fillStyle=I,s.fillRect(0,0,$,de),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function dc(i,e,t,o,s,n,r,a){let l=Ye(-e),c=Ye(e),d=W(t),h=W(o),p=c-l,m=h-d,y=W(Math.min(50,t+10)),u=p*(1.1+(1-s)*.5),f=i.createRadialGradient($/2,(d+h)/2,8,$/2,(d+h)/2,u);f.addColorStop(0,"rgba(255, 214, 150, 0.34)"),f.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),f.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),f.addColorStop(1,"rgba(99, 102, 241, 0)"),i.fillStyle=f,i.fillRect(l-p*.6,d-m*1.2,p*2.2,m*3.4);let b=te(n,.62,.55),g=te(n+40,.7,.5),S=te(n+70,.78,.52);i.save(),i.beginPath(),i.rect(l,d,p,m),i.clip();let v=i.createLinearGradient(0,d,0,h);v.addColorStop(0,`rgb(${b[0]},${b[1]},${b[2]})`),v.addColorStop(.5,`rgb(${g[0]},${g[1]},${g[2]})`),v.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=v,i.fillRect(l,d,p,m),i.globalAlpha=1;let w=i.createRadialGradient($/2,(d+h)/2,p*.12,$/2,(d+h)/2,p*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=w,i.fillRect(l,d,p,m),i.restore();let k=3+Math.floor(a()*3),T=m*.46,C=h-m*.08;for(let _=0;_<k;_++){let j=(_+1)/(k+1),V=l+p*(.22+j*.56+(a()-.5)*.06);Ji(i,V,C,T*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:te(n+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(l-p*.5,y,p*.5,h-y),i.fillRect(c,y,p*.5,h-y);let L=p*.055+3,I=L*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(l,h),i.lineTo(l-L,h),i.lineTo(l-I,y),i.lineTo(l+p*.012,y),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,h),i.lineTo(c+L,h),i.lineTo(c+I,y),i.lineTo(c-p*.012,y),i.closePath(),i.fill(),i.fillRect(l-I,y,p+I*2,(h-y)*.12);let x=m*.14,M=y+(h-y)*.12;i.fillStyle="rgba(4,6,12,0.96)";let R=7;i.beginPath(),i.moveTo(l-I,M);for(let _=0;_<=R;_++){let j=l-I+(p+I*2)*_/R;i.quadraticCurveTo(j-(p+I*2)/R/2,M+x,j,M)}i.lineTo(c+I,M),i.lineTo(c+I,y),i.lineTo(l-I,y),i.closePath(),i.fill(),i.fillStyle=`rgba(${r},0.12)`,i.fillRect(l-1.5,M,1.5,h-M),i.fillRect(c,M,1.5,h-M),i.fillStyle="#0b0f18",i.fillRect(l-L,h-m*.05,p+L*2,m*.05+3);let P=i.createLinearGradient(0,h-m*.05,0,h+m*.12);P.addColorStop(0,`rgba(255,206,140,${(.5*s).toFixed(3)})`),P.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=P,i.fillRect(l-L,h-m*.05,p+L*2,m*.2);let A=3+Math.floor(a()*2);for(let _=0;_<A;_++){let j=(_+1)/(A+1),V=l+p*(j+(a()-.5)*.08),z=W(Math.min(62,t+26)),J=(a()-.5)*p*.16;oi(i,V,z,V+J,h,4,p*.09,r,.16*(.7+s*.5)),eo(i,V,z,2.4,r)}}function hc(i,e,t,o,s,n,r){let a=Math.min(e*.6,Math.max(3,o.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=$/2,d=1.2,h=Math.max(e*.45,e-a),p=e+a,m=Math.atan2(d-t,h)*180/Math.PI,y=Math.atan2(d-t,p)*180/Math.PI,u=Math.atan2(-t,h)*180/Math.PI,f=W(m),b=W(y),g=W(u),S=Ye(l)-c,v=Math.max(6,(f-b)/2),w=(f+b)/2,k=i.createRadialGradient(c,g,4,c,g,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*s).toFixed(3)})`),k.addColorStop(.5,"rgba(150,140,190,0.08)"),k.addColorStop(1,"rgba(40,44,60,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=k,i.fillRect(c-S*2.6,b-v,S*5.2,g-b+v+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-S,w),i.ellipse(c,w,S,v,0,Math.PI,0,!1),i.lineTo(c+S,g),i.ellipse(c,g,S,v,0,0,Math.PI,!1),i.closePath(),i.fill();let T=i.createLinearGradient(0,w,0,g);T.addColorStop(0,`rgba(${n},0.14)`),T.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=T,i.fillRect(c-S,w,S*2,g-w);let C=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],L=C[Math.floor(r()*C.length)],I=r()<.5?-1:1,x=F=>c+F.u*I*S*.84,M=F=>w+F.v*v*.8,R=L.find(F=>F.lead)??L[0],P=x(R),A=i.createLinearGradient(0,w-v,0,w+v);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),i.fillStyle=A,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill();let _=i.createRadialGradient(P,w,2,P,w,S);_.addColorStop(0,`rgba(255,214,160,${(.5*s).toFixed(3)})`),_.addColorStop(1,"rgba(255,214,160,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=_,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill(),i.restore(),i.strokeStyle=`rgba(${n},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.stroke();let j=Math.max(24,(g-b)*1.3),V=L.length>=3?3:2;for(let F=0;F<V;F++){let he=(-.62+F*.52+(r()-.5)*.12)*-I,Le=c+he*S*.7,Ue=w-v*(.45+r()*.18),Fe=S*(.07+r()*.04),ci=j*(.26+r()*.12);i.fillStyle="#0a0e18",i.fillRect(Le-Fe/2,Ue-ci,Fe,ci),i.fillStyle=`rgba(${n},0.3)`,i.fillRect(Le-Fe/2,Ue-ci,Fe,1.5)}if(L.length>=3){let F=c-R.u*I*S*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(F,w-v*.34,S*.08,v*.1,0,0,E),i.fill(),i.strokeStyle=`rgba(${n},0.35)`,i.lineWidth=1,i.stroke()}for(let F of[...L].sort((he,Le)=>he.v-Le.v)){let he=.82+(F.v+1)*.14;Ji(i,x(F),M(F),j*he*(F.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:F.pose,rim:te(40,.72,.8),rimStrength:F.lead?1.4:.9})}let z=W(Math.min(60,y+34)),J=v*1.1+6;i.strokeStyle="rgba(60,68,92,0.85)",i.lineWidth=3,i.beginPath(),i.ellipse(c,z,S*1.15,J,0,0,E),i.stroke();let O=4+Math.floor(r()*3);for(let F=0;F<O;F++){let he=F/O*E,Le=c+Math.cos(he)*S*1.15,Ue=z+Math.sin(he)*J;if(Math.sin(he)>-.2){let Fe=c+(r()-.5)*S*.8;oi(i,Le,Ue,Fe,w,3,S*.32,n,.2*(.7+s*.4))}eo(i,Le,Ue,3,n)}let K=W(Math.min(52,y+24)),D=Math.max(60,S*.4),q=Math.max(24,D*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-D*.3,K-q/2),i.lineTo(c-D*.16,K-q*2.2),i.moveTo(c+D*.3,K-q/2),i.lineTo(c+D*.16,K-q*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-D/2,K-q/2,D,q);let ni=i.createLinearGradient(0,K-q*.3,0,K+q*.42);ni.addColorStop(0,`rgba(${n},0.5)`),ni.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=ni,i.fillRect(c-D*.42,K-q*.3,D*.84,q*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-D/2,K+q/2-2,D,2);let ri=i.createRadialGradient(c,K,4,c,K,D*1.1);ri.addColorStop(0,`rgba(${n},0.2)`),ri.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=ri,i.fillRect(c-D*1.1,K-D*.8,D*2.2,D*1.6);let ai=i.createRadialGradient(c,(z+w)/2,6,c,(z+w)/2,S*1.5);ai.addColorStop(0,`rgba(${n},${(.1*(.6+s*.5)).toFixed(3)})`),ai.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=ai,i.fillRect(c-S*1.5,z-40,S*3,w-z+80),i.restore();let Xr=c+Math.sign(P-c||1)*S*.5;oi(i,Xr,z-J*.4,P,M(R),2.5,S*.16,"255,224,178",.42*(.7+s*.4));let li=i.createRadialGradient(P,M(R),1,P,M(R),S*.2);li.addColorStop(0,`rgba(255,228,185,${(.4*s).toFixed(3)})`),li.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=li,i.beginPath(),i.ellipse(P,M(R),S*.2,v*.24,0,0,E),i.fill(),i.restore()}function uc(i,e,t,o,s,n,r,a){let l=$/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),h=e+c,p=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),m=Math.atan2(-t,d)*180/Math.PI,y=Math.atan2(-t,h)*180/Math.PI,u=W(m),f=W(y),b=Ye(p)-l,g=(u+f)/2,S=Math.max(10,(u-f)/2),v=i.createRadialGradient(l,g,4,l,g,b);v.addColorStop(0,"#e8f0fb"),v.addColorStop(.7,"#b9c9e2"),v.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(l,g,b,S,0,0,E),i.clip(),i.fillStyle=v,i.fillRect(l-b,g-S,b*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(l,g-S),i.lineTo(l,g+S),i.moveTo(l-b*.5,g-S),i.lineTo(l-b*.5,g+S),i.moveTo(l+b*.5,g-S),i.lineTo(l+b*.5,g+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(l,g,S*.9,S*.5,0,0,E),i.stroke(),i.restore(),i.strokeStyle="rgba(210,225,245,0.6)",i.lineWidth=2.5,i.beginPath(),i.ellipse(l,g,b,S,0,0,E),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let x=0;x<5;x++){let M=l+(a()-.5)*b*1.4,R=g+(a()-.5)*S*1.1,P=Math.max(2,S*.06);i.beginPath(),i.ellipse(M,R,P*.6,P,0,0,E),i.fill()}let w=i.createRadialGradient(l,g,4,l,g,b*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=w,i.fillRect(l-b*1.4,f-S,b*2.8,u-f+S*2),i.restore();let k=W(Math.min(66,y+60)),T=Math.max(80,b*.7),C=T*.5,L=i.createRadialGradient(l,k,4,l,k,T*1.6);L.addColorStop(0,`rgba(${r},0.3)`),L.addColorStop(1,`rgba(${r},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=L,i.fillRect(l-T*1.6,k-T*1.2,T*3.2,T*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(l-T/2,k-C/2),i.lineTo(l+T/2,k-C/2),i.lineTo(l+T*.6,k),i.lineTo(l+T/2,k+C/2),i.lineTo(l-T/2,k+C/2),i.lineTo(l-T*.6,k),i.closePath(),i.fill();let I=n;for(let x=0;x<3;x++){let M=te(I+x*30,.5,.5);i.fillStyle=`rgba(${M[0]},${M[1]},${M[2]},0.75)`;let R=T*.26;i.fillRect(l-T*.42+x*(R+T*.06),k-C*.32,R,C*.64)}i.fillStyle=`rgba(${r},0.9)`;for(let x=0;x<8;x++){let M=l-T*.6+T*1.2*x/7;i.beginPath(),i.arc(M,k+C*.62,2.4,0,E),i.fill()}}function pc(i,e,t,o,s,n,r,a,l,c){let d=e.sectionId,h=!1,p=[];for(let u of t){if(u.id===e.id)continue;let f=u.x-e.x,b=u.y-e.y,g=Math.hypot(f,b)*yt;if(d&&u.sectionId===d&&g<3&&f*r+b*a>0&&(h=!0),g<.3||g>32)continue;let v=((Math.atan2(f,-b)-s)*180/Math.PI+540)%360-180,w=l?(u.eyeHeightM??ee)-n:0,k=Math.atan2(w-.28,g)*180/Math.PI;if(k>10&&g>5)continue;let T=0;for(let I=0;I<u.id.length;I++)T=T*31+u.id.charCodeAt(I)&65535;let C=.9+(T&15)/40,L=Math.min(78,Math.atan2(.16,g)*180/Math.PI*tc*C);L<1.2||p.push({hx:Ye(v),hy:W(k),r:L,d:g,hash:T})}p.sort((u,f)=>f.d-u.d);let m=[];{let u=[...p].sort((g,S)=>g.hy-S.hy),f=[],b=()=>{if(!f.length)return;let g=f.reduce((w,k)=>w+k.d,0)/f.length,S=f.reduce((w,k)=>w+k.hy,0)/f.length,v=f.reduce((w,k)=>w+k.r,0)/f.length;m.push({figs:f.sort((w,k)=>k.d-w.d),d:g,hy:S,r:v}),f=[]};for(let g of u){let S=f[f.length-1];S&&Math.abs(g.hy-S.hy)>Math.max(5,(S.r+g.r)/2*1.7)&&b(),f.push(g)}b()}m.sort((u,f)=>f.d-u.d);let y=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let u of m){if(u.figs.length>=3&&u.r>=1.6&&u.r<26){let f=[],b=[...u.figs].sort((v,w)=>v.hx-w.hx),g=[];for(let v of b){let w=g[g.length-1];w&&v.hx-w.hx>Math.max(14,v.r*7)&&(g.length>=3&&f.push(g),g=[]),g.push(v)}g.length>=3&&f.push(g);let S=Math.min(.42,.5*(1-u.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let v of f){let w=v[0].hx-u.r*1.6,k=v[v.length-1].hx+u.r*1.6;i.beginPath(),i.roundRect(w,u.hy+u.r*.8,k-w,u.r*2.4,u.r*.8),i.fill()}}}for(let f of u.figs){let b=f.d<12?.95:f.d<17?Math.max(.66,.95-(f.d-12)/18):Math.max(.3,.68-(f.d-17)/34),g=Math.round((1-Math.min(1,f.d/16))*10),S=[14+(f.hash>>4&6)+g,17+(f.hash>>4&6)+g,25+(f.hash>>4&6)+g],v=y[f.hash%y.length],w=[v[0]+g,v[1]+g,v[2]+g];if(f.r>=13){let k=f.d<9?.16*(1-f.d/9)+(c.mode==="proscenium"?.06:0):0;lc(i,f.hx,f.hy,f.r,{tone:S,clothing:w,alpha:b,tilt:((f.hash>>2&7)-3.5)*.018,shoulderK:1.72+(f.hash>>5&7)/22,hair:f.hash%rc,rim:k,turn:((f.hash>>8&7)-3.5)*.034,lean:((f.hash>>10&3)-1.5)*.09})}else f.r>=5.5?cc(i,f.hx,f.hy,f.r,w,S,b):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${b.toFixed(3)})`,i.beginPath(),i.arc(f.hx,f.hy,f.r,0,E),i.fill(),i.beginPath(),i.ellipse(f.hx,f.hy+f.r*1.4,f.r*1.85,f.r*.95,0,Math.PI,0,!0),i.fill())}}if(h){let u=W(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,u,$,de-u),i.fillStyle="rgba(24, 30, 46, 0.9)";let f=16;for(let b=0;b<f;b++){let g=(b+.5)/f*$;i.beginPath(),i.ellipse(g,u+6,$/f*.42,22,0,Math.PI,0,!0),i.fill()}}}var se=480,Xe=270,ji=50,Be=30,Wr=i=>(i+ji)/(2*ji)*se,mt=i=>(Be-i)/(2*Be)*Xe;function um(i,e,t){let o=document.createElement("canvas");o.width=se,o.height=Xe;let s=o.getContext("2d"),n=e.x-i.x,r=e.y-i.y,a=Math.max(2,Math.hypot(n,r)*yt),l=zr(Vr(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=te(220+(l()-.5)*60,.55,.82),h=`${d[0]},${d[1]},${d[2]}`,p=s.createLinearGradient(0,0,0,Xe);p.addColorStop(0,"#080b12"),p.addColorStop(.44,"#151c32"),p.addColorStop(.5,"#1d2644"),p.addColorStop(.58,"#161c2e"),p.addColorStop(1,"#131829"),s.fillStyle=p,s.fillRect(0,0,se,Xe);let m=i.eyeHeightM??ee,y=$i(m,a),u=Math.min(ji-2,Math.atan2(4,a)*180/Math.PI),f=Math.min(Be-2,y.topPitch),b=Math.max(-Be+2,y.basePitch),g=Wr(-u),S=Wr(u),v=mt(f),w=mt(b),k=S-g,T=w-v,C=Math.max(.35,Math.min(1,1-(a-6)/60)),L=mt(Math.min(Be-1,f+8)),I=s.createRadialGradient(se/2,(v+w)/2,4,se/2,(v+w)/2,k*1.15);I.addColorStop(0,"rgba(255,214,150,0.34)"),I.addColorStop(.28,"rgba(150,150,230,0.3)"),I.addColorStop(.6,"rgba(99,102,241,0.12)"),I.addColorStop(1,"rgba(99,102,241,0)"),s.fillStyle=I,s.fillRect(g-k*.6,v-T*1.2,k*2.2,T*3.4);let x=te(c,.62,.55),M=te(c+40,.7,.5),R=te(c+70,.78,.52);s.save(),s.beginPath(),s.rect(g,v,k,T),s.clip();let P=s.createLinearGradient(0,v,0,w);P.addColorStop(0,`rgb(${x[0]},${x[1]},${x[2]})`),P.addColorStop(.5,`rgb(${M[0]},${M[1]},${M[2]})`),P.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),s.globalAlpha=.8,s.fillStyle=P,s.fillRect(g,v,k,T),s.globalAlpha=1;let A=s.createRadialGradient(se/2,(v+w)/2,k*.12,se/2,(v+w)/2,k*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),s.fillStyle=A,s.fillRect(g,v,k,T),s.restore();let _=3,j=w-T*.08;for(let O=0;O<_;O++){let K=(O+1)/(_+1);Ji(s,g+k*(.24+K*.52),j,T*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:te(c+20,.5,.7),rimStrength:.7})}s.fillStyle="#05070d",s.fillRect(g-k*.5,L,k*.5,w-L),s.fillRect(S,L,k*.5,w-L);let V=k*.05+2,z=V*1.35;s.fillStyle="#03050a",s.beginPath(),s.moveTo(g,w),s.lineTo(g-V,w),s.lineTo(g-z,L),s.lineTo(g+k*.012,L),s.closePath(),s.fill(),s.beginPath(),s.moveTo(S,w),s.lineTo(S+V,w),s.lineTo(S+z,L),s.lineTo(S-k*.012,L),s.closePath(),s.fill(),s.fillRect(g-z,L,k+z*2,(w-L)*.13),s.fillStyle=`rgba(${h},0.12)`,s.fillRect(g-1.2,L,1.2,w-L),s.fillRect(S,L,1.2,w-L),s.fillStyle="#0b0f18",s.fillRect(g-V,w-T*.05,k+V*2,T*.05+2);let J=s.createLinearGradient(0,w-T*.05,0,w+T*.14);J.addColorStop(0,`rgba(255,206,140,${(.5*C).toFixed(3)})`),J.addColorStop(1,"rgba(255,206,140,0)"),s.fillStyle=J,s.fillRect(g-V,w-T*.05,k+V*2,T*.22);for(let O=0;O<3;O++){let K=(O+1)/4,D=g+k*K,q=mt(Math.min(Be-1,f+20));oi(s,D,q,D+(l()-.5)*k*.14,w,3,k*.09,h,.17*C),eo(s,D,q,1.8,h)}s.fillStyle=`rgba(${h},0.75)`;for(let O=0;O<8;O++)s.beginPath(),s.arc((O+.5)/8*se,mt(Be-4-O%2*3),2.2,0,E),s.fill();s.fillStyle="rgba(10,13,20,0.9)",s.fillRect(0,Xe-26,se,26),s.fillStyle="rgba(30,37,54,0.9)";for(let O=0;O<9;O++){let K=O*(se/9)+se/18;s.beginPath(),s.ellipse(K,Xe-22,se/9*.4,15,0,Math.PI,0,!0),s.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Kr=new Set(["en"]),si=new Map;async function fc(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(Ho(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-2KZHFEV7.js"),t=e[i];return t?await t():null}async function ym(i,e){let t=Bs(i,e);if(t==="en"||Kr.has(t))return We(t),t;if(!_s.includes(t))return We("en"),"en";try{let o=si.get(t);o||(o=fc(t),si.set(t,o));let s=await o;return si.delete(t),s?(We(t,s),Kr.add(t),t):(We("en"),"en")}catch{return si.delete(t),We("en"),"en"}}export{bc as ACCESSIBILITY_RING_COLOR,yc as ACCESSIBILITY_TYPES,mc as CHART_STORAGE_KEY,md as CURRENCY_CHOICES,fd as DEFAULT_CURRENCY,Pc as EVENT_CONFIGURATION_EXPORT_SCHEMA,Cc as EVENT_CONFIGURATION_SCHEMA,kc as LABEL_STYLE_MAX_SIZE,wc as LABEL_STYLE_MIN_SIZE,Ld as LOCALE_NAMES,jc as MAX_EVENT_INVENTORY,Qc as MAX_GA_CAPACITY,Dr as PickerController,ke as PickerSelectionError,rd as RENDERED_QUALITY_REPORT_VERSION,Sc as SEAT_COMMERCIAL_MARKS,ma as SUPPORTED_LOCALES,Lc as SURROUNDINGS_SHAPE_ROLES,Xi as SeatmapRenderer,Fc as TABLE_SEAT_OFFSET,Bc as TIER_HEIGHT_M,_s as TRANSLATED_LOCALES,uo as UNGROUPED_ID,gc as accessibilityMeta,gt as accessibilityRingColor,no as allObjects,po as applyHidden,Ec as canTransitionEventConfiguration,Mc as canonicalEventConfigurationJson,ho as chartBounds,kt as computeSections,Cr as createRenderer,pa as currencyExponent,gd as currencySymbol,Kc as expandBooth,$e as expandChart,Hc as expandRow,Gc as expandRowSlots,zc as expandTable,Wc as expandTableSlots,$c as floorObjects,Zc as floorOverviewTranslations,vt as floorsOf,lo as floorsShareFootprint,Md as formatDate,yd as formatMinor,ot as formatMoney,fa as fromMinorUnits,qe as gaAreasOf,td as gaInventorySegments,Jc as gaUnitLabel,wt as gaUnitLabels,hm as generateSeatPanorama,um as generateSeatThumb,Td as getLocale,id as growJoinedGAInventory,nd as hiddenObjectIds,Rc as inspectEventConfigurationCompatibility,ad as inspectRenderedQualityEvidence,od as isGaUnitLabel,Pd as isLocaleLoaded,sd as isSectionHidden,Tc as layerOf,ao as layoutFloorOverview,co as layoutFloorRings,ym as loadLocale,Cd as localeDirection,_c as migrateLegacyEventConfigurations,Yc as objectCenter,Uc as owningSectionForObject,xc as parseEventConfigurationExport,Ic as parseEventConfigurationVersion,Xc as pointInPolygon,ie as pointInPolygonWithHoles,St as polygonLabelPoint,Ac as resolveEventConfigurationRollback,Bs as resolveLocale,Dc as rowInventoryCount,Oc as rowSeatPositions,vc as seatCommercialMeta,bt as sectionGeometry,We as setLocale,As as setMoneyLocale,Id as setStringOverrides,ro as stackFloors,Y as t,xd as tCount,Vc as tableInventoryCount,Nc as tableSeatCountsBySide,qc as translateObject,ed as validGAInventorySegments};