@seatlayer/core 0.67.13 → 0.67.15

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 (61) hide show
  1. package/README.md +8 -8
  2. package/dist/{categoryInventory-CDGQe2Ag.d.ts → categoryInventory-DLDU-RSw.d.ts} +1 -1
  3. package/dist/{categoryInventory-BI3jJaqD.d.cts → categoryInventory-DZapeGK6.d.cts} +1 -1
  4. package/dist/chunk-6JWYLLWU.js +1 -0
  5. package/dist/chunk-JBGLFOJO.js +1 -0
  6. package/dist/chunk-WZ6ZNPNT.js +1 -0
  7. package/dist/{chunk-VI3IZS2B.js → chunk-YYRUKI7A.js} +1 -1
  8. package/dist/core/chart-ops/index.cjs +1 -1
  9. package/dist/core/chart-ops/index.d.cts +27 -6
  10. package/dist/core/chart-ops/index.d.ts +27 -6
  11. package/dist/core/chart-ops/index.js +1 -1
  12. package/dist/core/inventory/index.cjs +1 -1
  13. package/dist/core/inventory/index.d.cts +4 -4
  14. package/dist/core/inventory/index.d.ts +4 -4
  15. package/dist/core/inventory/index.js +1 -1
  16. package/dist/core/layout/index.d.cts +4 -4
  17. package/dist/core/layout/index.d.ts +4 -4
  18. package/dist/core/quality/index.d.cts +3 -3
  19. package/dist/core/quality/index.d.ts +3 -3
  20. package/dist/core/render-assets/index.cjs +1 -1
  21. package/dist/core/render-assets/index.d.cts +1 -1
  22. package/dist/core/render-assets/index.d.ts +1 -1
  23. package/dist/core/render-assets/index.js +1 -1
  24. package/dist/core/seatConfidence.cjs +1 -1
  25. package/dist/core/seatConfidence.d.cts +1 -1
  26. package/dist/core/seatConfidence.d.ts +1 -1
  27. package/dist/core/sections/index.d.cts +5 -5
  28. package/dist/core/sections/index.d.ts +5 -5
  29. package/dist/core/sections/index.js +1 -1
  30. package/dist/{eventConfigurations-DImP8Cd6.d.ts → eventConfigurations-C_dst7Ro.d.cts} +3 -1
  31. package/dist/{eventConfigurations-YqyHnreh.d.cts → eventConfigurations-kZpADDdx.d.ts} +3 -1
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.d.cts +13 -13
  34. package/dist/index.d.ts +13 -13
  35. package/dist/index.js +1 -1
  36. package/dist/{labeling-lXzjJrgV.d.cts → labeling-B07AFOvn.d.cts} +1 -1
  37. package/dist/{labeling-Cb7ZwhoO.d.ts → labeling-Br0U7E-5.d.ts} +1 -1
  38. package/dist/{layout-cZ3VfeJR.d.cts → layout-BjWtKYJY.d.cts} +3 -3
  39. package/dist/{layout-ByBMw1t7.d.ts → layout-pMOP6qgP.d.ts} +3 -3
  40. package/dist/{renderedQuality-BJKHot_g.d.ts → renderedQuality-CBmIp6_6.d.ts} +1 -1
  41. package/dist/{renderedQuality-6ta0nSPm.d.cts → renderedQuality-DoRJqHmW.d.cts} +1 -1
  42. package/dist/{renderer-B9GavToM.d.ts → renderer-BpeegL9d.d.ts} +1 -1
  43. package/dist/{renderer-C9BLd1g2.d.cts → renderer-Dg76Jprw.d.cts} +1 -1
  44. package/dist/{sections-ND5PRE4j.d.cts → sections-BjzyfqGZ.d.cts} +1 -1
  45. package/dist/{sections-BvZ1cQkD.d.ts → sections-DCRfHaw4.d.ts} +1 -1
  46. package/dist/{segmentedRowModel-CLKP-2ca.d.ts → segmentedRowModel-DQggl3UO.d.ts} +1 -1
  47. package/dist/{segmentedRowModel-BB9MPufB.d.cts → segmentedRowModel-jfYcGWPd.d.cts} +1 -1
  48. package/dist/{ticketRestrictions-DUQ8wHjG.d.ts → ticketRestrictions-KwkFXVnM.d.ts} +2 -2
  49. package/dist/{ticketRestrictions-CjV47RNG.d.cts → ticketRestrictions-NNo-tPmw.d.cts} +2 -2
  50. package/dist/{types-hv6QjPRV.d.cts → types-BjTzKc2D.d.cts} +49 -2
  51. package/dist/{types-hv6QjPRV.d.ts → types-BjTzKc2D.d.ts} +49 -2
  52. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  53. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  54. package/dist/view3d/index.cjs +52 -33
  55. package/dist/view3d/index.d.cts +15 -3
  56. package/dist/view3d/index.d.ts +15 -3
  57. package/dist/view3d/index.js +50 -31
  58. package/package.json +5 -2
  59. package/dist/chunk-3TAVIEVO.js +0 -1
  60. package/dist/chunk-BTW7IGNT.js +0 -1
  61. package/dist/chunk-DNGP2HDT.js +0 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as ni,b as bs,d as ai,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 Ha,b as Na}from"./chunk-MR2O5WC7.js";import{b as ws}from"./chunk-FOYQOIWG.js";import{a as oa,b as ra,c as na,d as aa,e as la,f as ca,g as ha,h as da,i as pa}from"./chunk-3TAVIEVO.js";import{a as pe,b as es,c as xe,d as yt,e as gt,f as Se,g as J,m as ue,n as re,q as oi,r as bt,t as ts,u as St,v as Y,w as ri}from"./chunk-GXMGOWKB.js";import{b as Re,f as ds,g as ps,m as us,x as fs,y as ms}from"./chunk-DNGP2HDT.js";import{a as Ra,b as Ea,c as Aa,d as Ba,e as Fa,f as ft,g as Da,h as We,i as _a,j as Qi,k as ti,l as Oa,m as Ga,n as ji}from"./chunk-HZT2U5IY.js";import{c as ys,e as gs}from"./chunk-T2LWVOQ3.js";import{a as qn,b as Un,c as Zn,d as Qn,e as ei,f as jn,g as Jn,h as ea,i as ta,j as ia,k as sa,m as Xe,p as hs}from"./chunk-VI3IZS2B.js";import{b as wt,f as as,h as Lt,i as ls,k as cs}from"./chunk-UL5OIGIF.js";import{Aa as Ma,Ba as Xi,Ca as Pa,Da as $i,Ea as Yi,Fa as qi,Ga as Ui,Ha as xa,Ia as ze,Ja as Zi,W as Wi,X as Pe,Y as ua,ea as q,fa as Ki,ga as dt,ka as fa,la as ma,ma as ya,na as ga,oa as ba,pa as Sa,qa as va,ra as ka,s as Vi,sa as wa,ta as La,u as zi,ua as Ta,va as te,w as G,wa as pt,xa as Ca,ya as Ia,za as ut}from"./chunk-I6DNJFRF.js";import{B as oe,h as ii,s as Ke,t as me,u as de,v as mt,w as si,y as Ji}from"./chunk-CXF32VPG.js";import"./chunk-CRCGO52K.js";import{Konva as Wt}from"konva/lib/Core";import{Stage as Tn}from"konva/lib/Stage";import{Layer as xi}from"konva/lib/Layer";import{Group as Le}from"konva/lib/Group";import{Circle as Te}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 Ce}from"konva/lib/shapes/Text";import{Path as Cn}from"konva/lib/shapes/Path";import{Image as In}from"konva/lib/shapes/Image";import{Shape as Mn}from"konva/lib/Shape";var Ct=1.12;function li(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 G(s,t.min,t.max)}function Ts(i,e,t,s){let o=G(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=G(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 ur(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var Is=new Map;function fr(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 mr={dateStyle:"medium",timeStyle:"short"};function xs(i,e={}){let{locale:t,...s}=e,o=ur(i);if(!Number.isFinite(o))return"";let r=Object.keys(s).length?s:mr;return fr(t,r).format(o)}var Ka="USD",Xa=["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 ci(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 yr(i="USD"){try{return It(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function gr(i,e="USD"){return i/10**yr(e)}function $a(i,e="USD",t){return ci(gr(i,e),e,void 0,t)}function Ya(i="USD"){return It(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var $e={"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.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.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.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 br=["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"],Ja={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"],Sr=new Set(["ar","fa","he"]),hi={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"},di=new Map(br.map(i=>[i.toLowerCase(),i]));function vr(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=di.get(e)??hi[e];if(t)return t;let s=e.split("-");if(s.length>=2){let o=`${s[0]}-${s[1]}`,r=di.get(o)??hi[o];if(r)return r}return di.get(s[0])??hi[s[0]]}var ve={en:$e},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=vr(s);if(o)return o}return"en"}function el(){return se}function tl(i=se){return Sr.has(i)?"rtl":"ltr"}function il(i){return!!ve[i]}function Ee(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 sl(i){Mt=i}var Ds=/\{(\w+)\}/g;function U(i,e){let t=Mt[i]??ve[se]?.[i]??$e[i]??i;return e?t.replace(Ds,(s,o)=>String(e[o]??`{${o}}`)):t}function ol(i,e,t){let s=new Intl.PluralRules(se).select(e);return(Mt[`${i}.${s}`]??ve[se]?.[`${i}.${s}`]??$e[`${i}.${s}`]??Mt[`${i}.other`]??ve[se]?.[`${i}.other`]??$e[`${i}.other`]??i).replace(Ds,(n,a)=>String({count:e,...t}[a]??`{${a}}`))}function rl(i,e){return xs(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:se})}var Ye=9,ke=.9,ne=.55*ke,ae=J/pe,qe=4,Pt=14,_s=10,Os=14,ye=.45*ke,Ae=.9*ke,Gs=Math.max(ke*1.1,Ae),we=8,Hs=700,Z=2,Ns=J,pi=.85,Vs=J,Ue=64,Be=.55*ye,ui=700,zs=2500,xt=-11.5,Ze=.58,Ws=320,Rt=650,Ks=1,Et=1,fi=16,Qe=12,Xs=[.85,.72,.62],At=15,Bt=12,mi="600",yi="500",je=640;function gi(i){return Math.min(1,Math.max(Qe/fi,i/900))}function Ft(i,e){return Math.max(Qe,i*gi(e))}var $s=.1;import{Shape as wr}from"konva/lib/Shape";import{Circle as Lr}from"konva/lib/shapes/Circle";import{Rect as Tr}from"konva/lib/shapes/Rect";var kr={M:2,L:2,Q:4,C:6,Z:0},bi=new Map;function Si(i){let e=bi.get(i);if(e)return e;let t=Lt(i);if(!t)return bi.set(i,[]),[];let s=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<s.length;){let n=s[r++],a=kr[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 bi.set(i,o),o}function Ys(i,e,t,s=0,o=0){let r=Si(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 qs(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var Je=class extends wr{_sceneFunc(e){let t=this.attrs.seatRadius||1,s=this.attrs.seatGlyph,o=Si(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){qs(e,t),e.fillStrokeShape(this);return}e.beginPath(),Ys(e,s,t),e.fillStrokeShape(this)}_hitFunc(e){qs(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function Cr(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 Us(i){let{x:e,y:t,radius:s}=i;return i.wheelchairBay?new Tr({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}):Cr(i.glyph,{x:e,y:t,radius:s,detail:i.detail,fill:i.fill})??new Lr({x:e,y:t,radius:s,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Ir(i,e){return i*2*e>=16}function Zs(i,e,t,s){let o=Ir(e,t);if(o===s||!i.length)return o;for(let r of i)r.setAttr("seatGlyphDetail",o);return o}var Mr="#e5e7eb",Pr="#c7cbd1",xr="#595f69",Rr="#d1d5db",Er="#b8bdc4",Ar="#273142",Br="#526078",Fr="#f1f5f9",Dr="#374151",_r="#64748b",vi="#111827",Dt="#6b7280",Fe="#374151",Qs="#4b5563",js="#4b5563",Js=.4,De=.16,eo="rgba(244,246,248,0.06)",_t=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function le(i){return Ke(i)?{sectionFill:Mr,sectionStroke:Pr,sectionInk:xr,focalFill:Rr,focalStroke:Er}:{sectionFill:Ar,sectionStroke:Br,sectionInk:Fr,focalFill:Dr,focalStroke:_r}}function _e(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 ro=.5,H=Math.SQRT1_2,Or="#f3f4f6",to=4;function Gr(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?ro:Math.min(1,Math.max(0,e))}function Hr(i){return i==="booked"||i==="not_for_sale"?Fe:Dt}function io(i,e){return Number.parseInt(i.slice(e,e+2),16)}function so(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 Nr(i,e,t){let s=so(i),o=so(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(io(s,a)*(1-r)+io(o,a)*r);n+=l.toString(16).padStart(2,"0")}return n}function oo(i,e,t,s){let o=t*4,r=e*H,n=-e*H,a=s*H*2*o,l=s*-H*2*o,c=r+o*H,h=n+o*H,u=r-o*H,p=n-o*H;i.beginPath(),i.moveTo(c,h),i.lineTo(u,p),i.lineTo(u+a,p+l),i.lineTo(c+a,h+l),i.closePath(),i.clip()}function Vr(i,e){let t=e*4,s=Math.max(e*.45,1);i.beginPath();for(let o=-to;o<=to;o++){let r=o*s*2,n=r+s,a=r*H,l=-r*H,c=n*H,h=-n*H;i.moveTo(a+t*H,l+t*H),i.lineTo(a-t*H,l-t*H),i.lineTo(c-t*H,h-t*H),i.lineTo(c+t*H,h+t*H),i.closePath()}i.clip()}function Ot(i,e){i._sceneFunc(e)}function no(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,Ot(e,i),t.fill=o;return}let l=(1-2*(t.markFraction??ro))*s;i.save(),oo(i,l,s,1),t.fill=t.markBase??o,Ot(e,i),i.restore(),i.save(),oo(i,l,s,-1),t.fill=t.markFill??o,Ot(e,i),t.markHatch&&(Vr(i,s),t.fill=Or,Ot(e,i)),i.restore(),t.fill=o}function zr(i,e,t,s,o,r){let n=Gr(e),a=Hr(t),l=i.attrs;l.markFraction=n,l.markBase=s,l.markFill=a,l.markMidtone=Nr(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(no)}function Wr(i){i.setAttr("sceneFunc",void 0)}function Kr(i){return i.attrs.sceneFunc===no}var Gt=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){Kr(e)&&Wr(e);return}zr(e,l,s,o,r,n)}};function Xr(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 Oe=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),Xr(e,r)&&s++);return s}keys(e){let t=Math.floor(e.x/Ue),s=Math.floor((e.x+Math.max(0,e.width))/Ue),o=Math.floor(e.y/Ue),r=Math.floor((e.y+Math.max(0,e.height))/Ue),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 Ht(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 Nt(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 u=e*(h/6-.5),p=t*(c/4-.5),m={x:i.x+u*a-p*l,y:i.y+u*l+p*a};if(!te(m,o,r))return!1}return!0}function ao(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 $r}from"konva/lib/Group";import{Shape as Yr}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 Ge(i,e,t,s){let o=Xe(i)>0,r=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new Yr({...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 u=1;u<h.length;u+=1)n.lineTo(h[u].x,h[u].y);n.closePath()}};s?(h=>{n.moveTo(h.start.x,h.start.y);let u=h.start;for(let p of h.segments)p.kind==="line"?n.lineTo(p.end.x,p.end.y):p.kind==="arc"?n.arc(p.center.x,p.center.y,p.radius,Math.atan2(u.y-p.center.y,u.x-p.center.x),Math.atan2(p.end.y-p.center.y,p.end.x-p.center.x),!p.clockwise):n.bezierCurveTo(p.control1.x,p.control1.y,p.control2.x,p.control2.y,p.end.x,p.end.y),u=p.end;n.closePath()})(s):l(i);for(let h of e??[]){let u=Xe(h)>0;l(u===o?[...h].reverse():h)}n.fillStrokeShape(a)},perfectDrawEnabled:!1})}var et=class extends $r{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 Vt=class{constructor(e){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.host.cancelGlide();let t=this.toLocal(e);if(this.pointers.set(e.pointerId,t),this.pointers.size===1)this.movedPx=0,this.pinch=null,this.panStart=t,this.panStarted=!1,this.host.marqueeShouldStart(e)?(this.host.beginMarquee(t),this.panLast=null):this.panLast=t;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee();let[s,o]=[...this.pointers.values()],r={x:(s.x+o.x)/2,y:(s.y+o.y)/2},n=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(o.x-s.x,o.y-s.y),startScale:n,worldMid:{x:(r.x-this.host.stage.x())/n,y:(r.y-this.host.stage.y())/n}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+1}};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;e.preventDefault();let t=this.toLocal(e);if(this.pointers.set(e.pointerId,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),this.host.marqueeActive()){this.host.updateMarquee(t);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[s,o]=[...this.pointers.values()],r=Math.hypot(o.x-s.x,o.y-s.y);if(this.pinch.startDist<1)return;let n={x:(s.x+o.x)/2,y:(s.y+o.y)/2},{min:a,max:l}=this.host.zoomBounds(),c=G(this.pinch.startScale*(r/this.pinch.startDist),a,l);this.host.stage.scale({x:c,y:c}),this.host.stage.position({x:n.x-this.pinch.worldMid.x*c,y:n.y-this.pinch.worldMid.y*c}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(t.x-this.panLast.x),y:this.host.stage.y()+(t.y-this.panLast.y)}),this.panLast=t,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}};this.onPointerEnd=e=>{if(this.host.marqueeActive()){this.host.finishMarquee(),this.pointers.delete(e.pointerId),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e.pointerId),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())};this.host=e}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})}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)}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){let t=this.host.container.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}};import{Circle as Ur}from"konva/lib/shapes/Circle";import{Group as Zr}from"konva/lib/Group";import{Text as Qr}from"konva/lib/shapes/Text";var lo=13,jr=15,Jr=.3,en=.08;function uo(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function tn(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?U("map.soldOut"):U("map.seatsLeft",{count:i.available})}function sn(i,e){return e&&i.available!=null&&i.available<=0}function fo(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),s=i.overviewHidden(e),o=sn(e,i.pickerMode),r=i.pickerMode?e.selected??0:0;e.polygon.opacity(s?0:i.dimmed(e.categoryKey)?Se*en:o?Se*Jr: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),on(i,e,o,r,s,i.dimmed(e.categoryKey))}}function on(i,e,t,s,o,r){if(e.capacityNode){let n=tn(e,i.pickerMode);e.capacityNode.text()!==n&&(e.capacityNode.text(n),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}rn(i,e,o||r),s>0&&!o?an(i,e,s):e.chip&&e.chip.visible(!1)}var ki=9,co=.86;function rn(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=nn(e,r),a=ho(s,yt,n.width*co,r),l=ho(o,gt,n.width*co,r),c=a!=null,h=l!=null&&c&&a+l+ki<=n.height;po(s,c?a:null,e.labelPoint.y-ki/r,r),po(o,h?l:null,e.labelPoint.y+ki/r,r)}function nn(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 ho(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 po(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 an(i,e,t){if(!e.chip){let s=new Zr({x:e.labelPoint.x,y:e.labelPoint.y-lo-16,listening:!1}),o=new Ur({radius:lo,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),r=new Qr({text:String(t),fontSize:jr,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 mo(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 yo(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function go(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}import{Rect as bo}from"konva/lib/shapes/Rect";import{Text as ln}from"konva/lib/shapes/Text";function So(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 y=i.circleById.get(d.id),b=i.boothLabelById.get(d.id)??i.seatLabelById.get(d.id),v=i.viewMode==="perspective"?i.perspectiveSeatScale.get(d.id)??1:1,w=(i.viewMode==="perspective"?t:e)*v,k=d.kind==="booth"?xe:pe*i.seatLabelScale(d),S=i.viewMode==="perspective"&&d.kind!=="booth"?e*v:w,L=o((b?.fontSize()??k)*S),C=i.worldToScreen(d),M=C.x<0||C.x>s.width||C.y<0||C.y>s.height,I=i.focusedSeatOpacity(d.id,y?.getAbsoluteOpacity()??0),P=i.seatSection.get(d.id),x=!!b?.isVisible()&&I>=.5&&!M,T;x||(I<.5?T="dimmed-or-unavailable":L<J?T="below-minimum-size":M?T="outside-viewport":b?T="renderer-hidden":T="clutter-or-fit");let R=b?b.width()*t*v:0,E=b?b.height()*(i.viewMode==="perspective"&&d.kind==="booth"?t:e)*v:0,B=y instanceof bo?y.width()*t*v:i.seatR*2*w,W=y instanceof bo?y.height()*(i.viewMode==="perspective"?t:e)*v:i.seatR*2*w,z=2*(i.seatR*w+Pt),V=y?.fill(),j=b?.fill(),F=i.accessGlyphById.get(d.id),_=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,...P?{sectionId:P.id}:{},...P?.zone?{zoneId:P.zone}:{},status:i.statusById.get(d.id)??"free",selected:i.selection.has(d.id),visible:x,renderedFontPx:L,fill:typeof V=="string"?V:"",ink:typeof j=="string"?j:y?i.seatLabelInk(d,y):i.seatPreferredLabelInk(d),...r.has(d.id)?{selectionRingColor:r.get(d.id)}:{},opacity:o(I),...F?{accessibilityMarker:{glyphVisible:F.isVisible(),glyphWidthPx:o(re*Math.abs(_?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(d.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(d.id)&&!!y?.isVisible()&&!!y?.isListening()&&i.isSelectable(d.id),directWidthPx:o(B),directHeightPx:o(W),effectiveMinimumPx:o(Math.max(Math.min(B,W),z))},screenCenter:{x:o(C.x),y:o(C.y)},...x?{screenBox:{x:o(C.x-R/2),y:o(C.y-E/2),width:o(R),height:o(E)}}:{},...T?{hiddenReason:T}:{}}}),a=n.filter(d=>d.visible).length,l=(d,y,b,v,w,k)=>{let S=Ht({x:v.x(),y:v.y()},v.width(),v.height(),v.rotation()),L=k&&k.liftWorld>0?i.isoLiftLocal(k.liftWorld):{x:0,y:0},C=K(S.map(R=>i.worldToScreen({x:R.x+L.x,y:R.y+L.y}))),M=o(v.opacity()),I=v.fill(),P=C.x+C.width<0||C.x>s.width||C.y+C.height<0||C.y>s.height,x=v.isVisible()&&M>.05&&!P,T=k?Nt({x:v.x(),y:v.y()},v.width(),v.height(),v.rotation(),k.outline,k.holes):void 0;return{id:d,kind:y,role:b,label:v.text(),visible:x,renderedFontPx:o(v.fontSize()*t),opacity:M,fill:w,ink:typeof I=="string"?I:"",...T==null?{}:{fitsContainer:T},...x?{screenBox:{x:o(C.x),y:o(C.y),width:o(C.width),height:o(C.height)}}:{}}},c=[...i.sections.map(d=>{let y=d.blockPoly.fill();return l(d.id,"section","name",d.nameLabel,typeof y=="string"?y:d.baseFill,d)}),...i.sections.map(d=>{let y=d.blockPoly.fill();return l(`${d.id}:availability`,"section","availability",d.subLabel,typeof y=="string"?y: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,y])=>{let b=y.points.map(P=>i.worldToScreen(P)),v=Math.min(...b.map(P=>P.x)),w=Math.min(...b.map(P=>P.y)),k=Math.max(...b.map(P=>P.x)),S=Math.max(...b.map(P=>P.y)),L=k<0||v>s.width||S<0||w>s.height,C=o(y.polygon.opacity()),M=C>=.1&&!L,I=y.polygon.fill();return{areaId:d,label:y.label,capacity:y.capacity,categoryKey:y.categoryKey,...y.sectionId?{sectionId:y.sectionId}:{},visible:M,interactive:y.polygon.listening(),opacity:C,fill:typeof I=="string"?I:"",effectiveBackground:y.effectiveBackground,...M?{screenBox:{x:o(v),y:o(w),width:o(k-v),height:o(S-w)}}:{}}}),u=[...i.freeTextById].map(([d,y])=>{let{node:b,background:v,kind:w}=y,k=i.worldToScreen({x:b.x(),y:b.y()}),S=b.width()*t,L=b.height()*e,C=k.x-b.offsetX()*t,M=k.y-b.offsetY()*e,I=o(b.fontSize()*e),P=C+S<0||C>s.width||M+L<0||M>s.height,x=b.isVisible()&&!P,T=b.fill(),R=o(b.getAbsoluteOpacity()),E;return x||(I<J?E="below-minimum-size":P?E="outside-viewport":E="renderer-hidden"),{objectId:y.objectId??d,kind:w,text:b.text(),visible:x,renderedFontPx:I,ink:typeof T=="string"?T:"",background:v,opacity:R,...x?{screenBox:{x:o(C),y:o(M),width:o(S),height:o(L)}}:{},...E?{hiddenReason:E}:{}}}),p=i.labelGroup.find(d=>d.getAttr("rowLabel")===!0).filter(d=>d instanceof ln).map(d=>{let y=d.getClientRect({skipShadow:!0,skipStroke:!0}),b=y.x+y.width<0||y.x>s.width||y.y+y.height<0||y.y>s.height,v=d.fill();return{text:d.text(),visible:d.isVisible()&&!b,renderedFontPx:o(d.fontSize()*e),ink:typeof v=="string"?v:"",...b?{}:{screenBox:{x:o(y.x),y:o(y.y),width:o(y.width),height:o(y.height)}}}}),m=le(i.canvasBackground),f=new Set(["normal","nearly-gone","sold-out","closed"].map(d=>_e(m,d).toLowerCase())),g=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,y)=>d+y.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:g.length,categoryPaintedSectionShells:g.filter(d=>{let y=d.blockPoly.fill();return typeof y!="string"||!f.has(y.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:u,rowLabels:p}}import{Circle as cn}from"konva/lib/shapes/Circle";import{Ellipse as hn}from"konva/lib/shapes/Ellipse";import{Line as To}from"konva/lib/shapes/Line";import{Arrow as dn}from"konva/lib/shapes/Arrow";import{Path as pn}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 un}from"konva/lib/shapes/Image";function wi(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}var zt="#0b1220",tt="#ffffff",vo="#0b1220",ko="#232c40",wo="#8b93a7";function Lo(i,e,t="normal"){let s=i?"bold":t;return e?`italic ${s}`.trim():s}var Li="#0e1117";function Co(i,e){let t=new window.Image,s=new un({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(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 Io(i,e){if(e.shape==="round")i.bgLayer.add(new cn({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 Mo(i,e){let t=e.background?.color??i.canvasBackground,s=e.color??i.theme.textColor??wo,o=e.semanticKind==="icon"?us(e.iconKey):void 0;if(o){let c=e.fontSize/24,h=new pn({x:e.position.x,y:e.position.y,data:o,rotation:e.rotation,scaleX:c,scaleY:c,stroke:Y(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:Lo(e.bold,e.italic,"600"),fill:Y(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 Po(i,e){let t=e.fill??i.theme.decorFill??ko,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),u=e.opacity!=null?G(e.opacity,.1,1):1,p=0,m=0;if(l&&e.points&&e.points.length>=2){p=e.points.reduce((y,b)=>y+b.x,0)/e.points.length,m=e.points.reduce((y,b)=>y+b.y,0)/e.points.length;let f=fs(e),g=ms(h),d=new dn({points:e.points.flatMap(y=>[y.x,y.y]),closed:!1,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:c,fill:c,strokeWidth:h,opacity:u,lineCap:f.lineCap,lineJoin:f.lineJoin,pointerAtBeginning:f.startEnding==="arrow",pointerAtEnding:f.endEnding==="arrow",...g,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};p=e.x+e.width/2,m=e.y+e.height/2,i.bgLayer.add(new Ti({x:p,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:G(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,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;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 hn({x:p,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...f,stroke:c,strokeWidth:h,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let f=e.points.flatMap(y=>[y.x,y.y]),g=K(e.points);p=e.points.reduce((y,b)=>y+b.x,0)/e.points.length,m=e.points.reduce((y,b)=>y+b.y,0)/e.points.length;let d=s?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,de(a,.3),1,me(a,.12)]}:{fill:a};i.bgLayer.add(new To({points:f,closed:!0,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,...d,stroke:c,strokeWidth:h,opacity:u,listening:!1}))}for(let f of gs(e))i.bgLayer.add(new To({points:f.points.flatMap(g=>[g.x,g.y]),closed:f.closed,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:f.ink??ys,fill:f.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(s){let f=fn(i,p,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,p,m,o?Y(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,p,m,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:f,background:a,kind:"decor"})}}function fn(i,e,t,s,o){let r=Y(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 xo(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",s=i.canvasBackground,o=ts(t,s,Se),r=i.theme.textColor??"#e6e9f0",n=Y(o,r),a=Ge(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",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=pt(e.points,e.holes),c=i.sections.find(p=>te(l,p.outline,p.holes)),h=it(i,i.bgLayer,e.displayLabel??e.label,l.x,l.y-8,n,yt,!1),u=it(i,i.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,n,gt,!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:u,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:u,...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 Ro(i,e){let t=[],s=e.theme.background??"#0e1117",o=new Map,r=(c,h)=>{let u=o.get(c)??[];u.push(h),o.set(c,u)};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 u=h?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(u?.visible===!1||u?.positionPreset==="none")continue;let p=c.segmentedRow&&!h?c.segmentedRow.groupId:c.id,m=(o.get(p)??[]).slice().sort((R,E)=>n(R)-n(E));if(!m.length)continue;let f=m[0],g=m[m.length-1],d=u?.labelStyle,y=Y(s,d?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",St),b=d?.size??es,v=u?.rotation??0,w=e.objectFilteredOut(c)?.15:1,k=e.seatSection.get(f.id),S=c.segmentedRow?.displayLabel??c.displayLabel,L=k?.label.trim(),C=L&&c.label.toLocaleLowerCase("en-US").startsWith(`${L.toLocaleLowerCase("en-US")} `)?c.label.slice(L.length).trim():"",M=S??(/^[\p{L}\p{N}]{1,4}$/u.test(C)?C:c.label),I=k?[...new Set([k.id,k.logicalId,k.zone].filter(R=>!!R))]:void 0,P=(R,E,B)=>t.push({text:M,x:R,y:E,rotation:v,fontSize:b,ink:y,opacity:w,...I?.length?{focusKeys:I}:{},...B?{automaticAway:B}:{}});if(u?.position){P(u.position.x,u.position.y);continue}let x=e.seatR+12,T=u?.positionPreset??"start";if(T==="start"||T==="both"){let R=c.rotation*Math.PI/180,E={x:-Math.cos(R),y:-Math.sin(R)};P(f.x+E.x*x,f.y+E.y*x,E)}if(T==="end"||T==="both"){let R=(c.rotation+c.curve)*Math.PI/180,E={x:Math.cos(R),y:Math.sin(R)};P(g.x+E.x*x,g.y+E.y*x,E)}}let a=(e.seatR+12)*2.2,l=[];for(let c of t){let h=l.find(u=>u.text===c.text&&Math.hypot(u.x-c.x,u.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=Z){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 Eo(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 p=1;p<=4;p++){let m=a*p;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,u=1/0;for(let p of l){let m={x:o.x+p.x,y:o.y+p.y},f=Ii(i,m),d=(s?vt(s,f,{mode:"overlap"}).length:0)+t.collisionCount(f),y=Math.hypot(p.x,p.y);if((d<h||d===h&&y<u)&&(c=m,h=d,u=y),d===0)break}return c}function Ao(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*$s?"nearly-gone":"normal"}function Bo(i,e){let t=Pi(i,e);e.blockPoly.fill(_e(le(i.canvasBackground),t)),e.subLabel.text(t==="sold-out"?U("map.soldOut"):U("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Fo(i,e){let t,s;i.reducedMotion?(t=e<=ye?1:0,s=e<=Be?1:0):(t=G((Ae-e)/(Ae-ye),0,1),s=G((ye-e)/(ye-Be),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=G((t-.2)/.8,0,1);for(let p of i.sections){let m=i.hasFocusDimOverlay?1:l&&p.id!==l&&p.logicalId!==l&&p.zone!==l?De:1,f=Math.min(m,go(p.memberCategoryKeys,i.categoryFilter)?De:1);p.outlinePoly.opacity(o?0:(1-t)*f),p.blockPoly.opacity(Ks*t*f),p.blockPoly.stroke(c.sectionStroke),p.blockPoly.strokeWidth(Et/Math.max(n,1e-4));let g=p.blockPoly.fill(),d=Y(typeof g=="string"?g:p.baseFill,p.preferredInk);p.nameLabel.fill(d),p.subLabel.fill(d),a&&h>.01&&gn(i,p,n),p.nameLabel.opacity(p.nameLabelFits?h*(1-s)*f:0),p.subLabel.opacity(0)}let u=s*(1-i.isoT);for(let p of i.zones)p.back.opacity(u),p.label.opacity(u),p.sub&&p.sub.opacity(i.stageWidth<je?0:u),a&&bn(i,p,n);if(!i.glideInProgress&&(h>.01||u>.01)){yn(i,n),mn(i.sections);for(let p of i.zones){let m=p.label.opacity();p.back.opacity(m),p.sub&&p.sub.opacity(i.stageWidth<je?0:m)}}i.bgLayer.batchDraw()}function mn(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 yn(i,e){let s=[],o=a=>{let l=i.worldToScreen({x:a.x(),y:a.y()}),c=K(Ht({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 u of Xs){let p=c*u;if(p*e<Qe)break;st(a.node,p,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 gn(i,e,t){e.subLabelFits=!1;let s=Ft(fi*e.labelScale,i.stageWidth),o=Qe;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(Nt(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 bn(i,e,t){let s=gi(i.stageWidth),o=e.sub!=null&&i.stageWidth>=je,r=i.stageWidth<je,n=(r?7:10)*s/t,a=(r?4:6)*s/t,l=o?3*s/t:0;st(e.label,Ft(At,i.stageWidth)/t,e.anchor.y),e.label.x(e.anchor.x),o&&st(e.sub,Ft(Bt,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 u=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 f=m/2,d=(G(u.x,p+f,i.stageWidth-p-f)-u.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 y=62+h*t/2;if(u.y<y){let b=(y-u.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 Sn}from"konva/lib/Group";import{Line as Do}from"konva/lib/shapes/Line";import{Rect as vn}from"konva/lib/shapes/Rect";import{Text as _o}from"konva/lib/shapes/Text";function kn(i,e){return i>=ae||e&&i>=pi}function wn(i,e,t){return t&&e>=pi?Math.max(i,Vs/Math.max(e,1e-4)):i}function Ln(i,e){return Math.max(1,i*2-(e?1:3))}function Oo(i){let e=i.exportMode?Math.max(i.effScale(),ae):i.effScale(),t=kn(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(ue(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),u=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 y=new Sn({x:h.x,y:h.y,listening:!1});if(y.scale({x:u,y:u}),c==="held"?(y.add(new vn({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),y.add(new Do({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}))):y.add(new Do({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1})),i.seatLabelContainer(n.id).add(y),++o>=ui)break;continue}let m=i.seatMatchesFocus(n.id),f=wn(pe*i.seatLabelScale(n),e,m),g=new _o({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=Ln(i.seatR,m);if(g.width()>d&&g.fontSize(Math.max(qe,f*d/g.width())),g.width()>d+.01){g.destroy();continue}if(!ue(g.fontSize(),e)){g.destroy();continue}if(g.offsetX(g.width()/2),g.offsetY(g.height()/2),g.scale({x:u,y:u}),i.seatLabelContainer(n.id).add(g),!s(g)){g.destroy();continue}if(i.seatLabelById.set(n.id,g),++o>=ui)break}let r=new Oe;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-Z,y:a.y-Z,width:a.width+Z*2,height:a.height+Z*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&&!ue(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 _o({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 u=i.resolveAutomaticRowLabelPosition(h,n,r);h.position(u),h.setAttr("rowLabel",!0),i.labelGroup.add(h);let p=h.getClientRect({skipShadow:!0,skipStroke:!0}),m=6,f=p.x<m?m-p.x:p.x+p.width>i.stage.width()-m?i.stage.width()-m-p.x-p.width:0,g=p.y<m?m-p.y:p.y+p.height>i.stage.height()-m?i.stage.height()-m-p.y-p.height:0,d=u;if(f||g){let b=i.labelGroup.getAbsoluteTransform(),v=b.point(u);d=b.copy().invert().point({x:v.x+f,y:v.y+g}),h.position(d)}let y=i.rowLabelBox(h,d);if(n.automaticAway&&r.collisionCount(y)>0){h.destroy();continue}r.insert(y)}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-Ze)*i.isoT}}function Go(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 Ho(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 No(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 Vo(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 zo(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 Wo(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 Ko(i,e,t){return i.perspectiveAffine?ie(i.perspectiveAffine,e):ie(t,e)}function Xo(i,e){return e?ie(e,i):i}function $o(i,e){let t=0;for(let u of i.seats){let p=Math.max(0,(u.eyeHeightM??q)-q);t=Math.max(t,p*Pe)}for(let u of i.objects)u.type==="section"&&(t=Math.max(t,dt(u,{floorBaseHeightM:i.floorBaseHeightMFor(u.id)}).height*Pe));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 u of i.seats){let p=Math.max(0,(u.eyeHeightM??q)-q),m=fe(s,u,p*Pe),f={x:m.x,y:m.y};e.seatProjected.set(u.id,f),e.seatLocal.set(u.id,ie(r,f)),e.seatDepth.set(u.id,m.depth),e.seatScale.set(u.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 u 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=fe(s,u,0);n=Math.min(n,p.x),a=Math.min(a,p.y),l=Math.max(l,p.x),c=Math.max(c,p.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 Yo(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 u=i.seatR*1.5/re;c.position(r),c.scale({x:u*n,y:u*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 Gt;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.fitScale=1;this.seatR=Ye;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 Tn({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Vt(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",U("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 Le({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new Le({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.hoverRing=new Te({radius:Ye+2,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Te({radius:Ye+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??ut(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=G(this.theme.seatScale??1,.7,1.6)*Ye,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,_t[r%_t.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 Le({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:Re(e)};if(this.floorOverview&&e.floors.length>=2)return{...qi(e)?Ui(e):Yi(e),referenceImage:void 0,backgroundImage:Re(e)};if(this.stacked&&e.floors.length>=2)return{...$i(e),referenceImage:void 0,backgroundImage:Re(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:Re(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?ut(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?ut(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=si([...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<=zs;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 Te({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 u=Math.min(1,(h-a)/l);r.radius(this.seatR*(1+u*1.8)),r.opacity(.9*(1-u)),this.overlayLayer.batchDraw(),u<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(p=>this.perspectiveLocalPoint(this.projectedSectionPoint(o,p))):o.outline.map(p=>{let m=o.liftWorld>0?this.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:p.x+m.x,y:p.y+m.y}}),n=r.reduce((p,m)=>({x:p.x+m.x,y:p.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(p=>[p.x-n.x,p.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,u=p=>{if(this.destroyed||!a.getLayer())return;let m=Math.min(1,(p-c)/h),g=1+(1-Math.pow(1-m,3))*.04;a.scale({x:g,y:g}),a.opacity(.92*(1-m)),this.overlayLayer.batchDraw(),m<1?requestAnimationFrame(u):l()};requestAnimationFrame(u)}}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,u=c*t.x+h*t.y;if(u<=.5)continue;let p=Math.abs(c*t.y-h*t.x),m=u+p*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.focusRegion(this.focusedSectionId,{animate:!1});return}this.zoomToFit()}zoomIn(){this.zoomAbout(this.stage.scaleX()*at.ZOOM_STEP,li(this.stage))}zoomOut(){this.zoomAbout(this.stage.scaleX()/at.ZOOM_STEP,li(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(!yo(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(){fo({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=>uo(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<ne,effScale:()=>this.effScale(),labelLegible:e=>ue(e,this.effScale())})}setGAStates(e){mo(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,t){this.setGAStates({[e]:t})}focusCategories(e){if(!e?.length){this.focusRegion(this.bounds,{durationMs:Rt});return}let t=new Set(e),s=this.seats.filter(c=>!t.has(c.categoryKey)||this.seatInClosedSection(c.id)?!1:(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id));if(!s.length)return;let o=1/0,r=-1/0,n=1/0,a=-1/0;for(let c of s){let h=this.renderedSeatPoint(c);o=Math.min(o,h.x),r=Math.max(r,h.x),n=Math.min(n,h.y),a=Math.max(a,h.y)}let l=Math.max(24,this.seatR*3);o-=l,r+=l,n-=l,a+=l,this.focusRegion({x:o,y:n,width:Math.max(40,r-o),height:Math.max(40,a-n)},{durationMs:Rt})}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)/Ws),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-Ze)*this.isoT)}isoForward(e){return Go(e,this.isoState)}isoInverse(e){return Ho(e,this.isoState)}buildPerspectiveProjection(e){let t=$o({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){Vo(e,t,s)}resetContainerTransform(e){zo(e)}sectionSurfaceHeight(e,t){return Wo(e,t)}projectedSectionPoint(e,t){return Ko(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return Xo(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return No(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){Yo(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=u=>this.sectionSurfaceHeight(a,u),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 u=0;u<a.sideFaces.length;u++){let p=a.outline[u],m=a.outline[(u+1)%a.outline.length],f=this.perspectiveLocalPoint(fe(t,p,0)),g=this.perspectiveLocalPoint(fe(t,m,0)),d=this.perspectiveLocalPoint(fe(t,m,l(m))),y=this.perspectiveLocalPoint(fe(t,p,l(p)));a.sideFaces[u].points([f.x,f.y,g.x,g.y,d.x,d.y,y.x,y.y]),a.sideFaces[u].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,u=l,p=c/l,m=(o*n+r*a)/c,f=this.isoCentre;for(let g of[this.bgLayer,this.seatLayer,this.overlayLayer])g.position({x:f.x,y:f.y}),g.offset({x:f.x,y:f.y}),g.rotation(h),g.scaleX(u),g.scaleY(p),g.skewX(m),g.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-Ze)*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:De)}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=Us({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 Te({x:t.x,y:t.y,radius:this.seatR+1.5,stroke:ei(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")&&oi(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 Ce({x:o,y:r,text:e.displayLabel??e.label,fontSize:xe,fontStyle:"600",fontFamily:this.labelFont(),fill:this.theme.seatLabelColor??zt,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 Cn({x:e.x,y:e.y,data:oi(e.accessibility??[])??"",offsetX:re/2,offsetY:re/2,scaleX:s,scaleY:s,fill:ri(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)??_t[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??zt}seatLabelInk(e,t){let s=t.fill();return Y(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(Dt);break;case"booked":this.colorblind?(e.fill("rgba(0,0,0,0)"),e.stroke(Fe),e.strokeWidth(1.5),e.opacity(.9)):(e.fill(Fe),e.opacity(.45));break;case"not_for_sale":e.fill(Fe),e.stroke(Qs),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(ei(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??zt:"#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(js),e.stroke(""),e.strokeWidth(0),e.dash([]),e.opacity(Js)),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(ue(l.fontSize(),this.effScale())&&e.opacity()>=.5));let c=this.accessGlyphById.get(t);if(c){let h=e.fill();c.fill(ri(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.focusRegion(e))}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 Le({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(Ge(n,a,{fill:eo,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 Mn({fill:this.canvasBackground,opacity:1-De,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(u=>this.perspectiveLocalPoint(this.projectedSectionPoint(c,u))):c.outline.map(u=>{let p=c.liftWorld>0?this.isoLiftLocal(c.liftWorld):{x:0,y:0};return{x:u.x+p.x,y:u.y+p.y}});l(Xe(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=Re(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)),u=new In({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(u),u.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){Co(this.objectDrawContext,e)}renderTable(e){Io(this.objectDrawContext,e)}renderText(e){Mo(this.objectDrawContext,e)}renderShape(e){Po(this.objectDrawContext,e)}renderGA(e){xo(this.objectDrawContext,e)}renderSection(e){let t=pt(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(T=>this.seatById.get(T)).filter(T=>!!T):this.seats;for(let T of l)this.seatSection.has(T.id)||te(T,e.outline,e.holes)&&(o.push(T.id),r.set(T.categoryKey,(r.get(T.categoryKey)??0)+1),(this.statusById.get(T.id)??"free")==="free"&&n++);let c=e.color??si([...r].map(([T,R])=>({hex:this.catColor.get(T)??"#6e7bff",w:R})),"#3a4358"),h=Ki(e.elevation),u=dt(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),p=u.height*Pe,m=new Le({listening:!1});this.bgLayer.add(m);let f=new Le({listening:!1});m.add(f);let g=new et({listening:!0});this.seatLayer.add(g);let d=[];if(p>0){let T=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:T,stroke:oe("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});d.push(E),m.add(E)}}f.moveToTop();let y=f,b=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",v=Ge(e.outline,e.holes,{stroke:oe(b,.5),strokeWidth:1,fill:oe(b,.08),listening:!1},e.outlinePath);y.add(v);let w=Ge(e.outline,e.holes,{fill:s.sectionFill,stroke:s.sectionStroke,strokeWidth:Et,opacity:0,listening:!1},e.outlinePath);y.add(w);let k=e.labelPresentation?.labelStyle,S=k?.color??s.sectionInk,L=(k?.size??18)/18,C=new Ce({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*L,fontStyle:mi,fontFamily:this.labelFont(),fill:Y(s.sectionFill,S),listening:!1,perfectDrawEnabled:!1});C.offsetX(C.width()/2),C.offsetY(C.height()/2),y.add(C);let M=new Ce({x:t.x,y:t.y,text:U("map.seatsLeft",{count:n}),fontSize:12,fontStyle:yi,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:s.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});M.offsetX(M.width()/2),y.add(M);let I={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:ao(e.outline,e.holes??[],t),memberCategoryKeys:new Set(o.map(T=>this.seatById.get(T)?.categoryKey).filter(Boolean)),labelArea:zi(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:n,baseFill:c,outlineTint:b,outlinePoly:v,blockPoly:w,nameLabel:C,subLabel:M,preferredInk:S,labelScale:L,nameLabelFits:!1,subLabelFits:!0,elevation:h,liftWorld:p,rakeDeg:u.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:g.zIndex(),liftGroupBg:f,liftGroupSeat:g,sideFaces:d},P=o.map(T=>this.seatById.get(T)).filter(T=>!!T),x=P.length?P:e.outline;I.frontDistanceWorld=Math.min(...x.map(T=>Math.hypot(T.x-I.surfaceFocal.x,T.y-I.surfaceFocal.y)));for(let T of o)this.seatSection.set(T,I);this.refreshSectionFill(I),this.refreshSectionHeat(I),this.sections.push(I)}refreshSectionHeat(e){Ao(this.sectionLodPaintContext,e)}refreshSectionFill(e){Bo(this.sectionLodPaintContext,e)}isSectionClosed(e){return Mi(this.sectionLodPaintContext,e)}sectionAvailabilityState(e){return Pi(this.sectionLodPaintContext,e)}sectionBlockFill(e){return _e(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 p of o)p.centroid.y<r.centroid.y&&(r=p);let n=r.centroid.x,a=r.centroid.y,l=1/0;for(let p of o)for(let m of p.memberIds){let f=this.seatById.get(m),g=f&&this.catPrice.get(f.categoryKey);typeof g=="number"&&g<l&&(l=g)}let c=new rt({x:n,y:a,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:vi,stroke:s.color??r.outlineTint,strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});this.bgLayer.add(c);let h=new Ce({x:n,y:a,text:s.label.toUpperCase(),fontSize:At,fontStyle:mi,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 u=null;isFinite(l)&&(u=new Ce({x:n,y:a,text:U("map.fromPrice",{price:ci(l,this.currency)}),fontSize:Bt,fontStyle:yi,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:"#cbd5e1",opacity:0,listening:!1,perfectDrawEnabled:!1}),u.offsetX(u.width()/2),this.bgLayer.add(u)),this.zones.push({id:s.id,anchor:{x:n,y:a},back:c,background:vi,label:h,sub:u})}}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?ii(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let s=ii(getComputedStyle(t).backgroundColor);if(s)return s;t=t.parentElement}}return Li}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:Ke(this.canvasBackground)?vo: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=Y(typeof s=="string"?s:"",this.effSelection,St),r=this.selectionFocusId===e,n=this.boothDims.get(t.rowId),a=this.renderedSeatPoint(t),l=new Le({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),u=-Math.max(0,n.height/2-14);l.add(new Te({x:h,y:u,radius:10,fill:o,listening:!1})),l.add(new nt({x:h,y:u,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:Ke(o)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else l.add(new Te({...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 Te({...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(y=>this.projectedSectionPoint(f,y)));let g=f.liftWorld>0?this.isoLiftLocal(f.liftWorld):{x:0,y:0},d=f.outline.map(y=>{let b={x:y.x+g.x,y:y.y+g.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 g=this.seatById.get(f);if(!g)continue;let d=this.renderedSeatPoint(g);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 g={x:f.x+f.width/2,y:f.y+f.height/2};return t.some(d=>te(g,d.outline,d.holes))};for(let{node:f,backdrop:g}of this.freeTextById.values()){let d=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});h(d)&&(c(d),g&&c(g.getClientRect({relativeTo:this.bgLayer,skipShadow:!0})))}for(let{node:f}of this.iconNodeById.values()){let g=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});h(g)&&c(g)}let u=new Oe;for(let{node:f}of this.freeTextById.values()){let g=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0,skipStroke:!0});u.insert({x:g.x-Z,y:g.y-Z,width:g.width+Z*2,height:g.height+Z*2})}for(let f of this.rowLabelPlan){let g=(f.focusKeys??[]).some(v=>v===e||t.some(w=>v===w.id||v===w.logicalId)),d=new Ce({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 y=this.resolveAutomaticRowLabelPosition(d,f,u),b=this.rowLabelBox(d,y);g&&c(b),u.insert(b),d.destroy()}let p=Math.max(n-o,a-r),m=Math.max(this.seatR*2,Math.min(24,p*.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()*G(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,Be*.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=G(Math.max(c,t?.minScale??n),n,a),u=o/2-(s.x+s.width/2)*h,p=r/2-(s.y+s.height/2)*h,m=this.stage.scaleX(),f=this.stage.x(),g=this.stage.y();if(Math.abs(h-m)<1e-4&&Math.abs(u-f)<.5&&Math.abs(p-g)<.5){this.afterViewChange();return}let d=performance.now(),y=Math.max(180,Math.min(1200,t?.durationMs??Rt));this.glideInProgress=!0;let b=v=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let w=Math.min(1,(v-d)/y),k=w<.5?4*w*w*w:1-Math.pow(-2*w+2,3)/2,S=m+(h-m)*k;this.stage.scale({x:S,y:S}),this.stage.position({x:f+(u-f)*k,y:g+(p-g)*k}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),w<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<Be?"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 So(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(ye+ne)/2:Math.max(this.seatLabelTargetScale()*1.05,Gs,ne*1.3),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 p=this.sections.map(d=>{let y=K(d.outline);return{x:y.x+y.width/2,y:y.y+y.height/2}}),m=s/(t*2),f=o/(t*2);if(!p.some(d=>Math.abs(d.x-n.x)<=m&&Math.abs(d.y-n.y)<=f)){let d=p.reduce((y,b)=>{let v=(b.x-n.x)**2+(b.y-n.y)**2;return v<y.distance?{point:b,distance:v}:y},{point:p[0],distance:1/0});a=d.point.x,l=d.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 f of c){let g=f.x-n.x,d=f.y-n.y,y=g*g+d*d;y<m&&(p=f,m=y)}a=p.x,l=p.y}let h=s/(t*1.12),u=o/(t*1.12);this.focusRegion({x:a-h/2,y:l-u/2,width:h,height:u})}seatLabelTargetScale(){let e=xe,t=new Ce({fontSize:pe,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,xe);continue}let r=pe*this.seatLabelScale(o);t.fontSize(r),t.text(bt(o.displayLabel??o.label));let n=t.width()>s?Math.max(qe,r*s/t.width()):r;e=Math.min(e,n)}return t.destroy(),J/Math.max(qe,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(),Ae+.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?Fo(this.sectionLodPaintContext,e):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=Zs(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=G(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)||ue(t.fontSize(),e);t.visible(n),s?.visible(n)}for(let{node:t,fontSize:s}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||ue(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=Ro(e,{theme:this.theme,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,s=Z){return Ii(e,t,s)}resolveAutomaticRowLabelPosition(e,t,s){return Eo(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(){Oo(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 Uo(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 Zo(i,e,t){return We(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 Qo(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 jo(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 Jo(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 Kt(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}var ge=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function er(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var Xt=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 tr(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function ir(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 Pn(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function xn(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=>Pn(o.id)).sort((o,r)=>o-r);return s.some((o,r)=>o<0||r>0&&o!==s[r-1]+1)}function sr(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")&&xn(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 Rn=10,En=15e3,or=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new Xt;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=tr(e.numberOfPlacesToSelect);let t=ir(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Rn);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 Jo(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=We(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=S=>Math.round((performance.now()-S)*100)/100;this.closed=!1;let r,n=performance.now();try{r=await this.api.chart(this.key)}catch(S){return this.emitError(S),null}if(s.loadChart=o(n),this.closed)return null;this._doc=er(r.doc,r.event.eventConfiguration),this.eventConfiguration.reset(r.event.eventConfiguration);let a=performance.now();try{let S=ks(r.doc,r.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(S.map(L=>[L.objectId,L])),this.groupedTablesByLabel=new Map(S.map(L=>[L.label,L])),this.groupedTableBySeatId=new Map(S.flatMap(L=>L.chairs.map(C=>[C.id,L]))),this.tableQuantities=new Map(S.map(L=>[L.label,L.mode==="whole"?L.capacity:L.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=S.reduce((L,C)=>L+Math.max(0,C.chairs.length-1),0)}catch(S){return this.emitError(S),null}this.labelToId=new Map,this.labelToSeat=new Map,this.seatById=new Map,this.seatContext=new Map,this.allIds=[];let l=new Map(Xi(r.doc).map(S=>[S.id,S])),c=ti(r.doc),h=new Map([...c.sections,...c.ungrouped?[c.ungrouped]:[]].map(S=>[S.id,S.label]));this.expandedSeats=ze(r.doc);for(let S of this.expandedSeats){this.labelToId.set(S.label,S.id),this.labelToSeat.set(S.label,S),this.seatById.set(S.id,S),this.allIds.push(S.id);let L=l.get(S.rowId),C=L&&"label"in L&&typeof L.label=="string"?L.label:void 0,M=L?.type==="row"?L.segmentedRow:void 0,I=M?.displayLabel??(L&&"displayLabel"in L&&typeof L.displayLabel=="string"&&L.displayLabel?L.displayLabel:C),P=this.groupedTablesByObject.get(S.rowId),x=L?.type==="table"?"table":L?.type==="booth"?"booth":"seat",T=I,R=M?.displayType?.trim()||(L&&"displayType"in L&&typeof L.displayType=="string"&&L.displayType.trim()?L.displayType.trim():void 0),E=S.displayLabel??S.label,B=E.split("-"),W=P||S.kind==="booth"?void 0:I&&E.startsWith(`${I}-`)?E.slice(I.length+1):B[B.length-1]??E;this.seatContext.set(S.id,{objectId:S.rowId,objectType:x,sectionLabel:h.get(c.objectToSection.get(S.rowId)??""),rowLabel:T,seatNumber:W,...R?{displayType:R,rowType:R}:{}})}for(let S of this.groupedTablesByLabel.values()){let L=S.chairs[0];L&&(this.labelToId.set(S.label,L.id),this.labelToSeat.set(S.label,L))}s.normalizeBuyerModel=o(a);let u=r.event.currency??this.opts.currency;this.currency=u??"USD";let p=performance.now(),m=qo(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:u,onSelect:S=>{this.handleRendererSelect(S)},onDeselect:S=>{this.handleRendererDeselect(S)},onSelectionLimit:this.opts.onSelectionLimit,onHover:S=>{this.opts.onHover?.(S),this.opts.onSeatHover&&this.opts.onSeatHover(S?this.describeSeat(S):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:S=>this.handleSectionTap(S),onDeckTap:S=>this.handleDeckTap(S),onFps:this.opts.onFps});if(s.createRenderer=o(p),this.closed)return m.destroy(),null;this.renderer=m;let f=null,g="free",d=[],y=performance.now();try{let S=await this.api.objects(this.key);this.hidden=new Set(S.hidden??[]),d=(S.closed??[]).filter(L=>typeof L=="string"),f=S.seats,g=S.default??"free"}catch{}if(s.loadStatuses=o(y),this.closed)return m.destroy(),this.renderer=null,null;let b=performance.now();m.setChart(this.visibleDoc()),(r.doc.floors?.length??0)>1&&m.setFloorOverview?.(!0),this.opts.colorblindSafe&&m.setColorblindSafe?.(!0),s.buildScene=o(b),this.closedSections=new Set(d);let v=performance.now();d.length&&m.setClosedSections?.(d),f&&this.applySeatsMap(f,g),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),s.applyInitialState=o(v);let w=performance.now();m.forceDraw(),s.firstPaint=o(w);let k=performance.now();return this.attachVisibilityListener(),this.connect(),s.startRealtime=o(k),s.controllerTotal=o(t),{doc:r.doc,salesClosed:!!r.event.salesClosed,eventName:r.event.name,venue:r.event.venue,startsAt:r.event.startsAt,timezone:r.event.timezone??null,currency:u,mode:r.event.mode??"live",locale:r.event.locale??null,posterUrl:r.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 ge(ai(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 sr(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&&ni(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,u)=>h+(u.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 ge(ai([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 ge(a);if(this.hold_&&this.holdCovers(n))return this.hold_;try{let l=n.map(h=>{let u=r.find(f=>f.label===h);if(u)return{label:h,tierId:u.tierId,quantity:u.quantity};let p=this.labelToSeat.get(h),m=p?this.toSeat(p):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 jo({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?Zo(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Qo(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,s={}){let o=this.visibleDoc();if(!o||!Number.isFinite(t)||t<1)return null;let r=We(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(ti(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(p=>!n.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")continue;let m=this.labelToId.get(p.label);((m?this.getStatus(m):void 0)??"free")==="free"&&c.add(p.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(p=>this.labelToSeat.get(p)?.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 u=this.labelToSeat.get(h),p=u?this.toSeat(u):null;return{label:h,...p?.tierId?{tierId:p.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 ge(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(u=>{let p=this.labelToSeat.get(u),m=p?this.toSeat(p):null;return{label:u,...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:u,reason:p}=lt(c);if(this.clearHold(),h===409&&p==="event_closed")this.opts.onSalesClosed?.();else if(h===409&&u?.length){let m=new Set(u.map(d=>d.label)),f=this.idsForLabels(m);f.length&&(o.setStatus(f,"booked"),o.deselect(f),this.resetTableQuantitiesForLabels(m));let g=r.filter(d=>!m.has(d));g.length&&a&&this.api.release(this.key,g,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 g=this.seatById.get(f);if(!g)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(g.categoryKey,(n.get(g.categoryKey)??0)+1),t.getStatus(f)==="free"&&l++}let c=[...n.entries()].map(([f,g])=>{let d=s.categories.find(w=>w.key===f),y=d?.tiers?.length?d.tiers.map(w=>w.price):[d?.price??0],b=Math.min(...y),v=Math.max(...y);return{key:f,count:g,label:d?.label??f,color:d?.color??"#6e7bff",price:b,priceMin:b,priceMax:v}}).sort((f,g)=>f.price-g.price),h=c.map(f=>f.priceMin),u=c.map(f=>f.priceMax),p=o.zone?s.zones?.find(f=>f.id===o.zone):void 0,m=o.color??p?.color??c[0]?.color??"#6e7bff";return{id:e,label:o.displayLabel??o.label,zoneLabel:p?.label??"",...o.entrance&&o.entrance.trim()?{entrance:o.entrance.trim()}:{},color:m,seatsLeft:l,priceMin:h.length?Math.min(...h):0,priceMax:u.length?Math.max(...u):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"?U("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?ni(this.seatById.values(),r=>e.getStatus(r),s):[]).length>0?(this.hintShown=!0,this.opts.onHint(U("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=Kt(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[Kt(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=Kt(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=Uo(e,{baseMs:1e3,maxMs:En,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var An=5,Bn=-1.1,Bi=35;function Fi(i,e){let t=i-q,s=Math.atan2(An-t,e)*180/Math.PI,o=Math.atan2(Bn-t,e)*180/Math.PI;return o<-Bi&&(s+=-Bi-o,o=-Bi),{topPitch:s,basePitch:o}}var X=2048,ce=1024,ht=Wi,A=Math.PI*2,Fn=ce/180,Ne=i=>(i+180)/360*X,N=i=>(90-i)/180*ce;function cr(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 hr(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 $t=96,Oi=360/$t,Dn=.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 rr(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 Q(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 nr=new Map;function ar(i){if(!i)return null;let e=nr.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=Q(s,.3,.42);return nr.set(i,o),o}function _n(i,e,t,s){let o=new Array($t).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,u=Math.hypot(c,h)*ht;if(u<1.5||u>95)continue;let p=a.eyeHeightM??q,m=p-s;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,u)*180/Math.PI,g=Math.atan2(p-q-s,u)*180/Math.PI,y=((Math.atan2(c,-h)-t)*180/Math.PI+540)%360-180,b=Math.min($t-1,Math.max(0,Math.floor((y+180)/Oi))),v=f>34&&u<16,w=o[b];w?(f>w.top&&(w.top=f),g<w.base&&(w.base=g),u<w.nearM&&(w.nearM=u,w.tint=ar(a.categoryKey)),w.overhead=w.overhead||v):o[b]={top:f,base:g,nearM:u,overhead:v,tint:ar(a.categoryKey)}}return{bins:o,maxDelta:r}}function On(i,e,t,s){for(let o=0;o<$t;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),u=s(c),p=s(h);if(p<=u)continue;let m=r.nearM/95,f=r.tint,g=f?rr([44,54,80],f,.34):[44,54,80],d=f?rr([24,30,48],f,.28):[24,30,48],y=i.createLinearGradient(0,u,0,p);y.addColorStop(0,_i(g,m)),y.addColorStop(.24,_i(d,m)),y.addColorStop(1,_i([10,13,22],m)),i.fillStyle=y,i.fillRect(a,u,l-a+1,p-u),i.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,i.fillRect(a,u,l-a+1,1.5);let v=Math.min(p,s(0))-u;if(v>8){let k=1-m*.4;for(let S=1;S<6;S++){let L=u+v*S/6;i.fillStyle=`rgba(0,0,0,${.16*k})`,i.fillRect(a,L,l-a+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*k})`,i.fillRect(a,L+1.5,l-a+1,1.2)}}if(r.overhead){let w=s(Math.min(86,c+12)),k=i.createLinearGradient(0,w,0,u);k.addColorStop(0,"rgba(3,4,8,0.9)"),k.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=k,i.fillRect(a,w,l-a+1,u-w),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(a,u-1.5,l-a+1,1.5)}}}function Gn(i,e,t){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),n=new Set,a=0;for(let y of t){a++,y.sectionId&&n.add(y.sectionId);let b=y.x-e.x,v=y.y-e.y,w=Math.hypot(b,v)*ht;if(w<.5)continue;let k=Math.atan2(b,-v),S=Math.floor((k+Math.PI)/A*72);S<0?S=0:S>=72&&(S=71),o[S]=!0,w<r[S]&&(r[S]=w)}let l=0,c=[];for(let y=0;y<72;y++)o[y]&&(l++,c.push(r[y]));let h=l/72*360;c.sort((y,b)=>y-b);let u=c.length?c[c.length>>1]:0,p=c.length?c[Math.floor(c.length*.15)]??u:0,m=c.length?c[Math.floor(c.length*.85)]??u:0,f=p>.5?m/p:1,g=cr(`${a}|${[...n].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),d;return h>=300&&u>11&&f>1.35?d="sport":h>=285?d="arena":d="proscenium",{mode:d,seed:g,voidRadiusM:u,aspect:f}}var Hn=5;function Nn(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 Vn(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})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;i.save(),i.translate(e,t);let p=o.lean*s;i.fillStyle=h,i.beginPath(),i.moveTo(-r,a),i.quadraticCurveTo(-r*1.18,l-p-s*.6,-n,l-p),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+p),i.quadraticCurveTo(r*1.18,l+p-s*.6,r,a),i.closePath(),i.fill(),i.fillStyle=u,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=u,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()),Nn(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 zn(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,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,p=i.createRadialGradient(e,t,1,e,t,s*.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,s*.24,s*.24,0,0,A),i.fill(),i.restore(),i.fillStyle=u,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=u,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=u,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=u,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 Yt(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 ad(i,e,t){let s=document.createElement("canvas");s.width=X,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??q,h=Gn(i,e,t),u=hr(h.seed),p=210+u()*150,m=Q(220+(u()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,g=o.createLinearGradient(0,0,0,ce);g.addColorStop(0,"#080b12"),g.addColorStop(.42,"#12182c"),g.addColorStop(.5,"#1c2440"),g.addColorStop(.56,"#151b2c"),g.addColorStop(.78,"#171e30"),g.addColorStop(1,"#131829"),o.fillStyle=g,o.fillRect(0,0,X,ce);let d=o.createLinearGradient(0,N(-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,N(-6),X,ce-N(-6));let y=Math.atan2(r,-n),b=_n(i,t,y,c),v=b.maxDelta>=Dn;v&&On(o,b.bins,Ne,N);let w=Math.max(.3,Math.min(1,1-(l-6)/60)),k=Fi(c,l),S=Math.min(80,Math.atan2(4,l)*180/Math.PI),L=Math.min(45,k.topPitch),C=k.basePitch;h.mode==="sport"?Xn(o,l,c,h,w,p,f,u):h.mode==="arena"?Kn(o,l,c,h,w,f,u):Wn(o,S,L,C,w,p,f,u);let M=h.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${f},0.8)`;for(let P=0;P<M;P++){let x=(P+.5)/M*X,T=N(h.mode==="sport"?58:54+P*7%3*6);o.beginPath(),o.arc(x,T,h.mode==="sport"?2.6:3.2,0,A),o.fill()}$n(o,i,t,e,y,c,r,n,v,h);let I=o.createLinearGradient(0,0,0,ce);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)"),o.fillStyle=I,o.fillRect(0,0,X,ce),{url:s.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function Wn(i,e,t,s,o,r,n,a){let l=Ne(-e),c=Ne(e),h=N(t),u=N(s),p=c-l,m=u-h,f=N(Math.min(50,t+10)),g=p*(1.1+(1-o)*.5),d=i.createRadialGradient(X/2,(h+u)/2,8,X/2,(h+u)/2,g);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-p*.6,h-m*1.2,p*2.2,m*3.4);let y=Q(r,.62,.55),b=Q(r+40,.7,.5),v=Q(r+70,.78,.52);i.save(),i.beginPath(),i.rect(l,h,p,m),i.clip();let w=i.createLinearGradient(0,h,0,u);w.addColorStop(0,`rgb(${y[0]},${y[1]},${y[2]})`),w.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),w.addColorStop(1,`rgb(${v[0]},${v[1]},${v[2]})`),i.globalAlpha=.8,i.fillStyle=w,i.fillRect(l,h,p,m),i.globalAlpha=1;let k=i.createRadialGradient(X/2,(h+u)/2,p*.12,X/2,(h+u)/2,p*.62);k.addColorStop(0,"rgba(6,8,14,0)"),k.addColorStop(.7,"rgba(6,8,14,0.15)"),k.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=k,i.fillRect(l,h,p,m),i.restore();let S=3+Math.floor(a()*3),L=m*.46,C=u-m*.08;for(let B=0;B<S;B++){let W=(B+1)/(S+1),z=l+p*(.22+W*.56+(a()-.5)*.06);Hi(i,z,C,L*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:Q(r+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(l-p*.5,f,p*.5,u-f),i.fillRect(c,f,p*.5,u-f);let M=p*.055+3,I=M*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(l,u),i.lineTo(l-M,u),i.lineTo(l-I,f),i.lineTo(l+p*.012,f),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,u),i.lineTo(c+M,u),i.lineTo(c+I,f),i.lineTo(c-p*.012,f),i.closePath(),i.fill(),i.fillRect(l-I,f,p+I*2,(u-f)*.12);let P=m*.14,x=f+(u-f)*.12;i.fillStyle="rgba(4,6,12,0.96)";let T=7;i.beginPath(),i.moveTo(l-I,x);for(let B=0;B<=T;B++){let W=l-I+(p+I*2)*B/T;i.quadraticCurveTo(W-(p+I*2)/T/2,x+P,W,x)}i.lineTo(c+I,x),i.lineTo(c+I,f),i.lineTo(l-I,f),i.closePath(),i.fill(),i.fillStyle=`rgba(${n},0.12)`,i.fillRect(l-1.5,x,1.5,u-x),i.fillRect(c,x,1.5,u-x),i.fillStyle="#0b0f18",i.fillRect(l-M,u-m*.05,p+M*2,m*.05+3);let R=i.createLinearGradient(0,u-m*.05,0,u+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,u-m*.05,p+M*2,m*.2);let E=3+Math.floor(a()*2);for(let B=0;B<E;B++){let W=(B+1)/(E+1),z=l+p*(W+(a()-.5)*.08),V=N(Math.min(62,t+26)),j=(a()-.5)*p*.16;Yt(i,z,V,z+j,u,4,p*.09,n,.16*(.7+o*.5)),Ni(i,z,V,2.4,n)}}function Kn(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=X/2,h=1.2,u=Math.max(e*.45,e-a),p=e+a,m=Math.atan2(h-t,u)*180/Math.PI,f=Math.atan2(h-t,p)*180/Math.PI,g=Math.atan2(-t,u)*180/Math.PI,d=N(m),y=N(f),b=N(g),v=Ne(l)-c,w=Math.max(6,(d-y)/2),k=(d+y)/2,S=i.createRadialGradient(c,b,4,c,b,v*2.6);S.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),S.addColorStop(.5,"rgba(150,140,190,0.08)"),S.addColorStop(1,"rgba(40,44,60,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=S,i.fillRect(c-v*2.6,y-w,v*5.2,b-y+w+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-v,k),i.ellipse(c,k,v,w,0,Math.PI,0,!1),i.lineTo(c+v,b),i.ellipse(c,b,v,w,0,0,Math.PI,!1),i.closePath(),i.fill();let L=i.createLinearGradient(0,k,0,b);L.addColorStop(0,`rgba(${r},0.14)`),L.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=L,i.fillRect(c-v,k,v*2,b-k);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}]],M=C[Math.floor(n()*C.length)],I=n()<.5?-1:1,P=D=>c+D.u*I*v*.84,x=D=>k+D.v*w*.8,T=M.find(D=>D.lead)??M[0],R=P(T),E=i.createLinearGradient(0,k-w,0,k+w);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),i.fillStyle=E,i.beginPath(),i.ellipse(c,k,v,w,0,0,A),i.fill();let B=i.createRadialGradient(R,k,2,R,k,v);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,k,v,w,0,0,A),i.fill(),i.restore(),i.strokeStyle=`rgba(${r},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,k,v,w,0,0,A),i.stroke();let W=Math.max(24,(b-y)*1.3),z=M.length>=3?3:2;for(let D=0;D<z;D++){let he=(-.62+D*.52+(n()-.5)*.12)*-I,be=c+he*v*.7,Ve=k-w*(.45+n()*.18),Me=v*(.07+n()*.04),Jt=W*(.26+n()*.12);i.fillStyle="#0a0e18",i.fillRect(be-Me/2,Ve-Jt,Me,Jt),i.fillStyle=`rgba(${r},0.3)`,i.fillRect(be-Me/2,Ve-Jt,Me,1.5)}if(M.length>=3){let D=c-T.u*I*v*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(D,k-w*.34,v*.08,w*.1,0,0,A),i.fill(),i.strokeStyle=`rgba(${r},0.35)`,i.lineWidth=1,i.stroke()}for(let D of[...M].sort((he,be)=>he.v-be.v)){let he=.82+(D.v+1)*.14;Hi(i,P(D),x(D),W*he*(D.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:D.pose,rim:Q(40,.72,.8),rimStrength:D.lead?1.4:.9})}let V=N(Math.min(60,f+34)),j=w*1.1+6;i.strokeStyle="rgba(60,68,92,0.85)",i.lineWidth=3,i.beginPath(),i.ellipse(c,V,v*1.15,j,0,0,A),i.stroke();let F=4+Math.floor(n()*3);for(let D=0;D<F;D++){let he=D/F*A,be=c+Math.cos(he)*v*1.15,Ve=V+Math.sin(he)*j;if(Math.sin(he)>-.2){let Me=c+(n()-.5)*v*.8;Yt(i,be,Ve,Me,k,3,v*.32,r,.2*(.7+o*.4))}Ni(i,be,Ve,3,r)}let _=N(Math.min(52,f+24)),O=Math.max(60,v*.4),$=Math.max(24,O*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-O*.3,_-$/2),i.lineTo(c-O*.16,_-$*2.2),i.moveTo(c+O*.3,_-$/2),i.lineTo(c+O*.16,_-$*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-O/2,_-$/2,O,$);let Ut=i.createLinearGradient(0,_-$*.3,0,_+$*.42);Ut.addColorStop(0,`rgba(${r},0.5)`),Ut.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=Ut,i.fillRect(c-O*.42,_-$*.3,O*.84,$*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-O/2,_+$/2-2,O,2);let Zt=i.createRadialGradient(c,_,4,c,_,O*1.1);Zt.addColorStop(0,`rgba(${r},0.2)`),Zt.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=Zt,i.fillRect(c-O*1.1,_-O*.8,O*2.2,O*1.6);let Qt=i.createRadialGradient(c,(V+k)/2,6,c,(V+k)/2,v*1.5);Qt.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),Qt.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=Qt,i.fillRect(c-v*1.5,V-40,v*3,k-V+80),i.restore();let pr=c+Math.sign(R-c||1)*v*.5;Yt(i,pr,V-j*.4,R,x(T),2.5,v*.16,"255,224,178",.42*(.7+o*.4));let jt=i.createRadialGradient(R,x(T),1,R,x(T),v*.2);jt.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),jt.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=jt,i.beginPath(),i.ellipse(R,x(T),v*.2,w*.24,0,0,A),i.fill(),i.restore()}function Xn(i,e,t,s,o,r,n,a){let l=X/2,c=Math.max(10,s.voidRadiusM),h=Math.max(2,e-c),u=e+c,p=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),m=Math.atan2(-t,h)*180/Math.PI,f=Math.atan2(-t,u)*180/Math.PI,g=N(m),d=N(f),y=Ne(p)-l,b=(g+d)/2,v=Math.max(10,(g-d)/2),w=i.createRadialGradient(l,b,4,l,b,y);w.addColorStop(0,"#e8f0fb"),w.addColorStop(.7,"#b9c9e2"),w.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(l,b,y,v,0,0,A),i.clip(),i.fillStyle=w,i.fillRect(l-y,b-v,y*2,v*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(l,b-v),i.lineTo(l,b+v),i.moveTo(l-y*.5,b-v),i.lineTo(l-y*.5,b+v),i.moveTo(l+y*.5,b-v),i.lineTo(l+y*.5,b+v),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(l,b,v*.9,v*.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,y,v,0,0,A),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let P=0;P<5;P++){let x=l+(a()-.5)*y*1.4,T=b+(a()-.5)*v*1.1,R=Math.max(2,v*.06);i.beginPath(),i.ellipse(x,T,R*.6,R,0,0,A),i.fill()}let k=i.createRadialGradient(l,b,4,l,b,y*1.4);k.addColorStop(0,"rgba(200,220,255,0.12)"),k.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=k,i.fillRect(l-y*1.4,d-v,y*2.8,g-d+v*2),i.restore();let S=N(Math.min(66,f+60)),L=Math.max(80,y*.7),C=L*.5,M=i.createRadialGradient(l,S,4,l,S,L*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-L*1.6,S-L*1.2,L*3.2,L*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(l-L/2,S-C/2),i.lineTo(l+L/2,S-C/2),i.lineTo(l+L*.6,S),i.lineTo(l+L/2,S+C/2),i.lineTo(l-L/2,S+C/2),i.lineTo(l-L*.6,S),i.closePath(),i.fill();let I=r;for(let P=0;P<3;P++){let x=Q(I+P*30,.5,.5);i.fillStyle=`rgba(${x[0]},${x[1]},${x[2]},0.75)`;let T=L*.26;i.fillRect(l-L*.42+P*(T+L*.06),S-C*.32,T,C*.64)}i.fillStyle=`rgba(${n},0.9)`;for(let P=0;P<8;P++){let x=l-L*.6+L*1.2*P/7;i.beginPath(),i.arc(x,S+C*.62,2.4,0,A),i.fill()}}function $n(i,e,t,s,o,r,n,a,l,c){let h=e.sectionId,u=!1,p=[];for(let g of t){if(g.id===e.id)continue;let d=g.x-e.x,y=g.y-e.y,b=Math.hypot(d,y)*ht;if(h&&g.sectionId===h&&b<3&&d*n+y*a>0&&(u=!0),b<.3||b>32)continue;let w=((Math.atan2(d,-y)-o)*180/Math.PI+540)%360-180,k=l?(g.eyeHeightM??q)-r:0,S=Math.atan2(k-.28,b)*180/Math.PI;if(S>10&&b>5)continue;let L=0;for(let I=0;I<g.id.length;I++)L=L*31+g.id.charCodeAt(I)&65535;let C=.9+(L&15)/40,M=Math.min(78,Math.atan2(.16,b)*180/Math.PI*Fn*C);M<1.2||p.push({hx:Ne(w),hy:N(S),r:M,d:b,hash:L})}p.sort((g,d)=>d.d-g.d);let m=[];{let g=[...p].sort((b,v)=>b.hy-v.hy),d=[],y=()=>{if(!d.length)return;let b=d.reduce((k,S)=>k+S.d,0)/d.length,v=d.reduce((k,S)=>k+S.hy,0)/d.length,w=d.reduce((k,S)=>k+S.r,0)/d.length;m.push({figs:d.sort((k,S)=>S.d-k.d),d:b,hy:v,r:w}),d=[]};for(let b of g){let v=d[d.length-1];v&&Math.abs(b.hy-v.hy)>Math.max(5,(v.r+b.r)/2*1.7)&&y(),d.push(b)}y()}m.sort((g,d)=>d.d-g.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let g of m){if(g.figs.length>=3&&g.r>=1.6&&g.r<26){let d=[],y=[...g.figs].sort((w,k)=>w.hx-k.hx),b=[];for(let w of y){let k=b[b.length-1];k&&w.hx-k.hx>Math.max(14,w.r*7)&&(b.length>=3&&d.push(b),b=[]),b.push(w)}b.length>=3&&d.push(b);let v=Math.min(.42,.5*(1-g.d/42));if(v>.05){i.fillStyle=`rgba(15, 19, 31, ${v.toFixed(3)})`;for(let w of d){let k=w[0].hx-g.r*1.6,S=w[w.length-1].hx+g.r*1.6;i.beginPath(),i.roundRect(k,g.hy+g.r*.8,S-k,g.r*2.4,g.r*.8),i.fill()}}}for(let d of g.figs){let y=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),v=[14+(d.hash>>4&6)+b,17+(d.hash>>4&6)+b,25+(d.hash>>4&6)+b],w=f[d.hash%f.length],k=[w[0]+b,w[1]+b,w[2]+b];if(d.r>=13){let S=d.d<9?.16*(1-d.d/9)+(c.mode==="proscenium"?.06:0):0;Vn(i,d.hx,d.hy,d.r,{tone:v,clothing:k,alpha:y,tilt:((d.hash>>2&7)-3.5)*.018,shoulderK:1.72+(d.hash>>5&7)/22,hair:d.hash%Hn,rim:S,turn:((d.hash>>8&7)-3.5)*.034,lean:((d.hash>>10&3)-1.5)*.09})}else d.r>=5.5?zn(i,d.hx,d.hy,d.r,k,v,y):(i.fillStyle=`rgba(${v[0]},${v[1]},${v[2]},${y.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(u){let g=N(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,g,X,ce-g),i.fillStyle="rgba(24, 30, 46, 0.9)";let d=16;for(let y=0;y<d;y++){let b=(y+.5)/d*X;i.beginPath(),i.ellipse(b,g+6,X/d*.42,22,0,Math.PI,0,!0),i.fill()}}}var ee=480,He=270,Gi=50,Ie=30,lr=i=>(i+Gi)/(2*Gi)*ee,ct=i=>(Ie-i)/(2*Ie)*He;function ld(i,e,t){let s=document.createElement("canvas");s.width=ee,s.height=He;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=hr(cr(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,h=Q(220+(l()-.5)*60,.55,.82),u=`${h[0]},${h[1]},${h[2]}`,p=o.createLinearGradient(0,0,0,He);p.addColorStop(0,"#080b12"),p.addColorStop(.44,"#151c32"),p.addColorStop(.5,"#1d2644"),p.addColorStop(.58,"#161c2e"),p.addColorStop(1,"#131829"),o.fillStyle=p,o.fillRect(0,0,ee,He);let m=i.eyeHeightM??q,f=Fi(m,a),g=Math.min(Gi-2,Math.atan2(4,a)*180/Math.PI),d=Math.min(Ie-2,f.topPitch),y=Math.max(-Ie+2,f.basePitch),b=lr(-g),v=lr(g),w=ct(d),k=ct(y),S=v-b,L=k-w,C=Math.max(.35,Math.min(1,1-(a-6)/60)),M=ct(Math.min(Ie-1,d+8)),I=o.createRadialGradient(ee/2,(w+k)/2,4,ee/2,(w+k)/2,S*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)"),o.fillStyle=I,o.fillRect(b-S*.6,w-L*1.2,S*2.2,L*3.4);let P=Q(c,.62,.55),x=Q(c+40,.7,.5),T=Q(c+70,.78,.52);o.save(),o.beginPath(),o.rect(b,w,S,L),o.clip();let R=o.createLinearGradient(0,w,0,k);R.addColorStop(0,`rgb(${P[0]},${P[1]},${P[2]})`),R.addColorStop(.5,`rgb(${x[0]},${x[1]},${x[2]})`),R.addColorStop(1,`rgb(${T[0]},${T[1]},${T[2]})`),o.globalAlpha=.8,o.fillStyle=R,o.fillRect(b,w,S,L),o.globalAlpha=1;let E=o.createRadialGradient(ee/2,(w+k)/2,S*.12,ee/2,(w+k)/2,S*.6);E.addColorStop(0,"rgba(6,8,14,0)"),E.addColorStop(.7,"rgba(6,8,14,0.15)"),E.addColorStop(1,"rgba(5,6,11,0.9)"),o.fillStyle=E,o.fillRect(b,w,S,L),o.restore();let B=3,W=k-L*.08;for(let F=0;F<B;F++){let _=(F+1)/(B+1);Hi(o,b+S*(.24+_*.52),W,L*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:Q(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(b-S*.5,M,S*.5,k-M),o.fillRect(v,M,S*.5,k-M);let z=S*.05+2,V=z*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(b,k),o.lineTo(b-z,k),o.lineTo(b-V,M),o.lineTo(b+S*.012,M),o.closePath(),o.fill(),o.beginPath(),o.moveTo(v,k),o.lineTo(v+z,k),o.lineTo(v+V,M),o.lineTo(v-S*.012,M),o.closePath(),o.fill(),o.fillRect(b-V,M,S+V*2,(k-M)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(b-1.2,M,1.2,k-M),o.fillRect(v,M,1.2,k-M),o.fillStyle="#0b0f18",o.fillRect(b-z,k-L*.05,S+z*2,L*.05+2);let j=o.createLinearGradient(0,k-L*.05,0,k+L*.14);j.addColorStop(0,`rgba(255,206,140,${(.5*C).toFixed(3)})`),j.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=j,o.fillRect(b-z,k-L*.05,S+z*2,L*.22);for(let F=0;F<3;F++){let _=(F+1)/4,O=b+S*_,$=ct(Math.min(Ie-1,d+20));Yt(o,O,$,O+(l()-.5)*S*.14,k,3,S*.09,u,.17*C),Ni(o,O,$,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let F=0;F<8;F++)o.beginPath(),o.arc((F+.5)/8*ee,ct(Ie-4-F%2*3),2.2,0,A),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,He-26,ee,26),o.fillStyle="rgba(30,37,54,0.9)";for(let F=0;F<9;F++){let _=F*(ee/9)+ee/18;o.beginPath(),o.ellipse(_,He-22,ee/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:s.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var dr=new Set(["en"]),qt=new Map;async function Yn(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 pd(i,e){let t=Fs(i,e);if(t==="en"||dr.has(t))return Ee(t),t;if(!Bs.includes(t))return Ee("en"),"en";try{let s=qt.get(t);s||(s=Yn(t),qt.set(t,s));let o=await s;return qt.delete(t),o?(Ee(t,o),dr.add(t),t):(Ee("en"),"en")}catch{return qt.delete(t),Ee("en"),"en"}}export{Qn as ACCESSIBILITY_RING_COLOR,Un as ACCESSIBILITY_TYPES,qn as CHART_STORAGE_KEY,Xa as CURRENCY_CHOICES,Ka as DEFAULT_CURRENCY,ra as EVENT_CONFIGURATION_EXPORT_SCHEMA,oa as EVENT_CONFIGURATION_SCHEMA,ta as LABEL_STYLE_MAX_SIZE,ea as LABEL_STYLE_MIN_SIZE,Ja as LOCALE_NAMES,Ea as MAX_EVENT_INVENTORY,Ra as MAX_GA_CAPACITY,or as PickerController,ge as PickerSelectionError,Ha as RENDERED_QUALITY_REPORT_VERSION,jn as SEAT_COMMERCIAL_MARKS,br as SUPPORTED_LOCALES,ia as SURROUNDINGS_SHAPE_ROLES,Ei as SeatmapRenderer,fa as TABLE_SEAT_OFFSET,ua as TIER_HEIGHT_M,Bs as TRANSLATED_LOCALES,Qi as UNGROUPED_ID,Zn as accessibilityMeta,ei as accessibilityRingColor,Xi as allObjects,ji as applyHidden,ha as canTransitionEventConfiguration,la as canonicalEventConfigurationJson,Zi as chartBounds,ti as computeSections,qo as createRenderer,yr as currencyExponent,Ya as currencySymbol,La as expandBooth,ze as expandChart,ba as expandRow,ga as expandRowSlots,wa as expandTable,va as expandTableSlots,Ma as floorObjects,xa as floorOverviewTranslations,ut as floorsOf,qi as floorsShareFootprint,rl as formatDate,$a as formatMinor,ci as formatMoney,gr as fromMinorUnits,We as gaAreasOf,Fa as gaInventorySegments,Aa as gaUnitLabel,ft as gaUnitLabels,ad as generateSeatPanorama,ld as generateSeatThumb,el as getLocale,Da as growJoinedGAInventory,Ga as hiddenObjectIds,ca as inspectEventConfigurationCompatibility,Na as inspectRenderedQualityEvidence,_a as isGaUnitLabel,il as isLocaleLoaded,Oa as isSectionHidden,sa as layerOf,Yi as layoutFloorOverview,Ui as layoutFloorRings,pd as loadLocale,tl as localeDirection,pa as migrateLegacyEventConfigurations,Ca as objectCenter,Ia as owningSectionForObject,aa as parseEventConfigurationExport,na as parseEventConfigurationVersion,Ta as pointInPolygon,te as pointInPolygonWithHoles,pt as polygonLabelPoint,da as resolveEventConfigurationRollback,Fs as resolveLocale,ya as rowInventoryCount,ma as rowSeatPositions,Jn as seatCommercialMeta,dt as sectionGeometry,Ee as setLocale,As as setMoneyLocale,sl as setStringOverrides,$i as stackFloors,U as t,ol as tCount,ka as tableInventoryCount,Sa as tableSeatCountsBySide,Pa as translateObject,Ba as validGAInventorySegments};
1
+ import{a as ni,b as bs,d as ai,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 Na,b as Va}from"./chunk-MR2O5WC7.js";import{b as ws}from"./chunk-FOYQOIWG.js";import{a as pe,b as es,c as xe,d as yt,e as gt,f as Se,g as J,m as ue,n as re,q as oi,r as bt,t as ts,u as St,v as Y,w as ri}from"./chunk-GXMGOWKB.js";import{b as Re,f as ds,g as ps,m as us,x as fs,y as ms}from"./chunk-JBGLFOJO.js";import{a as Ea,b as Aa,c as Ba,d as Fa,e as Da,f as ft,g as _a,h as We,i as Oa,j as Qi,k as ti,l as Ga,m as Ha,n as ji}from"./chunk-HZT2U5IY.js";import{a as ra,b as na,c as aa,d as la,e as ca,f as ha,g as da,h as pa,i as ua}from"./chunk-WZ6ZNPNT.js";import{c as ys,e as gs}from"./chunk-T2LWVOQ3.js";import{a as Un,b as Zn,c as Qn,d as jn,e as ei,f as Jn,g as ea,h as ta,i as ia,j as sa,k as oa,p as Xe,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 Pa,Ba as Xi,Ca as xa,Da as $i,Ea as Yi,Fa as qi,Ga as Ui,Ha as Ra,Ia as ze,Ja as Zi,W as Wi,X as Pe,Y as fa,ea as q,fa as Ki,ga as dt,ka as ma,la as ya,ma as ga,na as ba,oa as Sa,pa as va,qa as ka,ra as wa,s as Vi,sa as La,ta as Ta,u as zi,ua as Ca,va as te,w as G,wa as pt,xa as Ia,ya as Ma,za as ut}from"./chunk-I6DNJFRF.js";import{B as oe,h as ii,s as Ke,t as me,u as de,v as mt,w as si,y as Ji}from"./chunk-CXF32VPG.js";import"./chunk-CRCGO52K.js";import{Konva as Wt}from"konva/lib/Core";import{Stage as Cn}from"konva/lib/Stage";import{Layer as xi}from"konva/lib/Layer";import{Group as Le}from"konva/lib/Group";import{Circle as Te}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 Ce}from"konva/lib/shapes/Text";import{Path as In}from"konva/lib/shapes/Path";import{Image as Mn}from"konva/lib/shapes/Image";import{Shape as Pn}from"konva/lib/Shape";var Ct=1.12;function li(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 G(s,t.min,t.max)}function Ts(i,e,t,s){let o=G(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=G(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 fr(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var Is=new Map;function mr(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 yr={dateStyle:"medium",timeStyle:"short"};function xs(i,e={}){let{locale:t,...s}=e,o=fr(i);if(!Number.isFinite(o))return"";let r=Object.keys(s).length?s:yr;return mr(t,r).format(o)}var Xa="USD",$a=["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 ci(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 gr(i="USD"){try{return It(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function br(i,e="USD"){return i/10**gr(e)}function Ya(i,e="USD",t){return ci(br(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 $e={"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.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.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.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 Sr=["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"],el={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"],vr=new Set(["ar","fa","he"]),hi={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"},di=new Map(Sr.map(i=>[i.toLowerCase(),i]));function kr(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=di.get(e)??hi[e];if(t)return t;let s=e.split("-");if(s.length>=2){let o=`${s[0]}-${s[1]}`,r=di.get(o)??hi[o];if(r)return r}return di.get(s[0])??hi[s[0]]}var ve={en:$e},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=kr(s);if(o)return o}return"en"}function tl(){return se}function il(i=se){return vr.has(i)?"rtl":"ltr"}function sl(i){return!!ve[i]}function Ee(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 ol(i){Mt=i}var Ds=/\{(\w+)\}/g;function U(i,e){let t=Mt[i]??ve[se]?.[i]??$e[i]??i;return e?t.replace(Ds,(s,o)=>String(e[o]??`{${o}}`)):t}function rl(i,e,t){let s=new Intl.PluralRules(se).select(e);return(Mt[`${i}.${s}`]??ve[se]?.[`${i}.${s}`]??$e[`${i}.${s}`]??Mt[`${i}.other`]??ve[se]?.[`${i}.other`]??$e[`${i}.other`]??i).replace(Ds,(n,a)=>String({count:e,...t}[a]??`{${a}}`))}function nl(i,e){return xs(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:se})}var Ye=9,ke=.9,ne=.55*ke,ae=J/pe,qe=4,Pt=14,_s=10,Os=14,ye=.45*ke,Ae=.9*ke,Gs=Math.max(ke*1.1,Ae),we=8,Hs=700,Z=2,Ns=J,pi=.85,Vs=J,Ue=64,Be=.55*ye,ui=700,zs=2500,xt=-11.5,Ze=.58,Ws=320,Rt=650,Ks=1,Et=1,fi=16,Qe=12,Xs=[.85,.72,.62],At=15,Bt=12,mi="600",yi="500",je=640;function gi(i){return Math.min(1,Math.max(Qe/fi,i/900))}function Ft(i,e){return Math.max(Qe,i*gi(e))}var $s=.1;import{Shape as Lr}from"konva/lib/Shape";import{Circle as Tr}from"konva/lib/shapes/Circle";import{Rect as Cr}from"konva/lib/shapes/Rect";var wr={M:2,L:2,Q:4,C:6,Z:0},bi=new Map;function Si(i){let e=bi.get(i);if(e)return e;let t=Lt(i);if(!t)return bi.set(i,[]),[];let s=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<s.length;){let n=s[r++],a=wr[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 bi.set(i,o),o}function Ys(i,e,t,s=0,o=0){let r=Si(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 qs(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var Je=class extends Lr{_sceneFunc(e){let t=this.attrs.seatRadius||1,s=this.attrs.seatGlyph,o=Si(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){qs(e,t),e.fillStrokeShape(this);return}e.beginPath(),Ys(e,s,t),e.fillStrokeShape(this)}_hitFunc(e){qs(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function Ir(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 Us(i){let{x:e,y:t,radius:s}=i;return i.wheelchairBay?new Cr({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}):Ir(i.glyph,{x:e,y:t,radius:s,detail:i.detail,fill:i.fill})??new Tr({x:e,y:t,radius:s,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Mr(i,e){return i*2*e>=16}function Zs(i,e,t,s){let o=Mr(e,t);if(o===s||!i.length)return o;for(let r of i)r.setAttr("seatGlyphDetail",o);return o}var Pr="#e5e7eb",xr="#c7cbd1",Rr="#595f69",Er="#d1d5db",Ar="#b8bdc4",Br="#273142",Fr="#526078",Dr="#f1f5f9",_r="#374151",Or="#64748b",vi="#111827",Dt="#6b7280",Fe="#374151",Qs="#4b5563",js="#4b5563",Js=.4,De=.16,eo="rgba(244,246,248,0.06)",_t=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function le(i){return Ke(i)?{sectionFill:Pr,sectionStroke:xr,sectionInk:Rr,focalFill:Er,focalStroke:Ar}:{sectionFill:Br,sectionStroke:Fr,sectionInk:Dr,focalFill:_r,focalStroke:Or}}function _e(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 ro=.5,H=Math.SQRT1_2,Gr="#f3f4f6",to=4;function Hr(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?ro:Math.min(1,Math.max(0,e))}function Nr(i){return i==="booked"||i==="not_for_sale"?Fe:Dt}function io(i,e){return Number.parseInt(i.slice(e,e+2),16)}function so(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 Vr(i,e,t){let s=so(i),o=so(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(io(s,a)*(1-r)+io(o,a)*r);n+=l.toString(16).padStart(2,"0")}return n}function oo(i,e,t,s){let o=t*4,r=e*H,n=-e*H,a=s*H*2*o,l=s*-H*2*o,c=r+o*H,h=n+o*H,u=r-o*H,p=n-o*H;i.beginPath(),i.moveTo(c,h),i.lineTo(u,p),i.lineTo(u+a,p+l),i.lineTo(c+a,h+l),i.closePath(),i.clip()}function zr(i,e){let t=e*4,s=Math.max(e*.45,1);i.beginPath();for(let o=-to;o<=to;o++){let r=o*s*2,n=r+s,a=r*H,l=-r*H,c=n*H,h=-n*H;i.moveTo(a+t*H,l+t*H),i.lineTo(a-t*H,l-t*H),i.lineTo(c-t*H,h-t*H),i.lineTo(c+t*H,h+t*H),i.closePath()}i.clip()}function Ot(i,e){i._sceneFunc(e)}function no(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,Ot(e,i),t.fill=o;return}let l=(1-2*(t.markFraction??ro))*s;i.save(),oo(i,l,s,1),t.fill=t.markBase??o,Ot(e,i),i.restore(),i.save(),oo(i,l,s,-1),t.fill=t.markFill??o,Ot(e,i),t.markHatch&&(zr(i,s),t.fill=Gr,Ot(e,i)),i.restore(),t.fill=o}function Wr(i,e,t,s,o,r){let n=Hr(e),a=Nr(t),l=i.attrs;l.markFraction=n,l.markBase=s,l.markFill=a,l.markMidtone=Vr(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(no)}function Kr(i){i.setAttr("sceneFunc",void 0)}function Xr(i){return i.attrs.sceneFunc===no}var Gt=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){Xr(e)&&Kr(e);return}Wr(e,l,s,o,r,n)}};function $r(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 Oe=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),$r(e,r)&&s++);return s}keys(e){let t=Math.floor(e.x/Ue),s=Math.floor((e.x+Math.max(0,e.width))/Ue),o=Math.floor(e.y/Ue),r=Math.floor((e.y+Math.max(0,e.height))/Ue),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 Ht(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 Nt(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 u=e*(h/6-.5),p=t*(c/4-.5),m={x:i.x+u*a-p*l,y:i.y+u*l+p*a};if(!te(m,o,r))return!1}return!0}function ao(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 Yr}from"konva/lib/Group";import{Shape as qr}from"konva/lib/Shape";function Ur(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 Ge(i,e,t,s){let o=Xe(i)>0,r=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new qr({...t,sceneFunc(n,a){n.beginPath();let l=h=>{if(h.length){if(r>0&&h.length>=3)return Ur(n,h,r);n.moveTo(h[0].x,h[0].y);for(let u=1;u<h.length;u+=1)n.lineTo(h[u].x,h[u].y);n.closePath()}};s?(h=>{n.moveTo(h.start.x,h.start.y);let u=h.start;for(let p of h.segments)p.kind==="line"?n.lineTo(p.end.x,p.end.y):p.kind==="arc"?n.arc(p.center.x,p.center.y,p.radius,Math.atan2(u.y-p.center.y,u.x-p.center.x),Math.atan2(p.end.y-p.center.y,p.end.x-p.center.x),!p.clockwise):n.bezierCurveTo(p.control1.x,p.control1.y,p.control2.x,p.control2.y,p.end.x,p.end.y),u=p.end;n.closePath()})(s):l(i);for(let h of e??[]){let u=Xe(h)>0;l(u===o?[...h].reverse():h)}n.fillStrokeShape(a)},perfectDrawEnabled:!1})}var et=class extends Yr{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 Vt=class{constructor(e){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.host.cancelGlide();let t=this.toLocal(e);if(this.pointers.set(e.pointerId,t),this.pointers.size===1)this.movedPx=0,this.pinch=null,this.panStart=t,this.panStarted=!1,this.host.marqueeShouldStart(e)?(this.host.beginMarquee(t),this.panLast=null):this.panLast=t;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee();let[s,o]=[...this.pointers.values()],r={x:(s.x+o.x)/2,y:(s.y+o.y)/2},n=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(o.x-s.x,o.y-s.y),startScale:n,worldMid:{x:(r.x-this.host.stage.x())/n,y:(r.y-this.host.stage.y())/n}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+1}};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;e.preventDefault();let t=this.toLocal(e);if(this.pointers.set(e.pointerId,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),this.host.marqueeActive()){this.host.updateMarquee(t);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[s,o]=[...this.pointers.values()],r=Math.hypot(o.x-s.x,o.y-s.y);if(this.pinch.startDist<1)return;let n={x:(s.x+o.x)/2,y:(s.y+o.y)/2},{min:a,max:l}=this.host.zoomBounds(),c=G(this.pinch.startScale*(r/this.pinch.startDist),a,l);this.host.stage.scale({x:c,y:c}),this.host.stage.position({x:n.x-this.pinch.worldMid.x*c,y:n.y-this.pinch.worldMid.y*c}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(t.x-this.panLast.x),y:this.host.stage.y()+(t.y-this.panLast.y)}),this.panLast=t,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}};this.onPointerEnd=e=>{if(this.host.marqueeActive()){this.host.finishMarquee(),this.pointers.delete(e.pointerId),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e.pointerId),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())};this.host=e}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})}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)}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){let t=this.host.container.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}};import{Circle as Zr}from"konva/lib/shapes/Circle";import{Group as Qr}from"konva/lib/Group";import{Text as jr}from"konva/lib/shapes/Text";var lo=13,Jr=15,en=.3,tn=.08;function uo(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function sn(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?U("map.soldOut"):U("map.seatsLeft",{count:i.available})}function on(i,e){return e&&i.available!=null&&i.available<=0}function fo(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),s=i.overviewHidden(e),o=on(e,i.pickerMode),r=i.pickerMode?e.selected??0:0;e.polygon.opacity(s?0:i.dimmed(e.categoryKey)?Se*tn:o?Se*en: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),rn(i,e,o,r,s,i.dimmed(e.categoryKey))}}function rn(i,e,t,s,o,r){if(e.capacityNode){let n=sn(e,i.pickerMode);e.capacityNode.text()!==n&&(e.capacityNode.text(n),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}nn(i,e,o||r),s>0&&!o?ln(i,e,s):e.chip&&e.chip.visible(!1)}var ki=9,co=.86;function nn(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=an(e,r),a=ho(s,yt,n.width*co,r),l=ho(o,gt,n.width*co,r),c=a!=null,h=l!=null&&c&&a+l+ki<=n.height;po(s,c?a:null,e.labelPoint.y-ki/r,r),po(o,h?l:null,e.labelPoint.y+ki/r,r)}function an(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 ho(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 po(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 ln(i,e,t){if(!e.chip){let s=new Qr({x:e.labelPoint.x,y:e.labelPoint.y-lo-16,listening:!1}),o=new Zr({radius:lo,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),r=new jr({text:String(t),fontSize:Jr,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 mo(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 yo(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function go(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 bo(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}import{Rect as So}from"konva/lib/shapes/Rect";import{Text as cn}from"konva/lib/shapes/Text";function vo(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 y=i.circleById.get(d.id),b=i.boothLabelById.get(d.id)??i.seatLabelById.get(d.id),v=i.viewMode==="perspective"?i.perspectiveSeatScale.get(d.id)??1:1,w=(i.viewMode==="perspective"?t:e)*v,k=d.kind==="booth"?xe:pe*i.seatLabelScale(d),S=i.viewMode==="perspective"&&d.kind!=="booth"?e*v:w,L=o((b?.fontSize()??k)*S),M=i.worldToScreen(d),C=b?b.width()*t*v:0,I=b?b.height()*(i.viewMode==="perspective"&&d.kind==="booth"?t:e)*v:0,P=M.x-C/2<0||M.x+C/2>s.width||M.y-I/2<0||M.y+I/2>s.height,R=i.focusedSeatOpacity(d.id,y?.getAbsoluteOpacity()??0),T=i.seatSection.get(d.id),x=!!b?.isVisible()&&R>=.5&&!P,E;x||(R<.5?E="dimmed-or-unavailable":L<J?E="below-minimum-size":P?E="outside-viewport":b?E="renderer-hidden":E="clutter-or-fit");let B=y instanceof So?y.width()*t*v:i.seatR*2*w,W=y instanceof So?y.height()*(i.viewMode==="perspective"?t:e)*v:i.seatR*2*w,z=2*(i.seatR*w+Pt),V=y?.fill(),j=b?.fill(),F=i.accessGlyphById.get(d.id),_=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,...T?{sectionId:T.id}:{},...T?.zone?{zoneId:T.zone}:{},status:i.statusById.get(d.id)??"free",selected:i.selection.has(d.id),visible:x,renderedFontPx:L,fill:typeof V=="string"?V:"",ink:typeof j=="string"?j:y?i.seatLabelInk(d,y):i.seatPreferredLabelInk(d),...r.has(d.id)?{selectionRingColor:r.get(d.id)}:{},opacity:o(R),...F?{accessibilityMarker:{glyphVisible:F.isVisible(),glyphWidthPx:o(re*Math.abs(_?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(d.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(d.id)&&!!y?.isVisible()&&!!y?.isListening()&&i.isSelectable(d.id),directWidthPx:o(B),directHeightPx:o(W),effectiveMinimumPx:o(Math.max(Math.min(B,W),z))},screenCenter:{x:o(M.x),y:o(M.y)},...x?{screenBox:{x:o(M.x-C/2),y:o(M.y-I/2),width:o(C),height:o(I)}}:{},...E?{hiddenReason:E}:{}}}),a=n.filter(d=>d.visible).length,l=(d,y,b,v,w,k)=>{let S=Ht({x:v.x(),y:v.y()},v.width(),v.height(),v.rotation()),L=k&&k.liftWorld>0?i.isoLiftLocal(k.liftWorld):{x:0,y:0},M=K(S.map(x=>i.worldToScreen({x:x.x+L.x,y:x.y+L.y}))),C=o(v.opacity()),I=v.fill(),P=M.x+M.width<0||M.x>s.width||M.y+M.height<0||M.y>s.height,R=v.isVisible()&&C>.05&&!P,T=k?Nt({x:v.x(),y:v.y()},v.width(),v.height(),v.rotation(),k.outline,k.holes):void 0;return{id:d,kind:y,role:b,label:v.text(),visible:R,renderedFontPx:o(v.fontSize()*t),opacity:C,fill:w,ink:typeof I=="string"?I:"",...T==null?{}:{fitsContainer:T},...R?{screenBox:{x:o(M.x),y:o(M.y),width:o(M.width),height:o(M.height)}}:{}}},c=[...i.sections.map(d=>{let y=d.blockPoly.fill();return l(d.id,"section","name",d.nameLabel,typeof y=="string"?y:d.baseFill,d)}),...i.sections.map(d=>{let y=d.blockPoly.fill();return l(`${d.id}:availability`,"section","availability",d.subLabel,typeof y=="string"?y: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,y])=>{let b=y.points.map(P=>i.worldToScreen(P)),v=Math.min(...b.map(P=>P.x)),w=Math.min(...b.map(P=>P.y)),k=Math.max(...b.map(P=>P.x)),S=Math.max(...b.map(P=>P.y)),L=k<0||v>s.width||S<0||w>s.height,M=o(y.polygon.opacity()),C=M>=.1&&!L,I=y.polygon.fill();return{areaId:d,label:y.label,capacity:y.capacity,categoryKey:y.categoryKey,...y.sectionId?{sectionId:y.sectionId}:{},visible:C,interactive:y.polygon.listening(),opacity:M,fill:typeof I=="string"?I:"",effectiveBackground:y.effectiveBackground,...C?{screenBox:{x:o(v),y:o(w),width:o(k-v),height:o(S-w)}}:{}}}),u=[...i.freeTextById].map(([d,y])=>{let{node:b,background:v,kind:w}=y,k=i.worldToScreen({x:b.x(),y:b.y()}),S=b.width()*t,L=b.height()*e,M=k.x-b.offsetX()*t,C=k.y-b.offsetY()*e,I=o(b.fontSize()*e),P=M+S<0||M>s.width||C+L<0||C>s.height,R=b.isVisible()&&!P,T=b.fill(),x=o(b.getAbsoluteOpacity()),E;return R||(I<J?E="below-minimum-size":P?E="outside-viewport":E="renderer-hidden"),{objectId:y.objectId??d,kind:w,text:b.text(),visible:R,renderedFontPx:I,ink:typeof T=="string"?T:"",background:v,opacity:x,...R?{screenBox:{x:o(M),y:o(C),width:o(S),height:o(L)}}:{},...E?{hiddenReason:E}:{}}}),p=i.labelGroup.find(d=>d.getAttr("rowLabel")===!0).filter(d=>d instanceof cn).map(d=>{let y=d.getClientRect({skipShadow:!0,skipStroke:!0}),b=y.x+y.width<0||y.x>s.width||y.y+y.height<0||y.y>s.height,v=d.fill();return{text:d.text(),visible:d.isVisible()&&!b,renderedFontPx:o(d.fontSize()*e),ink:typeof v=="string"?v:"",...b?{}:{screenBox:{x:o(y.x),y:o(y.y),width:o(y.width),height:o(y.height)}}}}),m=le(i.canvasBackground),f=new Set(["normal","nearly-gone","sold-out","closed"].map(d=>_e(m,d).toLowerCase())),g=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,y)=>d+y.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:g.length,categoryPaintedSectionShells:g.filter(d=>{let y=d.blockPoly.fill();return typeof y!="string"||!f.has(y.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:u,rowLabels:p}}import{Circle as hn}from"konva/lib/shapes/Circle";import{Ellipse as dn}from"konva/lib/shapes/Ellipse";import{Line as Co}from"konva/lib/shapes/Line";import{Arrow as pn}from"konva/lib/shapes/Arrow";import{Path as un}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 fn}from"konva/lib/shapes/Image";function wi(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}var zt="#0b1220",tt="#ffffff",ko="#0b1220",wo="#232c40",Lo="#8b93a7";function To(i,e,t="normal"){let s=i?"bold":t;return e?`italic ${s}`.trim():s}var Li="#f7f8fb";function Io(i,e){let t=new window.Image,s=new fn({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(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 Mo(i,e){if(e.shape==="round")i.bgLayer.add(new hn({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 Po(i,e){let t=e.background?.color??i.canvasBackground,s=e.color??i.theme.textColor??Lo,o=e.semanticKind==="icon"?us(e.iconKey):void 0;if(o){let c=e.fontSize/24,h=new un({x:e.position.x,y:e.position.y,data:o,rotation:e.rotation,scaleX:c,scaleY:c,stroke:Y(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:To(e.bold,e.italic,"600"),fill:Y(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 xo(i,e){let t=e.fill??i.theme.decorFill??wo,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),u=e.opacity!=null?G(e.opacity,.1,1):1,p=0,m=0;if(l&&e.points&&e.points.length>=2){p=e.points.reduce((y,b)=>y+b.x,0)/e.points.length,m=e.points.reduce((y,b)=>y+b.y,0)/e.points.length;let f=fs(e),g=ms(h),d=new pn({points:e.points.flatMap(y=>[y.x,y.y]),closed:!1,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:c,fill:c,strokeWidth:h,opacity:u,lineCap:f.lineCap,lineJoin:f.lineJoin,pointerAtBeginning:f.startEnding==="arrow",pointerAtEnding:f.endEnding==="arrow",...g,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};p=e.x+e.width/2,m=e.y+e.height/2,i.bgLayer.add(new Ti({x:p,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:G(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,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;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 dn({x:p,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...f,stroke:c,strokeWidth:h,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let f=e.points.flatMap(y=>[y.x,y.y]),g=K(e.points);p=e.points.reduce((y,b)=>y+b.x,0)/e.points.length,m=e.points.reduce((y,b)=>y+b.y,0)/e.points.length;let d=s?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,de(a,.3),1,me(a,.12)]}:{fill:a};i.bgLayer.add(new Co({points:f,closed:!0,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,...d,stroke:c,strokeWidth:h,opacity:u,listening:!1}))}for(let f of gs(e))i.bgLayer.add(new Co({points:f.points.flatMap(g=>[g.x,g.y]),closed:f.closed,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:f.ink??ys,fill:f.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(s){let f=mn(i,p,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,p,m,o?Y(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,p,m,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:f,background:a,kind:"decor"})}}function mn(i,e,t,s,o){let r=Y(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 Ro(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",s=i.canvasBackground,o=ts(t,s,Se),r=i.theme.textColor??"#e6e9f0",n=Y(o,r),a=Ge(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",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=pt(e.points,e.holes),c=i.sections.find(p=>te(l,p.outline,p.holes)),h=it(i,i.bgLayer,e.displayLabel??e.label,l.x,l.y-8,n,yt,!1),u=it(i,i.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,n,gt,!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:u,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:u,...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 Eo(i,e){let t=[],s=e.theme.background??"#f7f8fb",o=new Map,r=(c,h)=>{let u=o.get(c)??[];u.push(h),o.set(c,u)};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 u=h?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(u?.visible===!1||u?.positionPreset==="none")continue;let p=c.segmentedRow&&!h?c.segmentedRow.groupId:c.id,m=(o.get(p)??[]).slice().sort((x,E)=>n(x)-n(E));if(!m.length)continue;let f=m[0],g=m[m.length-1],d=u?.labelStyle,y=Y(s,d?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",St),b=d?.size??es,v=u?.rotation??0,w=e.objectFilteredOut(c)?.15:1,k=e.seatSection.get(f.id),S=c.segmentedRow?.displayLabel??c.displayLabel,L=k?.label.trim(),M=L&&c.label.toLocaleLowerCase("en-US").startsWith(`${L.toLocaleLowerCase("en-US")} `)?c.label.slice(L.length).trim():"",C=S??(/^[\p{L}\p{N}]{1,4}$/u.test(M)?M:c.label),I=k?[...new Set([k.id,k.logicalId,k.zone].filter(x=>!!x))]:void 0,P=(x,E,B)=>t.push({text:C,x,y:E,rotation:v,fontSize:b,ink:y,opacity:w,...I?.length?{focusKeys:I}:{},...B?{automaticAway:B}:{}});if(u?.position){P(u.position.x,u.position.y);continue}let R=e.seatR+12,T=u?.positionPreset??"start";if(T==="start"||T==="both"){let x=c.rotation*Math.PI/180,E={x:-Math.cos(x),y:-Math.sin(x)};P(f.x+E.x*R,f.y+E.y*R,E)}if(T==="end"||T==="both"){let x=(c.rotation+c.curve)*Math.PI/180,E={x:Math.cos(x),y:Math.sin(x)};P(g.x+E.x*R,g.y+E.y*R,E)}}let a=(e.seatR+12)*2.2,l=[];for(let c of t){let h=l.find(u=>u.text===c.text&&Math.hypot(u.x-c.x,u.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=Z){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 Ao(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 p=1;p<=4;p++){let m=a*p;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,u=1/0;for(let p of l){let m={x:o.x+p.x,y:o.y+p.y},f=Ii(i,m),d=(s?vt(s,f,{mode:"overlap"}).length:0)+t.collisionCount(f),y=Math.hypot(p.x,p.y);if((d<h||d===h&&y<u)&&(c=m,h=d,u=y),d===0)break}return c}function Bo(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*$s?"nearly-gone":"normal"}function Fo(i,e){let t=Pi(i,e);e.blockPoly.fill(_e(le(i.canvasBackground),t)),e.subLabel.text(t==="sold-out"?U("map.soldOut"):U("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Do(i,e){let t,s;i.reducedMotion?(t=e<=ye?1:0,s=e<=Be?1:0):(t=G((Ae-e)/(Ae-ye),0,1),s=G((ye-e)/(ye-Be),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=G((t-.2)/.8,0,1);for(let p of i.sections){let m=i.hasFocusDimOverlay?1:l&&p.id!==l&&p.logicalId!==l&&p.zone!==l?De:1,f=Math.min(m,bo(p.memberCategoryKeys,i.categoryFilter)?De:1);p.outlinePoly.opacity(o?0:(1-t)*f),p.blockPoly.opacity(Ks*t*f),p.blockPoly.stroke(c.sectionStroke),p.blockPoly.strokeWidth(Et/Math.max(n,1e-4));let g=p.blockPoly.fill(),d=Y(typeof g=="string"?g:p.baseFill,p.preferredInk);p.nameLabel.fill(d),p.subLabel.fill(d),a&&h>.01&&bn(i,p,n),p.nameLabel.opacity(p.nameLabelFits?h*(1-s)*f:0),p.subLabel.opacity(0)}let u=s*(1-i.isoT);for(let p of i.zones)p.back.opacity(u),p.label.opacity(u),p.sub&&p.sub.opacity(i.stageWidth<je?0:u),a&&Sn(i,p,n);if(!i.glideInProgress&&(h>.01||u>.01)){gn(i,n),yn(i.sections);for(let p of i.zones){let m=p.label.opacity();p.back.opacity(m),p.sub&&p.sub.opacity(i.stageWidth<je?0:m)}}i.bgLayer.batchDraw()}function yn(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 gn(i,e){let s=[],o=a=>{let l=i.worldToScreen({x:a.x(),y:a.y()}),c=K(Ht({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 u of Xs){let p=c*u;if(p*e<Qe)break;st(a.node,p,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 bn(i,e,t){e.subLabelFits=!1;let s=Ft(fi*e.labelScale,i.stageWidth),o=Qe;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(Nt(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 Sn(i,e,t){let s=gi(i.stageWidth),o=e.sub!=null&&i.stageWidth>=je,r=i.stageWidth<je,n=(r?7:10)*s/t,a=(r?4:6)*s/t,l=o?3*s/t:0;st(e.label,Ft(At,i.stageWidth)/t,e.anchor.y),e.label.x(e.anchor.x),o&&st(e.sub,Ft(Bt,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 u=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 f=m/2,d=(G(u.x,p+f,i.stageWidth-p-f)-u.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 y=62+h*t/2;if(u.y<y){let b=(y-u.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 vn}from"konva/lib/Group";import{Line as _o}from"konva/lib/shapes/Line";import{Rect as kn}from"konva/lib/shapes/Rect";import{Text as Oo}from"konva/lib/shapes/Text";function wn(i,e){return i>=ae||e&&i>=pi}function Ln(i,e,t){return t&&e>=pi?Math.max(i,Vs/Math.max(e,1e-4)):i}function Tn(i,e){return Math.max(1,i*2-(e?1:3))}function Go(i){let e=i.exportMode?Math.max(i.effScale(),ae):i.effScale(),t=wn(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(ue(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),u=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 y=new vn({x:h.x,y:h.y,listening:!1});if(y.scale({x:u,y:u}),c==="held"?(y.add(new kn({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),y.add(new _o({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}))):y.add(new _o({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1})),i.seatLabelContainer(n.id).add(y),++o>=ui)break;continue}let m=i.seatMatchesFocus(n.id),f=Ln(pe*i.seatLabelScale(n),e,m),g=new Oo({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=Tn(i.seatR,m);if(g.width()>d&&g.fontSize(Math.max(qe,f*d/g.width())),g.width()>d+.01){g.destroy();continue}if(!ue(g.fontSize(),e)){g.destroy();continue}if(g.offsetX(g.width()/2),g.offsetY(g.height()/2),g.scale({x:u,y:u}),i.seatLabelContainer(n.id).add(g),!s(g)){g.destroy();continue}if(i.seatLabelById.set(n.id,g),++o>=ui)break}let r=new Oe;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-Z,y:a.y-Z,width:a.width+Z*2,height:a.height+Z*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&&!ue(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 Oo({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 u=i.resolveAutomaticRowLabelPosition(h,n,r);h.position(u),h.setAttr("rowLabel",!0),i.labelGroup.add(h);let p=h.getClientRect({skipShadow:!0,skipStroke:!0}),m=6,f=p.x<m?m-p.x:p.x+p.width>i.stage.width()-m?i.stage.width()-m-p.x-p.width:0,g=p.y<m?m-p.y:p.y+p.height>i.stage.height()-m?i.stage.height()-m-p.y-p.height:0,d=u;if(f||g){let b=i.labelGroup.getAbsoluteTransform(),v=b.point(u);d=b.copy().invert().point({x:v.x+f,y:v.y+g}),h.position(d)}let y=i.rowLabelBox(h,d);if(n.automaticAway&&r.collisionCount(y)>0){h.destroy();continue}r.insert(y)}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-Ze)*i.isoT}}function Ho(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 No(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 Vo(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 zo(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 Wo(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 Ko(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 Xo(i,e,t){return i.perspectiveAffine?ie(i.perspectiveAffine,e):ie(t,e)}function $o(i,e){return e?ie(e,i):i}function Yo(i,e){let t=0;for(let u of i.seats){let p=Math.max(0,(u.eyeHeightM??q)-q);t=Math.max(t,p*Pe)}for(let u of i.objects)u.type==="section"&&(t=Math.max(t,dt(u,{floorBaseHeightM:i.floorBaseHeightMFor(u.id)}).height*Pe));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 u of i.seats){let p=Math.max(0,(u.eyeHeightM??q)-q),m=fe(s,u,p*Pe),f={x:m.x,y:m.y};e.seatProjected.set(u.id,f),e.seatLocal.set(u.id,ie(r,f)),e.seatDepth.set(u.id,m.depth),e.seatScale.set(u.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 u 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=fe(s,u,0);n=Math.min(n,p.x),a=Math.min(a,p.y),l=Math.max(l,p.x),c=Math.max(c,p.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 qo(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 u=i.seatR*1.5/re;c.position(r),c.scale({x:u*n,y:u*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 Gt;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.fitScale=1;this.seatR=Ye;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 Cn({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Vt(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",U("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 Le({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new Le({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.hoverRing=new Te({radius:Ye+2,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Te({radius:Ye+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??ut(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=G(this.theme.seatScale??1,.7,1.6)*Ye,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,_t[r%_t.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 Le({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:Re(e)};if(this.floorOverview&&e.floors.length>=2)return{...qi(e)?Ui(e):Yi(e),referenceImage:void 0,backgroundImage:Re(e)};if(this.stacked&&e.floors.length>=2)return{...$i(e),referenceImage:void 0,backgroundImage:Re(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:Re(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?ut(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?ut(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=si([...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<=zs;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 Te({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 u=Math.min(1,(h-a)/l);r.radius(this.seatR*(1+u*1.8)),r.opacity(.9*(1-u)),this.overlayLayer.batchDraw(),u<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(p=>this.perspectiveLocalPoint(this.projectedSectionPoint(o,p))):o.outline.map(p=>{let m=o.liftWorld>0?this.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:p.x+m.x,y:p.y+m.y}}),n=r.reduce((p,m)=>({x:p.x+m.x,y:p.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(p=>[p.x-n.x,p.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,u=p=>{if(this.destroyed||!a.getLayer())return;let m=Math.min(1,(p-c)/h),g=1+(1-Math.pow(1-m,3))*.04;a.scale({x:g,y:g}),a.opacity(.92*(1-m)),this.overlayLayer.batchDraw(),m<1?requestAnimationFrame(u):l()};requestAnimationFrame(u)}}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,u=c*t.x+h*t.y;if(u<=.5)continue;let p=Math.abs(c*t.y-h*t.x),m=u+p*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.focusRegion(this.focusedSectionId,{animate:!1});return}this.zoomToFit()}zoomIn(){this.zoomAbout(this.stage.scaleX()*at.ZOOM_STEP,li(this.stage))}zoomOut(){this.zoomAbout(this.stage.scaleX()/at.ZOOM_STEP,li(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(!yo(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(){fo({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=>uo(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<ne,effScale:()=>this.effScale(),labelLegible:e=>ue(e,this.effScale())})}setGAStates(e){mo(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,t){this.setGAStates({[e]:t})}focusCategories(e){if(!e?.length){this.focusRegion(this.bounds,{durationMs:Rt});return}let t=new Set(e),s=this.seats.filter(h=>!t.has(h.categoryKey)||this.seatInClosedSection(h.id)?!1:(this.statusById.get(h.id)??"free")==="free"||this.ownedHold.has(h.id));if(!s.length)return;let o=go(s.map(h=>h.id),this.seatSection);o&&this.focusSection(o);let r=1/0,n=-1/0,a=1/0,l=-1/0;for(let h of s){let u=this.renderedSeatPoint(h);r=Math.min(r,u.x),n=Math.max(n,u.x),a=Math.min(a,u.y),l=Math.max(l,u.y)}let c=Math.max(24,this.seatR*3);r-=c,n+=c,a-=c,l+=c,this.focusRegion({x:r,y:a,width:Math.max(40,n-r),height:Math.max(40,l-a)},{durationMs:Rt})}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)/Ws),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-Ze)*this.isoT)}isoForward(e){return Ho(e,this.isoState)}isoInverse(e){return No(e,this.isoState)}buildPerspectiveProjection(e){let t=Yo({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){zo(e,t,s)}resetContainerTransform(e){Wo(e)}sectionSurfaceHeight(e,t){return Ko(e,t)}projectedSectionPoint(e,t){return Xo(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return $o(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return Vo(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){qo(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=u=>this.sectionSurfaceHeight(a,u),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 u=0;u<a.sideFaces.length;u++){let p=a.outline[u],m=a.outline[(u+1)%a.outline.length],f=this.perspectiveLocalPoint(fe(t,p,0)),g=this.perspectiveLocalPoint(fe(t,m,0)),d=this.perspectiveLocalPoint(fe(t,m,l(m))),y=this.perspectiveLocalPoint(fe(t,p,l(p)));a.sideFaces[u].points([f.x,f.y,g.x,g.y,d.x,d.y,y.x,y.y]),a.sideFaces[u].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,u=l,p=c/l,m=(o*n+r*a)/c,f=this.isoCentre;for(let g of[this.bgLayer,this.seatLayer,this.overlayLayer])g.position({x:f.x,y:f.y}),g.offset({x:f.x,y:f.y}),g.rotation(h),g.scaleX(u),g.scaleY(p),g.skewX(m),g.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-Ze)*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:De)}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=Us({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 Te({x:t.x,y:t.y,radius:this.seatR+1.5,stroke:ei(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")&&oi(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 Ce({x:o,y:r,text:e.displayLabel??e.label,fontSize:xe,fontStyle:"600",fontFamily:this.labelFont(),fill:this.theme.seatLabelColor??zt,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 In({x:e.x,y:e.y,data:oi(e.accessibility??[])??"",offsetX:re/2,offsetY:re/2,scaleX:s,scaleY:s,fill:ri(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)??_t[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??zt}seatLabelInk(e,t){let s=t.fill();return Y(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(Dt);break;case"booked":this.colorblind?(e.fill("rgba(0,0,0,0)"),e.stroke(Fe),e.strokeWidth(1.5),e.opacity(.9)):(e.fill(Fe),e.opacity(.45));break;case"not_for_sale":e.fill(Fe),e.stroke(Qs),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(ei(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??zt:"#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(js),e.stroke(""),e.strokeWidth(0),e.dash([]),e.opacity(Js)),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(ue(l.fontSize(),this.effScale())&&e.opacity()>=.5));let c=this.accessGlyphById.get(t);if(c){let h=e.fill();c.fill(ri(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.focusRegion(e))}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 Le({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(Ge(n,a,{fill:eo,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 Pn({fill:this.canvasBackground,opacity:1-De,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(u=>this.perspectiveLocalPoint(this.projectedSectionPoint(c,u))):c.outline.map(u=>{let p=c.liftWorld>0?this.isoLiftLocal(c.liftWorld):{x:0,y:0};return{x:u.x+p.x,y:u.y+p.y}});l(Xe(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=Re(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)),u=new Mn({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(u),u.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){Io(this.objectDrawContext,e)}renderTable(e){Mo(this.objectDrawContext,e)}renderText(e){Po(this.objectDrawContext,e)}renderShape(e){xo(this.objectDrawContext,e)}renderGA(e){Ro(this.objectDrawContext,e)}renderSection(e){let t=pt(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(T=>this.seatById.get(T)).filter(T=>!!T):this.seats;for(let T of l)this.seatSection.has(T.id)||te(T,e.outline,e.holes)&&(o.push(T.id),r.set(T.categoryKey,(r.get(T.categoryKey)??0)+1),(this.statusById.get(T.id)??"free")==="free"&&n++);let c=e.color??si([...r].map(([T,x])=>({hex:this.catColor.get(T)??"#6e7bff",w:x})),"#3a4358"),h=Ki(e.elevation),u=dt(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),p=u.height*Pe,m=new Le({listening:!1});this.bgLayer.add(m);let f=new Le({listening:!1});m.add(f);let g=new et({listening:!0});this.seatLayer.add(g);let d=[];if(p>0){let T=de(this.zoneColor.get(e.zone??"")??c,.42);for(let x=0;x<e.outline.length;x++){let E=new nt({points:[],closed:!0,fill:T,stroke:oe("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});d.push(E),m.add(E)}}f.moveToTop();let y=f,b=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",v=Ge(e.outline,e.holes,{stroke:oe(b,.5),strokeWidth:1,fill:oe(b,.08),listening:!1},e.outlinePath);y.add(v);let w=Ge(e.outline,e.holes,{fill:s.sectionFill,stroke:s.sectionStroke,strokeWidth:Et,opacity:0,listening:!1},e.outlinePath);y.add(w);let k=e.labelPresentation?.labelStyle,S=k?.color??s.sectionInk,L=(k?.size??18)/18,M=new Ce({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*L,fontStyle:mi,fontFamily:this.labelFont(),fill:Y(s.sectionFill,S),listening:!1,perfectDrawEnabled:!1});M.offsetX(M.width()/2),M.offsetY(M.height()/2),y.add(M);let C=new Ce({x:t.x,y:t.y,text:U("map.seatsLeft",{count:n}),fontSize:12,fontStyle:yi,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:s.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});C.offsetX(C.width()/2),y.add(C);let I={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:ao(e.outline,e.holes??[],t),memberCategoryKeys:new Set(o.map(T=>this.seatById.get(T)?.categoryKey).filter(Boolean)),labelArea:zi(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:n,baseFill:c,outlineTint:b,outlinePoly:v,blockPoly:w,nameLabel:M,subLabel:C,preferredInk:S,labelScale:L,nameLabelFits:!1,subLabelFits:!0,elevation:h,liftWorld:p,rakeDeg:u.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:g.zIndex(),liftGroupBg:f,liftGroupSeat:g,sideFaces:d},P=o.map(T=>this.seatById.get(T)).filter(T=>!!T),R=P.length?P:e.outline;I.frontDistanceWorld=Math.min(...R.map(T=>Math.hypot(T.x-I.surfaceFocal.x,T.y-I.surfaceFocal.y)));for(let T of o)this.seatSection.set(T,I);this.refreshSectionFill(I),this.refreshSectionHeat(I),this.sections.push(I)}refreshSectionHeat(e){Bo(this.sectionLodPaintContext,e)}refreshSectionFill(e){Fo(this.sectionLodPaintContext,e)}isSectionClosed(e){return Mi(this.sectionLodPaintContext,e)}sectionAvailabilityState(e){return Pi(this.sectionLodPaintContext,e)}sectionBlockFill(e){return _e(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 p of o)p.centroid.y<r.centroid.y&&(r=p);let n=r.centroid.x,a=r.centroid.y,l=1/0;for(let p of o)for(let m of p.memberIds){let f=this.seatById.get(m),g=f&&this.catPrice.get(f.categoryKey);typeof g=="number"&&g<l&&(l=g)}let c=new rt({x:n,y:a,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:vi,stroke:s.color??r.outlineTint,strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});this.bgLayer.add(c);let h=new Ce({x:n,y:a,text:s.label.toUpperCase(),fontSize:At,fontStyle:mi,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 u=null;isFinite(l)&&(u=new Ce({x:n,y:a,text:U("map.fromPrice",{price:ci(l,this.currency)}),fontSize:Bt,fontStyle:yi,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:"#cbd5e1",opacity:0,listening:!1,perfectDrawEnabled:!1}),u.offsetX(u.width()/2),this.bgLayer.add(u)),this.zones.push({id:s.id,anchor:{x:n,y:a},back:c,background:vi,label:h,sub:u})}}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?ii(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let s=ii(getComputedStyle(t).backgroundColor);if(s)return s;t=t.parentElement}}return Li}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:Ke(this.canvasBackground)?ko: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=Y(typeof s=="string"?s:"",this.effSelection,St),r=this.selectionFocusId===e,n=this.boothDims.get(t.rowId),a=this.renderedSeatPoint(t),l=new Le({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),u=-Math.max(0,n.height/2-14);l.add(new Te({x:h,y:u,radius:10,fill:o,listening:!1})),l.add(new nt({x:h,y:u,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:Ke(o)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else l.add(new Te({...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 Te({...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(y=>this.projectedSectionPoint(f,y)));let g=f.liftWorld>0?this.isoLiftLocal(f.liftWorld):{x:0,y:0},d=f.outline.map(y=>{let b={x:y.x+g.x,y:y.y+g.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 g=this.seatById.get(f);if(!g)continue;let d=this.renderedSeatPoint(g);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 g={x:f.x+f.width/2,y:f.y+f.height/2};return t.some(d=>te(g,d.outline,d.holes))};for(let{node:f,backdrop:g}of this.freeTextById.values()){let d=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});h(d)&&(c(d),g&&c(g.getClientRect({relativeTo:this.bgLayer,skipShadow:!0})))}for(let{node:f}of this.iconNodeById.values()){let g=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});h(g)&&c(g)}let u=new Oe;for(let{node:f}of this.freeTextById.values()){let g=f.getClientRect({relativeTo:this.bgLayer,skipShadow:!0,skipStroke:!0});u.insert({x:g.x-Z,y:g.y-Z,width:g.width+Z*2,height:g.height+Z*2})}for(let f of this.rowLabelPlan){let g=(f.focusKeys??[]).some(v=>v===e||t.some(w=>v===w.id||v===w.logicalId)),d=new Ce({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 y=this.resolveAutomaticRowLabelPosition(d,f,u),b=this.rowLabelBox(d,y);g&&c(b),u.insert(b),d.destroy()}let p=Math.max(n-o,a-r),m=Math.max(this.seatR*2,Math.min(24,p*.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()*G(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,Be*.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=G(Math.max(c,t?.minScale??n),n,a),u=o/2-(s.x+s.width/2)*h,p=r/2-(s.y+s.height/2)*h,m=this.stage.scaleX(),f=this.stage.x(),g=this.stage.y();if(Math.abs(h-m)<1e-4&&Math.abs(u-f)<.5&&Math.abs(p-g)<.5){this.afterViewChange();return}let d=performance.now(),y=Math.max(180,Math.min(1200,t?.durationMs??Rt));this.glideInProgress=!0;let b=v=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let w=Math.min(1,(v-d)/y),k=w<.5?4*w*w*w:1-Math.pow(-2*w+2,3)/2,S=m+(h-m)*k;this.stage.scale({x:S,y:S}),this.stage.position({x:f+(u-f)*k,y:g+(p-g)*k}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),w<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<Be?"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 vo(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(ye+ne)/2:Math.max(this.seatLabelTargetScale()*1.05,Gs,ne*1.3),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 p=this.sections.map(d=>{let y=K(d.outline);return{x:y.x+y.width/2,y:y.y+y.height/2}}),m=s/(t*2),f=o/(t*2);if(!p.some(d=>Math.abs(d.x-n.x)<=m&&Math.abs(d.y-n.y)<=f)){let d=p.reduce((y,b)=>{let v=(b.x-n.x)**2+(b.y-n.y)**2;return v<y.distance?{point:b,distance:v}:y},{point:p[0],distance:1/0});a=d.point.x,l=d.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 f of c){let g=f.x-n.x,d=f.y-n.y,y=g*g+d*d;y<m&&(p=f,m=y)}a=p.x,l=p.y}let h=s/(t*1.12),u=o/(t*1.12);this.focusRegion({x:a-h/2,y:l-u/2,width:h,height:u})}seatLabelTargetScale(){let e=xe,t=new Ce({fontSize:pe,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,xe);continue}let r=pe*this.seatLabelScale(o);t.fontSize(r),t.text(bt(o.displayLabel??o.label));let n=t.width()>s?Math.max(qe,r*s/t.width()):r;e=Math.min(e,n)}return t.destroy(),J/Math.max(qe,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(),Ae+.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?Do(this.sectionLodPaintContext,e):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=Zs(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=G(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)||ue(t.fontSize(),e);t.visible(n),s?.visible(n)}for(let{node:t,fontSize:s}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||ue(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=Eo(e,{theme:this.theme,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,s=Z){return Ii(e,t,s)}resolveAutomaticRowLabelPosition(e,t,s){return Ao(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(){Go(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 Uo(i,e){return new Ei(i,e)}function Zo(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 Qo(i,e,t){return We(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 jo(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 Jo(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 er(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 Kt(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}var ge=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function tr(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var Xt=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 ir(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function sr(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 xn(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Rn(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=>xn(o.id)).sort((o,r)=>o-r);return s.some((o,r)=>o<0||r>0&&o!==s[r-1]+1)}function or(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")&&Rn(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 En=10,An=15e3,rr=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new Xt;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=ir(e.numberOfPlacesToSelect);let t=sr(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,En);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 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(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=We(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=S=>Math.round((performance.now()-S)*100)/100;this.closed=!1;let r,n=performance.now();try{r=await this.api.chart(this.key)}catch(S){return this.emitError(S),null}if(s.loadChart=o(n),this.closed)return null;this._doc=tr(r.doc,r.event.eventConfiguration),this.eventConfiguration.reset(r.event.eventConfiguration);let a=performance.now();try{let S=ks(r.doc,r.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(S.map(L=>[L.objectId,L])),this.groupedTablesByLabel=new Map(S.map(L=>[L.label,L])),this.groupedTableBySeatId=new Map(S.flatMap(L=>L.chairs.map(M=>[M.id,L]))),this.tableQuantities=new Map(S.map(L=>[L.label,L.mode==="whole"?L.capacity:L.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=S.reduce((L,M)=>L+Math.max(0,M.chairs.length-1),0)}catch(S){return this.emitError(S),null}this.labelToId=new Map,this.labelToSeat=new Map,this.seatById=new Map,this.seatContext=new Map,this.allIds=[];let l=new Map(Xi(r.doc).map(S=>[S.id,S])),c=ti(r.doc),h=new Map([...c.sections,...c.ungrouped?[c.ungrouped]:[]].map(S=>[S.id,S.label]));this.expandedSeats=ze(r.doc);for(let S of this.expandedSeats){this.labelToId.set(S.label,S.id),this.labelToSeat.set(S.label,S),this.seatById.set(S.id,S),this.allIds.push(S.id);let L=l.get(S.rowId),M=L&&"label"in L&&typeof L.label=="string"?L.label:void 0,C=L?.type==="row"?L.segmentedRow:void 0,I=C?.displayLabel??(L&&"displayLabel"in L&&typeof L.displayLabel=="string"&&L.displayLabel?L.displayLabel:M),P=this.groupedTablesByObject.get(S.rowId),R=L?.type==="table"?"table":L?.type==="booth"?"booth":"seat",T=I,x=C?.displayType?.trim()||(L&&"displayType"in L&&typeof L.displayType=="string"&&L.displayType.trim()?L.displayType.trim():void 0),E=S.displayLabel??S.label,B=E.split("-"),W=P||S.kind==="booth"?void 0:I&&E.startsWith(`${I}-`)?E.slice(I.length+1):B[B.length-1]??E;this.seatContext.set(S.id,{objectId:S.rowId,objectType:R,sectionLabel:h.get(c.objectToSection.get(S.rowId)??""),rowLabel:T,seatNumber:W,...x?{displayType:x,rowType:x}:{}})}for(let S of this.groupedTablesByLabel.values()){let L=S.chairs[0];L&&(this.labelToId.set(S.label,L.id),this.labelToSeat.set(S.label,L))}s.normalizeBuyerModel=o(a);let u=r.event.currency??this.opts.currency;this.currency=u??"USD";let p=performance.now(),m=Uo(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:u,onSelect:S=>{this.handleRendererSelect(S)},onDeselect:S=>{this.handleRendererDeselect(S)},onSelectionLimit:this.opts.onSelectionLimit,onHover:S=>{this.opts.onHover?.(S),this.opts.onSeatHover&&this.opts.onSeatHover(S?this.describeSeat(S):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:S=>this.handleSectionTap(S),onDeckTap:S=>this.handleDeckTap(S),onFps:this.opts.onFps});if(s.createRenderer=o(p),this.closed)return m.destroy(),null;this.renderer=m;let f=null,g="free",d=[],y=performance.now();try{let S=await this.api.objects(this.key);this.hidden=new Set(S.hidden??[]),d=(S.closed??[]).filter(L=>typeof L=="string"),f=S.seats,g=S.default??"free"}catch{}if(s.loadStatuses=o(y),this.closed)return m.destroy(),this.renderer=null,null;let b=performance.now();m.setChart(this.visibleDoc()),(r.doc.floors?.length??0)>1&&m.setFloorOverview?.(!0),this.opts.colorblindSafe&&m.setColorblindSafe?.(!0),s.buildScene=o(b),this.closedSections=new Set(d);let v=performance.now();d.length&&m.setClosedSections?.(d),f&&this.applySeatsMap(f,g),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),s.applyInitialState=o(v);let w=performance.now();m.forceDraw(),s.firstPaint=o(w);let k=performance.now();return this.attachVisibilityListener(),this.connect(),s.startRealtime=o(k),s.controllerTotal=o(t),{doc:r.doc,salesClosed:!!r.event.salesClosed,eventName:r.event.name,venue:r.event.venue,startsAt:r.event.startsAt,timezone:r.event.timezone??null,currency:u,mode:r.event.mode??"live",locale:r.event.locale??null,posterUrl:r.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 ge(ai(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 or(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&&ni(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,u)=>h+(u.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 ge(ai([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 ge(a);if(this.hold_&&this.holdCovers(n))return this.hold_;try{let l=n.map(h=>{let u=r.find(f=>f.label===h);if(u)return{label:h,tierId:u.tierId,quantity:u.quantity};let p=this.labelToSeat.get(h),m=p?this.toSeat(p):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 Jo({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?Qo(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(jo(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,s={}){let o=this.visibleDoc();if(!o||!Number.isFinite(t)||t<1)return null;let r=We(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(ti(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(p=>!n.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")continue;let m=this.labelToId.get(p.label);((m?this.getStatus(m):void 0)??"free")==="free"&&c.add(p.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(p=>this.labelToSeat.get(p)?.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 u=this.labelToSeat.get(h),p=u?this.toSeat(u):null;return{label:h,...p?.tierId?{tierId:p.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 ge(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(u=>{let p=this.labelToSeat.get(u),m=p?this.toSeat(p):null;return{label:u,...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:u,reason:p}=lt(c);if(this.clearHold(),h===409&&p==="event_closed")this.opts.onSalesClosed?.();else if(h===409&&u?.length){let m=new Set(u.map(d=>d.label)),f=this.idsForLabels(m);f.length&&(o.setStatus(f,"booked"),o.deselect(f),this.resetTableQuantitiesForLabels(m));let g=r.filter(d=>!m.has(d));g.length&&a&&this.api.release(this.key,g,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 g=this.seatById.get(f);if(!g)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(g.categoryKey,(n.get(g.categoryKey)??0)+1),t.getStatus(f)==="free"&&l++}let c=[...n.entries()].map(([f,g])=>{let d=s.categories.find(w=>w.key===f),y=d?.tiers?.length?d.tiers.map(w=>w.price):[d?.price??0],b=Math.min(...y),v=Math.max(...y);return{key:f,count:g,label:d?.label??f,color:d?.color??"#6e7bff",price:b,priceMin:b,priceMax:v}}).sort((f,g)=>f.price-g.price),h=c.map(f=>f.priceMin),u=c.map(f=>f.priceMax),p=o.zone?s.zones?.find(f=>f.id===o.zone):void 0,m=o.color??p?.color??c[0]?.color??"#6e7bff";return{id:e,label:o.displayLabel??o.label,zoneLabel:p?.label??"",...o.entrance&&o.entrance.trim()?{entrance:o.entrance.trim()}:{},color:m,seatsLeft:l,priceMin:h.length?Math.min(...h):0,priceMax:u.length?Math.max(...u):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"?U("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?ni(this.seatById.values(),r=>e.getStatus(r),s):[]).length>0?(this.hintShown=!0,this.opts.onHint(U("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=Kt(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[Kt(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=Kt(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=Zo(e,{baseMs:1e3,maxMs:An,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var Bn=5,Fn=-1.1,Bi=35;function Fi(i,e){let t=i-q,s=Math.atan2(Bn-t,e)*180/Math.PI,o=Math.atan2(Fn-t,e)*180/Math.PI;return o<-Bi&&(s+=-Bi-o,o=-Bi),{topPitch:s,basePitch:o}}var X=2048,ce=1024,ht=Wi,A=Math.PI*2,Dn=ce/180,Ne=i=>(i+180)/360*X,N=i=>(90-i)/180*ce;function hr(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 dr(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 $t=96,Oi=360/$t,_n=.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 nr(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 Q(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 ar=new Map;function lr(i){if(!i)return null;let e=ar.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=Q(s,.3,.42);return ar.set(i,o),o}function On(i,e,t,s){let o=new Array($t).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,u=Math.hypot(c,h)*ht;if(u<1.5||u>95)continue;let p=a.eyeHeightM??q,m=p-s;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,u)*180/Math.PI,g=Math.atan2(p-q-s,u)*180/Math.PI,y=((Math.atan2(c,-h)-t)*180/Math.PI+540)%360-180,b=Math.min($t-1,Math.max(0,Math.floor((y+180)/Oi))),v=f>34&&u<16,w=o[b];w?(f>w.top&&(w.top=f),g<w.base&&(w.base=g),u<w.nearM&&(w.nearM=u,w.tint=lr(a.categoryKey)),w.overhead=w.overhead||v):o[b]={top:f,base:g,nearM:u,overhead:v,tint:lr(a.categoryKey)}}return{bins:o,maxDelta:r}}function Gn(i,e,t,s){for(let o=0;o<$t;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),u=s(c),p=s(h);if(p<=u)continue;let m=r.nearM/95,f=r.tint,g=f?nr([44,54,80],f,.34):[44,54,80],d=f?nr([24,30,48],f,.28):[24,30,48],y=i.createLinearGradient(0,u,0,p);y.addColorStop(0,_i(g,m)),y.addColorStop(.24,_i(d,m)),y.addColorStop(1,_i([10,13,22],m)),i.fillStyle=y,i.fillRect(a,u,l-a+1,p-u),i.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,i.fillRect(a,u,l-a+1,1.5);let v=Math.min(p,s(0))-u;if(v>8){let k=1-m*.4;for(let S=1;S<6;S++){let L=u+v*S/6;i.fillStyle=`rgba(0,0,0,${.16*k})`,i.fillRect(a,L,l-a+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*k})`,i.fillRect(a,L+1.5,l-a+1,1.2)}}if(r.overhead){let w=s(Math.min(86,c+12)),k=i.createLinearGradient(0,w,0,u);k.addColorStop(0,"rgba(3,4,8,0.9)"),k.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=k,i.fillRect(a,w,l-a+1,u-w),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(a,u-1.5,l-a+1,1.5)}}}function Hn(i,e,t){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),n=new Set,a=0;for(let y of t){a++,y.sectionId&&n.add(y.sectionId);let b=y.x-e.x,v=y.y-e.y,w=Math.hypot(b,v)*ht;if(w<.5)continue;let k=Math.atan2(b,-v),S=Math.floor((k+Math.PI)/A*72);S<0?S=0:S>=72&&(S=71),o[S]=!0,w<r[S]&&(r[S]=w)}let l=0,c=[];for(let y=0;y<72;y++)o[y]&&(l++,c.push(r[y]));let h=l/72*360;c.sort((y,b)=>y-b);let u=c.length?c[c.length>>1]:0,p=c.length?c[Math.floor(c.length*.15)]??u:0,m=c.length?c[Math.floor(c.length*.85)]??u:0,f=p>.5?m/p:1,g=hr(`${a}|${[...n].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),d;return h>=300&&u>11&&f>1.35?d="sport":h>=285?d="arena":d="proscenium",{mode:d,seed:g,voidRadiusM:u,aspect:f}}var Nn=5;function Vn(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 zn(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})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;i.save(),i.translate(e,t);let p=o.lean*s;i.fillStyle=h,i.beginPath(),i.moveTo(-r,a),i.quadraticCurveTo(-r*1.18,l-p-s*.6,-n,l-p),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+p),i.quadraticCurveTo(r*1.18,l+p-s*.6,r,a),i.closePath(),i.fill(),i.fillStyle=u,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=u,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()),Vn(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 Wn(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,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,p=i.createRadialGradient(e,t,1,e,t,s*.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,s*.24,s*.24,0,0,A),i.fill(),i.restore(),i.fillStyle=u,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=u,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=u,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=u,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 Yt(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 ld(i,e,t){let s=document.createElement("canvas");s.width=X,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??q,h=Hn(i,e,t),u=dr(h.seed),p=210+u()*150,m=Q(220+(u()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,g=o.createLinearGradient(0,0,0,ce);g.addColorStop(0,"#080b12"),g.addColorStop(.42,"#12182c"),g.addColorStop(.5,"#1c2440"),g.addColorStop(.56,"#151b2c"),g.addColorStop(.78,"#171e30"),g.addColorStop(1,"#131829"),o.fillStyle=g,o.fillRect(0,0,X,ce);let d=o.createLinearGradient(0,N(-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,N(-6),X,ce-N(-6));let y=Math.atan2(r,-n),b=On(i,t,y,c),v=b.maxDelta>=_n;v&&Gn(o,b.bins,Ne,N);let w=Math.max(.3,Math.min(1,1-(l-6)/60)),k=Fi(c,l),S=Math.min(80,Math.atan2(4,l)*180/Math.PI),L=Math.min(45,k.topPitch),M=k.basePitch;h.mode==="sport"?$n(o,l,c,h,w,p,f,u):h.mode==="arena"?Xn(o,l,c,h,w,f,u):Kn(o,S,L,M,w,p,f,u);let C=h.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${f},0.8)`;for(let P=0;P<C;P++){let R=(P+.5)/C*X,T=N(h.mode==="sport"?58:54+P*7%3*6);o.beginPath(),o.arc(R,T,h.mode==="sport"?2.6:3.2,0,A),o.fill()}Yn(o,i,t,e,y,c,r,n,v,h);let I=o.createLinearGradient(0,0,0,ce);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)"),o.fillStyle=I,o.fillRect(0,0,X,ce),{url:s.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function Kn(i,e,t,s,o,r,n,a){let l=Ne(-e),c=Ne(e),h=N(t),u=N(s),p=c-l,m=u-h,f=N(Math.min(50,t+10)),g=p*(1.1+(1-o)*.5),d=i.createRadialGradient(X/2,(h+u)/2,8,X/2,(h+u)/2,g);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-p*.6,h-m*1.2,p*2.2,m*3.4);let y=Q(r,.62,.55),b=Q(r+40,.7,.5),v=Q(r+70,.78,.52);i.save(),i.beginPath(),i.rect(l,h,p,m),i.clip();let w=i.createLinearGradient(0,h,0,u);w.addColorStop(0,`rgb(${y[0]},${y[1]},${y[2]})`),w.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),w.addColorStop(1,`rgb(${v[0]},${v[1]},${v[2]})`),i.globalAlpha=.8,i.fillStyle=w,i.fillRect(l,h,p,m),i.globalAlpha=1;let k=i.createRadialGradient(X/2,(h+u)/2,p*.12,X/2,(h+u)/2,p*.62);k.addColorStop(0,"rgba(6,8,14,0)"),k.addColorStop(.7,"rgba(6,8,14,0.15)"),k.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=k,i.fillRect(l,h,p,m),i.restore();let S=3+Math.floor(a()*3),L=m*.46,M=u-m*.08;for(let B=0;B<S;B++){let W=(B+1)/(S+1),z=l+p*(.22+W*.56+(a()-.5)*.06);Hi(i,z,M,L*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:Q(r+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(l-p*.5,f,p*.5,u-f),i.fillRect(c,f,p*.5,u-f);let C=p*.055+3,I=C*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(l,u),i.lineTo(l-C,u),i.lineTo(l-I,f),i.lineTo(l+p*.012,f),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,u),i.lineTo(c+C,u),i.lineTo(c+I,f),i.lineTo(c-p*.012,f),i.closePath(),i.fill(),i.fillRect(l-I,f,p+I*2,(u-f)*.12);let P=m*.14,R=f+(u-f)*.12;i.fillStyle="rgba(4,6,12,0.96)";let T=7;i.beginPath(),i.moveTo(l-I,R);for(let B=0;B<=T;B++){let W=l-I+(p+I*2)*B/T;i.quadraticCurveTo(W-(p+I*2)/T/2,R+P,W,R)}i.lineTo(c+I,R),i.lineTo(c+I,f),i.lineTo(l-I,f),i.closePath(),i.fill(),i.fillStyle=`rgba(${n},0.12)`,i.fillRect(l-1.5,R,1.5,u-R),i.fillRect(c,R,1.5,u-R),i.fillStyle="#0b0f18",i.fillRect(l-C,u-m*.05,p+C*2,m*.05+3);let x=i.createLinearGradient(0,u-m*.05,0,u+m*.12);x.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),x.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=x,i.fillRect(l-C,u-m*.05,p+C*2,m*.2);let E=3+Math.floor(a()*2);for(let B=0;B<E;B++){let W=(B+1)/(E+1),z=l+p*(W+(a()-.5)*.08),V=N(Math.min(62,t+26)),j=(a()-.5)*p*.16;Yt(i,z,V,z+j,u,4,p*.09,n,.16*(.7+o*.5)),Ni(i,z,V,2.4,n)}}function Xn(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=X/2,h=1.2,u=Math.max(e*.45,e-a),p=e+a,m=Math.atan2(h-t,u)*180/Math.PI,f=Math.atan2(h-t,p)*180/Math.PI,g=Math.atan2(-t,u)*180/Math.PI,d=N(m),y=N(f),b=N(g),v=Ne(l)-c,w=Math.max(6,(d-y)/2),k=(d+y)/2,S=i.createRadialGradient(c,b,4,c,b,v*2.6);S.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),S.addColorStop(.5,"rgba(150,140,190,0.08)"),S.addColorStop(1,"rgba(40,44,60,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=S,i.fillRect(c-v*2.6,y-w,v*5.2,b-y+w+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-v,k),i.ellipse(c,k,v,w,0,Math.PI,0,!1),i.lineTo(c+v,b),i.ellipse(c,b,v,w,0,0,Math.PI,!1),i.closePath(),i.fill();let L=i.createLinearGradient(0,k,0,b);L.addColorStop(0,`rgba(${r},0.14)`),L.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=L,i.fillRect(c-v,k,v*2,b-k);let M=[[{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}]],C=M[Math.floor(n()*M.length)],I=n()<.5?-1:1,P=D=>c+D.u*I*v*.84,R=D=>k+D.v*w*.8,T=C.find(D=>D.lead)??C[0],x=P(T),E=i.createLinearGradient(0,k-w,0,k+w);E.addColorStop(0,"#3d4a72"),E.addColorStop(1,"#232b47"),i.fillStyle=E,i.beginPath(),i.ellipse(c,k,v,w,0,0,A),i.fill();let B=i.createRadialGradient(x,k,2,x,k,v);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,k,v,w,0,0,A),i.fill(),i.restore(),i.strokeStyle=`rgba(${r},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,k,v,w,0,0,A),i.stroke();let W=Math.max(24,(b-y)*1.3),z=C.length>=3?3:2;for(let D=0;D<z;D++){let he=(-.62+D*.52+(n()-.5)*.12)*-I,be=c+he*v*.7,Ve=k-w*(.45+n()*.18),Me=v*(.07+n()*.04),Jt=W*(.26+n()*.12);i.fillStyle="#0a0e18",i.fillRect(be-Me/2,Ve-Jt,Me,Jt),i.fillStyle=`rgba(${r},0.3)`,i.fillRect(be-Me/2,Ve-Jt,Me,1.5)}if(C.length>=3){let D=c-T.u*I*v*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(D,k-w*.34,v*.08,w*.1,0,0,A),i.fill(),i.strokeStyle=`rgba(${r},0.35)`,i.lineWidth=1,i.stroke()}for(let D of[...C].sort((he,be)=>he.v-be.v)){let he=.82+(D.v+1)*.14;Hi(i,P(D),R(D),W*he*(D.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:D.pose,rim:Q(40,.72,.8),rimStrength:D.lead?1.4:.9})}let V=N(Math.min(60,f+34)),j=w*1.1+6;i.strokeStyle="rgba(60,68,92,0.85)",i.lineWidth=3,i.beginPath(),i.ellipse(c,V,v*1.15,j,0,0,A),i.stroke();let F=4+Math.floor(n()*3);for(let D=0;D<F;D++){let he=D/F*A,be=c+Math.cos(he)*v*1.15,Ve=V+Math.sin(he)*j;if(Math.sin(he)>-.2){let Me=c+(n()-.5)*v*.8;Yt(i,be,Ve,Me,k,3,v*.32,r,.2*(.7+o*.4))}Ni(i,be,Ve,3,r)}let _=N(Math.min(52,f+24)),O=Math.max(60,v*.4),$=Math.max(24,O*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-O*.3,_-$/2),i.lineTo(c-O*.16,_-$*2.2),i.moveTo(c+O*.3,_-$/2),i.lineTo(c+O*.16,_-$*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-O/2,_-$/2,O,$);let Ut=i.createLinearGradient(0,_-$*.3,0,_+$*.42);Ut.addColorStop(0,`rgba(${r},0.5)`),Ut.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=Ut,i.fillRect(c-O*.42,_-$*.3,O*.84,$*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-O/2,_+$/2-2,O,2);let Zt=i.createRadialGradient(c,_,4,c,_,O*1.1);Zt.addColorStop(0,`rgba(${r},0.2)`),Zt.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=Zt,i.fillRect(c-O*1.1,_-O*.8,O*2.2,O*1.6);let Qt=i.createRadialGradient(c,(V+k)/2,6,c,(V+k)/2,v*1.5);Qt.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),Qt.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=Qt,i.fillRect(c-v*1.5,V-40,v*3,k-V+80),i.restore();let ur=c+Math.sign(x-c||1)*v*.5;Yt(i,ur,V-j*.4,x,R(T),2.5,v*.16,"255,224,178",.42*(.7+o*.4));let jt=i.createRadialGradient(x,R(T),1,x,R(T),v*.2);jt.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),jt.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=jt,i.beginPath(),i.ellipse(x,R(T),v*.2,w*.24,0,0,A),i.fill(),i.restore()}function $n(i,e,t,s,o,r,n,a){let l=X/2,c=Math.max(10,s.voidRadiusM),h=Math.max(2,e-c),u=e+c,p=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),m=Math.atan2(-t,h)*180/Math.PI,f=Math.atan2(-t,u)*180/Math.PI,g=N(m),d=N(f),y=Ne(p)-l,b=(g+d)/2,v=Math.max(10,(g-d)/2),w=i.createRadialGradient(l,b,4,l,b,y);w.addColorStop(0,"#e8f0fb"),w.addColorStop(.7,"#b9c9e2"),w.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(l,b,y,v,0,0,A),i.clip(),i.fillStyle=w,i.fillRect(l-y,b-v,y*2,v*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(l,b-v),i.lineTo(l,b+v),i.moveTo(l-y*.5,b-v),i.lineTo(l-y*.5,b+v),i.moveTo(l+y*.5,b-v),i.lineTo(l+y*.5,b+v),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(l,b,v*.9,v*.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,y,v,0,0,A),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let P=0;P<5;P++){let R=l+(a()-.5)*y*1.4,T=b+(a()-.5)*v*1.1,x=Math.max(2,v*.06);i.beginPath(),i.ellipse(R,T,x*.6,x,0,0,A),i.fill()}let k=i.createRadialGradient(l,b,4,l,b,y*1.4);k.addColorStop(0,"rgba(200,220,255,0.12)"),k.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=k,i.fillRect(l-y*1.4,d-v,y*2.8,g-d+v*2),i.restore();let S=N(Math.min(66,f+60)),L=Math.max(80,y*.7),M=L*.5,C=i.createRadialGradient(l,S,4,l,S,L*1.6);C.addColorStop(0,`rgba(${n},0.3)`),C.addColorStop(1,`rgba(${n},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=C,i.fillRect(l-L*1.6,S-L*1.2,L*3.2,L*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(l-L/2,S-M/2),i.lineTo(l+L/2,S-M/2),i.lineTo(l+L*.6,S),i.lineTo(l+L/2,S+M/2),i.lineTo(l-L/2,S+M/2),i.lineTo(l-L*.6,S),i.closePath(),i.fill();let I=r;for(let P=0;P<3;P++){let R=Q(I+P*30,.5,.5);i.fillStyle=`rgba(${R[0]},${R[1]},${R[2]},0.75)`;let T=L*.26;i.fillRect(l-L*.42+P*(T+L*.06),S-M*.32,T,M*.64)}i.fillStyle=`rgba(${n},0.9)`;for(let P=0;P<8;P++){let R=l-L*.6+L*1.2*P/7;i.beginPath(),i.arc(R,S+M*.62,2.4,0,A),i.fill()}}function Yn(i,e,t,s,o,r,n,a,l,c){let h=e.sectionId,u=!1,p=[];for(let g of t){if(g.id===e.id)continue;let d=g.x-e.x,y=g.y-e.y,b=Math.hypot(d,y)*ht;if(h&&g.sectionId===h&&b<3&&d*n+y*a>0&&(u=!0),b<.3||b>32)continue;let w=((Math.atan2(d,-y)-o)*180/Math.PI+540)%360-180,k=l?(g.eyeHeightM??q)-r:0,S=Math.atan2(k-.28,b)*180/Math.PI;if(S>10&&b>5)continue;let L=0;for(let I=0;I<g.id.length;I++)L=L*31+g.id.charCodeAt(I)&65535;let M=.9+(L&15)/40,C=Math.min(78,Math.atan2(.16,b)*180/Math.PI*Dn*M);C<1.2||p.push({hx:Ne(w),hy:N(S),r:C,d:b,hash:L})}p.sort((g,d)=>d.d-g.d);let m=[];{let g=[...p].sort((b,v)=>b.hy-v.hy),d=[],y=()=>{if(!d.length)return;let b=d.reduce((k,S)=>k+S.d,0)/d.length,v=d.reduce((k,S)=>k+S.hy,0)/d.length,w=d.reduce((k,S)=>k+S.r,0)/d.length;m.push({figs:d.sort((k,S)=>S.d-k.d),d:b,hy:v,r:w}),d=[]};for(let b of g){let v=d[d.length-1];v&&Math.abs(b.hy-v.hy)>Math.max(5,(v.r+b.r)/2*1.7)&&y(),d.push(b)}y()}m.sort((g,d)=>d.d-g.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let g of m){if(g.figs.length>=3&&g.r>=1.6&&g.r<26){let d=[],y=[...g.figs].sort((w,k)=>w.hx-k.hx),b=[];for(let w of y){let k=b[b.length-1];k&&w.hx-k.hx>Math.max(14,w.r*7)&&(b.length>=3&&d.push(b),b=[]),b.push(w)}b.length>=3&&d.push(b);let v=Math.min(.42,.5*(1-g.d/42));if(v>.05){i.fillStyle=`rgba(15, 19, 31, ${v.toFixed(3)})`;for(let w of d){let k=w[0].hx-g.r*1.6,S=w[w.length-1].hx+g.r*1.6;i.beginPath(),i.roundRect(k,g.hy+g.r*.8,S-k,g.r*2.4,g.r*.8),i.fill()}}}for(let d of g.figs){let y=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),v=[14+(d.hash>>4&6)+b,17+(d.hash>>4&6)+b,25+(d.hash>>4&6)+b],w=f[d.hash%f.length],k=[w[0]+b,w[1]+b,w[2]+b];if(d.r>=13){let S=d.d<9?.16*(1-d.d/9)+(c.mode==="proscenium"?.06:0):0;zn(i,d.hx,d.hy,d.r,{tone:v,clothing:k,alpha:y,tilt:((d.hash>>2&7)-3.5)*.018,shoulderK:1.72+(d.hash>>5&7)/22,hair:d.hash%Nn,rim:S,turn:((d.hash>>8&7)-3.5)*.034,lean:((d.hash>>10&3)-1.5)*.09})}else d.r>=5.5?Wn(i,d.hx,d.hy,d.r,k,v,y):(i.fillStyle=`rgba(${v[0]},${v[1]},${v[2]},${y.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(u){let g=N(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,g,X,ce-g),i.fillStyle="rgba(24, 30, 46, 0.9)";let d=16;for(let y=0;y<d;y++){let b=(y+.5)/d*X;i.beginPath(),i.ellipse(b,g+6,X/d*.42,22,0,Math.PI,0,!0),i.fill()}}}var ee=480,He=270,Gi=50,Ie=30,cr=i=>(i+Gi)/(2*Gi)*ee,ct=i=>(Ie-i)/(2*Ie)*He;function cd(i,e,t){let s=document.createElement("canvas");s.width=ee,s.height=He;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=dr(hr(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,h=Q(220+(l()-.5)*60,.55,.82),u=`${h[0]},${h[1]},${h[2]}`,p=o.createLinearGradient(0,0,0,He);p.addColorStop(0,"#080b12"),p.addColorStop(.44,"#151c32"),p.addColorStop(.5,"#1d2644"),p.addColorStop(.58,"#161c2e"),p.addColorStop(1,"#131829"),o.fillStyle=p,o.fillRect(0,0,ee,He);let m=i.eyeHeightM??q,f=Fi(m,a),g=Math.min(Gi-2,Math.atan2(4,a)*180/Math.PI),d=Math.min(Ie-2,f.topPitch),y=Math.max(-Ie+2,f.basePitch),b=cr(-g),v=cr(g),w=ct(d),k=ct(y),S=v-b,L=k-w,M=Math.max(.35,Math.min(1,1-(a-6)/60)),C=ct(Math.min(Ie-1,d+8)),I=o.createRadialGradient(ee/2,(w+k)/2,4,ee/2,(w+k)/2,S*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)"),o.fillStyle=I,o.fillRect(b-S*.6,w-L*1.2,S*2.2,L*3.4);let P=Q(c,.62,.55),R=Q(c+40,.7,.5),T=Q(c+70,.78,.52);o.save(),o.beginPath(),o.rect(b,w,S,L),o.clip();let x=o.createLinearGradient(0,w,0,k);x.addColorStop(0,`rgb(${P[0]},${P[1]},${P[2]})`),x.addColorStop(.5,`rgb(${R[0]},${R[1]},${R[2]})`),x.addColorStop(1,`rgb(${T[0]},${T[1]},${T[2]})`),o.globalAlpha=.8,o.fillStyle=x,o.fillRect(b,w,S,L),o.globalAlpha=1;let E=o.createRadialGradient(ee/2,(w+k)/2,S*.12,ee/2,(w+k)/2,S*.6);E.addColorStop(0,"rgba(6,8,14,0)"),E.addColorStop(.7,"rgba(6,8,14,0.15)"),E.addColorStop(1,"rgba(5,6,11,0.9)"),o.fillStyle=E,o.fillRect(b,w,S,L),o.restore();let B=3,W=k-L*.08;for(let F=0;F<B;F++){let _=(F+1)/(B+1);Hi(o,b+S*(.24+_*.52),W,L*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:Q(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(b-S*.5,C,S*.5,k-C),o.fillRect(v,C,S*.5,k-C);let z=S*.05+2,V=z*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(b,k),o.lineTo(b-z,k),o.lineTo(b-V,C),o.lineTo(b+S*.012,C),o.closePath(),o.fill(),o.beginPath(),o.moveTo(v,k),o.lineTo(v+z,k),o.lineTo(v+V,C),o.lineTo(v-S*.012,C),o.closePath(),o.fill(),o.fillRect(b-V,C,S+V*2,(k-C)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(b-1.2,C,1.2,k-C),o.fillRect(v,C,1.2,k-C),o.fillStyle="#0b0f18",o.fillRect(b-z,k-L*.05,S+z*2,L*.05+2);let j=o.createLinearGradient(0,k-L*.05,0,k+L*.14);j.addColorStop(0,`rgba(255,206,140,${(.5*M).toFixed(3)})`),j.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=j,o.fillRect(b-z,k-L*.05,S+z*2,L*.22);for(let F=0;F<3;F++){let _=(F+1)/4,O=b+S*_,$=ct(Math.min(Ie-1,d+20));Yt(o,O,$,O+(l()-.5)*S*.14,k,3,S*.09,u,.17*M),Ni(o,O,$,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let F=0;F<8;F++)o.beginPath(),o.arc((F+.5)/8*ee,ct(Ie-4-F%2*3),2.2,0,A),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,He-26,ee,26),o.fillStyle="rgba(30,37,54,0.9)";for(let F=0;F<9;F++){let _=F*(ee/9)+ee/18;o.beginPath(),o.ellipse(_,He-22,ee/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:s.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var pr=new Set(["en"]),qt=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 ud(i,e){let t=Fs(i,e);if(t==="en"||pr.has(t))return Ee(t),t;if(!Bs.includes(t))return Ee("en"),"en";try{let s=qt.get(t);s||(s=qn(t),qt.set(t,s));let o=await s;return qt.delete(t),o?(Ee(t,o),pr.add(t),t):(Ee("en"),"en")}catch{return qt.delete(t),Ee("en"),"en"}}export{jn as ACCESSIBILITY_RING_COLOR,Zn as ACCESSIBILITY_TYPES,Un as CHART_STORAGE_KEY,$a as CURRENCY_CHOICES,Xa as DEFAULT_CURRENCY,na as EVENT_CONFIGURATION_EXPORT_SCHEMA,ra as EVENT_CONFIGURATION_SCHEMA,ia as LABEL_STYLE_MAX_SIZE,ta as LABEL_STYLE_MIN_SIZE,el as LOCALE_NAMES,Aa as MAX_EVENT_INVENTORY,Ea as MAX_GA_CAPACITY,rr as PickerController,ge as PickerSelectionError,Na as RENDERED_QUALITY_REPORT_VERSION,Jn as SEAT_COMMERCIAL_MARKS,Sr as SUPPORTED_LOCALES,sa as SURROUNDINGS_SHAPE_ROLES,Ei as SeatmapRenderer,ma as TABLE_SEAT_OFFSET,fa as TIER_HEIGHT_M,Bs as TRANSLATED_LOCALES,Qi as UNGROUPED_ID,Qn as accessibilityMeta,ei as accessibilityRingColor,Xi as allObjects,ji as applyHidden,da as canTransitionEventConfiguration,ca as canonicalEventConfigurationJson,Zi as chartBounds,ti as computeSections,Uo as createRenderer,gr as currencyExponent,qa as currencySymbol,Ta as expandBooth,ze as expandChart,Sa as expandRow,ba as expandRowSlots,La as expandTable,ka as expandTableSlots,Pa as floorObjects,Ra as floorOverviewTranslations,ut as floorsOf,qi as floorsShareFootprint,nl as formatDate,Ya as formatMinor,ci as formatMoney,br as fromMinorUnits,We as gaAreasOf,Da as gaInventorySegments,Ba as gaUnitLabel,ft as gaUnitLabels,ld as generateSeatPanorama,cd as generateSeatThumb,tl as getLocale,_a as growJoinedGAInventory,Ha as hiddenObjectIds,ha as inspectEventConfigurationCompatibility,Va as inspectRenderedQualityEvidence,Oa as isGaUnitLabel,sl as isLocaleLoaded,Ga as isSectionHidden,oa as layerOf,Yi as layoutFloorOverview,Ui as layoutFloorRings,ud as loadLocale,il as localeDirection,ua as migrateLegacyEventConfigurations,Ia as objectCenter,Ma as owningSectionForObject,la as parseEventConfigurationExport,aa as parseEventConfigurationVersion,Ca as pointInPolygon,te as pointInPolygonWithHoles,pt as polygonLabelPoint,pa as resolveEventConfigurationRollback,Fs as resolveLocale,ga as rowInventoryCount,ya as rowSeatPositions,ea as seatCommercialMeta,dt as sectionGeometry,Ee as setLocale,As as setMoneyLocale,ol as setStringOverrides,$i as stackFloors,U as t,rl as tCount,wa as tableInventoryCount,va as tableSeatCountsBySide,xa as translateObject,Fa as validGAInventorySegments};